|
|
@ -311,11 +311,11 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor |
|
|
|
if ("1".equals(dto.getCheckTypeKey())) { |
|
|
|
//查询本部门指定库位下,库存数量大0并且是新件的库存
|
|
|
|
wmsInventories = wmsInventoryService.selByDeptSidAndRackSid(dto.getDeptSid(), dto.getRackSids()); |
|
|
|
} else if ("2".equals(dto.getCheckTypeKey())){ |
|
|
|
} else if ("2".equals(dto.getCheckTypeKey())) { |
|
|
|
//查询本部门下,库存数量大0并且是新件的库存
|
|
|
|
wmsInventories = wmsInventoryService.selByDeptSid(dto.getDeptSid()); |
|
|
|
} |
|
|
|
if (wmsInventories.size() == 0){ |
|
|
|
if (wmsInventories.size() == 0) { |
|
|
|
return rb.setMsg("该库位下没有商品库存信息"); |
|
|
|
} |
|
|
|
String sid = this.insertByDto(dto); |
|
|
@ -395,10 +395,12 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor |
|
|
|
WmsInventoryCheckbillReportDetailsVo wmsInventoryCheckbillReportDetailsVo = new WmsInventoryCheckbillReportDetailsVo(); |
|
|
|
//表头
|
|
|
|
WmsInventoryCheckbill wmsInventoryCheckbill = fetchBySid(sid); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setSid(sid); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setCreateByName(wmsInventoryCheckbill.getCreateByName()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setCreateName(wmsInventoryCheckbill.getCreateByName()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setDeptName(wmsInventoryCheckbill.getDeptName()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setCreateTime(wmsInventoryCheckbill.getCreateTime()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setSuperviseName(wmsInventoryCheckbill.getSuperviseName()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setFinances(wmsInventoryCheckbill.getSuperviseName()); |
|
|
|
//盘点报告备注
|
|
|
|
WmsInventoryCheckbillReport wmsInventoryCheckbillReport = wmsInventoryCheckbillReportService.selByBillSid(sid); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setRemarks(wmsInventoryCheckbillReport.getRemarks()); |
|
|
@ -407,21 +409,25 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor |
|
|
|
//总体盘点情况
|
|
|
|
List<WmsInventoryCheckbillReportSumVo> total = wmsInventoryCheckbillDetailService.reportSum(sid, "total"); |
|
|
|
for (WmsInventoryCheckbillReportSumVo totalSum : total) { |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setBookCountTotal(totalSum.getBookCount()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setBookAmountTotal(totalSum.getBookAmount()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setRealCountTotal(totalSum.getRealCount()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setRealAmountTotal(totalSum.getRealAmount()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setProfitCountTotal(totalSum.getProfitCount()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setProfitAmountTotal(totalSum.getProfitAmount()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setLoseCountTotal(totalSum.getLoseCount()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setLoseAmountTotal(totalSum.getLoseAmount()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setYpNum(totalSum.getYpNum()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setYpMoney(totalSum.getYpMoney()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setPyNum(totalSum.getPyNum()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setPyMoney(totalSum.getPyMoney()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setSpNum(totalSum.getSpNum()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setSpMoney(totalSum.getSpMoney()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setPyNum(totalSum.getPyNum()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setPyMoney(totalSum.getPyMoney()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setPkNum(totalSum.getPkNum()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setPkMoney(totalSum.getPkMoney()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setPsNum(totalSum.getPsNum()); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setPsMoney(totalSum.getPsMoney()); |
|
|
|
} |
|
|
|
//仓库盘点情况
|
|
|
|
List<WmsInventoryCheckbillReportSumVo> ware = wmsInventoryCheckbillDetailService.reportSum(sid, "ware"); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setWare(ware); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setWarehouseStocktakList(ware); |
|
|
|
//库区盘点情况
|
|
|
|
List<WmsInventoryCheckbillReportSumVo> area = wmsInventoryCheckbillDetailService.reportSum(sid, "area"); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setArea(area); |
|
|
|
wmsInventoryCheckbillReportDetailsVo.setArehouseAreaeStocktakList(area); |
|
|
|
return wmsInventoryCheckbillReportDetailsVo; |
|
|
|
} |
|
|
|
|
|
|
@ -433,36 +439,44 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor |
|
|
|
//发起部门
|
|
|
|
map.put("deptName", wmsInventoryCheckbillReportDetailsVo.getDeptName()); |
|
|
|
//发起日期
|
|
|
|
map.put("createTime", wmsInventoryCheckbillReportDetailsVo.getCreateTime()); |
|
|
|
map.put("createTime", DateUtil.formatDate(wmsInventoryCheckbillReportDetailsVo.getCreateTime())); |
|
|
|
//盘点人
|
|
|
|
map.put("pdrName", wmsInventoryCheckbillReportDetailsVo.getCreateByName()); |
|
|
|
//监盘人
|
|
|
|
map.put("jprName", wmsInventoryCheckbillReportDetailsVo.getSuperviseName()); |
|
|
|
map.put("jprName", wmsInventoryCheckbillReportDetailsVo.getFinances()); |
|
|
|
//备注
|
|
|
|
map.put("remarks", wmsInventoryCheckbillReportDetailsVo.getRemarks()); |
|
|
|
//总体应盘数量
|
|
|
|
map.put("ypsl", wmsInventoryCheckbillReportDetailsVo.getBookCountTotal()); |
|
|
|
map.put("ypsl", wmsInventoryCheckbillReportDetailsVo.getYpNum()); |
|
|
|
//总体应盘金额
|
|
|
|
map.put("ypje", wmsInventoryCheckbillReportDetailsVo.getBookAmountTotal()); |
|
|
|
map.put("ypje", wmsInventoryCheckbillReportDetailsVo.getYpMoney()); |
|
|
|
//总体实盘数量
|
|
|
|
map.put("spsl", wmsInventoryCheckbillReportDetailsVo.getRealCountTotal()); |
|
|
|
map.put("spsl", wmsInventoryCheckbillReportDetailsVo.getSpNum()); |
|
|
|
//总体实盘金额
|
|
|
|
map.put("spje", wmsInventoryCheckbillReportDetailsVo.getRealAmountTotal()); |
|
|
|
map.put("spje", wmsInventoryCheckbillReportDetailsVo.getSpMoney()); |
|
|
|
//总体盘盈数量
|
|
|
|
map.put("pysl", wmsInventoryCheckbillReportDetailsVo.getProfitCountTotal()); |
|
|
|
map.put("pysl", wmsInventoryCheckbillReportDetailsVo.getPyNum()); |
|
|
|
//总体盘盈金额
|
|
|
|
map.put("pyje", wmsInventoryCheckbillReportDetailsVo.getProfitAmountTotal()); |
|
|
|
map.put("pyje", wmsInventoryCheckbillReportDetailsVo.getPyMoney()); |
|
|
|
//总体盘亏数量
|
|
|
|
map.put("pksl", wmsInventoryCheckbillReportDetailsVo.getLoseCountTotal()); |
|
|
|
map.put("pksl", wmsInventoryCheckbillReportDetailsVo.getPkNum()); |
|
|
|
//总体盘亏金额
|
|
|
|
map.put("pkje", wmsInventoryCheckbillReportDetailsVo.getLoseAmountTotal()); |
|
|
|
map.put("pkje", wmsInventoryCheckbillReportDetailsVo.getPkMoney()); |
|
|
|
//总体盘损数量
|
|
|
|
map.put("pssl", wmsInventoryCheckbillReportDetailsVo.getLossCountTotal()); |
|
|
|
map.put("pssl", wmsInventoryCheckbillReportDetailsVo.getPsNum()); |
|
|
|
//总体盘损金额
|
|
|
|
map.put("psje", wmsInventoryCheckbillReportDetailsVo.getLossAmountTotal()); |
|
|
|
List<WmsInventoryCheckbillReportSumVo> ware = wmsInventoryCheckbillReportDetailsVo.getWare(); |
|
|
|
map.put("psje", wmsInventoryCheckbillReportDetailsVo.getPsMoney()); |
|
|
|
List<WmsInventoryCheckbillReportSumVo> ware = wmsInventoryCheckbillReportDetailsVo.getWarehouseStocktakList(); |
|
|
|
for (int i = 0; i < ware.size(); i++) { |
|
|
|
WmsInventoryCheckbillReportSumVo wmsInventoryCheckbillReportSumVo = ware.get(i); |
|
|
|
wmsInventoryCheckbillReportSumVo.setId(i + 1); |
|
|
|
} |
|
|
|
map.put("ware", ware); |
|
|
|
List<WmsInventoryCheckbillReportSumVo> area = wmsInventoryCheckbillReportDetailsVo.getArea(); |
|
|
|
List<WmsInventoryCheckbillReportSumVo> area = wmsInventoryCheckbillReportDetailsVo.getArehouseAreaeStocktakList(); |
|
|
|
for (int i = 0; i < area.size(); i++) { |
|
|
|
WmsInventoryCheckbillReportSumVo wmsInventoryCheckbillReportSumVo = area.get(i); |
|
|
|
wmsInventoryCheckbillReportSumVo.setId(i + 1); |
|
|
|
} |
|
|
|
map.put("area", area); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + "pdbg" + ".ftl"); |
|
|
|
//生成word文件名
|
|
|
@ -476,10 +490,11 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor |
|
|
|
WordConvertUtils.creatWord1(map, file, targetPath, typeName, dir); |
|
|
|
//新生成的word路径
|
|
|
|
String wordPath = targetPath + typeName; |
|
|
|
//生成文件名
|
|
|
|
String pdfName = map.get("num").toString() + "盘点报告_" + dateStr + seconds + ".pdf"; |
|
|
|
//生成出门证文件名
|
|
|
|
String pdfName = "盘点报告_" + dateStr + seconds + ".pdf"; |
|
|
|
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); |
|
|
|
return pdfName; |
|
|
|
wmsInventoryCheckbillReportService.updatePdf(sid,pdfName); |
|
|
|
return "/template/" + pdfName; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean submitApply(SubmitInventoryCheckDto dto) { |
|
|
@ -830,7 +845,7 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor |
|
|
|
if (StringUtils.isNotBlank(query.getName())) { |
|
|
|
qw.and(wrapper -> wrapper.like("d.warehouseName", query.getName()).or().like("d.warehouseArea", query.getName()).or().like("d.warehouseRackName", query.getName())); |
|
|
|
} |
|
|
|
qw.eq("c.checkState",'1'); |
|
|
|
qw.eq("c.checkState", '1'); |
|
|
|
qw.groupBy("d.warehouseRackSid"); |
|
|
|
IPage<WmsInventoryCheckbill> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<WmsInventoryCheckbillPageVo> pagging = baseMapper.appDetailRackPageList(page, qw); |
|
|
@ -846,23 +861,23 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor |
|
|
|
|
|
|
|
public ResultBean<HandleBean> scan(String sid, String content, String houseSid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
if (content.contains("#")){ |
|
|
|
if (content.contains("#")) { |
|
|
|
return rb.setMsg("请扫描商品码"); |
|
|
|
} |
|
|
|
HandleBean handleBean = wmsInventoryCheckbillDetailService.scan(sid,content,houseSid); |
|
|
|
if (handleBean == null){ |
|
|
|
HandleBean handleBean = wmsInventoryCheckbillDetailService.scan(sid, content, houseSid); |
|
|
|
if (handleBean == null) { |
|
|
|
List<WmsInventory> wmsInventories = wmsInventoryService.getListByGoodsID(content).getData(); |
|
|
|
if (!wmsInventories.isEmpty()){ |
|
|
|
if (!wmsInventories.isEmpty()) { |
|
|
|
for (WmsInventory wmsInventory : wmsInventories) { |
|
|
|
WmsWarehouseRack wmsWarehouseRack = wmsWarehouseRackService.fetchBySid(wmsInventory.getWarehouseRackSid()); |
|
|
|
WmsWarehouseArea wmsWarehouseArea = wmsWarehouseAreaService.fetchBySid(wmsWarehouseRack.getLocationSid()); |
|
|
|
return rb.setMsg("本商品不属于本库位,属于" + wmsWarehouseArea.getAreaName() + "库区" + wmsWarehouseRack.getRackName() + "库位。"); |
|
|
|
} |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
String billNo = wmsInventoryRecordService.selByGoodsID(content); |
|
|
|
if (StringUtils.isBlank(billNo)){ |
|
|
|
if (StringUtils.isBlank(billNo)) { |
|
|
|
return rb.setMsg("商品码不正确"); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
return rb.setMsg("本商品已在" + billNo + "单据编号中出库。"); |
|
|
|
} |
|
|
|
} |
|
|
@ -875,4 +890,8 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor |
|
|
|
wmsInventoryCheckbillDetailService.saveInventoryInfo2(dto); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
public void saveReport(String billSid, String remarks) { |
|
|
|
wmsInventoryCheckbillReportService.saveReport(billSid, remarks); |
|
|
|
} |
|
|
|
} |