Compare commits

...

12 Commits

  1. 4
      lms/nladmin-system/src/main/java/org/nl/modules/common/utils/SecurityUtils.java
  2. 8
      lms/nladmin-system/src/main/java/org/nl/modules/common/utils/dto/CurrentUser.java
  3. 45
      lms/nladmin-system/src/main/java/org/nl/wms/cockpit/rest/ReportController.java
  4. 17
      lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/ReportService.java
  5. 29
      lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/ReportServiceImpl.java
  6. 76
      lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/REPORT.wql
  7. 67
      lms/nladmin-system/src/main/java/org/nl/wms/das/rest/GroupUpdateRecordController.java
  8. 71
      lms/nladmin-system/src/main/java/org/nl/wms/das/service/GroupUpdateRecordService.java
  9. 78
      lms/nladmin-system/src/main/java/org/nl/wms/das/service/dto/GroupUpdateRecordDto.java
  10. 127
      lms/nladmin-system/src/main/java/org/nl/wms/das/service/impl/GroupUpdateRecordServiceImpl.java
  11. 18
      lms/nladmin-system/src/main/java/org/nl/wms/ext/erp/rest/ErpToWmsController.java
  12. 9
      lms/nladmin-system/src/main/java/org/nl/wms/ext/erp/service/ErpToWmsService.java
  13. 16
      lms/nladmin-system/src/main/java/org/nl/wms/ext/erp/service/impl/ErpToWmsServiceImpl.java
  14. 257
      lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java
  15. 185
      lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java
  16. 713
      lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java
  17. 14
      lms/nladmin-system/src/main/java/org/nl/wms/pda/util/PdaUtils.java
  18. 126
      lms/nladmin-system/src/main/java/org/nl/wms/pda/wql/PDA.wql
  19. 7
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/rest/DeviceController.java
  20. 8
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/rest/WorkorderController.java
  21. 2
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/DeviceService.java
  22. 2
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/WorkordeService.java
  23. 1
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/dto/WorkorderDto.java
  24. 6
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java
  25. 38
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java
  26. 3
      lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AbstractAcsTask.java
  27. 9
      lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/TaskType.java
  28. 4
      lms/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/PointServiceImpl.java
  29. 194
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/p2p/PDATask.java
  30. 15
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/HLSendMaterialTask.java
  31. 19
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/YZSendMaterialTask.java
  32. BIN
      lms/nladmin-system/src/main/java/org/nl/wms/wms.xls
  33. 27
      lms/nladmin-ui/src/api/groupUpdateRecord.js
  34. 8
      lms/nladmin-ui/src/api/wms/pdm/device.js
  35. 9
      lms/nladmin-ui/src/api/wms/pdm/workorder.js
  36. 143
      lms/nladmin-ui/src/views/wms/das/index.vue
  37. 14
      lms/nladmin-ui/src/views/wms/pdm/workerorder/hl/index.vue
  38. 75
      lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue
  39. 73
      lms/nladmin-ui/src/views/wms/report/back/index.vue
  40. 106
      lms/nladmin-ui/src/views/wms/report/xn/index.vue

4
lms/nladmin-system/src/main/java/org/nl/modules/common/utils/SecurityUtils.java

@ -30,9 +30,9 @@ public class SecurityUtils {
return json.toBean(CurrentUser.class);
}
} catch (Exception e) {
return new CurrentUser();
return CurrentUser.buildDefaultUser();
}
return null;
return CurrentUser.buildDefaultUser();
}
/**

8
lms/nladmin-system/src/main/java/org/nl/modules/common/utils/dto/CurrentUser.java

@ -28,4 +28,12 @@ public class CurrentUser implements Serializable {
private UserDto user;
private List<String> permissions = new ArrayList<>();
public static CurrentUser buildDefaultUser() {
CurrentUser currentUser = new CurrentUser();
currentUser.setId(99L);
currentUser.setUsername("default");
currentUser.setNickName("默认用户");
return currentUser;
}
}

45
lms/nladmin-system/src/main/java/org/nl/wms/cockpit/rest/ReportController.java

@ -0,0 +1,45 @@
package org.nl.wms.cockpit.rest;
import cn.dev33.satoken.annotation.SaIgnore;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.nl.modules.logging.annotation.Log;
import org.nl.wms.cockpit.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* @Author: lyd
* @Description: 报表管理
* @Date: 2024/5/16
*/
@RestController
@Api(tags = "报表管理")
@RequestMapping("/api/report")
public class ReportController {
@Autowired
private ReportService reportService;
@GetMapping("/queryXN")
@Log("查询出窑虚拟库、货架、木托虚拟库库存")
@ApiOperation("查询出窑虚拟库、货架、木托虚拟库库存")
//@SaCheckPermission("point:list")
public ResponseEntity<Object> queryXN(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(reportService.queryXN(whereJson, page), HttpStatus.OK);
}
@GetMapping("/mudMaterialReport")
@Log("泥料退料报表")
@ApiOperation("泥料退料报表")
//@SaCheckPermission("point:list")
public ResponseEntity<Object> mudMaterialReport(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(reportService.mudMaterialReport(whereJson, page), HttpStatus.OK);
}
}

17
lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/ReportService.java

@ -0,0 +1,17 @@
package org.nl.wms.cockpit.service;
import com.alibaba.fastjson.JSONObject;
import org.springframework.data.domain.Pageable;
import java.util.Map;
/**
* @Author: lyd
* @Description:
* @Date: 2024/5/16
*/
public interface ReportService {
Map<String,Object> queryXN(Map whereJson, Pageable page);
Map<String,Object> mudMaterialReport(Map whereJson, Pageable page);
}

29
lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/ReportServiceImpl.java

@ -0,0 +1,29 @@
package org.nl.wms.cockpit.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.util.WqlUtil;
import org.nl.wms.cockpit.service.ReportService;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* @Author: lyd
* @Description:
* @Date: 2024/5/16
*/
@Service
public class ReportServiceImpl implements ReportService {
@Override
public Map<String, Object> queryXN(Map whereJson, Pageable page) {
return WQL.getWO("REPORT").addParam("flag", "1").addParam("point_code", whereJson.get("point_code")).pageQuery(WqlUtil.getHttpContext(page), "sd.create_time desc");
}
@Override
public Map<String, Object> mudMaterialReport(Map whereJson, Pageable page) {
return WQL.getWO("REPORT").addParam("flag", "2").pageQuery(WqlUtil.getHttpContext(page), "sd.create_time desc, m.order_code");
}
}

76
lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/REPORT.wql

@ -0,0 +1,76 @@
[交易说明]
交易名: 车间情况
所属模块:
功能简述:
版权所有:
表引用:
版本经历:
[数据库]
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
[IO定义]
#################################################
## 表字段对应输入参数
#################################################
输入.flag TYPEAS s_string
输入.point_code TYPEAS s_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
[临时变量]
--所有中间过程变量均可在此处定义
[业务过程]
##########################################
# 1、输入输出检查 #
##########################################
##########################################
# 2、主过程前处理 #
##########################################
##########################################
# 3、业务主过程 #
##########################################
IF 输入.flag = "1"
PAGEQUERY
SELECT
sd.*,
p.point_name,
m.material_code,
m.order_code
FROM
`st_ivt_vehicle_detail` sd
LEFT JOIN sch_base_point p ON p.point_code = sd.point_code
LEFT JOIN md_me_materialbase m ON m.material_id = sd.material_id
WHERE p.region_code = 'XN' AND sd.is_delete = '0'
OPTION 输入.point_code <> ""
sd.point_code = 输入.point_code
ENDOPTION
ENDSELECT
ENDPAGEQUERY
ENDIF
IF 输入.flag = "2"
PAGEQUERY
SELECT
sd.*,
p.point_name,
m.material_code,
m.order_code
FROM
`st_ivt_vehicle_detail` sd
LEFT JOIN sch_base_point p ON p.point_code = sd.point_code
LEFT JOIN md_me_materialbase m ON m.material_id = sd.material_id
WHERE sd.is_back = '1'
ENDSELECT
ENDPAGEQUERY
ENDIF

67
lms/nladmin-system/src/main/java/org/nl/wms/das/rest/GroupUpdateRecordController.java

@ -0,0 +1,67 @@
package org.nl.wms.das.rest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.logging.annotation.Log;
import org.nl.wms.das.service.GroupUpdateRecordService;
import org.nl.wms.das.service.dto.GroupUpdateRecordDto;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* @author lyd
* @date 2024-06-23
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "组盘信息修改记录表管理")
@RequestMapping("/api/groupUpdateRecord")
@Slf4j
public class GroupUpdateRecordController {
private final GroupUpdateRecordService groupUpdateRecordService;
@GetMapping
@Log("查询组盘信息修改记录表")
@ApiOperation("查询组盘信息修改记录表")
//@SaCheckPermission("@el.check('groupUpdateRecord:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
return new ResponseEntity<>(groupUpdateRecordService.queryAll(whereJson,page),HttpStatus.OK);
}
@PostMapping
@Log("新增组盘信息修改记录表")
@ApiOperation("新增组盘信息修改记录表")
//@SaCheckPermission("@el.check('groupUpdateRecord:add')")
public ResponseEntity<Object> create(@Validated @RequestBody GroupUpdateRecordDto dto){
groupUpdateRecordService.create(dto);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PutMapping
@Log("修改组盘信息修改记录表")
@ApiOperation("修改组盘信息修改记录表")
//@SaCheckPermission("@el.check('groupUpdateRecord:edit')")
public ResponseEntity<Object> update(@Validated @RequestBody GroupUpdateRecordDto dto){
groupUpdateRecordService.update(dto);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("删除组盘信息修改记录表")
@ApiOperation("删除组盘信息修改记录表")
//@SaCheckPermission("@el.check('groupUpdateRecord:del')")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
groupUpdateRecordService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
}

71
lms/nladmin-system/src/main/java/org/nl/wms/das/service/GroupUpdateRecordService.java

@ -0,0 +1,71 @@
package org.nl.wms.das.service;
import org.nl.wms.das.service.dto.GroupUpdateRecordDto;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;
/**
* @author lyd
* @description 服务接口
* @date 2024-06-23
**/
public interface GroupUpdateRecordService {
/**
* 查询数据分页
*
* @param whereJson 条件
* @param page 分页参数
* @return Map<String, Object>
*/
Map<String, Object> queryAll(Map whereJson, Pageable page);
/**
* 查询所有数据不分页
*
* @param whereJson 条件参数
* @return List<GroupUpdateRecordDto>
*/
List<GroupUpdateRecordDto> queryAll(Map whereJson);
/**
* 根据ID查询
*
* @param data_id ID
* @return GroupUpdateRecord
*/
GroupUpdateRecordDto findById(Long data_id);
/**
* 根据编码查询
*
* @param code code
* @return GroupUpdateRecord
*/
GroupUpdateRecordDto findByCode(String code);
/**
* 创建
*
* @param dto /
*/
void create(GroupUpdateRecordDto dto);
/**
* 编辑
*
* @param dto /
*/
void update(GroupUpdateRecordDto dto);
/**
* 多选删除
*
* @param ids /
*/
void deleteAll(Long[] ids);
}

78
lms/nladmin-system/src/main/java/org/nl/wms/das/service/dto/GroupUpdateRecordDto.java

@ -0,0 +1,78 @@
package org.nl.wms.das.service.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serializable;
/**
* @author lyd
* @description /
* @date 2024-06-23
**/
@Data
public class GroupUpdateRecordDto implements Serializable {
/** 数据标识 */
/**
* 防止精度丢失
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long data_id;
/**
* 组盘id
*/
private String group_id;
/**
* 载具编码
*/
private String vehicle_code;
/**
* 载具类型
*/
private String vehicle_type;
/**
* 修改内容
*/
private String update_type;
/**
* 原重量
*/
private String orign_weight;
/**
* 新重量
*/
private String current_weight;
/**
* 原数量
*/
private String orign_qty;
/**
* 新数量
*/
private String current_qty;
/**
* 修改人
*/
private Long update_optid;
/**
* 修改人
*/
private String update_optname;
/**
* 修改时间
*/
private String update_time;
}

127
lms/nladmin-system/src/main/java/org/nl/wms/das/service/impl/GroupUpdateRecordServiceImpl.java

@ -0,0 +1,127 @@
package org.nl.wms.das.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.common.utils.SecurityUtils;
import org.nl.modules.wql.core.bean.ResultBean;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.WqlUtil;
import org.nl.wms.das.service.GroupUpdateRecordService;
import org.nl.wms.das.service.dto.GroupUpdateRecordDto;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
* @author lyd
* @description 服务实现
* @date 2024-06-23
**/
@Service
@RequiredArgsConstructor
@Slf4j
public class GroupUpdateRecordServiceImpl implements GroupUpdateRecordService {
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
WQLObject wo = WQLObject.getWQLObject("das_group_update_record");
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "1=1", "update_time desc");
final JSONObject json = rb.pageResult();
return json;
}
@Override
public List<GroupUpdateRecordDto> queryAll(Map whereJson) {
WQLObject wo = WQLObject.getWQLObject("das_group_update_record");
JSONArray arr = wo.query().getResultJSONArray(0);
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(GroupUpdateRecordDto.class);
return null;
}
@Override
public GroupUpdateRecordDto findById(Long data_id) {
WQLObject wo = WQLObject.getWQLObject("das_group_update_record");
JSONObject json = wo.query("data_id = '" + data_id + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(json)) {
return json.toJavaObject(GroupUpdateRecordDto.class);
}
return null;
}
@Override
public GroupUpdateRecordDto findByCode(String code) {
WQLObject wo = WQLObject.getWQLObject("das_group_update_record");
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(json)) {
return json.toJavaObject(GroupUpdateRecordDto.class);
}
return null;
}
@Override
public void create(GroupUpdateRecordDto dto) {
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
dto.setData_id(IdUtil.getSnowflake(1, 1).nextId());
dto.setUpdate_optid(currentUserId);
dto.setUpdate_optname(nickName);
dto.setUpdate_time(now);
WQLObject wo = WQLObject.getWQLObject("das_group_update_record");
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
wo.insert(json);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(GroupUpdateRecordDto dto) {
GroupUpdateRecordDto entity = this.findById(dto.getData_id());
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
dto.setUpdate_time(now);
dto.setUpdate_optid(currentUserId);
dto.setUpdate_optname(nickName);
WQLObject wo = WQLObject.getWQLObject("das_group_update_record");
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
wo.update(json);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteAll(Long[] ids) {
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
WQLObject wo = WQLObject.getWQLObject("das_group_update_record");
for (Long data_id : ids) {
JSONObject param = new JSONObject();
param.put("data_id", String.valueOf(data_id));
param.put("is_delete", "1");
param.put("update_optid", currentUserId);
param.put("update_optname", nickName);
param.put("update_time", now);
wo.update(param);
}
}
}

18
lms/nladmin-system/src/main/java/org/nl/wms/ext/erp/rest/ErpToWmsController.java

@ -0,0 +1,18 @@
package org.nl.wms.ext.erp.rest;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author: lyd
* @Description: Erp请求Wms
* @Date: 2024/5/13
*/
@RestController
@Api(tags = "erp请求wms")
@RequestMapping("/api/erp/task")
@Slf4j
public class ErpToWmsController {
}

9
lms/nladmin-system/src/main/java/org/nl/wms/ext/erp/service/ErpToWmsService.java

@ -0,0 +1,9 @@
package org.nl.wms.ext.erp.service;
/**
* @Author: lyd
* @Description:
* @Date: 2024/5/13
*/
public interface ErpToWmsService {
}

16
lms/nladmin-system/src/main/java/org/nl/wms/ext/erp/service/impl/ErpToWmsServiceImpl.java

@ -0,0 +1,16 @@
package org.nl.wms.ext.erp.service.impl;
import lombok.extern.slf4j.Slf4j;
import org.nl.wms.ext.erp.service.ErpToWmsService;
import org.springframework.stereotype.Service;
/**
* @Author: lyd
* @Description:
* @Date: 2024/5/13
*/
@Service
@Slf4j
public class ErpToWmsServiceImpl implements ErpToWmsService {
}

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

@ -1,5 +1,6 @@
package org.nl.wms.pda.rest;
import cn.dev33.satoken.annotation.SaIgnore;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
@ -28,6 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
@Api(tags = "辽宁晟华手持")
@RequestMapping("/api/pda")
@Slf4j
@SaIgnore
public class PdaController {
private final PdaService pdaService;
@ -267,4 +269,259 @@ public class PdaController {
pdaService.callDefective(device_code, param.toJSONString());
return PdaUtils.buildSuccessResultJSON(null);
}
@PostMapping("/manual/ExceptionHandlingTask/show")
@Log("人工异常处理-任务显示")
@ApiOperation("人工异常处理-任务显示")
@PdaAnnotation
public JSONObject manualExceptionHandlingTaskShow(@RequestBody JSONObject param) {
return PdaUtils.buildSuccessResultJSON(pdaService.manualExceptionHandlingTaskShow(param));
}
@PostMapping("/manual/ExceptionHandlingTask/list")
@Log("人工异常处理-点位下拉框")
@ApiOperation("人工异常处理-点位下拉框")
@PdaAnnotation
public JSONObject manualExceptionHandlingTaskList() {
return PdaUtils.buildSuccessResultJSON(pdaService.manualExceptionHandlingTaskList());
}
@PostMapping("/manual/ExceptionHandlingTask/regionList")
@Log("人工异常处理-区域下拉框")
@ApiOperation("人工异常处理-区域下拉框")
@PdaAnnotation
public JSONObject manualExceptionHandlingTaskRegionList() {
return PdaUtils.buildSuccessResultJSON(pdaService.manualExceptionHandlingTaskRegionList());
}
@PostMapping("/manual/ExceptionHandlingTask")
@Log("人工异常处理")
@ApiOperation("人工异常处理")
@PdaAnnotation
public JSONObject manualExceptionHandlingTask(@RequestBody JSONObject param) {
pdaService.manualExceptionHandlingTask(param);
return PdaUtils.buildSuccessResultJSON(null);
}
// ====================================================================
@PostMapping("/manual/mixingMoveTask")
@Log("人工混碾搬运")
@ApiOperation("人工混碾搬运")
@PdaAnnotation
public JSONObject manualMixingMoveTask(@RequestBody JSONObject param) {
pdaService.manualMixingMoveTask(param);
return PdaUtils.buildSuccessResultJSON(null);
}
@PostMapping("/manual/getMixingPointList")
@Log("获取混碾下拉框")
@ApiOperation("获取混碾下拉框")
@PdaAnnotation
public JSONObject getMixingPoint() {
return PdaUtils.buildSuccessResultJSON(pdaService.getMixingPointList());
}
@PostMapping("/manual/getMixingTaskList")
@Log("获取混碾人工任务")
@ApiOperation("获取混碾人工任务")
@PdaAnnotation
public JSONObject getMixingTaskList() {
return PdaUtils.buildSuccessResultJSON(pdaService.getMixingTaskList());
}
// ====================================================================
@PostMapping("/manual/transfer/positionList")
@Log("料盅转移位置列表")
@ApiOperation("料盅转移位置列表")
@PdaAnnotation
public JSONObject getPositionList() {
return PdaUtils.buildSuccessResultJSON(pdaService.getPositionList());
}
@PostMapping("/manual/transfer/createTask")
@Log("料盅转移任务")
@ApiOperation("料盅转移任务")
@PdaAnnotation
public JSONObject transferCreateTask(@RequestBody JSONObject param) {
pdaService.transferCreateTask(param);
return PdaUtils.buildSuccessResultJSON(null);
}
@PostMapping("/manual/transfer/taskShow")
@Log("料盅转移任务显示")
@ApiOperation("料盅转移任务显示")
@PdaAnnotation
public JSONObject transferTaskShow() {
return PdaUtils.buildSuccessResultJSON(pdaService.transferTaskShow());
}
// ====================================================================
// 终点见 /manual/transfer/positionList
@PostMapping("/manual/suppress/startPointList")
@Log("压制叫料起点列表")
@ApiOperation("压制叫料起点列表")
@PdaAnnotation
public JSONObject suppressStartPointList() {
return PdaUtils.buildSuccessResultJSON(pdaService.suppressStartPointList());
}
@PostMapping("/manual/suppress/createTask")
@Log("压制叫料任务")
@ApiOperation("压制叫料任务")
@PdaAnnotation
public JSONObject suppressCreateTask(@RequestBody JSONObject param) {
pdaService.suppressCreateTask(param);
return PdaUtils.buildSuccessResultJSON(null);
}
@PostMapping("/manual/suppress/taskShow")
@Log("压制叫料任务显示")
@ApiOperation("压制叫料任务显示")
@PdaAnnotation
public JSONObject suppressTaskShow() {
return PdaUtils.buildSuccessResultJSON(pdaService.suppressTaskShow());
}
// ====================================================================
@PostMapping("/manual/suppress/down/pointList")
@Log("压制送料起点列表")
@ApiOperation("压制送料起点列表")
@PdaAnnotation
public JSONObject suppressDownPointList() {
return PdaUtils.buildSuccessResultJSON(pdaService.suppressDownPointList());
}
@PostMapping("/manual/suppress/down/createTask")
@Log("压制送料任务")
@ApiOperation("压制送料任务")
@PdaAnnotation
public JSONObject suppressDownCreateTask(@RequestBody JSONObject param) {
pdaService.suppressDownCreateTask(param);
return PdaUtils.buildSuccessResultJSON(null);
}
@PostMapping("/manual/suppress/down/show")
@Log("压制送料任务显示")
@ApiOperation("压制送料任务显示")
@PdaAnnotation
public JSONObject suppressDownShow() {
return PdaUtils.buildSuccessResultJSON(pdaService.suppressDownShow());
}
// ====================================================================
@PostMapping("/manual/kiln/out/createTask")
@Log("出窑任务请求")
@ApiOperation("出窑任务请求")
@PdaAnnotation
public JSONObject kilnOutCreateTask(@RequestBody JSONObject param) {
pdaService.kilnOutCreateTask(param);
return PdaUtils.buildSuccessResultJSON(null);
}
@PostMapping("/manual/kiln/out/createTaskShow")
@Log("出窑任务请求显示")
@ApiOperation("出窑任务显示")
@PdaAnnotation
public JSONObject kilnOutCreateTaskShow() {
return PdaUtils.buildSuccessResultJSON(pdaService.kilnOutCreateTaskShow());
}
// ====================================================================
@PostMapping("/manual/kiln/move/createTask")
@Log("窑后移库任务请求")
@ApiOperation("窑后移库任务请求")
@PdaAnnotation
public JSONObject kilnMoveCreateTask(@RequestBody JSONObject param) {
pdaService.kilnMoveCreateTask(param);
return PdaUtils.buildSuccessResultJSON(null);
}
@PostMapping("/manual/kiln/move/createTaskShow")
@Log("窑后移库任务请求")
@ApiOperation("窑后移库任务请求")
@PdaAnnotation
public JSONObject kilnMoveCreateTaskShow() {
return PdaUtils.buildSuccessResultJSON(pdaService.kilnMoveCreateTaskShow());
}
@PostMapping("/manual/kiln/move/pointList")
@Log("窑后移库点位下拉数据")
@ApiOperation("窑后移库点位下拉数据")
@PdaAnnotation
public JSONObject kilnMovePointList() {
return PdaUtils.buildSuccessResultJSON(pdaService.kilnMovePointList());
}
// ====================================================================
@PostMapping("/manual/materialReturn")
@Log("泥料退料")
@ApiOperation("泥料退料")
@PdaAnnotation
public JSONObject MaterialReturn(@RequestBody JSONObject param) {
pdaService.MaterialReturn(param);
return PdaUtils.buildSuccessResultJSON(null);
}
// ====================================================================
@PostMapping("/manual/samplingCountNum")
@Log("取样计数")
@ApiOperation("取样计数")
@PdaAnnotation
public JSONObject samplingCountNum(@RequestBody JSONObject param) {
pdaService.samplingCountNum(param);
return PdaUtils.buildSuccessResultJSON(null);
}
// ====================================================================
@PostMapping("/manual/loamCompare/list")
@Log("搬运点位下拉框")
@ApiOperation("搬运点位下拉框")
@PdaAnnotation
public JSONObject getLoamComparePointList() {
return PdaUtils.buildSuccessResultJSON(pdaService.getLoamComparePointList());
}
@PostMapping("/manual/loamCompare/doCheck")
@Log("校验任务与组盘是否一致")
@ApiOperation("校验任务与组盘是否一致")
@PdaAnnotation
public JSONObject getLoamCompareDoCheck(@RequestBody JSONObject param) {
return PdaUtils.buildSuccessResultWithMessage(pdaService.getLoamCompareDoCheck(param));
}
// ====================================================================
@PostMapping("/manual/updateInfo/getInfo")
@Log("根据载具编码获取组盘信息")
@ApiOperation("根据载具编码获取组盘信息")
@PdaAnnotation
public JSONObject getGroupInfoByVehicleCode(@RequestBody JSONObject param) {
return PdaUtils.buildSuccessResultJSON(pdaService.getGroupInfoByVehicleCode(param));
}
@PostMapping("/manual/updateInfo/updateWeight")
@Log("修改料盅重量")
@ApiOperation("修改料盅重量")
@PdaAnnotation
public JSONObject doUpdateWeight(@RequestBody JSONObject param) {
pdaService.doUpdateWeight(param);
return PdaUtils.buildSuccessResultJSON(null);
}
// ====================================================================
@PostMapping("/manual/updateInfo/updateQty")
@Log("修改重量/数量")
@ApiOperation("修改重量/数量")
@PdaAnnotation
public JSONObject doUpdateQty(@RequestBody JSONObject param) {
pdaService.doUpdateQty(param);
return PdaUtils.buildSuccessResultJSON(null);
}
// ====================================================================
@PostMapping("/manual/unbindVehicle/checkHaveMaterial")
@Log("校验托盘是否有货")
@ApiOperation("校验托盘是否有货")
@PdaAnnotation
public JSONObject checkHaveMaterial(@RequestBody JSONObject param) {
return PdaUtils.buildSuccessResultJSON(pdaService.checkHaveMaterial(param));
}
@PostMapping("/manual/unbindVehicle/doUnbindVehicle")
@Log("解绑托盘信息")
@ApiOperation("解绑托盘信息")
@PdaAnnotation
public JSONObject doUnbindVehicle(@RequestBody JSONObject param) {
pdaService.doUnbindVehicle(param);
return PdaUtils.buildSuccessResultWithMessage("成功解绑");
}
}

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

@ -2,6 +2,7 @@ package org.nl.wms.pda.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
/**
* 辽宁晟华手持服务层接口
@ -123,4 +124,188 @@ public interface PdaService {
* @param device_code 设备编码
*/
void callDefective(String device_code, String request_param);
/**
* 人工处理异常任务
* @param param /
*/
void manualExceptionHandlingTask(JSONObject param);
/**
* 人工异常处理-任务查看
* @return /
*/
JSONArray manualExceptionHandlingTaskShow(JSONObject param);
/**
* 人工混碾搬运
* @param param /
*/
void manualMixingMoveTask(JSONObject param);
/**
* 获取混碾下拉框
* @return /
*/
JSONArray getMixingPointList();
/**
* 获取混碾人工任务
* @return /
*/
JSONArray getMixingTaskList();
/**
* 料盅转移位置列表
* @return /
*/
JSONArray getPositionList();
/**
* 料盅转移任务
* @param param /
*/
void transferCreateTask(JSONObject param);
/**
* 任务显示
* @return /
*/
JSONArray transferTaskShow();
/**
* 压制叫料起点列表
* @return
*/
JSONArray suppressStartPointList();
/**
* 创建任务
* @param param
*/
void suppressCreateTask(JSONObject param);
/**
* 压制送料起点列表
* @return /
*/
JSONArray suppressDownPointList();
/**
* 压制送料任务
* @param param /
*/
void suppressDownCreateTask(JSONObject param);
/**
* 任务显示
* @return /
*/
JSONArray suppressDownShow();
/**
* 出窑任务请求
* @param param /
*/
void kilnOutCreateTask(JSONObject param);
/**
* 窑后移库任务请求
* @param param /
*/
void kilnMoveCreateTask(JSONObject param);
/**
* 窑后移库点位下拉数据
* @return /
*/
JSONArray kilnMovePointList();
/**
* 点位下拉框
* @return /
*/
JSONArray manualExceptionHandlingTaskList();
/**
* 压制送料任务显示
* @return /
*/
JSONArray suppressTaskShow();
/**
* 退料
* @param param /
*/
void MaterialReturn(JSONObject param);
/**
* 取样计数
* @param param /
*/
void samplingCountNum(JSONObject param);
/**
* 区域下拉框
* @return
*/
JSONArray manualExceptionHandlingTaskRegionList();
/**
* 出窑任务
* @return /
*/
JSONArray kilnOutCreateTaskShow();
/**
* 转移
* @return /
*/
JSONArray kilnMoveCreateTaskShow();
/**
* 获取泥料比对的点位列表
* @return /
*/
JSONArray getLoamComparePointList();
/**
* 校验任务与组盘是否一致
* @param param /
* @return /
*/
String getLoamCompareDoCheck(JSONObject param);
/**
* 查询数据
* @param param /
* @return /
*/
JSONObject getGroupInfoByVehicleCode(JSONObject param);
/**
* 更新料盅重量
* @param param /
* @return /
*/
void doUpdateWeight(JSONObject param);
/**
* 修改重量/数量
* @param param /
*/
void doUpdateQty(JSONObject param);
/**
* 校验托盘是否有货
* @param param /
* @return /
*/
JSONObject checkHaveMaterial(JSONObject param);
/**
* 校验托盘是否有货
* @param param /
*/
void doUnbindVehicle(JSONObject param);
}

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

@ -10,20 +10,25 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.common.utils.SecurityUtils;
import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.basedata.eum.StandStatus;
import org.nl.wms.basedata.eum.TrueOrFalse;
import org.nl.wms.basedata.eum.VehicleType;
import org.nl.wms.common.PickType;
import org.nl.wms.das.service.GroupUpdateRecordService;
import org.nl.wms.das.service.dto.GroupUpdateRecordDto;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.pda.service.PdaService;
import org.nl.wms.sch.manage.CreateMode;
import org.nl.wms.sch.manage.PointStatus;
import org.nl.wms.sch.manage.Region;
import org.nl.wms.sch.manage.*;
import org.nl.wms.sch.task.call.empty.FJCallEmptyTask;
import org.nl.wms.sch.task.call.empty.HLCallEmptyTask;
import org.nl.wms.sch.task.call.empty.YZCallEmptyTask;
import org.nl.wms.sch.task.call.material.FJCallMaterialTask;
import org.nl.wms.sch.task.call.material.YZCallMaterialTask;
import org.nl.wms.sch.task.p2p.PDATask;
import org.nl.wms.sch.task.send.empty.FJSendEmptyTask;
import org.nl.wms.sch.task.send.empty.YZSendEmptyTask;
import org.nl.wms.sch.task.send.material.FJSendMaterialTask;
@ -33,6 +38,8 @@ import org.nl.wms.sch.task.util.TaskUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
/**
* @author 张江玮
* @date 2022/12/02 10:04
@ -64,6 +71,8 @@ public class PdaServiceImpl implements PdaService {
private final WmsToAcsService wmsToAcsService;
private final GroupUpdateRecordService groupUpdateRecordService;
@Override
public JSONArray region(String func) {
switch (func) {
@ -615,4 +624,702 @@ public class PdaServiceImpl implements PdaService {
method_param.put("create_name", SecurityUtils.getCurrentNickName());
yzCallMaterialTask.createTask(method_param);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void manualExceptionHandlingTask(JSONObject param) {
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
String taskId = param.getString("task_id");
// param中包含两个信息:task_id, target_point(可为空)
JSONObject taskObject = taskTab.query("task_id = '" + taskId + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(taskObject)) {
throw new BadRequestException("任务「" + taskId + "」不存在!");
}
if (ObjectUtil.isNotEmpty(param.getString("end_point"))) {
taskObject.put("point_code2", param.getString("end_point"));
}
taskObject.put("task_status", TaskStatus.FINISHED.value());
TaskUtils.addCurrentUpdateColum(taskObject);
taskTab.update(taskObject);
log.info("任务「{}」已经更新目的地「{}」并完成", taskId, param.getString("end_point"));
}
@Override
public JSONArray manualExceptionHandlingTaskShow(JSONObject param) {
return WQL
.getWO("PDA")
.addParam("flag", "4")
.addParam("region_code", param.getString("region_code"))
.process()
.getResultJSONArray(0);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void manualMixingMoveTask(JSONObject param) {
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail");
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
// param: point_code, vehicle_code, weight
String target_point = "KLXNK";
String pointCode = param.getString("point_code");
String vehicleCode = param.getString("vehicle_code");
String weight = param.getString("weight");
if (ObjectUtil.isEmpty(vehicleCode)) {
throw new BadRequestException("载具编码不能为空!");
}
if (ObjectUtil.isEmpty(weight)) {
throw new BadRequestException("重量不能为空!");
}
// 检测同个点位是否存在任务
JSONObject tasking = taskTab.query("point_code1 = '" + pointCode + "' AND task_status < '7' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(tasking)) {
throw new BadRequestException("点位「" + pointCode + "」存在任务『" + tasking.getString("task_code") + "』");
}
// 组盘
// 相同组盘信息,先标记删除
JSONObject vd_update = new JSONObject();
vd_update.put("is_delete", "1");
vd_update.put("update_optid", ACSSystem.id);
vd_update.put("update_optname", ACSSystem.nick_name);
String now = DateUtil.now();
vd_update.put("update_time", now);
vd_table.update(vd_update, "vehicle_type = '1' AND vehicle_code = '" + vehicleCode + "' AND is_delete = '0'");
// 获取点位
JSONObject point = pointTab.query("point_code = '" + pointCode + "'").uniqueResult(0);
// 获取工单
JSONObject workorder = TaskUtils.hasWorkOrder(point);
// 创建任务,状态为完成
JSONObject vd = new JSONObject();
vd.put("vd_id", IdUtil.getSnowflake(1L, 1L).nextId());
vd.put("vehicle_type", VehicleType.CUP.value());
vd.put("vehicle_code", vehicleCode);
vd.put("material_id", workorder.getString("material_id"));
vd.put("weight", weight);
vd.put("workorder_id", workorder.getString("workorder_id"));
vd.put("point_code", pointCode);
vd.put("create_id", SecurityUtils.getCurrentUserId());
vd.put("create_name", SecurityUtils.getCurrentNickName());
vd.put("create_time", now);
vd.put("is_in_kiln", "0");
vd.put("stand_status", StandStatus.STANDING.value());
vd.put("mix_num", "0"); // todo
vd_table.insert(vd);
param.put("vd", vd);
// 创建任务
JSONObject task = new JSONObject();
task.put("task_id", IdUtil.getSnowflake().nextId());
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
task.put("task_name", "混料区人工送料");
task.put("task_type", TaskType.PDA_HN.value());
task.put("task_status", TaskStatus.FINISHED.value());
task.put("point_code1", pointCode);
task.put("point_code2", target_point);
task.put("group_id", vd.getString("vd_id"));
task.put("material_id", workorder.getString("material_id"));
task.put("vehicle_type", VehicleType.CUP.value());
task.put("vehicle_code", vehicleCode);
task.put("priority", "1");
task.put("is_auto_issue", "0");
task.put("handle_class", this.getClass().getName());
task.put("create_mode", CreateMode.SCCJ.value());
task.put("request_param", param);
task.put("create_id", SecurityUtils.getCurrentUserId());
task.put("create_name", SecurityUtils.getCurrentNickName());
task.put("create_time", DateUtil.now());
taskTab.insert(task);
// 混碾工单需要加上重量真实值
JSONObject workorder_update = new JSONObject();
workorder_update.put("real_qty", workorder.getIntValue("real_qty") + param.getIntValue("weight"));
TaskUtils.addACSUpdateColum(workorder_update);
WQLObject.getWQLObject("pdm_bd_workorder").update(workorder_update, "workorder_id = " + workorder.getString("workorder_id"));
}
@Override
public JSONArray getMixingPointList() {
return WQL
.getWO("PDA")
.addParam("flag", "5")
.addParam("region_code", "HL")
.process()
.getResultJSONArray(0);
}
@Override
public JSONArray getMixingTaskList() {
return getTaskList(TaskType.PDA_HN.value());
}
public JSONArray getTaskList(String task_type) {
return WQL
.getWO("PDA")
.addParam("flag", "6")
.addParam("task_type", task_type)
.addParam("handle_class", "org.nl.wms.pda.service.impl.PdaServiceImpl")
.process()
.getResultJSONArray(0);
}
@Override
public JSONArray getPositionList() {
return WQL
.getWO("PDA")
.addParam("flag", "9")
.addParam("types", "('2','3')")
.process()
.getResultJSONArray(0);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void transferCreateTask(JSONObject param) {
log.info("请求参数:{}", param);
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail");
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
// param: start_point, end_point, vehicle_code, is_agv
String startPoint = param.getString("start_point");
String endPoint = param.getString("end_point");
if (startPoint.equals(endPoint)) {
throw new BadRequestException("起点和终点不能一样");
}
String vehicleCode = param.getString("vehicle_code");
String isAgv = param.getString("is_agv");
JSONObject point1 = pointTab.query("point_code = '" + startPoint + "'").uniqueResult(0);
JSONObject point2 = pointTab.query("point_code = '" + endPoint + "'").uniqueResult(0);
point2.put("vehicle_type", point1.getString("vehicle_type"));
point2.put("vehicle_code", point1.getString("vehicle_code"));
point2.put("point_status", "1");
pointTab.update(point2);
// 校验任务
JSONObject tasking = taskTab.query("(point_code1 = '" + startPoint + "' or point_code2 = '" + endPoint + "') " +
"AND task_status < '7' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(tasking)) {
throw new BadRequestException("已存在任务");
}
// 获取组盘
JSONObject groupInfo = vd_table.query("vehicle_type = '1' AND vehicle_code = '" + vehicleCode + "' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(groupInfo)) {
throw new BadRequestException("料盅「" + vehicleCode + "」的组盘信息不存在");
}
JSONObject taskParam = new JSONObject();
taskParam.put("point1", startPoint);
taskParam.put("point2", endPoint);
taskParam.put("vehicle_type", VehicleType.CUP.value());
taskParam.put("vehicle_code", vehicleCode);
taskParam.put("create_mode", CreateMode.SCCJ.value());
taskParam.put("group_id", groupInfo.getString("vd_id"));
if ("1".equals(isAgv)) {
PDATask pdaTask = SpringContextHolder.getBean(PDATask.class);
pdaTask.createTask(taskParam);
} else {
// 不是AGV就是人工搬运。
taskParam.put("task_id", IdUtil.getSnowflake().nextId());
taskParam.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
taskParam.put("task_name", "人工泥料转移");
taskParam.put("task_type", TaskType.PDA_MATERIAL_TRANSFER.value());
taskParam.put("task_status", TaskStatus.FINISHED.value());
taskParam.put("material_id", groupInfo.getString("material_id"));
taskParam.put("priority", "1");
taskParam.put("is_auto_issue", "0");
taskParam.put("handle_class", this.getClass().getName());
taskParam.put("request_param", param);
taskParam.put("create_id", SecurityUtils.getCurrentUserId());
taskParam.put("create_name", SecurityUtils.getCurrentNickName());
taskParam.put("create_time", DateUtil.now());
taskTab.insert(taskParam);
}
log.info("手持任务创建成功");
}
@Override
public JSONArray transferTaskShow() {
return WQL
.getWO("PDA")
.addParam("flag", "7")
.process()
.getResultJSONArray(0);
}
@Override
public JSONArray suppressStartPointList() {
return WQL
.getWO("PDA")
.addParam("flag", "8")
.process()
.getResultJSONArray(0);
}
@Override
public void suppressCreateTask(JSONObject param) {
log.info("请求参数:{}", param);
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail");
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
// param: start_point, end_point, vehicle_code
String startPoint = param.getString("start_point");
String endPoint = param.getString("end_point");
String vehicleCode = param.getString("vehicle_code");
// 校验是否创建过任务
JSONObject tasking = taskTab.query("(point_code1 = '" + startPoint + "' or point_code2 = '" + endPoint + "') " +
"AND task_status < '7' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(tasking)) {
throw new BadRequestException("已存在任务");
}
// 创建人工搬运任务,任务状态是完成,点位上记录的数据需要变动
JSONObject point1 = pointTab.query("point_code = '" + startPoint + "'").uniqueResult(0);
JSONObject point2 = pointTab.query("point_code = '" + endPoint + "'").uniqueResult(0);
// 获取组盘信息
JSONObject vd = vd_table.query("vehicle_type = '1' AND vehicle_code = '" + vehicleCode + "' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(vd)) {
throw new BadRequestException("料盅「" + vehicleCode + "」的组盘信息不存在");
}
// 获取工单
JSONObject workorder = TaskUtils.hasWorkOrder(point2);
// 创建任务
JSONObject task = new JSONObject();
task.put("task_id", IdUtil.getSnowflake().nextId());
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
task.put("task_name", "人工布料机上料");
task.put("task_type", TaskType.PDA_PRESS_UP.value());
task.put("task_status", TaskStatus.FINISHED.value());
task.put("point_code1", startPoint);
task.put("point_code2", endPoint);
task.put("group_id", vd.getString("vd_id"));
task.put("material_id", workorder.getString("material_id"));
task.put("vehicle_type", VehicleType.CUP.value());
task.put("vehicle_code", vehicleCode);
task.put("priority", "1");
task.put("is_auto_issue", "0");
task.put("handle_class", this.getClass().getName());
task.put("create_mode", CreateMode.SCCJ.value());
task.put("request_param", param);
task.put("create_id", SecurityUtils.getCurrentUserId());
task.put("create_name", SecurityUtils.getCurrentNickName());
task.put("create_time", DateUtil.now());
taskTab.insert(task);
// 点位数据更新
point1.put("task_code", "");
point1.put("vehicle_type", "");
point1.put("vehicle_code", "");
point1.put("point_status", PointStatus.EMPTY.value());
TaskUtils.addCurrentUpdateColum(point1);
pointTab.update(point1);
point2.put("task_code", "");
point2.put("vehicle_type", task.getString("vehicle_type"));
point2.put("vehicle_code", task.getString("vehicle_code"));
point2.put("point_status", PointStatus.NOT_EMPTY.value());
TaskUtils.addCurrentUpdateColum(point2);
pointTab.update(point2);
log.info("布料机叫料手持任务创建成功");
}
@Override
public JSONArray suppressDownPointList() {
return WQL
.getWO("PDA")
.addParam("flag", "9")
.addParam("types", "('1')")
.process()
.getResultJSONArray(0);
}
@Override
public void suppressDownCreateTask(JSONObject param) {
log.info("请求参数:{}", param);
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail");
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
// param: start_point, vehicle_code, qty, is_full
String startPoint = param.getString("start_point");
String endPoint = "YQXNK";
String vehicleCode = param.getString("vehicle_code");
String qty = param.getString("qty");
String isFull = param.getString("is_full");
String weight = "0";
// 判断是否有任务
JSONObject tasking = taskTab.query("(point_code1 = '" + startPoint + "' or point_code2 = '" + endPoint + "') " +
"AND task_status < '7' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(tasking)) {
throw new BadRequestException("已存在任务");
}
// 组盘
// 相同组盘信息,先标记删除
JSONObject vd_update = new JSONObject();
vd_update.put("is_delete", "1");
vd_update.put("update_optid", ACSSystem.id);
vd_update.put("update_optname", ACSSystem.nick_name);
String now = DateUtil.now();
vd_update.put("update_time", now);
vd_table.update(vd_update, "vehicle_type = '2' AND vehicle_code = '" + vehicleCode + "' AND is_delete = '0'");
// 获取点位
JSONObject point1 = pointTab.query("point_code = '" + startPoint + "'").uniqueResult(0);
JSONObject point2 = pointTab.query("point_code = '" + endPoint + "'").uniqueResult(0);
// 获取工单
JSONObject workorder = TaskUtils.hasWorkOrder(point1);
JSONObject vd = new JSONObject();
vd.put("vd_id", IdUtil.getSnowflake(1, 1).nextId());
vd.put("vehicle_type", "2");
vd.put("vehicle_code", vehicleCode);
vd.put("material_id", workorder.getString("material_id"));
vd.put("qty", qty);
vd.put("weight", weight);
vd.put("is_full", isFull);
vd.put("workorder_id", workorder.getString("workorder_id"));
vd.put("point_code", endPoint); // 这里换成虚拟库位置
vd.put("create_id", ACSSystem.id);
vd.put("create_name", ACSSystem.nick_name);
vd.put("create_time", DateUtil.now());
vd.put("is_delete", TrueOrFalse.FALSE.value());
vd_table.insert(vd);
JSONObject pn = TaskUtils.buildPN(PickType.YZ, vd.getLongValue("qty"), vd.getLongValue("workorder_id"));
WQLObject.getWQLObject("das_produce_number").insert(pn);
// 创建任务
JSONObject task = new JSONObject();
task.put("task_id", IdUtil.getSnowflake().nextId());
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
task.put("task_name", "人工压机下料");
task.put("task_type", TaskType.PDA_PRESS_DOWN.value());
task.put("task_status", TaskStatus.FINISHED.value());
task.put("point_code1", startPoint);
task.put("point_code2", endPoint);
task.put("group_id", vd.getString("vd_id"));
task.put("material_id", workorder.getString("material_id"));
task.put("vehicle_type", VehicleType.STEEL_TRAY.value());
task.put("vehicle_code", vehicleCode);
task.put("priority", "1");
task.put("is_auto_issue", "0");
task.put("handle_class", this.getClass().getName());
task.put("create_mode", CreateMode.SCCJ.value());
task.put("request_param", param);
task.put("create_id", SecurityUtils.getCurrentUserId());
task.put("create_name", SecurityUtils.getCurrentNickName());
task.put("create_time", DateUtil.now());
taskTab.insert(task);
// 起点清空,终点赋值。
point1.put("task_code", "");
point1.put("vehicle_type", "");
point1.put("vehicle_code", "");
point1.put("point_status", PointStatus.EMPTY.value());
TaskUtils.addCurrentUpdateColum(point1);
pointTab.update(point1);
point2.put("task_code", "");
point2.put("vehicle_type", task.getString("vehicle_type"));
point2.put("vehicle_code", task.getString("vehicle_code"));
point2.put("point_status", PointStatus.NOT_EMPTY.value());
TaskUtils.addCurrentUpdateColum(point2);
pointTab.update(point2);
log.info("压机下料手持任务创建成功");
}
@Override
public JSONArray suppressDownShow() {
return getTaskList(TaskType.PDA_PRESS_DOWN.value());
}
@Override
public void kilnOutCreateTask(JSONObject param) {
log.info("请求参数:{}", param);
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail");
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
// JYHJ01DJ04
// param: vehicle_code
String startPoint = "JYHJ01DJ04";
String endPoint = "CYXNK";
String vehicleCode = param.getString("vehicle_code");
// 校验任务
JSONObject tasking = taskTab.query("(point_code1 = '" + startPoint + "' or point_code2 = '" + endPoint + "') " +
"AND task_status < '7' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(tasking)) {
throw new BadRequestException("已存在任务");
}
// 获取组盘 (此时是刚托盘)
JSONObject vd = vd_table.query("vehicle_type = '2' AND vehicle_code = '" + vehicleCode + "' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(vd)) {
throw new BadRequestException("钢托盘「" + vehicleCode + "」的组盘信息不存在");
}
vd.put("is_fire", "1");
vd.put("is_in_kiln", "0");
vd.put("point_code", endPoint);
vd_table.update(vd);
// 创建任务
JSONObject task = new JSONObject();
task.put("task_id", IdUtil.getSnowflake().nextId());
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
task.put("task_name", "人工出窑任务");
task.put("task_type", TaskType.PDA_OUT_KILN.value());
task.put("task_status", TaskStatus.FINISHED.value());
task.put("point_code1", startPoint);
task.put("point_code2", endPoint);
task.put("group_id", vd.getString("vd_id"));
task.put("material_id", vd.getString("material_id"));
task.put("vehicle_type", VehicleType.STEEL_TRAY.value());
task.put("vehicle_code", vehicleCode);
task.put("priority", "1");
task.put("is_auto_issue", "0");
task.put("handle_class", this.getClass().getName());
task.put("create_mode", CreateMode.SCCJ.value());
task.put("request_param", param);
task.put("create_id", SecurityUtils.getCurrentUserId());
task.put("create_name", SecurityUtils.getCurrentNickName());
task.put("create_time", DateUtil.now());
taskTab.insert(task);
}
@Override
public void kilnMoveCreateTask(JSONObject param) {
log.info("请求参数:{}", param);
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail");
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
// param: start_point, vehicle_code
String startPoint = param.getString("start_point");
String vehicleCode = param.getString("vehicle_code");
String endPoint = "CYXNK";
JSONObject point1 = pointTab.query("point_code = '" + startPoint + "'").uniqueResult(0);
// 判断是否有任务
JSONObject tasking = taskTab.query("(point_code1 = '" + startPoint + "' or point_code2 = '" + endPoint + "') " +
"AND task_status < '7' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(tasking)) {
throw new BadRequestException("已存在任务");
}
// 获取组盘 (此时是刚托盘)
JSONObject vd = vd_table.query("vehicle_type = '2' AND vehicle_code = '" + vehicleCode + "' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(vd)) {
throw new BadRequestException("钢托盘「" + vehicleCode + "」的组盘信息不存在");
}
vd.put("point_code", endPoint); // 更新到虚拟库
vd_table.update(vd);
// 生成完成的任务
JSONObject task = new JSONObject();
task.put("task_id", IdUtil.getSnowflake().nextId());
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
task.put("task_name", "人工移库任务");
task.put("task_type", TaskType.PDA_VEHICLE_TRANSFER.value());
task.put("task_status", TaskStatus.FINISHED.value());
task.put("point_code1", startPoint);
task.put("point_code2", endPoint);
task.put("group_id", vd.getString("vd_id"));
task.put("material_id", vd.getString("material_id"));
task.put("vehicle_type", VehicleType.STEEL_TRAY.value());
task.put("vehicle_code", vehicleCode);
task.put("priority", "1");
task.put("is_auto_issue", "0");
task.put("handle_class", this.getClass().getName());
task.put("create_mode", CreateMode.SCCJ.value());
task.put("request_param", param);
task.put("create_id", SecurityUtils.getCurrentUserId());
task.put("create_name", SecurityUtils.getCurrentNickName());
task.put("create_time", DateUtil.now());
taskTab.insert(task);
// 起点清空
point1.put("task_code", "");
point1.put("vehicle_type", "");
point1.put("vehicle_code", "");
point1.put("point_status", PointStatus.EMPTY.value());
TaskUtils.addCurrentUpdateColum(point1);
}
@Override
public JSONArray kilnMovePointList() {
return WQL
.getWO("PDA")
.addParam("flag", "5")
.addParam("region_code", "BCPHJ")
.process()
.getResultJSONArray(0);
}
@Override
public JSONArray manualExceptionHandlingTaskList() {
return WQL
.getWO("PDA")
.addParam("flag", "5")
.addParam("region_code", "XN")
.process()
.getResultJSONArray(0);
}
@Override
public JSONArray suppressTaskShow() {
return getTaskList(TaskType.PDA_PRESS_UP.value());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void MaterialReturn(JSONObject param) {
log.info("请求参数:{}", param);
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail");
WQLObject orderTab = WQLObject.getWQLObject("pdm_bd_workorder");
// param: vehicle_code
String vehicleCode = param.getString("vehicle_code");
JSONObject groupObj = vd_table.query("vehicle_code = '" + vehicleCode + "' AND vehicle_type = '1'", "create_time desc").uniqueResult(0);
if (ObjectUtil.isEmpty(groupObj)) {
throw new BadRequestException("料盅[" + vehicleCode + "]组盘信息不存在!");
}
// 查找工单
JSONObject orderObj = orderTab.query("workorder_id = '" + groupObj.getString("workorder_id") + "'").uniqueResult(0);
orderObj.put("unqualified_qty", orderObj.getBigDecimal("unqualified_qty").add(groupObj.getBigDecimal("weight")));
TaskUtils.addCurrentUpdateColum(orderObj);
orderTab.update(orderObj);
// 组盘修改
groupObj.put("is_back", "1");
TaskUtils.addCurrentUpdateColum(groupObj);
vd_table.update(groupObj);
}
@Override
public void samplingCountNum(JSONObject param) {
log.info("请求参数:{}", param);
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail");
// param: vehicle_code, number
String vehicleCode = param.getString("vehicle_code");
BigDecimal number = param.getBigDecimal("number");
JSONObject groupObj = vd_table.query("vehicle_code = '" + vehicleCode + "' AND vehicle_type = '2'", "create_time desc").uniqueResult(0);
if (ObjectUtil.isEmpty(groupObj)) {
throw new BadRequestException("托盘[" + vehicleCode + "]组盘信息不存在!");
}
BigDecimal bigDecimal = ObjectUtil.isNotEmpty(groupObj.getBigDecimal("count_num")) ? groupObj.getBigDecimal("count_num") : new BigDecimal("0");
groupObj.put("count_num", bigDecimal.add(number));
TaskUtils.addCurrentUpdateColum(groupObj);
vd_table.update(groupObj);
}
@Override
public JSONArray manualExceptionHandlingTaskRegionList() {
return region("send_material");
}
@Override
public JSONArray kilnOutCreateTaskShow() {
return getTaskList(TaskType.PDA_OUT_KILN.value());
}
@Override
public JSONArray kilnMoveCreateTaskShow() {
return this.getTaskList(TaskType.PDA_VEHICLE_TRANSFER.value());
}
@Override
public JSONArray getLoamComparePointList() {
return getPositionList();
}
@Override
public String getLoamCompareDoCheck(JSONObject param) {
// param: point_code、vehicle_code
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
JSONObject taskObj = taskTab.query("point_code2 = '" + param.getString("point_code") + "' AND point_type = '" +
TaskType.PDA_PRESS_UP.value() + "'", "update_time desc").uniqueResult(0);
if (taskObj.getString("vehicle_code").equals(param.getString("vehicle_code"))) {
return "检测符合!";
}
return "检测不符合!";
}
@Override
public JSONObject getGroupInfoByVehicleCode(JSONObject param) {
// param: vehicle_code, vehicle_type
JSONObject info = WQL.getWO("PDA")
.addParam("flag", "10")
.addParam("vehicle_code", param.getString("vehicle_code"))
.addParam("vehicle_type", param.getString("vehicle_type"))
.process()
.uniqueResult(0);
if (ObjectUtil.isEmpty(info)) {
throw new BadRequestException("托盘:[" + param.getString("vehicle_code") + "]的组盘信息不存在!");
}
return info;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void doUpdateWeight(JSONObject param) {
// param: vehicle_code, vehicle_type, current_weight
// 更新、记录信息
WQLObject vdTab = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONObject info = vdTab.query("vehicle_code = '" + param.getString("vehicle_code") + "' AND vehicle_type = '" +
param.getString("vehicle_type") + "' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(info)) {
throw new BadRequestException("托盘:[" + param.getString("vehicle_code") + "]的组盘信息不存在!");
}
// 插入记录
GroupUpdateRecordDto dto = new GroupUpdateRecordDto();
dto.setGroup_id(info.getString("vd_id"));
dto.setOrign_weight(info.getString("weight"));
dto.setCurrent_weight(param.getString("current_weight"));
dto.setVehicle_code(param.getString("vehicle_code"));
dto.setVehicle_type(param.getString("vehicle_type"));
dto.setUpdate_type("1");
groupUpdateRecordService.create(dto);
info.put("weight", param.getString("current_weight"));
TaskUtils.addCurrentUpdateColum(info);
vdTab.update(info);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void doUpdateQty(JSONObject param) {
// param: vehicle_code, vehicle_type, current_weight,current_qty
// 更新、记录信息
WQLObject vdTab = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONObject info = vdTab.query("vehicle_code = '" + param.getString("vehicle_code") + "' AND vehicle_type = '" +
param.getString("vehicle_type") + "' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(info)) {
throw new BadRequestException("托盘:[" + param.getString("vehicle_code") + "]的组盘信息不存在!");
}
// 获取重量
BigDecimal currentWeight = param.getBigDecimal("current_weight");
// 获取数量
BigDecimal currentQty = param.getBigDecimal("current_qty");
if (ObjectUtil.isEmpty(currentQty)) {
currentQty = info.getBigDecimal("weight");
}
// 插入记录
GroupUpdateRecordDto dto = new GroupUpdateRecordDto();
dto.setGroup_id(info.getString("vd_id"));
dto.setOrign_weight(info.getString("weight"));
dto.setCurrent_weight(String.valueOf(currentWeight.multiply(currentQty)));
dto.setOrign_qty(info.getString("qty"));
dto.setCurrent_qty(param.getString("current_qty"));
dto.setVehicle_code(param.getString("vehicle_code"));
dto.setVehicle_type(param.getString("vehicle_type"));
dto.setUpdate_type(
(ObjectUtil.isEmpty(param.getString("current_weight")) && ObjectUtil.isNotEmpty(param.getString("current_qty")))
? "2" :
(ObjectUtil.isNotEmpty(param.getString("current_weight")) && ObjectUtil.isNotEmpty(param.getString("current_qty")))
? "3" : "1");
groupUpdateRecordService.create(dto);
info.put("weight", param.getString("current_weight"));
TaskUtils.addCurrentUpdateColum(info);
vdTab.update(info);
}
@Override
public JSONObject checkHaveMaterial(JSONObject param) {
JSONObject res = new JSONObject();
// param: vehicle_code, vehicle_type
WQLObject vdTab = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONObject info = vdTab.query("vehicle_code = '" + param.getString("vehicle_code") + "' AND vehicle_type = '" +
param.getString("vehicle_type") + "' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(info)) {
res.put("message", "该托盘系统中无组盘信息!");
return res;
}
res.put("message", "该托盘系统中存在组盘信息,如需解绑,请点击确认!");
return res;
}
@Override
public void doUnbindVehicle(JSONObject param) {
WQLObject vdTab = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONObject info = vdTab.query("vehicle_code = '" + param.getString("vehicle_code") + "' AND vehicle_type = '" +
param.getString("vehicle_type") + "' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(info)) {
throw new BadRequestException("托盘:[" + param.getString("vehicle_code") + "]的组盘信息不存在!");
}
info.put("is_delete", "1");
TaskUtils.addCurrentUpdateColum(info);
vdTab.update(info);
}
}

14
lms/nladmin-system/src/main/java/org/nl/wms/pda/util/PdaUtils.java

@ -3,6 +3,8 @@ package org.nl.wms.pda.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import javax.validation.constraints.NotNull;
/**
* 辽宁晟华手持工具类
*
@ -26,6 +28,18 @@ public final class PdaUtils {
return resultJSON;
}
/**
* 调用成功返回String
* @param result /
* @return /
*/
public static JSONObject buildSuccessResultWithMessage(@NotNull String result) {
JSONObject resultJSON = new JSONObject();
resultJSON.put("code", "1");
resultJSON.put("desc", result);
return resultJSON;
}
/**
* 服务层调用方法
* 创建操作失败的 JSONObject

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

@ -16,7 +16,12 @@
输入.flag TYPEAS s_string
输入.where TYPEAS f_string
输入.region_code TYPEAS s_string
输入.handle_class TYPEAS s_string
输入.task_type TYPEAS s_string
输入.vehicle_code TYPEAS s_string
输入.vehicle_type TYPEAS s_string
输入.point_type TYPEAS f_string
输入.types TYPEAS f_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
@ -94,3 +99,124 @@
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "4"
QUERY
SELECT
t.task_id,
t.task_code,
t.task_name,
t.task_status,
p.point_name AS start_point,
p1.point_name AS end_point,
t.vehicle_type,
t.vehicle_code
FROM
`sch_base_task` t
LEFT JOIN sch_base_point p ON p.point_code = t.point_code1
LEFT JOIN sch_base_point p1 ON p1.point_code = t.point_code2
WHERE t.task_status < '7' AND t.task_status > '3'
OPTION 输入.region_code <> ""
(p.region_code = 输入.region_code
OR
p1.region_code = 输入.region_code)
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "5"
QUERY
SELECT
p.point_code,
p.point_name
FROM
`sch_base_point` p
WHERE p.region_code = 输入.region_code
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "6"
QUERY
SELECT
t.task_id,
t.task_code,
t.task_name,
t.task_status,
p.point_name AS start_point,
p1.point_name AS end_point,
t.vehicle_type,
t.vehicle_code
FROM
`sch_base_task` t
LEFT JOIN sch_base_point p ON p.point_code = t.point_code1
LEFT JOIN sch_base_point p1 ON p1.point_code = t.point_code2
WHERE t.task_status = '7' AND t.task_type = 输入.task_type
AND t.handle_class = 输入.handle_class
AND TIMESTAMPDIFF(HOUR, t.create_time, NOW()) < 1;
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "7"
QUERY
SELECT
t.task_id,
t.task_code,
t.task_name,
t.task_status,
p.point_name AS start_point,
p1.point_name AS end_point,
t.vehicle_type,
t.vehicle_code
FROM
`sch_base_task` t
LEFT JOIN sch_base_point p ON p.point_code = t.point_code1
LEFT JOIN sch_base_point p1 ON p1.point_code = t.point_code2
WHERE (t.task_status < '7'
AND t.task_type = '6') OR (
t.task_status = '7' AND t.task_type = '8'
AND t.handle_class = 'org.nl.wms.pda.service.impl.PdaServiceImpl'
AND TIMESTAMPDIFF(HOUR, t.create_time, NOW()) < 1)
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "8"
QUERY
SELECT
p.point_code,
p.point_name
FROM
`sch_base_point` p
WHERE p.region_code IN ('XN', 'KLHJ') AND p.point_type = '1' AND p.is_used = '1' AND p.lock_type = '1'
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "9"
QUERY
SELECT
p.point_code,
p.point_name
FROM
`sch_base_point` p
WHERE p.region_code = 'YZ' AND p.point_type IN 输入.types
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "10"
QUERY
SELECT
vd.qty,
vd.weight,
mm.material_code,
mm.weight AS single_weight,
mm.material_brick_type
FROM
`st_ivt_vehicle_detail` vd
LEFT JOIN md_me_materialbase mm ON vd.material_id = mm.material_id
WHERE vd.vehicle_code = 输入.vehicle_code AND vd.vehicle_type = 输入.vehicle_type AND vd.is_delete = '0'
ENDSELECT
ENDQUERY
ENDIF

7
lms/nladmin-system/src/main/java/org/nl/wms/pdm/rest/DeviceController.java

@ -81,5 +81,12 @@ public class DeviceController {
public ResponseEntity<Object> getAllRegions(){
return new ResponseEntity<>(deviceService.getAllRegions(),HttpStatus.OK);
}
@PostMapping("/getYZDevice")
@Log("获取压机设备")
@ApiOperation("获取压机设备")
//@SaCheckPermission("device:list")
public ResponseEntity<Object> getYZDevice(){
return new ResponseEntity<>(deviceService.getYZDevice(),HttpStatus.OK);
}
}

8
lms/nladmin-system/src/main/java/org/nl/wms/pdm/rest/WorkorderController.java

@ -134,6 +134,14 @@ public class WorkorderController {
workordeService.forceFinish(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/changeDevice")
@Log("工单转移")
@ApiOperation("工单转移")
//@SaCheckPermission("produceshiftorder:list")
public ResponseEntity<Object> changeDevice(@RequestBody JSONObject param){
workordeService.changeDevice(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/getDtl")
@Log("获取当前工单下的工单生产记录")

2
lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/DeviceService.java

@ -72,4 +72,6 @@ public interface DeviceService {
* @return
*/
JSONArray getAllRegions();
JSONArray getYZDevice();
}

2
lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/WorkordeService.java

@ -126,4 +126,6 @@ public interface WorkordeService {
JSONArray getMaterial();
void downloadExcel(Map<String, Object> params, HttpServletResponse response);
void changeDevice(JSONObject param);
}

1
lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/dto/WorkorderDto.java

@ -112,4 +112,5 @@ public class WorkorderDto implements Serializable {
private String region_code;
private String plan_date;
private String is_auto;
}

6
lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java

@ -146,4 +146,10 @@ public class DeviceServiceImpl implements DeviceService {
return resultJSONArray;
}
@Override
public JSONArray getYZDevice() {
WQLObject wo = WQLObject.getWQLObject("pdm_bi_device");
JSONArray resultJSONArray = wo.query("region_code = 'YZ'").getResultJSONArray(0);
return resultJSONArray;
}
}

38
lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java

@ -566,4 +566,42 @@ public class WorkorderServiceImpl implements WorkordeService {
throw new RuntimeException(e);
}
}
@Override
public void changeDevice(JSONObject param) {
// 原先工单完成,创建新的工单。
WQLObject workorderTab = WQLObject.getWQLObject("pdm_bd_workorder");
WQLObject deviceTab = WQLObject.getWQLObject("pdm_bi_device");
JSONObject deviceObj = deviceTab.query("device_code = '" + param.getString("new_device_code") + "'").uniqueResult(0);
// 计算剩余值
Integer residual = param.getInteger("plan_qty") - param.getInteger("real_qty");
JSONObject old = new JSONObject();
old.put("order_status", WorkOrderEnum.ORDER_STATUS_FINISH.value());
TaskUtils.addCurrentUpdateColum(old);
workorderTab.update(old, "workorder_id = '" + param.getString("workorder_id") + "'");
// 创建新工单
JSONObject work_order = new JSONObject();
work_order.put("workorder_id", IdUtil.getSnowflake().nextId());
work_order.put("workorder_code", CodeUtil.getNewCode("PDM_SHIFTORDER"));
work_order.put("plan_qty", residual);
work_order.put("planproducestart_date", DateUtil.now());
work_order.put("planproduceend_date", DateUtil.now());
work_order.put("material_id", param.getString("material_id"));
work_order.put("vehicle_type", param.getString("vehicle_type"));
work_order.put("device_id", deviceObj.getString("device_id"));
work_order.put("device_code", deviceObj.getString("device_code"));
work_order.put("order_status", WorkOrderEnum.ORDER_STATUS_UNPRODUCED.value());
work_order.put("is_urgent", param.getString("is_urgent"));
work_order.put("is_pri", param.getString("is_pri"));
work_order.put("ext_code", param.getString("ext_code"));
work_order.put("is_delete", TrueOrFalse.FALSE.value());
work_order.put("plan_date", DateUtil.format(DateUtil.date(), "yyyy-MM-dd"));
Long user_id = SecurityUtils.getCurrentUserId();
String nick_name = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
work_order.put("create_id", user_id);
work_order.put("create_name", nick_name);
work_order.put("create_time", now);
workorderTab.insert(work_order);
}
}

3
lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AbstractAcsTask.java

@ -50,7 +50,8 @@ public abstract class AbstractAcsTask {
public List<AcsTaskDTO> addTask() {
JSONArray tasks = WQLObject
.getWQLObject("sch_base_task")
.query("is_delete = '0' AND task_status = " + TaskStatus.START_AND_END.value() + " AND handle_class = '" + this.getClass().getName() + "'")
.query("is_delete = '0' AND task_status = " + TaskStatus.START_AND_END.value() + " AND handle_class = '" + this.getClass().getName() +
"' AND is_auto_issue = '1'")
.getResultJSONArray(0);
ArrayList<AcsTaskDTO> acs_tasks = new ArrayList<>();

9
lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/TaskType.java

@ -16,7 +16,14 @@ public enum TaskType {
CALL_MATERIAL("叫料", "2"),
SEND_EMPTY("送空", "3"),
CALL_EMPTY("叫空", "4"),
TO_PACKAGE("去包装", "5");
TO_PACKAGE("去包装", "5"),
PDA_TASK("PDA任务", "6"),
PDA_HN("人工混碾", "7"),
PDA_MATERIAL_TRANSFER("泥料转移", "8"),
PDA_PRESS_UP("压制上料", "9"),
PDA_PRESS_DOWN("压制下料", "10"),
PDA_OUT_KILN("人工出窑", "11"),
PDA_VEHICLE_TRANSFER("载具转移", "12");
private final String label;
private final String value;

4
lms/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/PointServiceImpl.java

@ -215,8 +215,8 @@ public class PointServiceImpl implements PointService {
@Override
public JSONArray getPoint(Map wherJson) {
String area_type = (String) wherJson.get("area_type");
JSONArray point_rows = WQLObject.getWQLObject("sch_base_point").query("area_type IN (" + area_type + ") AND is_used = '1' AND is_delete = '0' order by point_code").getResultJSONArray(0);
String area_type = (String) wherJson.get("region_Code");
JSONArray point_rows = WQLObject.getWQLObject("sch_base_point").query("region_Code IN ('" + area_type + "') order by point_code").getResultJSONArray(0);
return point_rows;
}

194
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/p2p/PDATask.java

@ -0,0 +1,194 @@
package org.nl.wms.sch.task.p2p;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.common.utils.SecurityUtils;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.sch.manage.*;
import org.nl.wms.sch.task.util.TaskUtils;
import org.springframework.stereotype.Component;
/**
* @Author: lyd
* @Description: 手持点对点任务类
* @Date: 2024/5/14
*/
@RequiredArgsConstructor
@Component
public class PDATask extends AbstractAcsTask {
@Override
public void updateTaskStatus(JSONObject task, String status) {
if (TaskStatus.EXECUTING.value().equals(status)) {
task.put("task_status", TaskStatus.EXECUTING.value());
TaskUtils.addACSUpdateColum(task);
WQLObject.getWQLObject("sch_base_task").update(task);
} else if (TaskStatus.FINISHED.value().equals(status)) {
this.finishTask(task, OperationType.AUTO);
} else if (TaskStatus.CANCELLED.value().equals(status)) {
this.cancelTask(task, OperationType.AUTO);
}
}
@Override
public String createTask(JSONObject form) {
JSONObject point1 = form.getJSONObject("point1");
JSONObject point2 = form.getJSONObject("point2");
JSONObject task = TaskUtils.buildTask(
"手持点对点任务",
TaskType.PDA_TASK.value(),
TaskStatus.START_AND_END.value(),
point1.getString("point_code"),
point2.getString("point_code"),
form.getLong("group_id"),
null,
form.getString("vehicle_type"),
form.getString("vehicle_code"),
8,
PDATask.class.getName(),
form.getString("create_mode"),
JSONObject.toJSONString(form),
String.valueOf(SecurityUtils.getCurrentUserId()),
SecurityUtils.getCurrentUsername()
);
point1.put("lock_type", LockType.TASK_LOCKED.value());
point1.put("task_code", task.getString("task_code"));
TaskUtils.addFormUpdateColum(point1, form);
WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
pointTable.update(point1);
point2.put("lock_type", LockType.TASK_LOCKED.value());
point2.put("task_code", task.getString("task_code"));
TaskUtils.addFormUpdateColum(point2, form);
pointTable.update(point2);
WQLObject.getWQLObject("sch_base_task").insert(task);
return task.getString("task_code");
}
@Override
public void forceFinish(String task_id) {
JSONObject task = WQLObject.getWQLObject("sch_base_task").query("task_id = " + task_id).uniqueResult(0);
if (ObjectUtil.isEmpty(task)) {
throw new BadRequestException("未找到任务!");
}
this.finishTask(task, OperationType.MANUAL);
}
@Override
public void cancel(String task_id) {
JSONObject task = WQLObject.getWQLObject("sch_base_task").query("task_id = " + task_id).uniqueResult(0);
if (ObjectUtil.isEmpty(task)) {
throw new BadRequestException("未找到任务!");
}
this.cancelTask(task, OperationType.MANUAL);
}
public void cancelTask(JSONObject task, OperationType operation_type) {
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
task.put("task_status", TaskStatus.CANCELLED.value());
if (operation_type == OperationType.AUTO) {
TaskUtils.addACSUpdateColum(task);
} else if (operation_type == OperationType.MANUAL) {
TaskUtils.addCurrentUpdateColum(task);
}
WQLObject.getWQLObject("sch_base_task").update(task);
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
String point_code1 = task.getString("point_code1");
if (StrUtil.isNotBlank(point_code1)) {
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(point1)
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
&& task.getString("task_code").equals(point1.getString("task_code"))) {
point1.put("lock_type", LockType.UNLOCKED.value());
point1.put("task_code", "");
if (operation_type == OperationType.AUTO) {
TaskUtils.addACSUpdateColum(point1);
} else if (operation_type == OperationType.MANUAL) {
TaskUtils.addCurrentUpdateColum(point1);
}
point_table.update(point1);
}
}
String point_code2 = task.getString("point_code2");
if (StrUtil.isNotBlank(point_code2)) {
JSONObject point2 = new JSONObject();
point2.put("lock_type", LockType.UNLOCKED.value());
point2.put("task_code", "");
if (operation_type == OperationType.AUTO) {
TaskUtils.addACSUpdateColum(point2);
} else if (operation_type == OperationType.MANUAL) {
TaskUtils.addCurrentUpdateColum(point2);
}
point_table.update(point2, "point_code = '" + point_code2 + "'");
}
}
}
public void finishTask(JSONObject task, OperationType operation_type) {
int current_task_status = task.getIntValue("task_status");
if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) {
if (operation_type == OperationType.MANUAL
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
}
task.put("task_status", TaskStatus.FINISHED.value());
if (operation_type == OperationType.AUTO) {
TaskUtils.addACSUpdateColum(task);
} else if (operation_type == OperationType.MANUAL) {
TaskUtils.addCurrentUpdateColum(task);
}
WQLObject.getWQLObject("sch_base_task").update(task);
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
String point_code1 = task.getString("point_code1");
if (StrUtil.isNotBlank(point_code1)) {
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
&& task.getString("task_code").equals(point1.getString("task_code"))) {
point1.put("lock_type", LockType.UNLOCKED.value());
point1.put("task_code", "");
point1.put("vehicle_type", "");
point1.put("vehicle_code", "");
point1.put("vd_id", null);
point1.put("point_status", PointStatus.EMPTY.value());
if (operation_type == OperationType.AUTO) {
TaskUtils.addACSUpdateColum(point1);
} else if (operation_type == OperationType.MANUAL) {
TaskUtils.addCurrentUpdateColum(point1);
}
point_table.update(point1);
}
}
String point_code2 = task.getString("point_code2");
if (StrUtil.isNotBlank(point_code2)) {
JSONObject point2 = new JSONObject();
point2.put("lock_type", LockType.UNLOCKED.value());
point2.put("task_code", "");
point2.put("vehicle_type", task.getString("vehicle_type"));
point2.put("vehicle_code", task.getString("vehicle_code"));
point2.put("vd_id", task.getString("group_id"));
point2.put("point_status", PointStatus.NOT_EMPTY.value());
if (operation_type == OperationType.AUTO) {
TaskUtils.addACSUpdateColum(point2);
} else if (operation_type == OperationType.MANUAL) {
TaskUtils.addCurrentUpdateColum(point2);
}
point_table.update(point2, "point_code = '" + point_code2 + "'");
}
}
}
}

15
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/HLSendMaterialTask.java

@ -81,6 +81,7 @@ public class HLSendMaterialTask extends AbstractAcsTask {
@Override
public void findNextPoint() {
WQLObject task_table = WQLObject.getWQLObject("sch_base_task");
WQLObject vdTable = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONArray tasks = task_table
.query("is_delete = '0' AND task_status = '" + TaskStatus.SURE_START.value() + "' AND handle_class = '" + HLSendMaterialTask.class.getName() + "'", "priority DESC, create_time ASC")
.getResultJSONArray(0);
@ -94,6 +95,20 @@ public class HLSendMaterialTask extends AbstractAcsTask {
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
JSONObject point2 = null;
JSONObject workorder = WQL.getWO("SEND_MATERIAL_TASK").addParam("flag", "8").addParam("vd_id", task.getString("group_id")).process().uniqueResult(0);
// 此处判断是否不需要AGV,如果不需要直接创建人工任务,todo 状态目前设置完成。。。
if ("0".equals(workorder.getString("is_auto"))) {
task.put("task_status", TaskStatus.FINISHED.value());
task.put("point_code2", "KLXNK");
task.put("remark", "");
TaskUtils.addAutoUpdateColum(task);
task_table.update(task);
// 为了库存,把点位编码设置成虚拟库
JSONObject pa = new JSONObject();
pa.put("point_code", "KLXNK");
TaskUtils.addAutoUpdateColum(pa);
vdTable.update(pa, "vd_id = '" + task.getString("group_id") + "'");
break;
}
if (ObjectUtil.isNotEmpty(point1)
&& "2".equals(point1.getString("point_type"))
&& ObjectUtil.isNotEmpty(workorder)

19
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/YZSendMaterialTask.java

@ -79,6 +79,7 @@ public class YZSendMaterialTask extends AbstractAcsTask {
@Override
public void findNextPoint() {
WQLObject task_table = WQLObject.getWQLObject("sch_base_task");
WQLObject vdTable = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONArray tasks = task_table
.query("is_delete = '0' AND task_status = '" + TaskStatus.SURE_START.value() + "' AND handle_class = '" + YZSendMaterialTask.class.getName() + "'", "priority DESC, create_time ASC")
.getResultJSONArray(0);
@ -89,6 +90,22 @@ public class YZSendMaterialTask extends AbstractAcsTask {
for (int i = 0; i < tasks.size(); i++) {
JSONObject task = tasks.getJSONObject(i);
// 获取工单
JSONObject workorder = WQL.getWO("SEND_MATERIAL_TASK").addParam("flag", "8").addParam("vd_id", task.getString("group_id")).process().uniqueResult(0);
if ("0".equals(workorder.getString("is_auto"))) {
task.put("task_status", TaskStatus.FINISHED.value());
task.put("point_code2", "YQXNK");
task.put("remark", "");
TaskUtils.addAutoUpdateColum(task);
task_table.update(task);
// 为了库存,把点位编码设置成虚拟库
JSONObject pa = new JSONObject();
pa.put("point_code", "YQXNK");
TaskUtils.addAutoUpdateColum(pa);
vdTable.update(pa, "vd_id = '" + task.getString("group_id") + "'");
break;
}
JSONObject point = WQL
.getWO("SEND_MATERIAL_TASK")
.addParam("flag", "1")
@ -185,7 +202,7 @@ public class YZSendMaterialTask extends AbstractAcsTask {
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
}
task.put("task_status", TaskStatus.FINISHED.value());
if (operation_type == OperationType.AUTO) {
TaskUtils.addACSUpdateColum(task);

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

Binary file not shown.

27
lms/nladmin-ui/src/api/groupUpdateRecord.js

@ -0,0 +1,27 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/groupUpdateRecord',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/groupUpdateRecord/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/groupUpdateRecord',
method: 'put',
data
})
}
export default { add, edit, del }

8
lms/nladmin-ui/src/api/wms/pdm/device.js

@ -77,5 +77,11 @@ export function changeActive(data) {
data
})
}
export function getYZDevice() {
return request({
url: 'api/device/getYZDevice',
method: 'post'
})
}
export default { add, edit, del, getWorkprocedure, getItemByDeviceId, copyAdd, changeActive, getAllRegions }
export default { add, edit, del, getWorkprocedure, getItemByDeviceId, copyAdd, changeActive, getAllRegions, getYZDevice }

9
lms/nladmin-ui/src/api/wms/pdm/workorder.js

@ -103,4 +103,11 @@ export function getMaterial() {
})
}
export default { add, edit, del, submits, getDevice, getTable, openStart, saveReport, finish, getReportWork, forceFinish, getDtl, getMaterial }
export function changeDevice(data) {
return request({
url: 'api/workorder/changeDevice',
method: 'post',
data
})
}
export default { add, edit, del, submits, getDevice, getTable, openStart, saveReport, finish, getReportWork, forceFinish, getDtl, getMaterial, changeDevice }

143
lms/nladmin-ui/src/views/wms/das/index.vue

@ -0,0 +1,143 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission"/>
<!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0"
:title="crud.status.title" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
<el-form-item label="组盘id">
<el-input v-model="form.group_id" style="width: 370px;"/>
</el-form-item>
<el-form-item label="载具编码">
<el-input v-model="form.vehicle_code" style="width: 370px;"/>
</el-form-item>
<el-form-item label="载具类型">
<el-input v-model="form.vehicle_type" style="width: 370px;"/>
</el-form-item>
<el-form-item label="修改内容">
<el-input v-model="form.update_type" style="width: 370px;"/>
</el-form-item>
<el-form-item label="原重量">
<el-input v-model="form.orign_weight" style="width: 370px;"/>
</el-form-item>
<el-form-item label="新重量">
<el-input v-model="form.current_weight" style="width: 370px;"/>
</el-form-item>
<el-form-item label="原数量">
<el-input v-model="form.orign_qty" style="width: 370px;"/>
</el-form-item>
<el-form-item label="新数量">
<el-input v-model="form.current_qty" style="width: 370px;"/>
</el-form-item>
<el-form-item label="修改人">
<el-input v-model="form.update_optid" style="width: 370px;"/>
</el-form-item>
<el-form-item label="修改人">
<el-input v-model="form.update_optname" style="width: 370px;"/>
</el-form-item>
<el-form-item label="修改时间">
<el-input v-model="form.update_time" style="width: 370px;"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;"
@selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55"/>
<el-table-column prop="group_id" label="组盘id" :min-width="flexWidth('group_id',crud.data,'组盘id')"/>
<el-table-column prop="vehicle_code" label="载具编码"
:min-width="flexWidth('vehicle_code',crud.data,'载具编码')"/>
<el-table-column prop="vehicle_type" label="载具类型"
:min-width="flexWidth('vehicle_type',crud.data,'载具类型')"/>
<el-table-column prop="update_type" label="修改内容"
:min-width="flexWidth('update_type',crud.data,'修改内容')"/>
<el-table-column prop="orign_weight" label="原重量" :min-width="flexWidth('orign_weight',crud.data,'原重量')"/>
<el-table-column prop="current_weight" label="新重量"
:min-width="flexWidth('current_weight',crud.data,'新重量')"/>
<el-table-column prop="orign_qty" label="原数量" :min-width="flexWidth('orign_qty',crud.data,'原数量')"/>
<el-table-column prop="current_qty" label="新数量" :min-width="flexWidth('current_qty',crud.data,'新数量')"/>
<el-table-column prop="update_optid" label="修改人" :min-width="flexWidth('update_optid',crud.data,'修改人')"/>
<el-table-column prop="update_optname" label="修改人"
:min-width="flexWidth('update_optname',crud.data,'修改人')"/>
<el-table-column prop="update_time" label="修改时间"
:min-width="flexWidth('update_time',crud.data,'修改时间')"/>
<!-- <el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">-->
<!-- <template slot-scope="scope">-->
<!-- <udOperation-->
<!-- :data="scope.row"-->
<!-- :permission="permission"-->
<!-- />-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<!--分页组件-->
<pagination/>
</div>
</div>
</template>
<script>
import CRUD, {crud, form, header, presenter} from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import crudGroupUpdateRecord from '@/api/groupUpdateRecord'
const defaultForm = {
data_id: null,
group_id: null,
vehicle_code: null,
vehicle_type: null,
update_type: null,
orign_weight: null,
current_weight: null,
orign_qty: null,
current_qty: null,
update_optid: null,
update_optname: null,
update_time: null
}
export default {
name: 'GroupUpdateRecord',
components: {pagination, crudOperation, rrOperation, udOperation},
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: '组盘信息修改记录表',
url: 'api/groupUpdateRecord',
idField: 'data_id',
sort: 'data_id,desc',
crudMethod: {...crudGroupUpdateRecord},
optShow: {
add: false,
edit: false,
del: false
}
})
},
data() {
return {
permission: {},
rules: {}
}
},
methods: {
// false
[CRUD.HOOK.beforeRefresh]() {
return true
}
}
}
</script>
<style scoped>
</style>

14
lms/nladmin-ui/src/views/wms/pdm/workerorder/hl/index.vue

@ -146,6 +146,14 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否自动呼叫AGV" prop="is_auto">
<el-radio v-model="form.is_auto" label="1"></el-radio>
<el-radio v-model="form.is_auto" label="0"></el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否加急" prop="is_urgent">
@ -310,7 +318,8 @@ const defaultForm = {
qualified_qty: '0',
unqualified_qty: '0',
region_code: null,
plan_date: null
plan_date: null,
is_auto: '1'
}
export default {
name: 'HLWorkorder',
@ -359,6 +368,9 @@ export default {
device_name: [
{ required: true, message: '生产设备不能为空', trigger: 'change' }
],
is_auto: [
{ required: true, message: '是否自动不能为空', trigger: 'blur' }
],
is_urgent: [
{ required: true, message: '是否加急不能为空', trigger: 'blur' }
],

75
lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue

@ -86,6 +86,17 @@
>
开工
</el-button>
<el-button
slot="right"
class="filter-item"
type="warning"
icon="el-icon-position"
size="mini"
:disabled="!(crud.selections[0]) || crud.selections[1]"
@click="changeDevice(crud.selections[0])"
>
工单变更
</el-button>
<el-button
slot="right"
class="filter-item"
@ -168,6 +179,14 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否自动呼叫AGV" prop="is_auto">
<el-radio v-model="form.is_auto" label="1"></el-radio>
<el-radio v-model="form.is_auto" label="0"></el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否加急" prop="is_urgent">
@ -350,11 +369,37 @@
<el-button type="primary" @click="toForceFinish">确认</el-button>
</div>
</el-dialog>
<!-- 提示对话框 -->
<el-dialog
:close-on-click-modal="false"
:visible.sync="showDeviceChoose"
title="选择设备"
width="350px"
>
<el-select
v-model="cacheOrderDevice"
placeholder="转移设备"
style="width: 300px"
filterable
>
<el-option
v-for="item in yzDeviceList"
:key="item.device_id"
:label="item.device_name"
:value="item.device_code"
/>
</el-select>
<span slot="footer" class="dialog-footer">
<el-button @click="showDeviceChoose = false">取消</el-button>
<el-button type="primary" @click="doChangeDevice">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import crudWorkorder from '@/api/wms/pdm/workorder'
import crudDevice from '@/api/wms/pdm/device'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
@ -412,11 +457,12 @@ const defaultForm = {
qualified_qty: '0',
unqualified_qty: '0',
region_code: null,
plan_date: null
plan_date: null,
is_auto: '1'
}
export default {
name: 'Produceshiftorder',
components: { pagination, crudOperation, rrOperation, udOperation, MaterDtl, ViewDialog, DeviceDialog },
components: { pagination, crudOperation, rrOperation, udOperation, MaterDtl, ViewDialog, DeviceDialog, crudDevice },
mixins: [presenter(), header(), form(defaultForm), crud()],
dicts: ['pdm_workorder_status', 'priority_direction', 'is_used', 'is_or_not', 'material_type', 'vehicle_type', 'workorder_procedure', 'true_or_false', 'wood_vehicle_type'],
cruds() {
@ -470,10 +516,17 @@ export default {
plan_date: [
{ required: true, message: '计划生产日期不能为空', trigger: 'blur' }
]
}
},
showDeviceChoose: false,
cacheOrderData: {},
cacheOrderDevice: null,
yzDeviceList: []
}
},
created() {
crudDevice.getYZDevice().then(res => {
this.yzDeviceList = res
})
},
methods: {
//
@ -545,6 +598,22 @@ export default {
this.crud.toQuery()
})
},
//
changeDevice(row) {
this.cacheOrderData = row
this.showDeviceChoose = true
},
doChangeDevice() {
//
this.cacheOrderData.new_device_code = this.cacheOrderDevice
crudWorkorder.changeDevice(this.cacheOrderData).then(res => {
this.crud.notify('工单转移成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.showDeviceChoose = false
this.cacheOrderData = {}
this.cacheOrderDevice = null
this.crud.toQuery()
})
},
downloadExcel() {
if (this.crud.query.createTime) {
this.crud.query.begin_time = this.crud.query.createTime[0]

73
lms/nladmin-ui/src/views/wms/report/back/index.vue

@ -0,0 +1,73 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column prop="vehicle_code" label="托盘号" :min-width="flexWidth('vehicle_code',crud.data,'托盘号')" />
<el-table-column prop="vehicle_type" label="托盘类型" :min-width="flexWidth('vehicle_type',crud.data,'托盘类型')">
<template slot-scope="scope">
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
</template>
</el-table-column>
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'拆垛工位')" />
<el-table-column prop="weight" label="物料重量" :min-width="flexWidth('weight',crud.data,'分拣工单')" />
<el-table-column prop="qty" label="物料数量" :min-width="flexWidth('qty',crud.data,'分拣工单')" />
<el-table-column prop="point_name" label="点位名称" :min-width="flexWidth('point_name',crud.data,'分拣工单')" />
<el-table-column prop="order_code" label="订单编码" :min-width="flexWidth('order_code',crud.data,'分拣工单')" />
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import crudPoint from '@/api/wms/sch/point'
export default {
name: 'BackMaterial',
dicts: ['vehicle_type'],
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), crud()],
cruds() {
return CRUD({
title: '虚拟库存报表',
url: 'api/report/mudMaterialReport',
optShow: {
add: false,
edit: false,
del: false,
download: false
}
})
},
data() {
return {
permission: {
},
rules: {
}
}
},
created() {
},
methods: {
// false
[CRUD.HOOK.beforeRefresh]() {
return true
}
}
}
</script>
<style scoped>
</style>

106
lms/nladmin-ui/src/views/wms/report/xn/index.vue

@ -0,0 +1,106 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="100px"
label-suffix=":"
>
<el-form-item label="虚拟库位置">
<el-select
v-model="query.point_code"
clearable
filterable
placeholder="虚拟库位置"
>
<el-option
v-for="item in regionList"
:key="item.point_id"
:label="item.point_name"
:value="item.point_code"
/>
</el-select>
</el-form-item>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column prop="vehicle_code" label="托盘号" :min-width="flexWidth('vehicle_code',crud.data,'托盘号')" />
<el-table-column prop="vehicle_type" label="托盘类型" :min-width="flexWidth('vehicle_type',crud.data,'托盘类型')">
<template slot-scope="scope">
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
</template>
</el-table-column>
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'拆垛工位')" />
<el-table-column prop="weight" label="物料重量" :min-width="flexWidth('weight',crud.data,'分拣工单')" />
<el-table-column prop="qty" label="物料数量" :min-width="flexWidth('qty',crud.data,'分拣工单')" />
<el-table-column prop="point_name" label="点位名称" :min-width="flexWidth('point_name',crud.data,'分拣工单')" />
<el-table-column prop="order_code" label="订单编码" :min-width="flexWidth('order_code',crud.data,'分拣工单')" />
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import crudPoint from '@/api/wms/sch/point'
export default {
name: 'XnShow',
dicts: ['vehicle_type'],
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), crud()],
cruds() {
return CRUD({
title: '虚拟库存报表',
url: 'api/report/queryXN',
optShow: {
add: false,
edit: false,
del: false,
download: false
}
})
},
data() {
return {
permission: {
},
rules: {
},
regionList: []
}
},
created() {
const param = {
'region_Code': 'XN'
}
crudPoint.getPoint(param).then(res => {
this.regionList = res
})
},
methods: {
// false
[CRUD.HOOK.beforeRefresh]() {
return true
}
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save