Browse Source

德阳燃气bug修复

13408401276 3 years ago
parent
commit
905f408804

+ 1 - 4
src/main/java/com/tofly/dyrq/DyrqApplication.java

@@ -11,10 +11,7 @@ import org.springframework.cloud.client.SpringCloudApplication;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.context.annotation.Import;
 
-/**
- * @author tuonbed
- * @date 2020/3/2  10:19
- */
+
 @SpringCloudApplication
 @EnableFeignClients(basePackages = {"com.tofly.base.api","com.tofly.dyrq.custom.service"},defaultConfiguration =  FeignConfig.class)
 @Import(AutoConfigConfiguration.class)

+ 5 - 1
src/main/java/com/tofly/dyrq/config/MyConfiguration.java

@@ -1,7 +1,10 @@
 package com.tofly.dyrq.config;
 
+import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
+import com.baomidou.mybatisplus.extension.incrementer.OracleKeyGenerator;
+
 /**
  * @author tuonbed
  * @date 2020/3/27  14:19
@@ -12,5 +15,6 @@ public class MyConfiguration {
 //    @Bean
 //    public ScheduledTaskRegistrar scheduledTaskRegistrar(){
 //        return new ScheduledTaskRegistrar();
-//    }
+//    }	
+	
 }

+ 1 - 1
src/main/java/com/tofly/dyrq/controller/TestController.java

@@ -10,8 +10,8 @@ import com.tofly.dyrq.config.FilePathBean;
 import com.tofly.dyrq.custom.mapper.OtherMapper;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import jdk.nashorn.internal.ir.annotations.Reference;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.annotation.Reference;
 import org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor;
 import org.springframework.scheduling.config.ScheduledTaskHolder;
 import org.springframework.scheduling.config.ScheduledTaskRegistrar;

+ 1 - 1
src/main/java/com/tofly/dyrq/custom/controller/CustomAppFileController.java

@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
-
+//移动端上传日志
 @RestController
 @AllArgsConstructor
 @RequestMapping("/appfile")

+ 1 - 1
src/main/java/com/tofly/dyrq/custom/controller/CustomConstructionSiteController.java

@@ -23,7 +23,7 @@ import lombok.AllArgsConstructor;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
-
+//上报
 /**
  * 工地监护工单表自定义接口
  *

+ 8 - 9
src/main/java/com/tofly/dyrq/custom/service/impl/CustomPlanServiceImpl.java

@@ -100,7 +100,6 @@ public class CustomPlanServiceImpl implements CustomPlanService {
     @SneakyThrows
     public boolean savePlan(CustomPlan customPlan) {
 
-
         //默认字段
         customPlan.setIsFindTrouble("0");
         customPlan.setIsread("0");
@@ -200,6 +199,7 @@ public class CustomPlanServiceImpl implements CustomPlanService {
             if (type.equals("0")) {
                 planChild.setPointNum(Long.valueOf(geo.size()));
                 planChildService.save(planChild);
+                
                 for (int j = 0; j < geo.size(); j++) {
                     PlanPointTemp planPointTemp = new PlanPointTemp();
                     planPointTemp.setPlanId(customPlan.getId());
@@ -210,6 +210,7 @@ public class CustomPlanServiceImpl implements CustomPlanService {
                     planPointTemp.setChildPlanId(planChild.getId());
                     planPointTemp.setRegionId(customPlan.getRegionId());
                     planPointTemp.setDeviceTypeId(customPlan.getDeviceTypeId());
+                    planPointTemp.setCreateDate(new Date());
                     if (gisUrl == null) {
                         planPointTemp.setPointId(geo.getJSONObject(j).getLong("sid"));
                         planPointTemp.setGeometry(geo.getJSONObject(j).getString("geometry"));
@@ -257,6 +258,7 @@ public class CustomPlanServiceImpl implements CustomPlanService {
                             planPointTemp.setUserId(userId);
                             planPointTemp.setCompanyid(companyId);
                             planPointTemp.setIsover("0");
+                            planPointTemp.setCreateDate(new Date());
 
                             planPointTemp.setPointId(geo.getJSONObject(j).getLong("sid"));
                             planPointTemp.setGeometry(pipe.getJSONObject(w).getString("geometry"));
@@ -299,6 +301,7 @@ public class CustomPlanServiceImpl implements CustomPlanService {
                         planPointTemp.setUserId(userId);
                         planPointTemp.setCompanyid(companyId);
                         planPointTemp.setIsover("0");
+                        planPointTemp.setCreateDate(new Date());
 
                         planPointTemp.setPointId(geo.getJSONObject(j).getJSONObject("attributes").getLong("OBJECTID"));
                         planPointTemp.setGeometry(geo.getJSONObject(j).getString("geometry"));
@@ -451,9 +454,9 @@ public class CustomPlanServiceImpl implements CustomPlanService {
         planService.removeByIds(Arrays.asList(ids.split(",")));
         for (String id : Arrays.asList(ids.split(","))) {
             planChildService.remove(Wrappers.<PlanChild>lambdaQuery().eq(PlanChild::getMainPlanId, id));
-            planPointTempService.remove(Wrappers.<PlanPointTemp>lambdaQuery().eq(PlanPointTemp::getPlanId, id));
             List<PlanChild> list = planChildService.list(Wrappers.<PlanChild>lambdaQuery().eq(PlanChild::getMainPlanId, id));
             for (PlanChild child : list) {
+            	planPointTempService.remove(Wrappers.<PlanPointTemp>lambdaQuery().eq(PlanPointTemp::getChildPlanId, child.getId()));
                 planPathTempService.remove(Wrappers.<TfPlanPathTemp>lambdaQuery().eq(TfPlanPathTemp::getChildPlanId, child.getId()));
             }
         }
@@ -481,13 +484,9 @@ public class CustomPlanServiceImpl implements CustomPlanService {
     @Transactional(rollbackFor = Exception.class)
     @Override
     public boolean removeChildPlanByIds(String ids) {
-        List<PlanChild> inPlan = new ArrayList<>();
-        String s = new String();
-        for (String id : Arrays.asList(ids.split(","))) {
-            PlanChild planChild = planChildService.getOne(Wrappers.<PlanChild>lambdaQuery().eq(PlanChild::getId, id).ge(PlanChild::getChildPlanState, "2"));
-            if (planChild == null) {
-                break;
-            }
+        for (String id : Arrays.asList(ids.split(","))) {            
+        	planPointTempService.remove(Wrappers.<PlanPointTemp>lambdaQuery().eq(PlanPointTemp::getChildPlanId, id));
+            planPathTempService.remove(Wrappers.<TfPlanPathTemp>lambdaQuery().eq(TfPlanPathTemp::getChildPlanId, id));
 //            if ("3".equals(planChild.getChildPlanState())) {
 //                throw new ToflyDeniedException("巡检子计划" + planChild.getId().toString() + "已完成不允许删除");
 //            } else if ("4".equals(planChild.getChildPlanState())) {

+ 9 - 2
src/main/java/com/tofly/dyrq/custom/service/impl/CustomPointServiceImpl.java

@@ -157,7 +157,6 @@ public class CustomPointServiceImpl implements CustomPointService {
 	@Scheduled(fixedDelay = 3000)
 	public void executChild() {
 		
-		
 			Set<String> childkeys = redisTemplate.keys("child_"+"*");		
 		    if (CollectionUtils.isNotEmpty(childkeys)) {
 		    	for(String childKey : childkeys) {
@@ -176,7 +175,15 @@ public class CustomPointServiceImpl implements CustomPointService {
 						int total = 0; //point_temp个数
 						double percent = 0;
 						double percent1 = 0;
-						Map plan = customPlanMapper.getTodayPlan(childPlanId).get(0);
+						
+						Map plan = null;
+						
+						if(customPlanMapper.getTodayPlan(childPlanId).size()!=0) {
+							plan = customPlanMapper.getTodayPlan(childPlanId).get(0);
+						}else {							
+							continue;
+						}
+												
 						//查询包含巡检检查内容的类型
 			            List<SysDeviceType> devices = sysDeviceTypeService.list(Wrappers.<SysDeviceType>lambdaQuery().isNotNull(SysDeviceType::getCheckContent));
 			            Set<Long> checkTypes = new HashSet<>();

+ 13 - 2
src/main/java/com/tofly/dyrq/entity/Maintenance.java

@@ -55,10 +55,21 @@ public class Maintenance extends Model<Maintenance> {
                 /**
      * 检查起始时间
      */
-            @ApiModelProperty(value = "检查起始时间")
+            @ApiModelProperty(value = "检查时间")
         @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-                private Date checkBeginDate;
+                private Date checkDate;
+            
+            @ApiModelProperty(value = "检查状态")
+                    private Integer checkState;
+            
+            
+            @ApiModelProperty(value = "检查起始时间")
+            @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+                    private Date checkBeginDate;
+            
+            
                 /**
      * 检查结束时间
      */

+ 10 - 0
src/main/java/com/tofly/dyrq/entity/PlanPointTemp.java

@@ -194,4 +194,14 @@ public class PlanPointTemp extends Model<PlanPointTemp> {
      */
     @ApiModelProperty(value = "设备检查状态0:未检查 1:已检查(点状设备)")
     private String checkState;
+    
+    
+  
+    @ApiModelProperty(value = "到位时间")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private Date createDate;
+    
+    
+    
 }

+ 9 - 7
src/main/resources/customMapper/CustomMaintenanceMapper.xml

@@ -92,27 +92,27 @@
 
     <!-- 调压设备记录表分页查询 -->
     <select id="getMaintenancePage" resultMap="getMaintenancePageMap">
-        select * from TF_MAINTENANCE a where  a.del_flag='1'
+        select * from TF_MAINTENANCE a left join tf_plan_point_temp pt on a.plan_temp_point_id =pt.point_id   where  a.del_flag='1'
         <if test="maintenanceSearch.ids != null">
-            and id in
+            and a.id in
             <foreach item="item" collection="maintenanceSearch.ids" separator="," open="(" close=")" index="">
                 #{item}
             </foreach>
         </if>
         <if test="maintenanceSearch.startDate != null">
-            and CREATE_DATE >= #{maintenanceSearch.startDate}
+            and a.CREATE_DATE >= #{maintenanceSearch.startDate}
         </if>
         <if test="maintenanceSearch.endDate != null">
-            <![CDATA[       and CREATE_DATE <= #{maintenanceSearch.endDate}   ]]>
+            <![CDATA[       and a.CREATE_DATE <= #{maintenanceSearch.endDate}   ]]>
         </if>
         <if test="maintenanceSearch.childPlanId != null">
-            and CHILD_PLAN_ID = #{maintenanceSearch.childPlanId}
+            and pt.CHILD_PLAN_ID = #{maintenanceSearch.childPlanId}
         </if>
         <if test="maintenanceSearch.planTempPointId != null">
-            and PLAN_TEMP_POINT_ID = #{maintenanceSearch.planTempPointId}
+            and pt.point_id = #{maintenanceSearch.planTempPointId}
         </if>
         <if test="maintenanceSearch.createUser != null">
-            and CREATE_USER = #{maintenanceSearch.createUser}
+            and a.CREATE_USER = #{maintenanceSearch.createUser}
         </if>
     </select>
 
@@ -122,6 +122,8 @@
         <result property="deviceId" column="DEVICE_ID"/>
         <result property="checkBeginDate" column="CHECK_BEGIN_DATE"/>
         <result property="checkEndDate" column="CHECK_END_DATE"/>
+        <result property="checkDate" column="CHECK_DATE"/>
+        <result property="checkState" column="CHECK_STATE"/>
         <result property="address" column="ADDRESS"/>
         <result property="createUser" column="CREATE_USER"/>
         <result property="createDate" column="CREATE_DATE"/>

+ 4 - 2
src/main/resources/customMapper/CustomPlanMapper.xml

@@ -507,7 +507,8 @@
         content,
         pipe_length,
         lat,
-        lng
+        lng,
+        create_date
         )
         <foreach close=")" collection="pointTempList" item="point" index="index" open="(" separator="union">
             select
@@ -527,7 +528,8 @@
             #{point.content,jdbcType=VARCHAR},
             #{point.pipeLength,jdbcType=VARCHAR},
             #{point.lat,jdbcType=NUMERIC},
-            #{point.lng,jdbcType=NUMERIC}
+            #{point.lng,jdbcType=NUMERIC},
+            #{point.createDate,jdbcType=TIMESTAMP}
             from dual
         </foreach>
     </insert>