haogh 1 年之前
父节点
当前提交
997624a5dd

+ 5 - 5
sop-api/src/main/java/com/qmth/sop/server/api/DeviceDeliveryManageController.java

@@ -81,8 +81,8 @@ public class DeviceDeliveryManageController {
     @OperationLog(logType = LogTypeEnum.UPDATE)
     public Result in(@ApiParam(value = "设备发货id", required = true) @RequestParam String id,
                      @ApiParam(value = "入库方式", required = true) @RequestParam MailTypeEnum inMode,
-                     @ApiParam(value = "快递单号:入库方式-选择邮寄不能为空", required = false) @RequestParam String expressNo,
-                     @ApiParam(value = "备注:入库方式-选择其他的时候不能为空", required = false) @RequestParam String remark) {
+                     @ApiParam(value = "快递单号:入库方式-选择邮寄不能为空", required = false) @RequestParam(required = false) String expressNo,
+                     @ApiParam(value = "备注:入库方式-选择其他的时候不能为空", required = false) @RequestParam(required = false) String remark) {
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         tbDeviceDeliveryService.in(SystemConstant.convertIdToLong(id), inMode, expressNo, remark, requestUser.getId());
         return ResultUtil.ok();
@@ -94,9 +94,9 @@ public class DeviceDeliveryManageController {
     @OperationLog(logType = LogTypeEnum.UPDATE)
     public Result transfer(@ApiParam(value = "设备发货id", required = true) @RequestParam String id,
                            @ApiParam(value = "中转方式", required = true) @RequestParam MailTypeEnum transferMode,
-                           @ApiParam(value = "快递单号", required = false) @RequestParam String expressNo,
+                           @ApiParam(value = "快递单号", required = false) @RequestParam(required = false) String expressNo,
                            @ApiParam(value = "接收方单号", required = true) @RequestParam String receiveCrmNo,
-                           @ApiParam(value = "备注", required = false) @RequestParam String remark) {
+                           @ApiParam(value = "备注", required = false) @RequestParam(required = false) String remark) {
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         tbDeviceDeliveryService.transfer(SystemConstant.convertIdToLong(id), transferMode, expressNo, receiveCrmNo, remark, requestUser.getId());
         return ResultUtil.ok();
@@ -106,7 +106,7 @@ public class DeviceDeliveryManageController {
     @RequestMapping(value = "place/edit" , method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
     @OperationLog(logType = LogTypeEnum.UPDATE)
-    public Result placeEdit(@Valid @ApiParam(value = "设备去处编辑信息", required = true) @RequestBody DevicePlaceParam devicePlaceParam) {
+    public Result placeEdit(@Valid @ApiParam(value = "设备去处编辑信息", required = false) @RequestBody(required = false) DevicePlaceParam devicePlaceParam) {
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         tbDeviceDeliveryService.devicePlaceEdit(devicePlaceParam, requestUser.getId());
         return ResultUtil.ok();

+ 2 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/params/DevicePlaceParam.java

@@ -23,9 +23,11 @@ public class DevicePlaceParam {
     private Long id;
 
     @ApiModelProperty("使用方式: TRANSFER-中转,IN-入库")
+    @NotNull(message = "请选择使用方式")
     private DeviceUseStatusEnum transferStatus;
 
     @ApiModelProperty("中转方式: MAIL-邮寄,OTHER-其他")
+    @NotNull(message = "请选择中转方式")
     private MailTypeEnum transferMode;
 
     @ApiModelProperty("快递单号")

+ 10 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/DevicePlaceResult.java

@@ -41,6 +41,9 @@ public class DevicePlaceResult implements Serializable {
     @ApiModelProperty("其他运输方式说明")
     private String remark;
 
+    @ApiModelProperty("快递单号")
+    private String expressNo;
+
     public Long getId() {
         return id;
     }
@@ -121,4 +124,11 @@ public class DevicePlaceResult implements Serializable {
         this.remark = remark;
     }
 
+    public String getExpressNo() {
+        return expressNo;
+    }
+
+    public void setExpressNo(String expressNo) {
+        this.expressNo = expressNo;
+    }
 }

+ 9 - 14
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBDeviceDeliveryServiceImpl.java

@@ -840,9 +840,11 @@ public class TBDeviceDeliveryServiceImpl extends ServiceImpl<TBDeviceDeliveryMap
                     log.error(String.format("派单号crmNo:[%s],设备序列号serialNo:[%s]未有入库记录", crmNo, result.getSerialNo()));
                     continue;
                 }
-                result.setTransportMode(getTransportMode(inDeviceDelivery.getExpressNo(), inDeviceDelivery.getRemark()));
+                //result.setTransportMode(getTransportMode(inDeviceDelivery.getExpressNo(), inDeviceDelivery.getRemark()));
                 //设备是否已经被签收
                 result.setHaveSign(inDeviceDelivery.getStatus().equals(DeviceDeliveryStatusEnum.RECEIVE) ? Boolean.TRUE : Boolean.FALSE);
+                //快递单号
+                result.setExpressNo(inDeviceDelivery.getExpressNo());
             }
 
             //使用状态:中转
@@ -854,9 +856,11 @@ public class TBDeviceDeliveryServiceImpl extends ServiceImpl<TBDeviceDeliveryMap
                     continue;
                 }
                 result.setReceiveCrmNo(transferDeviceDelivery.getCrmNo());
-                result.setTransportMode(getTransportMode(transferDeviceDelivery.getExpressNo(), result.getRemark()));
+                //result.setTransportMode(getTransportMode(transferDeviceDelivery.getExpressNo(), result.getRemark()));
                 //设备是否已经被签收
                 result.setHaveSign(result.getStatus().equals(DeviceDeliveryStatusEnum.TRANSFER_SIGN) ? Boolean.TRUE : Boolean.FALSE);
+                //快递单号
+                result.setExpressNo(transferDeviceDelivery.getExpressNo());
             }
 
         }
@@ -877,7 +881,7 @@ public class TBDeviceDeliveryServiceImpl extends ServiceImpl<TBDeviceDeliveryMap
                         .eq(TBDeviceDelivery::getDeliveryType, InOutTypeEnum.IN));
         if (existDeviceDelivery != null) {
             this.update(new UpdateWrapper<TBDeviceDelivery>().lambda().set(TBDeviceDelivery::getExpressNo, expressNo)
-                    .set(TBDeviceDelivery::getStatus, DeviceDeliveryStatusEnum.IN)
+                    .set(TBDeviceDelivery::getStatus, DeviceDeliveryStatusEnum.DELIVER)
                     .set(TBDeviceDelivery::getDeliverTime, System.currentTimeMillis()).set(TBDeviceDelivery::getDeliverUserId, userId)
                     .set(TBDeviceDelivery::getUpdateId, userId).set(TBDeviceDelivery::getUpdateTime, System.currentTimeMillis())
                     .set(TBDeviceDelivery::getDeviceStatus, deviceDelivery.getDeviceStatus()).set(TBDeviceDelivery::getRemark, remark)
@@ -918,8 +922,7 @@ public class TBDeviceDeliveryServiceImpl extends ServiceImpl<TBDeviceDeliveryMap
             throw ExceptionResultEnum.ERROR.exception("使用中的设备才能进行中转");
         }
         TBCrm crm = tbCrmService.getOne(
-                new QueryWrapper<TBCrm>().lambda().eq(TBCrm::getCrmNo, receiveCrmNo).eq(TBCrm::getEnable, Boolean.TRUE)
-                        .last(SystemConstant.LIMIT1));
+                new QueryWrapper<TBCrm>().lambda().eq(TBCrm::getCrmNo, receiveCrmNo).eq(TBCrm::getEnable, Boolean.TRUE));
         if (Objects.isNull(crm)) {
             throw ExceptionResultEnum.ERROR.exception(String.format("接受方单号[%s]不存在", receiveCrmNo));
         }
@@ -1055,6 +1058,7 @@ public class TBDeviceDeliveryServiceImpl extends ServiceImpl<TBDeviceDeliveryMap
         newDeviceDelivery.setEffect(Boolean.TRUE);
         newDeviceDelivery.setDeviceStatus(existDeviceDelivery.getDeviceStatus());
         newDeviceDelivery.setRemark(remark);
+        newDeviceDelivery.setSourceId(existDeviceDelivery.getId());
         save(newDeviceDelivery);
     }
 
@@ -1094,15 +1098,6 @@ public class TBDeviceDeliveryServiceImpl extends ServiceImpl<TBDeviceDeliveryMap
         return existDeviceDelivery;
     }
 
-    private @NotNull String getTransportMode(String expressNo, String remark) {
-        String transportMode;
-        if (StringUtils.isNotEmpty(expressNo)) {
-            transportMode = MailTypeEnum.MAIL.getTitle() + "-" + expressNo;
-        } else {
-            transportMode = MailTypeEnum.OTHER.getTitle() + "-" + ((StringUtils.isEmpty(remark)) ? "" : remark);
-        }
-        return transportMode;
-    }
 
     /**
      * 补充结果信息

+ 2 - 1
sop-business/src/main/resources/mapper/TBDeviceDeliveryMapper.xml

@@ -224,7 +224,8 @@
             sd.STATUS deviceStatus,
             sp.NAME supplierName,
             d.STATUS,
-            d.remark
+            d.remark,
+            d.mail_type transportMode
         FROM
             t_b_device_delivery d,
             sys_device sd,