fix:分切计划改为按照母卷按照数组下发
This commit is contained in:
@@ -53,8 +53,8 @@ public class MesToLmsController {
|
||||
@PostMapping("/cutPlanTransfer")
|
||||
@Log("分切包装段:分切计划(单表,包含母卷/改制子卷-包装箱号、空包装箱物料、纸筒/FRP管)MES下发智能物流")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> cutPlanTransfer(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(mesToLmsService.cutPlanTransfer(jo), HttpStatus.OK);
|
||||
public ResponseEntity<Object> cutPlanTransfer(@RequestBody JSONArray ja) {
|
||||
return new ResponseEntity<>(mesToLmsService.cutPlanTransfer(ja), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/callNextAssAndMomRoll")
|
||||
|
||||
@@ -27,7 +27,7 @@ public interface MesToLmsService {
|
||||
/**
|
||||
* 分切包装段:分切计划(单表,包含母卷/改制子卷-包装箱号、空包装箱物料、纸筒/FRP管)MES下发智能物流
|
||||
*/
|
||||
JSONObject cutPlanTransfer(JSONObject param);
|
||||
JSONObject cutPlanTransfer(JSONArray ja);
|
||||
|
||||
/**
|
||||
* 分切即将完成,呼叫配送下一个母卷/改制子卷,MES传智能物流
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpStatus;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -533,9 +534,15 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject cutPlanTransfer(JSONObject param) {
|
||||
log.info("cutPlanTransfer接口输入参数为:-------------------" + param.toString());
|
||||
public JSONObject cutPlanTransfer(JSONArray ja) {
|
||||
log.info("cutPlanTransfer接口输入参数为:-------------------" + ja.toString());
|
||||
|
||||
WQLObject tab = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan");
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
try {
|
||||
for (int i = 0; i < ja.size(); i++) {
|
||||
JSONObject param = ja.getJSONObject(i);
|
||||
String orderType = param.getString("OrderType"); // 分切订单类型
|
||||
String ContainerName = param.getString("ContainerName"); // 子卷号
|
||||
String ProductName = param.getString("ProductName"); // 产品编码
|
||||
@@ -556,10 +563,6 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
String Attribute5 = param.getString("Attribute5"); // 是否套轴
|
||||
String Attribute6 = param.getString("Attribute6"); // 是否套轴
|
||||
|
||||
WQLObject tab = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan");
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
try {
|
||||
// 基础校验
|
||||
if (ObjectUtil.isEmpty(orderType)) {
|
||||
throw new BadRequestException("分切订单类型不能为空");
|
||||
@@ -721,17 +724,18 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
json.put("is_child_ps_ok", "0");
|
||||
json.put("is_delete", "0");
|
||||
tab.insert(json);
|
||||
|
||||
result.put("RTYPE", "S");
|
||||
result.put("RTMSG", "操作成功!");
|
||||
result.put("RTOAL", 1);
|
||||
result.put("RTDAT", null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
result.put("RTYPE", "E");
|
||||
result.put("RTMSG", "操作失败!" + e.getMessage());
|
||||
result.put("RTOAL", 0);
|
||||
result.put("RTDAT", null);
|
||||
}
|
||||
result.put("RTYPE", "S");
|
||||
result.put("RTMSG", "操作成功!");
|
||||
result.put("RTOAL", 1);
|
||||
result.put("RTDAT", null);
|
||||
|
||||
log.info("cutPlanTransfer接口输出参数为:-------------------" + result.toString());
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user