diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfo.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfo.java index 1636215..2b529de 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfo.java +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfo.java @@ -15,7 +15,7 @@ import java.time.LocalDateTime; *

* * @author mt - * @since 2021-12-09 + * @since 2021-12-15 */ @Data @EqualsAndHashCode(callSuper = false) @@ -73,7 +73,7 @@ public class OrderInfo extends Model { private Integer orderSource; /** - * 状态: 0等待执行,1执行中,2执行完成,3追加后完成(追加后就按完成来算) + * 状态: 0等待执行,1执行中,2执行完成 */ @TableField("status") private Integer status; @@ -186,6 +186,12 @@ public class OrderInfo extends Model { @TableField("orther_b") private String ortherB; + /** + * 是否作废 1:正常 0:作废 + */ + @TableField("order_void") + private Integer orderVoid; + public static final String ID = "id"; @@ -241,6 +247,8 @@ public class OrderInfo extends Model { public static final String ORTHER_B = "orther_b"; + public static final String ORDER_VOID = "order_void"; + @Override protected Serializable pkVal() { return this.id; diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfoHis.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfoHis.java index 4c599ec..b6451bf 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfoHis.java +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfoHis.java @@ -15,7 +15,7 @@ import java.time.LocalDateTime; *

* * @author mt - * @since 2021-12-09 + * @since 2021-12-15 */ @Data @EqualsAndHashCode(callSuper = false) @@ -73,7 +73,7 @@ public class OrderInfoHis extends Model { private Integer orderSource; /** - * 状态: 0等待执行,1执行中,2执行完成,3追加后完成(追加后就按完成来算) + * 状态: 0等待执行,1执行中,2执行完成 */ @TableField("status") private Integer status; @@ -162,6 +162,12 @@ public class OrderInfoHis extends Model { @TableField("quantity") private Float quantity; + /** + * 是否作废 0:正常 ,1:作废 + */ + @TableField("order_void") + private Integer orderVoid; + public static final String ID = "id"; @@ -209,6 +215,8 @@ public class OrderInfoHis extends Model { public static final String QUANTITY = "quantity"; + public static final String ORDER_VOID = "order_void"; + @Override protected Serializable pkVal() { return this.id; diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoHisMapper.xml b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoHisMapper.xml index 352684c..504eb1f 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoHisMapper.xml +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoHisMapper.xml @@ -27,13 +27,14 @@ + id, valid, create_time, creator_id, updater_id, update_time, version, order_source, status, inter_code, code, order_no, old_order_no, iden_card_num, customer_no, customer_name, product_name, product_model, material_des, - craft_ill, unit, weight, quantity + craft_ill, unit, weight, quantity, order_void diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoMapper.xml b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoMapper.xml index 1131b73..67ba66b 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoMapper.xml +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoMapper.xml @@ -31,13 +31,14 @@ + id, valid, create_time, creator_id, updater_id, update_time, version, order_source, status, inter_code, code, order_no, old_order_no, iden_card_num, customer_no, customer_name, product_name, product_model, material_des, - craft_ill, unit, weight, quantity, add_a, add_b, orther_a, orther_b + craft_ill, unit, weight, quantity, add_a, add_b, orther_a, orther_b, order_void diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java index ee4d446..b6f5534 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java @@ -53,11 +53,11 @@ public class ApmsController extends BaseController { static String ApiAddress = "http://59.110.171.25:9010"; @PostMapping(value = "apmsPostOrder") - @ApiOperation(value = "接收APMS推送订单信息") + @ApiOperation(value = "WMS接收APMS推送订单信息") public R apmsPostOrder(@Validated @RequestBody OrderParamForApms apmsPostOrderParam) { CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); - communicationLog.setLogName("WMS接收APMS订单"); + communicationLog.setLogName("WMS接收APMS推送订单信息"); communicationLog.setContent(apmsPostOrderParam.toString()); communicationLog.setType(3); setCommonField(communicationLog); @@ -66,11 +66,11 @@ public class ApmsController extends BaseController { } @PostMapping(value = "apmsVoidOrder") - @ApiOperation(value = "APMS通知WMS作废订单") + @ApiOperation(value = "WMS接收APMS作废订单信息") public R apmsVoidOrder(@Validated @RequestBody String idenCardNum) { CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); - communicationLog.setLogName("APMS通知WMS作废订单"); + communicationLog.setLogName("WMS接收APMS作废订单信息"); communicationLog.setType(3); communicationLog.setContent(idenCardNum); setCommonField(communicationLog); @@ -79,11 +79,11 @@ public class ApmsController extends BaseController { } @PostMapping(value = "apmsCompleteOrder") - @ApiOperation(value = "APMS返回加工单检验结果") + @ApiOperation(value = "WMS接收APMS加工单检验结果") public R apmsCompleteOrder(@Validated @RequestBody ApmsCompleteOrder apmsCompleteOrder) { CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); - communicationLog.setLogName("APMS返回WMS加工单检验结果"); + communicationLog.setLogName("WMS接收APMS加工单检验结果"); communicationLog.setType(3); communicationLog.setContent(apmsCompleteOrder.toString()); setCommonField(communicationLog); @@ -208,7 +208,7 @@ public class ApmsController extends BaseController { } @PostMapping(value = "getStoveCodeByWorkShopCode") - @ApiOperation(value = "APMS通过车间编码获取炉号信息") + @ApiOperation(value = "WMS通过APMS使用车间编码获取炉号信息") public R getStoveCodeByWorkShopCode(String workShopCode) { checkToken(); HashMap paramMap = new HashMap<>(); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java index 189f789..b08f638 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java @@ -118,9 +118,8 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService setCommonField(taskHis); //将主任务放入到历史表,清空id,防止重复 R save = taskHisService.save(taskHis); - byId.setValid(0); byId.setStatus(2); - currTaskServiceBiz.updateById(byId); + currTaskServiceBiz.removeById(byId); List taskDetailsByMainId = currTaskDetService.getTaskDetailsByMainId(IdParam.builder().id(byId.getId()).build()); List taskDetHis = com.mt.wms.core.utils.BeanUtils.copyList(taskDetailsByMainId, TaskDetHis.class); taskDetHis.forEach(detHis -> { diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java index b595e36..cb9d1dd 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java @@ -98,7 +98,6 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic QueryWrapper wrapper = new QueryWrapper<>(); wrapper.like(StringUtils.isNotBlank(param.getIdenCardNum()), OrderInfo.IDEN_CARD_NUM, param.getIdenCardNum()) .like(StringUtils.isNotBlank(param.getOrderNo()), OrderInfo.ORDER_NO, param.getOrderNo()) - .eq(OrderInfo.VALID, 1) .orderByDesc(OrderInfo.CREATE_TIME); Page page = orderInfoService.page(new Page<>(param.getCurrent(), param.getSize()), wrapper); PageVo orderInfoVoPageVo = new PageVo<>(page, OrderInfoVo.class); @@ -130,6 +129,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic @Override public R getOne(IdParam idParam) { OrderInfo byId = orderInfoService.getById(idParam.getId()); + Assert.notNull("未找到订单信息。", byId); OrderInfoVo build = OrderInfoVo.builder().build(); BeanUtils.copyProperties(byId, build); R info = getTaskInfoByIdenCardNum(build.getIdenCardNum()); @@ -150,7 +150,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic public R> getTaskInfo(OrderInfoTaskDetParam param) { //从任务详细中获取该标识卡和订单的所有订单 PageVo currOrderCurrTask = currTaskDetService.getCurrOrderCurrTask(param); - Assert.gtZero(currOrderCurrTask.getRecords().size(),"该订单暂无详细记录。"); + Assert.notNull("该订单暂无详细任务记录。", currOrderCurrTask.getRecords()); //获取车辆信息 R> vehicle = vehicleService.list(new VehicleQueryParam()); Map> collect = vehicle.getData().stream().collect(Collectors.groupingBy(VehicleVo::getId)); @@ -237,11 +237,9 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic @Override public R completeOrder(IdParam idParam) { OrderInfo byId = orderInfoService.getById(idParam.getId()); - byId.setValid(0); byId.setStatus(2); - orderInfoService.updateById(byId); + orderInfoService.removeById(byId); byId.setId(null); - byId.setValid(1); byId.setInterCode(IDGenerator.gen("DDHIS", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "ORDER_HIS_CODE")); setCommonField(byId); orderInfoHisService.save(byId); @@ -251,8 +249,9 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic @Override public R voidOrder(IdParam idParam) { OrderInfo byId = orderInfoService.getById(idParam.getId()); + Assert.notNull("未找到订单信息。", byId); byId.setUpdateTime(LocalDateTime.now()); - byId.setValid(0); + byId.setOrderVoid(0); orderInfoService.updateById(byId); return successful("成功,订单状态置为作废。"); } @@ -286,6 +285,6 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic one.setUpdateTime(LocalDateTime.now()); apmsCheckResultServiceBiz.save(one); //订单不应该在该地方完成,额外提供一个完成接口供人工完成,不通知apms - return successful("任务执行完成。"); + return successful("接收检验结果成功。"); } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java index 91229aa..2814021 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java @@ -30,13 +30,8 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo { private Long id; @ApiModelProperty(value = "订单状态") - private Integer valid; + private Integer orderVoid; - /** - * 来源:1.APMS 2.人工输入 - */ - @ApiModelProperty(value = "订单来源") - private Integer orderSource; /** * 添加时间,每次修改记录要更新记录新增时间 */ @@ -49,7 +44,7 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo { @ApiModelProperty(value = "修改时间") private LocalDateTime updateTime; /** - * 状态: 0等待执行,1执行中,2执行完成,3追加后完成(追加后就按完成来算) + * 状态: 0等待执行,1执行中,2执行完成 */ @ApiModelProperty(value = "状态") private Integer status;