This commit is contained in:
2023-02-20 13:40:55 +08:00
parent 9b3909ad96
commit 2abf86ef7a
7 changed files with 185 additions and 109 deletions

View File

@@ -202,7 +202,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
} catch (Exception e) { } catch (Exception e) {
throw new BadRequestException("MES提示错误" + e.getMessage()); log.info("MES提示错误" + e.getMessage());
} }
return result; return result;
} }
@@ -252,7 +252,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
} catch (Exception e) { } catch (Exception e) {
throw new BadRequestException("MES提示错误" + e.getMessage()); log.info("MES提示错误" + e.getMessage());
} }
return result; return result;
} }
@@ -363,7 +363,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
} catch (Exception e) { } catch (Exception e) {
throw new BadRequestException("MES提示错误" + e.getMessage()); log.info("MES提示错误" + e.getMessage());
} }
return result; return result;
} }

View File

@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.K;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
@@ -653,10 +654,22 @@ public class MesToLmsServiceImpl implements MesToLmsService {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
try { try {
String is_mesTolms = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("is_mesTolms").getValue(); if (ObjectUtil.isEmpty(param)) {
if (StrUtil.equals(is_mesTolms, "1")) { throw new BadRequestException("MES传入的参数不能为空");
}
String Status = param.getJSONObject(0).getString("Status"); String Status = param.getJSONObject(0).getString("Status");
String ResourceName = param.getJSONObject(0).getString("ResourceName");
JSONObject cut_jo = WQLObject.getWQLObject("ST_IVT_CutPointIvt").query("ext_code = '" + ResourceName + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(cut_jo)) {
throw new BadRequestException("分切计划对应的分切机不存在:" + ResourceName);
}
if ("0".equals(cut_jo.getString("is_used"))) {
result.put("RTYPE", "S");
result.put("RTMSG", "设备" + ResourceName + "在LMS系统中未启用!");
result.put("RTOAL", 1);
result.put("RTDAT", null);
return result;
}
if (Status.equals("1")) { if (Status.equals("1")) {
//更新分切计划表状态 //更新分切计划表状态
for (int i = 0; i < param.size(); i++) { for (int i = 0; i < param.size(); i++) {
@@ -671,11 +684,6 @@ public class MesToLmsServiceImpl implements MesToLmsService {
} }
if (Status.equals("2")) { if (Status.equals("2")) {
String ResourceName = param.getJSONObject(0).getString("ResourceName");
JSONObject cut_jo = WQLObject.getWQLObject("ST_IVT_CutPointIvt").query("ext_code = '" + ResourceName + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(cut_jo)) {
throw new BadRequestException("分切点位库存不存在:" + ResourceName);
}
String up_point_code = cut_jo.getString("up_point_code"); String up_point_code = cut_jo.getString("up_point_code");
String down_point_code = cut_jo.getString("down_point_code"); String down_point_code = cut_jo.getString("down_point_code");
@@ -697,11 +705,14 @@ public class MesToLmsServiceImpl implements MesToLmsService {
} }
if (ObjectUtil.isEmpty(up_rows) && ObjectUtil.isEmpty(down_rows)) { if (ObjectUtil.isEmpty(up_rows) && ObjectUtil.isEmpty(down_rows)) {
throw new BadRequestException("分切机上轴、下轴不存在一个分切计划"); throw new BadRequestException("MES传入的分切计划不能为空");
} }
//查询输送线上该分切机下一分切组可用的气涨轴 //查询输送线上该分切机下一分切组可用的气涨轴
JSONObject group_jo = WQL.getWO("PDA_02").addParam("flag", "14").addParam("resource_name", ResourceName).process().uniqueResult(0); JSONObject group_jo = WQL.getWO("PDA_02").addParam("flag", "14").addParam("resource_name", ResourceName).process().uniqueResult(0);
if (ObjectUtil.isEmpty(group_jo)){
group_jo = new JSONObject();
}
JSONArray del_rows = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("resource_name = '" + ResourceName + "' AND split_group = '" + group_jo.getString("split_group") + "' AND (parent_container_name = '" + group_jo.getString("source_container_name") + "' OR parent_container_name = '" + group_jo.getString("source_container_name") + "')").getResultJSONArray(0); JSONArray del_rows = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("resource_name = '" + ResourceName + "' AND split_group = '" + group_jo.getString("split_group") + "' AND (parent_container_name = '" + group_jo.getString("source_container_name") + "' OR parent_container_name = '" + group_jo.getString("source_container_name") + "')").getResultJSONArray(0);
if (up_rows.size() > 0) { if (up_rows.size() > 0) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
@@ -745,18 +756,16 @@ public class MesToLmsServiceImpl implements MesToLmsService {
inService.confirm(whereJson); inService.confirm(whereJson);
} }
} }
}
result.put("RTYPE", "S"); result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!"); result.put("RTMSG", "操作成功!");
result.put("RTOAL", 1); result.put("RTOAL", 1);
result.put("RTDAT", null); result.put("RTDAT", null);
System.out.println(result);
} 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);
System.out.println(result);
} }
log.info("childRollCutStartComp接口输出参数为-------------------" + result.toString()); log.info("childRollCutStartComp接口输出参数为-------------------" + result.toString());
return result; return result;

View File

@@ -52,12 +52,19 @@ public class RawFoilController {
} }
@PostMapping("/needEmptyAxis") @PostMapping("/needEmptyAxis")
@Log("呼叫空轴") @Log("呼叫")
@ApiOperation("呼叫空轴") @ApiOperation("呼叫")
public ResponseEntity<Object> needEmptyAxis(@RequestBody JSONObject whereJson) { public ResponseEntity<Object> needEmptyAxis(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(rawFoilService.needEmptyAxis(whereJson), HttpStatus.OK); return new ResponseEntity<>(rawFoilService.needEmptyAxis(whereJson), HttpStatus.OK);
} }
@PostMapping("/needEmptyVehicle")
@Log("呼叫空轴")
@ApiOperation("呼叫空轴")
public ResponseEntity<Object> needEmptyVehicle(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(rawFoilService.needEmptyVehicle(whereJson), HttpStatus.OK);
}
@PostMapping("/confirmBlanking") @PostMapping("/confirmBlanking")
@Log("确认下卷") @Log("确认下卷")
@ApiOperation("确认下卷") @ApiOperation("确认下卷")

View File

@@ -27,12 +27,19 @@ public interface RawFoilService {
JSONObject queryRawFoilList(JSONObject whereJson, HttpContext ctx); JSONObject queryRawFoilList(JSONObject whereJson, HttpContext ctx);
/** /**
* 呼叫空卷轴 * 呼叫
* @param whereJson / * @param whereJson /
* @return JSONObject * @return JSONObject
*/ */
JSONObject needEmptyAxis(JSONObject whereJson); JSONObject needEmptyAxis(JSONObject whereJson);
/**
* 呼叫空卷轴
* @param whereJson /
* @return JSONObject
*/
JSONObject needEmptyVehicle(JSONObject whereJson);
/** /**
* 下卷确认 * 下卷确认
* @param whereJson / * @param whereJson /

View File

@@ -107,7 +107,7 @@ public class OutServiceImpl implements OutService {
throw new BadRequestException("未查询到对应的分切机!"); throw new BadRequestException("未查询到对应的分切机!");
} }
if (!StrUtil.equals(rows.getJSONObject(0).getString("point_code"), cut_ivt.getString("point_code"))) { if (!StrUtil.equals(rows.getJSONObject(0).getString("resource_name"), cut_ivt.getString("ext_code"))) {
throw new BadRequestException("请选择和分切计划相同的设备点位进行上空轴!"); throw new BadRequestException("请选择和分切计划相同的设备点位进行上空轴!");
} }

View File

@@ -186,6 +186,51 @@ public class RawFoilServiceImpl implements RawFoilService {
return jo; return jo;
} }
@Override
@Transactional(rollbackFor = Exception.class)
public JSONObject needEmptyVehicle(JSONObject whereJson) {
String point_code = whereJson.getString("point_code");
if (ObjectUtil.isEmpty(point_code)){
throw new BadRequestException("输入的点位不能为空!");
}
JSONObject raw_jo = WQLObject.getWQLObject("st_ivt_sbpointivt").query("point_code = '"+point_code+"'").uniqueResult(0);
if (ObjectUtil.isEmpty(raw_jo)){
throw new BadRequestException("未查到相关的生箔机点位!");
}
// 2.根据就近原则查对应空卷抽
JSONObject map = new JSONObject();
map.put("flag", "1");
map.put("product_area", raw_jo.getString("product_area"));
map.put("point_location", raw_jo.getString("point_location"));
JSONObject jsonIvt = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
// 3.如果没找到则继续找下一节点
String start_pint_code = "";
if (ObjectUtil.isEmpty(jsonIvt)) {
/*String point_location = jsonSb.getString("point_location");
if (StrUtil.equals(point_location, "0")) map.put("point_location", "1");
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);*/
throw new BadRequestException("未查询到有空轴且母卷位置为空的点位!");
} else {
start_pint_code = jsonIvt.getString("empty_point_code");
}
// 起点和终点确定 生成任务
JSONObject param = new JSONObject();
param.put("point_code1", start_pint_code);
param.put("point_code2", point_code+"_K");
param.put("task_type", "010103");
param.put("product_area", jsonIvt.getString("product_area"));
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
callEmpReelTask.createTask(param);
JSONObject jo = new JSONObject();
jo.put("message", "操作成功!");
return jo;
}
@Override @Override
public JSONObject confirmBlanking(JSONObject whereJson) { public JSONObject confirmBlanking(JSONObject whereJson) {
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单 WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单

View File

@@ -117,6 +117,7 @@
st_ivt_deliverypointivt ivt st_ivt_deliverypointivt ivt
WHERE WHERE
point_status = '02' point_status = '02'
AND ivt.is_used = '1'
AND NOT EXISTS ( AND NOT EXISTS (
SELECT SELECT
* *
@@ -147,6 +148,7 @@
st_ivt_deliverypointivt ivt st_ivt_deliverypointivt ivt
WHERE WHERE
point_status = '01' point_status = '01'
AND ivt.is_used = '1'
AND NOT EXISTS ( AND NOT EXISTS (
SELECT SELECT
* *
@@ -297,6 +299,7 @@
plan.is_child_ps_ok = '1' plan.is_child_ps_ok = '1'
AND AND
plan.status = '03' plan.status = '03'
AND del.is_used = '1'
AND AND
plan.is_delete = '0' plan.is_delete = '0'
OPTION 输入.product_area <> "" OPTION 输入.product_area <> ""
@@ -361,7 +364,7 @@
FROM FROM
st_ivt_deliverypointivt del st_ivt_deliverypointivt del
WHERE WHERE
1=1 del.is_used = '1'
OPTION 输入.product_area <> "" OPTION 输入.product_area <> ""
del.product_area = 输入.product_area del.product_area = 输入.product_area
ENDOPTION ENDOPTION
@@ -513,6 +516,7 @@
ivt.point_status = '03' ivt.point_status = '03'
AND plan.`status` = '03' AND plan.`status` = '03'
AND plan.is_delete = '0' AND plan.is_delete = '0'
AND ivt.is_used = '1'
AND plan.resource_name = 输入.resource_name AND plan.resource_name = 输入.resource_name
ORDER BY ORDER BY
plan.manufacture_sort, plan.manufacture_sort,
@@ -556,6 +560,8 @@
plan.is_delete = '0' plan.is_delete = '0'
AND AND
del.point_status = '03' del.point_status = '03'
AND
del.is_used = '1'
OPTION 输入.ext_code <> "" OPTION 输入.ext_code <> ""
plan.resource_name = 输入.ext_code plan.resource_name = 输入.ext_code
ENDOPTION ENDOPTION
@@ -578,6 +584,8 @@
point_location = 输入.point_location point_location = 输入.point_location
AND AND
point_code <> 输入.point_code point_code <> 输入.point_code
AND
ivt.is_used = '1'
OPTION 输入.find_type = "1" OPTION 输入.find_type = "1"
point_status <> '01' point_status <> '01'
ENDOPTION ENDOPTION