opt:任务相关操作代码优化
This commit is contained in:
@@ -39,6 +39,7 @@ import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.*;
|
|||||||
import org.nl.common.enums.NoticeTypeEnum;
|
import org.nl.common.enums.NoticeTypeEnum;
|
||||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||||
import org.nl.common.utils.CodeUtil;
|
import org.nl.common.utils.CodeUtil;
|
||||||
|
import org.nl.common.utils.MapOf;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
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;
|
||||||
@@ -170,7 +171,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
* @returnzss
|
* @returnzss
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public Map<String, Object> receiveTaskStatusAcs(String string) {
|
public Map<String, Object> receiveTaskStatusAcs(String string) {
|
||||||
log.info("acs向lms反馈任务状态,请求参数:--------------------------------------" + string);
|
log.info("acs向lms反馈任务状态,请求参数:--------------------------------------" + string);
|
||||||
@@ -191,8 +191,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
String acs_task_status = row.getString("task_status");
|
String acs_task_status = row.getString("task_status");
|
||||||
String car_no = row.getString("car_no");
|
String car_no = row.getString("car_no");
|
||||||
if (StrUtil.isNotEmpty(car_no)) {
|
if (StrUtil.isNotEmpty(car_no)) {
|
||||||
taskObj.put("car_no", car_no);
|
WQLObject.getWQLObject("SCH_BASE_Task").update(MapOf.of("car_no", car_no),"task_id = '" + task_id + "'");
|
||||||
WQLObject.getWQLObject("SCH_BASE_Task").update(taskObj);
|
|
||||||
}
|
}
|
||||||
String message = "";
|
String message = "";
|
||||||
String status = "";
|
String status = "";
|
||||||
|
|||||||
@@ -117,7 +117,6 @@ public class TaskServiceImpl implements TaskService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public void operation(Map<String, Object> map) {
|
public void operation(Map<String, Object> map) {
|
||||||
String task_id = MapUtil.getStr(map, "task_id");
|
String task_id = MapUtil.getStr(map, "task_id");
|
||||||
@@ -130,12 +129,13 @@ public class TaskServiceImpl implements TaskService {
|
|||||||
if ("finish".equals(method_name)) {
|
if ("finish".equals(method_name)) {
|
||||||
//强制执行,只把任务变更成完成状态
|
//强制执行,只把任务变更成完成状态
|
||||||
// 更改任务状态为完成
|
// 更改任务状态为完成
|
||||||
taskObj.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
HashMap hashMap = new HashMap<>();
|
||||||
taskObj.put("update_optid", SecurityUtils.getCurrentUserId());
|
hashMap.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||||
taskObj.put("update_optname", SecurityUtils.getCurrentUsername());
|
hashMap.put("update_optid", SecurityUtils.getCurrentUserId());
|
||||||
taskObj.put("update_time", DateUtil.now());
|
hashMap.put("update_optname", SecurityUtils.getCurrentUsername());
|
||||||
taskObj.put("remark", "任务被用户:" + SecurityUtils.getCurrentUsername() + "在:" + DateUtil.now() + "强制完成。");
|
hashMap.put("update_time", DateUtil.now());
|
||||||
WQLObject.getWQLObject("SCH_BASE_Task").update(taskObj);
|
hashMap.put("remark", "任务被用户:" + SecurityUtils.getCurrentUsername() + "在:" + DateUtil.now() + "强制完成。");
|
||||||
|
WQLObject.getWQLObject("SCH_BASE_Task").update(hashMap,"task_id = '" + task_id + "'");
|
||||||
} else {
|
} else {
|
||||||
// 任务处理类
|
// 任务处理类
|
||||||
String processing_class = taskObj.getString("handle_class");
|
String processing_class = taskObj.getString("handle_class");
|
||||||
|
|||||||
@@ -123,11 +123,12 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
|||||||
|
|
||||||
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
||||||
// 更改任务状态为完成
|
// 更改任务状态为完成
|
||||||
jsonTask.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
HashMap<Object, Object> hashMap = new HashMap<>();
|
||||||
jsonTask.put("update_optid", SecurityUtils.getCurrentUserId());
|
hashMap.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||||
jsonTask.put("update_optname", SecurityUtils.getCurrentUsername());
|
hashMap.put("update_optid", SecurityUtils.getCurrentUserId());
|
||||||
jsonTask.put("update_time", DateUtil.now());
|
hashMap.put("update_optname", SecurityUtils.getCurrentUsername());
|
||||||
taskTab.update(jsonTask);
|
hashMap.put("update_time", DateUtil.now());
|
||||||
|
taskTab.update(hashMap,"task_id = '" + task_id + "'");
|
||||||
|
|
||||||
String point_code1 = jsonTask.getString("point_code1");
|
String point_code1 = jsonTask.getString("point_code1");
|
||||||
String point_code2 = jsonTask.getString("point_code2");
|
String point_code2 = jsonTask.getString("point_code2");
|
||||||
@@ -230,7 +231,8 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
|||||||
jsonIvt2.put("point_status", "2");
|
jsonIvt2.put("point_status", "2");
|
||||||
jsonIvt2.put("material_code", jsonTask.getString("material_code"));
|
jsonIvt2.put("material_code", jsonTask.getString("material_code"));
|
||||||
point_tab.update(jsonIvt2);
|
point_tab.update(jsonIvt2);
|
||||||
} else if (jsonTask.getString("task_type").equals("010106")) {
|
}
|
||||||
|
else if (jsonTask.getString("task_type").equals("010106")) {
|
||||||
BakingServiceImpl bean = SpringContextHolder.getBean(BakingServiceImpl.class);
|
BakingServiceImpl bean = SpringContextHolder.getBean(BakingServiceImpl.class);
|
||||||
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表
|
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表
|
||||||
JSONObject requestParam = jsonTask.getJSONObject("request_param");
|
JSONObject requestParam = jsonTask.getJSONObject("request_param");
|
||||||
@@ -322,37 +324,6 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
|||||||
cache_param.put("cool_ivt_status", "01");
|
cache_param.put("cool_ivt_status", "01");
|
||||||
ivtTab.update(cache_param, "full_point_code ='" + point_code4 + "'");
|
ivtTab.update(cache_param, "full_point_code ='" + point_code4 + "'");
|
||||||
|
|
||||||
/*// 插入入库单
|
|
||||||
JSONObject jsonMater = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
|
|
||||||
if (ObjectUtil.isEmpty(jsonMater)) {
|
|
||||||
throw new BadRequestException("产品不存在");
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject jsonRegion = new JSONObject();
|
|
||||||
jsonRegion.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
|
|
||||||
jsonRegion.put("bill_code", CodeUtil.getNewCode("COOLREGION_BILL_CODE"));
|
|
||||||
jsonRegion.put("io_type", "0");
|
|
||||||
jsonRegion.put("material_id", jsonMater.getString("material_id"));
|
|
||||||
jsonRegion.put("pcsn", jsonRaw.getString("container_name"));
|
|
||||||
jsonRegion.put("vehicle_code", "");
|
|
||||||
jsonRegion.put("qty", jsonRaw.getString("productin_qty"));
|
|
||||||
jsonRegion.put("qty_unit_id", jsonMater.get("base_unit_id"));
|
|
||||||
jsonRegion.put("bill_status", "50");
|
|
||||||
jsonRegion.put("start_point_code", point_code2);
|
|
||||||
jsonRegion.put("end_point_code", point_code4);
|
|
||||||
jsonRegion.put("cust_id", "");
|
|
||||||
jsonRegion.put("create_mode", "03");
|
|
||||||
jsonRegion.put("task_id", task_id);
|
|
||||||
jsonRegion.put("create_id", currentUserId);
|
|
||||||
jsonRegion.put("create_name", currentUsername);
|
|
||||||
jsonRegion.put("create_time", DateUtil.now());
|
|
||||||
jsonRegion.put("update_optid", currentUserId);
|
|
||||||
jsonRegion.put("update_optname", currentUsername);
|
|
||||||
jsonRegion.put("update_time", DateUtil.now());
|
|
||||||
jsonRegion.put("confirm_optid", currentUserId);
|
|
||||||
jsonRegion.put("confirm_optname", currentUsername);
|
|
||||||
jsonRegion.put("confirm_time", DateUtil.now());
|
|
||||||
coolTab.insert(jsonRegion);*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -370,7 +341,6 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public String createTask(JSONObject form) {
|
public String createTask(JSONObject form) {
|
||||||
WQLObject tab = WQLObject.getWQLObject("SCH_BASE_Task");
|
WQLObject tab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
|||||||
@@ -251,7 +251,6 @@ public class InHotTask extends AbstractAcsTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public String createTask(JSONObject form) {
|
public String createTask(JSONObject form) {
|
||||||
WQLObject tab = WQLObject.getWQLObject("SCH_BASE_Task");
|
WQLObject tab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import org.nl.wms.sch.manage.TaskStatusEnum;
|
|||||||
import org.nl.wms.st.inbill.service.impl.InbillServiceImpl;
|
import org.nl.wms.st.inbill.service.impl.InbillServiceImpl;
|
||||||
import org.nl.wms.st.inbill.service.impl.RawAssistIStorServiceImpl;
|
import org.nl.wms.st.inbill.service.impl.RawAssistIStorServiceImpl;
|
||||||
import org.nl.wms.st.inbill.service.impl.StorPublicServiceImpl;
|
import org.nl.wms.st.inbill.service.impl.StorPublicServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -28,6 +29,7 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* Created by ZZ on 2021/12/22.
|
* Created by ZZ on 2021/12/22.
|
||||||
*/
|
*/
|
||||||
|
@Service
|
||||||
public class InTask extends AbstractAcsTask {
|
public class InTask extends AbstractAcsTask {
|
||||||
|
|
||||||
private final String THIS_CLASS = InTask.class.getName();
|
private final String THIS_CLASS = InTask.class.getName();
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import org.nl.wms.sch.manage.AbstractAcsTask;
|
|||||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||||
import org.nl.wms.st.inbill.service.CheckOutBillService;
|
import org.nl.wms.st.inbill.service.CheckOutBillService;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -25,7 +26,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* Created by Lxy on 2021/12/22.
|
* Created by Lxy on 2021/12/22.
|
||||||
*/
|
*/
|
||||||
@Component
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class OutTask extends AbstractAcsTask {
|
public class OutTask extends AbstractAcsTask {
|
||||||
private final String THIS_CLASS = OutTask.class.getName();
|
private final String THIS_CLASS = OutTask.class.getName();
|
||||||
|
|||||||
Reference in New Issue
Block a user