汪菘 2 years ago
parent
commit
b6a294c03c
  1. 1
      wms/hd/nladmin-system/src/main/java/org/nl/wms/.~lock.wms.xls#
  2. 4
      wms/hd/nladmin-system/src/main/java/org/nl/wms/WorkProcedureEnum.java
  3. 33
      wms/hd/nladmin-system/src/main/java/org/nl/wms/common/PointUpdateUtil.java
  4. 62
      wms/hd/nladmin-system/src/main/java/org/nl/wms/common/StructFindUtil.java
  5. 50
      wms/hd/nladmin-system/src/main/java/org/nl/wms/common/wql/QSTRUCT_RULE.wql
  6. 11
      wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java
  7. 8
      wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java
  8. 6
      wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java
  9. 21
      wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  10. 10
      wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java
  11. 22
      wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACSTOMES_001.wql
  12. 17
      wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/callMaterial/service/impl/CallMaterialServiceImpl.java
  13. 7
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/AreaEnum.java
  14. 10
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/VehicleTypeEnum.java
  15. 45
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java
  16. 29
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallMaterialTask.java
  17. 11
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendEmptyVehicleTask.java
  18. 21
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendMaterialTask.java
  19. 56
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/wql/BUSSTASK_001.wql
  20. 2
      wms/hd/nladmin-system/src/main/java/org/nl/wms/st/basedata/service/impl/SectattrServiceImpl.java
  21. BIN
      wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls
  22. 155
      wms/qd/src/views/wms/pdm/produceTask/MaterDialog.vue
  23. 44
      wms/qd/src/views/wms/pdm/produceTask/index.vue

1
wms/hd/nladmin-system/src/main/java/org/nl/wms/.~lock.wms.xls#

@ -0,0 +1 @@
,DESKTOP-BT6HP4E/zhang,DESKTOP-BT6HP4E,29.08.2022 16:51,file:///C:/Users/zhang/AppData/Roaming/LibreOffice/4;

4
wms/hd/nladmin-system/src/main/java/org/nl/wms/WorkProcedureEnum.java

@ -11,7 +11,9 @@ public enum WorkProcedureEnum {
HNGX(1, "1514444198529601536", "01", "混碾工序", ""), HNGX(1, "1514444198529601536", "01", "混碾工序", ""),
YZGX(2, "1514444247439380480", "02", "压制工序", ""), YZGX(2, "1514444247439380480", "02", "压制工序", ""),
SZGX(3, "1514444321896665088", "03", "烧制工序", ""), SZGX(3, "1514444321896665088", "03", "烧制工序", ""),
FJGX(4, "1514444386174373888", "04", "分拣工序", ""); FJGX(4, "1514444386174373888", "04", "分拣工序", ""),
DPGX(4, "1514444386174373888", "05", "叠盘工序", ""),
CPGX(4, "1514444386174373888", "06", "拆盘工序", "");
//顺序号 //顺序号
private int index; private int index;
//工序标识 //工序标识

33
wms/hd/nladmin-system/src/main/java/org/nl/wms/common/PointUpdateUtil.java

@ -0,0 +1,33 @@
package org.nl.wms.common;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.nl.modules.system.service.impl.ParamServiceImpl;
import org.nl.utils.SpringContextHolder;
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
import org.nl.wql.core.bean.WQLObject;
public class PointUpdateUtil {
public static void updatePoint(JSONArray arr) {
WmsToAcsServiceImpl wmsToAcsServiceImpl = new WmsToAcsServiceImpl();
String isConnect = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("IS_CONNECT_ACS").getValue();
if (StrUtil.equals("0", isConnect)) {
return;
}
JSONObject joo = wmsToAcsServiceImpl.queryPointStatus(arr);
JSONArray pointarr = joo.getJSONArray("data");
WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
for (int i = 0; i < pointarr.size(); i++) {
JSONObject pointjo = pointarr.getJSONObject(i);
String point_status = "0" + pointjo.getString("move");
String device_code = pointjo.getString("device_code");
pointjo.put("point_status", point_status);
JSONObject pointObj = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0);
pointObj.put("point_status", point_status);
pointTable.update(pointObj);
}
}
}

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

@ -2,9 +2,11 @@ package org.nl.wms.common;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.nl.exception.BadRequestException; import org.nl.exception.BadRequestException;
import org.nl.start.day01.Struct; import org.nl.start.day01.Struct;
import org.nl.wms.sch.manage.AreaEnum;
import org.nl.wql.WQL; import org.nl.wql.WQL;
import org.nl.wql.core.bean.WQLObject; import org.nl.wql.core.bean.WQLObject;
@ -17,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 + "' 托盘信息!");
} }
@ -28,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;
} }
@ -38,10 +49,7 @@ public class StructFindUtil {
String area_type = jsonObject.getString("area_type"); String area_type = jsonObject.getString("area_type");
String is_full = jsonObject.getString("is_full"); String is_full = jsonObject.getString("is_full");
String workprocedure_id = jsonObject.getString("workprocedure_id"); String workprocedure_id = jsonObject.getString("workprocedure_id");
String vehicle_type = jsonObject.getString("vehicle_type");
if (StrUtil.isEmpty(material_id)) {
throw new BadRequestException("物料不能为空!");
}
if (StrUtil.isEmpty(area_type)) { if (StrUtil.isEmpty(area_type)) {
throw new BadRequestException("区域不能为空!"); throw new BadRequestException("区域不能为空!");
} }
@ -53,6 +61,7 @@ public class StructFindUtil {
} }
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "3") JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "3")
.addParam("material_id", material_id).addParam("area_type", area_type) .addParam("material_id", material_id).addParam("area_type", area_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;
@ -61,9 +70,14 @@ public class StructFindUtil {
public static JSONObject getEmptyVehicleInStruct(JSONObject jsonObject) { public static JSONObject getEmptyVehicleInStruct(JSONObject jsonObject) {
String area_type = jsonObject.getString("area_type"); String area_type = jsonObject.getString("area_type");
String vehicle_code = jsonObject.getString("vehicle_code"); String vehicle_code = jsonObject.getString("vehicle_code");
String point_code = jsonObject.getString("point_code");
if (StrUtil.isEmpty(vehicle_code)) { if (StrUtil.isEmpty(vehicle_code)) {
throw new BadRequestException("托盘不能为空!"); throw new BadRequestException("托盘不能为空!");
} }
if (StrUtil.equals(point_code, "KGTPDDW05")) {
JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTCPQ.getCode()).addParam("flag", "2").process().getResultJSONArray(0);
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)) {
@ -74,18 +88,46 @@ public class StructFindUtil {
} }
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("vehice_type", vehice_type).process().uniqueResult(0); .addParam("area_type", area_type)
.addParam("vehice_type", vehice_type)
.addParam("point_code", point_code)
.process().uniqueResult(0);
return result; return result;
} }
public static JSONObject getEmptyVehicleOutStruct(JSONObject jsonObject) { public static JSONObject getEmptyVehicleOutStruct(JSONObject jsonObject) {
String area_type = jsonObject.getString("area_type"); String area_type = jsonObject.getString("area_type");
String vehicle_type = jsonObject.getString("vehicle_type"); String vehicle_type = jsonObject.getString("vehicle_type");
String point_code = jsonObject.getString("point_code");
//如果是堆叠位5 需要更新 设备状态
if(StrUtil.equals(point_code,"KGTDDW05")){
JSONArray pointarr = WQL.getWO("ACSTOMES_001")
.addParam("area_type", AreaEnum.KGTCPQ.getCode())
.addParam("flag", "2").process().getResultJSONArray(0);
PointUpdateUtil.updatePoint(pointarr);
}
if (StrUtil.isEmpty(area_type)) { if (StrUtil.isEmpty(area_type)) {
throw new BadRequestException("区域不能为空!"); throw new BadRequestException("区域不能为空!");
} }
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "5") JSONObject result = new JSONObject();
.addParam("area_type", area_type).addParam("vehicle_type", vehicle_type).process().uniqueResult(0); //如果是堆叠位5 需要更新 设备状态
if (StrUtil.equals(point_code, "KGTDDW05")) {
JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTCPQ.getCode()).addParam("flag", "2").process().getResultJSONArray(0);
PointUpdateUtil.updatePoint(pointarr);
result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "6")
.addParam("area_type", area_type)
.addParam("vehicle_type", vehicle_type)
.addParam("point_code", point_code)
.process().uniqueResult(0);
} else {
result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "5")
.addParam("area_type", area_type)
.addParam("vehicle_type", vehicle_type)
.addParam("point_code", point_code)
.process().uniqueResult(0);
}
return result; return result;
} }

50
wms/hd/nladmin-system/src/main/java/org/nl/wms/common/wql/QSTRUCT_RULE.wql

@ -21,6 +21,8 @@
输入.vehicle_type TYPEAS s_string 输入.vehicle_type TYPEAS s_string
输入.workprocedure_id TYPEAS s_string 输入.workprocedure_id TYPEAS s_string
输入.is_full TYPEAS s_string 输入.is_full TYPEAS s_string
输入.vehicle_type TYPEAS s_string
输入.point_code TYPEAS s_string
[临时表] [临时表]
@ -112,11 +114,13 @@ IF 输入.flag = "3"
ivt.qty_unit_id, ivt.qty_unit_id,
ivt.pcsn, ivt.pcsn,
ivt.qty_unit_id, ivt.qty_unit_id,
ivt.material_id,
ruledis.out_seq_no ruledis.out_seq_no
FROM FROM
st_ivt_structivt ivt st_ivt_structivt ivt
LEFT JOIN sch_base_point point ON point.point_id = ivt.struct_id LEFT JOIN sch_base_point point ON point.point_id = ivt.struct_id
left join st_rule_IOdisStruct ruledis on ruledis.struct_uuid = ivt.struct_id left join st_rule_IOdisStruct ruledis on ruledis.struct_uuid = ivt.struct_id
left join md_pb_vehicle vehicle on vehicle.vehicle_code =ivt.vehicle_code
WHERE WHERE
ivt.canuse_qty > 0 ivt.canuse_qty > 0
AND point.point_status = '02' AND point.point_status = '02'
@ -126,6 +130,9 @@ IF 输入.flag = "3"
OPTION 输入.material_id <> "" OPTION 输入.material_id <> ""
ivt.material_id = 输入.material_id ivt.material_id = 输入.material_id
ENDOPTION ENDOPTION
OPTION 输入.vehicle_type <> ""
vehicle.vehicle_type = 输入.vehicle_type
ENDOPTION
OPTION 输入.area_type <> "" OPTION 输入.area_type <> ""
point.area_type = 输入.area_type point.area_type = 输入.area_type
ENDOPTION ENDOPTION
@ -144,13 +151,11 @@ ENDIF
IF 输入.flag = "4" IF 输入.flag = "4"
QUERY QUERY
SELECT DISTINCT SELECT DISTINCT
structattr.struct_id, point.point_id as struct_id,
structattr.struct_code, point.point_code as struct_code,
structattr.struct_name point.point_name as struct_name
FROM FROM
st_ivt_structattr structattr sch_base_point point ON point.point_id = structattr.struct_id
LEFT JOIN sch_base_point point ON point.point_id = structattr.struct_id
LEFT JOIN ST_IVT_StructRelaVehicleType rulevehicle ON rulevehicle.struct_id = structattr.struct_id
WHERE WHERE
point.lock_type = '00' point.lock_type = '00'
AND ( point.vehicle_code = '' OR point.vehicle_code IS NULL ) AND ( point.vehicle_code = '' OR point.vehicle_code IS NULL )
@ -158,12 +163,12 @@ IF 输入.flag = "4"
OPTION 输入.area_type <> "" OPTION 输入.area_type <> ""
point.area_type = 输入.area_type point.area_type = 输入.area_type
ENDOPTION ENDOPTION
OPTION 输入.sect_id <> ""
point.structattr = 输入.sect_id
ENDOPTION
OPTION 输入.vehicle_type <> "" OPTION 输入.vehicle_type <> ""
rulevehicle.vehicle_type = 输入.vehicle_type rulevehicle.vehicle_type = 输入.vehicle_type
ENDOPTION ENDOPTION
OPTION 输入.point_code <> ""
point.point_code = 输入.point_code
ENDOPTION
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF
@ -176,8 +181,6 @@ IF 输入.flag = "5"
point.point_code AS struct_code, point.point_code AS struct_code,
point.point_name AS struct_name, point.point_name AS struct_name,
point.vehicle_code point.vehicle_code
FROM FROM
sch_base_point point sch_base_point point
LEFT JOIN md_pb_vehicle vehicle ON vehicle.vehicle_code = point.vehicle_code LEFT JOIN md_pb_vehicle vehicle ON vehicle.vehicle_code = point.vehicle_code
@ -191,6 +194,31 @@ IF 输入.flag = "5"
OPTION 输入.vehicle_type <> "" OPTION 输入.vehicle_type <> ""
vehicle.vehicle_type = 输入.vehicle_type vehicle.vehicle_type = 输入.vehicle_type
ENDOPTION ENDOPTION
OPTION 输入.point_code <> ""
point.point_code = 输入.point_code
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "6"
QUERY
SELECT DISTINCT
point.point_id AS struct_id,
point.point_code AS struct_code,
point.point_name AS struct_name,
point.vehicle_code
FROM
sch_base_point point
WHERE
point.lock_type = '00'
AND point.point_status = '01'
OPTION 输入.area_type <> ""
point.area_type = 输入.area_type
ENDOPTION
OPTION 输入.point_code <> ""
point.point_code = 输入.point_code
ENDOPTION
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF

11
wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java

@ -2,6 +2,7 @@
package org.nl.wms.ext.acs.rest; package org.nl.wms.ext.acs.rest;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -34,7 +35,10 @@ public class AcsToWmsController {
@ApiOperation("ACS给WMS发送任务") @ApiOperation("ACS给WMS发送任务")
public ResponseEntity<Object> receiveTaskFromAcs(@RequestBody Map whereJson) { public ResponseEntity<Object> receiveTaskFromAcs(@RequestBody Map whereJson) {
acsToWmsService.receiveTaskFromAcs(whereJson); acsToWmsService.receiveTaskFromAcs(whereJson);
return new ResponseEntity<>(HttpStatus.OK); JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());
result.put("message", "发送任务成功");
return new ResponseEntity<>(result, HttpStatus.OK);
} }
@PostMapping("/manipulatorApply") @PostMapping("/manipulatorApply")
@ -42,7 +46,10 @@ public class AcsToWmsController {
@ApiOperation("ACS机械手给WMS发送任务") @ApiOperation("ACS机械手给WMS发送任务")
public ResponseEntity<Object> manipulatorApply(@RequestBody Map whereJson) { public ResponseEntity<Object> manipulatorApply(@RequestBody Map whereJson) {
acsToWmsService.manipulatorApply(whereJson); acsToWmsService.manipulatorApply(whereJson);
return new ResponseEntity<>(HttpStatus.OK); JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());
result.put("message", "发送任务成功");
return new ResponseEntity<>(result, HttpStatus.OK);
} }

8
wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java

@ -64,5 +64,13 @@ public class WmsToAcsController {
return new ResponseEntity<>(wmsToAcsService.action(arr), HttpStatus.OK); return new ResponseEntity<>(wmsToAcsService.action(arr), HttpStatus.OK);
} }
@PostMapping("/queryPointStatus")
@Log("查询点位状态")
@ApiOperation("查询点位状态")
public ResponseEntity<Object> queryPointStatus(@RequestBody Map whereJson) {
JSONArray arr = JSONArray.parseArray(JSON.toJSONString(whereJson.get("data")));
return new ResponseEntity<>(wmsToAcsService.queryPointStatus(arr), HttpStatus.OK);
}
} }

6
wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java

@ -40,6 +40,12 @@ public interface WmsToAcsService {
* @return * @return
*/ */
Map<String, Object> action(JSONArray arr); Map<String, Object> action(JSONArray arr);
/**
* 下发动作信号
* @param arr
* @return
*/
Map<String, Object> queryPointStatus(JSONArray arr);
} }

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

@ -75,10 +75,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
//叫料出库 //叫料出库
jsonObject.put("next_point_code", device_code); jsonObject.put("next_point_code", device_code);
jsonObject.put("create_mode", "01"); jsonObject.put("create_mode", "01");
produceInfoByCode = this.getProduceInfoByCode(device_code);
//批次 物料,客户要从排产单里面去取 //批次 物料,客户要从排产单里面去取
jsonObject.put("pcsn", "pcsn"); jsonObject.put("pcsn", "pcsn");
jsonObject.put("material_id", "1515940603542769664"); if (!StrUtil.equals(device_code,"RYW")){
produceInfoByCode = this.getProduceInfoByCode(device_code);
jsonObject.put("material_id", produceInfoByCode.getString("material_id"));
}
jsonObject.put("cust_id", "1516368197694132224"); jsonObject.put("cust_id", "1516368197694132224");
callMaterialTask.createTask((JSONObject) JSON.toJSON(jsonObject)); callMaterialTask.createTask((JSONObject) JSON.toJSON(jsonObject));
break; break;
@ -150,7 +155,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONObject produceInfoByCode = new JSONObject(); JSONObject produceInfoByCode = new JSONObject();
String device_code = (String) jsonObject.get("device_code"); String device_code = (String) jsonObject.get("device_code");
String vehicle_code = (String) jsonObject.get("vehicle_code"); String vehicle_code = (String) jsonObject.get("vehicle_code");
String qty = (String) jsonObject.get("qty"); String qty = String.valueOf(jsonObject.get("qty")) ;
produceInfoByCode = this.getProduceInfoByCode(device_code); produceInfoByCode = this.getProduceInfoByCode(device_code);
String material_id = (String) produceInfoByCode.get("material_id"); String material_id = (String) produceInfoByCode.get("material_id");
String cust_id = (String) produceInfoByCode.get("cust_id"); String cust_id = (String) produceInfoByCode.get("cust_id");
@ -324,6 +329,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (ObjectUtil.isEmpty(taskObj)) { if (ObjectUtil.isEmpty(taskObj)) {
throw new BadRequestException("未找到工单号为'" + producetask_code + "'的工单信息!"); throw new BadRequestException("未找到工单号为'" + producetask_code + "'的工单信息!");
} }
JSONObject materialObj = WQLObject.getWQLObject("md_me_material").query("material_code = '" + material_code + "'").uniqueResult(0);
//1为确认 //1为确认
//2为生产中 //2为生产中
//3为完成 //3为完成
@ -338,14 +344,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
throw new BadRequestException("物料编码不能为空!"); throw new BadRequestException("物料编码不能为空!");
} }
//根据设备去找设备id if (!StrUtil.equals(materialObj.getString("material_id"), taskObj.getString("material_id"))) {
JSONObject deviceObj = WQLObject.getWQLObject("PDM_BASE_DEVICE").query("device_code='" + device_code + "'").uniqueResult(0);
//根据物料code 去找物料id
JSONObject materiObj = WQLObject.getWQLObject("MD_ME_Material").query("material_code='" + material_code + "'").uniqueResult(0);
if (!StrUtil.equals(deviceObj.getString("device_id"), taskObj.getString("device_id"))) {
throw new BadRequestException("设备标识不一样!");
}
if (!StrUtil.equals(materiObj.getString("material_id"), taskObj.getString("material_id"))) {
throw new BadRequestException("物料标识不一样!"); throw new BadRequestException("物料标识不一样!");
} }
taskObj.put("producetask_status", "04"); taskObj.put("producetask_status", "04");

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

@ -40,9 +40,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
return AcsUtil.notifyAcs(api, arr); return AcsUtil.notifyAcs(api, arr);
} }
public static void main(String[] args) { @Override
String format = DateUtil.format(new Date(), "yyyy-MM-dd"); public JSONObject queryPointStatus(JSONArray arr) {
System.out.println(format); String api = "api/wms/querydevice";
return AcsUtil.notifyAcs(api, arr);
} }
} }

22
wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACSTOMES_001.wql

@ -16,6 +16,8 @@
输入.flag TYPEAS s_string 输入.flag TYPEAS s_string
输入.workprocedure_id TYPEAS s_string 输入.workprocedure_id TYPEAS s_string
输入.material_id TYPEAS s_string 输入.material_id TYPEAS s_string
输入.area_type TYPEAS s_string
输入.point_code TYPEAS s_string
[临时表] [临时表]
--这边列出来的临时表就会在运行期动态创建 --这边列出来的临时表就会在运行期动态创建
@ -61,3 +63,23 @@
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF
IF 输入.flag = "2"
QUERY
SELECT
point.point_code as device_code
FROM
sch_base_point point
WHERE
1=1
AND point.is_delete = '0'
OPTION 输入.area_type <> ""
point.area_type = 输入.area_type
ENDOPTION
OPTION 输入.point_code <> ""
point.point_code = 输入.point_code
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF

17
wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/callMaterial/service/impl/CallMaterialServiceImpl.java

@ -53,6 +53,7 @@ public class CallMaterialServiceImpl implements CallMaterialService {
public Map<String, Object> bussConfirm(@RequestBody Map<String, String> param) { public Map<String, Object> bussConfirm(@RequestBody Map<String, String> param) {
String is_full = param.get("is_full"); String is_full = param.get("is_full");
String next_point_code = param.get("point_code"); String next_point_code = param.get("point_code");
String material_id = param.get("material_id");
if (StrUtil.isEmpty(is_full)) { if (StrUtil.isEmpty(is_full)) {
throw new PdaRequestException("是否满拖不能为空!"); throw new PdaRequestException("是否满拖不能为空!");
} }
@ -65,12 +66,6 @@ public class CallMaterialServiceImpl implements CallMaterialService {
String point_type = pointObj.getString("point_type"); String point_type = pointObj.getString("point_type");
//如果是压机上料位置则走转储的流程 //如果是压机上料位置则走转储的流程
if (StrUtil.equals(point_type, "05")) { if (StrUtil.equals(point_type, "05")) {
//查询当前压机对应的排产单的物料信息是
JSONObject TaskObj = WQLObject.getWQLObject("PDM_MG_produceTask").query("device_id='" + pointObj.getString("device_id") + "' and producetask_status in ('02','03','04') and is_delete='0'").uniqueResult(0);
if (ObjectUtil.isEmpty(TaskObj)) {
throw new BadRequestException("未找到该点位设备的工单信息!");
}
String material_id = TaskObj.getString("material_id");
String startArea_type = AreaEnum.KLHJ.getCode(); String startArea_type = AreaEnum.KLHJ.getCode();
JSONObject param1 = new JSONObject(); JSONObject param1 = new JSONObject();
param1.put("material_id", material_id); param1.put("material_id", material_id);
@ -133,12 +128,10 @@ public class CallMaterialServiceImpl implements CallMaterialService {
jsonObject.put("next_point_code", next_point_code); jsonObject.put("next_point_code", next_point_code);
jsonObject.put("create_mode", "03"); jsonObject.put("create_mode", "03");
//批次 物料,客户要从排产单里面去取 //批次 物料,客户要从排产单里面去取
jsonObject.put("pcsn", "pcsn"); // jsonObject.put("pcsn", "pcsn");
JSONObject produceInfoByCode = this.getProduceInfoByCode(next_point_code); //JSONObject produceInfoByCode = this.getProduceInfoByCode(next_point_code);
jsonObject.put("material_id", produceInfoByCode.getString("material_id")); jsonObject.put("material_id", material_id);
jsonObject.put("cust_id", produceInfoByCode.getString("cust_id")); //jsonObject.put("producetask_id", produceInfoByCode.getString("producetask_id"));
jsonObject.put("stewing_time", produceInfoByCode.getString("stewing_time"));
jsonObject.put("producetask_id", produceInfoByCode.getString("producetask_id"));
jsonObject.put("is_full", is_full); jsonObject.put("is_full", is_full);
callMaterialTask.createTask((JSONObject) JSON.toJSON(jsonObject)); callMaterialTask.createTask((JSONObject) JSON.toJSON(jsonObject));
} }

7
wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/AreaEnum.java

@ -14,10 +14,11 @@ public enum AreaEnum {
YZQY("22", "压制区域"), YZQY("22", "压制区域"),
YYJLZ("23", "液压机料盅架"), YYJLZ("23", "液压机料盅架"),
YQU("24", "窑区域"), YQU("24", "窑区域"),
KGTDDQ("25", "空钢托堆叠区"), KGTCPQ("25", "空钢拆盘区"),
ZDCDX("26", "自动柴垛线"), ZDCDX("26", "自动柴垛线"),
RGCPQ("26", "人工拆盘区域"), RGCPQ("27", "人工拆盘区域"),
BZQ("26", "包装区"); BZQ("28", "包装区"),
KGTPDPQ("29", "空钢托叠盘区");
private final String name; private final String name;
private final String code; private final String code;

10
wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/VehicleTypeEnum.java

@ -6,9 +6,15 @@ package org.nl.wms.sch.manage;
* 24 窑区域 25 空钢托堆叠区 26 自动柴垛线 * 24 窑区域 25 空钢托堆叠区 26 自动柴垛线
*/ */
public enum VehicleTypeEnum { public enum VehicleTypeEnum {
LZ("01", "料盅"), DLZ("01", "料盅"),
GTP("02", "钢托盘"), GTP("02", "钢托盘"),
MTP("03", "木托盘"); MTP1("03", "类型一木托盘"),
MTP2("04", "类型二木托盘"),
MTP3("05", "类型三木托盘"),
MTP4("06", "类型四木托盘"),
MTP5("07", "类型五木托盘"),
TP6("08", "类型六托盘"),
XLZ("09", "小料盅");
private final String name; private final String name;
private final String code; private final String code;

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

@ -112,25 +112,36 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
switch (workProcedureEnum) { switch (workProcedureEnum) {
//混黏工序 //混黏工序
case HNGX: case HNGX:
vehicle_type = VehicleTypeEnum.LZ.getCode(); vehicle_type = VehicleTypeEnum.XLZ.getCode();
start_area = AreaEnum.KLHJ.getCode(); start_area = AreaEnum.KLHJ.getCode();
break;
// 压制工序 // 压制工序
case YZGX: case YZGX:
vehicle_type = VehicleTypeEnum.LZ.getCode(); vehicle_type = VehicleTypeEnum.GTP.getCode();
start_area = AreaEnum.KLHJ.getCode(); start_area = AreaEnum.KLHJ.getCode();
break;
//烧制工序 //烧制工序
case SZGX: case SZGX:
vehicle_type = VehicleTypeEnum.LZ.getCode(); vehicle_type = VehicleTypeEnum.GTP.getCode();
start_area = AreaEnum.KLHJ.getCode(); start_area = AreaEnum.KLHJ.getCode();
break;
//分拣工序 //分拣工序
case FJGX: case FJGX:
vehicle_type = VehicleTypeEnum.LZ.getCode(); // 根据点位code查找对应设备,根据设备查找对应工单,从工单中取托盘类型
vehicle_type = WQL.getWO("BUSSTASK_001")
.addParam("flag", "1")
.addParam("point_code", next_point_code)
.process()
.uniqueResult(0)
.getString("vehicle_type");
start_area = AreaEnum.KLHJ.getCode(); start_area = AreaEnum.KLHJ.getCode();
break;
default: default:
vehicle_type = VehicleTypeEnum.LZ.getCode(); vehicle_type = VehicleTypeEnum.XLZ.getCode();
start_area = AreaEnum.KLHJ.getCode(); start_area = AreaEnum.KLHJ.getCode();
} }
//寻找一个合适的仓位 //寻找一个合适的仓位
param.put("vehicle_type", vehicle_type);
JSONObject outStructObj = StructFindUtil.getEmptyVehicleOutStruct(param); JSONObject outStructObj = StructFindUtil.getEmptyVehicleOutStruct(param);
if (ObjectUtil.isEmpty(outStructObj)) { if (ObjectUtil.isEmpty(outStructObj)) {
continue; continue;
@ -194,14 +205,15 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
switch (workProcedureEnum) { switch (workProcedureEnum) {
//混黏工序 //混黏工序
case HNGX: case HNGX:
vehicle_type = VehicleTypeEnum.LZ.getCode();
start_area = AreaEnum.KLHJ.getCode(); start_area = AreaEnum.KLHJ.getCode();
//托盘类型取当前工单生产的托盘类型
vehicle_type = WQLObject.getWQLObject("PDM_MG_produceTask").query("device_id='" + device_id + "' and producetask_status='04'").uniqueResult(0).getString("vehicle_type");
break; break;
// 压制工序 // 压制工序
case YZGX: case YZGX:
vehicle_type = VehicleTypeEnum.GTP.getCode(); vehicle_type = VehicleTypeEnum.GTP.getCode();
start_area = AreaEnum.CYHJ.getCode(); start_area = AreaEnum.KGTCPQ.getCode();
start_point_code = "KGTDDW05";
break; break;
//烧制工序 //烧制工序
case SZGX: case SZGX:
@ -211,18 +223,25 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
//分拣工序 //分拣工序
case FJGX: case FJGX:
//托盘类型取当前工单生产的托盘类型 //托盘类型取当前工单生产的托盘类型
JSONObject produceObj = WQLObject.getWQLObject("PDM_MG_produceTask").query("device_id='" + device_id + "' and producetask_status='04'").uniqueResult(0); vehicle_type = WQLObject.getWQLObject("PDM_MG_produceTask").query("device_id='" + device_id + "' and producetask_status='04'").uniqueResult(0).getString("vehicle_type");
vehicle_type = produceObj.getString("vehicle_type");
start_area = AreaEnum.CYZC.getCode(); start_area = AreaEnum.CYZC.getCode();
is_auto_issue = "0"; is_auto_issue = "0";
break; break;
//叠盘工序
case DPGX:
//托盘类型取当前工单生产的托盘类型
vehicle_type = VehicleTypeEnum.GTP.getCode();
start_area = AreaEnum.CYHJ.getCode();
is_auto_issue = "0";
break;
default: default:
vehicle_type = VehicleTypeEnum.LZ.getCode(); vehicle_type = VehicleTypeEnum.DLZ.getCode();
start_area = AreaEnum.KLHJ.getCode(); start_area = AreaEnum.KLHJ.getCode();
} }
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("vehicle_type", vehicle_type); param.put("vehicle_type", vehicle_type);
param.put("area_type", start_area); param.put("area_type", start_area);
param.put("point_code", start_point_code);
JSONObject outStructObj = StructFindUtil.getEmptyVehicleOutStruct(param); JSONObject outStructObj = StructFindUtil.getEmptyVehicleOutStruct(param);
if (ObjectUtil.isEmpty(outStructObj)) { if (ObjectUtil.isEmpty(outStructObj)) {
throw new BadRequestException("未找到合适的空托盘点位"); throw new BadRequestException("未找到合适的空托盘点位");
@ -247,6 +266,10 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
} }
String task_id = IdUtil.getSnowflake(1, 1).nextId() + ""; String task_id = IdUtil.getSnowflake(1, 1).nextId() + "";
//生成空载具搬运单据 //生成空载具搬运单据
//如果载具点位上取不到,则给一个默认的999
if (StrUtil.isEmpty(vehicle_code)) {
vehicle_code = "999";
}
JSONObject EmptyVehicleObj = new JSONObject(); JSONObject EmptyVehicleObj = new JSONObject();
EmptyVehicleObj.put("record_uuid", IdUtil.getSnowflake(1, 1).nextId()); EmptyVehicleObj.put("record_uuid", IdUtil.getSnowflake(1, 1).nextId());
EmptyVehicleObj.put("bill_code", CodeUtil.getNewCode("KZJ_BILL_CODE")); EmptyVehicleObj.put("bill_code", CodeUtil.getNewCode("KZJ_BILL_CODE"));

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

@ -164,24 +164,17 @@ 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("终点不能为空!");
} }
if (StrUtil.isEmpty(material_id)) {
throw new BadRequestException("物料标识不能为空!");
}
if (StrUtil.isEmpty(cust_id)) {
throw new BadRequestException("客户不能为空!");
}
if (StrUtil.isEmpty(create_mode)) { if (StrUtil.isEmpty(create_mode)) {
throw new BadRequestException("创建方式不能为空!"); throw new BadRequestException("创建方式不能为空!");
} }
@ -189,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") + "' 未完成!");
@ -222,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);
@ -299,6 +295,9 @@ public class CallMaterialTask extends AbstractAcsTask {
iosObj.put("bill_type", bill_type); iosObj.put("bill_type", bill_type);
iosObj.put("workprocedure_id", workprocedure_id); iosObj.put("workprocedure_id", workprocedure_id);
iosObj.put("ivt_workprocedure_id", ivt_workprocedure_id); iosObj.put("ivt_workprocedure_id", ivt_workprocedure_id);
if (StrUtil.isEmpty(material_id)) {
material_id = outStructObj.getString("material_id");
}
iosObj.put("material_id", material_id); iosObj.put("material_id", material_id);
iosObj.put("vehicle_code", outStructObj.getString("vehicle_code")); iosObj.put("vehicle_code", outStructObj.getString("vehicle_code"));
iosObj.put("qty", qty); iosObj.put("qty", qty);
@ -319,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();

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

@ -154,7 +154,6 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
if (StrUtil.isEmpty(vehicle_code)) { if (StrUtil.isEmpty(vehicle_code)) {
throw new BadRequestException("载具未找到!"); throw new BadRequestException("载具未找到!");
} }
//判断起点有没有未完成的指令 //判断起点有没有未完成的指令
JSONObject beforTaskObj = taskTable. JSONObject beforTaskObj = taskTable.
query("is_delete='0' and start_point_code='" + start_point_code + "' and task_status <>'" + TaskStatusEnum.FINISHED.getCode() + "'") query("is_delete='0' and start_point_code='" + start_point_code + "' and task_status <>'" + TaskStatusEnum.FINISHED.getCode() + "'")
@ -162,7 +161,6 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
if (ObjectUtil.isNotEmpty(beforTaskObj)) { if (ObjectUtil.isNotEmpty(beforTaskObj)) {
throw new BadRequestException("存在指令号为'" + beforTaskObj.getString("task_code") + "' 未完成!"); throw new BadRequestException("存在指令号为'" + beforTaskObj.getString("task_code") + "' 未完成!");
} }
//根据起点去找工序,找一个合适的仓位 并且生成单据 //根据起点去找工序,找一个合适的仓位 并且生成单据
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.getWO("QSTRUCT_RULE").addParam("flag", "1").addParam("code", start_point_code)
@ -185,7 +183,13 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
break; break;
//分拣工序 //分拣工序
case FJGX: case FJGX:
next_area = AreaEnum.KGTDDQ.getCode(); next_area = AreaEnum.KGTPDPQ.getCode();
next_point_code = "KGTDTW01";
break;
//拆盘工序
case DPGX:
next_area = AreaEnum.KGTCPQ.getCode();
next_point_code = "KGTDDW01";
break; break;
default: default:
next_area = AreaEnum.KLHJ.getCode(); next_area = AreaEnum.KLHJ.getCode();
@ -193,6 +197,7 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("area_type", next_area); param.put("area_type", next_area);
param.put("vehicle_code", vehicle_code); param.put("vehicle_code", vehicle_code);
param.put("point_code", next_point_code);
JSONObject inStructObj = StructFindUtil.getEmptyVehicleInStruct(param); JSONObject inStructObj = StructFindUtil.getEmptyVehicleInStruct(param);
next_point_code = inStructObj.getString("struct_code"); next_point_code = inStructObj.getString("struct_code");
} }

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

@ -15,10 +15,7 @@ import org.nl.utils.SpringContextHolder;
import org.nl.wms.BussConstant; import org.nl.wms.BussConstant;
import org.nl.wms.WorkProcedureEnum; import org.nl.wms.WorkProcedureEnum;
import org.nl.wms.common.StructFindUtil; import org.nl.wms.common.StructFindUtil;
import org.nl.wms.sch.manage.AbstractAcsTask; import org.nl.wms.sch.manage.*;
import org.nl.wms.sch.manage.AreaEnum;
import org.nl.wms.sch.manage.BillTypeEnum;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.service.PointService; import org.nl.wms.sch.service.PointService;
import org.nl.wms.sch.service.dto.PointDto; import org.nl.wms.sch.service.dto.PointDto;
import org.nl.wms.sch.service.impl.PointServiceImpl; import org.nl.wms.sch.service.impl.PointServiceImpl;
@ -236,6 +233,7 @@ public class SendMaterialTask extends AbstractAcsTask {
.process().uniqueResult(0); .process().uniqueResult(0);
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);
String vehilce_type="";
switch (workProcedureEnum) { switch (workProcedureEnum) {
//混黏工序 //混黏工序
@ -243,6 +241,7 @@ public class SendMaterialTask extends AbstractAcsTask {
qty_unit_id = BussConstant.HN_IN_QTY_UNIT_ID; qty_unit_id = BussConstant.HN_IN_QTY_UNIT_ID;
endArea_type = AreaEnum.KLHJ.getCode(); endArea_type = AreaEnum.KLHJ.getCode();
bill_type = BillTypeEnum.HNRK.getCode(); bill_type = BillTypeEnum.HNRK.getCode();
vehilce_type = VehicleTypeEnum.XLZ.getCode();
break; break;
// 压制工序 // 压制工序
case YZGX: case YZGX:
@ -259,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:
@ -270,6 +269,7 @@ public class SendMaterialTask extends AbstractAcsTask {
param.put("material_id", material_id); param.put("material_id", material_id);
param.put("area_type", endArea_type); param.put("area_type", endArea_type);
param.put("vehicle_code", vehicle_code); param.put("vehicle_code", vehicle_code);
param.put("vehilce_type", vehilce_type);
JSONObject inStructObj = StructFindUtil.getInStruct(param); JSONObject inStructObj = StructFindUtil.getInStruct(param);
if (ObjectUtil.isEmpty(inStructObj)) { if (ObjectUtil.isEmpty(inStructObj)) {
throw new BadRequestException("未找到合适的入库仓位!"); throw new BadRequestException("未找到合适的入库仓位!");
@ -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);

56
wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/wql/BUSSTASK_001.wql

@ -0,0 +1,56 @@
[交易说明]
交易名: ACS发送请求给mes
所属模块:
功能简述:
版权所有:
表引用:
版本经历:
[数据库]
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
[IO定义]
#################################################
## 表字段对应输入参数
#################################################
输入.flag TYPEAS s_string
输入.workprocedure_id TYPEAS s_string
输入.point_code TYPEAS s_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
[临时变量]
--所有中间过程变量均可在此处定义
[业务过程]
##########################################
# 1、输入输出检查 #
##########################################
##########################################
# 2、主过程前处理 #
##########################################
##########################################
# 3、业务主过程 #
##########################################
IF 输入.flag = "1"
QUERY
SELECT
task.vehicle_type
FROM
pdm_mg_producetask task
right JOIN sch_base_point point ON task.device_id = point.device_id
WHERE
task.producetask_status IN ('03', '04')
OPTION 输入.point_code <> ""
point.point_code = 输入.point_code
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF

2
wms/hd/nladmin-system/src/main/java/org/nl/wms/st/basedata/service/impl/SectattrServiceImpl.java

@ -205,7 +205,7 @@ public class SectattrServiceImpl implements SectattrService {
JSONArray sect_ja = new JSONArray(); JSONArray sect_ja = new JSONArray();
for (int j = 0; j < sect_arr.size(); j++) { for (int j = 0; j < sect_arr.size(); j++) {
JSONObject sect_jo = sect_arr.getJSONObject(j); JSONObject sect_jo = sect_arr.getJSONObject(j);
net.sf.json.JSONObject sect_cas = new net.sf.json.JSONObject(); JSONObject sect_cas = new JSONObject();
sect_cas.put("value", sect_jo.getString("sect_id")); sect_cas.put("value", sect_jo.getString("sect_id"));
sect_cas.put("label", sect_jo.getString("sect_name")); sect_cas.put("label", sect_jo.getString("sect_name"));
sect_ja.add(sect_cas); sect_ja.add(sect_cas);

BIN
wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls

Binary file not shown.

155
wms/qd/src/views/wms/pdm/produceTask/MaterDialog.vue

@ -0,0 +1,155 @@
<template>
<el-dialog
title="物料选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="模糊搜索">
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="编码、名称"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation />
</el-form>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
size="mini"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
@current-change="clickChange"
>
<el-table-column v-if="!isSingle" type="selection" width="55" />
<el-table-column v-if="isSingle" label="选择" width="55">
<template slot-scope="scope">
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
</template>
</el-table-column>
<el-table-column prop="material_code" label="物料编码" show-overflow-tooltip />
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip />
<el-table-column prop="material_spec" label="规格" show-overflow-tooltip />
<el-table-column prop="material_model" label="型号" />
<el-table-column prop="english_name" label="外文名称" />
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import crudWorkprocedureios from '@/api/wms/st/in/workprocedureios'
export default {
name: 'MaterDialog',
components: { rrOperation, pagination },
cruds() {
return CRUD({ title: '物料', url: 'api/workprocedureiosIn/getMaterial', crudMethod: { ...crudWorkprocedureios }, optShow: {}})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: true
},
materOptCode: {
type: String,
default: '00'
}
},
data() {
return {
dialogVisible: false,
tableRadio: null,
tableData: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
clickChange(item) {
this.tableRadio = item
},
open() {
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
submit() {
//
if (this.isSingle && this.tableRadio) {
this.$emit('update:dialogShow', false)
this.$emit('tableChanged4', this.tableRadio)
return
}
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选物料')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('tableChanged4', this.rows)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

44
wms/qd/src/views/wms/pdm/produceTask/index.vue

@ -128,15 +128,9 @@
<!--表单组件--> <!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="780px"> <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="780px">
<el-form ref="form" inline :model="form" :rules="rules" size="mini" label-width="120px"> <el-form ref="form" inline :model="form" :rules="rules" size="mini" label-width="120px">
<el-form-item label="物料名称" prop="material_id"> <el-form-item label="物料" prop="material_name">
<el-select v-model="form.material_id" filterable clearable style="width: 200px;" placeholder="请选择物料"> <label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
<el-option <el-input v-model="form.material_name" style="width: 200px;" @focus="getMater" />
v-for="item in materialList"
:key="item.material_id"
:label="item.material_name"
:value="item.material_id"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备名称" prop="device_id"> <el-form-item label="设备名称" prop="device_id">
<el-select v-model="form.device_id" filterable clearable style="width: 200px" placeholder="请选择设备"> <el-select v-model="form.device_id" filterable clearable style="width: 200px" placeholder="请选择设备">
@ -148,7 +142,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="产线名称" prop="produceline_id"> <el-form-item v-if="false" label="产线名称" prop="produceline_id">
<el-select v-model="form.produceline_id" filterable clearable class="filter-item" style="width: 200px" placeholder="请选择产线"> <el-select v-model="form.produceline_id" filterable clearable class="filter-item" style="width: 200px" placeholder="请选择产线">
<el-option <el-option
v-for="item in producelineList" v-for="item in producelineList"
@ -254,7 +248,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="material_name" label="物料名称" /> <el-table-column prop="material_name" label="物料名称" />
<el-table-column prop="device_name" label="设备名称" width="120" /> <el-table-column prop="device_name" label="设备名称" width="120" />
<el-table-column prop="produceline_name" label="产线名称" /> <el-table-column v-if="false" prop="produceline_name" label="产线名称" />
<el-table-column prop="cust_name" label="客户名称" /> <el-table-column prop="cust_name" label="客户名称" />
<el-table-column prop="seq_no" label="生产顺序" /> <el-table-column prop="seq_no" label="生产顺序" />
<el-table-column prop="plan_qty" label="计划生产数量" width="120" /> <el-table-column prop="plan_qty" label="计划生产数量" width="120" />
@ -298,6 +292,7 @@
<UploadDialog :dialog-show.sync="uploadShow" @tableChanged3="tableChanged3" /> <UploadDialog :dialog-show.sync="uploadShow" @tableChanged3="tableChanged3" />
<CopyDialog ref="copyChiled" :open-param="openParam" :dialog-show.sync="copyShow" @tableChanged2="tableChanged2" /> <CopyDialog ref="copyChiled" :open-param="openParam" :dialog-show.sync="copyShow" @tableChanged2="tableChanged2" />
<SortDialog :open-param="openParam" :dialog-show.sync="sortShow" @tableChanged1="tableChanged1" /> <SortDialog :open-param="openParam" :dialog-show.sync="sortShow" @tableChanged1="tableChanged1" />
<MaterDialog :dialog-show.sync="materDialog" :dialog-matertype="materType" @tableChanged4="tableChanged4" />
</div> </div>
</template> </template>
@ -311,12 +306,13 @@ import pagination from '@crud/Pagination'
import UploadDialog from '@/views/wms/pdm/produceTask/UploadDialog' import UploadDialog from '@/views/wms/pdm/produceTask/UploadDialog'
import CopyDialog from '@/views/wms/pdm/produceTask/CopyDialog' import CopyDialog from '@/views/wms/pdm/produceTask/CopyDialog'
import SortDialog from '@/views/wms/pdm/produceTask/SortDialog' import SortDialog from '@/views/wms/pdm/produceTask/SortDialog'
import MaterDialog from './MaterDialog.vue'
const defaultForm = { producetask_id: null, producetask_code: null, producetask_status: null, material_id: null, device_id: null, produceline_id: null, cust_id: null, seq_no: null, plan_qty: null, real_qty: null, plan_start_time: null, real_start_time: null, plan_end_time: null, real_end_time: null, producetask_finish_type: null, stand_hour: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, model: null, molten_pool: null } const defaultForm = { producetask_id: null, producetask_code: null, producetask_status: null, material_id: null, material_name: null, device_id: null, produceline_id: null, cust_id: null, seq_no: null, plan_qty: null, real_qty: null, plan_start_time: null, real_start_time: null, plan_end_time: null, real_end_time: null, producetask_finish_type: null, stand_hour: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, model: null, molten_pool: null, is_package: '0' }
export default { export default {
name: 'Producetask', name: 'Producetask',
dicts: ['PRODUCETASK_STATUS', 'PRODUCETASK_STATUS_TYPE', 'MD_EVEHICLE_TYPE'], dicts: ['PRODUCETASK_STATUS', 'PRODUCETASK_STATUS_TYPE', 'MD_EVEHICLE_TYPE'],
components: { pagination, crudOperation, rrOperation, udOperation, UploadDialog, CopyDialog, SortDialog }, components: { pagination, crudOperation, rrOperation, udOperation, UploadDialog, CopyDialog, SortDialog, MaterDialog },
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() { cruds() {
return CRUD({ title: '生产任务', url: 'api/producetask', idField: 'producetask_id', sort: 'producetask_id,desc', optShow: { add: true, edit: false, del: false, download: false, reset: true }, crudMethod: { ...crudProducetask }}) return CRUD({ title: '生产任务', url: 'api/producetask', idField: 'producetask_id', sort: 'producetask_id,desc', optShow: { add: true, edit: false, del: false, download: false, reset: true }, crudMethod: { ...crudProducetask }})
@ -340,16 +336,15 @@ export default {
sort_update: false, sort_update: false,
openParam: {}, openParam: {},
currentRow: null, currentRow: null,
materDialog: false,
materType: '',
rules: { rules: {
material_id: [
{ required: true, message: '物料标识不能为空', trigger: 'blur' }
],
device_id: [ device_id: [
{ required: true, message: '设备标识不能为空', trigger: 'blur' } { required: true, message: '设备标识不能为空', trigger: 'blur' }
], ],
produceline_id: [ // produceline_id: [
{ required: true, message: '产线标识不能为空', trigger: 'blur' } // { required: true, message: '线', trigger: 'blur' }
], // ],
seq_no: [ seq_no: [
{ required: true, message: '生产顺序不能为空', trigger: 'blur' } { required: true, message: '生产顺序不能为空', trigger: 'blur' }
], ],
@ -364,6 +359,9 @@ export default {
], ],
stand_hour: [ stand_hour: [
{ required: true, message: '静置时间不能为空', trigger: 'blur' } { required: true, message: '静置时间不能为空', trigger: 'blur' }
],
material_name: [
{ required: true, message: '物料不能为空', trigger: 'change' }
] ]
}, },
queryTypeOptions: [ queryTypeOptions: [
@ -499,6 +497,14 @@ export default {
}, },
tableChanged1() { tableChanged1() {
this.crud.toQuery() this.crud.toQuery()
},
getMater() {
this.materDialog = true
},
tableChanged4(row) {
console.log(row)
this.form.material_id = row.material_id
this.form.material_name = row.material_name
} }
} }
} }

Loading…
Cancel
Save