Przeglądaj źródła

merge from origin

maqingyang 1 rok temu
rodzic
commit
4adbc3a563
33 zmienionych plików z 464 dodań i 97 usunięć
  1. 8 9
      pom.xml
  2. 23 1
      src/main/java/com/kexun/controller/BusinessController.java
  3. 20 6
      src/main/java/com/kexun/controller/CooperatorController.java
  4. 68 6
      src/main/java/com/kexun/controller/FieldDefineController.java
  5. 20 4
      src/main/java/com/kexun/controller/FieldTemplateController.java
  6. 61 9
      src/main/java/com/kexun/controller/ReportController.java
  7. 1 0
      src/main/java/com/kexun/controller/UploadController.java
  8. 4 0
      src/main/java/com/kexun/entity/BaseEntity.java
  9. 3 0
      src/main/java/com/kexun/entity/BusinessInfo.java
  10. 1 1
      src/main/java/com/kexun/entity/CooperatorInfo.java
  11. 2 0
      src/main/java/com/kexun/entity/FieldDefineEntity.java
  12. 6 0
      src/main/java/com/kexun/entity/FieldTable.java
  13. 3 0
      src/main/java/com/kexun/entity/ReportFile.java
  14. 21 21
      src/main/java/com/kexun/groovy/FunArgGroove.groovy
  15. 8 8
      src/main/java/com/kexun/groovy/FunGroove.groovy
  16. 11 11
      src/main/java/com/kexun/groovy/HelloWorld.groovy
  17. 1 0
      src/main/java/com/kexun/mapper/CooperatorMapper.java
  18. 5 0
      src/main/java/com/kexun/mapper/FieldDefineMapper.java
  19. 3 0
      src/main/java/com/kexun/mapper/FieldTemplateMapper.java
  20. 5 2
      src/main/java/com/kexun/model/ro/FiledTemplateCreateRO.java
  21. 2 0
      src/main/java/com/kexun/service/CooperatorService.java
  22. 8 0
      src/main/java/com/kexun/service/FieldDefineService.java
  23. 10 0
      src/main/java/com/kexun/service/FieldTemplateService.java
  24. 6 0
      src/main/java/com/kexun/service/ReportService.java
  25. 7 5
      src/main/java/com/kexun/service/impl/CooperatorServiceImpl.java
  26. 30 3
      src/main/java/com/kexun/service/impl/FieldDefineServiceImpl.java
  27. 78 10
      src/main/java/com/kexun/service/impl/FieldTemplateServiceImpl.java
  28. 26 0
      src/main/java/com/kexun/service/impl/ReportServiceImpl.java
  29. 1 1
      src/main/resources/application.yml
  30. 5 0
      src/main/resources/mapper/BusinessMapper.xml
  31. 4 0
      src/main/resources/mapper/CooperatorMapper.xml
  32. 8 0
      src/main/resources/mapper/FieldDefineMapper.xml
  33. 5 0
      src/main/resources/mapper/FieldTemplateMapper.xml

+ 8 - 9
pom.xml

@@ -16,7 +16,7 @@
     <properties>
         <java.version>1.8</java.version>
         <mybatis-plus.version>3.4.1</mybatis-plus.version>
-        <groovy.version>2.5.6</groovy.version>
+<!--        <groovy.version>2.5.6</groovy.version>-->
     </properties>
     <dependencies>
         <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
@@ -106,7 +106,7 @@
         <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
-            <version>1.18.20</version>
+            <version>1.18.12</version>
         </dependency>
         <!--mybatis-plus-->
         <dependency>
@@ -217,6 +217,12 @@
             <artifactId>lombok</artifactId>
             <optional>true</optional>
         </dependency>
+
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+            <version>2.9.4</version>
+        </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-test</artifactId>
@@ -247,13 +253,6 @@
             <artifactId>commons-io</artifactId>
             <version>2.11.0</version>
         </dependency>
-        <!-- https://mvnrepository.com/artifact/joda-time/joda-time -->
-        <dependency>
-            <groupId>joda-time</groupId>
-            <artifactId>joda-time</artifactId>
-            <version>2.12.5</version>
-        </dependency>
-
     </dependencies>
     <build>
         <plugins>

+ 23 - 1
src/main/java/com/kexun/controller/BusinessController.java

@@ -6,6 +6,7 @@ package com.kexun.controller;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.github.pagehelper.PageHelper;
 import com.kexun.common.utils.Result;
 import com.kexun.entity.*;
 import com.kexun.service.BusinessService;
@@ -35,9 +36,19 @@ public class BusinessController {
     // 获取待办业务列表
     @GetMapping("businessToDoList")
     public Result businessToDoList() {
+
         JSONObject resJson=new JSONObject();
         List<BusinessInfo> list= BusinessService.queryToDoList();
+        for(int i=0; i<list.size(); i++)
+        {
+            list.get(i).setStatus("待解决");
+            String time = list.get(i).getCreateTime().replace(".0","");
+            list.get(i).setCreateTime(time);
+        }
+
+
         resJson.put("business_todo_list",list);
+
         System.out.println(list);
 
         return Result.success("ok",resJson);
@@ -48,6 +59,12 @@ public class BusinessController {
     public Result businessAnalysisList() {
         JSONObject resJson=new JSONObject();
         List<BusinessInfo> list= BusinessService.queryAnalysisList();
+        for(int i=0; i<list.size(); i++)
+        {
+            list.get(i).setStatus("待解决");
+            String time = list.get(i).getCreateTime().replace(".0","");
+            list.get(i).setCreateTime(time);
+        }
         resJson.put("business_todo_list",list);
         System.out.println(list);
 
@@ -58,8 +75,13 @@ public class BusinessController {
     public Result businessFailList() {
         JSONObject resJson=new JSONObject();
         List<BusinessInfo> list= BusinessService.queryFailList();
+        for(int i=0; i<list.size(); i++)
+        {
+            list.get(i).setStatus("待解决");
+            String time = list.get(i).getCreateTime().replace(".0","");
+            list.get(i).setCreateTime(time);
+        }
         resJson.put("business_todo_list",list);
-        System.out.println(list);
 
         return Result.success("ok",resJson);
     }

+ 20 - 6
src/main/java/com/kexun/controller/CooperatorController.java

@@ -6,6 +6,8 @@ package com.kexun.controller;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import com.kexun.common.utils.Result;
 import com.kexun.entity.*;
 import com.kexun.service.CooperatorService;
@@ -36,10 +38,20 @@ public class CooperatorController {
 
     // 获取合作方信息
     @GetMapping("cooperatorList")
-    public Result cooperatorList() {
+    public Result cooperatorList(@RequestParam int pageNum) {
+        int pageSize = 10;
+        PageHelper.startPage(pageNum, pageSize);//设置分页信息
         JSONObject resJson=new JSONObject();
-        List<CooperatorInfo> list= CooperatorService.list();
-        resJson.put("cooperator_List",list);
+        List<CooperatorInfo> list= CooperatorService.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_List",pageInfo);
 //        System.out.println(list);
 
         return Result.success("ok",resJson);
@@ -52,11 +64,13 @@ public class CooperatorController {
         JSONObject req = JSON.parseObject(json);
         CooperatorInfo cooperatorInfo = new CooperatorInfo();
         cooperatorInfo.setCooperatorName(req.getString("cooperator_name"));
-        cooperatorInfo.setCorpCertificateNum(req.getString("corp_certificate_num"));
+        cooperatorInfo.setCooperatorNum(req.getString("cooperatorNum"));
         cooperatorInfo.setCorpCertificateType(req.getString("corp_certificate_type"));
+//        long time1 = System.currentTimeMillis();
+//        cooperatorInfo.setCooperatorNum(Long.toString(time1));
         cooperatorInfo.setTemplateNo(req.getString("field_template_no"));
         Calendar calendar= Calendar.getInstance();
-        SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
+        SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :HH:mm:ss");
         cooperatorInfo.setCreateTime(dateFormat.format(calendar.getTime()));
         // System.out.println(dateFormat.format(calendar.getTime()));
         CooperatorService.save(cooperatorInfo);
@@ -73,7 +87,7 @@ public class CooperatorController {
         CooperatorInfo cooperatorInfo = CooperatorService.findByID(cooperatorId);
 
         cooperatorInfo.setCooperatorName(req.getString("cooperator_name"));
-        cooperatorInfo.setCorpCertificateNum(req.getString("corp_certificate_num"));
+        cooperatorInfo.setCooperatorNum(req.getString("cooperatorNum"));
         cooperatorInfo.setCorpCertificateType(req.getString("corp_certificate_type"));
 
         Calendar calendar= Calendar.getInstance();

+ 68 - 6
src/main/java/com/kexun/controller/FieldDefineController.java

@@ -3,10 +3,13 @@ package com.kexun.controller;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import com.kexun.common.utils.Result;
 import com.kexun.entity.BusInfoModifyHis;
 import com.kexun.entity.CooperatorInfo;
 import com.kexun.entity.FieldDefineEntity;
+import com.kexun.entity.FieldTemplateEntity;
 import com.kexun.hander.PageBean;
 import com.kexun.model.ro.FiledRO;
 import com.kexun.model.ro.FiledUpdateRO;
@@ -19,6 +22,8 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.Iterator;
 import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -39,15 +44,72 @@ public class FieldDefineController {
      *
      * @return
      */
-    @GetMapping("fieldListNew")
-    public Result fieldListNew() {
-        JSONObject resJson=new JSONObject();
-        List<FieldDefineEntity> list= fieldDefineService.list();
-        resJson.put("fieldListNew",list);
+//    @GetMapping("fieldListNew")
+//    public Result fieldListNew() {
+//        JSONObject resJson=new JSONObject();
+//        List<FieldDefineEntity> list= fieldDefineService.list();
+//        resJson.put("fieldListNew",list);
+//
+//        return Result.success("ok",resJson);
+//    }
 
-        return Result.success("ok",resJson);
+    @RequestMapping("/fieldListNew")
+    @ResponseBody
+    public Result findAll(@RequestParam int pageNum){
+        int pageSize = 10;
+        PageHelper.startPage(pageNum, pageSize);//设置分页信息
+        List<FieldDefineEntity> list = fieldDefineService.selectPage();
+
+        List<FieldDefineEntity> list2 = fieldDefineService.selectPage2();
+
+        PageInfo pageInfo=new PageInfo(list);
+        PageInfo pageInfo2=new PageInfo(list2);
+
+        System.out.println(pageInfo);
+        JSONObject resJson = new JSONObject();
+
+        resJson.put("fieldListNew", pageInfo);
+
+
+        resJson.put("fieldListDerive", pageInfo2);
+
+        return Result.success("ok", resJson);
     }
 
+    @RequestMapping("/fieldListBase")
+    @ResponseBody
+    public Result fieldListBase(@RequestParam int pageNum){
+        int pageSize = 10;
+        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("/fieldListDerive")
+    @ResponseBody
+    public Result fieldListDerive(@RequestParam int pageNum){
+        int pageSize = 10;
+        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);
+    }
     /**
      * 字段列表查询
      *

+ 20 - 4
src/main/java/com/kexun/controller/FieldTemplateController.java

@@ -3,9 +3,10 @@ package com.kexun.controller;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import com.kexun.common.utils.Result;
 import com.kexun.entity.*;
-import com.kexun.model.ro.FiledTemplateCreateRO;
 import com.kexun.model.ro.FiledTemplateRO;
 import com.kexun.model.ro.FiledTemplateUpdateRO;
 import com.kexun.model.vo.FiledTemplateVO;
@@ -54,6 +55,21 @@ public class FieldTemplateController {
         return result;
     }
 
+    @RequestMapping("/findAll")
+    @ResponseBody
+    public Result findAll(@RequestParam int pageNum){
+        int pageSize = 10;
+        PageHelper.startPage(pageNum, pageSize);//设置分页信息
+        List<FieldTemplateEntity> list = fieldTemplateService.selectPage();
+        PageInfo pageInfo=new PageInfo(list);
+        System.out.println(pageInfo);
+        JSONObject resJson = new JSONObject();
+
+        resJson.put("field_template_list", pageInfo);
+
+        return Result.success("ok", resJson);
+    }
+
     /**
      * 字段模板详情
      *
@@ -74,13 +90,13 @@ public class FieldTemplateController {
     /**
      * 保存
      *
-     * @param filedTemplateCreateRO
+     * @param filedTemplateUpdateRO
      * @return
      */
     @PostMapping("save")
-    public Result save(@RequestBody FiledTemplateCreateRO filedTemplateCreateRO) {
+    public Result save(@RequestBody FiledTemplateUpdateRO filedTemplateUpdateRO) {
         Result result = new Result();
-        fieldTemplateService.save(filedTemplateCreateRO);
+        fieldTemplateService.save(filedTemplateUpdateRO);
         return result;
     }
 

+ 61 - 9
src/main/java/com/kexun/controller/ReportController.java

@@ -3,19 +3,26 @@ 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.BusinessInfo;
-import com.kexun.entity.CustomInfo;
-import com.kexun.entity.ReportFile;
+import com.kexun.entity.*;
+import com.kexun.service.CooperatorService;
 import com.kexun.service.CustomInfoService;
+import com.kexun.service.ReportService;
 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 org.springframework.util.ResourceUtils;
+import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.URLEncoder;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
 import java.util.List;
 
 @RestController
@@ -24,17 +31,62 @@ import java.util.List;
 public class ReportController {
 
     @Autowired
-    private com.kexun.service.ReportService ReportService;
+    private com.kexun.service.ReportService reportService;
 
 
     @GetMapping("reportFileList")
     public Result businessToDoList() {
         JSONObject resJson=new JSONObject();
-        List<ReportFile> list= ReportService.list();
+        List<ReportFile> list= reportService.list();
+        for(int i=0; i<list.size(); i++)
+        {
+            String time = list.get(i).getCreateTime().replace(".0","");
+            list.get(i).setCreateTime(time);
+        }
         resJson.put("report_file_list",list);
         System.out.println(list);
 
         return Result.success("ok",resJson);
     }
+    @GetMapping("del")
+    public Result del(@RequestParam Long id) {
+        System.out.println("role");
+        System.out.println(id);
 
+        reportService.removeById(id);
+        return Result.success();
+    }
+
+
+
+
+    @PostMapping("download")
+    public void  download(@RequestBody String json)  {
+        // 获得待下载文件所在文件夹的绝对路径
+        JSONObject req = JSON.parseObject(json);
+        String fileName = req.getString("file_name");
+        System.out.println(fileName);
+        reportService.download(fileName);
+
+    }
+
+    @PostMapping("fileReportAdd")
+    public Result fileReportAdd(@RequestBody String json)
+    {
+        JSONObject req = JSON.parseObject(json);
+        ReportFile reportFile = new ReportFile();
+        reportFile.setFileName(req.getString("file_name"));
+        reportFile.setFileNameXml(req.getString("fileNameXml"));
+        reportFile.setFileNameTxt(req.getString("fileNameTxt"));
+        reportFile.setFileNameModel(req.getString("fileModel"));
+
+
+        Calendar calendar= Calendar.getInstance();
+        SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :HH:mm:ss");
+        reportFile.setCreateTime(dateFormat.format(calendar.getTime()));
+        // System.out.println(dateFormat.format(calendar.getTime()));
+        reportService.save(reportFile);
+
+        return Result.success();
+    }
 }

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

@@ -64,6 +64,7 @@ public class UploadController {
 
     }
 
+
     @Autowired
     private CustomizedModelService customizedModelService;
 

+ 4 - 0
src/main/java/com/kexun/entity/BaseEntity.java

@@ -1,6 +1,7 @@
 package com.kexun.entity;
 
 import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -43,6 +44,7 @@ public class BaseEntity implements Serializable,IBaseEntity {
      * 创建时间
      */
     @TableField(value = "create_time",fill = FieldFill.INSERT)
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
     private Date createTime;
 
     /**
@@ -55,6 +57,8 @@ public class BaseEntity implements Serializable,IBaseEntity {
      * 修改时间
      */
     @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+
     private Date updateTime;
 
     /**

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

@@ -29,6 +29,9 @@ public class BusinessInfo implements Serializable {
     private String productNum;
     private String productName;
 
+    @TableField(value = "status")
+    private String status;
+
     @TableField(value = "certificate_num")
     private String certificateNum;
 

+ 1 - 1
src/main/java/com/kexun/entity/CooperatorInfo.java

@@ -15,7 +15,7 @@ import java.io.Serializable;
 @Data
 public class CooperatorInfo implements Serializable {
 
-    @TableId(value = "id" , type = IdType.AUTO)
+    @TableId(value = "id" )
 //    @TableField(value = "id")
     private Long id;
 

+ 2 - 0
src/main/java/com/kexun/entity/FieldDefineEntity.java

@@ -40,6 +40,8 @@ public class FieldDefineEntity extends BaseEntity implements Serializable {
     @TableField("name_zh")
     private String nameZh;
 
+
+
     @ApiModelProperty(value = "字段类别 1-基础字段;2-衍生字段")
     @TableField("category")
     private String category;

+ 6 - 0
src/main/java/com/kexun/entity/FieldTable.java

@@ -57,6 +57,12 @@ public class FieldTable implements Serializable {
     @TableField(value = "extra_data")
     private String extraData;
 
+    @TableField(value = "create_time")
+    private String createTime;
+
+    @TableField(value = "update_time")
+    private String updateTime;
+
     @TableField(exist = false)
     private static final long serialVersionUID = 1L;
 }

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

@@ -18,6 +18,9 @@ public class ReportFile implements Serializable {
     @TableField(value = "rpt_no")
     private String rptNo;
 
+    @TableField(value = "file_name")
+    private String fileName;
+
     @TableField(value = "file_name_xml")
     private String fileNameXml;
 

+ 21 - 21
src/main/java/com/kexun/groovy/FunArgGroove.groovy

@@ -1,21 +1,21 @@
-package com.kexun.groovy
-
-import com.kexun.model.vo.TestVo
-
-String printArg(String name){
-    System.out.println("参数:"+name);
-    return "返回结果:"+name;
-}
-
-//执行方法
-printArg(arg);
-
-
-
-def handle(Object object){
-    if (object instanceof TestVo){
-       TestVo testVo= (TestVo) object;
-        def age = testVo.getAge();
-        println age;
-    }
-}
+//package com.kexun.groovy
+//
+//import com.kexun.model.vo.TestVo
+//
+//String printArg(String name){
+//    System.out.println("参数:"+name);
+//    return "返回结果:"+name;
+//}
+//
+////执行方法
+//printArg(arg);
+//
+//
+//
+//def handle(Object object){
+//    if (object instanceof TestVo){
+//       TestVo testVo= (TestVo) object;
+//        def age = testVo.getAge();
+//        println age;
+//    }
+//}

+ 8 - 8
src/main/java/com/kexun/groovy/FunGroove.groovy

@@ -1,8 +1,8 @@
-package com.kexun.groovy
-
-
-void print() {
-    System.out.println("没有参数!!!!");
-}
-//执行方法
-print();
+//package com.kexun.groovy
+//
+//
+//void print() {
+//    System.out.println("没有参数!!!!");
+//}
+////执行方法
+//print();

+ 11 - 11
src/main/java/com/kexun/groovy/HelloWorld.groovy

@@ -1,11 +1,11 @@
-package com.kexun.groovy
-
-/**
- * 测试
- */
-class HelloWorld {
-    def HelloWorld() { println "hello world" }
-
-
-}
-
+//package com.kexun.groovy
+//
+///**
+// * 测试
+// */
+//class HelloWorld {
+//    def HelloWorld() { println "hello world" }
+//
+//
+//}
+//

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

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

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

@@ -4,6 +4,8 @@ import com.kexun.entity.FieldDefineEntity;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * <p>
  * 字段定义表 Mapper 接口
@@ -23,4 +25,7 @@ public interface FieldDefineMapper extends BaseMapper<FieldDefineEntity> {
      */
     void updateStatus(@Param("id") Long id, @Param("status") String status);
 
+    List<FieldDefineEntity> selectAll(String cat);
+
+
 }

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

@@ -19,6 +19,9 @@ public interface FieldTemplateMapper extends BaseMapper<FieldTemplateEntity> {
      */
     void updateStatus(@Param("id") Long id, @Param("status") String status);
 
+    List<FieldTemplateEntity> selectAll();
+
+//    List<FieldTemplateEntity> selectAll();
 }
 
 

+ 5 - 2
src/main/java/com/kexun/model/ro/FiledTemplateCreateRO.java

@@ -21,7 +21,10 @@ public class FiledTemplateCreateRO implements Serializable {
     @ApiModelProperty(value = "字段模板名称")
     private String templateName;
 
-    @ApiModelProperty(value = "字段列表")
-    private List<FiledUpdateRO> filedList;
+    @ApiModelProperty(value = "基础字段列表")
+    private List fieldSelected;
+
+    @ApiModelProperty(value = "衍生字段列表")
+    private List fieldSelected2;
 
 }

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

@@ -18,4 +18,6 @@ public interface CooperatorService extends IService<CooperatorInfo> {
     List<CooperatorField> findCooperatorFieldByNum(String cooperatorNum);
     List<CooperatorProduct> findCooperatorProductByNum(String cooperatorNum);
     CooperatorInfo findByID(long id);
+
+    List<CooperatorInfo> selectPage();
 }

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

@@ -2,6 +2,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.FieldDefineEntity;
 import com.kexun.model.ro.FiledRO;
 import com.kexun.model.ro.FiledUpdateRO;
@@ -31,6 +32,8 @@ public interface FieldDefineService extends IService<FieldDefineEntity> {
      */
     void saveOrUpdate(FiledUpdateRO filedUpdateRO);
 
+
+
     /**
      * 修改字段类型状态
      * @param id
@@ -45,6 +48,11 @@ public interface FieldDefineService extends IService<FieldDefineEntity> {
      */
     List<FieldDefineEntity> listFieldInfoByLevel(String oneLevel);
 
+    FieldDefineEntity findByID(long id);
+
+
+    List<FieldDefineEntity> selectPage();
 
+    List<FieldDefineEntity> selectPage2();
 
 }

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

@@ -9,6 +9,8 @@ import com.kexun.model.ro.FiledTemplateRO;
 import com.kexun.model.ro.FiledTemplateUpdateRO;
 import com.kexun.model.vo.FiledTemplateVO;
 
+import java.util.List;
+
 /**
  *
  */
@@ -23,12 +25,20 @@ public interface FieldTemplateService extends IService<FieldTemplateEntity> {
      */
     IPage<FieldTemplateEntity> listPage(FiledTemplateRO filedTemplateRO);
 
+    List<FieldTemplateEntity> selectPage();
+
     /**
      * 保存模板关系表
      * @param filedTemplateCreateRO
      */
     void save(FiledTemplateCreateRO filedTemplateCreateRO);
 
+    /**
+     * 修改
+     * @param filedTemplateUpdateRO
+     */
+    void saveOrUpdate(FiledTemplateUpdateRO filedTemplateUpdateRO);
+
     /**
      * 修改
      * @param filedTemplateUpdateRO

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

@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.kexun.entity.BusinessInfo;
 import com.kexun.entity.ReportFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.OutputStream;
 import java.util.List;
 
 /**
@@ -11,5 +14,8 @@ import java.util.List;
  */
 public interface ReportService extends IService<ReportFile> {
 
+    public void download(String fileName) ;
 
 }
+
+

+ 7 - 5
src/main/java/com/kexun/service/impl/CooperatorServiceImpl.java

@@ -2,13 +2,9 @@ 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.CooperatorField;
-import com.kexun.entity.CooperatorInfo;
-import com.kexun.entity.CooperatorProduct;
-import com.kexun.entity.UserField;
+import com.kexun.entity.*;
 import com.kexun.mapper.CooperatorMapper;
 import com.kexun.service.CooperatorService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -44,6 +40,12 @@ public class CooperatorServiceImpl extends ServiceImpl<CooperatorMapper, Coopera
         return l;
     }
 
+    public List<CooperatorInfo> selectPage() {
+//        System.out.println("aaa");
+        List<CooperatorInfo> l = cooperatorMapper.selectAll();
+        return l;
+    }
+
     @Override
     public CooperatorInfo findByID(long id) {
         QueryWrapper<CooperatorInfo> wrapper=new QueryWrapper<CooperatorInfo>().eq("id",id);

+ 30 - 3
src/main/java/com/kexun/service/impl/FieldDefineServiceImpl.java

@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.kexun.entity.BusInfoModifyHis;
+import com.kexun.entity.CooperatorInfo;
 import com.kexun.entity.FieldDefineEntity;
+import com.kexun.entity.FieldTemplateEntity;
 import com.kexun.hander.PageBean;
 import com.kexun.mapper.BusInfoModifyHisMapper;
 import com.kexun.mapper.FieldDefineMapper;
@@ -32,7 +34,8 @@ import java.util.List;
 @Service
 public class FieldDefineServiceImpl extends ServiceImpl<FieldDefineMapper, FieldDefineEntity> implements FieldDefineService {
 
-
+    @Autowired
+    FieldDefineService fieldDefineService;
     @Autowired
     private FieldDefineMapper fieldDefineMapper;
 
@@ -74,6 +77,20 @@ public class FieldDefineServiceImpl extends ServiceImpl<FieldDefineMapper, Field
         return list;
     }
 
+    public List<FieldDefineEntity> selectPage() {
+//        System.out.println("aaa");
+        String cat = "1";
+        List<FieldDefineEntity> l = fieldDefineMapper.selectAll(cat);
+        return l;
+    }
+
+    public List<FieldDefineEntity> selectPage2() {
+//        System.out.println("aaa");
+        String cat = "2";
+        List<FieldDefineEntity> l = fieldDefineMapper.selectAll(cat);
+        return l;
+    }
+
     /**
      * 保存或者修改字段定义
      * @param filedUpdateRO
@@ -83,10 +100,16 @@ public class FieldDefineServiceImpl extends ServiceImpl<FieldDefineMapper, Field
         Long id = filedUpdateRO.getId();
         FieldDefineEntity defineEntity = getById(id);
         FieldDefineEntity fieldDefineEntity = new FieldDefineEntity();
-        BeanUtils.copyProperties(filedUpdateRO,fieldDefineEntity);
+
         if (null != defineEntity) {
+            BeanUtils.copyProperties(filedUpdateRO,fieldDefineEntity);
+
             updateById(fieldDefineEntity);
         }else {
+            filedUpdateRO.setCategory("2");
+            long time1 = System.currentTimeMillis();
+            filedUpdateRO.setFieldNo(Long.toString(time1));
+            BeanUtils.copyProperties(filedUpdateRO,fieldDefineEntity);
             save(fieldDefineEntity);
         }
     }
@@ -101,6 +124,10 @@ public class FieldDefineServiceImpl extends ServiceImpl<FieldDefineMapper, Field
         fieldDefineMapper.updateStatus(id,status);
     }
 
-
+    @Override
+    public FieldDefineEntity findByID(long id) {
+        QueryWrapper<FieldDefineEntity> wrapper=new QueryWrapper<FieldDefineEntity>().eq("id",id);
+        return getOne(wrapper);
+    }
 
 }

+ 78 - 10
src/main/java/com/kexun/service/impl/FieldTemplateServiceImpl.java

@@ -13,6 +13,7 @@ import com.kexun.model.ro.*;
 import com.kexun.model.vo.FieldVO;
 import com.kexun.model.vo.FiledTemplateVO;
 import com.kexun.service.CooperatorService;
+import com.kexun.service.FieldDefineService;
 import com.kexun.service.FieldTemplateRefService;
 import com.kexun.service.FieldTemplateService;
 import com.kexun.utils.PageUtils;
@@ -33,12 +34,15 @@ import java.util.stream.Collectors;
  */
 @Service
 public class FieldTemplateServiceImpl extends ServiceImpl<FieldTemplateMapper, FieldTemplateEntity> implements FieldTemplateService {
-
+    @Autowired
+    FieldDefineService fieldDefineService;
     @Autowired
     FieldTemplateMapper fieldTemplateMapper;
     @Autowired
     FieldTemplateRefService fieldTemplateRefService;
 
+
+
     /**
      * 分页查询模板字段
      * @param filedTemplateRO
@@ -60,6 +64,12 @@ public class FieldTemplateServiceImpl extends ServiceImpl<FieldTemplateMapper, F
         return pageList;
     }
 
+    public List<FieldTemplateEntity> selectPage() {
+//        System.out.println("aaa");
+        List<FieldTemplateEntity> l = fieldTemplateMapper.selectAll();
+        return l;
+    }
+
     /**
      * 保存模板字段
      *
@@ -70,24 +80,82 @@ public class FieldTemplateServiceImpl extends ServiceImpl<FieldTemplateMapper, F
         if (null != filedTemplateCreateRO) {
             FieldTemplateEntity fieldTemplateEntity = new FieldTemplateEntity();
             fieldTemplateEntity.setStatus(BaseConsts.STATUS_ON);
+            long time1 = System.currentTimeMillis();
+            filedTemplateCreateRO.setTemplateNo(Long.toString(time1));
+
             BeanUtils.copyProperties(filedTemplateCreateRO, fieldTemplateEntity);
             fieldTemplateMapper.insert(fieldTemplateEntity);
             Long id = fieldTemplateEntity.getId();
-            //模板字段关系表
-            List<FiledUpdateRO> filedList = filedTemplateCreateRO.getFiledList();
+            FieldTemplateEntity templateEntity = getById(id);
 
+
+            //模板字段关系表
+            List <String> fieldSelected = filedTemplateCreateRO.getFieldSelected();
+            List <String> fieldSelected2 = filedTemplateCreateRO.getFieldSelected2();
             List<FieldTemplateRefEntity> fieldTemplateRefList = new ArrayList<>();
-            for (FiledUpdateRO filedUpdateRO : filedList) {
+
+            for (int i=0;i<fieldSelected.size();i++){
+                Long fid = Long.parseLong(fieldSelected.get(i));
+                FieldDefineEntity fieldDefine = fieldDefineService.findByID(fid);
                 FieldTemplateRefEntity fieldTemplateRefEntity = new FieldTemplateRefEntity();
+                fieldTemplateRefEntity.setIsDeleted(false);
+                fieldTemplateRefEntity.setFieldDefineId(fieldDefine.getId());
+                fieldTemplateRefEntity.setFieldNo(fieldDefine.getFieldNo());
+                fieldTemplateRefEntity.setName(fieldDefine.getName());
                 fieldTemplateRefEntity.setFieldTemplateId(id);
-                fieldTemplateRefEntity.setTemplateNo(filedTemplateCreateRO.getTemplateNo());
-                fieldTemplateRefEntity.setFieldDefineId(filedUpdateRO.getId());
-                fieldTemplateRefEntity.setFieldNo(filedUpdateRO.getFieldNo());
-                fieldTemplateRefEntity.setName(filedUpdateRO.getName());
-                fieldTemplateRefEntity.setType(filedUpdateRO.getType());
+                fieldTemplateRefEntity.setTemplateNo(fieldTemplateEntity.getTemplateNo());
+                fieldTemplateRefList.add(fieldTemplateRefEntity);
+            }
+            for (int i=0;i<fieldSelected2.size();i++){
+                Long fid = Long.parseLong(fieldSelected.get(i));
+                FieldDefineEntity fieldDefine = fieldDefineService.findByID(fid);
+                FieldTemplateRefEntity fieldTemplateRefEntity = new FieldTemplateRefEntity();
+                fieldTemplateRefEntity.setIsDeleted(false);
+                fieldTemplateRefEntity.setFieldDefineId(fieldDefine.getId());
+                fieldTemplateRefEntity.setFieldNo(fieldDefine.getFieldNo());
+                fieldTemplateRefEntity.setName(fieldDefine.getName());
+                fieldTemplateRefEntity.setFieldTemplateId(id);
+                fieldTemplateRefEntity.setTemplateNo(fieldTemplateEntity.getTemplateNo());
                 fieldTemplateRefList.add(fieldTemplateRefEntity);
             }
             fieldTemplateRefService.saveBatch(fieldTemplateRefList);
+
+//            List<FieldTemplateRefEntity> fieldTemplateRefList = new ArrayList<>();
+
+//            for (FiledUpdateRO filedUpdateRO : filedList) {
+//                FieldTemplateRefEntity fieldTemplateRefEntity = new FieldTemplateRefEntity();
+//                fieldTemplateRefEntity.setFieldTemplateId(id);
+//                fieldTemplateRefEntity.setTemplateNo(filedTemplateCreateRO.getTemplateNo());
+//                fieldTemplateRefEntity.setFieldDefineId(filedUpdateRO.getId());
+//                fieldTemplateRefEntity.setFieldNo(filedUpdateRO.getFieldNo());
+//                fieldTemplateRefEntity.setName(filedUpdateRO.getName());
+//                fieldTemplateRefEntity.setType(filedUpdateRO.getType());
+//                fieldTemplateRefList.add(fieldTemplateRefEntity);
+//            }
+//            fieldTemplateRefService.saveBatch(fieldTemplateRefList);
+        }
+    }
+
+    /**
+     * 保存或者修改字段定义
+     * @param filedTemplateUpdateRO
+     */
+    @Override
+    public void saveOrUpdate(FiledTemplateUpdateRO filedTemplateUpdateRO) {
+        Long id = filedTemplateUpdateRO.getId();
+        FieldTemplateEntity templateEntity = getById(id);
+        FieldTemplateEntity FieldTemplateEntity = new FieldTemplateEntity();
+        List<FiledUpdateRO> filedList = filedTemplateUpdateRO.getFieldSelected();
+        System.out.println(filedList);
+        if (null != templateEntity) {
+            BeanUtils.copyProperties(filedTemplateUpdateRO,FieldTemplateEntity);
+
+            updateById(FieldTemplateEntity);
+        }else {
+            long time1 = System.currentTimeMillis();
+            filedTemplateUpdateRO.setTemplateNo(Long.toString(time1));
+            BeanUtils.copyProperties(filedTemplateUpdateRO,FieldTemplateEntity);
+            save(FieldTemplateEntity);
         }
     }
 
@@ -101,7 +169,7 @@ public class FieldTemplateServiceImpl extends ServiceImpl<FieldTemplateMapper, F
         Long id = filedTemplateUpdateRO.getId();
         FieldTemplateEntity fieldTemplateSelect = fieldTemplateMapper.selectById(id);
         if (null != fieldTemplateSelect) {
-            List<FiledUpdateRO> filedList = filedTemplateUpdateRO.getFiledList();
+            List<FiledUpdateRO> filedList = filedTemplateUpdateRO.getFieldSelected();
             //先删除,后insert
             List<FieldTemplateRefEntity> filedTemplateList = new ArrayList<>();
             for (FiledUpdateRO filedUpdateRO : filedList) {

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

@@ -7,9 +7,13 @@ import com.kexun.mapper.BusinessMapper;
 import com.kexun.mapper.ReportMapper;
 import com.kexun.service.BusinessService;
 import com.kexun.service.ReportService;
+import org.apache.commons.io.IOUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.URLEncoder;
 import java.util.List;
 
 /**
@@ -18,6 +22,28 @@ import java.util.List;
 @Service
 public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportFile>
     implements ReportService {
+    @Override
+    public void download( String fileName)  {
+        try {
+            String filePath = new String("D:/jin_rong/todo/test_data" +'/'+ fileName);
+
+            FileInputStream inputFile = new FileInputStream(filePath);
+
+            String outPath = new String("C:\\Users\\zishanan\\Desktop\\3" +'/'+ fileName);
+            FileOutputStream outputFile = new FileOutputStream(outPath);
+
+            int byteData;
+            while ((byteData = inputFile.read()) != -1) {
+                outputFile.write(byteData);
+            }
+
+            inputFile.close();
+            outputFile.close();
+            System.out.println("文件下载成功!");
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
 
 
 }

+ 1 - 1
src/main/resources/application.yml

@@ -56,7 +56,7 @@ spring:
 mybatis-plus:
   mapper-locations: classpath:mapper/*.xml
   configuration:
-    #    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
     map-underscore-to-camel-case: true
   type-aliases-package: com.kexun.entity
   type-handlers-package: com.kexun.typehandler

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

@@ -28,6 +28,7 @@
             report_info.certificate_num,
             report_info.coop_business_num,
             report_info.product_num,
+            report_info.status,
             cooperator_info.cooperator_name,
             prd_product.product_name
         FROM
@@ -46,6 +47,8 @@
             report_info.certificate_num,
             report_info.coop_business_num,
             report_info.product_num,
+            report_info.status,
+
             cooperator_info.cooperator_name,
             prd_product.product_name
         FROM
@@ -64,6 +67,8 @@
             report_info.certificate_num,
             report_info.coop_business_num,
             report_info.product_num,
+            report_info.status,
+
             cooperator_info.cooperator_name,
             prd_product.product_name
         FROM

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

@@ -45,6 +45,10 @@
 
     </select>
 
+    <select id="selectAll" resultType="com.kexun.entity.CooperatorInfo">
+        select * from cooperator_info
+    </select>
+
     <select id="QueryProduct" resultType="com.kexun.entity.CooperatorProduct" >
         SELECT DISTINCT
             prd_product.product_num,

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

@@ -48,6 +48,14 @@
         remarks,
         field_no, name, name_zh, category, type, fetch_logic, formula_expr, formula_class, formula_method, formula_desc, three_level, three_level_zh, two_level, two_level_zh, one_level, one_level_zh, json_key, type_no, status
     </sql>
+
+    <select id="selectAll" resultType="com.kexun.entity.FieldDefineEntity">
+        select * from field_define
+        where category=#{cat}
+    </select>
+
+
+
     <update id="updateStatus">
         update field_define
         set status = #{status}

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

@@ -14,6 +14,11 @@
         id,template_no,template_name
     </sql>
 
+    <select id="selectAll" resultType="com.kexun.entity.FieldTemplateEntity">
+            select * from field_template
+    </select>
+
+
     <update id="updateStatus">
         update field_template
         set status = #{status}