一步或两步上架配置

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 javax.swing.text.StyledEditorKit;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
@ -187,10 +188,26 @@ public class WmInQmIController extends BaseController {
message = "上架成功";
try {
toup(request.getParameter("id"));
systemService.addLog(message, Globals.Log_Type_DEL,
Globals.Log_Leavel_INFO);
} catch (Exception e) {
j.setSuccess(false);
e.printStackTrace();
message = "上架失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
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,
request.getParameter("id").toString());// 获取行项目
id);// 获取行项目
for (WmInQmIEntity wmInQmIEntity : WmInQmIEntityList) {
WmToUpGoodsEntity wmToUpGoodsEntity = new WmToUpGoodsEntity();
wmToUpGoodsEntity.setGoodsId(wmInQmIEntity.getGoodsId());
@ -209,10 +226,8 @@ public class WmInQmIController extends BaseController {
+ wmInQmIEntity.getBinId() + "'";
Map<String, Object> binMap = systemService.findOneForJdbc(sql);
if (binMap == null) {
j.setSuccess(false);
message = "储位不存在";
j.setMsg(message);
return j;
return false;
}
@ -249,17 +264,7 @@ public class WmInQmIController extends BaseController {
systemService.save(wmToUpGoodsEntity);
systemService.saveOrUpdate(wmInQmIEntity);
}
systemService.addLog(message, Globals.Log_Type_DEL,
Globals.Log_Leavel_INFO);
} catch (Exception e) {
j.setSuccess(false);
e.printStackTrace();
message = "上架失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
return true;
}
/**
@ -487,7 +492,10 @@ public class WmInQmIController extends BaseController {
wmInQmI.setImQuat(wmimnotice.getGoodsCount());
wmInQmI.setImCusCode(wmimnotice.getImCusCode());
// 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,
Globals.Log_Leavel_INFO);
}

View File

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