Browse Source

Version 1.3

master
张江玮 2 years ago
parent
commit
9a9947e9b2
  1. 1
      acs/nladmin-system/src/main/java/org/nl/hand/amb/service/impl/HFHandServiceImpl.java
  2. 1
      acs/nladmin-system/src/main/java/org/nl/hand/amb/wql/QJN_QUERY001.wql
  3. 1
      acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java
  4. 2
      acs/nladmin-system/src/main/resources/config/application-prod.yml
  5. 8
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/MaterialbaseServiceImpl.java
  6. 4
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/VehicleServiceImpl.java
  7. 2
      lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java
  8. 2
      lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java
  9. 72
      lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java
  10. 29
      lms/nladmin-system/src/main/java/org/nl/wms/pda/wql/PDA.wql
  11. 10
      lms/nladmin-system/src/main/java/org/nl/wms/st/structivt/wql/ST_IVT_STRUCTIVT.wql
  12. 8
      lms/nladmin-system/src/main/java/org/nl/wms/st/vm/rest/VMController.java
  13. 7
      lms/nladmin-system/src/main/java/org/nl/wms/st/vm/service/VMService.java
  14. 18
      lms/nladmin-system/src/main/java/org/nl/wms/st/vm/service/impl/VMServiceImpl.java
  15. 9
      lms/nladmin-system/src/main/java/org/nl/wms/st/vm/wql/ST_IVT_VEHICLE_MATERIAL.wql
  16. 2
      lms/nladmin-ui/src/views/wms/st/vm/index.vue

1
acs/nladmin-system/src/main/java/org/nl/hand/amb/service/impl/HFHandServiceImpl.java

@ -639,6 +639,7 @@ public class HFHandServiceImpl implements HFHandService {
instdto.setStart_device_code(taskjo.getString("start_device_code"));
instdto.setNext_device_code(taskjo.getString("next_device_code"));
instdto.setInstruction_status("0");
instdto.setIs_delete("0");
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
WQLObject instwo = WQLObject.getWQLObject("acs_instruction");
JSONObject instcheckjson = instwo.query(" instruction_status <2 and next_point_code= '" + next_point_code + "'" + " and start_point_code = '" + start_point_code + "'" + " and task_id = '" + task_id + "'").uniqueResult(0);

1
acs/nladmin-system/src/main/java/org/nl/hand/amb/wql/QJN_QUERY001.wql

@ -173,7 +173,6 @@
AND dtl3.NAME = 'send_status'
WHERE
inst.is_delete = '0'
AND inst.instruction_status <> '2'
AND inst.instruction_status < '2'
OPTION 输入.key <> ""
inst.instruction_code like 输入.key

1
acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java

@ -115,6 +115,7 @@ public class AutoCreateInst {
instdto.setInstruction_status("0");
instdto.setExecute_device_code(start_point_code);
instdto.setVehicle_type(vehicleType);
instdto.setIs_delete("0");
try {
instructionService.create(instdto);
} catch (Exception e) {

2
acs/nladmin-system/src/main/resources/config/application-prod.yml

@ -52,7 +52,7 @@ spring:
multi-statement-allow: true
redis:
#数据库索引
database: ${REDIS_DB:15}
database: ${REDIS_DB:0}
host: ${REDIS_HOST:127.0.0.1}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:}

8
lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/MaterialbaseServiceImpl.java

@ -135,6 +135,14 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
JSONObject existMaterial = WQLObject
.getWQLObject("md_me_materialbase")
.query("material_code = '" + dto.getMaterial_code() + "'")
.uniqueResult(0);
if (ObjectUtil.isNotEmpty(existMaterial)) {
throw new BadRequestException("该物料号已存在");
}
dto.setMaterial_id(IdUtil.getSnowflake(1L, 1L).nextId());
dto.setIs_used("1");
dto.setCreate_id(currentUserId);

4
lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/VehicleServiceImpl.java

@ -123,8 +123,8 @@ public class VehicleServiceImpl implements VehicleService {
throw new BadRequestException("载具号" + vehicleCode + "存在组盘信息");
}
JSONObject point = new JSONObject();
point.put("vehicle_code", null);
pointTable.update(point, "vehicle_code = " + vehicleCode);
point.put("vehicle_code", "");
pointTable.update(point, "vehicle_code = '" + vehicleCode + "'");
vehicleTable.delete("vehicle_id = " + vehicleId);
}
}

2
lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java

@ -93,7 +93,7 @@ public class PdaController {
@PostMapping("/queryInventory")
@Log("查询可出库信息")
@ApiOperation("查询可出库信息")
public ResponseEntity<JSONObject> queryInventory(@RequestBody JSONObject param) {
public ResponseEntity<JSONArray> queryInventory(@RequestBody JSONObject param) {
return new ResponseEntity<>(pdaService.queryInventory(param.getString("material_code"), param.getString("vehicle_code")), HttpStatus.OK);
}

2
lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java

@ -25,7 +25,7 @@ public interface PdaService {
JSONArray queryMaterial();
JSONObject queryInventory(String materialCode, String vehicleCode);
JSONArray queryInventory(String materialCode, String vehicleCode);
void task(String type, String pointId, String startPointId, String nextPointId);
}

72
lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java

@ -16,17 +16,11 @@ import org.nl.wms.sch.base.point.LockType;
import org.nl.wms.sch.base.point.PointStatus;
import org.nl.wms.sch.base.point.PointType;
import org.nl.wms.sch.base.region.RegionEnum;
import org.nl.wms.sch.task.CallEmptyVehicleTask;
import org.nl.wms.sch.task.CallMaterialTask;
import org.nl.wms.sch.task.SendFullVehicleTask;
import org.nl.wms.sch.task.SendResiduesMaterialTask;
import org.nl.wms.sch.task.SendEmptyVehicleTask;
import org.nl.wms.sch.task.*;
import org.nl.wms.util.CommonUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.concurrent.locks.Lock;
/**
* @author 张江玮
* @date 2022/11/04 18:25
@ -65,12 +59,7 @@ public class PdaServiceImpl implements PdaService {
point.put("status", "2");
}
}
// for (Object o : points) {
// JSONObject point = (JSONObject) o;
// if (StrUtil.equals(point.getString("lock_type"), LockType.TASK_LOCKED.getCode())) {
// point.put("status", "3");
// }
// }
return points;
}
@ -117,7 +106,7 @@ public class PdaServiceImpl implements PdaService {
if (StrUtil.isNotEmpty(vehicleCode)) {
JSONObject vehicle = WQLObject.getWQLObject("md_pb_vehicle").query("vehicle_code = '" + vehicleCode + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(vehicle)) {
throw new BadRequestException("该载具号不存在,请从组盘功能添加");
throw new BadRequestException("该载具号不存在");
}
JSONObject existPoint = pointTable.query("vehicle_code = '" + vehicleCode + "'").uniqueResult(0);
@ -185,7 +174,7 @@ public class PdaServiceImpl implements PdaService {
.query("material_code = '" + materialCode + "'")
.uniqueResult(0);
if (ObjectUtil.isEmpty(material)) {
throw new BadRequestException("条码为" + code + "的物料信息不存在,请从后台管理界面添加");
throw new BadRequestException("条码为" + code + "的物料信息不存在");
}
JSONObject vm = new JSONObject();
@ -248,10 +237,6 @@ public class PdaServiceImpl implements PdaService {
vm.put("create_time", oldVm.getString("create_time"));
vmTable.insert(vm);
}
// for (Object o : materials) {
// JSONObject material = (JSONObject) o;
//
// }
vehicle.put("vehicle_status", VehicleStatus.HAS_MATERIAL.getCode());
} else {
@ -268,13 +253,26 @@ public class PdaServiceImpl implements PdaService {
}
@Override
public JSONObject queryInventory(String materialCode, String vehicleCode) {
public JSONArray queryInventory(String materialCode, String vehicleCode) {
if (StrUtil.isNotEmpty(materialCode)) {
JSONObject material = WQLObject
.getWQLObject("md_me_materialbase")
.query("material_code = '" + materialCode + "'")
.uniqueResult(0);
if (ObjectUtil.isEmpty(material)) {
throw new BadRequestException("该物料号不存在");
}
}
if (StrUtil.isNotEmpty(vehicleCode)) {
JSONObject vehicle = WQLObject
.getWQLObject("md_pb_vehicle")
.query("vehicle_code = '" + vehicleCode + "'")
.uniqueResult(0);
if (ObjectUtil.isEmpty(vehicle)) {
throw new BadRequestException("该载具号不存在,请从组盘功能添加");
throw new BadRequestException("该载具号不存在");
}
if (StrUtil.equals(vehicle.getString("vehicle_status"), VehicleStatus.EMPTY.getCode())) {
throw new BadRequestException("该载具为空载具");
@ -293,27 +291,18 @@ public class PdaServiceImpl implements PdaService {
if (StrUtil.equals(point.getString("is_used"), "0")) {
throw new BadRequestException("该载具所在点位已被禁用");
}
JSONObject result = new JSONObject();
result.put("point_id", point.getString("point_id"));
result.put("point_name", point.getString("point_name"));
JSONObject material = WQLObject
.getWQLObject("md_me_materialbase")
.query("material_code = '" + materialCode + "'")
.uniqueResult(0);
if (ObjectUtil.isEmpty(material)) {
throw new BadRequestException("该物料号不存在");
}
JSONArray detail = WQL
JSONArray result = WQL
.getWO("PDA")
.addParam("flag", "5")
.addParam("vehicle_id", vehicle.getString("vehicle_id"))
.addParam("material_id", material.getString("material_id"))
.addParam("material_code", materialCode)
.addParam("vehicle_code", vehicleCode)
.process()
.getResultJSONArray(0);
result.put("detail", detail);
if (ObjectUtil.isEmpty(result)) {
throw new BadRequestException("未找到符合条件的暂存区点位");
}
return result;
}
@ -355,14 +344,11 @@ public class PdaServiceImpl implements PdaService {
if (StrUtil.equals(point.getString("point_status"), PointStatus.EMPTY.getCode())) {
throw new BadRequestException("该点位为空位");
}
if (StrUtil.equals(point.getString("region_id"), RegionEnum.ZC.getId())) {
throw new BadRequestException("暂存区不能生成入库任务");
}
String regionId = point.getString("region_id");
if (StrUtil.equals(regionId, RegionEnum.JJ.getId())
&& point.getString("point_code").startsWith("JJC")) {
throw new BadRequestException("交接区出库位不能生成入库任务");
if (StrUtil.equals(regionId, RegionEnum.ZC.getId())
|| (StrUtil.equals(regionId, RegionEnum.JJ.getId())
&& point.getString("point_code").startsWith("JJC"))) {
throw new BadRequestException("只有交接区的入库位和接料区才能发起入库任务");
}
JSONObject vehicle = WQLObject

29
lms/nladmin-system/src/main/java/org/nl/wms/pda/wql/PDA.wql

@ -16,8 +16,7 @@
输入.flag TYPEAS s_string
输入.region_id TYPEAS s_string
输入.vehicle_code TYPEAS s_string
输入.vehicle_id TYPEAS s_string
输入.material_id TYPEAS s_string
输入.material_code TYPEAS s_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
@ -99,16 +98,32 @@
IF 输入.flag = "5"
QUERY
SELECT
point.point_id,
point.point_name,
point.vehicle_code,
material.material_code,
material.material_name,
vm.material_qty,
vm.material_batch AS batch
vm.material_batch,
SUM( vm.material_qty ) AS material_qty
FROM
st_ivt_vehicle_material vm
sch_base_point point
LEFT JOIN md_pb_vehicle vehicle ON point.vehicle_code = vehicle.vehicle_code
LEFT JOIN st_ivt_vehicle_material vm ON vehicle.vehicle_id = vm.vehicle_id
LEFT JOIN md_me_materialbase material ON vm.material_id = material.material_id
WHERE
vm.vehicle_id = 输入.vehicle_id
AND vm.material_id = 输入.material_id
point.point_status = '1'
AND point.is_used = '1'
AND point.lock_type = '1'
AND point.region_id = 1585921595338264576
AND vehicle.vehicle_status = '2'
OPTION 输入.material_code <> ""
material.material_code = 输入.material_code
ENDOPTION
OPTION 输入.vehicle_code <> ""
vehicle.vehicle_code = 输入.vehicle_code
ENDOPTION
GROUP BY
point.point_id
ENDSELECT
ENDQUERY
ENDIF

10
lms/nladmin-system/src/main/java/org/nl/wms/st/structivt/wql/ST_IVT_STRUCTIVT.wql

@ -47,12 +47,12 @@
PAGEQUERY
SELECT
ivt.stockrecord_id,
ANY_VALUE( region.region_name ) AS region_name,
ANY_VALUE( point.point_name ) AS point_name,
ANY_VALUE( vehicle.vehicle_id ) AS vehicle_id,
ANY_VALUE( vehicle.vehicle_code ) AS vehicle_code,
region.region_name,
point.point_name,
vehicle.vehicle_id,
vehicle.vehicle_code,
SUM( vm.material_qty ) AS qty,
ANY_VALUE( ivt.instorage_time ) AS instorage_time
ivt.instorage_time
FROM
st_ivt_structivt ivt
LEFT JOIN sch_base_point point ON ivt.point_id = point.point_id

8
lms/nladmin-system/src/main/java/org/nl/wms/st/vm/rest/VMController.java

@ -41,4 +41,12 @@ public class VMController {
public ResponseEntity<JSONArray> queryDetail(@RequestBody JSONObject param) {
return new ResponseEntity<>(vmService.queryDetail(param), HttpStatus.OK);
}
@DeleteMapping
@Log("删除组盘信息")
@ApiOperation("删除组盘信息")
public ResponseEntity<Void> delete(@RequestBody Long[] ids) {
vmService.delete(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
}

7
lms/nladmin-system/src/main/java/org/nl/wms/st/vm/service/VMService.java

@ -28,4 +28,11 @@ public interface VMService {
* @return 所有组盘信息
*/
JSONArray queryDetail(JSONObject param);
/**
* 删除组盘
*
* @param ids 载具id数组
*/
void delete(Long[] ids);
}

18
lms/nladmin-system/src/main/java/org/nl/wms/st/vm/service/impl/VMServiceImpl.java

@ -5,7 +5,9 @@ import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.WqlUtil;
import org.nl.wms.md.pb.VehicleStatus;
import org.nl.wms.st.vm.service.VMService;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
@ -49,4 +51,20 @@ public class VMServiceImpl implements VMService {
param.put("flag", "2");
return WQL.getWO("ST_IVT_VEHICLE_MATERIAL").addParamMap(param).process().getResultJSONArray(0);
}
/**
* 删除组盘
*
* @param ids 载具id数组
*/
@Override
public void delete(Long[] ids) {
for (Long id : ids) {
WQLObject.getWQLObject("st_ivt_vehicle_material").delete("vehicle_id = " + id);
JSONObject vehicleUpdate = new JSONObject();
vehicleUpdate.put("vehicle_status", VehicleStatus.EMPTY);
WQLObject.getWQLObject("md_pb_vehicle").update(vehicleUpdate, "vehicle_id = " + id);
}
}
}

9
lms/nladmin-system/src/main/java/org/nl/wms/st/vm/wql/ST_IVT_VEHICLE_MATERIAL.wql

@ -43,16 +43,17 @@
PAGEQUERY
SELECT
vehicle.vehicle_id,
ANY_VALUE( vm.vm_id ) AS vm_id,
ANY_VALUE( vehicle.vehicle_code) AS vehicle_code,
vm.vm_id,
vehicle.vehicle_code,
SUM( vm.material_qty ) AS qty,
ANY_VALUE( vm.create_name ) AS create_name,
ANY_VALUE( vm.create_time ) AS create_time
vm.create_name,
vm.create_time
FROM
md_pb_vehicle vehicle
LEFT JOIN st_ivt_vehicle_material vm ON vehicle.vehicle_id = vm.vehicle_id
WHERE
vehicle.vehicle_status = '2'
AND vm.vm_id IS NOT NULL
OPTION 输入.vehicle_code <> ""
vehicle.vehicle_code LIKE CONCAT( '%', 输入.vehicle_code, '%' )
ENDOPTION

2
lms/nladmin-ui/src/views/wms/st/vm/index.vue

@ -129,7 +129,7 @@ export default {
title: '组盘',
optShow: { reset: true, del: true },
url: 'api/vm',
idField: 'vm_id',
idField: 'vehicle_id',
sort: 'vm_id,desc',
crudMethod: { ...crudVM }
})

Loading…
Cancel
Save