This commit is contained in:
2022-12-12 15:30:26 +08:00
parent 0f788d9423
commit 57410a2102
4 changed files with 58 additions and 12 deletions

View File

@@ -31,7 +31,7 @@ public class EmptyVehicleServiceImpl implements EmptyVehicleService {
}
JSONObject point_jo = WQLObject.getWQLObject("st_ivt_coolpointivt").query("empty_point_code = '"+point_code+"'").uniqueResult(0);
if (ObjectUtil.isEmpty(point_jo)){
throw new BadRequestException("未查询到对应的点位设备");
throw new BadRequestException("未查询到对应点位,请扫描正确的空轴点位");
}
String empty_vehicle_code = point_jo.getString("empty_vehicle_code");
JSONObject vehicle_jo = new JSONObject();

View File

@@ -158,7 +158,7 @@ public class RawFoilServiceImpl implements RawFoilService {
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("未查询到可用点位");
throw new BadRequestException("未查询到有空轴且母卷位置为空的点位");
} else {
start_pint_code = jsonIvt.getString("empty_point_code");
point_code4 = jsonIvt.getString("full_point_code");
@@ -252,6 +252,14 @@ public class RawFoilServiceImpl implements RawFoilService {
JSONObject jsonCool = coolTab.query("workorder_id = '" + raw_jo.getString("workorder_id") + "'").uniqueResult(0);
//查询该生箔工单是否存在未完成的任务
String container_name = raw_jo.getString("container_name");
JSONObject task_jo = WQLObject.getWQLObject("").query("material_code = '"+container_name+"' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(task_jo)){
throw new BadRequestException("该生箔工单存在未完成的任务,请先完成任务!");
}
jsonCool.put("status", "09");
jsonCool.put("realend_time", DateUtil.now());
jsonCool.put("finish_type", "02");

View File

@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@Service
@@ -61,11 +62,13 @@ public class BookTwoConfirmTask extends AbstractAcsTask {
@Transactional
public void updateTaskStatus(JSONObject taskObj, String status) {
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工序工单表
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
String task_id = taskObj.getString("task_id");
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
@@ -75,9 +78,6 @@ public class BookTwoConfirmTask extends AbstractAcsTask {
}
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
// 更新任务状态为执行中
jsonTask.put("task_status", TaskStatusEnum.EXECUTING.getCode());
jsonTask.put("update_time", DateUtil.now());
@@ -128,6 +128,23 @@ public class BookTwoConfirmTask extends AbstractAcsTask {
jsonCool.put("confirm_optname", SecurityUtils.getCurrentUsername());
jsonCool.put("confirm_time", DateUtil.now());
coolTab.update(jsonCool);
//更新母卷工单状态
HashMap<String,String> map = new HashMap<>();
map.put("statuPDM_BI_RawFoilWorkOrders", "09");
map.put("realend_time", DateUtil.now());
map.put("update_optid",currentUserId+"");
map.put("update_optname",currentUsername);
jsonCool.put("finish_type", "01");
map.put("update_time",DateUtil.now());
WQLObject.getWQLObject("").update(map,"container_name = '"+jsonTask.getString("material_code")+"'");
jsonCool.put("status", "09");
jsonCool.put("realend_time", DateUtil.now());
jsonCool.put("finish_type", "01");
jsonCool.put("update_optid",currentUserId+"");
jsonCool.put("update_optname",currentUsername);
jsonCool.put("update_time",DateUtil.now());
rawTab.update(jsonCool);
}
}

View File

@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@Service
@@ -59,7 +60,6 @@ public class CallEmpReelTask extends AbstractAcsTask {
@Transactional
public void updateTaskStatus(JSONObject taskObj, String status) {
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工序工单表
@@ -68,6 +68,9 @@ public class CallEmpReelTask extends AbstractAcsTask {
String task_id = taskObj.getString("task_id");
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
if (StrUtil.equals(status, "0")) {
// 取消删除任务
taskTab.delete("task_id = '" + task_id + "'");
@@ -132,10 +135,21 @@ public class CallEmpReelTask extends AbstractAcsTask {
jsonCoolIvt.put("workorder_id", jsonRaw.getString("workorder_id"));
jsonCoolIvt.put("ivt_qty", jsonRaw.getString("productin_qty"));
ivtTab.update(jsonCoolIvt);
//更新母卷工单状态
HashMap<String,String> map = new HashMap<>();
map.put("status", "09");
map.put("realend_time", DateUtil.now());
map.put("update_optid",currentUserId+"");
map.put("update_optname",currentUsername);
map.put("finish_type", "01");
map.put("update_time",DateUtil.now());
WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(map,"container_name = '"+jsonTask.getString("material_code")+"'");
} else {
// 取空
JSONObject jsonCoolIvt = ivtTab.query("full_point_code = '" + point_code1 + "'").uniqueResult(0);
jsonCoolIvt.put("empty_point_status", "01");
jsonCoolIvt.put("empty_vehicle_code", "");
ivtTab.update(jsonCoolIvt);
}
} else {
@@ -150,6 +164,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
// 更新冷却库存状态
jsonIvt.put("empty_point_status", "01");
jsonIvt.put("empty_vehicle_code", "");
ivtTab.update(jsonIvt);
// 校验终点是否存在
@@ -157,8 +172,15 @@ public class CallEmpReelTask extends AbstractAcsTask {
if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("终点未找到可用点位:" + point_code2);
// 更新工单状态为完成
jsonRaw.put("status", "09");
rawTab.update(jsonRaw);
//更新母卷工单状态
HashMap<String,String> map = new HashMap<>();
map.put("status", "09");
map.put("realend_time", DateUtil.now());
map.put("update_optid",currentUserId+"");
map.put("update_optname",currentUsername);
map.put("finish_type", "01");
map.put("update_time",DateUtil.now());
WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(map,"container_name = '"+jsonTask.getString("material_code")+"'");
// 更新冷却库存状态
jsonIvt2.put("full_point_status", "02");
@@ -167,12 +189,11 @@ public class CallEmpReelTask extends AbstractAcsTask {
jsonIvt2.put("workorder_id", jsonRaw.getString("workorder_id"));
jsonIvt2.put("ivt_qty", jsonRaw.getString("productin_qty"));
ivtTab.update(jsonIvt2);
}
// 插入入库单
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
JSONObject jsonMater = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("产品不存在");