Explorar o código

新增留言投诉,文件管理

邵洋 hai 1 ano
pai
achega
b695a3bb83
Modificáronse 25 ficheiros con 1326 adicións e 3 borrados
  1. 106 0
      background-service/zksy-admin/src/main/java/com/zksy/web/controller/basicData/OwLeavingMessageController.java
  2. 105 0
      background-service/zksy-admin/src/main/java/com/zksy/web/controller/basicData/XcrComplainController.java
  3. 71 0
      background-service/zksy-admin/src/main/java/com/zksy/web/controller/basicData/XcrFileController.java
  4. BIN=BIN
      background-service/zksy-admin/src/main/resources/template/投诉模板.pdf
  5. BIN=BIN
      background-service/zksy-admin/src/main/resources/template/留言模板.pdf
  6. 6 1
      background-service/zksy-common/pom.xml
  7. 75 0
      background-service/zksy-system/src/main/java/com/zksy/basicData/domain/OwLeavingMessage.java
  8. 99 0
      background-service/zksy-system/src/main/java/com/zksy/basicData/domain/XcrComplain.java
  9. 66 0
      background-service/zksy-system/src/main/java/com/zksy/basicData/domain/XcrFile.java
  10. 14 0
      background-service/zksy-system/src/main/java/com/zksy/basicData/mapper/OwLeavingMessageMapper.java
  11. 14 0
      background-service/zksy-system/src/main/java/com/zksy/basicData/mapper/XcrComplainMapper.java
  12. 14 0
      background-service/zksy-system/src/main/java/com/zksy/basicData/mapper/XcrFileMapper.java
  13. 27 0
      background-service/zksy-system/src/main/java/com/zksy/basicData/service/IOwLeavingMessageService.java
  14. 47 0
      background-service/zksy-system/src/main/java/com/zksy/basicData/service/IXcrComplainService.java
  15. 33 0
      background-service/zksy-system/src/main/java/com/zksy/basicData/service/IXcrFileService.java
  16. 71 0
      background-service/zksy-system/src/main/java/com/zksy/basicData/service/impl/OwLeavingMessageServiceImpl.java
  17. 148 0
      background-service/zksy-system/src/main/java/com/zksy/basicData/service/impl/XcrComplainServiceImpl.java
  18. 43 0
      background-service/zksy-system/src/main/java/com/zksy/basicData/service/impl/XcrFileServiceImpl.java
  19. 42 0
      background-service/zksy-system/src/main/java/com/zksy/basicData/utils/DeleteTableUtils.java
  20. 74 0
      background-service/zksy-system/src/main/java/com/zksy/basicData/utils/DowntemplateUtil.java
  21. 206 0
      background-service/zksy-system/src/main/java/com/zksy/basicData/utils/PdfUtil.java
  22. 19 0
      background-service/zksy-system/src/main/resources/mapper/basicData/OwLeavingMessageMapper.xml
  23. 22 0
      background-service/zksy-system/src/main/resources/mapper/basicData/XcrComplainMapper.xml
  24. 21 0
      background-service/zksy-system/src/main/resources/mapper/basicData/XcrFileMapper.xml
  25. 3 2
      data-service/src/main/java/com/zksy/data/controller/TestController.java

+ 106 - 0
background-service/zksy-admin/src/main/java/com/zksy/web/controller/basicData/OwLeavingMessageController.java

@@ -0,0 +1,106 @@
+package com.zksy.web.controller.basicData;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zksy.basicData.domain.OwLeavingMessage;
+import com.zksy.basicData.service.IOwLeavingMessageService;
+import com.zksy.basicData.utils.DowntemplateUtil;
+import com.zksy.common.annotation.Log;
+import com.zksy.common.core.controller.BaseController;
+import com.zksy.common.core.domain.AjaxResult;
+import com.zksy.common.enums.BusinessType;
+import com.zksy.common.utils.SearchUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 官网留言Controller
+ *
+ * @author sy
+ * @date 2024-06-27
+ */
+@RestController
+@RequestMapping("/owLeavingMessage")
+@Api(tags = "官网留言", description = "官网留言desc")
+public class OwLeavingMessageController extends BaseController{
+
+    @Autowired
+    private IOwLeavingMessageService service;
+
+    @GetMapping("/getById/{borrowId}")
+    @ApiOperation(value = "官网留言搜索getById")
+    public OwLeavingMessage getById(@PathVariable String borrowId) {
+        return service.getById(borrowId);
+    }
+
+    @GetMapping("/findByPage")
+    @ApiOperation(value = "官网留言分页")
+    public Page findByPage(long pageNum, long pageSize, String conditionJson) throws Exception {
+        return service.page(new Page<>(pageNum, pageSize), SearchUtil.parseWhereSql(conditionJson));
+    }
+
+    @GetMapping("/getList")
+    @ApiOperation(value = "官网留言查询所有")
+    public List<OwLeavingMessage> getList(String conditionJson) throws Exception {
+        return service.list(SearchUtil.parseWhereSql(conditionJson));
+    }
+
+    /**
+     * 新增官网留言
+     */
+    @PostMapping("/save")
+    @ApiOperation(value = "官网留言新增")
+    @Log(title = "新增官网留言", businessType = BusinessType.INSERT)
+    public AjaxResult save(@RequestBody OwLeavingMessage owLeavingMessage) {
+        owLeavingMessage.setCreateTime(new Date());
+        Boolean flag = service.save(owLeavingMessage);
+        if(flag){
+            return AjaxResult.success("留言成功");
+        }else {
+            return AjaxResult.success("留言失败");
+        }
+    }
+
+    /**
+     * 修改官网留言
+     */
+    @PostMapping("/updateById")
+    @ApiOperation(value = "官网留言修改")
+    @Log(title = "修改官网留言", businessType = BusinessType.UPDATE)
+    public AjaxResult updateById(@RequestBody OwLeavingMessage owLeavingMessage) {
+        owLeavingMessage.setUpdateTime(new Date());
+        return AjaxResult.success(service.updateById(owLeavingMessage));
+    }
+
+    @Log(title = "官网留言", businessType = BusinessType.DELETE)
+    @PostMapping("/delete")
+    @ApiOperation(value = "删除官网留言", notes = "删除官网留言")
+    public AjaxResult delete(@RequestBody List<String> ids)
+    {
+        return toAjax(service.removeByIds(ids));
+    }
+
+    @DeleteMapping("/deleteAll")
+    @ApiOperation(value = "清除数据", notes = "清除数据")
+    public AjaxResult deleteAll(){
+        return service.deleteAll();
+    }
+
+    @PostMapping("/getUploadTemplate")
+    @ApiOperation(value = "获取上传模板", notes = "获取上传模板")
+    public void getUploadTemplate(HttpServletResponse response) throws IOException {
+        DowntemplateUtil.downloadTemplate(response,"官网留言模板");
+    }
+
+    @PostMapping("/generateVoucher")
+    public void generateVoucher(HttpServletResponse response,String name,Long id) throws Exception {
+        service.generateVoucher(response,name,id);
+    }
+}
+

+ 105 - 0
background-service/zksy-admin/src/main/java/com/zksy/web/controller/basicData/XcrComplainController.java

@@ -0,0 +1,105 @@
+package com.zksy.web.controller.basicData;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zksy.basicData.domain.XcrComplain;
+import com.zksy.basicData.domain.XcrFile;
+import com.zksy.basicData.service.IXcrComplainService;
+import com.zksy.basicData.service.IXcrFileService;
+import com.zksy.common.annotation.Log;
+import com.zksy.common.core.controller.BaseController;
+import com.zksy.common.core.domain.AjaxResult;
+import com.zksy.common.enums.BusinessType;
+import com.zksy.common.utils.SearchUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 投诉Controller
+ *
+ * @author sy
+ * @date 2024-05-10
+ */
+@RestController
+@RequestMapping("/crmComplain")
+@Api(tags = "投诉", description = "投诉desc")
+public class XcrComplainController extends BaseController {
+
+    @Autowired
+    private IXcrComplainService service;
+
+    @Autowired
+    private IXcrFileService xcrFileService;
+
+    @GetMapping("/getById/{borrowId}")
+    @ApiOperation(value = "投诉搜索getById")
+    public AjaxResult getById(@PathVariable String borrowId) {
+        return AjaxResult.success(service.getByComplainId(borrowId));
+    }
+
+    @GetMapping("/findByPage")
+    @ApiOperation(value = "投诉分页")
+    public Page<XcrComplain> findByPage(long pageNum, long pageSize, String conditionJson) throws Exception {
+        Page<XcrComplain> page = service.page(new Page<>(pageNum, pageSize), SearchUtil.parseWhereSql(conditionJson));
+        for(XcrComplain entity : page.getRecords()){
+            List<XcrFile> crmFile = xcrFileService.selectByFid(entity.getId());
+            if(crmFile != null) {
+                entity.setFiles(crmFile);
+            }
+        }
+        return page;
+    }
+
+    @GetMapping("/getList")
+    @ApiOperation(value = "投诉查询所有")
+    public AjaxResult getList(String conditionJson) throws Exception {
+        List<XcrComplain> list = service.list(SearchUtil.parseWhereSql(conditionJson));
+        for(XcrComplain entity : list){
+            List<XcrFile> crmFile = xcrFileService.selectByFid(entity.getId());
+            if(crmFile != null) {
+                entity.setFiles(crmFile);
+            }
+        }
+        return AjaxResult.success(list);
+    }
+
+    /**
+     * 新增投诉
+     */
+    @PostMapping("/save")
+    @ApiOperation(value = "投诉新增")
+    @Log(title = "新增投诉", businessType = BusinessType.INSERT)
+    public AjaxResult saveCrmComplain(@RequestBody XcrComplain crmComplain) {
+        return service.saveCrmComplain(crmComplain);
+    }
+
+    /**
+     * 修改投诉
+     */
+    @PostMapping("/updateById")
+    @ApiOperation(value = "投诉修改")
+    @Log(title = "修改投诉", businessType = BusinessType.UPDATE)
+    public AjaxResult updateById(@RequestBody XcrComplain crmComplain) {
+        return service.updateCrmComplain(crmComplain);
+    }
+
+    @Log(title = "投诉", businessType = BusinessType.DELETE)
+    @PostMapping("/delete")
+    @ApiOperation(value = "删除投诉", notes = "删除投诉")
+    public AjaxResult delete(@RequestBody List<String> ids)
+    {
+        return service.removeCrmComplain(ids);
+    }
+
+    @PostMapping("/generateVoucher")
+    public void generateVoucher(HttpServletResponse response,String name,Long id) throws Exception {
+        service.generateVoucher(response,name,id);
+    }
+
+}
+

+ 71 - 0
background-service/zksy-admin/src/main/java/com/zksy/web/controller/basicData/XcrFileController.java

@@ -0,0 +1,71 @@
+package com.zksy.web.controller.basicData;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zksy.basicData.domain.XcrFile;
+import com.zksy.basicData.service.IXcrFileService;
+import com.zksy.common.annotation.Log;
+import com.zksy.common.core.controller.BaseController;
+import com.zksy.common.enums.BusinessType;
+import com.zksy.common.utils.SearchUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 文件管理Controller
+ *
+ * @author sy
+ * @date 2024-05-20
+ */
+@RestController
+@RequestMapping("/xcrFile")
+@Api(tags = "文件管理", description = "文件管理desc")
+public class XcrFileController extends BaseController {
+
+    @Autowired
+    private IXcrFileService service;
+
+    @GetMapping("/getById/{borrowId}")
+    @ApiOperation(value = "文件管理搜索getById")
+    public XcrFile getById(@PathVariable String borrowId) {
+        return service.getById(borrowId);
+    }
+
+    @GetMapping("/findByPage")
+    @ApiOperation(value = "文件管理分页")
+    public Page findByPage(long pageNum, long pageSize, String conditionJson) throws Exception {
+        return service.page(new Page<>(pageNum, pageSize), SearchUtil.parseWhereSql(conditionJson));
+    }
+
+    @GetMapping("/getList")
+    @ApiOperation(value = "文件管理根据条件查询所有")
+    public List<XcrFile> getList(String conditionJson) throws Exception {
+        return service.list(SearchUtil.parseWhereSql(conditionJson));
+    }
+
+    /**
+     * 新增文件管理
+     */
+    @PostMapping("/save")
+    @ApiOperation(value = "文件管理新增")
+    @Log(title = "新增文件管理", businessType = BusinessType.INSERT)
+    public boolean save(@RequestBody XcrFile crmFile) {
+        return service.save(crmFile);
+    }
+
+    /**
+     * 修改文件管理
+     */
+    @PostMapping("/updateById")
+    @ApiOperation(value = "文件管理修改")
+    @Log(title = "修改文件管理", businessType = BusinessType.UPDATE)
+    public boolean updateById(@RequestBody XcrFile crmFile) {
+        return service.updateById(crmFile);
+    }
+
+}
+

BIN=BIN
background-service/zksy-admin/src/main/resources/template/投诉模板.pdf


BIN=BIN
background-service/zksy-admin/src/main/resources/template/留言模板.pdf


+ 6 - 1
background-service/zksy-common/pom.xml

@@ -16,7 +16,12 @@
     </description>
 
     <dependencies>
-
+        <!--itextpdf-->
+        <dependency>
+            <groupId>com.itextpdf</groupId>
+            <artifactId>itextpdf</artifactId>
+            <version>5.5.13.1</version>
+        </dependency>
         <!-- Spring框架基本的核心工具 -->
         <dependency>
             <groupId>org.springframework</groupId>

+ 75 - 0
background-service/zksy-system/src/main/java/com/zksy/basicData/domain/OwLeavingMessage.java

@@ -0,0 +1,75 @@
+package com.zksy.basicData.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.zksy.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * 官网留言对象 ow_leaving_message
+ *
+ * @author sy
+ * @date 2024-06-27
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("ow_leaving_message")
+@ApiModel(value = "官网留言")
+public class OwLeavingMessage extends Model<OwLeavingMessage> {
+
+private static final long serialVersionUID=1L;
+
+@ApiModelProperty(value = "主键")
+    /** 主键 */
+        @TableId(type = IdType.AUTO)
+    private Long id;
+
+@ApiModelProperty(value = "留言类型")
+    /** 留言类型 */
+                @Excel(name = "留言类型")
+    private String type;
+
+@ApiModelProperty(value = "企业名称")
+    /** 企业名称 */
+                @Excel(name = "企业名称")
+    private String enterpriseName;
+
+@ApiModelProperty(value = "统一社会信用代码")
+    /** 统一社会信用代码 */
+                @Excel(name = "统一社会信用代码")
+    private String unifiedSocialCreditCode;
+
+@ApiModelProperty(value = "留言人姓名")
+    /** 留言人姓名 */
+                @Excel(name = "留言人姓名")
+    private String name;
+
+@ApiModelProperty(value = "联系方式")
+    /** 联系方式 */
+                @Excel(name = "联系方式")
+    private String phone;
+
+@ApiModelProperty(value = "身份证号")
+    /** 身份证号 */
+                @Excel(name = "身份证号")
+    private String card;
+
+@ApiModelProperty(value = "留言内容")
+    /** 留言内容 */
+                @Excel(name = "留言内容")
+    private String content;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+        }

+ 99 - 0
background-service/zksy-system/src/main/java/com/zksy/basicData/domain/XcrComplain.java

@@ -0,0 +1,99 @@
+package com.zksy.basicData.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.zksy.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 投诉对象 crm_complain
+ *
+ * @author sy
+ * @date 2024-05-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("xcr_complain")
+@ApiModel(value = "投诉")
+public class XcrComplain extends Model<XcrComplain> {
+
+private static final long serialVersionUID=1L;
+
+@ApiModelProperty(value = "主键")
+    /** 主键 */
+        @TableId(type = IdType.AUTO)
+    private Long id;
+
+@ApiModelProperty(value = "投诉类型")
+    /** 投诉类型 */
+@Excel(name = "投诉类型")
+    private String type;
+
+@ApiModelProperty(value = "投诉标题")
+    /** 投诉标题 */
+                @Excel(name = "投诉标题")
+    private String title;
+
+@ApiModelProperty(value = "投诉内容")
+    /** 投诉内容 */
+@Excel(name = "投诉内容")
+    private String content;
+
+@ApiModelProperty(value = "投诉人姓名")
+    /** 投诉人姓名 */
+                @Excel(name = "投诉人姓名")
+    private String name;
+
+    @ApiModelProperty(value = "企业名称")
+    /** 企业名称 */
+    @Excel(name = "企业名称")
+    private String enterpriseName;
+
+    @ApiModelProperty(value = "统一社会信用代码")
+    /** 统一社会信用代码 */
+    @Excel(name = "统一社会信用代码")
+    private String unifiedSocialCreditCode;
+
+@ApiModelProperty(value = "联系方式")
+    /** 联系方式 */
+                @Excel(name = "联系方式")
+    private String phone;
+
+@ApiModelProperty(value = "身份证号")
+    /** 身份证号 */
+                @Excel(name = "身份证号")
+    private String card;
+
+@ApiModelProperty(value = "图片文件")
+    /** 图片文件 */
+                @Excel(name = "图片文件")
+    private Long fileId;
+
+    @ApiModelProperty(value = "创建者")
+    private String createBy;
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    @ApiModelProperty(value = "更新者")
+    private String updateBy;
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+
+    @TableField(exist = false)
+    private List<XcrFile> files;
+
+
+        }

+ 66 - 0
background-service/zksy-system/src/main/java/com/zksy/basicData/domain/XcrFile.java

@@ -0,0 +1,66 @@
+package com.zksy.basicData.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * 文件管理对象 crm_file
+ *
+ * @author sy
+ * @date 2024-05-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("xcr_file")
+@ApiModel(value = "文件管理")
+public class XcrFile extends Model<XcrFile> {
+
+private static final long serialVersionUID=1L;
+
+@ApiModelProperty(value = "主键")
+    /** 主键 */
+        @TableId(type = IdType.AUTO)
+    private Long id;
+
+@ApiModelProperty(value = "父id")
+    private Long fid;
+
+@ApiModelProperty(value = "模块名称")
+    private String moduleName;
+
+@ApiModelProperty(value = "原文件名称")
+    private String fileOriginalName;
+
+@ApiModelProperty(value = "文件绝对路径")
+    private String fileUrl;
+
+@ApiModelProperty(value = "文件名称")
+    private String fileName;
+
+@ApiModelProperty(value = "文件大小")
+    private Long fileSize;
+
+@ApiModelProperty(value = "创建人")
+private String createBy;
+@ApiModelProperty(value = "创建时间")
+private Date createTime;
+@ApiModelProperty(value = "修改人")
+private String updateBy;
+@ApiModelProperty(value = "修改时间")
+private Date updateTime;
+@ApiModelProperty(value = "是否删除(0否1是)")
+    private Long isDelete;
+
+
+
+        }

+ 14 - 0
background-service/zksy-system/src/main/java/com/zksy/basicData/mapper/OwLeavingMessageMapper.java

@@ -0,0 +1,14 @@
+package com.zksy.basicData.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.basicData.domain.OwLeavingMessage;
+
+/**
+ * 官网留言Mapper接口
+ *
+ * @author sy
+ * @date 2024-06-27
+ */
+public interface OwLeavingMessageMapper extends BaseMapper<OwLeavingMessage> {
+
+}

+ 14 - 0
background-service/zksy-system/src/main/java/com/zksy/basicData/mapper/XcrComplainMapper.java

@@ -0,0 +1,14 @@
+package com.zksy.basicData.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.basicData.domain.XcrComplain;
+
+/**
+ * 投诉Mapper接口
+ *
+ * @author sy
+ * @date 2024-05-10
+ */
+public interface XcrComplainMapper extends BaseMapper<XcrComplain> {
+
+}

+ 14 - 0
background-service/zksy-system/src/main/java/com/zksy/basicData/mapper/XcrFileMapper.java

@@ -0,0 +1,14 @@
+package com.zksy.basicData.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.basicData.domain.XcrFile;
+
+/**
+ * 文件管理Mapper接口
+ *
+ * @author sy
+ * @date 2024-05-10
+ */
+public interface XcrFileMapper extends BaseMapper<XcrFile> {
+
+}

+ 27 - 0
background-service/zksy-system/src/main/java/com/zksy/basicData/service/IOwLeavingMessageService.java

@@ -0,0 +1,27 @@
+package com.zksy.basicData.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.basicData.domain.OwLeavingMessage;
+import com.zksy.common.core.domain.AjaxResult;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 官网留言Service接口
+ *
+ * @author sy
+ * @date 2024-06-27
+ */
+public interface IOwLeavingMessageService extends IService<OwLeavingMessage> {
+
+    /**
+ * TODO 删除全部数据
+ * @param
+ * @return com.zksy.common.core.domain.AjaxResult
+ * @author Administrator
+ * @date 2024/5/13 17:12:22
+ */
+    AjaxResult deleteAll();
+
+    void generateVoucher(HttpServletResponse response,String name, Long id) throws Exception;
+}

+ 47 - 0
background-service/zksy-system/src/main/java/com/zksy/basicData/service/IXcrComplainService.java

@@ -0,0 +1,47 @@
+package com.zksy.basicData.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.basicData.domain.XcrComplain;
+import com.zksy.common.core.domain.AjaxResult;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 投诉Service接口
+ *
+ * @author sy
+ * @date 2024-05-10
+ */
+public interface IXcrComplainService extends IService<XcrComplain> {
+    /**
+     * TODO 新增投诉
+      * @param xcrComplain
+     * @return com.zksy.common.core.domain.AjaxResult
+     * @author Administrator
+     * @date 2024/5/20 09:17:26
+     */
+    AjaxResult saveCrmComplain(XcrComplain xcrComplain);
+
+    /**
+     * TODO 修改投诉
+      * @param xcrComplain
+     * @return com.zksy.common.core.domain.AjaxResult
+     * @author Administrator
+     * @date 2024/5/20 09:18:01
+     */
+    AjaxResult updateCrmComplain(XcrComplain xcrComplain);
+
+    AjaxResult getByComplainId(String id);
+
+    /**
+     * TODO 批量删除投诉信息和文件
+      * @param ids
+     * @return com.zksy.common.core.domain.AjaxResult
+     * @author Administrator
+     * @date 2024/5/21 09:28:14
+     */
+    AjaxResult removeCrmComplain(List<String> ids);
+
+    void generateVoucher(HttpServletResponse response, String name, Long id) throws Exception;
+}

+ 33 - 0
background-service/zksy-system/src/main/java/com/zksy/basicData/service/IXcrFileService.java

@@ -0,0 +1,33 @@
+package com.zksy.basicData.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.basicData.domain.XcrFile;
+
+import java.util.List;
+
+/**
+ * 文件管理Service接口
+ *
+ * @author sy
+ * @date 2024-05-20
+ */
+public interface IXcrFileService extends IService<XcrFile> {
+
+    /**
+     * TODO 根据(多个)fid查询文件
+      * @param fids
+     * @return java.util.List<com.zksy.system.basicData.domain.CrmFile>
+     * @author Administrator
+     * @date 2024/5/20 10:13:37
+     */
+    List<XcrFile> selectByFids(List<String> fids);
+
+    /**
+     * TODO 根据fid查询文件
+     * @param fid
+     * @return java.util.List<com.zksy.system.basicData.domain.CrmFile>
+     * @author Administrator
+     * @date 2024/5/20 10:13:37
+     */
+    List<XcrFile> selectByFid(Long fid);
+}

+ 71 - 0
background-service/zksy-system/src/main/java/com/zksy/basicData/service/impl/OwLeavingMessageServiceImpl.java

@@ -0,0 +1,71 @@
+package com.zksy.basicData.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.basicData.domain.OwLeavingMessage;
+import com.zksy.basicData.mapper.OwLeavingMessageMapper;
+import com.zksy.basicData.service.IOwLeavingMessageService;
+import com.zksy.basicData.utils.DeleteTableUtils;
+import com.zksy.common.core.domain.AjaxResult;
+import com.zksy.common.utils.DateUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import static com.zksy.basicData.utils.PdfUtil.fillPdf;
+
+/**
+ * 官网留言Service业务层处理
+ *
+ * @author sy
+ * @date 2024-06-27
+ */
+@Service
+public class OwLeavingMessageServiceImpl extends ServiceImpl<OwLeavingMessageMapper, OwLeavingMessage> implements IOwLeavingMessageService {
+    @Resource
+    private OwLeavingMessageMapper mapper;
+
+    @Override
+    @Transactional
+    public AjaxResult deleteAll() {
+        DeleteTableUtils<OwLeavingMessage> utils = new DeleteTableUtils<>();
+        utils.del(OwLeavingMessage::getId,mapper);
+        return AjaxResult.success("全部删除成功");
+    }
+
+    public void generateVoucher(HttpServletResponse response,String name, Long id) throws Exception {
+        InputStream inputStream = new ClassPathResource("/template/留言模板.pdf").getInputStream();
+        Map<String, String> data = new HashMap<>();
+        OwLeavingMessage owLeavingMessage = mapper.selectById(id);
+
+        data.put("type", name);
+        data.put("createTime", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, owLeavingMessage.getCreateTime()));
+        data.put("name", owLeavingMessage.getName());
+        data.put("phone", owLeavingMessage.getPhone());
+        if(StringUtils.isNotEmpty(owLeavingMessage.getEnterpriseName())) {
+            data.put("enterpriseName", owLeavingMessage.getEnterpriseName());
+        }
+        if(StringUtils.isNotEmpty(owLeavingMessage.getUnifiedSocialCreditCode())) {
+            data.put("unifiedSocialCreditCode", owLeavingMessage.getUnifiedSocialCreditCode());
+        }
+        data.put("content",owLeavingMessage.getContent());
+
+        byte[] filledPdfBytes = fillPdf(inputStream, null, data);
+        // 设置HTTP响应头
+        response.setContentType("application/pdf");
+        response.setHeader("Content-Disposition", "attachment; filename=liuyan.pdf");
+
+        // 将字节数组写入到HTTP响应输出流中
+        OutputStream outStream = response.getOutputStream();
+        outStream.write(filledPdfBytes);
+        outStream.flush();
+        outStream.close();
+    }
+}

+ 148 - 0
background-service/zksy-system/src/main/java/com/zksy/basicData/service/impl/XcrComplainServiceImpl.java

@@ -0,0 +1,148 @@
+package com.zksy.basicData.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.basicData.domain.XcrComplain;
+import com.zksy.basicData.domain.XcrFile;
+import com.zksy.basicData.mapper.XcrComplainMapper;
+import com.zksy.basicData.service.IXcrComplainService;
+import com.zksy.basicData.service.IXcrFileService;
+import com.zksy.common.core.domain.AjaxResult;
+import com.zksy.common.utils.DateUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static com.zksy.basicData.utils.PdfUtil.fillPdf;
+
+/**
+ * 投诉Service业务层处理
+ *
+ * @author sy
+ * @date 2024-05-10
+ */
+@Service
+@Slf4j
+public class XcrComplainServiceImpl extends ServiceImpl<XcrComplainMapper, XcrComplain> implements IXcrComplainService {
+
+    @Resource
+    private XcrComplainMapper mapper;
+
+    @Autowired
+    private IXcrFileService xcrFileService;
+
+    @Override
+    public AjaxResult saveCrmComplain(XcrComplain xcrComplain) {
+        XcrComplain entity = new XcrComplain();
+        BeanUtils.copyProperties(xcrComplain,entity);
+        entity.setCreateBy(xcrComplain.getName());
+        entity.setCreateTime(new Date());
+        int number = mapper.insert(entity);
+        if(number > 0 ){
+            if(xcrComplain.getFiles() != null) {
+                for (XcrFile file : xcrComplain.getFiles()) {
+                    //添加文件
+                    file.setFid(entity.getId());
+                    file.setUpdateBy(entity.getName());
+                    file.setUpdateTime(new Date());
+                    xcrFileService.updateById(file);
+                }
+            }
+        }else{
+            return AjaxResult.success("投诉失败");
+        }
+        return AjaxResult.success("投诉成功");
+    }
+
+    @Override
+    public AjaxResult updateCrmComplain(XcrComplain crmComplain) {
+        XcrComplain info = mapper.selectById(crmComplain.getId());
+        log.info("数据长度之前:{}",crmComplain.getFiles().size());
+        //赋值
+        BeanUtils.copyProperties(crmComplain, info);
+        info.setUpdateBy(info.getName());
+        info.setFiles(null);
+        info.setUpdateTime(new Date());
+        int number = mapper.updateById(info);
+        if(number > 0 ){
+            if(crmComplain.getFiles() != null) {
+                for (XcrFile file : crmComplain.getFiles()) {
+                    //添加文件
+                    file.setFid(info.getId());
+                    file.setUpdateBy(info.getName());
+                    file.setUpdateTime(new Date());
+                    xcrFileService.updateById(file);
+                }
+            }
+        }else{
+            return AjaxResult.success("投诉失败");
+        }
+        return AjaxResult.success("投诉成功");
+    }
+
+    @Override
+    public AjaxResult getByComplainId(String id) {
+        XcrComplain crmComplain = baseMapper.selectById(id);
+        List<XcrFile> crmFile = xcrFileService.selectByFid(crmComplain.getId());
+        if(crmFile != null) {
+            crmComplain.setFiles(crmFile);
+        }
+        return AjaxResult.success("查询成功",crmComplain);
+    }
+
+    @Override
+    public AjaxResult removeCrmComplain(List<String> ids) {
+        //查询fids所有文件
+        List<XcrFile> crmFileList = xcrFileService.selectByFids(ids);
+        for(XcrFile crmFile : crmFileList){
+            //根据id删除文件
+            xcrFileService.removeById(crmFile.getId());
+        }
+        mapper.deleteBatchIds(ids);
+        return AjaxResult.success("删除文件成功");
+    }
+
+    @Override
+    public void generateVoucher(HttpServletResponse response, String name, Long id) throws Exception {
+        InputStream inputStream = new ClassPathResource("/template/投诉模板.pdf").getInputStream();
+        Map<String, String> data = new HashMap<>();
+        XcrComplain owLeavingMessage = mapper.selectById(id);
+
+        data.put("type", name);
+        data.put("title",owLeavingMessage.getTitle());
+        data.put("createTime", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, owLeavingMessage.getCreateTime()));
+        data.put("name", owLeavingMessage.getName());
+        data.put("phone", owLeavingMessage.getPhone());
+        data.put("card", owLeavingMessage.getCard());
+        if(StringUtils.isNotEmpty(owLeavingMessage.getEnterpriseName())) {
+            data.put("enterpriseName", owLeavingMessage.getEnterpriseName());
+        }
+        if(StringUtils.isNotEmpty(owLeavingMessage.getUnifiedSocialCreditCode())) {
+            data.put("unifiedSocialCreditCode", owLeavingMessage.getUnifiedSocialCreditCode());
+        }
+        data.put("content",owLeavingMessage.getContent());
+        data.put("remark", owLeavingMessage.getRemark());
+
+        byte[] filledPdfBytes = fillPdf(inputStream, null, data);
+        // 设置HTTP响应头
+        response.setContentType("application/pdf");
+        response.setHeader("Content-Disposition", "attachment; filename=tousu.pdf");
+
+        // 将字节数组写入到HTTP响应输出流中
+        OutputStream outStream = response.getOutputStream();
+        outStream.write(filledPdfBytes);
+        outStream.flush();
+        outStream.close();
+    }
+}

+ 43 - 0
background-service/zksy-system/src/main/java/com/zksy/basicData/service/impl/XcrFileServiceImpl.java

@@ -0,0 +1,43 @@
+package com.zksy.basicData.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.basicData.domain.XcrFile;
+import com.zksy.basicData.mapper.XcrFileMapper;
+import com.zksy.basicData.service.IXcrFileService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 文件管理Service业务层处理
+ *
+ * @author sy
+ * @date 2024-05-20
+ */
+@Service
+public class XcrFileServiceImpl extends ServiceImpl<XcrFileMapper, XcrFile> implements IXcrFileService {
+
+    @Autowired
+    private IXcrFileService service;
+
+    @Override
+    public List<XcrFile> selectByFids(List<String> fids) {
+        QueryWrapper<XcrFile> queryWrapper =new QueryWrapper<>();
+        queryWrapper.in("fid",fids);
+        BaseMapper<XcrFile> baseMapper = service.getBaseMapper();
+        List<XcrFile> crmFileList = baseMapper.selectList(queryWrapper);
+        return crmFileList;
+    }
+
+    @Override
+    public List<XcrFile> selectByFid(Long fid) {
+        QueryWrapper<XcrFile> queryWrapper =new QueryWrapper<>();
+        queryWrapper.eq("fid",fid);
+        BaseMapper<XcrFile> baseMapper = service.getBaseMapper();
+        List<XcrFile> crmFileList = baseMapper.selectList(queryWrapper);
+        return crmFileList;
+    }
+}

+ 42 - 0
background-service/zksy-system/src/main/java/com/zksy/basicData/utils/DeleteTableUtils.java

@@ -0,0 +1,42 @@
+package com.zksy.basicData.utils;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+/**
+ * @author Administrator
+ * @version 1.0
+ * @project credit-rating
+ * @description 删除整张表
+ * @date 2024/5/13 11:59:24
+ */
+@NoArgsConstructor
+@AllArgsConstructor
+public class DeleteTableUtils<T> {
+
+    private T entity;
+    /**
+     * TODO
+      * @param fun 一般传 类名::getId()
+     * @param mapper 传实体类对应的mapper
+     * @return void
+     * @author Administrator
+     * @date 2024/5/13 12:22:26
+     */
+    public <T> void del(Function<T, Long> fun, BaseMapper<T> mapper){
+        List<T> list = mapper.selectList(null);
+        if(list == null){
+            throw new RuntimeException("没有数据");
+        }
+        List<Long> ids = list.stream().map(fun).collect(Collectors.toList());
+        if(ids.size() == 0){
+            throw new RuntimeException("没有数据");
+        }
+        mapper.deleteBatchIds(ids);
+    }
+}

+ 74 - 0
background-service/zksy-system/src/main/java/com/zksy/basicData/utils/DowntemplateUtil.java

@@ -0,0 +1,74 @@
+package com.zksy.basicData.utils;
+
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.util.FileCopyUtils;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+public class DowntemplateUtil {
+
+    private final static String FILE_PATH = "template/";
+    private final static String FILE_SUFFIX = ".xlsx";
+    private final static String FILE_WORD = ".doc";
+    /**
+     * 给一个请求体对象再给个template下的文件   后缀需要为.xlsx的文件 就能给前端下载了
+     * @param response
+     * @param fileName
+     * @throws IOException
+     */
+    public static void downloadTemplate(HttpServletResponse response,String fileName) throws IOException {
+        ClassPathResource resource = new ClassPathResource(FILE_PATH + fileName + FILE_SUFFIX);
+        if (!resource.exists()) {
+            response.sendError(HttpServletResponse.SC_NOT_FOUND, "没找到这个: " + FILE_PATH + fileName + FILE_SUFFIX + "文件");
+            throw new IOException("没找到这个: " + FILE_PATH + fileName + FILE_SUFFIX + "文件");
+        }
+
+        // 设置响应头以支持文件下载
+        HttpHeaders headers = new HttpHeaders();
+        headers.add(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + new String((fileName + FILE_SUFFIX).getBytes("UTF-8"), "ISO-8859-1"));
+        headers.add(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel");
+
+        // 从资源读取输入流并写入响应的输出流
+        try (InputStream inputStream = resource.getInputStream();
+             OutputStream outputStream = response.getOutputStream()) {
+
+            response.setHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(resource.contentLength()));
+
+            FileCopyUtils.copy(inputStream, outputStream);
+            outputStream.flush();
+        }
+    }
+    /**
+     * 给一个请求体对象再给个template下的文件   后缀需要为.xlsx的文件 就能给前端下载了
+     * @param response
+     * @param fileName
+     * @throws IOException
+     */
+    public static void downloadTemplateWord(HttpServletResponse response,String fileName) throws IOException {
+        ClassPathResource resource = new ClassPathResource(FILE_PATH + fileName + FILE_WORD);
+        if (!resource.exists()) {
+            response.sendError(HttpServletResponse.SC_NOT_FOUND, "没找到这个: " + FILE_PATH + fileName + FILE_WORD + "文件");
+            throw new IOException("没找到这个: " + FILE_PATH + fileName + FILE_WORD + "文件");
+        }
+
+        // 设置响应头以支持文件下载
+        HttpHeaders headers = new HttpHeaders();
+        headers.add(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + new String((fileName + FILE_WORD).getBytes("UTF-8"), "ISO-8859-1"));
+        headers.add(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel");
+
+        // 从资源读取输入流并写入响应的输出流
+        try (InputStream inputStream = resource.getInputStream();
+             OutputStream outputStream = response.getOutputStream()) {
+
+            response.setHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(resource.contentLength()));
+
+            FileCopyUtils.copy(inputStream, outputStream);
+            outputStream.flush();
+        }
+    }
+}

+ 206 - 0
background-service/zksy-system/src/main/java/com/zksy/basicData/utils/PdfUtil.java

@@ -0,0 +1,206 @@
+package com.zksy.basicData.utils;
+
+import com.itextpdf.text.Document;
+import com.itextpdf.text.DocumentException;
+import com.itextpdf.text.Image;
+import com.itextpdf.text.Rectangle;
+import com.itextpdf.text.pdf.*;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class PdfUtil {
+
+    /**htmlT
+     * 填充pdf
+     *
+     * @param inputStream   pdf模板
+     * @param createFileUrl 创建的pdf存放路径 (如果为空则不会写入)
+     * @param dataMap       文字替换map
+     * @return
+     * @throws Exception
+     */
+
+
+    public static byte[] fillPdf(InputStream inputStream, String createFileUrl, Map<String, String> dataMap) throws Exception {
+        PdfReader reader = new PdfReader(inputStream);
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        /* 将要生成的目标PDF文件名称 */
+        PdfStamper ps = new PdfStamper(reader, bos);
+
+        //使用中文字体
+        BaseFont bf = BaseFont.createFont("simsun.ttc,0" , BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
+        ArrayList<BaseFont> fontList = new ArrayList<BaseFont>();
+        fontList.add(bf);
+
+        /* 取出报表模板中的所有字段 */
+        AcroFields fields = ps.getAcroFields();
+        fields.setSubstitutionFonts(fontList);
+        if (dataMap != null){
+            //替换文字
+            fillData(fields, dataMap);
+        }
+        /* 必须要调用这个,否则文档不会生成的 */
+        ps.setFormFlattening(true);
+        ps.close();
+
+        byte[] bytes = bos.toByteArray();
+        if (StringUtils.isNotBlank(createFileUrl)) {
+            OutputStream fos = new FileOutputStream(createFileUrl);
+            fos.write(bytes);
+            fos.flush();
+            fos.close();
+        }
+        bos.close();
+        reader.close();
+        return bytes;
+    }
+
+    /**
+     * 填充数据
+     *
+     * @param fields
+     * @param data
+     * @throws IOException
+     */
+    public static void fillData(AcroFields fields, Map<String, String> data)
+            throws IOException {
+        for (String key : data.keySet()) {
+            String value = data.get(key);
+            try {
+                fields.setField(key, value); // 为字段赋值,注意字段名称是区分大小写的
+            } catch (com.itextpdf.text.DocumentException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    /**
+     * 填充图片
+     *
+     * @param stamper
+     * @param fields
+     * @param imageMap
+     * @throws Exception
+     */
+    public static void fillImage(PdfStamper stamper, AcroFields fields, Map<String, byte[]> imageMap) throws Exception {
+        for (String fieldName : imageMap.keySet()
+                ) {
+            // 通过域名获取所在页和坐标,左下角为起点
+            int pageNo = fields.getFieldPositions(fieldName).get(0).page;
+            Rectangle signRect = fields.getFieldPositions(fieldName).get(0).position;
+            float x = signRect.getLeft();
+            float y = signRect.getBottom();
+
+            // 读图片
+            Image image = Image.getInstance(imageMap.get(fieldName));
+            // 获取操作的页面
+            PdfContentByte under = stamper.getOverContent(pageNo);
+            // 根据域的大小缩放图片
+            image.scaleToFit(signRect.getWidth(), signRect.getHeight());
+            // 添加图片
+            y = signRect.getTop() - image.getPlainHeight();//使图片出现在左上角
+            image.setAbsolutePosition(x, y);
+            under.addImage(image);
+        }
+    }
+
+    /**
+     * 获得指定文件的byte数组
+     */
+    public static byte[] getBytes(String filePath) {
+        byte[] buffer = null;
+        try {
+            File file = new File(filePath);
+            FileInputStream fis = new FileInputStream(file);
+            ByteArrayOutputStream bos = new ByteArrayOutputStream(1000);
+            byte[] b = new byte[1000];
+            int n;
+            while ((n = fis.read(b)) != -1) {
+                bos.write(b, 0, n);
+            }
+            fis.close();
+            bos.close();
+            buffer = bos.toByteArray();
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return buffer;
+    }
+
+    public static Map<String, byte[]> dataMap() {
+        Map<String, byte[]> data = new HashMap<>();
+        data.put("LEADERSHIP_INSTRUCTIONS_NAME", getBytes("H:/PDF/name.png"));
+        data.put("ACCEPTANCE_SITUATION", getBytes("H:/PDF/name2.png"));
+        data.put("INSTALL_USER", getBytes("H:/PDF/name3.png"));
+        data.put("PAYMENT_RECORDS", getBytes("H:/PDF/name4.png"));
+        data.put("MATERIALS_BUDGET", getBytes("H:/PDF/name5.png"));
+        return data;
+    }
+
+    /**
+     * 根据byte进行合并
+     * @param byteList  需要合并的pdf列表(文件流)      byte
+     * @param strList   需要合并的pdf列表(文件地址)    String
+     * @param savePath  保存路径(文件流输出路径)       FileOutputStream
+     */
+    public static void mergeAccording(List<byte[]> byteList, List<String> strList, String savePath)  {
+        Document document = null;
+        try {
+            List<byte[]> fileList = new ArrayList<>();
+            if (CollectionUtils.isNotEmpty(byteList)){
+                fileList = byteList;
+            }else{
+                for (String s : strList) {
+                    fileList.add(getBytes(s));
+                }
+            }
+
+            document = new Document(new PdfReader(fileList.get(0)).getPageSize(1));
+            PdfCopy copy = new PdfCopy(document, new FileOutputStream(savePath));
+            document.open();
+            for (int i = 0; i < fileList.size(); i++) {
+                PdfReader reader = new PdfReader(fileList.get(i));
+                int n = reader.getNumberOfPages();// 获得总页码
+                for (int j = 1; j <= n; j++) {
+                    document.newPage();
+                    PdfImportedPage page = copy.getImportedPage(reader, j);// 从当前Pdf,获取第j页
+                    copy.addPage(page);
+                }
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (DocumentException e) {
+            e.printStackTrace();
+        } finally {
+            if (document != null) {
+                document.close();
+            }
+        }
+    }
+
+/*    static String savepath = "E:\\IdeaProjects\\water\\attachment\\resource\\20190413\\R190413101922623.pdf";
+
+    public static void main(String[] args) {
+        List<String> fileList = getFiles();
+        mergeAccording(null, fileList, savepath);
+        System.out.println(getBytes(savepath));
+    }
+
+    public static List<String> getFiles() {
+        List<String> fileList = new ArrayList<String>();
+        fileList.add("E:\\IdeaProjects\\water\\attachment\\resource\\20190413\\R190413093901966.pdf\\");
+        fileList.add("E:\\IdeaProjects\\water\\attachment\\resource\\20190413\\R190413093902569.pdf\\");
+        fileList.add("E:\\IdeaProjects\\water\\attachment\\resource\\20190413\\R190413093902764.pdf\\");
+        fileList.add("E:\\IdeaProjects\\water\\attachment\\resource\\20190413\\R190413093902721.pdf\\");
+        return fileList;
+    }*/
+
+}

+ 19 - 0
background-service/zksy-system/src/main/resources/mapper/basicData/OwLeavingMessageMapper.xml

@@ -0,0 +1,19 @@
+<?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.zksy.basicData.mapper.OwLeavingMessageMapper">
+    
+    <resultMap type="OwLeavingMessage" id="OwLeavingMessageResult">
+        <result property="id"    column="id"    />
+        <result property="type"    column="type"    />
+        <result property="enterpriseName"    column="enterprise_name"    />
+        <result property="unifiedSocialCreditCode"    column="unified_social_credit_code"    />
+        <result property="name"    column="name"    />
+        <result property="phone"    column="phone"    />
+        <result property="card"    column="card"    />
+        <result property="content"    column="content"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+</mapper>

+ 22 - 0
background-service/zksy-system/src/main/resources/mapper/basicData/XcrComplainMapper.xml

@@ -0,0 +1,22 @@
+<?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.zksy.basicData.mapper.XcrComplainMapper">
+    
+    <resultMap type="XcrComplain" id="XcrComplainResult">
+        <result property="id"    column="id"    />
+        <result property="type"    column="type"    />
+        <result property="title"    column="title"    />
+        <result property="content"    column="content"    />
+        <result property="name"    column="name"    />
+        <result property="phone"    column="phone"    />
+        <result property="card"    column="card"    />
+        <result property="fileId"    column="file_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+</mapper>

+ 21 - 0
background-service/zksy-system/src/main/resources/mapper/basicData/XcrFileMapper.xml

@@ -0,0 +1,21 @@
+<?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.zksy.basicData.mapper.XcrFileMapper">
+    
+    <resultMap type="XcrFile" id="XcrFileResult">
+        <result property="id"    column="id"    />
+        <result property="fid"    column="fid"    />
+        <result property="moduleName"    column="module_name"    />
+        <result property="fileOriginalName"    column="file_original_name"    />
+        <result property="fileUrl"    column="file_url"    />
+        <result property="fileName"    column="file_name"    />
+        <result property="fileSize"    column="file_size"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="isDelete"    column="is_delete"    />
+    </resultMap>
+</mapper>

+ 3 - 2
data-service/src/main/java/com/zksy/data/controller/TestController.java

@@ -333,7 +333,7 @@ public class TestController {
         executeServiceCall(() -> xcrChangeFilingService.saveDataByUniCode("gateway/api/1/getBgbaxxByUniscid"), "gateway/api/1/getBgbaxxByUniscid");
         //executeServiceCall(() -> xcrSocialInsuranceDataService.saveDataByUniCode("gateway/api/1/getQynbshbxxxByUniscid"), "gateway/api/1/getQynbshbxxxByUniscid");
         executeServiceCall(() -> xcrAgriculturalCollegeAnnualReportService.saveDataByUniCode("gateway/api/1/getNznbjbxxByUniscid"), "gateway/api/1/getNznbjbxxByUniscid");
-        executeServiceCall(() -> xcrInspectionResultsService.saveDataByUniCode("gateway/api/1/getJcjgxxByUniscid"), "gateway/api/1/getJcjgxxByUniscid");
+        //executeServiceCall(() -> xcrInspectionResultsService.saveDataByUniCode("gateway/api/1/getJcjgxxByUniscid"), "gateway/api/1/getJcjgxxByUniscid");
         // 个体经营者基本信息
         executeServiceCall(() -> xcrIndividualBusinessInformationService.saveDataByUniCode("gateway/api/1/getGtjyzjbxxByUniscid"), "gateway/api/1/getGtjyzjbxxByUniscid");
         // 个体工商户基本信息
@@ -493,8 +493,9 @@ public class TestController {
     @GetMapping("/testClient")
     public Result testClient(){
         //xcrEBaseinfoService.saveDataByUniCode("123");
-        xcrAnnualReportBaseInfoService.saveDataByUniCode("123");
+        //xcrAnnualReportBaseInfoService.saveDataByUniCode("123");
         //xcrEnterpriseAnnualReportShareholderService.saveDataByUniCode("123");
+        xcrInspectionResultsService.saveDataByUniCode("");
         return Result.ok();
     }
 }