From 882d55070dbab332dfe7ca172694db04f9b77e68 Mon Sep 17 00:00:00 2001 From: erzhongxmu Date: Sun, 20 Mar 2022 14:29:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93=E9=80=9A=E7=9F=A5=E5=AF=BC?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wm/controller/WmImNoticeHController.java | 23 ++++++++++++++++++- .../service/impl/WmImNoticeHServiceImpl.java | 23 ++++++++++++------- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java b/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java index 260825e1..e33e99bd 100644 --- a/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java +++ b/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java @@ -2822,6 +2822,22 @@ public class WmImNoticeHController extends BaseController { AjaxJson j = new AjaxJson(); MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; Map fileMap = multipartRequest.getFileMap(); + + TSUser user = ResourceUtil.getSessionUserName(); + String roles = ""; + if (user != null) { + List rUsers = systemService.findByProperty(TSRoleUser.class, "TSUser.id", user.getId()); + for (TSRoleUser ru : rUsers) { + TSRole role = ru.getTSRole(); + roles += role.getRoleCode() + ","; + } + if (roles.length() > 0) { + roles = roles.substring(0, roles.length() - 1); + } + + } + + for (Map.Entry entity : fileMap.entrySet()) { MultipartFile file = entity.getValue();// 获取上传文件对象 ImportParams params = new ImportParams(); @@ -2880,13 +2896,18 @@ public class WmImNoticeHController extends BaseController { }catch (Exception e){ } - wmi.setOtherId(page.getOtherId()); wmImNoticeIListnew.add(wmi); } } WmImNoticeHEntity wmImNoticeH = new WmImNoticeHEntity(); + + if(roles.equals("CUS")){ + wmImNoticeH.setImSta(Constants.wm_sta0); + }else{ + wmImNoticeH.setImSta(Constants.wm_sta1); + } wmImNoticeH.setOrderTypeCode(pageheader.getOrderTypeCode()); String noticeid = wmUtil.getNextNoticeid(wmImNoticeH.getOrderTypeCode()); wmImNoticeH.setCusCode(pageheader.getCusCode()); diff --git a/src/main/java/com/zzjee/wm/service/impl/WmImNoticeHServiceImpl.java b/src/main/java/com/zzjee/wm/service/impl/WmImNoticeHServiceImpl.java index 336ee75e..ae77c05d 100644 --- a/src/main/java/com/zzjee/wm/service/impl/WmImNoticeHServiceImpl.java +++ b/src/main/java/com/zzjee/wm/service/impl/WmImNoticeHServiceImpl.java @@ -9,6 +9,7 @@ import com.zzjee.wm.entity.WmImNoticeHEntity; import com.zzjee.wm.entity.WmImNoticeIEntity; import com.zzjee.wm.entity.WmInQmIEntity; +import org.jeecgframework.core.util.*; import org.jeecgframework.web.system.sms.util.Constants; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -17,11 +18,6 @@ import java.util.List; import org.jeecgframework.core.common.exception.BusinessException; import org.jeecgframework.core.common.service.impl.CommonServiceImpl; -import org.jeecgframework.core.util.DateUtils; -import org.jeecgframework.core.util.MyBeanUtils; -import org.jeecgframework.core.util.ResourceUtil; -import org.jeecgframework.core.util.StringUtil; -import org.jeecgframework.core.util.oConvertUtils; import org.jeecgframework.web.system.pojo.base.TSRole; import org.jeecgframework.web.system.pojo.base.TSRoleUser; import org.jeecgframework.web.system.pojo.base.TSUser; @@ -46,6 +42,9 @@ public class WmImNoticeHServiceImpl extends CommonServiceImpl implements WmImNot public void addMain(WmImNoticeHEntity wmImNoticeH, List wmImNoticeIList){ //保存主信息 + if(StringUtil.isEmpty(wmImNoticeH.getOrderTypeCode())){ + wmImNoticeH.setOrderTypeCode("01"); + } this.save(wmImNoticeH); /**保存-进货通知明细*/ @@ -121,12 +120,20 @@ public class WmImNoticeHServiceImpl extends CommonServiceImpl implements WmImNot }else{ wmImNoticeI.setBinPre("N"); wmImNoticeI.setGoodsQmCount("0"); - if(wmImNoticeH.getImSta().equals(Constants.wm_sta0)){ - wmImNoticeI.setBinPre("I"); - } + try{ + if(wmImNoticeH.getImSta().equals(Constants.wm_sta0)){ + wmImNoticeI.setBinPre("I"); + } + }catch (Exception e){ + + } + wmImNoticeI.setImNoticeId(wmImNoticeH.getNoticeId()); wmImNoticeI.setImBeizhu(wmImNoticeH.getImBeizhu()); wmImNoticeI.setImCusCode(wmImNoticeH.getImCusCode()); + if(StringUtil.isEmpty(wmImNoticeI.getOtherId())){ + wmImNoticeI.setOtherId(UUIDGenerator.generate().toString()); + } this.save(wmImNoticeI); }