From 8f113217082535fd0505799f18191b7b9993ff0c Mon Sep 17 00:00:00 2001 From: cez Date: Fri, 24 Jun 2022 16:51:07 +0800 Subject: [PATCH] =?UTF-8?q?PDA=20=E6=94=B9=E4=B8=BAUNIAPP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wm/controller/WmInQmIController.java | 26 +++++++++++---- .../wm/controller/WmToUpGoodsController.java | 32 ++++++------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/zzjee/wm/controller/WmInQmIController.java b/src/main/java/com/zzjee/wm/controller/WmInQmIController.java index 54b8452f..099ee12a 100644 --- a/src/main/java/com/zzjee/wm/controller/WmInQmIController.java +++ b/src/main/java/com/zzjee/wm/controller/WmInQmIController.java @@ -65,6 +65,8 @@ import com.zzjee.md.entity.MvGoodsEntity; import com.zzjee.wm.service.WmInQmIServiceI; import com.zzjee.wmutil.wmUtil; +import static com.xiaoleilu.hutool.date.DateTime.now; + /** * @author erzhongxmu * @version V1.0 @@ -230,7 +232,7 @@ public class WmInQmIController extends BaseController { message = "上架成功"; try { System.out.println(request.getParameter("id")); - boolean isup = toup(request.getParameter("id")); + boolean isup = toup(request.getParameter("id"),"","",""); if (!isup) { j.setSuccess(false); message = "上架失败"; @@ -251,7 +253,7 @@ public class WmInQmIController extends BaseController { } - private boolean toup(String id) { + public boolean toup(String id,String kuweiBianMa,String username,String realname) { // List wmToUpGoodsList = new ArrayList(); String hql0 = "from WmInQmIEntity where binSta = 'N' and id = ?"; List WmInQmIEntityList = systemService.findHql(hql0, @@ -273,6 +275,13 @@ public class WmInQmIController extends BaseController { System.out.println(wmInQmIEntity.getId() + "33333"); WmToUpGoodsEntity wmToUpGoodsEntity = new WmToUpGoodsEntity(); + if(!StringUtil.isEmpty(username)){ + wmToUpGoodsEntity.setCreateBy(username); + } + if(!StringUtil.isEmpty(realname)){ + wmToUpGoodsEntity.setCreateName(realname); + } + wmToUpGoodsEntity.setCreateDate(now()); wmToUpGoodsEntity.setGoodsId(wmInQmIEntity.getGoodsId()); wmToUpGoodsEntity.setGoodsProData(wmInQmIEntity.getProData()); wmToUpGoodsEntity.setGoodsBatch(wmInQmIEntity.getGoodsBatch()); @@ -281,7 +290,12 @@ public class WmInQmIController extends BaseController { wmToUpGoodsEntity.setOrderIdI(wmInQmIEntity.getId()); wmToUpGoodsEntity.setOrderId(wmInQmIEntity.getImNoticeId()); wmToUpGoodsEntity.setBinId(wmInQmIEntity.getTinId()); - wmToUpGoodsEntity.setKuWeiBianMa(wmInQmIEntity.getBinId()); + if(!StringUtil.isEmpty(kuweiBianMa)){ + wmToUpGoodsEntity.setKuWeiBianMa(kuweiBianMa); + }else{ + wmToUpGoodsEntity.setKuWeiBianMa(wmInQmIEntity.getBinId()); + } + wmToUpGoodsEntity.setCusCode(wmInQmIEntity.getCusCode()); wmToUpGoodsEntity.setGoodsName(wmInQmIEntity.getGoodsName()); wmToUpGoodsEntity.setActTypeCode("01"); @@ -291,7 +305,7 @@ public class WmInQmIController extends BaseController { // Map binMap = systemService.findOneForJdbc(sql); System.out.println(wmInQmIEntity.getBinId() + "444444"); - if (!wmUtil.checkbin(wmInQmIEntity.getBinId())) { + if (!wmUtil.checkbin(wmToUpGoodsEntity.getKuWeiBianMa())) { throw new RuntimeException("储位不存在或已停用!"); } System.out.println(wmInQmIEntity.getBinId() + "555555"); @@ -586,7 +600,7 @@ public class WmInQmIController extends BaseController { // wmInQmI.setBinId(wmInQmI.getImNoticeId()); String id = wmInQmIService.save(wmInQmI).toString(); if ("on".equals(ResourceUtil.getConfigByName("webonestepup")) && StringUtil.isNotEmpty(wmInQmI.getBinId())) { - toup(id); + toup(id,"","",""); } systemService.addLog("批量收货" + wmInQmI.getGoodsId(), Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); @@ -1091,7 +1105,7 @@ public class WmInQmIController extends BaseController { } String id = wmInQmIService.save(wmInQmI).toString(); if ("on".equals(ResourceUtil.getConfigByName("onestepup")) && StringUtil.isNotEmpty(wmInQmI.getBinId())) { - toup(id); + toup(id,"","",""); } D0.setOK(true); } diff --git a/src/main/java/com/zzjee/wm/controller/WmToUpGoodsController.java b/src/main/java/com/zzjee/wm/controller/WmToUpGoodsController.java index ccdf423d..a8dbdabd 100644 --- a/src/main/java/com/zzjee/wm/controller/WmToUpGoodsController.java +++ b/src/main/java/com/zzjee/wm/controller/WmToUpGoodsController.java @@ -82,7 +82,8 @@ public class WmToUpGoodsController extends BaseController { private SystemService systemService; @Autowired private Validator validator; - + @Autowired + private WmInQmIController wmInQmIController; /** @@ -452,7 +453,6 @@ public class WmToUpGoodsController extends BaseController { if (!failures.isEmpty()) { return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST); } - if(StringUtil.isEmpty(wmToUpGoods.getKuWeiBianMa())){ D0.setOK(false); D0.setErrorMsg("储位不能为空"); @@ -463,8 +463,6 @@ public class WmToUpGoodsController extends BaseController { D0.setErrorMsg("储位不存在"); return new ResponseEntity(D0, HttpStatus.OK); } } - - //保存 try{ D0.setOK(true); @@ -483,34 +481,22 @@ public class WmToUpGoodsController extends BaseController { return new ResponseEntity(D0, HttpStatus.OK); } - if(StringUtil.isNotEmpty(wmToUpGoods.getOrderIdI())){ - List wmToUpGoodsEntity = systemService.findByProperty(WmToUpGoodsEntity.class,"orderIdI",wmToUpGoods.getWmToUpId()); - if(wmToUpGoodsEntity!=null&&wmToUpGoodsEntity.size()>0){ - D0.setOK(false); - D0.setErrorMsg("已经上架,不能重复上架"); - return new ResponseEntity(D0, HttpStatus.OK); - } - }else{ - D0.setOK(false); - D0.setErrorMsg("验收记录为空,不能上架"); - - return new ResponseEntity(D0, HttpStatus.OK); - } - - wmToUpGoods.setGoodsName(wmInQmIEntity.getGoodsName()); - wmToUpGoods.setCreateDate(DateUtils.getDate()); - +// wmToUpGoods.setGoodsName(wmInQmIEntity.getGoodsName()); +// wmToUpGoods.setCreateDate(DateUtils.getDate()); TSBaseUser user = systemService.findUniqueByProperty(TSBaseUser.class,"userName",wmToUpGoods.getCreateBy()); if (user != null ) { wmToUpGoods.setCreateName(user.getRealName()); } - wmToUpGoodsService.save(wmToUpGoods); + wmInQmIController.toup(wmToUpGoods.getWmToUpId(),wmToUpGoods.getKuWeiBianMa(),wmToUpGoods.getCreateBy(),user.getRealName()); +// wmToUpGoodsService.save(wmToUpGoods); + + + } catch (Exception e) { e.printStackTrace(); D0.setOK(false); } - return new ResponseEntity(D0, HttpStatus.OK); }