入库通知导入

master
erzhongxmu 2022-03-20 14:29:33 +08:00
parent f946100222
commit 882d55070d
2 changed files with 37 additions and 9 deletions

View File

@ -2822,6 +2822,22 @@ public class WmImNoticeHController extends BaseController {
AjaxJson j = new AjaxJson(); AjaxJson j = new AjaxJson();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
TSUser user = ResourceUtil.getSessionUserName();
String roles = "";
if (user != null) {
List<TSRoleUser> 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<String, MultipartFile> entity : fileMap.entrySet()) { for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象 MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams(); ImportParams params = new ImportParams();
@ -2880,13 +2896,18 @@ public class WmImNoticeHController extends BaseController {
}catch (Exception e){ }catch (Exception e){
} }
wmi.setOtherId(page.getOtherId()); wmi.setOtherId(page.getOtherId());
wmImNoticeIListnew.add(wmi); wmImNoticeIListnew.add(wmi);
} }
} }
WmImNoticeHEntity wmImNoticeH = new WmImNoticeHEntity(); WmImNoticeHEntity wmImNoticeH = new WmImNoticeHEntity();
if(roles.equals("CUS")){
wmImNoticeH.setImSta(Constants.wm_sta0);
}else{
wmImNoticeH.setImSta(Constants.wm_sta1);
}
wmImNoticeH.setOrderTypeCode(pageheader.getOrderTypeCode()); wmImNoticeH.setOrderTypeCode(pageheader.getOrderTypeCode());
String noticeid = wmUtil.getNextNoticeid(wmImNoticeH.getOrderTypeCode()); String noticeid = wmUtil.getNextNoticeid(wmImNoticeH.getOrderTypeCode());
wmImNoticeH.setCusCode(pageheader.getCusCode()); wmImNoticeH.setCusCode(pageheader.getCusCode());

View File

@ -9,6 +9,7 @@ import com.zzjee.wm.entity.WmImNoticeHEntity;
import com.zzjee.wm.entity.WmImNoticeIEntity; import com.zzjee.wm.entity.WmImNoticeIEntity;
import com.zzjee.wm.entity.WmInQmIEntity; import com.zzjee.wm.entity.WmInQmIEntity;
import org.jeecgframework.core.util.*;
import org.jeecgframework.web.system.sms.util.Constants; import org.jeecgframework.web.system.sms.util.Constants;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 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.exception.BusinessException;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl; 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.TSRole;
import org.jeecgframework.web.system.pojo.base.TSRoleUser; import org.jeecgframework.web.system.pojo.base.TSRoleUser;
import org.jeecgframework.web.system.pojo.base.TSUser; import org.jeecgframework.web.system.pojo.base.TSUser;
@ -46,6 +42,9 @@ public class WmImNoticeHServiceImpl extends CommonServiceImpl implements WmImNot
public void addMain(WmImNoticeHEntity wmImNoticeH, public void addMain(WmImNoticeHEntity wmImNoticeH,
List<WmImNoticeIEntity> wmImNoticeIList){ List<WmImNoticeIEntity> wmImNoticeIList){
//保存主信息 //保存主信息
if(StringUtil.isEmpty(wmImNoticeH.getOrderTypeCode())){
wmImNoticeH.setOrderTypeCode("01");
}
this.save(wmImNoticeH); this.save(wmImNoticeH);
/**保存-进货通知明细*/ /**保存-进货通知明细*/
@ -121,12 +120,20 @@ public class WmImNoticeHServiceImpl extends CommonServiceImpl implements WmImNot
}else{ }else{
wmImNoticeI.setBinPre("N"); wmImNoticeI.setBinPre("N");
wmImNoticeI.setGoodsQmCount("0"); wmImNoticeI.setGoodsQmCount("0");
if(wmImNoticeH.getImSta().equals(Constants.wm_sta0)){ try{
wmImNoticeI.setBinPre("I"); if(wmImNoticeH.getImSta().equals(Constants.wm_sta0)){
} wmImNoticeI.setBinPre("I");
}
}catch (Exception e){
}
wmImNoticeI.setImNoticeId(wmImNoticeH.getNoticeId()); wmImNoticeI.setImNoticeId(wmImNoticeH.getNoticeId());
wmImNoticeI.setImBeizhu(wmImNoticeH.getImBeizhu()); wmImNoticeI.setImBeizhu(wmImNoticeH.getImBeizhu());
wmImNoticeI.setImCusCode(wmImNoticeH.getImCusCode()); wmImNoticeI.setImCusCode(wmImNoticeH.getImCusCode());
if(StringUtil.isEmpty(wmImNoticeI.getOtherId())){
wmImNoticeI.setOtherId(UUIDGenerator.generate().toString());
}
this.save(wmImNoticeI); this.save(wmImNoticeI);
} }