1
0
chenendian 2 месяцев назад
Родитель
Сommit
743b0c025a

+ 3 - 2
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/ThematicController.java

@@ -61,12 +61,13 @@ public class ThematicController extends BaseController {
      * @param rwlx 任务类型  同字典表 ztlx
      * @param ztfw 制图范围
      * @param ztry 制图人员
+     * @param ztdw 制图单位
      * @return
      */
     @PostMapping("/launch")
-    public R<Object> launch(String name, String rwlx, String ztfw, String ztry) {
+    public R<Object> launch(String name, String rwlx, String ztfw, String ztry, String ztdw) {
         try {
-            R<Object> res = thematicService.launch(name, rwlx, ztfw, ztry);
+            R<Object> res = thematicService.launch(name, rwlx, ztfw, ztry, ztdw);
             return res;
         } catch (Exception e) {
             return R.fail(e.getMessage());

+ 1 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/ThematicMapper.java

@@ -23,7 +23,7 @@ public interface ThematicMapper {
 
     void productDelete(@Param("id") String id);
 
-    void addRw(@Param("uuid") String uuid, @Param("name") String name, @Param("rwlx") String rwlx, @Param("ztfw") String ztfw, @Param("ztry") String ztry);
+    void addRw(@Param("uuid") String uuid, @Param("name") String name, @Param("rwlx") String rwlx, @Param("ztfw") String ztfw, @Param("ztry") String ztry, @Param("ztdw") String ztdw);
 
     void updateRwzt(@Param("uuid") String uuid, @Param("rwzt") String rwzt);
 

+ 1 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/ThematicService.java

@@ -30,7 +30,7 @@ public interface ThematicService {
 
     R<Object> productDelete(String id);
 
-    R<Object> launch(String name, String rwlx, String ztfw, String ztry);
+    R<Object> launch(String name, String rwlx, String ztfw, String ztry, String ztdw);
 
     R<Object> drop(String id, String type);
 }

+ 13 - 12
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/ThematicImpl.java

@@ -19,7 +19,6 @@ import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStreamReader;
-import java.net.http.HttpResponse;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -32,7 +31,7 @@ import java.util.Map;
 public class ThematicImpl implements ThematicService {
     //默认参数配置
     private Integer page_default = 1; //页码
-    private Integer limit_default = 100; //每页条数
+    private Integer limit_default = 10; //每页条数
     @Resource
     private ThematicMapper thematicMapper;
     @Value("${temp}")
@@ -49,7 +48,6 @@ public class ThematicImpl implements ThematicService {
     private FzssFxrwrzHandleService fzssFxrwrzHandleService;
 
 
-
     @Override
     public R<Object> list(String name, String rwlx, Integer page, Integer limit) {
         try {
@@ -77,14 +75,17 @@ public class ThematicImpl implements ThematicService {
         try {
             List<ThematicTask> datas = thematicMapper.list(null, null, null, null, id);
             if (datas != null && datas.size() > 0) {
-                thematicMapper.drop(id);
                 if ("1".equals(type)) { //仅删除任务记录
-
+                    thematicMapper.drop(id);
                 } else if ("2".equals(type)) { //删除任务记录和制图成果
-                    String filepath = thematicMapper.productFile(id);
-                    File file = new File(filepath);
-                    org.apache.commons.io.FileUtils.deleteDirectory(file.getParentFile());
-                    thematicMapper.productDelete(id);
+                    thematicMapper.drop(id);
+                    List<ThematicDetails> details = thematicMapper.productlist(null, id, 0, 1000);
+                    for (ThematicDetails cur : details) {
+                        String filepath = thematicMapper.productFile(cur.getId());
+                        File file = new File(filepath);
+                        org.apache.commons.io.FileUtils.deleteDirectory(file.getParentFile());
+                        thematicMapper.productDelete(cur.getId());
+                    }
                 }
             } else {
                 return R.fail("id参数有误!");
@@ -97,10 +98,10 @@ public class ThematicImpl implements ThematicService {
     }
 
     @Override
-    public R<Object> launch(String name, String rwlx, String ztfw, String ztry) {
+    public R<Object> launch(String name, String rwlx, String ztfw, String ztry, String ztdw) {
         String uuid = StringUtils.getUUID();
         // 插入制图任务表
-        thematicMapper.addRw(uuid, name, rwlx, ztfw, ztry);
+        thematicMapper.addRw(uuid, name, rwlx, ztfw, ztry, ztdw);
         fzssFxrwrzHandleService.insertFxrwrz(uuid, "地籍制图", "任务创建成功", "info");
 
         // 判断需要执行的python脚本
@@ -167,7 +168,7 @@ public class ThematicImpl implements ThematicService {
             if (limit == null) {
                 limit = limit_default;
             }
-            limit = limit_default;
+            //limit = limit_default;
             Integer offset = (page - 1) * limit;
             name = ""; //todo 这里先清空名称查询条件,避免统计数量错误
             List<ThematicDetails> datas = thematicMapper.productlist(name, taskid, offset, limit);

+ 4 - 3
siwei-modules/siwei-apply/src/main/resources/mapper/ThematicMapper.xml

@@ -67,14 +67,15 @@
     </select>
 
     <delete id="productDelete" parameterType="java.lang.String">
-        delete from t_thematic_details where id = #{id} or taskid = #{id}
+        delete from t_thematic_details where id = #{id}
     </delete>
 
     <insert id="addRw" parameterType="java.lang.String">
-        insert into t_thematic_task (id , name , cjsj , rwzt , rwlx , ztfw, ztry) values
-        (#{uuid} , #{name} ,CURRENT_TIMESTAMP , '0' , #{rwlx}, #{ztfw}, #{ztry} )
+        insert into t_thematic_task (id , name , cjsj , rwzt , rwlx , ztfw, ztry, ztdw) values
+        (#{uuid} , #{name} ,CURRENT_TIMESTAMP , '0' , #{rwlx}, #{ztfw}, #{ztry}, #{ztdw} )
     </insert>
 
+
     <update id="updateRwzt" parameterType="java.lang.String">
         update t_thematic_task set rwzt = #{rwzt} ,rwkssj = CURRENT_TIMESTAMP where id = #{uuid}
     </update>