Procházet zdrojové kódy

fix: 设备发货管理增加搜索条件

caozixuan před 1 rokem
rodič
revize
95121e8248

+ 11 - 7
sop-api/src/main/java/com/qmth/sop/server/api/TBDeviceDeliveryController.java

@@ -11,10 +11,7 @@ import com.qmth.sop.business.entity.TBDeviceDelivery;
 import com.qmth.sop.business.service.TBDeviceDeliveryService;
 import com.qmth.sop.common.annotation.OperationLog;
 import com.qmth.sop.common.contant.SystemConstant;
-import com.qmth.sop.common.enums.DeviceDeliveryStatusEnum;
-import com.qmth.sop.common.enums.DeviceUsageTypeEnum;
-import com.qmth.sop.common.enums.ExceptionResultEnum;
-import com.qmth.sop.common.enums.LogTypeEnum;
+import com.qmth.sop.common.enums.*;
 import com.qmth.sop.common.util.Result;
 import com.qmth.sop.common.util.ResultUtil;
 import com.qmth.sop.common.util.ServletUtil;
@@ -61,13 +58,17 @@ public class TBDeviceDeliveryController {
             @ApiParam(value = "签收开始时间") @RequestParam(required = false) Long receiveStartTime, @ApiParam(value = "签收结束时间") @RequestParam(required = false) Long receiveEndTime,
             @ApiParam(value = "收件人") @RequestParam(required = false) String consignee,
             @ApiParam(value = "邮寄地址") @RequestParam(required = false) String mailingAddress,
+            @ApiParam(value = "出入库状态") @RequestParam(required = false) InOutTypeEnum deliveryType,
+            @ApiParam(value = "品牌") @RequestParam(required = false) String brand,
+            @ApiParam(value = "型号") @RequestParam(required = false) String model,
+            @ApiParam(value = "快递单号") @RequestParam(required = false) String expressNo,
             @ApiParam(value = "页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
             @ApiParam(value = "页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize)
             throws Exception {
         return ResultUtil.ok(tbDeviceDeliveryService.page(new Page<>(pageNumber, pageSize), SystemConstant.convertIdToLong(serviceId),
                 usageType, crmNo, status, SystemConstant.convertIdToLong(deliverUserId), deliverStartTime, deliverEndTime,
                 serialNo, deviceNo, SystemConstant.convertIdToLong(supplierId), receiveStartTime, receiveEndTime,
-                consignee, mailingAddress));
+                consignee, mailingAddress, deliveryType, brand, model, expressNo));
     }
 
     @ApiOperation(value = "设备发货保存接口")
@@ -129,10 +130,13 @@ public class TBDeviceDeliveryController {
             @ApiParam(value = "设备编号") @RequestParam(required = false) String deviceNo, @ApiParam(value = "供应商id") @RequestParam(required = false) Long supplierId,
             @ApiParam(value = "签收开始时间") @RequestParam(required = false) Long receiveStartTime, @ApiParam(value = "签收结束时间") @RequestParam(required = false) Long receiveEndTime,
             @ApiParam(value = "收件人") @RequestParam(required = false) String consignee,
-            @ApiParam(value = "邮寄地址") @RequestParam(required = false) String mailingAddress) throws Exception {
+            @ApiParam(value = "邮寄地址") @RequestParam(required = false) String mailingAddress, @ApiParam(value = "出入库状态") @RequestParam(required = false) InOutTypeEnum deliveryType,
+            @ApiParam(value = "品牌") @RequestParam(required = false) String brand,
+            @ApiParam(value = "型号") @RequestParam(required = false) String model,
+            @ApiParam(value = "快递单号") @RequestParam(required = false) String expressNo) throws Exception {
         tbDeviceDeliveryService.dataExport(serviceId, usageType, crmNo, status, deliverUserId, deliverStartTime,
                 deliverEndTime, serialNo, deviceNo, supplierId, receiveStartTime, receiveEndTime, consignee,
-                mailingAddress);
+                mailingAddress, deliveryType, brand, model, expressNo);
     }
 
     @ApiOperation(value = "设备发货人列表查询")

+ 15 - 2
sop-business/src/main/java/com/qmth/sop/business/mapper/TBDeviceDeliveryMapper.java

@@ -6,6 +6,7 @@ import com.qmth.sop.business.bean.result.TBDeviceDeliveryResult;
 import com.qmth.sop.business.entity.TBDeviceDelivery;
 import com.qmth.sop.common.enums.DeviceDeliveryStatusEnum;
 import com.qmth.sop.common.enums.DeviceUsageTypeEnum;
+import com.qmth.sop.common.enums.InOutTypeEnum;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -39,13 +40,19 @@ public interface TBDeviceDeliveryMapper extends BaseMapper<TBDeviceDelivery> {
      * @param receiveEndTime   receiveEndTime
      * @param consignee        consignee
      * @param mailingAddress   mailingAddress
+     * @param deliveryType     deliveryType
+     * @param brand            brand
+     * @param model            model
+     * @param expressNo        expressNo
      * @return 查询结果
      */
     IPage<TBDeviceDeliveryResult> page(IPage<TBDeviceDeliveryResult> iPage, @Param("serviceId") Long serviceId, @Param("usageType") DeviceUsageTypeEnum usageType,
             @Param("crmNo") String crmNo, @Param("status") DeviceDeliveryStatusEnum status, @Param("deliverUserId") Long deliverUserId,
             @Param("deliverStartTime") Long deliverStartTime, @Param("deliverEndTime") Long deliverEndTime, @Param("serialNo") String serialNo,
             @Param("deviceNo") String deviceNo, @Param("supplierId") Long supplierId, @Param("receiveStartTime") Long receiveStartTime,
-            @Param("receiveEndTime") Long receiveEndTime, @Param("consignee") String consignee, @Param("mailingAddress") String mailingAddress);
+            @Param("receiveEndTime") Long receiveEndTime, @Param("consignee") String consignee, @Param("mailingAddress") String mailingAddress,
+            @Param("deliveryType") InOutTypeEnum deliveryType, @Param("brand") String brand, @Param("model") String model,
+            @Param("expressNo") String expressNo);
 
     /**
      * 设备发货列表查询
@@ -62,11 +69,17 @@ public interface TBDeviceDeliveryMapper extends BaseMapper<TBDeviceDelivery> {
      * @param supplierId       supplierId
      * @param consignee        consignee
      * @param mailingAddress   mailingAddress
+     * @param deliveryType     deliveryType
+     * @param brand            brand
+     * @param model            model
+     * @param expressNo        expressNo
      * @return 查询结果
      */
     List<TBDeviceDeliveryResult> list(@Param("serviceId") Long serviceId, @Param("usageType") DeviceUsageTypeEnum usageType,
             @Param("crmNo") String crmNo, @Param("status") DeviceDeliveryStatusEnum status, @Param("deliverUserId") Long deliverUserId,
             @Param("deliverStartTime") Long deliverStartTime, @Param("deliverEndTime") Long deliverEndTime, @Param("serialNo") String serialNo,
             @Param("deviceNo") String deviceNo, @Param("supplierId") Long supplierId, @Param("receiveStartTime") Long receiveStartTime,
-            @Param("receiveEndTime") Long receiveEndTime, @Param("consignee") String consignee, @Param("mailingAddress") String mailingAddress);
+            @Param("receiveEndTime") Long receiveEndTime, @Param("consignee") String consignee, @Param("mailingAddress") String mailingAddress,
+            @Param("deliveryType") InOutTypeEnum deliveryType, @Param("brand") String brand, @Param("model") String model,
+            @Param("expressNo") String expressNo);
 }

+ 19 - 3
sop-business/src/main/java/com/qmth/sop/business/service/TBDeviceDeliveryService.java

@@ -10,6 +10,7 @@ import com.qmth.sop.business.entity.SysUser;
 import com.qmth.sop.business.entity.TBDeviceDelivery;
 import com.qmth.sop.common.enums.DeviceDeliveryStatusEnum;
 import com.qmth.sop.common.enums.DeviceUsageTypeEnum;
+import com.qmth.sop.common.enums.InOutTypeEnum;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
@@ -58,11 +59,16 @@ public interface TBDeviceDeliveryService extends IService<TBDeviceDelivery> {
      * @param receiveEndTime    验收结束时间
      * @param consignee         收件人
      * @param mailingAddress    收件地址
+     * @param deliveryType      出入库状态
+     * @param brand             品牌
+     * @param model             型号
+     * @param expressNo         快递单号
      * @return 分页结果
      */
     IPage<TBDeviceDeliveryResult> page(IPage<TBDeviceDeliveryResult> iPage, Long serviceId, DeviceUsageTypeEnum usageType, String crmNo,
             DeviceDeliveryStatusEnum status, Long deliverUserId, Long deliveryStartTime, Long deliveryEndTime, String serialNo, String deviceNo, Long supplierId,
-            Long receiveStartTime, Long receiveEndTime, String consignee, String mailingAddress) throws Exception;
+            Long receiveStartTime, Long receiveEndTime, String consignee, String mailingAddress,
+            InOutTypeEnum deliveryType, String brand, String model, String expressNo) throws Exception;
 
     /**
      * 设备发货管理列表
@@ -81,11 +87,16 @@ public interface TBDeviceDeliveryService extends IService<TBDeviceDelivery> {
      * @param receiveEndTime    验收结束时间
      * @param consignee         收件人
      * @param mailingAddress    收件地址
+     * @param deliveryType      出入库状态
+     * @param brand             品牌
+     * @param model             型号
+     * @param expressNo         快递单号
      * @return 分页结果
      */
     List<TBDeviceDeliveryResult> list(Long serviceId, DeviceUsageTypeEnum usageType, String crmNo,
             DeviceDeliveryStatusEnum status, Long deliverUserId, Long deliveryStartTime, Long deliveryEndTime,
-            String serialNo, String deviceNo, Long supplierId, Long receiveStartTime, Long receiveEndTime, String consignee, String mailingAddress) throws Exception;
+            String serialNo, String deviceNo, Long supplierId, Long receiveStartTime, Long receiveEndTime, String consignee, String mailingAddress,
+            InOutTypeEnum deliveryType, String brand, String model, String expressNo) throws Exception;
 
     /**
      * 设备发货管理导出
@@ -104,10 +115,15 @@ public interface TBDeviceDeliveryService extends IService<TBDeviceDelivery> {
      * @param receiveEndTime    验收结束时间分页结果
      * @param consignee         收件人
      * @param mailingAddress    收件地址
+     * @param deliveryType      出入库状态
+     * @param brand             品牌
+     * @param model             型号
+     * @param expressNo         快递单号
      */
     void dataExport(Long serviceId, DeviceUsageTypeEnum usageType, String crmNo, DeviceDeliveryStatusEnum status,
             Long deliverUserId, Long deliveryStartTime, Long deliveryEndTime, String serialNo, String deviceNo,
-            Long supplierId, Long receiveStartTime, Long receiveEndTime, String consignee, String mailingAddress) throws Exception;
+            Long supplierId, Long receiveStartTime, Long receiveEndTime, String consignee, String mailingAddress,
+            InOutTypeEnum deliveryType, String brand, String model, String expressNo) throws Exception;
 
     /**
      * 新增设备发货入库记录

+ 15 - 7
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBDeviceDeliveryServiceImpl.java

@@ -229,12 +229,16 @@ public class TBDeviceDeliveryServiceImpl extends ServiceImpl<TBDeviceDeliveryMap
     @Override
     public IPage<TBDeviceDeliveryResult> page(IPage<TBDeviceDeliveryResult> iPage, Long serviceId, DeviceUsageTypeEnum usageType,
             String crmNo, DeviceDeliveryStatusEnum status, Long deliverUserId, Long deliveryStartTime, Long deliveryEndTime, String serialNo, String deviceNo, Long supplierId,
-            Long receiveStartTime, Long receiveEndTime, String consignee, String mailingAddress) throws Exception {
+            Long receiveStartTime, Long receiveEndTime, String consignee, String mailingAddress, InOutTypeEnum deliveryType, String brand, String model, String expressNo) throws Exception {
         crmNo = SystemConstant.translateSpecificSign(crmNo);
         serialNo = SystemConstant.translateSpecificSign(serialNo);
         deviceNo = SystemConstant.translateSpecificSign(deviceNo);
         consignee = SystemConstant.translateSpecificSign(consignee);
         mailingAddress = SystemConstant.translateSpecificSign(mailingAddress);
+        brand = SystemConstant.translateSpecificSign(brand);
+        model = SystemConstant.translateSpecificSign(model);
+        expressNo = SystemConstant.translateSpecificSign(expressNo);
+
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionDto dpr = sysUserService.buildUserDataPermission(requestUser.getId());
         if (dpr.getHasDeviceDelivery() && !dpr.getHasAdmin() && !dpr.getHasPmo() && !dpr.getHasBusiness()
@@ -248,7 +252,7 @@ public class TBDeviceDeliveryServiceImpl extends ServiceImpl<TBDeviceDeliveryMap
         }
         IPage<TBDeviceDeliveryResult> page = this.baseMapper.page(iPage, serviceId, usageType, crmNo, status,
                 deliverUserId, deliveryStartTime, deliveryEndTime, serialNo, deviceNo, supplierId, receiveStartTime,
-                receiveEndTime, consignee, mailingAddress);
+                receiveEndTime, consignee, mailingAddress, deliveryType, brand, model, expressNo);
         for (TBDeviceDeliveryResult e : page.getRecords()) {
             this.fillResultInfo(e);
         }
@@ -258,14 +262,17 @@ public class TBDeviceDeliveryServiceImpl extends ServiceImpl<TBDeviceDeliveryMap
     @Override
     public List<TBDeviceDeliveryResult> list(Long serviceId, DeviceUsageTypeEnum usageType, String crmNo,
             DeviceDeliveryStatusEnum status, Long deliverUserId, Long deliveryStartTime, Long deliveryEndTime,
-            String serialNo, String deviceNo, Long supplierId, Long receiveStartTime, Long receiveEndTime, String consignee, String mailingAddress)
-            throws Exception {
+            String serialNo, String deviceNo, Long supplierId, Long receiveStartTime, Long receiveEndTime, String consignee, String mailingAddress,
+            InOutTypeEnum deliveryType, String brand, String model, String expressNo) throws Exception {
 
         crmNo = SystemConstant.translateSpecificSign(crmNo);
         serialNo = SystemConstant.translateSpecificSign(serialNo);
         deviceNo = SystemConstant.translateSpecificSign(deviceNo);
         consignee = SystemConstant.translateSpecificSign(consignee);
         mailingAddress = SystemConstant.translateSpecificSign(mailingAddress);
+        brand = SystemConstant.translateSpecificSign(brand);
+        model = SystemConstant.translateSpecificSign(model);
+        expressNo = SystemConstant.translateSpecificSign(expressNo);
 
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionDto dpr = sysUserService.buildUserDataPermission(requestUser.getId());
@@ -280,7 +287,7 @@ public class TBDeviceDeliveryServiceImpl extends ServiceImpl<TBDeviceDeliveryMap
         }
         List<TBDeviceDeliveryResult> result = this.baseMapper.list(serviceId, usageType, crmNo, status, deliverUserId,
                 deliveryStartTime, deliveryEndTime, serialNo, deviceNo, supplierId, receiveStartTime, receiveEndTime,
-                consignee, mailingAddress);
+                consignee, mailingAddress, deliveryType, brand, model, expressNo);
         for (TBDeviceDeliveryResult e : result) {
             this.fillResultInfo(e);
         }
@@ -290,11 +297,12 @@ public class TBDeviceDeliveryServiceImpl extends ServiceImpl<TBDeviceDeliveryMap
     @Override
     public void dataExport(Long serviceId, DeviceUsageTypeEnum usageType, String crmNo, DeviceDeliveryStatusEnum status,
             Long deliverUserId, Long deliveryStartTime, Long deliveryEndTime, String serialNo, String deviceNo,
-            Long supplierId, Long receiveStartTime, Long receiveEndTime, String consignee, String mailingAddress) throws Exception {
+            Long supplierId, Long receiveStartTime, Long receiveEndTime, String consignee, String mailingAddress,
+            InOutTypeEnum deliveryType, String brand, String model, String expressNo) throws Exception {
 
         List<TBDeviceDeliveryResult> datasource = this.list(serviceId, usageType, crmNo, status, deliverUserId,
                 deliveryStartTime, deliveryEndTime, serialNo, deviceNo, supplierId, receiveStartTime, receiveEndTime,
-                consignee, mailingAddress);
+                consignee, mailingAddress, deliveryType, brand, model, expressNo);
         File fileTemp = null;
         try {
             fileTemp = SystemConstant.getFileTempVar(SystemConstant.XLSX_PREFIX);

+ 24 - 0
sop-business/src/main/resources/mapper/TBDeviceDeliveryMapper.xml

@@ -80,6 +80,18 @@
             <if test="mailingAddress != null and mailingAddress != ''">
                 AND tbdd.mailing_address LIKE CONCAT('%',#{mailingAddress},'%')
             </if>
+            <if test="deliveryType != null">
+                AND tbdd.delivery_type = #{deliveryType}
+            </if>
+            <if test="brand != null and brand != ''">
+                AND sd.brand LIKE CONCAT('%',#{brand},'%')
+            </if>
+            <if test="model != null and model != ''">
+                AND sd.model LIKE CONCAT('%',#{model},'%')
+            </if>
+            <if test="expressNo != null and expressNo != ''">
+                AND tbdd.express_no LIKE CONCAT('%',#{express_no},'%')
+            </if>
         </where>
         ORDER BY tbdd.update_time DESC
     </select>
@@ -162,6 +174,18 @@
             <if test="mailingAddress != null and mailingAddress != ''">
                 AND tbdd.mailing_address LIKE CONCAT('%',#{mailingAddress},'%')
             </if>
+            <if test="deliveryType != null">
+                AND tbdd.delivery_type = #{deliveryType}
+            </if>
+            <if test="brand != null and brand != ''">
+                AND sd.brand LIKE CONCAT('%',#{brand},'%')
+            </if>
+            <if test="model != null and model != ''">
+                AND sd.model LIKE CONCAT('%',#{model},'%')
+            </if>
+            <if test="expressNo != null and expressNo != ''">
+                AND tbdd.express_no LIKE CONCAT('%',#{express_no},'%')
+            </if>
         </where>
         ORDER BY tbdd.update_time DESC
     </select>