shixr 1 年之前
父节点
当前提交
83cd2f640d

+ 110 - 0
src/main/java/com/kexun/controller/BusinessController.java

@@ -0,0 +1,110 @@
+package com.kexun.controller;
+
+//import ch.qos.logback.core.rolling.helper.FileStoreUtil;
+//import ch.qos.logback.core.util.FileUtil;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.kexun.common.utils.Result;
+import com.kexun.entity.*;
+import com.kexun.service.BusinessService;
+import com.kexun.service.CooperatorService;
+import com.kexun.service.CustomInfoService;
+import lombok.extern.java.Log;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.List;
+
+@RestController
+@RequestMapping("/admin/business")
+@Log
+public class BusinessController {
+
+    @Autowired
+    private com.kexun.service.BusinessService BusinessService;
+
+    @Autowired
+    private CustomInfoService CustomInfoService;
+
+    // 获取待办业务列表
+    @GetMapping("businessToDoList")
+    public Result businessToDoList() {
+        JSONObject resJson=new JSONObject();
+        List<BusinessInfo> list= BusinessService.queryToDoList();
+        resJson.put("business_todo_list",list);
+        System.out.println(list);
+
+        return Result.success("ok",resJson);
+    }
+
+    // 获取解析业务列表
+    @GetMapping("businessAnalysisList")
+    public Result businessAnalysisList() {
+        JSONObject resJson=new JSONObject();
+        List<BusinessInfo> list= BusinessService.queryAnalysisList();
+        resJson.put("business_todo_list",list);
+        System.out.println(list);
+
+        return Result.success("ok",resJson);
+    }
+
+    @GetMapping("businessFailList")
+    public Result businessFailList() {
+        JSONObject resJson=new JSONObject();
+        List<BusinessInfo> list= BusinessService.queryFailList();
+        resJson.put("business_todo_list",list);
+        System.out.println(list);
+
+        return Result.success("ok",resJson);
+    }
+
+    @GetMapping("findBusinessInfoByNum/{businessNum}")
+    public Result findBusinessInfoByNum(@PathVariable("businessNum") String businessNum){
+        JSONObject resJson=new JSONObject();
+        BusinessInfo list = BusinessService.QueryBusinessInfoByNum(businessNum);
+        resJson.put("business_info",list);
+        System.out.println(list);
+
+        return Result.success("ok",resJson);
+    }
+
+    @GetMapping("findCustomInfoByNum/{businessNum}")
+    public Result findCustomInfoByNum(@PathVariable("businessNum") String businessNum){
+        JSONObject resJson=new JSONObject();
+        CustomInfo list1 = CustomInfoService.QueryCustomInfo(businessNum);
+        List<CustomInfo> list2 = CustomInfoService.QueryCustomTelephone(businessNum);
+        List<CustomInfo> list3 = CustomInfoService.QueryCustomAddress(businessNum);
+
+        System.out.println(list3);
+        String telephonelist = "";
+        for(int i=0; i<list2.size(); i++)
+        {
+            CustomInfo customInfo = list2.get(i);
+            telephonelist += (customInfo.telephone);
+            telephonelist += ";  ";
+        }
+
+        String addresslist = "";
+        for(int i=0; i<list3.size(); i++)
+        {
+            CustomInfo customInfo = list3.get(i);
+            addresslist += (customInfo.address);
+            addresslist += ";  ";
+        }
+        list1.telephone = telephonelist;
+        list1.address = addresslist;
+        System.out.println(list1);
+
+        resJson.put("custom_info",list1);
+
+
+        return Result.success("ok",resJson);
+    }
+
+}

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

@@ -0,0 +1,40 @@
+package com.kexun.controller;
+
+//import ch.qos.logback.core.rolling.helper.FileStoreUtil;
+//import ch.qos.logback.core.util.FileUtil;
+
+import com.alibaba.fastjson.JSONObject;
+import com.kexun.common.utils.Result;
+import com.kexun.entity.BusinessInfo;
+import com.kexun.entity.CustomInfo;
+import com.kexun.entity.ReportFile;
+import com.kexun.service.CustomInfoService;
+import lombok.extern.java.Log;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/admin/report")
+@Log
+public class ReportController {
+
+    @Autowired
+    private com.kexun.service.ReportService ReportService;
+
+
+    @GetMapping("reportFileList")
+    public Result businessToDoList() {
+        JSONObject resJson=new JSONObject();
+        List<ReportFile> list= ReportService.list();
+        resJson.put("report_file_list",list);
+        System.out.println(list);
+
+        return Result.success("ok",resJson);
+    }
+
+}

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

@@ -0,0 +1,40 @@
+package com.kexun.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@TableName(value = "report_info")
+@Data
+public class BusinessInfo implements Serializable {
+
+
+    @TableId(value = "id")
+    private Long id;
+
+    @TableField(value = "business_num")
+    private String businessNum;
+
+    @TableField(value = "customer_name")
+    private String customerName;
+
+    @TableField(value = "coop_business_num")
+    private String coopBusinessNum;
+    private String cooperatorName;
+
+    @TableField(value = "product_num")
+    private String productNum;
+    private String productName;
+
+    @TableField(value = "certificate_num")
+    private String certificateNum;
+
+    @TableField(value = " create_time")
+    private String createTime;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 42 - 0
src/main/java/com/kexun/entity/CustomInfo.java

@@ -0,0 +1,42 @@
+package com.kexun.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@TableName(value = "cr_base_inf")
+@Data
+public class CustomInfo implements Serializable {
+
+
+    @TableId(value = "id")
+    private Long id;
+
+    @TableField(value = "customer_num")
+    private String customerNum;
+
+    @TableField(value = "name")
+    private String name;
+
+    @TableField(value = "id_type_code")
+    private String idTypeCode;
+
+    @TableField(value = "id_num")
+    private String idNum;
+
+    @TableField(value = "sex_code")
+    private String sexCode;
+
+    @TableField(value = " create_time")
+    private String createTime;
+
+    public String telephone;
+    public String address;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 35 - 0
src/main/java/com/kexun/entity/ReportFile.java

@@ -0,0 +1,35 @@
+package com.kexun.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@TableName(value = "report_file")
+@Data
+public class ReportFile implements Serializable {
+
+
+    @TableId(value = "id")
+    private Long id;
+
+    @TableField(value = "rpt_no")
+    private String rptNo;
+
+    @TableField(value = "file_name_xml")
+    private String fileNameXml;
+
+    @TableField(value = "file_name_txt")
+    private String fileNameTxt;
+
+    @TableField(value = "file_name_model")
+    private String fileNameModel;
+
+    @TableField(value = " create_time")
+    private String createTime;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 25 - 0
src/main/java/com/kexun/mapper/BusinessMapper.java

@@ -0,0 +1,25 @@
+package com.kexun.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.kexun.entity.*;
+import org.springframework.data.repository.query.Param;
+
+import java.util.List;
+
+/**
+ * @Entity com.kexun.entity.PartnerInfo
+ */
+public interface BusinessMapper extends BaseMapper<BusinessInfo> {
+
+    List<BusinessInfo> QueryToDoList();
+    List<BusinessInfo> QueryAnalysisList();
+
+    List<BusinessInfo> QueryFailList();
+    BusinessInfo queryBusinessInfoByNum(@Param("businessNum") String businessNum);
+
+
+}
+
+
+
+

+ 22 - 0
src/main/java/com/kexun/mapper/CustomInfoMapper.java

@@ -0,0 +1,22 @@
+package com.kexun.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.kexun.entity.BusinessInfo;
+import com.kexun.entity.CustomInfo;
+import org.springframework.data.repository.query.Param;
+
+import java.util.List;
+
+/**
+ * @Entity com.kexun.entity.PartnerInfo
+ */
+public interface CustomInfoMapper extends BaseMapper<CustomInfo> {
+
+    CustomInfo queryCustomInfo(@Param("businessNum") String businessNum);
+    List<CustomInfo> queryCustomTelephone(@Param("businessNum") String businessNum);
+    List<CustomInfo> queryCustomAddress(@Param("businessNum") String businessNum);
+}
+
+
+
+

+ 20 - 0
src/main/java/com/kexun/mapper/ReportMapper.java

@@ -0,0 +1,20 @@
+package com.kexun.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.kexun.entity.BusinessInfo;
+import com.kexun.entity.ReportFile;
+import org.springframework.data.repository.query.Param;
+
+import java.util.List;
+
+/**
+ * @Entity com.kexun.entity.PartnerInfo
+ */
+public interface ReportMapper extends BaseMapper<ReportFile> {
+
+
+}
+
+
+
+

+ 18 - 0
src/main/java/com/kexun/service/BusinessService.java

@@ -0,0 +1,18 @@
+package com.kexun.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.kexun.entity.*;
+
+import java.util.List;
+
+/**
+ *
+ */
+public interface BusinessService extends IService<BusinessInfo> {
+    List<BusinessInfo> queryToDoList();
+
+    List<BusinessInfo> queryAnalysisList();
+    List<BusinessInfo> queryFailList();
+    BusinessInfo QueryBusinessInfoByNum(String businessNum);
+
+}

+ 18 - 0
src/main/java/com/kexun/service/CustomInfoService.java

@@ -0,0 +1,18 @@
+package com.kexun.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.kexun.entity.BusinessInfo;
+import com.kexun.entity.CustomInfo;
+
+import java.util.List;
+
+/**
+ *
+ */
+public interface CustomInfoService extends IService<CustomInfo> {
+
+    CustomInfo QueryCustomInfo(String businessNum);
+    List<CustomInfo> QueryCustomTelephone(String businessNum);
+    List<CustomInfo> QueryCustomAddress(String businessNum);
+
+}

+ 15 - 0
src/main/java/com/kexun/service/ReportService.java

@@ -0,0 +1,15 @@
+package com.kexun.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.kexun.entity.BusinessInfo;
+import com.kexun.entity.ReportFile;
+
+import java.util.List;
+
+/**
+ *
+ */
+public interface ReportService extends IService<ReportFile> {
+
+
+}

+ 58 - 0
src/main/java/com/kexun/service/impl/BusinessServiceImpl.java

@@ -0,0 +1,58 @@
+package com.kexun.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.kexun.entity.*;
+import com.kexun.mapper.BusinessMapper;
+import com.kexun.mapper.CooperatorMapper;
+import com.kexun.service.BusinessService;
+import com.kexun.service.CooperatorService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ *
+ */
+@Service
+public class BusinessServiceImpl extends ServiceImpl<BusinessMapper, BusinessInfo>
+    implements BusinessService {
+
+    @Resource
+    BusinessMapper businessMapper;
+
+    @Override
+    public List<BusinessInfo> queryToDoList(){
+//        System.out.println("aaa");
+        List<BusinessInfo> l = businessMapper.QueryToDoList();
+        return l;
+    }
+
+    @Override
+    public List<BusinessInfo> queryAnalysisList(){
+//        System.out.println("aaa");
+        List<BusinessInfo> l = businessMapper.QueryAnalysisList();
+        return l;
+    }
+
+    @Override
+    public List<BusinessInfo> queryFailList(){
+//        System.out.println("aaa");
+        List<BusinessInfo> l = businessMapper.QueryFailList();
+        return l;
+    }
+
+    @Override
+    public BusinessInfo QueryBusinessInfoByNum(String businessNum){
+//        System.out.println("aaa");
+        BusinessInfo l = businessMapper.queryBusinessInfoByNum(businessNum);
+        return l;
+    }
+
+
+}
+
+
+
+

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

@@ -0,0 +1,48 @@
+package com.kexun.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.kexun.entity.BusinessInfo;
+import com.kexun.entity.CustomInfo;
+import com.kexun.mapper.BusinessMapper;
+import com.kexun.mapper.CustomInfoMapper;
+import com.kexun.service.BusinessService;
+import com.kexun.service.CustomInfoService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ *
+ */
+@Service
+public class CustomInfoServiceImpl extends ServiceImpl<CustomInfoMapper, CustomInfo>
+    implements CustomInfoService {
+
+    @Resource
+    CustomInfoMapper customInfoMapper;
+
+    @Override
+    public CustomInfo QueryCustomInfo(String businessNum){
+        CustomInfo l = customInfoMapper.queryCustomInfo(businessNum);
+        return l;
+    }
+
+    @Override
+    public List<CustomInfo> QueryCustomTelephone(String businessNum){
+        List<CustomInfo> l = customInfoMapper.queryCustomTelephone(businessNum);
+        return l;
+    }
+
+    @Override
+    public List<CustomInfo> QueryCustomAddress(String businessNum){
+        List<CustomInfo> l = customInfoMapper.queryCustomAddress(businessNum);
+        return l;
+    }
+
+
+}
+
+
+
+

+ 27 - 0
src/main/java/com/kexun/service/impl/ReportServiceImpl.java

@@ -0,0 +1,27 @@
+package com.kexun.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.kexun.entity.BusinessInfo;
+import com.kexun.entity.ReportFile;
+import com.kexun.mapper.BusinessMapper;
+import com.kexun.mapper.ReportMapper;
+import com.kexun.service.BusinessService;
+import com.kexun.service.ReportService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ *
+ */
+@Service
+public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportFile>
+    implements ReportService {
+
+
+}
+
+
+
+

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

@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.kexun.mapper.BusinessMapper">
+
+    <resultMap id="BaseResultMap" type="com.kexun.entity.BusinessInfo">
+            <result property="partnerName" column="partner_name" jdbcType="VARCHAR"/>
+            <result property="contactName" column="contact_name" jdbcType="VARCHAR"/>
+            <result property="mobileNo" column="mobile_no" jdbcType="VARCHAR"/>
+            <result property="rate1" column="rate_1" jdbcType="VARCHAR"/>
+            <result property="queryNumber1" column="query_number1" jdbcType="VARCHAR"/>
+            <result property="rate2" column="rate_2" jdbcType="VARCHAR"/>
+            <result property="queryNumber2" column="query_number2" jdbcType="VARCHAR"/>
+            <result property="rate3" column="rate_3" jdbcType="VARCHAR"/>
+            <result property="queryNumber3" column="query_number3" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="VARCHAR"/>
+            <result property="isEnable" column="is_enable" jdbcType="VARCHAR"/>
+
+    </resultMap>
+
+
+    <select id="QueryToDoList" resultType="com.kexun.entity.BusinessInfo">
+        SELECT DISTINCT
+            report_info.business_num,
+            report_info.customer_name,
+            report_info.create_time,
+            report_info.certificate_num,
+            report_info.coop_business_num,
+            report_info.product_num,
+            cooperator_info.cooperator_name,
+            prd_product.product_name
+        FROM
+            report_info
+        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;
+    </select>
+
+    <select id="QueryAnalysisList" resultType="com.kexun.entity.BusinessInfo">
+        SELECT DISTINCT
+            report_info.business_num,
+            report_info.customer_name,
+            report_info.create_time,
+            report_info.certificate_num,
+            report_info.coop_business_num,
+            report_info.product_num,
+            cooperator_info.cooperator_name,
+            prd_product.product_name
+        FROM
+            report_info
+                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;
+    </select>
+
+    <select id="QueryFailList" resultType="com.kexun.entity.BusinessInfo">
+        SELECT DISTINCT
+            report_info.business_num,
+            report_info.customer_name,
+            report_info.create_time,
+            report_info.certificate_num,
+            report_info.coop_business_num,
+            report_info.product_num,
+            cooperator_info.cooperator_name,
+            prd_product.product_name
+        FROM
+            report_info
+                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;
+    </select>
+
+    <select id="queryBusinessInfoByNum" resultType="com.kexun.entity.BusinessInfo">
+        SELECT DISTINCT
+            report_info.business_num,
+            report_info.customer_name,
+            report_info.create_time,
+            report_info.certificate_num,
+            report_info.coop_business_num,
+            report_info.product_num,
+            cooperator_info.cooperator_name,
+            prd_product.product_name
+        FROM
+            report_info
+                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};
+    </select>
+
+
+
+
+
+</mapper>

+ 58 - 0
src/main/resources/mapper/CustomInfoMapper.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.kexun.mapper.CustomInfoMapper">
+
+    <resultMap id="BaseResultMap" type="com.kexun.entity.CustomInfo">
+            <result property="partnerName" column="partner_name" jdbcType="VARCHAR"/>
+            <result property="contactName" column="contact_name" jdbcType="VARCHAR"/>
+            <result property="mobileNo" column="mobile_no" jdbcType="VARCHAR"/>
+            <result property="rate1" column="rate_1" jdbcType="VARCHAR"/>
+            <result property="queryNumber1" column="query_number1" jdbcType="VARCHAR"/>
+            <result property="rate2" column="rate_2" jdbcType="VARCHAR"/>
+            <result property="queryNumber2" column="query_number2" jdbcType="VARCHAR"/>
+            <result property="rate3" column="rate_3" jdbcType="VARCHAR"/>
+            <result property="queryNumber3" column="query_number3" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="VARCHAR"/>
+            <result property="isEnable" column="is_enable" jdbcType="VARCHAR"/>
+
+    </resultMap>
+
+
+    <select id="queryCustomInfo" resultType="com.kexun.entity.CustomInfo">
+        SELECT DISTINCT
+            cr_base_inf.customer_num,
+            cr_base_inf.`name`,
+            cr_base_inf.id_type_code,
+            cr_base_inf.id_num,
+            cr_base_inf.sex_code
+        FROM
+            cr_base_inf
+        WHERE
+            cr_base_inf.rpt_no = #{businessNum};
+    </select>
+
+    <select id="queryCustomTelephone" resultType="com.kexun.entity.CustomInfo">
+        SELECT DISTINCT
+            cr_base_phone.telephone
+        FROM
+            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};
+    </select>
+
+    <select id="queryCustomAddress" resultType="com.kexun.entity.CustomInfo">
+        SELECT DISTINCT
+            cr_base_residence.address
+        FROM
+            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};
+    </select>
+
+
+
+</mapper>