From 6f45f4a29ce38525f3f9e3931bcedfc77bde765e Mon Sep 17 00:00:00 2001 From: jiazx0107@163.com <jiazx0107@163.com> Date: 星期六, 24 六月 2023 18:07:43 +0800 Subject: [PATCH] 出入库流程优化-入库详单优化 --- igds-inout/src/main/java/com/ld/igds/inout/service/impl/InoutServiceImpl.java | 54 +++++++++++++++++++----------------------------------- 1 files changed, 19 insertions(+), 35 deletions(-) diff --git a/igds-inout/src/main/java/com/ld/igds/inout/service/impl/InoutServiceImpl.java b/igds-inout/src/main/java/com/ld/igds/inout/service/impl/InoutServiceImpl.java index cbbc2d9..eeec666 100644 --- a/igds-inout/src/main/java/com/ld/igds/inout/service/impl/InoutServiceImpl.java +++ b/igds-inout/src/main/java/com/ld/igds/inout/service/impl/InoutServiceImpl.java @@ -15,7 +15,6 @@ import com.ld.igds.inout.mapper.InoutCheckMapper; import com.ld.igds.inout.mapper.InoutRecordMapper; import com.ld.igds.inout.service.InoutService; -import com.ld.igds.models.Depot; import com.ld.igds.models.InoutPrice; import com.ld.igds.util.ContextUtil; import com.ld.igds.util.DateUtil; @@ -57,8 +56,6 @@ if (null != result) { return result; } - - List<InoutData> list = inoutMapper.inoutProgressQuery(param); if (null == list || list.size() == 0) return null; @@ -106,16 +103,18 @@ } @Override - public String inoutStop(InoutParam param) { + public String inoutStop(InoutParam param) throws Exception { if (StringUtils.isEmpty(param.getCompanyId())) { - param.setCompanyId(ContextUtil.getCompanyId()); + param.setCompanyId(ContextUtil.getDefaultCompanyId()); } + + + param.setProgress(InoutConstant.PROGRESS_RECORD); + param.setRecordStatus(InoutConstant.RECORD_STATUS_DEL); + // 缂撳瓨涓垹闄� delFromCache(param.getDeptId(), param.getType(), param.getId()); - - param.setProgress(InoutConstant.PROGRESS_RECORD); - param.setRecordStatus(InoutConstant.RECORD_STATUS_ERROR); inoutMapper.inoutStop(param); @@ -208,7 +207,7 @@ //鏇存柊缂撳瓨 updateInoutCache(newData); - + return null; } @@ -291,8 +290,6 @@ this.delFromCache(param.getDeptId(), param.getType(), param.getId()); - - inoutMapper.toComplete(param); return null; @@ -301,7 +298,7 @@ @Override public String quickComplete(InoutData data) throws Exception { if (null == data.getCompanyId()) { - data.setCompanyId(ContextUtil.getCompanyId()); + data.setCompanyId(ContextUtil.getDefaultCompanyId()); } if (null == data.getCompleteTime()) { data.setCompleteTime(new Date()); @@ -312,7 +309,6 @@ if (null == data.getEmptyWeightTime()) { data.setEmptyWeightTime(new Date()); } - //璋冩暣鏃堕棿宸� if (InoutConstant.TYPE_IN.equals(data.getType())) { @@ -341,15 +337,10 @@ // 璁剧疆娴佺▼缁撴潫 data.setProgress(InoutConstant.PROGRESS_RECORD); - - if (null == data.getFoodType()) { - // 鏍规嵁浠撳簱淇℃伅鑾峰彇缂撳瓨 - Depot depot = commonService.getCacheDepot(data.getCompanyId(), data.getDepotId()); - data.setFoodType(depot.getFoodType()); - } - + //鎵ц鏇存柊 inoutMapper.updateData(data); + //鏇存柊缂撳瓨 updateInoutCache(data); return null; @@ -370,8 +361,6 @@ } else { setInoutCache(data.getDeptId(), data); } - //鎺ㄩ�佸ぇ灞� - notifyToScreen(data.getCompanyId(), data.getDeptId(), data.getProgress()); } @@ -492,7 +481,7 @@ public String addInoutDataByLossOver(InoutData data) { // 鑾峰彇涓婁竴杞︾殑娴佹按鏁版嵁 - // InoutData inoutData = this.getLastRecord(data.getCompanyId(), data.getDepotId()); + // InoutData inoutData = this.getLastRecord(data.getCompanyId(), data.getDepotId()); // // 璁剧疆娴佹按鐨勫簱瀛� // if (InoutConstant.TYPE_IN.equals(inoutData.getType())) { @@ -754,27 +743,22 @@ } @Override - public String updateCheckData(InoutCheckData data) { - if (StringUtils.isEmpty(data.getCompanyId())) { - data.setCompanyId(ContextUtil.getCompanyId()); - } - if (StringUtils.isEmpty(data.getDeptId())) { - data.setCompanyId(ContextUtil.subDeptId(null)); - } - - + public String updateCheckData(InoutData data) { data.setUpdateTime(new Date()); - int num = inoutCheckMapper.updateCheckData(data); + + //鏇存柊缂撳瓨 + updateInoutCache(data); + return null; } @Override public List<InoutPrice> getPrice(InoutCheckParam param) { - if(null == param.getStart()){ + if (null == param.getStart()) { param.setStart(new Date()); } - if(null == param.getEnd()){ + if (null == param.getEnd()) { param.setEnd(new Date()); } return inoutCheckMapper.getPrice(param); -- Gitblit v1.9.3