Selaa lähdekoodia

代办业务问题

zishan-an 11 kuukautta sitten
vanhempi
commit
729ed93746

+ 14 - 9
src/main/java/com/kexun/controller/BusinessController.java

@@ -189,12 +189,16 @@ public class BusinessController {
         return Result.success("ok", resJson);
     }
 
-    @GetMapping("findCustomInfoByNum/{businessNum}")
-    public Result findCustomInfoByNum(@PathVariable("businessNum") String businessNum) {
+
+    //查找逻辑修改原来是bussinessnum,1.2开始是headInfId
+    @GetMapping("findCustomInfoByHead/{headInfId}")
+    public Result findCustomInfoByHead(@PathVariable("headInfId") String headInfId) {
         JSONObject resJson = new JSONObject();
-        CustomInfo list1 = CustomInfoService.QueryCustomInfo(businessNum);
-        List<CustomInfo> list2 = CustomInfoService.QueryCustomTelephone(businessNum);
-        List<CustomInfo> list3 = CustomInfoService.QueryCustomAddress(businessNum);
+        CustomInfo list1 = CustomInfoService.QueryCustomInfo(headInfId);
+
+        //下面两个方法还不知道
+        List<CustomInfo> list2 = CustomInfoService.QueryCustomTelephone(headInfId);
+        List<CustomInfo> list3 = CustomInfoService.QueryCustomAddress(headInfId);
 
         System.out.println(list3);
         String telephonelist = "";
@@ -210,10 +214,11 @@ public class BusinessController {
             addresslist += (customInfo.address);
             addresslist += ";  ";
         }
-        list1.telephone = telephonelist;
-        list1.address = addresslist;
-        System.out.println(list1);
-
+        if(list1!=null) {
+            list1.telephone = telephonelist;
+            list1.address = addresslist;
+            System.out.println(list1);
+        }
         resJson.put("custom_info", list1);
 
 

+ 1 - 0
src/main/java/com/kexun/controller/ReportController.java

@@ -105,6 +105,7 @@ public class ReportController {
 //        return Result.success();
 //    }
 
+    //原来的逻辑是新增,2024.1.2之后改为修改 如果没有文件,改为新增,方法需要重写
     @PostMapping("fileReportAdd")
     public Result fileReportAdd(@RequestBody String json)
     {

+ 3 - 0
src/main/java/com/kexun/entity/BusinessInfo.java

@@ -17,6 +17,9 @@ public class BusinessInfo implements Serializable {
     @TableId(value = "id")
     private Long id;
 
+    @TableField("head_inf_id")
+    private Long headInfId;
+
     @TableField(value = "business_num")
     private String businessNum;
 

+ 3 - 3
src/main/java/com/kexun/service/CustomInfoService.java

@@ -11,8 +11,8 @@ import java.util.List;
  */
 public interface CustomInfoService extends IService<CustomInfo> {
 
-    CustomInfo QueryCustomInfo(String businessNum);
-    List<CustomInfo> QueryCustomTelephone(String businessNum);
-    List<CustomInfo> QueryCustomAddress(String businessNum);
+    CustomInfo QueryCustomInfo(String headInfId);
+    List<CustomInfo> QueryCustomTelephone(String headInfId);
+    List<CustomInfo> QueryCustomAddress(String headInfId);
 
 }

+ 6 - 6
src/main/java/com/kexun/service/impl/CustomInfoServiceImpl.java

@@ -23,20 +23,20 @@ public class CustomInfoServiceImpl extends ServiceImpl<CustomInfoMapper, CustomI
     CustomInfoMapper customInfoMapper;
 
     @Override
-    public CustomInfo QueryCustomInfo(String businessNum){
-        CustomInfo l = customInfoMapper.queryCustomInfo(businessNum);
+    public CustomInfo QueryCustomInfo(String headInfId){
+        CustomInfo l = customInfoMapper.queryCustomInfo(headInfId);
         return l;
     }
 
     @Override
-    public List<CustomInfo> QueryCustomTelephone(String businessNum){
-        List<CustomInfo> l = customInfoMapper.queryCustomTelephone(businessNum);
+    public List<CustomInfo> QueryCustomTelephone(String headInfId){
+        List<CustomInfo> l = customInfoMapper.queryCustomTelephone(headInfId);
         return l;
     }
 
     @Override
-    public List<CustomInfo> QueryCustomAddress(String businessNum){
-        List<CustomInfo> l = customInfoMapper.queryCustomAddress(businessNum);
+    public List<CustomInfo> QueryCustomAddress(String headInfId){
+        List<CustomInfo> l = customInfoMapper.queryCustomAddress(headInfId);
         return l;
     }
 

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

@@ -23,6 +23,7 @@
     <select id="QueryToDoList" resultType="com.kexun.entity.BusinessInfo">
         SELECT DISTINCT
             r.id,
+            r.head_inf_id,
             r.business_num,
             r.customer_name,
             r.create_time,
@@ -43,6 +44,7 @@
     <select id="selectBusinessToDo" resultType="com.kexun.entity.BusinessInfo">
         SELECT DISTINCT
             r.id,
+            r.head_inf_id,
             r.business_num,
             r.customer_name,
             r.create_time,

+ 3 - 3
src/main/resources/mapper/CustomInfoMapper.xml

@@ -30,7 +30,7 @@
         FROM
             cr_base_inf
         WHERE
-            cr_base_inf.rpt_no = #{businessNum};
+            cr_base_inf.head_inf_id = #{headInfId};
     </select>
 
     <select id="queryCustomTelephone" resultType="com.kexun.entity.CustomInfo">
@@ -40,7 +40,7 @@
             cr_base_inf
                 LEFT JOIN  cr_base_phone on cr_base_inf.rpt_no = cr_base_phone.rpt_no
         WHERE
-            cr_base_inf.rpt_no = #{businessNum};
+            cr_base_inf.head_inf_id = #{headInfId};
     </select>
 
     <select id="queryCustomAddress" resultType="com.kexun.entity.CustomInfo">
@@ -50,7 +50,7 @@
             cr_base_inf
                 LEFT JOIN  cr_base_residence on cr_base_inf.rpt_no = cr_base_residence.rpt_no
         WHERE
-            cr_base_inf.rpt_no = #{businessNum};
+            cr_base_inf.head_inf_id = #{headInfId};
     </select>