hanfucheng 8 mesiacov pred
rodič
commit
5a3dc3b0cf

+ 13 - 0
src/main/java/com/sooka/sponest/data/generalbusiness/controller/CenterdataTKeyProjectsController.java

@@ -183,6 +183,19 @@ public class CenterdataTKeyProjectsController extends BaseController {
     }
 
     /*
+    * 重点工程删除(逻辑删除)
+    *
+    * @author 韩福成
+    * @date 2024/12/13 上午9:09
+    */
+    @ApiOperation(value = "重点工程删除(逻辑删除)", notes = "重点工程删除(假删除)")
+    @Log(title = "重点工程删除(逻辑删除)", businessType = BusinessType.UPDATE)
+    @PostMapping("/deleteProject")
+    public AjaxResult deleteProject(@RequestBody String[] projectIds) {
+        return toAjax(centerdataTKeyProjectsService.updateDel(projectIds));
+    }
+
+    /*
     * 推送报文
     *
     * @author 韩福成

+ 10 - 0
src/main/java/com/sooka/sponest/data/generalbusiness/domain/CenterdataTKeyProjects.java

@@ -327,6 +327,16 @@ public class CenterdataTKeyProjects extends BaseBusinessEntity {
 
     private String month;
 
+    private String del;
+
+    public String getDel() {
+        return del;
+    }
+
+    public void setDel(String del) {
+        this.del = del;
+    }
+
     public String getYear() {
         return year;
     }

+ 8 - 0
src/main/java/com/sooka/sponest/data/generalbusiness/mapper/CenterdataTKeyProjectsMapper.java

@@ -75,4 +75,12 @@ public interface CenterdataTKeyProjectsMapper {
     * @date 2024/4/2 10:06
     */
     int updateByProjectId(CenterdataTKeyProjects centerdataTKeyProjects);
+
+    /*
+    * 重点工程删除(逻辑删除)
+    *
+    * @author 韩福成
+    * @date 2024/12/13 上午9:15
+    */
+    int updateDel(String[] projectIds);
 }

+ 8 - 0
src/main/java/com/sooka/sponest/data/generalbusiness/service/ICenterdataTKeyProjectsService.java

@@ -63,6 +63,14 @@ public interface ICenterdataTKeyProjectsService {
     int receivedMessage(List<CenterdataTKeyProjects> centerdataTKeyProjects);
 
     /*
+    * 重点工程删除(逻辑删除)
+    *
+    * @author 韩福成
+    * @date 2024/12/13 上午9:13
+    */
+    int updateDel(String[] projectIds);
+
+    /*
     * 推送报文
     *
     * @author 韩福成

+ 12 - 0
src/main/java/com/sooka/sponest/data/generalbusiness/service/impl/CenterdataTKeyProjectsServiceImpl.java

@@ -161,6 +161,7 @@ public class CenterdataTKeyProjectsServiceImpl extends BaseServiceImpl implement
                 projects.setCreateBy(SecurityUtils.getUserId().toString());
                 projects.setCreateName( SecurityUtils.getLoginUser().getSysUser().getNickName());
                 projects.setCreateTime(DateUtils.getNowDate());
+                projects.setDel("0");
                 i = centerdataTKeyProjectsMapper.insertCenterdataTKeyProjects(projects);
             }
         }
@@ -168,6 +169,17 @@ public class CenterdataTKeyProjectsServiceImpl extends BaseServiceImpl implement
     }
 
     /*
+    * 重点工程删除(逻辑删除)
+    *
+    * @author 韩福成
+    * @date 2024/12/13 上午9:14
+    */
+    @Override
+    public int updateDel(String[] projectIds) {
+        return centerdataTKeyProjectsMapper.updateDel(projectIds);
+    }
+
+    /*
     * 推送报文
     *
     * @author 韩福成

+ 1 - 2
src/main/resources/mapper/commandcenter/CommandCentreMapper.xml

@@ -167,7 +167,7 @@
         LEFT JOIN ${database_system}.sys_dept d ON d.dept_id = a.dept_id
         LEFT JOIN ${database_system}.sys_dept b ON b.dept_id = a.park
         LEFT JOIN centerdata_t_equipment_camera c ON c.business_id = a.id AND `type` = 'key_projects'
-        <where>
+        where del = 0
             <choose>
                 <when test="deptId != null and deptId != ''">and FIND_IN_SET( #{deptId}, CONCAT(d.ancestors,',',d.dept_id) )</when>
                 <otherwise>${params.dataScope}</otherwise>
@@ -199,7 +199,6 @@
             <if test="params.month != null and params.month != ''"><!--开复工时间-->
                 AND DATE_FORMAT(start_time,'%m') = #{params.month}
             </if>
-        </where>
         GROUP BY a.id
         <if test="state != null and state != ''" >
             HAVING cameraCode IS NOT NULL

+ 8 - 2
src/main/resources/mapper/generalbusiness/CenterdataTKeyProjectsMapper.xml

@@ -73,7 +73,7 @@
         from centerdata_t_key_projects a
         left join ${database_system}.sys_dept d ON d.dept_id = a.dept_id
         LEFT JOIN ${database_system}.sys_dept dd on dd.dept_id = a.park
-        <where>
+        where del = 0
             <if test="projectName != null  and projectName != ''">and project_name like concat('%', #{projectName},
                 '%')
             </if>
@@ -107,7 +107,6 @@
             <if test="year != null">and DATE_FORMAT(start_time,'%Y')  =  #{year}</if>
             <if test="month != null">and DATE_FORMAT(start_time,'%m')  = #{month}</if>
             ${params.dataScope}
-        </where>
         order by a.order_num,a.create_time desc
     </select>
 
@@ -356,4 +355,11 @@
         </trim>
         where project_id = #{projectId}
     </update>
+
+    <update id="updateDel" parameterType="string">
+        update centerdata_t_key_projects SET del = 1 where project_id in
+        <foreach item="projectIds" collection="array" open="(" separator="," close=")">
+            #{projectIds}
+        </foreach>
+    </update>
 </mapper>