一步或两步上架配置

master
e 2018-12-25 22:57:11 +08:00
parent a423b58e36
commit a3923c9b1a
2 changed files with 75 additions and 63 deletions

View File

@ -55,6 +55,7 @@ import org.jeecgframework.core.beanvalidator.BeanValidators;
import java.util.Set; import java.util.Set;
import javax.swing.text.StyledEditorKit;
import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolation;
import javax.validation.Validator; import javax.validation.Validator;
@ -187,68 +188,7 @@ public class WmInQmIController extends BaseController {
message = "上架成功"; message = "上架成功";
try { try {
List<WmToUpGoodsEntity> wmToUpGoodsList = new ArrayList<WmToUpGoodsEntity>(); toup(request.getParameter("id"));
String hql0 = "from WmInQmIEntity where binSta = 'N' and id = ?";
List<WmInQmIEntity> WmInQmIEntityList = systemService.findHql(hql0,
request.getParameter("id").toString());// 获取行项目
for (WmInQmIEntity wmInQmIEntity : WmInQmIEntityList) {
WmToUpGoodsEntity wmToUpGoodsEntity = new WmToUpGoodsEntity();
wmToUpGoodsEntity.setGoodsId(wmInQmIEntity.getGoodsId());
wmToUpGoodsEntity.setGoodsProData(wmInQmIEntity.getProData());
wmToUpGoodsEntity.setGoodsBatch(wmInQmIEntity.getGoodsBatch());
wmToUpGoodsEntity.setGoodsQua(wmInQmIEntity.getQmOkQuat());
wmToUpGoodsEntity.setGoodsUnit(wmInQmIEntity.getGoodsUnit());
wmToUpGoodsEntity.setOrderIdI(wmInQmIEntity.getId());
wmToUpGoodsEntity.setOrderId(wmInQmIEntity.getImNoticeId());
wmToUpGoodsEntity.setBinId(wmInQmIEntity.getTinId());
wmToUpGoodsEntity.setKuWeiBianMa(wmInQmIEntity.getBinId());
wmToUpGoodsEntity.setCusCode(wmInQmIEntity.getCusCode());
wmToUpGoodsEntity.setGoodsName(wmInQmIEntity.getGoodsName());
wmToUpGoodsEntity.setActTypeCode("01");
String sql = "select md.suo_shu_ke_hu as cuscode from md_bin md where md.ku_wei_bian_ma = '"
+ wmInQmIEntity.getBinId() + "'";
Map<String, Object> binMap = systemService.findOneForJdbc(sql);
if(binMap==null){
j.setSuccess(false);
message = "储位不存在";
j.setMsg(message);
return j;
}
try{
MvGoodsEntity mvgoods = new MvGoodsEntity();
mvgoods = systemService.findUniqueByProperty(
MvGoodsEntity.class, "goodsCode",
wmToUpGoodsEntity.getGoodsId());
wmToUpGoodsEntity.setBaseUnit(mvgoods.getBaseunit());
wmToUpGoodsEntity.setGoodsUnit(mvgoods.getShlDanWei());
if (!mvgoods.getBaseunit().equals(mvgoods.getShlDanWei())) {
try {
wmToUpGoodsEntity.setBaseGoodscount(String.valueOf(
Double.parseDouble(mvgoods.getChlShl())
* Double.parseDouble(wmToUpGoodsEntity.getGoodsQua())));
} catch (Exception e) {
// TODO: handle exception
}
} else {
wmToUpGoodsEntity.setBaseGoodscount(wmToUpGoodsEntity
.getGoodsQua());
}
}catch (Exception e){
}
wmInQmIEntity.setBinSta("Y");
systemService.save(wmToUpGoodsEntity);
systemService.saveOrUpdate(wmInQmIEntity);
}
systemService.addLog(message, Globals.Log_Type_DEL, systemService.addLog(message, Globals.Log_Type_DEL,
Globals.Log_Leavel_INFO); Globals.Log_Leavel_INFO);
@ -262,6 +202,71 @@ public class WmInQmIController extends BaseController {
return j; return j;
} }
private boolean toup(String id ){
List<WmToUpGoodsEntity> wmToUpGoodsList = new ArrayList<WmToUpGoodsEntity>();
String hql0 = "from WmInQmIEntity where binSta = 'N' and id = ?";
List<WmInQmIEntity> WmInQmIEntityList = systemService.findHql(hql0,
id);// 获取行项目
for (WmInQmIEntity wmInQmIEntity : WmInQmIEntityList) {
WmToUpGoodsEntity wmToUpGoodsEntity = new WmToUpGoodsEntity();
wmToUpGoodsEntity.setGoodsId(wmInQmIEntity.getGoodsId());
wmToUpGoodsEntity.setGoodsProData(wmInQmIEntity.getProData());
wmToUpGoodsEntity.setGoodsBatch(wmInQmIEntity.getGoodsBatch());
wmToUpGoodsEntity.setGoodsQua(wmInQmIEntity.getQmOkQuat());
wmToUpGoodsEntity.setGoodsUnit(wmInQmIEntity.getGoodsUnit());
wmToUpGoodsEntity.setOrderIdI(wmInQmIEntity.getId());
wmToUpGoodsEntity.setOrderId(wmInQmIEntity.getImNoticeId());
wmToUpGoodsEntity.setBinId(wmInQmIEntity.getTinId());
wmToUpGoodsEntity.setKuWeiBianMa(wmInQmIEntity.getBinId());
wmToUpGoodsEntity.setCusCode(wmInQmIEntity.getCusCode());
wmToUpGoodsEntity.setGoodsName(wmInQmIEntity.getGoodsName());
wmToUpGoodsEntity.setActTypeCode("01");
String sql = "select md.suo_shu_ke_hu as cuscode from md_bin md where md.ku_wei_bian_ma = '"
+ wmInQmIEntity.getBinId() + "'";
Map<String, Object> binMap = systemService.findOneForJdbc(sql);
if (binMap == null) {
return false;
}
try {
MvGoodsEntity mvgoods = new MvGoodsEntity();
mvgoods = systemService.findUniqueByProperty(
MvGoodsEntity.class, "goodsCode",
wmToUpGoodsEntity.getGoodsId());
wmToUpGoodsEntity.setBaseUnit(mvgoods.getBaseunit());
wmToUpGoodsEntity.setGoodsUnit(mvgoods.getShlDanWei());
if (!mvgoods.getBaseunit().equals(mvgoods.getShlDanWei())) {
try {
wmToUpGoodsEntity.setBaseGoodscount(String.valueOf(
Double.parseDouble(mvgoods.getChlShl())
* Double.parseDouble(wmToUpGoodsEntity.getGoodsQua())));
} catch (Exception e) {
// TODO: handle exception
}
} else {
wmToUpGoodsEntity.setBaseGoodscount(wmToUpGoodsEntity
.getGoodsQua());
}
} catch (Exception e) {
}
wmInQmIEntity.setBinSta("Y");
systemService.save(wmToUpGoodsEntity);
systemService.saveOrUpdate(wmInQmIEntity);
}
return true;
}
/** /**
* *
* *
@ -487,7 +492,10 @@ public class WmInQmIController extends BaseController {
wmInQmI.setImQuat(wmimnotice.getGoodsCount()); wmInQmI.setImQuat(wmimnotice.getGoodsCount());
wmInQmI.setImCusCode(wmimnotice.getImCusCode()); wmInQmI.setImCusCode(wmimnotice.getImCusCode());
// wmInQmI.setBinId(wmInQmI.getImNoticeId()); // wmInQmI.setBinId(wmInQmI.getImNoticeId());
wmInQmIService.save(wmInQmI); String id = wmInQmIService.save(wmInQmI).toString();
if("on".equals(ResourceUtil.getConfigByName("onestepup"))&&StringUtil.isNotEmpty(wmInQmI.getBinId())){
toup(id);
}
systemService.addLog(message, Globals.Log_Type_INSERT, systemService.addLog(message, Globals.Log_Type_INSERT,
Globals.Log_Leavel_INFO); Globals.Log_Leavel_INFO);
} }

View File

@ -286,6 +286,10 @@ comgroup=on
tijiunit=\u7ACB\u65B9\u5206\u7C73 tijiunit=\u7ACB\u65B9\u5206\u7C73
zhongliangunit=\u516C\u65A4 zhongliangunit=\u516C\u65A4
#\u4E00\u6B65\u4E0A\u67B6
onestepup=on