This commit is contained in:
2023-02-10 11:44:00 +08:00
parent a6b817d8ac
commit 73c64455a3
11 changed files with 104 additions and 40 deletions

View File

@@ -104,6 +104,14 @@ public class MesToLmsController {
return new ResponseEntity<>(mesToLmsService.childRollInfoUpdate(jo), HttpStatus.OK);
}
@PostMapping("/cutPlanTransferCancel")
@Log("分切计划取消")
@ApiOperation("分切计划取消")
@SaIgnore
public ResponseEntity<Object> cutPlanTransferCancel(@RequestBody JSONObject jo) {
return new ResponseEntity<>(mesToLmsService.cutPlanTransferCancel(jo), HttpStatus.OK);
}

View File

@@ -53,4 +53,9 @@ public interface MesToLmsService {
* 子卷信息更新:计划外需求有可能入库完成后ERP才回传计划外需求SalesOrder
*/
JSONObject childRollInfoUpdate(JSONObject param);
/**
* 分切计划取消
*/
JSONObject cutPlanTransferCancel(JSONObject param);
}

View File

@@ -1076,4 +1076,47 @@ public class MesToLmsServiceImpl implements MesToLmsService {
log.info("childRollInfoUpdate接口输出参数为-------------------" + result.toString());
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public JSONObject cutPlanTransferCancel(JSONObject param){
log.info("cutPlanTransferCancel接口输入参数为-------------------" + param.toString());
JSONObject result = new JSONObject();
try {
String ContainerName = param.getString("ContainerName");
String CancelledDate = param.getString("CancelledDate");
if(StrUtil.isEmpty(ContainerName)){
throw new BadRequestException("子卷号不能为空!");
}
JSONObject plan_jo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '"+ContainerName+"'").uniqueResult(0);
if (ObjectUtil.isEmpty(plan_jo)){
throw new BadRequestException("系统中不存在子卷号为:"+ContainerName+"的分切计划!");
}
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
plan_jo.put("is_delete","1");
plan_jo.put("update_optid", currentUserId);
plan_jo.put("update_optname", nickName);
plan_jo.put("update_time", DateUtil.now());
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");
result.put("RTOAL", 1);
result.put("RTDAT", null);
System.out.println(result);
} catch (Exception e) {
result.put("RTYPE", "E");
result.put("RTMSG", "操作失败!" + e.getMessage());
result.put("RTOAL", 0);
result.put("RTDAT", null);
System.out.println(result);
}
log.info("childRollInfoUpdate接口输出参数为-------------------" + result.toString());
return result;
}
}

View File

@@ -119,7 +119,7 @@ public class BakingServiceImpl implements BakingService {
hotParam.put("qty_unit_id", jsonMater.getString("base_unit_id"));
hotParam.put("task_id", task_id);
hotParam.put("start_point_code", point_code1);
hotParam.put("next_point_code", jsonHotIvt.getString("point_code"));
hotParam.put("end_point_code", jsonHotIvt.getString("point_code"));
hotParam.put("temperature", temperature);
hotParam.put("oven_time", hours);
this.createHotIoMst(hotParam);
@@ -160,7 +160,7 @@ public class BakingServiceImpl implements BakingService {
JSONObject point_code2_jo = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
if (ObjectUtil.isEmpty(point_code2_jo)){
throw new BadRequestException("未查询到符合的对接位!");
throw new BadRequestException("未查询到可用的点位类型为入箱的烘箱对接位!");
}
String point_code2 = point_code2_jo.getString("point_code");
/*if (ObjectUtil.isEmpty(pointArr)) {
@@ -178,7 +178,7 @@ public class BakingServiceImpl implements BakingService {
jsonMap.put("max_temperature", NumberUtil.add(temperature, temperature_lose));
jsonMap.put("point_location", map.getString("point_location"));
JSONObject jsonHotIvt = WQL.getWO("PDA_BAKING_01").addParamMap(jsonMap).process().uniqueResult(0);
if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("烘烤区没有合适温度的空位");
if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("烘烤区没有合适温度的空位");
// 3.创建冷却区 --> 烘烤区任务
JSONObject param = new JSONObject();
@@ -197,7 +197,7 @@ public class BakingServiceImpl implements BakingService {
// 4.插入烘箱区出入主表
JSONObject jsonRaw = rawTab.query("container_name = '" + container_name + "' and is_delete = '0'").uniqueResult(0);
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("物料不存在");
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("物料基础信息中无此物料!");
JSONObject hotParam = new JSONObject();
hotParam.put("container_name", container_name);
@@ -247,7 +247,7 @@ public class BakingServiceImpl implements BakingService {
String point_code1 = whereJson.getString("point_code");
if (ObjectUtil.isEmpty(point_code1)) throw new BadRequestException("点位不能为空");
JSONObject jsonHotIvt = hosIvtTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("对应烘箱点位不存在");
if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("烘烤区域无此点位!");
//查询该点位是否存在未完成的任务
boolean have_task = new CutConveyorTask().isSingleTask(point_code1);
@@ -282,7 +282,7 @@ public class BakingServiceImpl implements BakingService {
map.put("point_type", "5");
JSONArray pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().getResultJSONArray(0);
if (ObjectUtil.isEmpty(pointArr)) throw new BadRequestException("没有可用的出箱暂存位");
if (ObjectUtil.isEmpty(pointArr)) throw new BadRequestException("没有可用的点位类型为出箱的烘箱对接位!");
// 2.判断暂存位是否有任务:找到无任务的暂存位
String point_code2 = "";
@@ -299,7 +299,7 @@ public class BakingServiceImpl implements BakingService {
break;
}
}
if (ObjectUtil.isEmpty(point_code2)) throw new BadRequestException("没有可用的出箱暂存位");
if (ObjectUtil.isEmpty(point_code2)) throw new BadRequestException("没有可用的点位类型为出箱的烘箱对接位!");
// 3.创建任务
JSONObject param = new JSONObject();
param.put("point_code1", point_code1);
@@ -348,7 +348,7 @@ public class BakingServiceImpl implements BakingService {
// 1.获取此暂存位的生产区域和上下位置
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("点位不存在");
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("冷却区内此点位不存在");
// 2.找冷却区空货位
JSONObject map = new JSONObject();
@@ -392,7 +392,7 @@ public class BakingServiceImpl implements BakingService {
JSONObject jsonRaw = rawTab.query("container_name = '" + container_name + "' and is_delete = '0'").uniqueResult(0);
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("物料不存在");
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("物料基础信息中无此物料!");
JSONObject jsonCool = new JSONObject();
jsonCool.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());

View File

@@ -70,7 +70,7 @@ public class HandleBakingServiceImpl implements HandleBakingService {
JSONObject jsonRaw = rawTab.query("container_name = '" + container_name + "' and is_delete = '0'").uniqueResult(0);
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("物料不存在");
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("物料基础信息中无此物料");
if (StrUtil.equals(option, "1")) {
@@ -181,7 +181,7 @@ public class HandleBakingServiceImpl implements HandleBakingService {
} else if (StrUtil.equals(option, "2")) {
JSONObject cool_ivt = WQLObject.getWQLObject("st_ivt_hotpointivt").query("point_code = '" + point_code1 + "'").uniqueResult(0);
if(ObjectUtil.isEmpty(cool_ivt)){
throw new BadRequestException("请扫描正确的冷却区满轴点位!");
throw new BadRequestException("请扫描正确的烘烤区点位!");
}
String on_container_name = cool_ivt.getString("container_name");
if (!on_container_name.equals(container_name)) {

View File

@@ -95,7 +95,7 @@
AND
is_child_ps_ok = 0
AND
is_delete = '0'
plan.is_delete = '0'
OPTION 输入.product_area <> ""
ivt.product_area = 输入.product_area
ENDOPTION
@@ -185,6 +185,8 @@
is_child_tz_ok = 1
AND
is_child_ps_ok = 1
AND
plan.is_delete = '0'
OPTION 输入.product_area <> ""
ivt.product_area = 输入.product_area
ENDOPTION
@@ -213,7 +215,7 @@
AND
is_child_ps_ok = 0
AND
is_delete = '0'
plan.is_delete = '0'
OPTION 输入.product_area <> ""
ivt.product_area = 输入.product_area
ENDOPTION
@@ -263,6 +265,8 @@
plan.is_child_ps_ok = '1'
AND
plan.status = '03'
AND
plan.is_delete = '0'
OPTION 输入.product_area <> ""
del.product_area = 输入.product_area
ENDOPTION
@@ -355,7 +359,7 @@
AND
is_parent_ok = 0
AND
is_delete = '0'
plan.is_delete = '0'
OPTION 输入.product_area <> ""
ivt.product_area = 输入.product_area
ENDOPTION
@@ -403,6 +407,7 @@
task.task_type = '010402'
AND IFNULL( plan.qzzno, '' ) <> ''
AND task.is_delete = '0'
AND plan.is_delete = '0'
AND task.task_status < '07'
OPTION 输入.product_area <> ""
cut.product_area = 输入.product_area
@@ -421,6 +426,8 @@
LEFT JOIN st_ivt_cutpointivt cut ON cut.ext_code = plan.resource_name
WHERE
ivt.point_status = '03'
AND
plan.is_delete = '0'
OPTION 输入.product_area <> ""
cut.product_area = 输入.product_area
ENDOPTION
@@ -437,6 +444,8 @@
LEFT JOIN st_ivt_cutpointivt cut ON cut.ext_code = plan.resource_name
WHERE
plan.qzzno = 输入.qzzno
AND
plan.is_delete = '0'
OPTION 输入.product_area <> ""
cut.product_area = 输入.product_area
ENDOPTION
@@ -464,6 +473,7 @@
WHERE
ivt.point_status = '03'
AND plan.`status` = '03'
AND plan.is_delete = '0'
AND plan.resource_name = 输入.resource_name
ORDER BY
plan.manufacture_sort,
@@ -503,6 +513,8 @@
is_child_ps_ok = '1'
AND
`status` = '03'
AND
plan.is_delete = '0'
AND
del.point_status = '03'
OPTION 输入.ext_code <> ""

View File

@@ -63,7 +63,7 @@ public class CoolInServiceImpl implements CoolInService {
// 查询终点在冷却区是否存在
JSONObject jsonCoolIvt = coolIvtTab.query("full_point_code = '" + point_code + "' and full_point_status = '01' and empty_point_status = '01' and is_used = '1'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonCoolIvt)) throw new BadRequestException("此点位不存在或被占用"+point_code);
if (ObjectUtil.isEmpty(jsonCoolIvt)) throw new BadRequestException("冷却区不存在该满轴点位或空轴、满轴点位上有货!");
//查询该点位是否存在任务
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 like '%"+jsonCoolIvt.getString("point_code")+"%' OR point_code2 like '%"+jsonCoolIvt.getString("point_code")+"%') AND is_delete = '0' AND task_status < '07'").uniqueResult(0);
@@ -93,7 +93,7 @@ public class CoolInServiceImpl implements CoolInService {
coolIvtTab.insert(jsonCool);*/
// 校验母卷号是否已存在
JSONObject json = coolIvtTab.query("container_name = '" + raw_jo.getString("container_name") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(json)) throw new BadRequestException("此母卷库存已存在");
if (ObjectUtil.isNotEmpty(json)) throw new BadRequestException("冷却区中此母卷库存已存在");
//查询对应母卷信息
JSONObject mom_jo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder").query("container_name = '"+raw_jo.getString("container_name")+"'").uniqueResult(0);

View File

@@ -58,31 +58,14 @@
WHEN '06' THEN '执行中'
END
) AS task_status,
(
CASE task_type
WHEN '010101' THEN '标准任务'
WHEN '010102' THEN '取满(生箔->冷却)'
WHEN '010103' THEN '取空(冷却->生箔)'
WHEN '010201' THEN '冷却->烘箱'
WHEN '010202' THEN '烘箱->暂存位'
WHEN '010203' THEN '暂存位->烘箱'
WHEN '010204' THEN '暂存位->冷却'
WHEN '010301' THEN '标准任务'
WHEN '010302' THEN '取满(冷却->分切)'
WHEN '010303' THEN '取空(分切->冷却)'
WHEN '010401' THEN '输送出'
WHEN '010402' THEN '输送入'
WHEN '010403' THEN '桁架标准任务'
WHEN '010404' THEN '分切>输送线'
WHEN '010405' THEN '输送线>分切'
END
) AS task_type,
class.class_name AS task_type,
car_no,
create_time,
vehicle_code2,
material_code
FROM
SCH_BASE_Task
SCH_BASE_Task task
LEFT JOIN md_pb_classstandard class ON class.class_code = task.task_type
WHERE
is_delete = '0'
AND task_status <> '07'

View File

@@ -13,6 +13,8 @@ import org.nl.modules.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.system.service.user.ISysUserService;
import org.nl.system.service.user.dao.SysUser;
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
import org.nl.wms.st.inbill.service.StorPublicService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -31,6 +33,8 @@ public class InbillServiceImpl {
private final StorPublicService storPublicService;
private final ISysUserService iSysUserService;
public void operatePoint(String operate, JSONObject form) {
WQLObject point_table = WQLObject.getWQLObject("SCH_BASE_Point");
WQLObject struct_table = WQLObject.getWQLObject("ST_IVT_StructAttr");
@@ -191,7 +195,8 @@ public class InbillServiceImpl {
// 调用接口回传
JSONObject paramMesMst = new JSONObject();
paramMesMst.put("PackageBoxSN",box_row.getString("box_no"));
paramMesMst.put("User",box_row.getString("confirm_optname"));
SysUser sysUser = iSysUserService.getById(box_row.getString("confirm_optid"));
paramMesMst.put("User",sysUser.getUsername());
// new LmsToMesServiceImpl().childRollFGInboundComplete(paramMesMst);
}
}

View File

@@ -11,12 +11,15 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.system.service.param.impl.SysParamServiceImpl;
import org.nl.system.service.user.ISysUserService;
import org.nl.system.service.user.dao.SysUser;
import org.nl.system.service.user.dto.CurrentUser;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.modules.wql.util.WqlUtil;
import org.nl.system.service.user.dto.UserDto;
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
import org.nl.wms.ext.sap.service.impl.LmsToSapServiceImpl;
@@ -42,6 +45,8 @@ import java.util.Map;
public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
private final TransactionTemplate transactionTemplate;
private final ISysUserService iSysUserService;
@Override
public Map<String, Object> pageQuery(Map whereJson, Pageable page) {
HashMap map = new HashMap<>(whereJson);
@@ -114,7 +119,8 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
// 调用接口回传
JSONObject paramMesMst = new JSONObject();
paramMesMst.put("PackageBoxSN", box_row.getString("box_no"));
paramMesMst.put("User", box_row.getString("confirm_optname"));
SysUser sysUser = iSysUserService.getById(box_row.getString("confirm_optid"));
paramMesMst.put("User", sysUser.getUsername());
new LmsToMesServiceImpl().childRollFGInboundComplete(paramMesMst);
jo_mst.put("is_upload", "1");
@@ -706,7 +712,8 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
// 调用接口回传
JSONObject paramMesMst = new JSONObject();
paramMesMst.put("PackageBoxSN", box_row.getString("box_no"));
paramMesMst.put("User", box_row.getString("confirm_optname"));
SysUser sysUser = iSysUserService.getById(box_row.getString("confirm_optid"));
paramMesMst.put("User", sysUser.getUsername());
new LmsToMesServiceImpl().childRollFGInboundComplete(paramMesMst);

View File

@@ -145,7 +145,8 @@
QUERY
SELECT DISTINCT
dis.box_no,
mst.confirm_optname
mst.confirm_optname,
mst.confirm_optid
FROM
st_ivt_iostorinvdis dis
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id