库存平面图
This commit is contained in:
@@ -7,6 +7,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -23,6 +24,7 @@ public class TwinController {
|
||||
@Autowired
|
||||
private ITwinService twinService;
|
||||
|
||||
//获取所有货位
|
||||
@Anonymous
|
||||
@GetMapping("/getEmptyCargoSpace")
|
||||
public AjaxResult getEmptyCargoSpace() {
|
||||
@@ -30,10 +32,25 @@ public class TwinController {
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
//获取统计信息
|
||||
@Anonymous
|
||||
@GetMapping("/getStockList")
|
||||
public Map<String, Object> getStockList() {
|
||||
return twinService.getStockListOverview();
|
||||
}
|
||||
|
||||
//根据货位号获取库存中的物料信息
|
||||
@Anonymous
|
||||
@GetMapping("/getCargo/{cargoSpaceName}")
|
||||
public Map<String, Object> getCargo(@PathVariable("cargoSpaceName") String cargoSpaceName) {
|
||||
return twinService.getCargo(cargoSpaceName);
|
||||
}
|
||||
|
||||
//根据任务号获取作业表中的物料信息
|
||||
@Anonymous
|
||||
@GetMapping("/getTaskCargo/{taskNo}")
|
||||
public Map<String, Object> getTaskCargo(@PathVariable("taskNo") String taskNo) {
|
||||
return twinService.getTaskCargo(taskNo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,5 +4,7 @@ import java.util.Map;
|
||||
|
||||
public interface ITwinService {
|
||||
Map<String, Object> getStockListOverview();
|
||||
Map<String, Object> getCargo(String cargoSpaceName);
|
||||
Map<String, Object> getTaskCargo(String taskNo);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,10 @@ import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
|
||||
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.in.stockinfinish.domain.InStockinFinish;
|
||||
import com.ruoyi.in.stockinfinish.service.IInStockinFinishService;
|
||||
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
||||
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
||||
import com.ruoyi.job.mydojobdetail.service.IMydoJobDetailService;
|
||||
import com.ruoyi.out.outStockoutFinish.domain.OutStockoutFinish;
|
||||
import com.ruoyi.out.outStockoutFinish.service.IOutStockoutFinishService;
|
||||
import com.ruoyi.stock.stock.domain.BasStock;
|
||||
@@ -33,6 +37,10 @@ public class TwinServiceImpl implements ITwinService {
|
||||
private IInStockinFinishService inStockinFinishService;
|
||||
@Autowired
|
||||
private IOutStockoutFinishService outStockoutFinishService;
|
||||
@Autowired
|
||||
private IMydoJobService mydoJobService;
|
||||
@Autowired
|
||||
private IMydoJobDetailService mydoJobDetailService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getStockListOverview() {
|
||||
@@ -250,4 +258,62 @@ public class TwinServiceImpl implements ITwinService {
|
||||
result.put("monthOutStock", monthOutStock);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getCargo(String cargoSpaceName) {
|
||||
BasStock basStock = new BasStock();
|
||||
basStock.setCargoSpaceName(cargoSpaceName);
|
||||
List<BasStock> list = basStockService.selectBasStockList(basStock);
|
||||
List<Map<String, String>> dataList = new ArrayList<>();
|
||||
for (BasStock stock : list) {
|
||||
Map<String, String> dataMap = new HashMap<>();
|
||||
dataMap.put("productId", stock.getProductId());
|
||||
dataMap.put("productName", stock.getProductName());
|
||||
dataMap.put("quantity", stock.getQuantity());
|
||||
dataMap.put("trayCode", stock.getTrayCode());
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("data", dataList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getTaskCargo(String taskNo) {
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setTaskNo(taskNo);
|
||||
List<MydoJob> jobList = mydoJobService.selectMydoJobList(mydoJob);
|
||||
List<Map<String, String>> dataList = new ArrayList<>();
|
||||
if (jobList != null && !jobList.isEmpty()) {
|
||||
MydoJob job = jobList.get(0);
|
||||
String jobId = job.getJobId();
|
||||
String inOrOutStr = job.getInOrOut();
|
||||
int inOrOut = 0;
|
||||
try {
|
||||
inOrOut = Integer.parseInt(inOrOutStr);
|
||||
} catch (Exception e) {
|
||||
// Ignore parse error
|
||||
}
|
||||
|
||||
List<MydoJobDetail> details = mydoJobDetailService.selectMydoJobDetailListByJobId(jobId);
|
||||
for (MydoJobDetail detail : details) {
|
||||
Map<String, String> dataMap = new HashMap<>();
|
||||
dataMap.put("productId", detail.getProductId());
|
||||
dataMap.put("productName", detail.getProductName());
|
||||
|
||||
String quantity = "0";
|
||||
if (inOrOut < 20) {
|
||||
quantity = detail.getInQuantity();
|
||||
} else {
|
||||
quantity = detail.getOutQuantity();
|
||||
}
|
||||
dataMap.put("quantity", quantity);
|
||||
dataMap.put("trayCode", detail.getTrayCode());
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
}
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("data", dataList);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
bs.product_name
|
||||
from bas_cargo_space bcs
|
||||
left join bas_stock bs on bcs.cargo_space_id = bs.cargo_space_id
|
||||
where bcs.status in ('1', '2')
|
||||
where bcs.status in ('1', '2','4')
|
||||
</select>
|
||||
<select id="selectBasCargoSpaceListByRoadway" parameterType="BasCargoSpace" resultMap="BasCargoSpaceResult">
|
||||
select bcs.cargo_space_id, bcs.warehouse_id, bcs.roadway_id, bcs.cargo_space_name,
|
||||
|
||||
Reference in New Issue
Block a user