Browse Source

Merge remote-tracking branch 'origin/dev_v1.0.0' into dev_v1.0.0

wangliang 1 năm trước cách đây
mục cha
commit
3879043d83

+ 2 - 1
sop-api/src/main/java/com/qmth/sop/server/api/SysDeviceController.java

@@ -63,12 +63,13 @@ public class SysDeviceController {
                 @ApiParam(value = "品牌", required = false) @RequestParam(required = false) String brand,
                 @ApiParam(value = "型号", required = false) @RequestParam(required = false) String model,
                 @ApiParam(value = "设备编号", required = false) @RequestParam(required = false) String deviceCode,
+                @ApiParam(value = "设备序列号", required = false) @RequestParam(required = false) String serialNo,
                 @ApiParam(value = "运行状态", required = false) @RequestParam(required = false) DeviceStatusEnum status,
                 @ApiParam(value = "出库/入库", required = false) @RequestParam(required = false) InOutTypeEnum bound,
                 @ApiParam(value = "启用/禁用", required = false) @RequestParam(required = false) Boolean enable,
                 @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) {
-        IPage<SysDeviceResult> resultIPage = sysDeviceService.query(new Page<>(pageNumber, pageSize),supplierId,brand,model,deviceCode,status,bound,enable);
+        IPage<SysDeviceResult> resultIPage = sysDeviceService.query(new Page<>(pageNumber, pageSize),supplierId,brand,model,deviceCode,serialNo,status,bound,enable);
 
         return ResultUtil.ok(resultIPage);
     }

+ 6 - 6
sop-business/src/main/java/com/qmth/sop/business/bean/params/DeviceInOutForm.java

@@ -13,8 +13,8 @@ import java.util.List;
  */
 public class DeviceInOutForm implements Serializable {
 
-    @ApiModelProperty("设备号")
-    private String deviceNo;
+    @ApiModelProperty("设备序列号")
+    private String serialNo;
 
     @ApiModelProperty("设备品牌")
     private String deviceBrand;
@@ -40,12 +40,12 @@ public class DeviceInOutForm implements Serializable {
     @ApiModelProperty("快递单拍照")
     private String basePhotoPath;
 
-    public String getDeviceNo() {
-        return deviceNo;
+    public String getSerialNo() {
+        return serialNo;
     }
 
-    public void setDeviceNo(String deviceNo) {
-        this.deviceNo = deviceNo;
+    public void setSerialNo(String serialNo) {
+        this.serialNo = serialNo;
     }
 
     public String getDeviceBrand() {

+ 1 - 1
sop-business/src/main/java/com/qmth/sop/business/mapper/SysDeviceMapper.java

@@ -25,5 +25,5 @@ public interface SysDeviceMapper extends BaseMapper<SysDevice> {
 	 * @return
 	 */
 
-	IPage<SysDeviceResult> query(IPage<Map> iPage,@Param("supplierId")  Long supplierId,@Param("brand")  String brand,@Param("model")  String model,@Param("deviceCode")  String deviceCode,@Param("status")  String status,@Param("bound")  String bound,@Param("enable")  Boolean enable);
+	IPage<SysDeviceResult> query(IPage<Map> iPage,@Param("supplierId")  Long supplierId,@Param("brand")  String brand,@Param("model")  String model,@Param("deviceCode")  String deviceCode,@Param("serialNo")  String serialNo,@Param("status")  String status,@Param("bound")  String bound,@Param("enable")  Boolean enable);
 }

+ 1 - 1
sop-business/src/main/java/com/qmth/sop/business/service/SysDeviceService.java

@@ -27,7 +27,7 @@ public interface SysDeviceService extends IService<SysDevice>{
     * @param iPage
     * @return
     */
-    IPage<SysDeviceResult> query(IPage<Map> iPage, Long supplierId, String brand, String model, String deviceCode, DeviceStatusEnum status, InOutTypeEnum bound, Boolean enable);
+    IPage<SysDeviceResult> query(IPage<Map> iPage, Long supplierId, String brand, String model, String deviceCode,String serialNo, DeviceStatusEnum status, InOutTypeEnum bound, Boolean enable);
 
     /**
     * 新增修改设备配置表

+ 9 - 2
sop-business/src/main/java/com/qmth/sop/business/service/impl/SysDeviceServiceImpl.java

@@ -10,6 +10,7 @@ import com.qmth.sop.business.entity.SysDevice;
 import com.qmth.sop.business.entity.SysUser;
 import com.qmth.sop.business.mapper.SysDeviceMapper;
 import com.qmth.sop.business.service.SysDeviceService;
+import com.qmth.sop.common.contant.SystemConstant;
 import com.qmth.sop.common.enums.DeviceStatusEnum;
 import com.qmth.sop.common.enums.ExceptionResultEnum;
 import com.qmth.sop.common.enums.FieldUniqueEnum;
@@ -46,8 +47,14 @@ public class SysDeviceServiceImpl extends ServiceImpl<SysDeviceMapper, SysDevice
      * @return
      */
     @Override
-    public IPage<SysDeviceResult> query(IPage<Map> iPage, Long supplierId, String brand, String model, String deviceCode, DeviceStatusEnum status, InOutTypeEnum bound, Boolean enable) {
-        return this.baseMapper.query(iPage, supplierId,brand,model,deviceCode,Objects.nonNull(status)?status.name():null,Objects.nonNull(bound)?bound.name():null,enable);
+    public IPage<SysDeviceResult> query(IPage<Map> iPage, Long supplierId, String brand, String model, String deviceCode,String serialNo, DeviceStatusEnum status, InOutTypeEnum bound, Boolean enable) {
+        if (deviceCode != null && deviceCode.length() > 0){
+            deviceCode = SystemConstant.translateSpecificSign(deviceCode);
+        }
+        if (serialNo != null && serialNo.length() > 0){
+            serialNo = SystemConstant.translateSpecificSign(serialNo);
+        }
+        return this.baseMapper.query(iPage, supplierId,brand,model,deviceCode,serialNo,Objects.nonNull(status)?status.name():null,Objects.nonNull(bound)?bound.name():null,enable);
     }
 
     /**

+ 3 - 3
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBDeviceInOutServiceImpl.java

@@ -125,7 +125,7 @@ public class TBDeviceInOutServiceImpl extends ServiceImpl<TBDeviceInOutMapper, T
         } else {
             usageType = DeviceUsageTypeEnum.OTHER;
         }
-        if (deviceInOutSubmitParam.getDeviceInOutFormList().size() > deviceInOutSubmitParam.getDeviceInOutFormList().stream().map(DeviceInOutForm::getDeviceNo).distinct().count()) {
+        if (deviceInOutSubmitParam.getDeviceInOutFormList().size() > deviceInOutSubmitParam.getDeviceInOutFormList().stream().map(DeviceInOutForm::getSerialNo).distinct().count()) {
             throw ExceptionResultEnum.ERROR.exception("出入库登记表中设备编号有重复");
         }
 
@@ -149,7 +149,7 @@ public class TBDeviceInOutServiceImpl extends ServiceImpl<TBDeviceInOutMapper, T
             }
             tbDeviceInOut.setUserId(requestUser.getId());
             tbDeviceInOut.setType(inOutType);
-            tbDeviceInOut.setDeviceNo(e.getDeviceNo());
+            tbDeviceInOut.setDeviceNo(e.getSerialNo());
             tbDeviceInOut.setSupplierName(e.getSupplierName());
             tbDeviceInOut.setLocation(e.getLocation());
             tbDeviceInOut.setAddress(e.getAddress());
@@ -169,7 +169,7 @@ public class TBDeviceInOutServiceImpl extends ServiceImpl<TBDeviceInOutMapper, T
                     .set(SysDevice::getScanCount, e.getScanCount())
                     .set(SysDevice::getStatus, e.getDeviceStatus())
                     .set(SysDevice::getBound, inOutType)
-                    .eq(SysDevice::getDeviceCode, e.getDeviceNo());
+                    .eq(SysDevice::getDeviceCode, e.getSerialNo());
             sysDeviceService.update(updateWrapper);
 
             return Stream.of(tbDeviceInOut);

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

@@ -91,7 +91,7 @@
         t_b_service s
 
         left join t_b_device_in_out io on io.service_id=s.id
-        left join sys_device d on d.device_code=io.device_no
+        left join sys_device d on d.serial_no=io.serial_no
         <where>
             and s.status !='FINISH'
             <if test="dpr != null and !dpr.hasAdmin and !dpr.hasPmo">

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

@@ -304,7 +304,7 @@
         FROM
         t_b_service s
         LEFT JOIN t_b_device_in_out io ON io.service_id = s.id
-        LEFT JOIN sys_device d ON d.device_code = io.device_no
+        LEFT JOIN sys_device d ON d.serial_no = io.serial_no
         LEFT JOIN sys_supplier su ON su.id = d.supplier_id
         <where>
             and io.id IS NOT NULL

+ 4 - 1
sop-business/src/main/resources/mapper/SysDeviceMapper.xml

@@ -16,7 +16,10 @@
                 and a.model = #{model}
             </if>
             <if test="deviceCode != null and deviceCode != ''">
-                and a.device_code = #{deviceCode}
+                and a.device_code LIKE CONCAT('%',#{deviceCode},'%')
+            </if>
+            <if test="serialNo != null and serialNo != ''">
+                and a.serial_no LIKE CONCAT('%',#{serialNo},'%')
             </if>
             <if test="status != null and status != ''">
                 and a.status = #{status}

+ 4 - 4
sop-business/src/main/resources/mapper/TBDeviceInOutMapper.xml

@@ -30,7 +30,7 @@
                 LEFT JOIN
             t_b_service tbs ON tbdio.service_id = tbs.id
                 LEFT JOIN
-            sys_device sd ON tbdio.device_no = sd.device_code
+            sys_device sd ON tbdio.serial_no = sd.serial_no
                 LEFT JOIN
             sys_user su ON tbdio.user_id = su.id
                 LEFT JOIN
@@ -124,7 +124,7 @@
                 LEFT JOIN
             t_b_service tbs ON tbdio.service_id = tbs.id
                 LEFT JOIN
-            sys_device sd ON tbdio.device_no = sd.device_code
+            sys_device sd ON tbdio.serial_no = sd.serial_no
                 LEFT JOIN
             sys_user su ON tbdio.user_id = su.id
                 LEFT JOIN
@@ -244,10 +244,10 @@
             </if>
             <choose>
                 <when test="sopNo != null and sopNo != ''">
-                    AND EXISTS(SELECT 1 FROM t_b_device_in_out tbdio WHERE tbdio.device_no = sd.device_code AND tbdio.sop_no = #{sopNo})
+                    AND EXISTS(SELECT 1 FROM t_b_device_in_out tbdio WHERE tbdio.serial_no = sd.device_code AND tbdio.sop_no = #{sopNo})
                 </when>
                 <otherwise>
-                    AND EXISTS(SELECT 1 FROM t_b_device_in_out tbdio WHERE tbdio.device_no = sd.device_code AND tbdio.service_id IS NULL)
+                    AND EXISTS(SELECT 1 FROM t_b_device_in_out tbdio WHERE tbdio.serial_no = sd.device_code AND tbdio.service_id IS NULL)
                 </otherwise>
             </choose>
         </where>