Browse Source

debug35初版

zishan-an 1 year ago
parent
commit
a425abc98d

+ 7 - 4
src/main/java/com/kexun/controller/CooperatorController.java

@@ -92,11 +92,11 @@ public class CooperatorController {
         JSONObject req = JSON.parseObject(json);
         CooperatorInfo cooperatorInfo = new CooperatorInfo();
         cooperatorInfo.setCooperatorName(req.getString("cooperator_name"));
-        cooperatorInfo.setCooperatorNum(req.getString("cooperatorNum"));
+        cooperatorInfo.setCorpCertificateNum(req.getString("corpCertificateNum"));
         cooperatorInfo.setCorpCertificateType(req.getString("corp_certificate_type"));
 //        long time1 = System.currentTimeMillis();
 //        cooperatorInfo.setCooperatorNum(Long.toString(time1));
-        cooperatorInfo.setTemplateNo(req.getString("field_template_no"));
+        cooperatorInfo.setTemplateId(req.getString("field_template_id"));
         Calendar calendar= Calendar.getInstance();
         SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :HH:mm:ss");
         cooperatorInfo.setCreateTime(dateFormat.format(calendar.getTime()));
@@ -111,13 +111,16 @@ public class CooperatorController {
     {
         JSONObject req = JSON.parseObject(json);
         long cooperatorId=Long.valueOf(req.getString("cooperator_id")) ;
-//        System.out.println(cooperatorId);
+        System.out.println("asdffasdasfdafe");
+        System.out.println("asdffasdasfdafe");
+
         CooperatorInfo cooperatorInfo = CooperatorService.findByID(cooperatorId);
 
         cooperatorInfo.setCooperatorName(req.getString("cooperator_name"));
         cooperatorInfo.setCooperatorNum(req.getString("cooperatorNum"));
         cooperatorInfo.setCorpCertificateType(req.getString("corp_certificate_type"));
-
+//        Long templateID = (req.getString("fieldTemplateId")).toL;
+        cooperatorInfo.setTemplateId(req.getString("fieldTemplateId"));
         Calendar calendar= Calendar.getInstance();
         SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
         cooperatorInfo.setUpdateTime(dateFormat.format(calendar.getTime()));

+ 10 - 0
src/main/java/com/kexun/controller/FieldTemplateController.java

@@ -12,6 +12,7 @@ import com.kexun.model.ro.FiledTemplateRO;
 import com.kexun.model.ro.FiledTemplateUpdateRO;
 import com.kexun.model.vo.FiledTemplateVO;
 import com.kexun.service.BusinessService;
+import com.kexun.service.CooperatorService;
 import com.kexun.service.FieldTemplateService;
 import lombok.extern.java.Log;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -89,6 +90,15 @@ public class FieldTemplateController {
         return Result.success("ok", resJson);
     }
 
+    @GetMapping("getTemplateById")
+    public Result getTemplateById(@RequestParam Long id) {
+        JSONObject result = new JSONObject();
+        FieldTemplateEntity fieldTemplate = fieldTemplateService.findByID(id);
+        System.out.println("its name is:"+fieldTemplate.getTemplateName());
+        result.put("templateName",fieldTemplate.getTemplateName());
+
+        return Result.success("ok", result);
+    }
 
     /**
      * 字段模板详情

+ 5 - 2
src/main/java/com/kexun/entity/CooperatorInfo.java

@@ -32,6 +32,10 @@ public class CooperatorInfo implements Serializable {
     @TableField(value = "corp_certificate_num")
     private String corpCertificateNum;
 
+
+    @TableField(value = "template_id")
+    private String templateId;
+
     @TableField(value = "template_no")
     private String templateNo;
 
@@ -50,8 +54,7 @@ public class CooperatorInfo implements Serializable {
     @TableField(value = "update_time")
     private String updateTime;
 
-    @TableField(value = "template_name")
-    private String templateName;
+
 
 
 

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

@@ -67,4 +67,6 @@ public interface FieldTemplateService extends IService<FieldTemplateEntity> {
     FiledTemplateVO detail(Long id);
 
     List<FieldTemplateEntity> selectTemplate(String templateName);
+
+    FieldTemplateEntity findByID(long id);
 }

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

@@ -75,6 +75,11 @@ public class FieldTemplateServiceImpl extends ServiceImpl<FieldTemplateMapper, F
         return l;
     }
 
+
+    public FieldTemplateEntity findByID(long id) {
+        QueryWrapper<FieldTemplateEntity> wrapper=new QueryWrapper<FieldTemplateEntity>().eq("id",id);
+        return getOne(wrapper);
+    }
     /**
      * 保存模板字段
      *

+ 9 - 0
src/main/resources/mapper/BusinessMapper.xml

@@ -37,6 +37,8 @@
         LEFT JOIN prd_product ON  prd_product.product_num = report_info.product_num
         WHERE
             report_info.status = 1
+        order by create_time desc
+
     </select>
 
     <select id="selectBusinessToDo" resultType="com.kexun.entity.BusinessInfo">
@@ -55,6 +57,7 @@
         LEFT JOIN prd_product ON  prd_product.product_num = report_info.product_num
         WHERE customer_name LIKE concat('%',#{customer_name},'%')
         and             report_info.status = 1
+        order by create_time desc
 
     </select>
 
@@ -76,6 +79,8 @@
                 LEFT JOIN prd_product ON  prd_product.product_num = report_info.product_num
         WHERE
             report_info.status = 2
+        order by create_time desc
+
     </select>
 
     <select id="selectBusinessAnalysis" resultType="com.kexun.entity.BusinessInfo">
@@ -94,6 +99,7 @@
                  LEFT JOIN prd_product ON  prd_product.product_num = report_info.product_num
         WHERE customer_name LIKE concat('%',#{customer_name},'%')
           and             report_info.status = 2
+        order by create_time desc
 
     </select>
 
@@ -115,6 +121,8 @@
                 LEFT JOIN prd_product ON  prd_product.product_num = report_info.product_num
         WHERE
             report_info.status = 3
+        order by create_time desc
+
     </select>
     <select id="selectBusinessFail" resultType="com.kexun.entity.BusinessInfo">
         SELECT DISTINCT
@@ -132,6 +140,7 @@
                  LEFT JOIN prd_product ON  prd_product.product_num = report_info.product_num
         WHERE customer_name LIKE concat('%',#{customer_name},'%')
           and             report_info.status = 3
+        order by create_time desc
 
     </select>
     <select id="queryBusinessInfoByNum" resultType="com.kexun.entity.BusinessInfo">

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

@@ -43,27 +43,19 @@
         WHERE
             cooperator_info.cooperator_num = #{cooperatorNum};
 
-
     </select>
 
     <select id="selectAll" resultType="com.kexun.entity.CooperatorInfo">
-        SELECT *
-        FROM
-            (SELECT *
-            FROM
-                (
-                SELECT *,row_number()
-                OVER (PARTITION BY cooperator_name ORDER BY cooperator_name desc)num from cooperator_info
-                )A
-                WHERE A.num=1) AS sub_table LEFT JOIN field_template ON field_template.template_no = sub_table.template_no
-        WHERE  sub_table.is_deleted=0
-        ORDER BY sub_table.create_time DESC
+        select * from cooperator_info
+        order by create_time 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
 
     </select>
 

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

@@ -61,11 +61,14 @@
     </select>
     <select id="selectProduct" resultType="com.kexun.entity.CooperatorProduct">
         select * from prd_product
+        order by create_time desc
+
     </select>
 
     <select id="selectCoopProduct" resultType="com.kexun.entity.CooperatorProduct">
         select * from prd_product
         WHERE product_name LIKE concat('%',#{info},'%')
+        order by create_time desc
 
     </select>
     <select id="findCooperatorFieldsQuery" resultType="com.kexun.entity.CooperatorField">

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

@@ -60,12 +60,14 @@
     <select id="selectBase" resultType="com.kexun.entity.FieldDefineEntity">
         select * from field_define
         WHERE name_zh LIKE concat('%',#{info},'%')
+        order by create_time desc
 
     </select>
 
     <select id="selectDerive" resultType="com.kexun.entity.FieldDefineEntity">
         select * from field_define
         WHERE name_zh LIKE concat('%',#{info},'%')
+        order by create_time desc
 
     </select>