Merge branch 'master' of http://121.40.234.130:8899/root/yongYuJiaJu
This commit is contained in:
@@ -117,7 +117,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
public String againApply(String task_id) {
|
||||
log.info("输入参数:" + task_id);
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonTask)) throw new BadRequestException("任务已删除或已完成!");
|
||||
|
||||
String point_code = "";
|
||||
String message = "";
|
||||
@@ -233,6 +234,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
param.put("io_type", "2");
|
||||
param.put("vehicle_type", vehicle_type);
|
||||
param.put("vehicle_code", vehicle_code);
|
||||
param.put("material_num", material_num);
|
||||
// 创建任务
|
||||
YqxCallMaterialTask taskBean = SpringContextHolder.getBean(YqxCallMaterialTask.class);
|
||||
String task_id = taskBean.createTask(param);
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
package org.nl.wms.sch;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
|
||||
|
||||
public class PointFindUtil {
|
||||
public static JSONObject getInStruct(JSONObject jsonObject) {
|
||||
String material_id = jsonObject.getString("material_id");
|
||||
String area_type = jsonObject.getString("area_type");
|
||||
String vehicle_code = jsonObject.getString("vehicle_code");
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("托盘不能为空!");
|
||||
}
|
||||
//根据托盘找托盘类型,
|
||||
JSONObject vehicleObj = WQLObject.getWQLObject("md_pb_vehicle").query("vehicle_code='" + vehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(vehicleObj)) {
|
||||
throw new BadRequestException("未找到托盘号为'" + vehicle_code + "' 托盘信息!");
|
||||
}
|
||||
if (StrUtil.isEmpty(material_id)) {
|
||||
throw new BadRequestException("物料不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(area_type)) {
|
||||
throw new BadRequestException("区域不能为空!");
|
||||
}
|
||||
String vehice_type = vehicleObj.getString("vehicle_type");
|
||||
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "2")
|
||||
.addParam("material_id", material_id).addParam("area_type", area_type).addParam("vehice_type", vehice_type).process().uniqueResult(0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static JSONObject getOutStruct(JSONObject jsonObject) {
|
||||
String material_id = jsonObject.getString("material_id");
|
||||
String area_type = jsonObject.getString("area_type");
|
||||
String is_full = jsonObject.getString("is_full");
|
||||
String workprocedure_id = jsonObject.getString("workprocedure_id");
|
||||
|
||||
if (StrUtil.isEmpty(material_id)) {
|
||||
throw new BadRequestException("物料不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(area_type)) {
|
||||
throw new BadRequestException("区域不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(is_full)) {
|
||||
throw new BadRequestException("是否满托不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(workprocedure_id)) {
|
||||
throw new BadRequestException("工序不能为空!");
|
||||
}
|
||||
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "3")
|
||||
.addParam("material_id", material_id).addParam("area_type", area_type)
|
||||
.addParam("is_full", is_full).addParam("workprocedure_id", workprocedure_id)
|
||||
.process().uniqueResult(0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static JSONObject getEmptyVehicleInStruct(JSONObject jsonObject) {
|
||||
String area_type = jsonObject.getString("area_type");
|
||||
String vehicle_code = jsonObject.getString("vehicle_code");
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("托盘不能为空!");
|
||||
}
|
||||
//根据托盘找托盘类型,
|
||||
JSONObject vehicleObj = WQLObject.getWQLObject("md_pb_vehicle").query("vehicle_code='" + vehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(vehicleObj)) {
|
||||
throw new BadRequestException("未找到托盘号为'" + vehicle_code + "' 托盘信息!");
|
||||
}
|
||||
if (StrUtil.isEmpty(area_type)) {
|
||||
throw new BadRequestException("区域不能为空!");
|
||||
}
|
||||
String vehice_type = vehicleObj.getString("vehicle_type");
|
||||
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "4")
|
||||
.addParam("area_type", area_type).addParam("vehice_type", vehice_type).process().uniqueResult(0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static JSONObject getEmptyVehicleOutStruct(JSONObject jsonObject) {
|
||||
String area_type = jsonObject.getString("area_type");
|
||||
String vehicle_type = jsonObject.getString("vehicle_type");
|
||||
if (StrUtil.isEmpty(area_type)) {
|
||||
throw new BadRequestException("区域不能为空!");
|
||||
}
|
||||
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "5")
|
||||
.addParam("area_type", area_type).addParam("vehicle_type", vehicle_type).process().uniqueResult(0);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -104,4 +104,12 @@ public class PointController {
|
||||
pointService.changeUsed(jsonObject);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("锁定与解锁")
|
||||
@PostMapping("/changeLock")
|
||||
@ApiOperation("锁定与解锁")
|
||||
public ResponseEntity<Object> changeLock(@RequestBody JSONObject jsonObject) {
|
||||
pointService.changeLock(jsonObject);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,4 +90,10 @@ public interface PointService {
|
||||
* @param jsonObject
|
||||
*/
|
||||
void changeUsed(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 改变锁定类型
|
||||
* @param jsonObject
|
||||
*/
|
||||
void changeLock(JSONObject jsonObject);
|
||||
}
|
||||
|
||||
@@ -49,6 +49,9 @@ public class PointDto implements Serializable {
|
||||
/** MES设备编码 */
|
||||
private String mes_device_code;
|
||||
|
||||
/** 物料标识 */
|
||||
private Long material_id;
|
||||
|
||||
/** 允许的载具类型 */
|
||||
private String can_vehicle_type;
|
||||
|
||||
@@ -108,4 +111,4 @@ public class PointDto implements Serializable {
|
||||
|
||||
/** 修改时间 */
|
||||
private String update_time;
|
||||
}
|
||||
}
|
||||
@@ -153,6 +153,14 @@ public class PointServiceImpl implements PointService {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
String pointStatus = dto.getPoint_status();
|
||||
if (ObjectUtil.isNotEmpty(pointStatus) && pointStatus.equals("1")) {
|
||||
entity.setMaterial_id(null);
|
||||
entity.setVehicle_type(null);
|
||||
entity.setVehicle_code(null);
|
||||
entity.setVehicle_qty(null);
|
||||
}
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
@@ -275,6 +283,24 @@ public class PointServiceImpl implements PointService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 改变锁定类型
|
||||
*
|
||||
* @param jsonObject
|
||||
*/
|
||||
@Override
|
||||
public void changeLock(JSONObject jsonObject) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_base_Point");
|
||||
JSONArray data = jsonObject.getJSONArray("data");
|
||||
String lock = jsonObject.getString("lock_type");
|
||||
for ( int i = 0; i < data.size(); i++ ) {
|
||||
JSONObject object = data.getJSONObject(i);
|
||||
if (lock.equals("1")) object.put("lock_type", 1);
|
||||
else object.put("lock_type", 2);
|
||||
wo.update(object);
|
||||
}
|
||||
}
|
||||
|
||||
//根据重量返回最大的 级数
|
||||
public String getLoadSeriesByqty(Double qty) {
|
||||
JSONArray dictArr = WQLObject.getWQLObject("sys_dict_detail").query("dict_id ='108'", "label").getResultJSONArray(0);
|
||||
|
||||
@@ -275,7 +275,7 @@ public class GjxCallEmpVehicleTask extends AbstractAcsTask {
|
||||
.task_id(org.nl.wms.util.IdUtil.getLongId())
|
||||
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
||||
.task_type("")
|
||||
.acs_task_type("3")
|
||||
.acs_task_type("2")
|
||||
.task_name("养生A区>叠盘架空载具")
|
||||
.task_status(TaskStatusEnum.START_AND_POINT.getCode())
|
||||
.point_code1(jsonStartPoint.getString("point_code"))
|
||||
@@ -319,6 +319,14 @@ public class GjxCallEmpVehicleTask extends AbstractAcsTask {
|
||||
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder"); // 生产工单表
|
||||
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); //点位基础表
|
||||
|
||||
//任务表【SCH_BASE_Task】
|
||||
//判断当前点是否有未完成的任务
|
||||
JSONObject taskObj = taskTab.query("is_delete='0' and point_code2 = '" + form.getString("point_code2") + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj)) throw new BadRequestException("当前点位" + form.getString("point_code2") + "存在未完成的任务");
|
||||
|
||||
|
||||
|
||||
|
||||
String point_code2 = form.getString("point_code2");
|
||||
String sub_device_code = point_code2.substring(0, point_code2.indexOf("_"));
|
||||
|
||||
@@ -333,6 +341,7 @@ public class GjxCallEmpVehicleTask extends AbstractAcsTask {
|
||||
.task_name("共挤线叫空载具")
|
||||
.task_status(TaskStatusEnum.SURE_END.getCode())
|
||||
.point_code2(point_code2)
|
||||
.acs_task_type("2")
|
||||
.vehicle_code(form.getString("vehicle_code"))
|
||||
.vehicle_type(workOrderObj.getString("vehicle_type"))
|
||||
.vehicle_qty(form.getIntValue("qty"))
|
||||
|
||||
@@ -283,7 +283,7 @@ public class YqxCallEmpVehicleTask extends AbstractAcsTask {
|
||||
.task_id(org.nl.wms.util.IdUtil.getLongId())
|
||||
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
||||
.task_type("")
|
||||
.acs_task_type("3")
|
||||
.acs_task_type("2")
|
||||
.task_name("养生A区>叠盘架空载具")
|
||||
.task_status(TaskStatusEnum.START_AND_POINT.getCode())
|
||||
.point_code1(jsonStartPoint.getString("point_code"))
|
||||
@@ -326,6 +326,14 @@ public class YqxCallEmpVehicleTask extends AbstractAcsTask {
|
||||
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder"); // 生产工单表
|
||||
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); //点位基础表
|
||||
|
||||
//任务表【SCH_BASE_Task】
|
||||
//判断当前点是否有未完成的任务
|
||||
JSONObject taskObj = taskTab.query("is_delete='0' and point_code2 = '" + form.getString("point_code2") + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj)) throw new BadRequestException("当前点位" + form.getString("point_code2") + "存在未完成的任务");
|
||||
|
||||
|
||||
|
||||
|
||||
String point_code2 = form.getString("point_code2");
|
||||
String sub_device_code = point_code2.substring(0, point_code2.indexOf("_"));
|
||||
|
||||
@@ -340,6 +348,7 @@ public class YqxCallEmpVehicleTask extends AbstractAcsTask {
|
||||
.task_name("油漆线叫空载具")
|
||||
.task_status(TaskStatusEnum.SURE_END.getCode())
|
||||
.point_code2(point_code2)
|
||||
.acs_task_type("2")
|
||||
.vehicle_code(form.getString("vehicle_code"))
|
||||
.vehicle_type(workOrderObj.getString("vehicle_type"))
|
||||
.vehicle_qty(form.getIntValue("qty"))
|
||||
|
||||
@@ -43,7 +43,8 @@ public class YqxCallMaterialTask extends AbstractAcsTask {
|
||||
|
||||
String task_id = task.getString("task_id");
|
||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
|
||||
// 物料点
|
||||
JSONObject material_point = pointTab.query("point_code = '" + taskObj.getString("point_code1") + "'").uniqueResult(0);
|
||||
//任务取消
|
||||
if (StrUtil.equals(status, "0")) {
|
||||
// 取消删除任务
|
||||
@@ -61,6 +62,11 @@ public class YqxCallMaterialTask extends AbstractAcsTask {
|
||||
taskObj.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
taskObj.put("remark", "已取消");
|
||||
taskTab.update(taskObj);
|
||||
|
||||
// 点位解锁 并设置空位
|
||||
material_point.put("lock_type", "1");
|
||||
material_point.put("point_status", "1");
|
||||
pointTab.update(material_point);
|
||||
}
|
||||
|
||||
if ("1".equals(status)) {
|
||||
@@ -77,18 +83,7 @@ public class YqxCallMaterialTask extends AbstractAcsTask {
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
|
||||
String point_code3 = taskObj.getString("point_code3");
|
||||
if (ObjectUtil.isEmpty(point_code3)) point_code3 = taskObj.getString("point_code2"); // 终点
|
||||
JSONObject point3Obj = pointTab.query("point_code = '" + point_code3 + "'").uniqueResult(0);
|
||||
JSONObject requestObj = task.getJSONObject("request_param");
|
||||
//工单标识
|
||||
String workorder_id = requestObj.getString("material_info_id");
|
||||
//生产工单表【PDM_BD_WorkOrder】
|
||||
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder");
|
||||
JSONObject workorderObj = workOrderTab.query("workorder_id", workorder_id).uniqueResult(0);
|
||||
|
||||
JSONObject point3 = pointTab.query("point_code = '" + point_code3 + "'").uniqueResult(0);
|
||||
|
||||
|
||||
//区域出入表【st_ivt_regionIO】
|
||||
WQLObject regionIoTab = WQLObject.getWQLObject("st_ivt_regionIO");
|
||||
@@ -97,15 +92,15 @@ public class YqxCallMaterialTask extends AbstractAcsTask {
|
||||
regionIoObj.put("bill_code", CodeUtil.getNewCode("IN_STORE_CODE"));
|
||||
regionIoObj.put("buss_date", DateUtil.today());
|
||||
regionIoObj.put("io_type", "2");
|
||||
regionIoObj.put("region_id", point3.getString("region_id"));
|
||||
regionIoObj.put("region_code", point3.getString("region_code"));
|
||||
regionIoObj.put("region_name", point3.getString("region_name"));
|
||||
regionIoObj.put("region_id", material_point.getString("region_id"));
|
||||
regionIoObj.put("region_code", material_point.getString("region_code"));
|
||||
regionIoObj.put("region_name", material_point.getString("region_name"));
|
||||
regionIoObj.put("material_id", taskObj.getString("material_id"));
|
||||
regionIoObj.put("vehicle_code", taskObj.getString("vehicle_code"));
|
||||
regionIoObj.put("qty", requestObj.getString("qty"));
|
||||
regionIoObj.put("qty", requestObj.getString("material_num"));
|
||||
regionIoObj.put("bill_status", "3");
|
||||
regionIoObj.put("start_point_code", taskObj.getString("point_code1"));
|
||||
regionIoObj.put("end_point_code", taskObj.getString("point_code3"));
|
||||
regionIoObj.put("end_point_code", taskObj.getString("point_code2"));
|
||||
regionIoObj.put("create_mode", "2");
|
||||
regionIoObj.put("pcsn", DateUtil.format(DateUtil.parse(DateUtil.today()), "yyyyMMdd"));
|
||||
regionIoObj.put("create_id", SecurityUtils.getCurrentUserId());
|
||||
@@ -113,14 +108,12 @@ public class YqxCallMaterialTask extends AbstractAcsTask {
|
||||
regionIoObj.put("create_time", DateUtil.now());
|
||||
regionIoTab.insert(regionIoObj);
|
||||
|
||||
|
||||
//完成后将仓位库存删掉
|
||||
//仓位库存表【ST_IVT_StructIvt】
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
||||
ivtTab.delete("point_code = '" + taskObj.getString("point_code1") + "'");
|
||||
|
||||
// 点位解锁 并设置空位
|
||||
JSONObject material_point = pointTab.query("point_code = '" + taskObj.getString("point_code1") + "'").uniqueResult(0);
|
||||
material_point.put("lock_type", "1");
|
||||
material_point.put("point_status", "1");
|
||||
pointTab.update(material_point);
|
||||
@@ -148,33 +141,17 @@ public class YqxCallMaterialTask extends AbstractAcsTask {
|
||||
//1、根据物料id查找养生A区物料点
|
||||
JSONObject json1 = WQL.getWO("QSCH_yqxCallMAterial_01").addParamMap(param1).process().uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json1)) {
|
||||
Integer block_num = json1.getInteger("block_num");
|
||||
Integer row_num = json1.getInteger("row_num");
|
||||
Integer col_num = json1.getInteger("col_num");
|
||||
// 拿到点位
|
||||
JSONObject material_point = pointTab.query("point_id = '" + json1.getString("point_id") + "' and lock_type = '1'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(material_point)) throw new BadRequestException("数据错误,请校验!");
|
||||
// 物料点位上锁
|
||||
material_point.put("lock_type", 2);
|
||||
material_point.put("lock_type", "2");
|
||||
pointTab.update(material_point);
|
||||
//需要设置等待点
|
||||
if (row_num < 9) {
|
||||
//二楼终点追加任务,taskObj的code2存叫料点
|
||||
JSONObject jsonObject = pointTab.query("block_num = '" + block_num + "' and col_num = '" + col_num + "' and row_num ='9'").uniqueResult(0);
|
||||
taskObj.put("point_code1", taskObj.getString("point_code2")); // 叫料点
|
||||
taskObj.put("point_code2", jsonObject.getString("point_code")); // 等待点
|
||||
taskObj.put("point_code3", material_point.getString("point_code")); // 物料点
|
||||
taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
taskObj.put("acs_task_type", "4");
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
} else if (row_num == 9) {
|
||||
//二楼普通任务
|
||||
taskObj.put("point_code1", material_point.getString("point_code"));
|
||||
taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
taskObj.put("acs_task_type", "2");
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
}
|
||||
|
||||
taskObj.put("point_code1", material_point.getString("point_code"));
|
||||
taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
taskObj.put("acs_task_type", "2");
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
} else {
|
||||
taskObj.put("remark", "养生A区无所需物料");
|
||||
@@ -220,14 +197,18 @@ public class YqxCallMaterialTask extends AbstractAcsTask {
|
||||
String point_code2 = whereJson.getString("point_code2");
|
||||
String vehicle_type = whereJson.getString("vehicle_type");
|
||||
String vehicle_code = whereJson.getString("vehicle_code");
|
||||
String qty = whereJson.getString("qty");
|
||||
String qty = whereJson.getString("material_num");
|
||||
|
||||
//生产工单表【PDM_BD_WorkOrder】
|
||||
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder");
|
||||
//任务表【SCH_BASE_Task】
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
//判断当前点是否有未完成的任务
|
||||
JSONObject taskObj = taskTab.query("is_delete='0' and point_code2 = '" + point_code2 + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj)) throw new BadRequestException("当前点位" + point_code2 + "存在未完成的任务");
|
||||
//点位基础表【SCH_BASE_Point】
|
||||
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
String device_code = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0).getString("device_code");
|
||||
|
||||
JSONObject workOrderObj = workOrderTab.query("device_code = '" + device_code + "' and order_status = '3' and is_delete ='0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(workOrderObj)) throw new BadRequestException("该设备当前未生产或者已删除");
|
||||
|
||||
@@ -247,8 +228,6 @@ public class YqxCallMaterialTask extends AbstractAcsTask {
|
||||
.create_time(DateUtil.now())
|
||||
.request_param(whereJson.toJSONString())
|
||||
.build();
|
||||
//任务表【SCH_BASE_Task】
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
taskTab.insert(json);
|
||||
|
||||
@@ -263,41 +242,17 @@ public class YqxCallMaterialTask extends AbstractAcsTask {
|
||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj))
|
||||
this.updateTaskStatus(taskObj,"2");
|
||||
else {
|
||||
throw new BadRequestException("未找到该任务或者任务已完成");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public String againApply(String task_id) {
|
||||
/*
|
||||
* 再次下发任务处理方法
|
||||
* 涉及业务:入空载具、出空载具、入物料、出物料
|
||||
*/
|
||||
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
|
||||
// WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); // 点位表
|
||||
|
||||
JSONObject taskObj = taskTab.query("task_id ='" + task_id + "'").uniqueResult(0);
|
||||
// JSONObject jsonPoint2 = pointTab.query("point_code = '" + taskObj.getString("point_code1") + "'").uniqueResult(0); //
|
||||
|
||||
// code1是叫料点,code3是物料点 -> code1是物料点,code2是等待点,code3是叫料点
|
||||
String askPoint = taskObj.getString("point_code1");
|
||||
taskObj.put("point_code1", taskObj.getString("point_code3"));
|
||||
taskObj.put("point_code3", askPoint);
|
||||
|
||||
taskObj.put("remark", "二次申请货位");
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
|
||||
|
||||
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
|
||||
String point_code =taskObj.getString("point_code3");
|
||||
String newPoint = point_code.substring(0, 4) + "1" + point_code.substring(4, 9);
|
||||
|
||||
return newPoint;
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj))
|
||||
this.updateTaskStatus(taskObj,"0");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
OPTION 输入.vehicle_type <> ""
|
||||
p.can_vehicle_type like 输入.vehicle_type
|
||||
ENDOPTION
|
||||
ORDER BY block_num,col_num
|
||||
ORDER BY block_num,row_num desc,col_num
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -104,7 +104,7 @@ public class CpOutTask extends AbstractAcsTask {
|
||||
point1Obj.put("lock_type", "1");
|
||||
point1Obj.put("point_status", "1");
|
||||
point2Obj.put("lock_type", "1");
|
||||
point2Obj.put("point_status", "1");
|
||||
point2Obj.put("point_status", "3");
|
||||
pointTab.update(point1Obj);
|
||||
pointTab.update(point2Obj);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ import java.util.List;
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class GjxSendMaterialTask extends AbstractAcsTask {
|
||||
|
||||
private final String THIS_CLASS = GjxSendMaterialTask.class.getName();
|
||||
|
||||
|
||||
@@ -51,17 +50,17 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
||||
if (StrUtil.equals(taskObj.getString("task_status"), TaskStatusEnum.FINISHED.getCode())) {
|
||||
throw new BadRequestException("已完成不能取消!");
|
||||
}
|
||||
String point_code2 = taskObj.getString("point_code2");
|
||||
String point_code3 = taskObj.getString("point_code3");
|
||||
//说明未二次申请过
|
||||
if (ObjectUtil.isEmpty(point_code3)) {
|
||||
JSONObject json = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||
json.put("lock_type", "1");
|
||||
pointTab.update(json);
|
||||
}
|
||||
|
||||
taskObj.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
taskObj.put("remark", "已取消");
|
||||
taskTab.update(taskObj);
|
||||
|
||||
//释放相关电位信息
|
||||
JSONObject param1 = new JSONObject();
|
||||
param1.put("lock_type", "1");
|
||||
param1.put("task_id", "");
|
||||
param1.put("material_id", "");
|
||||
pointTab.update(param1, "task_id = '" + taskObj.getString("task_id") + "'");
|
||||
}
|
||||
|
||||
if ("1".equals(status)) {
|
||||
@@ -73,13 +72,23 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
if (StrUtil.equals(status, "2")) {
|
||||
|
||||
//判断状态,
|
||||
if (StrUtil.equals("2", taskObj.getString("task_status"))) {
|
||||
// 更改任务状态为完成
|
||||
taskObj.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
return;
|
||||
}
|
||||
// 更改任务状态为完成
|
||||
taskObj.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
|
||||
String point_code3 = taskObj.getString("point_code3");
|
||||
JSONObject point3Obj = pointTab.query("point_code = '" + point_code3 + "'").uniqueResult(0);
|
||||
|
||||
String point_code2 = taskObj.getString("point_code2");
|
||||
JSONObject endPoint = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||
JSONObject requestObj = task.getJSONObject("request_param");
|
||||
//工单标识
|
||||
String workorder_id = requestObj.getString("material_info_id");
|
||||
@@ -87,8 +96,6 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
||||
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder");
|
||||
JSONObject workorderObj = workOrderTab.query("workorder_id", workorder_id).uniqueResult(0);
|
||||
|
||||
JSONObject point3 = pointTab.query("point_code = '" + point_code3 + "'").uniqueResult(0);
|
||||
|
||||
|
||||
//区域出入表【st_ivt_regionIO】
|
||||
WQLObject regionIoTab = WQLObject.getWQLObject("st_ivt_regionIO");
|
||||
@@ -97,9 +104,9 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
||||
regionIoObj.put("bill_code", CodeUtil.getNewCode("IN_STORE_CODE"));
|
||||
regionIoObj.put("buss_date", DateUtil.today());
|
||||
regionIoObj.put("io_type", "1");
|
||||
regionIoObj.put("region_id", point3.getString("region_id"));
|
||||
regionIoObj.put("region_code", point3.getString("region_code"));
|
||||
regionIoObj.put("region_name", point3.getString("region_name"));
|
||||
regionIoObj.put("region_id", endPoint.getString("region_id"));
|
||||
regionIoObj.put("region_code", endPoint.getString("region_code"));
|
||||
regionIoObj.put("region_name", endPoint.getString("region_name"));
|
||||
regionIoObj.put("material_id", taskObj.getString("material_id"));
|
||||
regionIoObj.put("vehicle_code", taskObj.getString("vehicle_code"));
|
||||
regionIoObj.put("qty", requestObj.getString("qty"));
|
||||
@@ -119,12 +126,12 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
||||
JSONObject ivtObj = new JSONObject();
|
||||
ivtObj.put("stockrecord_id", IdUtil.getLongId());
|
||||
ivtObj.put("point_id", point3Obj.getString("point_id"));
|
||||
ivtObj.put("point_code", point3Obj.getString("point_code"));
|
||||
ivtObj.put("point_name", point3Obj.getString("point_name"));
|
||||
ivtObj.put("region_id", point3Obj.getString("region_id"));
|
||||
ivtObj.put("region_code", point3Obj.getString("region_code"));
|
||||
ivtObj.put("region_name", point3Obj.getString("region_name"));
|
||||
ivtObj.put("point_id", endPoint.getString("point_id"));
|
||||
ivtObj.put("point_code", endPoint.getString("point_code"));
|
||||
ivtObj.put("point_name", endPoint.getString("point_name"));
|
||||
ivtObj.put("region_id", endPoint.getString("region_id"));
|
||||
ivtObj.put("region_code", endPoint.getString("region_code"));
|
||||
ivtObj.put("region_name", endPoint.getString("region_name"));
|
||||
ivtObj.put("instorage_time", DateUtil.now());
|
||||
ivtObj.put("pcsn", DateUtil.format(DateUtil.parse(DateUtil.today()), "yyyyMMdd"));
|
||||
ivtObj.put("ivt_qty", requestObj.getString("qty"));
|
||||
@@ -133,19 +140,26 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
||||
ivtTab.insert(ivtObj);
|
||||
|
||||
// 点位解锁
|
||||
point3Obj.put("lock_type", "1");
|
||||
point3Obj.put("point_status", "3");
|
||||
pointTab.update(point3Obj);
|
||||
endPoint.put("lock_type", "1");
|
||||
endPoint.put("point_status", "3");
|
||||
endPoint.put("material_id", taskObj.getString("material_id"));
|
||||
pointTab.update(endPoint);
|
||||
//释放整列货位
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("lock_type", "1");
|
||||
pointTab.update(param, "task_id = '" + task_id + "'");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findNextPoint() {
|
||||
//判断共挤线是否有执行中的任务,如果任务数>=3,则不生成任务
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
/*
|
||||
* 根据业务找对应的终点
|
||||
*/
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
JSONArray taskArr = taskTab.query("handle_class = '" + THIS_CLASS + "'and is_delete = '0' and task_status = '2'").getResultJSONArray(0);
|
||||
for (int i = 0; i < taskArr.size(); i++) {
|
||||
@@ -159,31 +173,51 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
||||
param1.put("vehicle_type", "%" + vehicle_type + "%");
|
||||
//1、查找库区类是否有响应的载具类型和对应的物料
|
||||
JSONObject json1 = WQL.getWO("QSCH_gjxSendMaterial_01").addParamMap(param1).process().uniqueResult(0);
|
||||
|
||||
|
||||
//判断是否有到同一列的相同物料SKU的AGV任务,如果有,则等待
|
||||
JSONArray taskIngs = taskTab.query("is_delete='0' and material_id = '" + material_id + "' and (task_status = '4' or task_status = '5' or task_status = '6' )").getResultJSONArray(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(taskIngs)) {
|
||||
JSONObject taskIng = taskIngs.getJSONObject(0);
|
||||
if (ObjectUtil.isNotEmpty(taskIng) && ObjectUtil.isNotEmpty(json1)) {
|
||||
JSONObject point2 = pointTab.query("point_code = '" + taskIng.getString("point_code2") + "'").uniqueResult(0);
|
||||
if (StrUtil.equals(point2.getString("block_num"), json1.getString("block_num"))
|
||||
&& StrUtil.equals(point2.getString("col_num"), json1.getString("col_num"))) {
|
||||
taskObj.put("remark", "相应列有AGV在工作,等待执行!");
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ObjectUtil.isNotEmpty(json1)) {
|
||||
Integer block_num = json1.getInteger("block_num");
|
||||
Integer row_num = json1.getInteger("row_num");
|
||||
Integer col_num = json1.getInteger("col_num");
|
||||
|
||||
//拿到第一排
|
||||
JSONObject firstRow = pointTab.query("block_num = '" + block_num + "' and col_num = '" + col_num + "' and row_num ='1'").uniqueResult(0);
|
||||
JSONObject firstRow = pointTab.query("block_num = '" + block_num + "' and col_num = '" + col_num + "' and row_num ='" + (row_num - 1) + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(firstRow)) throw new BadRequestException("数据错误,请校验!");
|
||||
taskObj.put("point_code2", firstRow.getString("point_code"));
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
//需要设置等待点
|
||||
if (row_num > 2) {
|
||||
//二楼终点追加任务
|
||||
taskObj.put("acs_task_type", "4");
|
||||
} else if (row_num == 2) {
|
||||
//二楼普通任务
|
||||
taskObj.put("acs_task_type", "2");
|
||||
}
|
||||
//把物料信(SKU)息更新到点位上
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("material_id", taskObj.getString("material_id"));
|
||||
pointTab.update(param, "block_num = '" + block_num + "' and row_num = '" + (row_num-1) + "' and col_num = '" + col_num + "'");
|
||||
|
||||
taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
//二楼普通任务
|
||||
taskTab.update(taskObj);
|
||||
//锁住相关货位
|
||||
JSONObject point = new JSONObject();
|
||||
point.put("lock_type", "2");
|
||||
point.put("task_id", taskObj.getString("task_id"));
|
||||
pointTab.update(point, "block_num = '" + block_num + "' and col_num = '" + col_num + "' and row_num <= '" + (row_num - 1) + "'");
|
||||
|
||||
} else {//找空位入
|
||||
if (ObjectUtil.isNotEmpty(taskIngs) && taskIngs.size() > 1) {
|
||||
taskObj.put("remark", "相应列有AGV在工作,等待执行!");
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
continue;
|
||||
}
|
||||
|
||||
JSONObject param2 = new JSONObject();
|
||||
param2.put("flag", "2");
|
||||
param2.put("region_code", "YSQA01");
|
||||
@@ -197,12 +231,18 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
||||
} else {
|
||||
Integer block_num = json2.getInteger("block_num");
|
||||
Integer col_num = json2.getInteger("col_num");
|
||||
JSONObject firstRow = pointTab.query("block_num = '" + block_num + "' and col_num = '" + col_num + "' and row_num ='1'").uniqueResult(0);
|
||||
JSONObject firstRow = pointTab.query("block_num = '" + block_num + "' and col_num = '" + col_num + "' and row_num ='9'").uniqueResult(0);
|
||||
taskObj.put("point_code2", firstRow.getString("point_code"));
|
||||
//二楼终点追加任务
|
||||
taskObj.put("acs_task_type", "4");
|
||||
//二楼普通任务
|
||||
taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
//锁住相关货位
|
||||
JSONObject point = new JSONObject();
|
||||
point.put("lock_type", "2");
|
||||
point.put("task_id", taskObj.getString("task_id"));
|
||||
pointTab.update(point, "block_num = '" + block_num + "' and col_num = '" + col_num + "' and row_num <= '" + 9 + "'");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,16 +251,18 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
||||
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask() {
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
/*
|
||||
* 下发给ACS时需要特殊处理
|
||||
*/
|
||||
JSONArray arr = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0'").getResultJSONArray(0);
|
||||
JSONArray arr = taskTab.query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0'").getResultJSONArray(0);
|
||||
|
||||
ArrayList<AcsTaskDto> acsTaskArr = new ArrayList<>();
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
|
||||
String point_code = json.getString("point_code3");
|
||||
String point_code = json.getString("point_code2");
|
||||
String newPoint = point_code.substring(0, 4) + "1" + point_code.substring(4, 9);
|
||||
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
@@ -271,6 +313,7 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
||||
.task_name("共挤线满料")
|
||||
.task_status(TaskStatusEnum.SURE_START.getCode())
|
||||
.point_code1(point_code1)
|
||||
.acs_task_type("2")//2楼AGV普通任务
|
||||
.vehicle_code(vehicle_code)
|
||||
.material_qty(qty)
|
||||
.material_info_id(workOrderObj.getLong("workorder_id"))
|
||||
@@ -292,9 +335,13 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
||||
@Override
|
||||
public void forceFinish(String task_id) {
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj))
|
||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status < " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||
this.updateTaskStatus(taskObj, "2");
|
||||
} else {
|
||||
throw new BadRequestException("任务已删除或者已完成!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -303,6 +350,7 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
||||
|
||||
}
|
||||
|
||||
//TODO 暂时不用二次申请
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public String againApply(String task_id) {
|
||||
@@ -315,28 +363,22 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
||||
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); // 点位表
|
||||
|
||||
JSONObject taskObj = taskTab.query("task_id ='" + task_id + "'").uniqueResult(0);
|
||||
JSONObject jsonPoint2 = pointTab.query("point_code = '" + taskObj.getString("point_code2") + "'").uniqueResult(0);
|
||||
|
||||
// 根据 区域、块、列找到第一个有物料的货位
|
||||
JSONObject jsonOnePoint = pointTab.query("region_id = '" + jsonPoint2.getString("region_id") +
|
||||
"' and block_num = '" + jsonPoint2.getString("block_num") +
|
||||
"' and col_num = '" + jsonPoint2.getString("col_num") +
|
||||
"' and point_status = '1' order by row_num desc").uniqueResult(0);
|
||||
JSONObject jsonPoint3 = pointTab.query("point_code = '" + taskObj.getString("point_code3") + "'").uniqueResult(0);
|
||||
//提前更新这列货位状态,方便生成往这列的任务
|
||||
jsonPoint3.put("point_status", "3");
|
||||
jsonPoint3.put("material_id", taskObj.getString("material_id"));
|
||||
pointTab.update(jsonPoint3);
|
||||
//释放相关货位
|
||||
JSONObject point = new JSONObject();
|
||||
point.put("lock_type", "1");
|
||||
point.put("task_id", "");
|
||||
pointTab.update(point, "task_id = '" + taskObj.getString("task_id") + "'");
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonOnePoint)) throw new BadRequestException("该列库存状态有误,请检查!");
|
||||
|
||||
taskObj.put("point_code3", jsonOnePoint.getString("point_code"));
|
||||
taskObj.put("remark", "二次申请货位");
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
|
||||
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
|
||||
String point_code = jsonOnePoint.getString("point_code");
|
||||
String point_code = taskObj.getString("point_code3");
|
||||
String newPoint = point_code.substring(0, 4) + "1" + point_code.substring(4, 9);
|
||||
|
||||
// 点位上锁
|
||||
jsonOnePoint.put("lock_type", "2");
|
||||
pointTab.update(jsonOnePoint);
|
||||
return newPoint;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,13 +51,13 @@
|
||||
p.row_num,
|
||||
p.col_num
|
||||
FROM
|
||||
|
||||
SCH_BASE_Point p
|
||||
where p.is_used = '1'
|
||||
AND is_delete = '0'
|
||||
AND lock_type = '1'
|
||||
AND p.row_num >1
|
||||
and p.point_status='1'
|
||||
where
|
||||
p.is_used = '1'
|
||||
AND is_delete = '0'
|
||||
AND lock_type = '1'
|
||||
AND point_status = '3'
|
||||
and row_num>1
|
||||
OPTION 输入.material_id <> ""
|
||||
p.material_id = 输入.material_id
|
||||
ENDOPTION
|
||||
@@ -67,7 +67,7 @@
|
||||
OPTION 输入.vehicle_type <> ""
|
||||
p.can_vehicle_type like 输入.vehicle_type
|
||||
ENDOPTION
|
||||
ORDER BY block_num,row_num
|
||||
ORDER BY block_num,col_num,row_num
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -151,7 +151,8 @@ public class RegionIoServiceImpl implements RegionIoService {
|
||||
for (int i = 0; i < dto.size(); i++) {
|
||||
JSONObject dtoJSONObject = dto.getJSONObject(i);
|
||||
JSONObject iostorinv = regionIoTab.query("iostorinv_id = '" + dtoJSONObject.getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.equal(iostorinv.getString("bill_status"), "3")) continue; // 已完成的单据不在继续
|
||||
if (ObjectUtil.equal(iostorinv.getString("bill_status"), "3"))
|
||||
throw new BadRequestException("没有单据或者已出库");
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", dtoJSONObject.getString("start_point_code"));
|
||||
param.put("vehicle_code", dtoJSONObject.getString("vehicle_code"));
|
||||
|
||||
@@ -244,11 +244,6 @@ public class StructivtServiceImpl implements StructivtService {
|
||||
JSONObject structivts = jsonArray.getJSONObject(i);
|
||||
// 如果是空位或者锁定就跳过
|
||||
if (structivts.getString("lock_type").equals("2") || !structivts.getString("point_status").equals("3")) continue;
|
||||
// 找到任務
|
||||
JSONObject taskObj = taskTab.query("task_id = '" + structivts.getString("task_id") + "'").uniqueResult(0);
|
||||
String end_point_code = taskObj.getString("point_code3");
|
||||
if (ObjectUtil.isEmpty(end_point_code)) end_point_code = taskObj.getString("point_code2");
|
||||
|
||||
// 插入regionIO - 未锁定,有料位
|
||||
JSONObject regionIoObj = new JSONObject();
|
||||
regionIoObj.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
@@ -264,8 +259,6 @@ public class StructivtServiceImpl implements StructivtService {
|
||||
regionIoObj.put("start_point_code", structivts.getString("point_code")); // 起点
|
||||
String start_region_id = pointTab.query("point_code = '" + structivts.getString("point_code") + "'").uniqueResult(0).getString("region_id");
|
||||
if (ObjectUtil.isNotEmpty(start_region_id))
|
||||
// regionIoObj.put("start_region_id", start_region_id);
|
||||
regionIoObj.put("task_id", structivts.getString("task_id"));
|
||||
regionIoObj.put("region_id", structivts.getString("region_id"));
|
||||
regionIoObj.put("region_code", structivts.getString("region_code"));
|
||||
regionIoObj.put("region_name", structivts.getString("region_name"));
|
||||
|
||||
@@ -48,48 +48,48 @@
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
cppoint.*,
|
||||
str.stockrecord_id,
|
||||
str.pcsn,
|
||||
str.material_id,
|
||||
str.ivt_qty,
|
||||
str.qty_unit_id,
|
||||
str.instorage_time,
|
||||
str.standing_time
|
||||
str.*,
|
||||
point.vehicle_type,
|
||||
point.layer_num,
|
||||
point.row_num,
|
||||
point.col_num,
|
||||
point.is_used,
|
||||
point.lock_type,
|
||||
point.point_status
|
||||
FROM
|
||||
st_ivt_structivt str
|
||||
LEFT JOIN sch_base_point cppoint ON str.point_id = cppoint.point_id
|
||||
LEFT JOIN sch_base_point point ON str.point_id = point.point_id
|
||||
WHERE
|
||||
cppoint.region_code IN 输入.region_code
|
||||
point.region_code IN 输入.region_code
|
||||
OPTION 输入.point_code <> ""
|
||||
point_code LIKE 输入.point_code
|
||||
point.point_code LIKE 输入.point_code
|
||||
ENDOPTION
|
||||
OPTION 输入.point_status <> ""
|
||||
point_status = 输入.point_status
|
||||
point.point_status = 输入.point_status
|
||||
ENDOPTION
|
||||
OPTION 输入.vehicle_type <> ""
|
||||
vehicle_type = 输入.vehicle_type
|
||||
point.vehicle_type = 输入.vehicle_type
|
||||
ENDOPTION
|
||||
OPTION 输入.layer_num <> ""
|
||||
cppoint.layer_num = 输入.layer_num
|
||||
point.layer_num = 输入.layer_num
|
||||
ENDOPTION
|
||||
OPTION 输入.row_num <> ""
|
||||
row_num = 输入.row_num
|
||||
point.row_num = 输入.row_num
|
||||
ENDOPTION
|
||||
OPTION 输入.col_num <> ""
|
||||
col_num = 输入.col_num
|
||||
point.col_num = 输入.col_num
|
||||
ENDOPTION
|
||||
OPTION 输入.lock_type <> ""
|
||||
lock_type = 输入.lock_type
|
||||
point.lock_type = 输入.lock_type
|
||||
ENDOPTION
|
||||
OPTION 输入.is_used <> ""
|
||||
is_used = 输入.is_used
|
||||
point.is_used = 输入.is_used
|
||||
ENDOPTION
|
||||
OPTION 输入.begin_time <> ""
|
||||
instorage_time >= 输入.begin_time
|
||||
str.instorage_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
OPTION 输入.end_time <> ""
|
||||
instorage_time <= 输入.end_time
|
||||
str.instorage_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
|
||||
Binary file not shown.
@@ -52,7 +52,6 @@ export function getRegion() {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function changeUsed(data) {
|
||||
return request({
|
||||
url: 'api/point/changeUsed',
|
||||
@@ -61,4 +60,12 @@ export function changeUsed(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeActive, findPoints, getPoint, getRegion, changeUsed }
|
||||
export function changeLock(data) {
|
||||
return request({
|
||||
url: 'api/point/changeLock',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeActive, findPoints, getPoint, getRegion, changeUsed, changeLock }
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-width="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="模糊搜索">
|
||||
@@ -69,22 +69,51 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="锁定类型">
|
||||
<el-select
|
||||
v-model="query.lock_type"
|
||||
<el-form-item label="块" v-if="(query.region_id=='1557539288307077120' || query.region_id=='1582909373552922624')">
|
||||
<el-input
|
||||
v-model="query.block_num"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="锁定类型"
|
||||
class="filter-item"
|
||||
placeholder="块"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排" v-if="(query.region_id=='1557539288307077120' || query.region_id=='1582909373552922624' || query.region_id=='1557538851726168064')">
|
||||
<el-input
|
||||
v-model="query.row_num"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="排"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="列" v-if="(query.region_id=='1557539288307077120' || query.region_id=='1582909373552922624' || query.region_id=='1557538851726168064')">
|
||||
<el-input
|
||||
v-model="query.col_num"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="列"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="层" v-if="(query.region_id=='1557539288307077120' || query.region_id=='1582909373552922624' || query.region_id=='1557538851726168064')">
|
||||
<el-input
|
||||
v-model="query.layer_num"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="层"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="锁定类型">
|
||||
<el-switch
|
||||
v-model="query.lock_type"
|
||||
active-value="2"
|
||||
inactive-value="1"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#C0CCDA"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.d_lock_type"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否启用">
|
||||
@@ -109,6 +138,7 @@
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-circle-check"
|
||||
v-if="crud.query.is_used == 0"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="changeUsed(crud.selections, 1)"
|
||||
>
|
||||
@@ -118,13 +148,38 @@
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="danger"
|
||||
type="primary"
|
||||
icon="el-icon-circle-close"
|
||||
v-if="crud.query.is_used == 1"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="changeUsed(crud.selections, 0)"
|
||||
>
|
||||
禁用
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-circle-check"
|
||||
v-if="crud.query.lock_type == 1"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="changeLock(crud.selections, 2)"
|
||||
>
|
||||
锁定
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-circle-close"
|
||||
v-if="crud.query.lock_type == 2"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="changeLock(crud.selections, 1)"
|
||||
>
|
||||
解锁
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
@@ -240,7 +295,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="vehicle_code" label="载具编码" />
|
||||
<el-table-column prop="vehicle_qty" label="载具数量" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="remark" label="备注" min-width="100" show-overflow-tooltip/>
|
||||
<el-table-column prop="is_used" label="是否启用">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.is_used=='1' ? '是' : '否' }}
|
||||
@@ -339,6 +394,11 @@ export default {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.afterToCU]() {
|
||||
if (this.form.region_id) {
|
||||
this.getPointStatusAndTypeList(this.form.region_id)
|
||||
}
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
@@ -389,6 +449,15 @@ export default {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
changeLock(data, flag) { // 更改锁定状态
|
||||
const param = {}
|
||||
param.data = data
|
||||
param.lock_type = flag
|
||||
crudPoint.changeLock(param).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -114,21 +114,30 @@
|
||||
>
|
||||
<el-table-column type="selection" width="50" />
|
||||
<el-table-column v-if="true" prop="task_id" label="任务标识" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column v-if="true" prop="material_id" label="物料标识" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="task_code" label="任务编码" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column v-if="false" prop="task_type" label="任务类型" />
|
||||
<el-table-column prop="acs_task_type" label="acs任务类型" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="acs_task_type" label="acs任务类型" min-width="120" show-overflow-tooltip >
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.acs_task_type[scope.row.acs_task_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="task_name" label="任务描述" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column v-if="false" prop="task_type_name" label="任务类型" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column v-if="false" prop="task_status" label="任务状态" />
|
||||
<el-table-column prop="task_status_name" label="任务状态" width="95px" :formatter="formatTaskStatusName" />
|
||||
<el-table-column prop="vehicle_type" label="载具类型" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicle_type" label="载具类型" min-width="100" show-overflow-tooltip >
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="vehicle_code" label="载具编码" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="point_code1" label="点位1" width="100" />
|
||||
<el-table-column prop="point1_region_name" label="区域1" width="100" />
|
||||
<el-table-column prop="point_code2" label="点位2" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="point2_region_name" label="区域2" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="point_code3" label="点位3" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="point3_region_name" label="区域3" min-width="120" show-overflow-tooltip />
|
||||
<!--<el-table-column prop="point_code3" label="点位3" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="point3_region_name" label="区域3" min-width="120" show-overflow-tooltip />-->
|
||||
<!--<el-table-column prop="point_code3" label="点位3" width="85" />
|
||||
<el-table-column prop="point_code4" label="点位4" width="85" />-->
|
||||
<el-table-column prop="remark" label="备注" width="120" show-overflow-tooltip />
|
||||
@@ -145,7 +154,7 @@
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-upload"
|
||||
@click="doOperate(scope.row, 'd')"
|
||||
@click="doOperate(scope.row, 'c')"
|
||||
>下发</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
@@ -196,7 +205,7 @@ import crudClassstandard from '@/api/wms/basedata/classstandard'
|
||||
|
||||
export default {
|
||||
name: 'Task',
|
||||
dicts: [],
|
||||
dicts: ['acs_task_type', 'vehicle_type'],
|
||||
components: {
|
||||
pagination, crudOperation, rrOperation, Treeselect, udOperation
|
||||
},
|
||||
@@ -311,13 +320,10 @@ export default {
|
||||
case 'b':// 取消
|
||||
method_name = 'cancel'
|
||||
break
|
||||
case 'c':// 拉回
|
||||
method_name = 'pullBack'
|
||||
case 'c':// 下发
|
||||
method_name = 'immediateNotifyAcs'
|
||||
break
|
||||
case 'd':// 下发
|
||||
method_name = 'renotifyAcs'
|
||||
break
|
||||
case 'e':// 详情
|
||||
case 'd':// 详情
|
||||
method_name = 'view'
|
||||
break
|
||||
}
|
||||
|
||||
@@ -50,23 +50,6 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="点位状态">
|
||||
<el-select
|
||||
v-model="query.point_status"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 185px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.sch_point_status"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具类型">
|
||||
<el-select
|
||||
v-model="query.vehicle_type"
|
||||
@@ -145,22 +128,6 @@
|
||||
<el-form-item label="点位编码" prop="standing_time">
|
||||
<el-input v-model="form.point_code" style="width: 370px;" :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="点位状态">
|
||||
<el-select
|
||||
v-model="form.point_status"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.sch_point_status"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="托盘类型">
|
||||
<el-select
|
||||
v-model="form.vehicle_type"
|
||||
@@ -207,7 +174,6 @@
|
||||
<el-table-column prop="pcsn" label="批次" />
|
||||
<el-table-column prop="ivt_qty" label="库存数" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="instorage_time" label="入库时间" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="point_status_name" label="点位状态" />
|
||||
<el-table-column prop="vehicle_type" label="托盘类型" min-width="100"/>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="is_used" label="是否启用" >
|
||||
|
||||
@@ -50,23 +50,6 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="点位状态">
|
||||
<el-select
|
||||
v-model="query.point_status"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 185px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.sch_point_status"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具类型">
|
||||
<el-select
|
||||
v-model="query.vehicle_type"
|
||||
@@ -133,22 +116,6 @@
|
||||
<el-form-item label="点位编码" prop="standing_time">
|
||||
<el-input v-model="form.point_code" style="width: 370px;" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="点位状态">
|
||||
<el-select
|
||||
v-model="form.point_status"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.sch_point_status"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="托盘类型">
|
||||
<el-select
|
||||
v-model="form.vehicle_type"
|
||||
@@ -196,9 +163,8 @@
|
||||
<el-table-column prop="point_code" label="点位编码" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="region_name" label="区域名称" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="pcsn" label="批次" />
|
||||
<el-table-column prop="ivt_qty" label="库存数" />
|
||||
<el-table-column prop="ivt_qty" label="库存数" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="instorage_time" label="入库时间" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="point_status_name" label="点位状态" />
|
||||
<el-table-column prop="lock_type" label="锁定类型">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.d_lock_type[scope.row.lock_type] }}
|
||||
|
||||
Reference in New Issue
Block a user