Browse Source

美化

master
张江玮 2 years ago
parent
commit
4f268e50aa
  1. 54
      wms/hd/nladmin-system/src/main/java/org/nl/wms/common/StructFindUtil.java
  2. 14
      wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  3. 14
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java
  4. 9
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallMaterialTask.java
  5. 14
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendEmptyVehicleTask.java

54
wms/hd/nladmin-system/src/main/java/org/nl/wms/common/StructFindUtil.java

@ -59,11 +59,15 @@ public class StructFindUtil {
if (StrUtil.isEmpty(workprocedure_id)) { if (StrUtil.isEmpty(workprocedure_id)) {
throw new BadRequestException("工序不能为空!"); throw new BadRequestException("工序不能为空!");
} }
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "3") JSONObject result = WQL
.addParam("material_id", material_id).addParam("area_type", area_type) .getWO("QSTRUCT_RULE")
.addParam("flag", "3")
.addParam("material_id", material_id)
.addParam("area_type", area_type)
.addParam("vehicle_type", vehicle_type) .addParam("vehicle_type", vehicle_type)
.addParam("is_full", is_full).addParam("workprocedure_id", workprocedure_id) .addParam("is_full", is_full).addParam("workprocedure_id", workprocedure_id)
.process().uniqueResult(0); .process()
.uniqueResult(0);
return result; return result;
} }
@ -74,12 +78,20 @@ public class StructFindUtil {
if (StrUtil.isEmpty(vehicle_code)) { if (StrUtil.isEmpty(vehicle_code)) {
throw new BadRequestException("托盘不能为空!"); throw new BadRequestException("托盘不能为空!");
} }
if (StrUtil.equals(point_code, "KGTPDDW05")) { if (StrUtil.equals(point_code, "KGTDDW05")) {
JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTCPQ.getCode()).addParam("flag", "2").process().getResultJSONArray(0); JSONArray pointarr = WQL
.getWO("ACSTOMES_001")
.addParam("area_type", AreaEnum.KGTCPQ.getCode())
.addParam("flag", "2")
.process()
.getResultJSONArray(0);
PointUpdateUtil.updatePoint(pointarr); PointUpdateUtil.updatePoint(pointarr);
} }
//根据托盘找托盘类型, //根据托盘找托盘类型,
JSONObject vehicleObj = WQLObject.getWQLObject("md_pb_vehicle").query("vehicle_code='" + vehicle_code + "'").uniqueResult(0); JSONObject vehicleObj = WQLObject
.getWQLObject("md_pb_vehicle")
.query("vehicle_code='" + vehicle_code + "'")
.uniqueResult(0);
if (ObjectUtil.isEmpty(vehicleObj)) { if (ObjectUtil.isEmpty(vehicleObj)) {
throw new BadRequestException("未找到托盘号为'" + vehicle_code + "' 托盘信息!"); throw new BadRequestException("未找到托盘号为'" + vehicle_code + "' 托盘信息!");
} }
@ -87,11 +99,14 @@ public class StructFindUtil {
throw new BadRequestException("区域不能为空!"); throw new BadRequestException("区域不能为空!");
} }
String vehice_type = vehicleObj.getString("vehicle_type"); String vehice_type = vehicleObj.getString("vehicle_type");
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "4") JSONObject result = WQL
.getWO("QSTRUCT_RULE")
.addParam("flag", "4")
.addParam("area_type", area_type) .addParam("area_type", area_type)
.addParam("vehice_type", vehice_type) .addParam("vehice_type", vehice_type)
.addParam("point_code", point_code) .addParam("point_code", point_code)
.process().uniqueResult(0); .process()
.uniqueResult(0);
return result; return result;
} }
@ -101,9 +116,12 @@ public class StructFindUtil {
String point_code = jsonObject.getString("point_code"); String point_code = jsonObject.getString("point_code");
//如果是堆叠位5 需要更新 设备状态 //如果是堆叠位5 需要更新 设备状态
if(StrUtil.equals(point_code,"KGTDDW05")){ if(StrUtil.equals(point_code,"KGTDDW05")){
JSONArray pointarr = WQL.getWO("ACSTOMES_001") JSONArray pointarr = WQL
.getWO("ACSTOMES_001")
.addParam("area_type", AreaEnum.KGTCPQ.getCode()) .addParam("area_type", AreaEnum.KGTCPQ.getCode())
.addParam("flag", "2").process().getResultJSONArray(0); .addParam("flag", "2")
.process()
.getResultJSONArray(0);
PointUpdateUtil.updatePoint(pointarr); PointUpdateUtil.updatePoint(pointarr);
} }
@ -113,19 +131,23 @@ public class StructFindUtil {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
//如果是堆叠位5 需要更新 设备状态 //如果是堆叠位5 需要更新 设备状态
if (StrUtil.equals(point_code, "KGTDDW05")) { if (StrUtil.equals(point_code, "KGTDDW05")) {
JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTCPQ.getCode()).addParam("flag", "2").process().getResultJSONArray(0); result = WQL
PointUpdateUtil.updatePoint(pointarr); .getWO("QSTRUCT_RULE")
result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "6") .addParam("flag", "6")
.addParam("area_type", area_type) .addParam("area_type", area_type)
.addParam("vehicle_type", vehicle_type) .addParam("vehicle_type", vehicle_type)
.addParam("point_code", point_code) .addParam("point_code", point_code)
.process().uniqueResult(0); .process()
.uniqueResult(0);
} else { } else {
result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "5") result = WQL
.getWO("QSTRUCT_RULE")
.addParam("flag", "5")
.addParam("area_type", area_type) .addParam("area_type", area_type)
.addParam("vehicle_type", vehicle_type) .addParam("vehicle_type", vehicle_type)
.addParam("point_code", point_code) .addParam("point_code", point_code)
.process().uniqueResult(0); .process()
.uniqueResult(0);
} }
return result; return result;

14
wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -122,11 +122,19 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
produceInfoByCode = this.getProduceInfoByCode(device_code); produceInfoByCode = this.getProduceInfoByCode(device_code);
String material_id = produceInfoByCode.getString("material_id"); String material_id = produceInfoByCode.getString("material_id");
String cust_id = produceInfoByCode.getString("cust_id"); String cust_id = produceInfoByCode.getString("cust_id");
String workprocedure_id = WorkProcedureEnum.YZGX.getId(); String workprocedure_id;
JSONObject jsonObject1 = WQL.getWO("ACSTOMES_001").addParam("flag", "1") if (device_code.startsWith("Y")) {
workprocedure_id = WorkProcedureEnum.YZGX.getId();
} else {
workprocedure_id = WorkProcedureEnum.FJGX.getId();
}
JSONObject jsonObject1 = WQL
.getWO("ACSTOMES_001")
.addParam("flag", "1")
.addParam("workprocedure_id", workprocedure_id) .addParam("workprocedure_id", workprocedure_id)
.addParam("material_id", material_id) .addParam("material_id", material_id)
.process().uniqueResult(0); .process()
.uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonObject1)) { if (ObjectUtil.isNotEmpty(jsonObject1)) {
//如果有库存,则出半满托盘 //如果有库存,则出半满托盘
//叫料出库 //叫料出库

14
wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java

@ -188,8 +188,8 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
String vehicle_type = form.getString("vehicle_type"); String vehicle_type = form.getString("vehicle_type");
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task"); WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
//判断起点有没有未完成的指令 //判断起点有没有未完成的指令
JSONObject beforTaskObj = taskTable. JSONObject beforTaskObj = taskTable
query("is_delete='0' and next_point_code='" + next_point_code + "' and task_status <>'" + TaskStatusEnum.FINISHED.getCode() + "'") .query("is_delete='0' and next_point_code='" + next_point_code + "' and task_status <>'" + TaskStatusEnum.FINISHED.getCode() + "'")
.uniqueResult(0); .uniqueResult(0);
if (ObjectUtil.isNotEmpty(beforTaskObj)) { if (ObjectUtil.isNotEmpty(beforTaskObj)) {
throw new BadRequestException("存在指令号为'" + beforTaskObj.getString("task_code") + "' 未完成!"); throw new BadRequestException("存在指令号为'" + beforTaskObj.getString("task_code") + "' 未完成!");
@ -197,8 +197,12 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
String start_area = ""; String start_area = "";
//假如起点为空,根据终点点去找对应工序需要的托盘类型 //假如起点为空,根据终点点去找对应工序需要的托盘类型
if (StrUtil.isEmpty(start_point_code)) { if (StrUtil.isEmpty(start_point_code)) {
JSONObject workInfo = WQL.getWO("QSTRUCT_RULE").addParam("flag", "1").addParam("code", next_point_code) JSONObject workInfo = WQL
.process().uniqueResult(0); .getWO("QSTRUCT_RULE")
.addParam("flag", "1")
.addParam("code", next_point_code)
.process()
.uniqueResult(0);
String workprocedure_id = workInfo.getString("workprocedure_id"); String workprocedure_id = workInfo.getString("workprocedure_id");
String device_id = workInfo.getString("device_id"); String device_id = workInfo.getString("device_id");
WorkProcedureEnum workProcedureEnum = WorkProcedureEnum.get(workprocedure_id); WorkProcedureEnum workProcedureEnum = WorkProcedureEnum.get(workprocedure_id);
@ -224,7 +228,7 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
case FJGX: case FJGX:
//托盘类型取当前工单生产的托盘类型 //托盘类型取当前工单生产的托盘类型
vehicle_type = WQLObject.getWQLObject("PDM_MG_produceTask").query("device_id='" + device_id + "' and producetask_status='04'").uniqueResult(0).getString("vehicle_type"); vehicle_type = WQLObject.getWQLObject("PDM_MG_produceTask").query("device_id='" + device_id + "' and producetask_status='04'").uniqueResult(0).getString("vehicle_type");
start_area = AreaEnum.CYZC.getCode(); start_area = AreaEnum.RGCPQ.getCode();
is_auto_issue = "0"; is_auto_issue = "0";
break; break;
//叠盘工序 //叠盘工序

9
wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallMaterialTask.java

@ -199,13 +199,16 @@ public class CallMaterialTask extends AbstractAcsTask {
WQLObject iosTable = WQLObject.getWQLObject("ST_IVT_workProcedureIOS"); WQLObject iosTable = WQLObject.getWQLObject("ST_IVT_workProcedureIOS");
if (StrUtil.isNotEmpty(start_point_code)) { if (StrUtil.isNotEmpty(start_point_code)) {
if (StrUtil.isEmpty(iostorinv_id)) { if (StrUtil.isEmpty(iostorinv_id)) {
throw new BadRequestException("库单据号不能为空!"); throw new BadRequestException("库单据号不能为空!");
} }
JSONObject IosObj = iosTable.query("iostorinv_id='" + iostorinv_id + "'").uniqueResult(0); JSONObject IosObj = iosTable.query("iostorinv_id='" + iostorinv_id + "'").uniqueResult(0);
IosObj.put("bill_status", "20"); IosObj.put("bill_status", "20");
iosTable.update(IosObj); iosTable.update(IosObj);
PointDto StartPoint = pointService.findByCode(start_point_code); PointDto StartPoint = pointService.findByCode(start_point_code);
JSONObject ivtObj = WQLObject.getWQLObject("ST_IVT_StructIvt").query("struct_id='" + StartPoint.getPoint_id() + "'").uniqueResult(0); JSONObject ivtObj = WQLObject
.getWQLObject("ST_IVT_StructIvt")
.query("struct_id='" + StartPoint.getPoint_id() + "'")
.uniqueResult(0);
if (ObjectUtil.isEmpty(ivtObj)) { if (ObjectUtil.isEmpty(ivtObj)) {
throw new BadRequestException("仓位为'" + StartPoint.getPoint_code() + "'的库存信息不存在!"); throw new BadRequestException("仓位为'" + StartPoint.getPoint_code() + "'的库存信息不存在!");
} }
@ -215,7 +218,7 @@ public class CallMaterialTask extends AbstractAcsTask {
} }
PointDto nextPoint = pointService.findByCode(next_point_code); PointDto nextPoint = pointService.findByCode(next_point_code);
//如果没给起点,根据点去找工序,找一个合适的仓位 并且生成出库单,并且锁定点位 //如果没给起点,根据点去找工序,找一个合适的仓位 并且生成出库单,并且锁定点位
if (StrUtil.isEmpty(start_point_code)) { if (StrUtil.isEmpty(start_point_code)) {
if (StrUtil.isEmpty(workprocedure_id)) { if (StrUtil.isEmpty(workprocedure_id)) {
JSONObject workInfo = WQL JSONObject workInfo = WQL

14
wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendEmptyVehicleTask.java

@ -163,8 +163,12 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
} }
//根据起点去找工序,找一个合适的仓位 并且生成单据 //根据起点去找工序,找一个合适的仓位 并且生成单据
if (StrUtil.isEmpty(next_point_code)) { if (StrUtil.isEmpty(next_point_code)) {
JSONObject workInfo = WQL.getWO("QSTRUCT_RULE").addParam("flag", "1").addParam("code", start_point_code) JSONObject workInfo = WQL
.process().uniqueResult(0); .getWO("QSTRUCT_RULE")
.addParam("flag", "1")
.addParam("code", start_point_code)
.process()
.uniqueResult(0);
String workprocedure_code = workInfo.getString("workInfo"); String workprocedure_code = workInfo.getString("workInfo");
String workprocedure_id = workInfo.getString("workprocedure_id"); String workprocedure_id = workInfo.getString("workprocedure_id");
WorkProcedureEnum workProcedureEnum = WorkProcedureEnum.get(workprocedure_id); WorkProcedureEnum workProcedureEnum = WorkProcedureEnum.get(workprocedure_id);
@ -175,7 +179,7 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
break; break;
// 压制工序 // 压制工序
case YZGX: case YZGX:
next_area = AreaEnum.CYHJ.getCode(); next_area = AreaEnum.KLHJ.getCode();
break; break;
//烧制工序 //烧制工序
case SZGX: case SZGX:
@ -211,7 +215,9 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
//锁定终点 //锁定终点
HashMap lock_map = new HashMap(); HashMap lock_map = new HashMap();
lock_map.put("lock_type", "01"); lock_map.put("lock_type", "01");
WQLObject.getWQLObject("sch_base_point").update(lock_map, "point_code = '" + next_point_code + "'"); WQLObject
.getWQLObject("sch_base_point")
.update(lock_map, "point_code = '" + next_point_code + "'");
} }
String task_id = IdUtil.getSnowflake(1, 1).nextId() + ""; String task_id = IdUtil.getSnowflake(1, 1).nextId() + "";

Loading…
Cancel
Save