Bläddra i källkod

Merge remote-tracking branch 'origin/V0.0.2' into V0.0.2

jingyuanchao 2 år sedan
förälder
incheckning
29dcf00f54

+ 3 - 1
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/retrieval/domain/CoreMonitoringRetrievalTask.java

@@ -120,8 +120,10 @@ private static final long serialVersionUID=1L;
     private Date submitTime;
 
     /** 异常数 */
-            @ApiModelProperty(value = "异常数")
+    @ApiModelProperty(value = "异常数")
     private Integer exceptionCount;
+    @ApiModelProperty(value = "0正常,1删除")
+    private Integer isDeleted;
 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
 @Override

+ 2 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/mapper/CoreMonitoringRetrievalTaskMapper.java

@@ -83,4 +83,6 @@ public interface CoreMonitoringRetrievalTaskMapper extends BaseMapper<CoreMonito
     void updateTaskStart(@Param("dateTimeNew") Date dateTimeNew);
 
     void deleteTaskByPlanId(@Param("planId") Long planId);
+
+    void updateDeleteTaskByPlanId(@Param("planId") Long planId,@Param("isDeleted") Integer isDeleted);
 }

+ 2 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/service/ICoreMonitoringRetrievalTaskService.java

@@ -90,5 +90,7 @@ public interface ICoreMonitoringRetrievalTaskService extends IService<CoreMonito
 
     void updateTaskStart();
 
+
     void deleteTaskByPlanId(Long planId);
+    void updateDeleteTaskByPlanId(Long planId,Integer isDeleted);
 }

+ 6 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/service/impl/CoreMonitoringRetrievalTaskServiceImpl.java

@@ -365,6 +365,11 @@ public class CoreMonitoringRetrievalTaskServiceImpl extends ServiceImpl<CoreMoni
         coreMonitoringRetrievalTaskMapper.deleteTaskByPlanId(planId);
     }
 
+    @Override
+    public void updateDeleteTaskByPlanId(Long planId,Integer isDeleted) {
+        coreMonitoringRetrievalTaskMapper.updateDeleteTaskByPlanId(planId,isDeleted);
+    }
+
     /**
      * @param cycle    周期
      * @param taskTime 日期
@@ -454,6 +459,7 @@ public class CoreMonitoringRetrievalTaskServiceImpl extends ServiceImpl<CoreMoni
         task.setRoleId(plan.getRoleId());
         task.setStatus("0");
         task.setCreateTime(DateTime.now());
+        task.setIsDeleted(0);
         return task;
     }
 

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/weather/controller/WeatherWarningController.java

@@ -7,6 +7,7 @@ import com.xunmei.common.core.domain.weather.dto.WeatherWarningDto;
 import com.xunmei.common.core.utils.KeyValue;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.common.security.annotation.InnerAuth;
 import com.xunmei.common.security.annotation.RequiresPermissions;
 import com.xunmei.core.access.vo.TMonitoringRetrievalPlanVO;
 import com.xunmei.core.weather.service.IWeatherWarningService;
@@ -48,7 +49,7 @@ public class WeatherWarningController {
         List<KeyValue> cityList = weatherWarningService.cityCodeList();
     return AjaxResult.success(cityList);
     }
-
+    @InnerAuth
     @GetMapping(value = "/getDataFromApi")
     public void getDataFromApi() {
         weatherWarningService.getDataFromApi();

+ 6 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/retrieval/CoreMonitoringRetrievalTaskMapper.xml

@@ -97,7 +97,7 @@
     <select id="selectPageList" resultType="com.xunmei.common.core.domain.retrieval.vo.CoreMonitoringRetrievalTaskVo">
         select a.*,b.role_name as roleName,c.name as retrievalUserName from core_monitoring_retrieval_task a left join
         sys_role b on a.role_id = b.id left join sys_user c on a.retrieval_user = c.id
-        where 1=1
+        where is_deleted = 0
         <if test="request.orgId != null ">
             and a.org_id = #{request.orgId}
         </if>
@@ -357,6 +357,7 @@
           and status!=2
     </update>
 
+
     <delete id="deleteCoreMonitoringRetrievalTaskById" parameterType="Long">
         delete
         from core_monitoring_retrieval_task
@@ -372,4 +373,8 @@
     <delete id="deleteTaskByPlanId">
         delete from core_monitoring_retrieval_task where plan_id = #{planId} and status  in (0,3)
     </delete>
+
+    <update id="updateDeleteTaskByPlanId">
+        update core_monitoring_retrieval_task set is_deleted = #{isDeleted} where plan_id = #{planId}
+    </update>
 </mapper>