|
@ -32,10 +32,8 @@ import org.nl.b_lms.sch.tasks.first_floor_area.GzqTask; |
|
|
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant; |
|
|
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant; |
|
|
import org.nl.b_lms.sch.tasks.slitter.service.SlitterService; |
|
|
import org.nl.b_lms.sch.tasks.slitter.service.SlitterService; |
|
|
import org.nl.common.enums.PackageInfoIvtEnum; |
|
|
import org.nl.common.enums.PackageInfoIvtEnum; |
|
|
import org.nl.common.utils.SecurityUtils; |
|
|
import org.nl.common.utils.*; |
|
|
import org.nl.common.utils.TaskUtils; |
|
|
|
|
|
import org.nl.modules.common.exception.BadRequestException; |
|
|
import org.nl.modules.common.exception.BadRequestException; |
|
|
import org.nl.common.utils.CodeUtil; |
|
|
|
|
|
import org.nl.modules.wql.WQL; |
|
|
import org.nl.modules.wql.WQL; |
|
|
import org.nl.modules.wql.core.bean.WQLObject; |
|
|
import org.nl.modules.wql.core.bean.WQLObject; |
|
|
import org.nl.modules.wql.util.SpringContextHolder; |
|
|
import org.nl.modules.wql.util.SpringContextHolder; |
|
@ -68,6 +66,7 @@ import javax.annotation.Resource; |
|
|
import java.util.HashMap; |
|
|
import java.util.HashMap; |
|
|
import java.util.HashSet; |
|
|
import java.util.HashSet; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
@ -565,10 +564,8 @@ public class MesToLmsServiceImpl implements MesToLmsService { |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public Map cutPlanTransfer(JSONObject param) { |
|
|
public JSONObject cutPlanTransfer(JSONObject param) { |
|
|
|
|
|
log.info("cutPlanTransfer接口输入参数为:-------------------" + param.toString()); |
|
|
log.info("cutPlanTransfer接口输入参数为:-------------------" + param.toString()); |
|
|
|
|
|
|
|
|
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"); // 产品编码
|
|
@ -588,67 +585,24 @@ public class MesToLmsServiceImpl implements MesToLmsService { |
|
|
String Attribute4 = param.getString("Attribute4"); // 位置左右
|
|
|
String Attribute4 = param.getString("Attribute4"); // 位置左右
|
|
|
String Attribute5 = param.getString("Attribute5"); // 是否套轴
|
|
|
String Attribute5 = param.getString("Attribute5"); // 是否套轴
|
|
|
String Attribute6 = param.getString("Attribute6"); // 是否套轴
|
|
|
String Attribute6 = param.getString("Attribute6"); // 是否套轴
|
|
|
|
|
|
String parentContainerName = param.getString("ParentContainerName"); |
|
|
WQLObject tab = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan"); |
|
|
String restructContainerName = param.getString("RestructContainerName"); |
|
|
|
|
|
|
|
|
JSONObject result = new JSONObject(); |
|
|
|
|
|
try { |
|
|
try { |
|
|
// 基础校验
|
|
|
// 基础校验
|
|
|
if (ObjectUtil.isEmpty(orderType)) { |
|
|
AssertNullUtils.batch(MapOf.of( |
|
|
throw new BadRequestException("分切订单类型不能为空"); |
|
|
"orderType",orderType,"ContainerName",ContainerName,"ProductName",ProductName, |
|
|
} |
|
|
"Description",Description,"Warehouse",Warehouse,"ResourceName",ResourceName |
|
|
if (ObjectUtil.isEmpty(ContainerName)) { |
|
|
,"SplitGroup",SplitGroup,"ManufactureSort",ManufactureSort,"MfgOrderName",MfgOrderName |
|
|
throw new BadRequestException("子卷号不能为空"); |
|
|
,"ManufactureDate",ManufactureDate,"PaperTubeOrFRP",PaperTubeOrFRP,"SplitBreadth",SplitBreadth |
|
|
} |
|
|
,"SplitHeight",SplitHeight,"SplitWeight",SplitWeight)); |
|
|
if (ObjectUtil.isEmpty(ProductName)) { |
|
|
|
|
|
throw new BadRequestException("产品编码不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (ObjectUtil.isEmpty(Description)) { |
|
|
|
|
|
throw new BadRequestException("产品名称不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (ObjectUtil.isEmpty(Warehouse)) { |
|
|
|
|
|
throw new BadRequestException("来源卷位置不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (ObjectUtil.isEmpty(ResourceName)) { |
|
|
|
|
|
throw new BadRequestException("分切机台编码不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (ObjectUtil.isEmpty(SplitGroup)) { |
|
|
|
|
|
throw new BadRequestException("分切组不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (ObjectUtil.isEmpty(ManufactureSort)) { |
|
|
|
|
|
throw new BadRequestException("生产顺序不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (ObjectUtil.isEmpty(MfgOrderName)) { |
|
|
|
|
|
throw new BadRequestException("生产订单不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (ObjectUtil.isEmpty(ManufactureDate)) { |
|
|
|
|
|
throw new BadRequestException("生产日期不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (ObjectUtil.isEmpty(PaperTubeOrFRP)) { |
|
|
|
|
|
throw new BadRequestException("管件类型不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (ObjectUtil.isEmpty(SplitBreadth)) { |
|
|
|
|
|
throw new BadRequestException("子卷幅宽不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (ObjectUtil.isEmpty(SplitHeight)) { |
|
|
|
|
|
throw new BadRequestException("子卷理论长度不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (ObjectUtil.isEmpty(SplitWeight)) { |
|
|
|
|
|
throw new BadRequestException("子卷理论重量不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* orderType |
|
|
/* orderType |
|
|
* 1.当订单类型为1(常规)时 ParentContainerName 来源母卷号不能为空 |
|
|
* 1.当订单类型为1(常规)时 ParentContainerName 来源母卷号不能为空 |
|
|
* 2.当订单类型为2(改制)时 RestructContainerName 改制来源子卷号、PackageBoxSN 子卷立库木箱号 不能为空 |
|
|
* 2.当订单类型为2(改制)时 RestructContainerName 改制来源子卷号、PackageBoxSN 子卷立库木箱号 不能为空 |
|
|
*/ |
|
|
*/ |
|
|
if (StrUtil.equals(orderType, "1")) { |
|
|
if (StrUtil.equals(orderType, "1")) { |
|
|
if (ObjectUtil.isEmpty(param.getString("ParentContainerName"))) { |
|
|
AssertNullUtils.batch(MapOf.of("parentContainerName", parentContainerName)); |
|
|
throw new BadRequestException("来源母卷号不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
if (ObjectUtil.isEmpty(param.getString("RestructContainerName"))) { |
|
|
AssertNullUtils.batch(MapOf.of("restructContainerName", restructContainerName)); |
|
|
throw new BadRequestException("改制来源子卷号不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
/* PaperTubeOrFRP |
|
|
/* PaperTubeOrFRP |
|
|
* 1.当管件类型为1(纸筒)时 PaperTubeMaterial 纸筒物料编码、PaperTubeDescription 纸筒物料描述、PaperTubeModel 纸筒规格 不能为空 |
|
|
* 1.当管件类型为1(纸筒)时 PaperTubeMaterial 纸筒物料编码、PaperTubeDescription 纸筒物料描述、PaperTubeModel 纸筒规格 不能为空 |
|
@ -657,15 +611,10 @@ public class MesToLmsServiceImpl implements MesToLmsService { |
|
|
String qzz_generation = "0"; |
|
|
String qzz_generation = "0"; |
|
|
String qzz_size = "0"; |
|
|
String qzz_size = "0"; |
|
|
if (StrUtil.equals(PaperTubeOrFRP, "1")) { |
|
|
if (StrUtil.equals(PaperTubeOrFRP, "1")) { |
|
|
if (ObjectUtil.isEmpty(param.getString("PaperTubeMaterial"))) { |
|
|
AssertNullUtils.batch(MapOf.of( |
|
|
throw new BadRequestException("纸筒物料编码不能为空"); |
|
|
"PaperTubeMaterial", param.getString("PaperTubeMaterial"), |
|
|
} |
|
|
"PaperTubeDescription",param.getString("PaperTubeDescription"), |
|
|
if (ObjectUtil.isEmpty(param.getString("PaperTubeDescription"))) { |
|
|
"PaperTubeModel",param.getString("PaperTubeModel"))); |
|
|
throw new BadRequestException("纸筒物料描述不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (ObjectUtil.isEmpty(param.getString("PaperTubeModel"))) { |
|
|
|
|
|
throw new BadRequestException("纸筒规格不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (param.getString("PaperTubeDescription").contains("3.12")) { |
|
|
if (param.getString("PaperTubeDescription").contains("3.12")) { |
|
|
qzz_generation = "4"; |
|
|
qzz_generation = "4"; |
|
|
} else if (param.getString("PaperTubeDescription").contains("3.15")) { |
|
|
} else if (param.getString("PaperTubeDescription").contains("3.15")) { |
|
@ -673,21 +622,15 @@ public class MesToLmsServiceImpl implements MesToLmsService { |
|
|
} else { |
|
|
} else { |
|
|
qzz_generation = "4"; |
|
|
qzz_generation = "4"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 解析描述数组
|
|
|
// 解析描述数组
|
|
|
String[] tubeArray = param.getString("PaperTubeDescription").split("\\|"); |
|
|
String[] tubeArray = param.getString("PaperTubeDescription").split("\\|"); |
|
|
// 定义尺寸与长度
|
|
|
// 定义尺寸与长度
|
|
|
qzz_size = Character.toString(tubeArray[2].charAt(0)); |
|
|
qzz_size = Character.toString(tubeArray[2].charAt(0)); |
|
|
} else { |
|
|
} else { |
|
|
if (ObjectUtil.isEmpty(param.getString("FRPMaterial"))) { |
|
|
AssertNullUtils.batch(MapOf.of( |
|
|
throw new BadRequestException("FRP管物料编码不能为空"); |
|
|
"FRPMaterial", param.getString("FRPMaterial"), |
|
|
} |
|
|
"FRPDescription",param.getString("FRPDescription"), |
|
|
if (ObjectUtil.isEmpty(param.getString("FRPDescription"))) { |
|
|
"FRP管规格不能为空",param.getString("FRP管规格不能为空"))); |
|
|
throw new BadRequestException("FRP管物料描述不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (ObjectUtil.isEmpty(param.getString("FRPModel"))) { |
|
|
|
|
|
throw new BadRequestException("FRP管规格不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (param.getString("FRPDescription").contains("3.12")) { |
|
|
if (param.getString("FRPDescription").contains("3.12")) { |
|
|
qzz_generation = "4"; |
|
|
qzz_generation = "4"; |
|
|
} else if (param.getString("FRPDescription").contains("3.15")) { |
|
|
} else if (param.getString("FRPDescription").contains("3.15")) { |
|
@ -695,78 +638,71 @@ public class MesToLmsServiceImpl implements MesToLmsService { |
|
|
} else { |
|
|
} else { |
|
|
qzz_generation = "4"; |
|
|
qzz_generation = "4"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 解析描述数组
|
|
|
// 解析描述数组
|
|
|
String[] tubeArray = param.getString("FRPDescription").split("\\|"); |
|
|
String[] tubeArray = param.getString("FRPDescription").split("\\|"); |
|
|
// 定义尺寸与长度
|
|
|
// 定义尺寸与长度
|
|
|
qzz_size = Character.toString(tubeArray[2].charAt(0)); |
|
|
qzz_size = Character.toString(tubeArray[2].charAt(0)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
JSONObject json = new JSONObject(); |
|
|
JSONObject json = new JSONObject(); |
|
|
json.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId()); |
|
|
packageDo:{ |
|
|
json.put("order_type", orderType); |
|
|
json.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId()); |
|
|
json.put("container_name", ContainerName); |
|
|
json.put("order_type", orderType); |
|
|
json.put("product_name", ProductName); |
|
|
json.put("container_name", ContainerName); |
|
|
json.put("description", Description); |
|
|
json.put("product_name", ProductName); |
|
|
json.put("parent_container_name", param.getString("ParentContainerName")); |
|
|
json.put("description", Description); |
|
|
json.put("restruct_container_name", param.getString("RestructContainerName")); |
|
|
json.put("parent_container_name", param.getString("ParentContainerName")); |
|
|
json.put("package_box_sn", param.getString("PackageBoxSN")); |
|
|
json.put("restruct_container_name", param.getString("RestructContainerName")); |
|
|
json.put("ware_house", Warehouse); |
|
|
json.put("package_box_sn", param.getString("PackageBoxSN")); |
|
|
json.put("resource_name", ResourceName); |
|
|
json.put("ware_house", Warehouse); |
|
|
json.put("split_group", SplitGroup); |
|
|
json.put("resource_name", ResourceName); |
|
|
json.put("manufacture_sort", ManufactureSort); |
|
|
json.put("split_group", SplitGroup); |
|
|
json.put("mfg_order_name", MfgOrderName); |
|
|
json.put("manufacture_sort", ManufactureSort); |
|
|
json.put("manufacture_date", ManufactureDate); |
|
|
json.put("mfg_order_name", MfgOrderName); |
|
|
json.put("paper_tube_or_FRP", PaperTubeOrFRP); |
|
|
json.put("manufacture_date", ManufactureDate); |
|
|
json.put("paper_tube_material", param.getString("PaperTubeMaterial")); |
|
|
json.put("paper_tube_or_FRP", PaperTubeOrFRP); |
|
|
json.put("paper_tube_description", param.getString("PaperTubeDescription")); |
|
|
json.put("paper_tube_material", param.getString("PaperTubeMaterial")); |
|
|
json.put("paper_tube_model", param.getString("PaperTubeModel")); |
|
|
json.put("paper_tube_description", param.getString("PaperTubeDescription")); |
|
|
json.put("FRP_material", param.getString("FRPMaterial")); |
|
|
json.put("paper_tube_model", param.getString("PaperTubeModel")); |
|
|
json.put("FRP_description", param.getString("FRPDescription")); |
|
|
json.put("FRP_material", param.getString("FRPMaterial")); |
|
|
json.put("FRP_model", param.getString("FRPModel")); |
|
|
json.put("FRP_description", param.getString("FRPDescription")); |
|
|
json.put("split_breadth", SplitBreadth); |
|
|
json.put("FRP_model", param.getString("FRPModel")); |
|
|
json.put("split_height", SplitHeight); |
|
|
json.put("split_breadth", SplitBreadth); |
|
|
json.put("split_weight", SplitWeight); |
|
|
json.put("split_height", SplitHeight); |
|
|
if (Attribute3.equals("U")) { |
|
|
json.put("split_weight", SplitWeight); |
|
|
json.put("up_or_down", "1"); |
|
|
if (Attribute3.equals("U")) { |
|
|
} else { |
|
|
json.put("up_or_down", "1"); |
|
|
json.put("up_or_down", "2"); |
|
|
} else { |
|
|
} |
|
|
json.put("up_or_down", "2"); |
|
|
if (Attribute4.equals("L")) { |
|
|
} |
|
|
json.put("left_or_right", "1"); |
|
|
if (Attribute4.equals("L")) { |
|
|
} else { |
|
|
json.put("left_or_right", "1"); |
|
|
json.put("left_or_right", "2"); |
|
|
} else { |
|
|
} |
|
|
json.put("left_or_right", "2"); |
|
|
json.put("qzz_size", qzz_size); |
|
|
} |
|
|
if (ResourceName.startsWith("B5") || ResourceName.startsWith("B6")) { |
|
|
json.put("qzz_size", qzz_size); |
|
|
json.put("is_paper_ok", "1"); |
|
|
if (ResourceName.startsWith("B5") || ResourceName.startsWith("B6")) { |
|
|
} |
|
|
json.put("is_paper_ok", "1"); |
|
|
if (Attribute5.equals("0")) { |
|
|
} |
|
|
json.put("is_paper_ok", "2"); |
|
|
if (Attribute5.equals("0")) { |
|
|
} |
|
|
json.put("is_paper_ok", "2"); |
|
|
json.put("sale_order_name", Attribute2); |
|
|
} |
|
|
json.put("material_type", Attribute6); |
|
|
json.put("sale_order_name", Attribute2); |
|
|
json.put("start_time", DateUtil.now()); |
|
|
json.put("material_type", Attribute6); |
|
|
json.put("status", "01"); |
|
|
json.put("start_time", DateUtil.now()); |
|
|
json.put("qzz_generation", qzz_generation); |
|
|
json.put("status", "01"); |
|
|
json.put("is_parent_ok", "0"); |
|
|
json.put("qzz_generation", qzz_generation); |
|
|
json.put("is_child_tz_ok", "0"); |
|
|
json.put("is_parent_ok", "0"); |
|
|
json.put("is_child_ps_ok", "0"); |
|
|
json.put("is_child_tz_ok", "0"); |
|
|
json.put("is_delete", "0"); |
|
|
json.put("is_child_ps_ok", "0"); |
|
|
tab.insert(json); |
|
|
json.put("is_delete", "0"); |
|
|
|
|
|
} |
|
|
result.put("RTYPE", "S"); |
|
|
PdmBiSlittingproductionplan slittingproductionplan = json.toJavaObject(PdmBiSlittingproductionplan.class); |
|
|
result.put("RTMSG", "操作成功!"); |
|
|
slittingproductionplanService.save(slittingproductionplan); |
|
|
result.put("RTOAL", 1); |
|
|
return MapOf.of("RTYPE", "S","RTMSG", "操作成功!","RTOAL", 1,"RTDAT", null); |
|
|
result.put("RTDAT", null); |
|
|
|
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
result.put("RTYPE", "E"); |
|
|
log.info("MES下发分切计划保存下发失败:-------------------" + e.getMessage()); |
|
|
result.put("RTMSG", "操作失败!" + e.getMessage()); |
|
|
return MapOf.of("RTYPE", "E","RTMSG", "操作失败!" + e.getMessage(),"RTOAL", 0,"RTDAT", null); |
|
|
result.put("RTOAL", 0); |
|
|
|
|
|
result.put("RTDAT", null); |
|
|
|
|
|
} |
|
|
} |
|
|
log.info("cutPlanTransfer接口输出参数为:-------------------" + result.toString()); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|