Browse Source

代码格式

master
张江玮 2 years ago
parent
commit
7372060d55
  1. 15
      wms/hd/nladmin-system/src/main/java/org/nl/wms/common/StructFindUtil.java
  2. 20
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallMaterialTask.java
  3. 13
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendMaterialTask.java

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

@ -19,7 +19,10 @@ public class StructFindUtil {
throw new BadRequestException("托盘不能为空!"); throw new BadRequestException("托盘不能为空!");
} }
//根据托盘找托盘类型, //根据托盘找托盘类型,
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 + "' 托盘信息!");
} }
@ -30,8 +33,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", "2") JSONObject result = WQL
.addParam("material_id", material_id).addParam("area_type", area_type).addParam("vehice_type", vehice_type).process().uniqueResult(0); .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; return result;
} }

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

@ -164,15 +164,14 @@ public class CallMaterialTask extends AbstractAcsTask {
String start_point_code = form.getString("start_point_code"); String start_point_code = form.getString("start_point_code");
String next_point_code = form.getString("next_point_code"); String next_point_code = form.getString("next_point_code");
String vehicle_code = form.getString("vehicle_code"); String vehicle_code = form.getString("vehicle_code");
String task_status = TaskStatusEnum.SURE_START.getCode();
String material_id = form.getString("material_id"); String material_id = form.getString("material_id");
String cust_id = form.getString("cust_id"); String cust_id = form.getString("cust_id");
String create_mode = form.getString("create_mode"); String create_mode = form.getString("create_mode");
String pcsn = form.getString("pcsn"); String pcsn = form.getString("pcsn");
String is_full = form.getString("is_full"); String is_full = form.getString("is_full");
String workprocedure_id = form.getString("workprocedure_id"); String workprocedure_id = form.getString("workprocedure_id");
WQLObject taskTable = WQLObject.getWQLObject("SCH_BASE_Task");
String iostorinv_id = form.getString("iostorinv_id"); String iostorinv_id = form.getString("iostorinv_id");
WQLObject taskTable = WQLObject.getWQLObject("SCH_BASE_Task");
if (StrUtil.isEmpty(next_point_code)) { if (StrUtil.isEmpty(next_point_code)) {
throw new BadRequestException("终点不能为空!"); throw new BadRequestException("终点不能为空!");
} }
@ -183,8 +182,8 @@ public class CallMaterialTask extends AbstractAcsTask {
throw new BadRequestException("是否满托不能为空!"); throw new BadRequestException("是否满托不能为空!");
} }
//判断终点有没有未完成的指令 //判断终点有没有未完成的指令
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") + "' 未完成!");
@ -216,12 +215,15 @@ 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.getWO("QSTRUCT_RULE").addParam("flag", "1").addParam("code", next_point_code) .getWO("QSTRUCT_RULE")
.process().uniqueResult(0); .addParam("flag", "1")
.addParam("code", next_point_code)
.process()
.uniqueResult(0);
workprocedure_id = workInfo.getString("workprocedure_id"); workprocedure_id = workInfo.getString("workprocedure_id");
WorkProcedureEnum workProcedureEnum = WorkProcedureEnum.get(workprocedure_id); WorkProcedureEnum workProcedureEnum = WorkProcedureEnum.get(workprocedure_id);
@ -316,7 +318,7 @@ public class CallMaterialTask extends AbstractAcsTask {
WQLObject.getWQLObject("ST_IVT_workProcedureIOS").insert(iosObj); WQLObject.getWQLObject("ST_IVT_workProcedureIOS").insert(iosObj);
} }
task_status = TaskStatusEnum.START_AND_POINT.getCode(); String task_status = TaskStatusEnum.START_AND_POINT.getCode();
PointDto startPoint = pointService.findByCode(start_point_code); PointDto startPoint = pointService.findByCode(start_point_code);
start_area = nextPoint.getArea_type(); start_area = nextPoint.getArea_type();

13
wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendMaterialTask.java

@ -258,7 +258,7 @@ public class SendMaterialTask extends AbstractAcsTask {
//分拣工序 //分拣工序
case FJGX: case FJGX:
qty_unit_id = BussConstant.HN_IN_QTY_UNIT_ID; qty_unit_id = BussConstant.HN_IN_QTY_UNIT_ID;
bill_type = BillTypeEnum.SZRK.getCode(); bill_type = BillTypeEnum.FJRK.getCode();
endArea_type = AreaEnum.BZZC.getCode(); endArea_type = AreaEnum.BZZC.getCode();
break; break;
default: default:
@ -278,8 +278,11 @@ public class SendMaterialTask extends AbstractAcsTask {
//创建入库单据 //创建入库单据
//假如静置时间为0 或者为空,则取物料表上的静置时间 //假如静置时间为0 或者为空,则取物料表上的静置时间
if (StrUtil.isEmpty(stewing_time) || StrUtil.equals(stewing_time, "0")) { if (StrUtil.isEmpty(stewing_time) || StrUtil.equals(stewing_time, "0")) {
stewing_time = WQLObject.getWQLObject("md_me_material").query("material_id ='" + material_id + "'"). stewing_time = WQLObject
uniqueResult(0).getString("stewing_time"); .getWQLObject("md_me_material")
.query("material_id ='" + material_id + "'")
.uniqueResult(0)
.getString("stewing_time");
} }
JSONObject iosObj = new JSONObject(); JSONObject iosObj = new JSONObject();
iosObj.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId()); iosObj.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
@ -315,7 +318,9 @@ public class SendMaterialTask 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 + "'");
CodeUtil.getNewCode("TASK_CODE"); CodeUtil.getNewCode("TASK_CODE");
JSONObject taskObj = new JSONObject(); JSONObject taskObj = new JSONObject();
taskObj.put("task_id", task_id); taskObj.put("task_id", task_id);

Loading…
Cancel
Save