JNDemo/src/main/java/com/JN/demo/jnzmquatation/controller/JNController.java

96 lines
3.0 KiB
Java
Raw Normal View History

2024-02-26 08:31:53 +08:00
package com.JN.demo.jnzmquatation.controller;
import com.JN.common.R;
2024-02-26 08:57:27 +08:00
import com.JN.demo.jnzmquatation.dto.JnInventoryDto;
import com.JN.demo.jnzmquatation.dto.JnMaterialDto;
import com.JN.demo.jnzmquatation.dto.JnRegionDto;
import com.JN.demo.jnzmquatation.service.JnInventoryService;
import com.JN.demo.jnzmquatation.service.JnMaterialService;
import com.JN.demo.jnzmquatation.service.JnRegionService;
2024-02-26 08:31:53 +08:00
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
2024-02-26 08:57:27 +08:00
* @ClassName JNController
2024-02-26 08:31:53 +08:00
* @Description TODO
* @Author JIAL
* @Date 2024/2/19 8:47
* @Version 1.0
*/
@RestController
@Slf4j
@RequestMapping("/jnquotation")
public class JNController {
2024-02-26 08:57:27 +08:00
@Autowired
JnRegionService regionService;
@Autowired
JnMaterialService materialService;
@Autowired
JnInventoryService inventoryService;
/**
* @title queryRegionList
* @description 查询地区列表信息
* @author JIAL
* @param: regionName
* @updateTime 2024/2/20 16:54
* @return: com.JN.common.R<java.util.List<com.JN.demo.zmquotation.dto.RegionDto>>
*/
@PostMapping("/regionList")
public R queryRegionList(@RequestParam("regionName") String regionName){
List<JnRegionDto> regionList = regionService.queryRegionListByName(regionName);
log.info("查询到的地区列表结果是:{}", regionList);
return R.success(regionList);
}
/**
* @title queryMaterialList
* @description 查询物料信息
* @author JIAL
* @param: precMaterialName
* @param: vagueMaterialName
* @param: vagueModel
* @updateTime 2024/2/20 16:54
* @return: com.JN.common.R<java.util.List<com.JN.demo.zmquotation.dto.MaterialDto>>
*/
@PostMapping("/materialList")
public R queryMaterialList(@RequestParam("precMaterialName") String precMaterialName,
@RequestParam("vagueMaterialName") String vagueMaterialName,
@RequestParam("vagueModel") String vagueModel) {
List<JnMaterialDto> materialList = materialService.queryMaterialListByParam(precMaterialName, vagueMaterialName, vagueModel);
/* Map<String, Object> result = new HashMap<>();
result.put("rows", materialList);
result.put("total", materialNum);*/
return R.success(materialList);
}
/**
* @title queryInventoryList
* @description 获取盘具列表
* @author JIAL
* @updateTime 2024/2/22 10:09
* @return: com.JN.common.R<java.util.List<com.JN.demo.zmquotation.dto.InventoryDto>>
*/
@PostMapping("/inventoryList")
public R queryInventoryList() {
List<JnInventoryDto> inventoryList = inventoryService.queryInventoryList();
2024-02-26 08:31:53 +08:00
2024-02-26 08:57:27 +08:00
return R.success(inventoryList);
}
2024-02-26 08:31:53 +08:00
}