Bladeren bron

fixed bugs in search

maqingyang 11 maanden geleden
bovenliggende
commit
0a58ba917b

+ 158 - 158
src/main/java/com/kexun/controller/BusinessController.java

@@ -37,7 +37,7 @@ public class BusinessController {
         List<BusinessInfo> list=null;
         switch(businessType){
             case 0:
-                list = BusinessService.queryToDoList();
+                list = BusinessService.queryBusinessList("'0'",null);
                 for (BusinessInfo businessInfo : list) {
                     if (businessInfo.getStatus().equals("0")) {
                         businessInfo.setStatus("待解析");
@@ -45,7 +45,7 @@ public class BusinessController {
                 }
                 break;
             case 1:
-                list = BusinessService.queryAnalysisList();
+                list = BusinessService.queryBusinessList("'1','2'",null);
                 for (BusinessInfo businessInfo : list) {
                     if (businessInfo.getStatus().equals("1")) {
                         businessInfo.setStatus("解析完成");
@@ -55,7 +55,7 @@ public class BusinessController {
                 }
                 break;
             case 2:
-                list = BusinessService.queryFailList();
+                list = BusinessService.queryBusinessList("'3','4'",null);
                 for (BusinessInfo businessInfo : list) {
                     if (businessInfo.getStatus().equals("3")) {
                         businessInfo.setStatus("查询失败");
@@ -73,32 +73,32 @@ public class BusinessController {
     }
 
 
-
-    /**
-     * 获取待办业务列表
-     *
-     * @param json
-     * @return
-     */
-    @RequestMapping("businessToDoList")
-    public Result businessToDoList(@RequestBody String json) {
-        JSONObject req = JSON.parseObject(json);
-        int pageNum = req.getIntValue("pageNum");
-        int pageSize = req.getIntValue("pageSize");
-
-        PageHelper.startPage(pageNum, pageSize);//设置分页信息
-
-        List<BusinessInfo> list = BusinessService.queryToDoList();
-        PageInfo pageInfo = new PageInfo(list);
-        for (BusinessInfo businessInfo : list) {
-            if (businessInfo.getStatus().equals("0")) {
-                businessInfo.setStatus("待解析");
-            }
-        }
-        JSONObject resJson = new JSONObject();
-        resJson.put("business_todo_list", pageInfo);
-        return Result.success("ok", resJson);
-    }
+//
+//    /**
+//     * 获取待办业务列表
+//     *
+//     * @param json
+//     * @return
+//     */
+//    @RequestMapping("businessToDoList")
+//    public Result businessToDoList(@RequestBody String json) {
+//        JSONObject req = JSON.parseObject(json);
+//        int pageNum = req.getIntValue("pageNum");
+//        int pageSize = req.getIntValue("pageSize");
+//
+//        PageHelper.startPage(pageNum, pageSize);//设置分页信息
+//
+//        List<BusinessInfo> list = BusinessService.queryToDoList();
+//        PageInfo pageInfo = new PageInfo(list);
+//        for (BusinessInfo businessInfo : list) {
+//            if (businessInfo.getStatus().equals("0")) {
+//                businessInfo.setStatus("待解析");
+//            }
+//        }
+//        JSONObject resJson = new JSONObject();
+//        resJson.put("business_todo_list", pageInfo);
+//        return Result.success("ok", resJson);
+//    }
     @RequestMapping("selectBusiness")
     public Result selectBusiness(@RequestBody String json) {
         JSONObject req = JSON.parseObject(json);
@@ -110,7 +110,7 @@ public class BusinessController {
         List<BusinessInfo> list=null;
         switch(businessType){
             case 0:
-                list = BusinessService.selectBusinessToDo(customerName);
+                list = BusinessService.queryBusinessList("'0'",customerName);
                 for (BusinessInfo businessInfo : list) {
                     if (businessInfo.getStatus().equals("0")) {
                         businessInfo.setStatus("待解析");
@@ -118,7 +118,7 @@ public class BusinessController {
                 }
                 break;
             case 1:
-                list = BusinessService.selectBusinessAnalysis(customerName);
+                list = BusinessService.queryBusinessList("'1','2'",customerName);
                 for (BusinessInfo businessInfo : list) {
                     if (businessInfo.getStatus().equals("1")) {
                         businessInfo.setStatus("解析完成");
@@ -128,7 +128,7 @@ public class BusinessController {
                 }
                 break;
             case 2:
-                list = BusinessService.selectBusinessFail(customerName);
+                list = BusinessService.queryBusinessList("'3','4'",customerName);
                 for (BusinessInfo businessInfo : list) {
                     if (businessInfo.getStatus().equals("3")) {
                         businessInfo.setStatus("查询失败");
@@ -141,134 +141,134 @@ public class BusinessController {
         }
         PageInfo pageInfo = new PageInfo(list);
         JSONObject resJson = new JSONObject();
-        resJson.put("select_business_todo", pageInfo);
-        return Result.success("ok", resJson);
-    }
-    /**
-     * 待解析的业务
-     *
-     * @param json
-     * @return
-     */
-    @RequestMapping("selectBusinessToDo")
-    public Result selectBusinessToDo(@RequestBody String json) {
-        JSONObject req = JSON.parseObject(json);
-        int pageNum = req.getIntValue("pageNum");
-        int pageSize = req.getIntValue("pageSize");
-        String customerName = req.getString("customerName");
-        PageHelper.startPage(pageNum, pageSize);//设置分页信息
-
-        List<BusinessInfo> list = BusinessService.selectBusinessToDo(customerName);
-        PageInfo pageInfo = new PageInfo(list);
-
-        for (BusinessInfo businessInfo : list) {
-            if (businessInfo.getStatus().equals("0")) {
-                businessInfo.setStatus("待解析");
-            }
-        }
-        JSONObject resJson = new JSONObject();
-        resJson.put("select_business_todo", pageInfo);
-        return Result.success("ok", resJson);
-    }
-
-    /**
-     * 解析成功的业务列表
-     *
-     * @param json
-     * @return
-     */
-    @RequestMapping("businessAnalysisList")
-    public Result businessAnalysisList(@RequestBody String json) {
-        JSONObject req = JSON.parseObject(json);
-        int pageNum = req.getIntValue("pageNum");
-        int pageSize = req.getIntValue("pageSize");
-        PageHelper.startPage(pageNum, pageSize);//设置分页信息
-
-        List<BusinessInfo> list = BusinessService.queryAnalysisList();
-        PageInfo pageInfo = new PageInfo(list);
-        for (BusinessInfo businessInfo : list) {
-            if (businessInfo.getStatus().equals("1")) {
-                businessInfo.setStatus("解析完成");
-            } else if (businessInfo.getStatus().equals("2")) {
-                businessInfo.setStatus("白户");
-            }
-        }
-        JSONObject resJson = new JSONObject();
-        resJson.put("business_analysis_list", pageInfo);
-        return Result.success("ok", resJson);
-    }
-
-    //查询解析业务
-    @RequestMapping("selectBusinessAnalysis")
-    public Result selectBusinessAnalysis(@RequestBody String json) {
-        JSONObject req = JSON.parseObject(json);
-        int pageNum = req.getIntValue("pageNum");
-        int pageSize = req.getIntValue("pageSize");
-        String customerName = req.getString("customerName");
-        PageHelper.startPage(pageNum, pageSize);//设置分页信息
-
-        List<BusinessInfo> list = BusinessService.selectBusinessAnalysis(customerName);
-        PageInfo pageInfo = new PageInfo(list);
-
-        for (BusinessInfo businessInfo : list) {
-            if (businessInfo.getStatus().equals("3")) {
-                businessInfo.setStatus("查询失败");
-            } else if (businessInfo.getStatus().equals("4")) {
-                businessInfo.setStatus("查询异常");
-            }
-        }
-        JSONObject resJson = new JSONObject();
-        resJson.put("select_business_analysis", pageInfo);
-
-        return Result.success("ok", resJson);
-    }
-
-    /**
-     * 失败的业务
-     *
-     * @param json
-     * @return
-     */
-    @RequestMapping("businessFailList")
-    public Result businessFailList(@RequestBody String json) {
-        JSONObject req = JSON.parseObject(json);
-        int pageNum = req.getIntValue("pageNum");
-        int pageSize = req.getIntValue("pageSize");
-        PageHelper.startPage(pageNum, pageSize);//设置分页信息
-
-        List<BusinessInfo> list = BusinessService.queryFailList();
-        for (BusinessInfo businessInfo : list) {
-            if (businessInfo.getStatus().equals("3")) {
-                businessInfo.setStatus("查询失败");
-            } else if (businessInfo.getStatus().equals("4")) {
-                businessInfo.setStatus("查询异常");
-            }
-        }
-        PageInfo pageInfo = new PageInfo(list);
-        JSONObject resJson = new JSONObject();
-        resJson.put("business_fail_list", pageInfo);
-        return Result.success("ok", resJson);
-    }
-
-    //查询失败业务
-    @RequestMapping("selectBusinessFail")
-    public Result selectBusinessFail(@RequestBody String json) {
-        JSONObject req = JSON.parseObject(json);
-        int pageNum = req.getIntValue("pageNum");
-        int pageSize = req.getIntValue("pageSize");
-        String customerName = req.getString("customerName");
-        PageHelper.startPage(pageNum, pageSize);//设置分页信息
-
-        List<BusinessInfo> list = BusinessService.selectBusinessFail(customerName);
-        PageInfo pageInfo = new PageInfo(list);
-
-        for (int i = 0; i < list.size(); i++) {
-            list.get(i).setStatus("待解决");
-        }
-        JSONObject resJson = new JSONObject();
-        resJson.put("select_business_fail", pageInfo);
+        resJson.put("select_business_list", pageInfo);
         return Result.success("ok", resJson);
     }
+//    /**
+//     * 待解析的业务
+//     *
+//     * @param json
+//     * @return
+//     */
+//    @RequestMapping("selectBusinessToDo")
+//    public Result selectBusinessToDo(@RequestBody String json) {
+//        JSONObject req = JSON.parseObject(json);
+//        int pageNum = req.getIntValue("pageNum");
+//        int pageSize = req.getIntValue("pageSize");
+//        String customerName = req.getString("customerName");
+//        PageHelper.startPage(pageNum, pageSize);//设置分页信息
+//
+//        List<BusinessInfo> list = BusinessService.selectBusinessToDo(customerName);
+//        PageInfo pageInfo = new PageInfo(list);
+//
+//        for (BusinessInfo businessInfo : list) {
+//            if (businessInfo.getStatus().equals("0")) {
+//                businessInfo.setStatus("待解析");
+//            }
+//        }
+//        JSONObject resJson = new JSONObject();
+//        resJson.put("select_business_todo", pageInfo);
+//        return Result.success("ok", resJson);
+//    }
+//
+//    /**
+//     * 解析成功的业务列表
+//     *
+//     * @param json
+//     * @return
+//     */
+//    @RequestMapping("businessAnalysisList")
+//    public Result businessAnalysisList(@RequestBody String json) {
+//        JSONObject req = JSON.parseObject(json);
+//        int pageNum = req.getIntValue("pageNum");
+//        int pageSize = req.getIntValue("pageSize");
+//        PageHelper.startPage(pageNum, pageSize);//设置分页信息
+//
+//        List<BusinessInfo> list = BusinessService.queryAnalysisList("'1','2'");
+//        PageInfo pageInfo = new PageInfo(list);
+//        for (BusinessInfo businessInfo : list) {
+//            if (businessInfo.getStatus().equals("1")) {
+//                businessInfo.setStatus("解析完成");
+//            } else if (businessInfo.getStatus().equals("2")) {
+//                businessInfo.setStatus("白户");
+//            }
+//        }
+//        JSONObject resJson = new JSONObject();
+//        resJson.put("business_analysis_list", pageInfo);
+//        return Result.success("ok", resJson);
+//    }
+//
+//    //查询解析业务
+//    @RequestMapping("selectBusinessAnalysis")
+//    public Result selectBusinessAnalysis(@RequestBody String json) {
+//        JSONObject req = JSON.parseObject(json);
+//        int pageNum = req.getIntValue("pageNum");
+//        int pageSize = req.getIntValue("pageSize");
+//        String customerName = req.getString("customerName");
+//        PageHelper.startPage(pageNum, pageSize);//设置分页信息
+//
+//        List<BusinessInfo> list = BusinessService.selectBusinessAnalysis(customerName);
+//        PageInfo pageInfo = new PageInfo(list);
+//
+//        for (BusinessInfo businessInfo : list) {
+//            if (businessInfo.getStatus().equals("3")) {
+//                businessInfo.setStatus("查询失败");
+//            } else if (businessInfo.getStatus().equals("4")) {
+//                businessInfo.setStatus("查询异常");
+//            }
+//        }
+//        JSONObject resJson = new JSONObject();
+//        resJson.put("select_business_analysis", pageInfo);
+//
+//        return Result.success("ok", resJson);
+//    }
+//
+//    /**
+//     * 失败的业务
+//     *
+//     * @param json
+//     * @return
+//     */
+//    @RequestMapping("businessFailList")
+//    public Result businessFailList(@RequestBody String json) {
+//        JSONObject req = JSON.parseObject(json);
+//        int pageNum = req.getIntValue("pageNum");
+//        int pageSize = req.getIntValue("pageSize");
+//        PageHelper.startPage(pageNum, pageSize);//设置分页信息
+//
+//        List<BusinessInfo> list = BusinessService.queryFailList();
+//        for (BusinessInfo businessInfo : list) {
+//            if (businessInfo.getStatus().equals("3")) {
+//                businessInfo.setStatus("查询失败");
+//            } else if (businessInfo.getStatus().equals("4")) {
+//                businessInfo.setStatus("查询异常");
+//            }
+//        }
+//        PageInfo pageInfo = new PageInfo(list);
+//        JSONObject resJson = new JSONObject();
+//        resJson.put("business_fail_list", pageInfo);
+//        return Result.success("ok", resJson);
+//    }
+//
+//    //查询失败业务
+//    @RequestMapping("selectBusinessFail")
+//    public Result selectBusinessFail(@RequestBody String json) {
+//        JSONObject req = JSON.parseObject(json);
+//        int pageNum = req.getIntValue("pageNum");
+//        int pageSize = req.getIntValue("pageSize");
+//        String customerName = req.getString("customerName");
+//        PageHelper.startPage(pageNum, pageSize);//设置分页信息
+//
+//        List<BusinessInfo> list = BusinessService.selectBusinessFail(customerName);
+//        PageInfo pageInfo = new PageInfo(list);
+//
+//        for (int i = 0; i < list.size(); i++) {
+//            list.get(i).setStatus("待解决");
+//        }
+//        JSONObject resJson = new JSONObject();
+//        resJson.put("select_business_fail", pageInfo);
+//        return Result.success("ok", resJson);
+//    }
 
     @GetMapping("findBusinessInfoByNum/{businessNum}")
     public Result findBusinessInfoByNum(@PathVariable("businessNum") String businessNum) {

+ 3 - 1
src/main/java/com/kexun/mapper/BusinessMapper.java

@@ -11,8 +11,10 @@ import java.util.List;
  */
 public interface BusinessMapper extends BaseMapper<BusinessInfo> {
 
+    List<BusinessInfo> QueryBusinessList(@Param("params") String params, @Param("customerName") String customerName);
+
     List<BusinessInfo> QueryToDoList();
-    List<BusinessInfo> QueryAnalysisList();
+    List<BusinessInfo> QueryAnalysisList(@Param("params") String params);
 
     List<BusinessInfo> QueryFailList();
     BusinessInfo queryBusinessInfoByNum(@Param("businessNum") String businessNum);

+ 2 - 1
src/main/java/com/kexun/service/BusinessService.java

@@ -9,9 +9,10 @@ import java.util.List;
  *
  */
 public interface BusinessService extends IService<BusinessInfo> {
+    List<BusinessInfo> queryBusinessList(String params,String customerName);
     List<BusinessInfo> queryToDoList();
 
-    List<BusinessInfo> queryAnalysisList();
+    List<BusinessInfo> queryAnalysisList(String params);
     List<BusinessInfo> queryFailList();
     BusinessInfo QueryBusinessInfoByNum(String businessNum);
 

+ 7 - 3
src/main/java/com/kexun/service/impl/BusinessServiceImpl.java

@@ -22,15 +22,19 @@ public class BusinessServiceImpl extends ServiceImpl<BusinessMapper, BusinessInf
     @Resource
     BusinessMapper businessMapper;
 
+    @Override
+    public List<BusinessInfo> queryBusinessList(String params,String customerName){
+        List<BusinessInfo> l = businessMapper.QueryBusinessList(params,customerName);
+        return l;
+    }
     @Override
     public List<BusinessInfo> queryToDoList(){
         List<BusinessInfo> l = businessMapper.QueryToDoList();
         return l;
     }
-
     @Override
-    public List<BusinessInfo> queryAnalysisList(){
-        List<BusinessInfo> l = businessMapper.QueryAnalysisList();
+    public List<BusinessInfo> queryAnalysisList(String params){
+        List<BusinessInfo> l = businessMapper.QueryAnalysisList(params);
         return l;
     }
 

+ 22 - 1
src/main/resources/mapper/BusinessMapper.xml

@@ -19,7 +19,28 @@
 
     </resultMap>
 
+    <select id="QueryBusinessList" resultType="com.kexun.entity.BusinessInfo">
+        SELECT DISTINCT
+            r.id,
+            r.head_inf_id,
+            r.business_num,
+            r.customer_name,
+            r.create_time,
+            r.certificate_num,
+            r.coop_business_num,
+            r.product_num,
+            r.status,
+            p.cooperator_name,
+            p.product_name
+        FROM
+            report_info r LEFT JOIN prd_product p ON  p.product_num = r.product_num
+        WHERE r.status in (${params}) and r.is_deleted=0 and p.is_deleted=0
+        <if test="customerName!=null">
+            and r.customer_name LIKE concat('%',#{customerName},'%')
+        </if>
+        ORDER BY r.create_time DESC ,r.id DESC
 
+    </select>
     <select id="QueryToDoList" resultType="com.kexun.entity.BusinessInfo">
         SELECT DISTINCT
             r.id,
@@ -77,7 +98,7 @@
         FROM
             report_info r
                 LEFT JOIN prd_product p ON  p.product_num = r.product_num
-        WHERE r.status in ('1','2')
+        WHERE r.status in (${params})
         order by r.create_time desc ,r.id desc
 
     </select>

+ 4 - 3
src/main/resources/mapper/CooperatorMapper.xml

@@ -86,15 +86,16 @@
             WHERE is_deleted=0
         ) tno
         ON coo.template_no=tno.template_no
-        ORDER BY coo.create_time DESC
+        WHERE coo.is_deleted=0
+        ORDER BY coo.create_time DESC,coo.id DESC
 
 
     </select>
 
     <select id="selectCoop" resultType="com.kexun.entity.CooperatorInfo">
         select * from cooperator_info
-        WHERE cooperator_name LIKE concat('%',#{info},'%')
-        order by create_time desc
+        WHERE cooperator_name LIKE concat('%',#{info},'%') and is_deleted=0
+        order by create_time DESC,id DESC
 
     </select>
 

+ 3 - 2
src/main/resources/mapper/CooperatorProductMapper.xml

@@ -76,13 +76,14 @@
         FROM
             prd_product
                 LEFT JOIN model ON model.id = prd_product.model_id
-        order by create_time desc
+        WHERE prd_product.is_deleted=0 and model.is_deleted=0
+        order by prd_product.create_time desc,prd_product.product_num desc
 
     </select>
 
     <select id="selectCoopProduct" resultType="com.kexun.entity.CooperatorProduct">
         select * from prd_product
-        WHERE product_name LIKE concat('%',#{info},'%')
+        WHERE product_name LIKE concat('%',#{info},'%') and is_deleted=0
         order by create_time desc
 
     </select>

+ 3 - 1
src/main/resources/mapper/FieldDefineMapper.xml

@@ -74,6 +74,7 @@
         from field_define
         where category = #{cat}
           and is_deleted = 0
+        order by create_time desc,id desc
 
 
     </select>
@@ -83,6 +84,7 @@
         from field_define
         WHERE name_zh LIKE concat('%', #{info}, '%')
           and is_deleted = 0
+        order by create_time desc,id desc
 
     </select>
 
@@ -91,7 +93,7 @@
         from field_define
         WHERE name_zh LIKE concat('%', #{info}, '%')
           and is_deleted = 0
-        order by create_time desc
+        order by create_time desc,id desc
 
     </select>
 

+ 2 - 2
src/main/resources/mapper/FieldTemplateMapper.xml

@@ -17,7 +17,7 @@
     <select id="selectAll" resultType="com.kexun.entity.FieldTemplateEntity">
             SELECT * from field_template
             WHERE is_deleted = 0
-            ORDER BY create_time DESC
+            ORDER BY create_time DESC,id desc
 
     </select>
 
@@ -25,7 +25,7 @@
         select * from field_template
         WHERE template_name LIKE concat('%',#{templateName},'%')
           and is_deleted = 0
-        ORDER BY create_time DESC
+        ORDER BY create_time DESC,id desc
 
     </select>
     <update id="updateStatus">