3
0

3 کامیت‌ها 95dbabadd6 ... 873eb6b72e

نویسنده SHA1 پیام تاریخ
  maqingyang 873eb6b72e Merge remote-tracking branch 'origin/develop' into develop 11 ماه پیش
  maqingyang 0a58ba917b fixed bugs in search 11 ماه پیش
  maqingyang d050b93101 fixed some bugs 11 ماه پیش

+ 188 - 143
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,157 +73,202 @@ 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("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) {
+//
+//    /**
+//     * 获取待办业务列表
+//     *
+//     * @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);
         int pageNum = req.getIntValue("pageNum");
         int pageSize = req.getIntValue("pageSize");
         String customerName = req.getString("customerName");
+        int businessType = req.getIntValue("businessType");
         PageHelper.startPage(pageNum, pageSize);//设置分页信息
+        List<BusinessInfo> list=null;
+        switch(businessType){
+            case 0:
+                list = BusinessService.queryBusinessList("'0'",customerName);
+                for (BusinessInfo businessInfo : list) {
+                    if (businessInfo.getStatus().equals("0")) {
+                        businessInfo.setStatus("待解析");
+                    }
+                }
+                break;
+            case 1:
+                list = BusinessService.queryBusinessList("'1','2'",customerName);
+                for (BusinessInfo businessInfo : list) {
+                    if (businessInfo.getStatus().equals("1")) {
+                        businessInfo.setStatus("解析完成");
+                    } else if (businessInfo.getStatus().equals("2")) {
+                        businessInfo.setStatus("白户");
+                    }
+                }
+                break;
+            case 2:
+                list = BusinessService.queryBusinessList("'3','4'",customerName);
+                for (BusinessInfo businessInfo : list) {
+                    if (businessInfo.getStatus().equals("3")) {
+                        businessInfo.setStatus("查询失败");
+                    } else if (businessInfo.getStatus().equals("4")) {
+                        businessInfo.setStatus("查询异常");
+                    }
+                }
+                break;
 
-        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,
@@ -80,7 +101,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">