fix:分切计划改为按照母卷按照数组下发

This commit is contained in:
zhouz
2025-06-24 10:37:46 +08:00
parent 9853d7129e
commit 2a4742421a
3 changed files with 183 additions and 179 deletions

View File

@@ -53,8 +53,8 @@ public class MesToLmsController {
@PostMapping("/cutPlanTransfer") @PostMapping("/cutPlanTransfer")
@Log("分切包装段:分切计划(单表,包含母卷/改制子卷-包装箱号、空包装箱物料、纸筒/FRP管MES下发智能物流") @Log("分切包装段:分切计划(单表,包含母卷/改制子卷-包装箱号、空包装箱物料、纸筒/FRP管MES下发智能物流")
@SaIgnore @SaIgnore
public ResponseEntity<Object> cutPlanTransfer(@RequestBody JSONObject jo) { public ResponseEntity<Object> cutPlanTransfer(@RequestBody JSONArray ja) {
return new ResponseEntity<>(mesToLmsService.cutPlanTransfer(jo), HttpStatus.OK); return new ResponseEntity<>(mesToLmsService.cutPlanTransfer(ja), HttpStatus.OK);
} }
@PostMapping("/callNextAssAndMomRoll") @PostMapping("/callNextAssAndMomRoll")

View File

@@ -27,7 +27,7 @@ public interface MesToLmsService {
/** /**
* 分切包装段:分切计划(单表,包含母卷/改制子卷-包装箱号、空包装箱物料、纸筒/FRP管MES下发智能物流 * 分切包装段:分切计划(单表,包含母卷/改制子卷-包装箱号、空包装箱物料、纸筒/FRP管MES下发智能物流
*/ */
JSONObject cutPlanTransfer(JSONObject param); JSONObject cutPlanTransfer(JSONArray ja);
/** /**
* 分切即将完成,呼叫配送下一个母卷/改制子卷MES传智能物流 * 分切即将完成,呼叫配送下一个母卷/改制子卷MES传智能物流

View File

@@ -6,6 +6,7 @@ import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpStatus; import cn.hutool.http.HttpStatus;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -533,9 +534,15 @@ public class MesToLmsServiceImpl implements MesToLmsService {
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public JSONObject cutPlanTransfer(JSONObject param) { public JSONObject cutPlanTransfer(JSONArray ja) {
log.info("cutPlanTransfer接口输入参数为-------------------" + param.toString()); 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 orderType = param.getString("OrderType"); // 分切订单类型
String ContainerName = param.getString("ContainerName"); // 子卷号 String ContainerName = param.getString("ContainerName"); // 子卷号
String ProductName = param.getString("ProductName"); // 产品编码 String ProductName = param.getString("ProductName"); // 产品编码
@@ -556,10 +563,6 @@ public class MesToLmsServiceImpl implements MesToLmsService {
String Attribute5 = param.getString("Attribute5"); // 是否套轴 String Attribute5 = param.getString("Attribute5"); // 是否套轴
String Attribute6 = param.getString("Attribute6"); // 是否套轴 String Attribute6 = param.getString("Attribute6"); // 是否套轴
WQLObject tab = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan");
JSONObject result = new JSONObject();
try {
// 基础校验 // 基础校验
if (ObjectUtil.isEmpty(orderType)) { if (ObjectUtil.isEmpty(orderType)) {
throw new BadRequestException("分切订单类型不能为空"); throw new BadRequestException("分切订单类型不能为空");
@@ -721,17 +724,18 @@ public class MesToLmsServiceImpl implements MesToLmsService {
json.put("is_child_ps_ok", "0"); json.put("is_child_ps_ok", "0");
json.put("is_delete", "0"); json.put("is_delete", "0");
tab.insert(json); tab.insert(json);
}
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");
result.put("RTOAL", 1);
result.put("RTDAT", null);
} catch (Exception e) { } catch (Exception e) {
result.put("RTYPE", "E"); result.put("RTYPE", "E");
result.put("RTMSG", "操作失败!" + e.getMessage()); result.put("RTMSG", "操作失败!" + e.getMessage());
result.put("RTOAL", 0); result.put("RTOAL", 0);
result.put("RTDAT", null); result.put("RTDAT", null);
} }
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");
result.put("RTOAL", 1);
result.put("RTDAT", null);
log.info("cutPlanTransfer接口输出参数为-------------------" + result.toString()); log.info("cutPlanTransfer接口输出参数为-------------------" + result.toString());
return result; return result;
} }