浏览代码

Merge remote-tracking branch 'origin/20210223' into 20210223

wangyangyang 4 年之前
父节点
当前提交
0ddbb2f257

+ 1 - 1
operation_manager/src/main/java/com/huaxu/order/controller/WorkOrderManageController.java

@@ -496,7 +496,7 @@ public class WorkOrderManageController {
         ProcessDefinition processDefinition = workFlowService.findProcessDefinition(
                 loginUser.getTenantId(),
                 loginUser.getCompanyId(),
-                1);
+                orderTypeId);
         if(processDefinition == null){
            return new AjaxMessage(ResultStatus.ERROR,"没有创建流程,不能派单!");
         }

+ 5 - 1
operation_manager/src/main/java/com/huaxu/process/service/impl/WorkFlowServiceImpl.java

@@ -129,6 +129,7 @@ public class WorkFlowServiceImpl implements WorkFlowService {
         processDefinition.setTenantId(tenantId);
         processDefinition.setCompanyOrgId(companyId);
         processDefinition.setTaskType(taskType);
+        processDefinition.setProcessStatus("2");
         List<ProcessDefinition> processDefinitions = processDefinitionMapper.selectList(processDefinition);
         if(processDefinitions.size()>0){
             process=processDefinitions.get(0);
@@ -190,7 +191,10 @@ public class WorkFlowServiceImpl implements WorkFlowService {
         String tenantId = UserUtil.getCurrentUser().getTenantId();
         int uniqueCount = processDefinitionMapper.checkProcessUnique(null, tenantId,
                 processDefinition.getCompanyOrgId(),processDefinition.getTaskType());
-        if (uniqueCount > 0) {
+        ProcessDefinition processDefinition1 = processDefinitionMapper.selectById(processDefinition.getId());
+        boolean flag=processDefinition1.getCompanyOrgId().equals(processDefinition.getCompanyOrgId())&&
+                     processDefinition1.getTaskType().equals(processDefinition.getTaskType());
+        if (!flag&&uniqueCount > 0) {
             throw new ServiceException(ResultStatus.PROCESS_ALREADY_EXISTS);
         }
 

+ 1 - 1
operation_manager/src/main/java/com/huaxu/task/controller/PlanManageController.java

@@ -204,7 +204,7 @@ public class PlanManageController {
         ProcessDefinition processDefinition = workFlowService.findProcessDefinition(
                 loginUser.getTenantId(),
                 loginUser.getCompanyId(),
-                2);
+                planManage.getTaskType());
         if(processDefinition == null){
             return new AjaxMessage(ResultStatus.ERROR,"没有创建流程,不能提交!");
         }

+ 7 - 0
sms_water/src/main/java/com/huaxu/controller/HomePageReportController.java

@@ -94,6 +94,13 @@ public class HomePageReportController {
         return new AjaxMessage<>(ResultStatus.OK,homePageReportService.monitorDataFifteenDays(sceneId,"水厂",3));
     }
 
+    @RequestMapping(value = "getWaterMakingFifteenDaysForPumpingStation",method = RequestMethod.GET)
+    @ApiOperation(value = "综合展示——泵站制水15天")
+    public AjaxMessage<List<DeviceWaterSupply>> getWaterMakingFifteenDaysForPumpingStation(
+            @ApiParam(value = "泵站id",required = true) @RequestParam Integer sceneId){
+        return new AjaxMessage<>(ResultStatus.OK,homePageReportService.monitorDataFifteenDays(sceneId,"泵站",3));
+    }
+
     @RequestMapping(value = "getWaterQualityRateForWaterSource",method = RequestMethod.GET)
     @ApiOperation(value = "综合展示——水库水质")
     public AjaxMessage<WaterQualityRateForScene> waterQualityRateForWaterSource(

+ 11 - 14
sms_water/src/main/java/com/huaxu/service/impl/MonitorDataServiceImpl.java

@@ -167,22 +167,26 @@ public class MonitorDataServiceImpl implements MonitorDataService , Initializing
         //保存日报表数据
         saveReportDataByHour(hourDatas, lastHourDataMap);
 
-        //设备id
-        List<Integer> deviceIds = lastHourDataMap.values().stream().map(d -> d.getDeviceId().intValue()).distinct().collect(Collectors.toList());
         //补数据,前24小时没有统计数据的
-        if(deviceIds.size()>0){
+        List<Integer> deviceIds ;
+        if(lastHourDataMap.values().size()>0){
             for(int i=1;i<24;i++){
-                dateTime = LocalDateTime.now().plusHours(-i);
+                dateTime = dateTime.plusHours(-1);
+                //设备id
+                deviceIds = lastHourDataMap.values().stream().map(d -> d.getDeviceId().intValue()).distinct().collect(Collectors.toList());
+                if(deviceIds.size() ==0){break;}
+
                 //前几小时有统计数据的设备id
                 List<Integer> deviceIdsIsExit = monitorDataMapper.checkReportDataExit(dateTime.getYear(),dateTime.getMonthValue(),dateTime.getDayOfMonth(),dateTime.getHour(),deviceIds);
                 //需要补充数据的设备
                 deviceIds = deviceIds.stream().filter(deviceId -> !deviceIdsIsExit.contains(deviceId)).collect(Collectors.toList());
+                if(deviceIds.size() ==0){break;}
 
                 //查询需要补充数据的设备数据信息
-                hourDatas = new ArrayList<>(lastHourDataMap.values());
+                hourDatas = lastHourDataMap.values().stream().filter(d -> !deviceIdsIsExit.contains(d.getDeviceId())).collect(Collectors.toList());
 
-                lastHourDatas = getMonitorDataGroupByHour(dateTime.plusHours(-i),deviceIds);
-                lastHourDataMap = lastHourDatas.stream().collect(Collectors.toMap(DayReportEntity::getMapkey, a -> a,(k1, k2)->k1));
+                lastHourDatas = getMonitorDataGroupByHour(dateTime.plusHours(-1), deviceIds);
+                lastHourDataMap = lastHourDatas.stream().collect(Collectors.toMap(DayReportEntity::getMapkey, a -> a, (k1, k2) -> k1));
                 //保存日报表数据
                 saveReportDataByHour(hourDatas, lastHourDataMap);
             }
@@ -227,11 +231,4 @@ public class MonitorDataServiceImpl implements MonitorDataService , Initializing
         monitorDataMapper.batchInsertYearReport(dateTime.getYear(),dateTime.getMonthValue());
     }
 
-
-
-
-
-
-
-
 }

+ 3 - 2
user_center/src/main/resources/mapper/TenantMapper.xml

@@ -162,7 +162,7 @@
     <!-- 生成租户菜单 -->
     <insert id="createTenantMenu">
         insert into uims_tenant_menu (TENANT_ID ,MENU_ID ,MENU_NAME ,MENU_IMAGE ,MENU_SEQ ,LINK_PATH ,STATUS
-        ,DATE_CREATE ,CREATE_BY ,DATE_UPDATE ,UPDATE_BY)
+        ,DATE_CREATE ,CREATE_BY ,DATE_UPDATE ,UPDATE_BY,REMARK)
         select
             #{tenantId},
             id,
@@ -174,7 +174,8 @@
             now(),
             #{userName},
             now(),
-            #{userName}
+            #{userName},
+            remark
         from uims_menu
         where id in (
         <foreach collection="menuIds" item="item" index="index" separator=",">