Selaa lähdekoodia

优化指令记录接口,新增“产品编码”、“设备ID” 2个筛选字段

james 5 kuukautta sitten
vanhempi
commit
c7be3645e8

+ 3 - 1
data-transfer/data-transfer-biz/src/main/java/com/usky/transfer/controller/web/QueryDeviceDataController.java

@@ -197,10 +197,12 @@ public class QueryDeviceDataController {
      */
     @GetMapping("deviceCommandRecord")
     public ApiResult<CommonPage<DmpDeviceCommand>> deviceCommandRecord(@RequestParam(value = "commandStatus",required = false) Integer commandStatus,
+                                                                       @RequestParam(value = "productCode",required = false) String productCode,
+                                                                       @RequestParam(value = "deviceId",required = false) String deviceId,
                                                                        @RequestParam(value = "startTime",required = false) String startTime,
                                                                        @RequestParam(value = "endTime",required = false) String endTime,
                                                                        @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
                                                                        @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize){
-        return ApiResult.success(dmpDeviceCommandService.deviceCommandRecord(commandStatus,startTime,endTime,pageNum,pageSize));
+        return ApiResult.success(dmpDeviceCommandService.deviceCommandRecord(commandStatus,productCode,deviceId,startTime,endTime,pageNum,pageSize));
     }
 }

+ 1 - 1
data-transfer/data-transfer-biz/src/main/java/com/usky/transfer/service/DmpDeviceCommandService.java

@@ -15,5 +15,5 @@ import org.springframework.web.bind.annotation.RequestParam;
  */
 public interface DmpDeviceCommandService extends CrudService<DmpDeviceCommand> {
 
-    CommonPage<DmpDeviceCommand> deviceCommandRecord(Integer commandStatus,String startTime,String endTime,Integer pageNum,Integer pageSize);
+    CommonPage<DmpDeviceCommand> deviceCommandRecord(Integer commandStatus,String productCode,String deviceId,String startTime,String endTime,Integer pageNum,Integer pageSize);
 }

+ 3 - 1
data-transfer/data-transfer-biz/src/main/java/com/usky/transfer/service/impl/DmpDeviceCommandServiceImpl.java

@@ -25,10 +25,12 @@ import org.springframework.stereotype.Service;
 public class DmpDeviceCommandServiceImpl extends AbstractCrudService<DmpDeviceCommandMapper, DmpDeviceCommand> implements DmpDeviceCommandService {
 
     @Override
-    public CommonPage<DmpDeviceCommand> deviceCommandRecord(Integer commandStatus, String startTime, String endTime, Integer pageNum, Integer pageSize){
+    public CommonPage<DmpDeviceCommand> deviceCommandRecord(Integer commandStatus,String productCode,String deviceId, String startTime, String endTime, Integer pageNum, Integer pageSize){
         IPage<DmpDeviceCommand> page = new Page<>(pageNum,pageSize);
         LambdaQueryWrapper<DmpDeviceCommand> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(commandStatus != null,DmpDeviceCommand::getCommandStatus,commandStatus)
+                .like(StringUtils.isNotBlank(productCode),DmpDeviceCommand::getProductCode,productCode)
+                .like(StringUtils.isNotBlank(deviceId),DmpDeviceCommand::getDeviceId,deviceId)
                 .between(StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime),DmpDeviceCommand::getCreatedTime,startTime,endTime)
                 .eq(DmpDeviceCommand::getTenantId, SecurityUtils.getTenantId())
                 .orderByDesc(DmpDeviceCommand::getId);