소스 검색

Merge remote-tracking branch 'origin/develop' into develop

Danj0rr 1 년 전
부모
커밋
1594b26922

+ 26 - 2
src/main/java/com/kexun/controller/CooperatorController.java

@@ -43,8 +43,7 @@ public class CooperatorController {
         JSONObject req = JSON.parseObject(json);
         int pageNum = req.getIntValue("pageNum");
         int pageSize = req.getIntValue("pageSize");
-        System.out.println(pageNum);
-        System.out.println(pageSize);
+
         PageHelper.startPage(pageNum, pageSize);//设置分页信息
         JSONObject resJson=new JSONObject();
         List<CooperatorInfo> list= CooperatorService.selectPage();
@@ -61,6 +60,31 @@ public class CooperatorController {
         return Result.success("ok",resJson);
     }
 
+    //模糊查询
+    @RequestMapping("selectCooperator")
+
+    public Result selectCooperator(@RequestBody String json) {
+        JSONObject req = JSON.parseObject(json);
+        int pageNum = req.getIntValue("pageNum");
+        int pageSize = req.getIntValue("pageSize");
+        String cooperatorName = req.getString("cooperatorName");
+        System.out.println("this is:"+cooperatorName);
+        PageHelper.startPage(pageNum, pageSize);//设置分页信息
+        JSONObject resJson=new JSONObject();
+        List<CooperatorInfo> list= CooperatorService.selectCoop(cooperatorName);
+
+        for(int i=0; i<list.size(); i++)
+        {
+            String time = list.get(i).getCreateTime().replace(".0","");
+            list.get(i).setCreateTime(time);
+        }
+        PageInfo pageInfo=new PageInfo(list);
+        resJson.put("select_cooperator_List",pageInfo);
+        System.out.println(resJson);
+
+        return Result.success("ok",resJson);
+    }
+
     // 新增合作方
     @PostMapping("add")
     public Result cooperatorAdd(@RequestBody String json)

+ 31 - 0
src/main/java/com/kexun/controller/CooperatorProductController.java

@@ -38,11 +38,42 @@ public class CooperatorProductController {
         PageHelper.startPage(pageNum, pageSize);//设置分页信息
         JSONObject resJson=new JSONObject();
         List<CooperatorProduct> list=CooperatorProductService.selectPage();
+
+        for(int i=0; i<list.size(); i++)
+        {
+            String time = list.get(i).getCreateTime().replace(".0","");
+            list.get(i).setCreateTime(time);
+        }
         PageInfo pageInfo=new PageInfo(list);
         resJson.put("cooperator_Product_List",pageInfo);
         return Result.success("ok",resJson);
     }
 
+    //模糊查询
+    @RequestMapping("selectCoopProduct")
+
+    public Result selectCoopProduct(@RequestBody String json) {
+        JSONObject req = JSON.parseObject(json);
+        int pageNum = req.getIntValue("pageNum");
+        int pageSize = req.getIntValue("pageSize");
+        String productName = req.getString("productName");
+
+        PageHelper.startPage(pageNum, pageSize);//设置分页信息
+        JSONObject resJson=new JSONObject();
+        List<CooperatorProduct> list=CooperatorProductService.selectCoopProduct(productName);
+
+        for(int i=0; i<list.size(); i++)
+        {
+            String time = list.get(i).getCreateTime().replace(".0","");
+            list.get(i).setCreateTime(time);
+        }
+        PageInfo pageInfo=new PageInfo(list);
+        resJson.put("select_cooperator_Product_List",pageInfo);
+        System.out.println(resJson);
+
+        return Result.success("ok",resJson);
+    }
+
     @RequestMapping("getCooperatorByModel")
     public Result getCooperatorByModel(@RequestBody String json) {
         JSONObject req = JSON.parseObject(json);

+ 29 - 7
src/main/java/com/kexun/controller/FieldDefineController.java

@@ -87,14 +87,26 @@ public class FieldDefineController {
         int pageSize = req.getIntValue("pageSize");
         PageHelper.startPage(pageNum, pageSize);//设置分页信息
         List<FieldDefineEntity> list = fieldDefineService.selectPage();
-
         PageInfo pageInfo=new PageInfo(list);
-
         System.out.println(pageInfo);
         JSONObject resJson = new JSONObject();
         resJson.put("fieldListBase", pageInfo);
+        return Result.success("ok", resJson);
+    }
 
+    @RequestMapping("/selectFieldListBase")
+    public Result selectFieldListBase(@RequestBody String json){
+        JSONObject req = JSON.parseObject(json);
+        int pageNum = req.getIntValue("pageNum");
+        int pageSize = req.getIntValue("pageSize");
+        String nameZh = req.getString("nameZh");
 
+        PageHelper.startPage(pageNum, pageSize);//设置分页信息
+        List<FieldDefineEntity> list = fieldDefineService.selectBase(nameZh);
+        PageInfo pageInfo=new PageInfo(list);
+        System.out.println(pageInfo);
+        JSONObject resJson = new JSONObject();
+        resJson.put("selectFieldListBase", pageInfo);
         return Result.success("ok", resJson);
     }
 
@@ -105,16 +117,26 @@ public class FieldDefineController {
         int pageNum = req.getIntValue("pageNum");
         int pageSize = req.getIntValue("pageSize");
         PageHelper.startPage(pageNum, pageSize);//设置分页信息
-
         List<FieldDefineEntity> list2 = fieldDefineService.selectPage2();
-
         PageInfo pageInfo2=new PageInfo(list2);
-
-        System.out.println(pageInfo2);
         JSONObject resJson = new JSONObject();
-
         resJson.put("fieldListDerive", pageInfo2);
+        return Result.success("ok", resJson);
+    }
 
+    @RequestMapping("/selectFieldListDerive")
+    public Result selectFieldListDerive(@RequestBody String json){
+        JSONObject req = JSON.parseObject(json);
+        int pageNum = req.getIntValue("pageNum");
+        int pageSize = req.getIntValue("pageSize");
+        String nameZh = req.getString("nameZh");
+
+        PageHelper.startPage(pageNum, pageSize);//设置分页信息
+        List<FieldDefineEntity> list = fieldDefineService.selectDerive(nameZh);
+        PageInfo pageInfo=new PageInfo(list);
+        System.out.println(pageInfo);
+        JSONObject resJson = new JSONObject();
+        resJson.put("selectFieldListDerive", pageInfo);
         return Result.success("ok", resJson);
     }
     /**

+ 15 - 2
src/main/java/com/kexun/controller/FieldTemplateController.java

@@ -69,12 +69,25 @@ public class FieldTemplateController {
         PageInfo pageInfo=new PageInfo(list);
         System.out.println(pageInfo);
         JSONObject resJson = new JSONObject();
-
         resJson.put("field_template_list", pageInfo);
-
         return Result.success("ok", resJson);
     }
 
+    @RequestMapping("/selectTemplate")
+    public Result selectTemplate(@RequestBody String json){
+        JSONObject req = JSON.parseObject(json);
+        int pageNum = req.getIntValue("pageNum");
+        int pageSize = req.getIntValue("pageSize");
+        String templateName = req.getString("templateName");
+
+        PageHelper.startPage(pageNum, pageSize);//设置分页信息
+        List<FieldTemplateEntity> list = fieldTemplateService.selectTemplate(templateName);
+        PageInfo pageInfo=new PageInfo(list);
+        System.out.println(pageInfo);
+        JSONObject resJson = new JSONObject();
+        resJson.put("select_field_template_list", pageInfo);
+        return Result.success("ok", resJson);
+    }
 
 
     /**

+ 3 - 0
src/main/java/com/kexun/mapper/CooperatorMapper.java

@@ -18,6 +18,9 @@ public interface CooperatorMapper extends BaseMapper<CooperatorInfo> {
     List<CooperatorProduct> QueryProduct(@Param("cooperatorNum") String cooperatorNum);
 
     List<CooperatorInfo> selectAll();
+
+    List<CooperatorInfo> selectCoop(String info);
+
 }
 
 

+ 2 - 0
src/main/java/com/kexun/mapper/CooperatorProductMapper.java

@@ -22,5 +22,7 @@ public interface CooperatorProductMapper extends BaseMapper<CooperatorProduct> {
 
     List<CooperatorProduct> selectProduct();
 
+    List<CooperatorProduct> selectCoopProduct(String info);
+
     List<CooperatorProduct> getCooperatorByModelQuery(@Param("modelNo") Long modelNo);
 }

+ 3 - 0
src/main/java/com/kexun/mapper/FieldDefineMapper.java

@@ -28,4 +28,7 @@ public interface FieldDefineMapper extends BaseMapper<FieldDefineEntity> {
     List<FieldDefineEntity> selectAll(String cat);
 
 
+    List<FieldDefineEntity> selectBase(String info);
+
+    List<FieldDefineEntity> selectDerive(String info);
 }

+ 2 - 0
src/main/java/com/kexun/mapper/FieldTemplateMapper.java

@@ -21,6 +21,8 @@ public interface FieldTemplateMapper extends BaseMapper<FieldTemplateEntity> {
 
     List<FieldTemplateEntity> selectAll();
 
+    List<FieldTemplateEntity> selectTemplate(String templateName);
+
 //    List<FieldTemplateEntity> selectAll();
 }
 

+ 2 - 0
src/main/java/com/kexun/service/CooperatorProductService.java

@@ -20,5 +20,7 @@ public interface CooperatorProductService extends IService<CooperatorProduct> {
 
     List<CooperatorProduct> selectPage();
 
+    List<CooperatorProduct> selectCoopProduct(String info);
+
     List<CooperatorProduct> getCooperatorByModel(Long modelNo);
 }

+ 3 - 0
src/main/java/com/kexun/service/CooperatorService.java

@@ -20,4 +20,7 @@ public interface CooperatorService extends IService<CooperatorInfo> {
     CooperatorInfo findByID(long id);
 
     List<CooperatorInfo> selectPage();
+
+    List<CooperatorInfo> selectCoop(String info);
+
 }

+ 7 - 0
src/main/java/com/kexun/service/FieldDefineService.java

@@ -3,6 +3,7 @@ package com.kexun.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.kexun.entity.CooperatorInfo;
+import com.kexun.entity.CooperatorProduct;
 import com.kexun.entity.FieldDefineEntity;
 import com.kexun.model.ro.FiledRO;
 import com.kexun.model.ro.FiledUpdateRO;
@@ -53,6 +54,12 @@ public interface FieldDefineService extends IService<FieldDefineEntity> {
 
     List<FieldDefineEntity> selectPage();
 
+    List<FieldDefineEntity> selectBase(String info);
+
+
     List<FieldDefineEntity> selectPage2();
 
+    List<FieldDefineEntity> selectDerive(String info);
+
+
 }

+ 1 - 0
src/main/java/com/kexun/service/FieldTemplateService.java

@@ -66,4 +66,5 @@ public interface FieldTemplateService extends IService<FieldTemplateEntity> {
      */
     FiledTemplateVO detail(Long id);
 
+    List<FieldTemplateEntity> selectTemplate(String templateName);
 }

+ 7 - 0
src/main/java/com/kexun/service/impl/CooperatorProductServiceImpl.java

@@ -55,6 +55,13 @@ public class CooperatorProductServiceImpl extends ServiceImpl<CooperatorProductM
         List<CooperatorProduct> l = cooperatorProductMapper.selectProduct();
         return l;
     }
+
+    public List<CooperatorProduct> selectCoopProduct(String info) {
+//        System.out.println("aaa");
+        List<CooperatorProduct> l = cooperatorProductMapper.selectCoopProduct(info);
+        return l;
+    }
+
     @Override
     public List<CooperatorProduct> getCooperatorByModel(Long modelNo){
         return cooperatorProductMapper.getCooperatorByModelQuery(modelNo);

+ 4 - 0
src/main/java/com/kexun/service/impl/CooperatorServiceImpl.java

@@ -45,6 +45,10 @@ public class CooperatorServiceImpl extends ServiceImpl<CooperatorMapper, Coopera
         return l;
     }
 
+    public List<CooperatorInfo> selectCoop(String info) {
+        List<CooperatorInfo> l = cooperatorMapper.selectCoop(info);
+        return l;
+    }
     @Override
     public CooperatorInfo findByID(long id) {
         QueryWrapper<CooperatorInfo> wrapper=new QueryWrapper<CooperatorInfo>().eq("id",id);

+ 10 - 0
src/main/java/com/kexun/service/impl/FieldDefineServiceImpl.java

@@ -84,6 +84,11 @@ public class FieldDefineServiceImpl extends ServiceImpl<FieldDefineMapper, Field
         return l;
     }
 
+    public List<FieldDefineEntity> selectBase(String info) {
+        List<FieldDefineEntity> l = fieldDefineMapper.selectBase(info);
+        return l;
+    }
+
     public List<FieldDefineEntity> selectPage2() {
 //        System.out.println("aaa");
         String cat = "2";
@@ -91,6 +96,11 @@ public class FieldDefineServiceImpl extends ServiceImpl<FieldDefineMapper, Field
         return l;
     }
 
+    public List<FieldDefineEntity> selectDerive(String info) {
+        List<FieldDefineEntity> l = fieldDefineMapper.selectDerive(info);
+        return l;
+    }
+
     /**
      * 保存或者修改字段定义
      * @param filedUpdateRO

+ 5 - 0
src/main/java/com/kexun/service/impl/FieldTemplateServiceImpl.java

@@ -70,6 +70,11 @@ public class FieldTemplateServiceImpl extends ServiceImpl<FieldTemplateMapper, F
         return l;
     }
 
+    public List<FieldTemplateEntity> selectTemplate(String templateName) {
+        List<FieldTemplateEntity> l = fieldTemplateMapper.selectTemplate(templateName);
+        return l;
+    }
+
     /**
      * 保存模板字段
      *

+ 4 - 4
src/main/resources/mapper/BusinessMapper.xml

@@ -36,7 +36,7 @@
         LEFT JOIN cooperator_info ON cooperator_info.cooperator_num = report_info.coop_business_num
         LEFT JOIN prd_product ON  prd_product.product_num = report_info.product_num
         WHERE
-            report_info.status = 1;
+            report_info.status = 1
     </select>
 
     <select id="QueryAnalysisList" resultType="com.kexun.entity.BusinessInfo">
@@ -56,7 +56,7 @@
                 LEFT JOIN cooperator_info ON cooperator_info.cooperator_num = report_info.coop_business_num
                 LEFT JOIN prd_product ON  prd_product.product_num = report_info.product_num
         WHERE
-            report_info.status = 2;
+            report_info.status = 2
     </select>
 
     <select id="QueryFailList" resultType="com.kexun.entity.BusinessInfo">
@@ -76,7 +76,7 @@
                 LEFT JOIN cooperator_info ON cooperator_info.cooperator_num = report_info.coop_business_num
                 LEFT JOIN prd_product ON  prd_product.product_num = report_info.product_num
         WHERE
-            report_info.status = 3;
+            report_info.status = 3
     </select>
 
     <select id="queryBusinessInfoByNum" resultType="com.kexun.entity.BusinessInfo">
@@ -94,7 +94,7 @@
                 LEFT JOIN cooperator_info ON cooperator_info.cooperator_num = report_info.coop_business_num
                 LEFT JOIN prd_product ON  prd_product.product_num = report_info.product_num
         WHERE
-            report_info.business_num = #{businessNum};
+            report_info.business_num = #{businessNum}
     </select>
 
 

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

@@ -61,7 +61,11 @@
 
     </select>
 
+    <select id="selectCoop" resultType="com.kexun.entity.CooperatorInfo">
+        select * from cooperator_info
+        WHERE cooperator_name LIKE concat('%',#{info},'%')
 
+    </select>
 
     <select id="QueryProduct" resultType="com.kexun.entity.CooperatorProduct" >
         SELECT DISTINCT

+ 6 - 0
src/main/resources/mapper/CooperatorProductMapper.xml

@@ -62,6 +62,12 @@
     <select id="selectProduct" resultType="com.kexun.entity.CooperatorProduct">
         select * from prd_product
     </select>
+
+    <select id="selectCoopProduct" resultType="com.kexun.entity.CooperatorProduct">
+        select * from prd_product
+        WHERE product_name LIKE concat('%',#{info},'%')
+
+    </select>
     <select id="findCooperatorFieldsQuery" resultType="com.kexun.entity.CooperatorField">
         SELECT DISTINCT
         field_define.field_no,

+ 10 - 0
src/main/resources/mapper/FieldDefineMapper.xml

@@ -57,7 +57,17 @@
 
     </select>
 
+    <select id="selectBase" resultType="com.kexun.entity.FieldDefineEntity">
+        select * from field_define
+        WHERE name_zh LIKE concat('%',#{info},'%')
+
+    </select>
 
+    <select id="selectDerive" resultType="com.kexun.entity.FieldDefineEntity">
+        select * from field_define
+        WHERE name_zh LIKE concat('%',#{info},'%')
+
+    </select>
 
     <update id="updateStatus">
         update field_define

+ 4 - 0
src/main/resources/mapper/FieldTemplateMapper.xml

@@ -21,7 +21,11 @@
 
     </select>
 
+    <select id="selectTemplate" resultType="com.kexun.entity.FieldTemplateEntity">
+        select * from field_template
+        WHERE template_name LIKE concat('%',#{templateName},'%')
 
+    </select>
     <update id="updateStatus">
         update field_template
         set status = #{status}