Przeglądaj źródła

中审代码修改提交

wangqiang 2 lat temu
rodzic
commit
910242c682
14 zmienionych plików z 1191 dodań i 60 usunięć
  1. 176 0
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/controller/ZsReimbursementInfoController.java
  2. 425 0
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/domain/ZSProgramProjectListInfo.java
  3. 11 9
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/mapper/ZsReimbursementInfoMapper.java
  4. 2 2
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/mapper/xml/ZsReimbursementInfoMapper.xml
  5. 41 38
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/service/ZsReimbursementInfoService.java
  6. 2 3
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/service/dto/ZsSaveInfoDto.java
  7. 323 0
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/util/ZSEasyPoiUtil.java
  8. 75 0
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/util/ZSExcelDiceAddressListHandlerImpl.java
  9. 6 0
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalType/mapper/ZsReimbursementTypeMapper.java
  10. 13 0
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalType/mapper/xml/ZsReimbursementTypeMapper.xml
  11. 113 7
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalType/service/ZsReimbursementTypeService.java
  12. 2 0
      jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/mapper/CwReimbursementTypeMapper.java
  13. 1 1
      jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/service/CwReimbursementTypeService.java
  14. 1 0
      jeeplus-modules/pom.xml

+ 176 - 0
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/controller/ZsReimbursementInfoController.java

@@ -0,0 +1,176 @@
+package com.jeeplus.centrecareful.approvalInfo.controller;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.centrecareful.approvalInfo.domain.ZSProgramProjectListInfo;
+import com.jeeplus.centrecareful.approvalInfo.service.ZsReimbursementInfoService;
+import com.jeeplus.centrecareful.approvalInfo.service.dto.*;
+import com.jeeplus.centrecareful.approvalInfo.util.ZSEasyPoiUtil;
+import com.jeeplus.common.excel.ExcelOptions;
+import com.jeeplus.common.excel.ExportMode;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.logging.annotation.ApiLog;
+import com.jeeplus.logging.constant.enums.LogTypeEnum;
+import com.jeeplus.utils.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.http.ResponseEntity;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-24 16:44
+ **/
+@RestController
+@Api(tags ="财务-报销申请")
+@RequestMapping(value = "/zsReimbursement/info")
+public class ZsReimbursementInfoController {
+
+    @Resource
+    private ZsReimbursementInfoService service;
+
+    @Resource
+    private IFlowableApi flowTaskService;
+
+    /**
+     * 报告号查询
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "报告号查询")
+    @GetMapping("/reportNoList")
+    public ResponseEntity<IPage<ZsReportNoDto>> reportNoList(Page<ZsReportNoDto> page, ZsReportNoDto dto) throws Exception{
+        IPage<ZsReportNoDto> iPage = service.getReportNoList(page, dto);
+        return ResponseEntity.ok(iPage);
+    }
+
+    /**
+     * 列表查询
+     * @param dto/reimbursementApproval/type/bxList
+     * @return
+     */
+    @ApiOperation(value = "列表查询")
+    @GetMapping("/list")
+    public ResponseEntity<IPage<ZsRetureListDto>> list(Page<ZsRetureListDto> page, ZsQueryListDto dto) throws Exception{
+        IPage<ZsRetureListDto> iPage = service.list(page, dto);
+        iPage.getRecords().stream().forEach(i -> {
+            if (StringUtils.isNotBlank(i.getProcInsId()) && StringUtils.isNotBlank(i.getTaskId())) {
+                i.setAuditUserIds(flowTaskService.getTaskAuditUsers(i.getTaskId()));  // 获取数据审核人
+            }
+        });
+        return ResponseEntity.ok(iPage);
+    }
+
+    /**
+     * 项目登记列表
+     * @param info
+     * @param page
+     * @return
+     * @throws Exception
+     */
+    @ApiOperation(value = "项目登记列表")
+    @GetMapping(value = "/projectList")
+    public ResponseEntity<IPage<ZSProgramProjectListInfo>> projectList(ZSProgramProjectListInfo info, Page<ZSProgramProjectListInfo> page) throws Exception {
+        IPage<ZSProgramProjectListInfo> list = service.projectList(page, info, "1");
+        return ResponseEntity.ok (list);
+    }
+
+    /**
+     * 新增/修改
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "新增、修改")
+    @PostMapping("/save")
+    public ResponseEntity<String> save(@RequestBody ZsSaveInfoDto dto) throws Exception{
+        String s = service.save(dto);
+        return ResponseUtil.newInstance().add("businessTable", "zs_reimbursement_info").add("businessId", s).ok ("操作成功");
+    }
+
+    /**
+     * 删除
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "删除")
+    @GetMapping("/remove")
+    public ResponseEntity<String> remove(@RequestParam String id){
+        String s = service.remove(id);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 查询
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "查询")
+    @GetMapping("/findById")
+    public ResponseEntity<ZsSaveInfoDto> findById(@RequestParam String id) throws Exception{
+        ZsSaveInfoDto dto = service.findById(id);
+        return ResponseEntity.ok(dto);
+    }
+
+    @ApiOperation(value = "发票号判断")
+    @GetMapping("/checkNumber")
+    public ResponseEntity<Boolean> checkNumber(@RequestParam String number) {
+        Boolean is = service.checkNumber(number);
+        return ResponseEntity.ok(is);
+    }
+
+    /**
+     * 根据id修改状态status
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "updateStatusById")
+    public void updateStatusById(@RequestBody ZsRetureListDto dto) {
+        service.updateStatusById(dto);
+    }
+
+    @ApiOperation(value = "用户树形")
+    @GetMapping(value = "/userTree")
+    public ResponseEntity<List<ZsTreeUserDto>> userTree(@RequestParam String name) {
+        List<ZsTreeUserDto> list = service.userTree(name);
+        return ResponseEntity.ok(list);
+    }
+
+
+
+    @ApiLog(value = "中审报销数据", type = LogTypeEnum.EXPORT)
+    @GetMapping("exportFile")
+    @ApiOperation(value = "中审报销数据")
+    public void exportFile(ZsQueryListDto cwFinanceInvoiceDTO, Page <ZsRetureListDto> page, ExcelOptions options, HttpServletResponse response) throws Exception {
+        String fileName = options.getFilename();
+        String sheetName = options.getSheetName();
+        List<ZsRetureListDto> result = new ArrayList<>();
+        if ( ExportMode.current.equals ( options.getMode() ) ) {
+            result = service.list (page,cwFinanceInvoiceDTO).getRecords();
+        } else if (ExportMode.selected.equals ( options.getMode() )) {
+            result = service.list (page,cwFinanceInvoiceDTO).getRecords().stream ( ).filter ( item ->
+                    options.getSelectIds ( ).contains ( item.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize (-1);
+            page.setCurrent (0);
+            result = service.list (page,cwFinanceInvoiceDTO).getRecords();
+        }
+        ZSEasyPoiUtil.exportExcel ( result, sheetName,  sheetName, ZsRetureListDto.class, fileName, response );
+
+    }
+
+
+
+    @ApiOperation(value = "关联报销")
+    @GetMapping(value = "/relationReimbursementList")
+    public ResponseEntity<IPage<ZsRetureListDto>> relationReimbursementList(Page<ZsRetureListDto> page, @RequestParam("id") String id) {
+        IPage<ZsRetureListDto> listDtoIPage = service.relationReimbursementList(page, id);
+        return ResponseEntity.ok(listDtoIPage);
+    }
+
+}

+ 425 - 0
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/domain/ZSProgramProjectListInfo.java

@@ -0,0 +1,425 @@
+package com.jeeplus.centrecareful.approvalInfo.domain;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.query.Query;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+@Data
+@TableName(value = "program_project_list_info")
+public class ZSProgramProjectListInfo {
+
+    /**
+     * 实体主键
+     */
+    @TableId
+    private String id;
+
+    /**
+     * 创建日期
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "创建时间", width = 30, orderNum = "6")
+    private Date createDate;
+
+    /**
+     * 创建人
+     */
+    @Query(tableColumn = "a.create_by")
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
+
+    /**
+     * 更新日期
+     */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateDate;
+
+    /**
+     * 更新人
+     */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateBy;
+
+    /**
+     * 逻辑删除标记
+     */
+    @TableLogic
+    @TableField(fill = FieldFill.INSERT)
+    private Integer delFlag;
+
+    private String contractId;
+
+    /**
+     * 合同名称
+     */
+    @Excel(name = "合同名称", width = 30, orderNum = "3")
+    @Query(tableColumn = "a.contract_name")
+    private String contractName;
+
+    /**
+     * 委托方
+     */
+    private String client;
+
+    @Excel(name = "委托方", width = 30, orderNum = "5")
+    @Query(tableColumn = "a.client_name")
+    private String clientName;
+
+    private String amount;
+
+    private String contractType;
+
+    /**
+     * 项目名称
+     */
+    @Excel(name = "项目名称", width = 30, orderNum = "1")
+    @Query(tableColumn = "a.name")
+    private String name;
+
+    /**
+     * 项目编号
+     */
+    @Excel(name = "项目编号", width = 20, orderNum = "2")
+    @Query(tableColumn = "a.no")
+    private String no;
+
+    private String projectType;
+
+    /**
+     * 项目立项号
+     */
+    private String approvalNo;
+
+    private String company;
+
+    private String projectMould;
+
+    private String propertyHolder;
+
+    private String propertyHolderName;
+
+    private String location;
+
+    private String isFirst;
+
+    private String yearNum;
+
+    private String checkYear;
+
+    /**
+     * 项目经理(项目责任人)
+     */
+    private String projectManager;
+
+    @Excel(name = "项目经理", width = 20, orderNum = "4")
+    @Query(tableColumn = "c.name")
+    private String projectManagerName;
+
+    private String reportType;
+
+    private String industry;
+
+    private String enterpriseType;
+
+    private String riskLevel;
+
+    private String projectSource;
+
+    private BigDecimal estimate;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    private Date planEndTime;
+
+    private Integer useNum;
+
+    private Integer appointment;
+
+    private Double workHours;
+
+    private String remarks;
+
+    private String assessmentEnterprise;
+
+    private String assessmentEnterpriseName;
+
+    private String linkNum;
+
+    private String relationship;
+
+    private String assessmentWay;
+
+    private String assessmentObjective;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    private Date assessmentDate;
+
+    private BigDecimal num;
+
+    private String projectDevelopment;
+
+    private String delegateProjectType;
+
+    private String assessmentObject;
+
+    private String assessmentRange;
+
+    /**
+     * 是否生成报告号
+     */
+    private String generateReportNumber;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    private Date workBeginDate;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    private Date workEndDate;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    private Date reportingDate;
+
+    private String isHave;
+
+    private String isInfluence;
+
+    private String mode;
+
+    /**
+     * 状态
+     */
+    @Excel(name = "状态", width = 20, orderNum = "7")
+    @Query(tableColumn = "a.status")
+    private String status;
+
+    private String procInsId;
+
+    private String processDefinitionId;
+
+    /**
+     * 创建时间
+     */
+    @TableField(exist = false)
+    private String[] createDates;
+
+    /**
+     * 是否开票
+     */
+    @TableField(exist = false)
+    private String isInvoice;
+
+    /**
+     * 项目报告号
+     */
+    @TableField(exist = false)
+    private String reportNo;
+
+    /**
+     * 一级校审状态
+     */
+    @TableField(exist = false)
+    private String status1;
+
+    /**
+     * 二级校审状态
+     */
+    @TableField(exist = false)
+    private String status2;
+
+    /**
+     * 三级校审状态
+     */
+    @TableField(exist = false)
+    private String status3;
+
+    /**
+     * 报告签发状态
+     */
+    @TableField(exist = false)
+    private String issuedStatus;
+
+    /**
+     * 一级校审id
+     */
+    @TableField(exist = false)
+    private String auditId1;
+
+    /**
+     * 二级校审id
+     */
+    @TableField(exist = false)
+    private String auditId2;
+
+    /**
+     * 三级校审id
+     */
+    @TableField(exist = false)
+    private String auditId3;
+
+    /**
+     * 报告签发id
+     */
+    @TableField(exist = false)
+    private String issuedId;
+
+    /**
+     * 三级校审流程id
+     */
+    @TableField(exist = false)
+    private String procInsId1;
+
+    /**
+     * 三级校审流程id
+     */
+    @TableField(exist = false)
+    private String procInsId2;
+
+    /**
+     * 三级校审流程id
+     */
+    @TableField(exist = false)
+    private String procInsId3;
+
+    /**
+     * 项目归档流程id
+     */
+    @TableField(exist = false)
+    private String procInsIdArchive;
+
+    /**
+     * 项目归档id
+     */
+    @TableField(exist = false)
+    private String archiveId;
+
+    /**
+     * 项目归档状态
+     */
+    @TableField(exist = false)
+    private String archiveStatus;
+
+    /**
+     * 项目负责人id
+     */
+    @TableField(exist = false)
+    private String OfficeId;
+
+    /**
+     * 报告签发流程id
+     */
+    @TableField(exist = false)
+    private String procInsId4;
+
+    /**
+     * 审批通过时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date agreeTime;
+
+    /**
+     * 审批人
+     */
+    private String agreeUserId;
+
+    /**
+     * 合同编号
+     */
+    @TableField(exist = false)
+    private String contractNo;
+
+    /**
+     * 所属菜单   是评估项目登记   还是  评估2022项目登记
+     */
+    private String tabType;
+
+    /**
+     * 项目登记  taskId
+     */
+    @TableField(exist = false)
+    private String taskId;
+
+    /**
+     * 数据审核人  项目登记
+     */
+    @TableField(exist = false)
+    private List<String> auditUserIds;
+
+    /**
+     * 一级校审  taskId
+     */
+    @TableField(exist = false)
+    private String taskIdAudit1;
+
+    /**
+     * 二级校审  taskId
+     */
+    @TableField(exist = false)
+    private String taskIdAudit2;
+
+    /**
+     * 三级校审  taskId
+     */
+    @TableField(exist = false)
+    private String taskIdAudit3;
+
+    /**
+     * 数据审核人  一级校审
+     */
+    @TableField(exist = false)
+    private List<String> auditUserIds1;
+
+    /**
+     * 数据审核人  二级校审
+     */
+    @TableField(exist = false)
+    private List<String> auditUserIds2;
+
+    /**
+     * 数据审核人  三级校审
+     */
+    @TableField(exist = false)
+    private List<String> auditUserIds3;
+
+    /**
+     * 签发  taskId
+     */
+    @TableField(exist = false)
+    private String taskIdIssued;
+
+    /**
+     * 归档  taskId
+     */
+    @TableField(exist = false)
+    private String taskIdArchive;
+
+    /**
+     * 数据审核人  签发
+     */
+    @TableField(exist = false)
+    private List<String> auditUserIdsIssued;
+
+    /**
+     * 数据审核人  归档
+     */
+    @TableField(exist = false)
+    private List<String> auditUserIdsArchive;
+
+    /**
+     * 是否展示关联发票的开票状态   1展示   其他不展示
+     */
+    @TableField(exist = false)
+    private String showInvoiceFlag;
+
+}

+ 11 - 9
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/mapper/ZsReimbursementInfoMapper.java

@@ -1,16 +1,16 @@
 package com.jeeplus.centrecareful.approvalInfo.mapper;
 
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.jeeplus.finance.reimbursementApproval.approvalInfo.domain.ProgramProjectListInfo;
 import com.jeeplus.centrecareful.approvalInfo.domain.*;
 import com.jeeplus.centrecareful.approvalInfo.service.dto.ZsReportNoDto;
 import com.jeeplus.centrecareful.approvalInfo.service.dto.ZsRetureListDto;
 import com.jeeplus.centrecareful.approvalInfo.service.dto.ZsTreeUserDto;
-import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -21,13 +21,14 @@ import java.util.List;
  **/
 public interface ZsReimbursementInfoMapper extends BaseMapper<ZsReimbursementInfo> {
 
-    IPage<ProgramProjectListInfo> findProjectList(Page<ProgramProjectListInfo> page, @Param(Constants.WRAPPER) QueryWrapper<ProgramProjectListInfo> wrapper);
+    IPage<ZSProgramProjectListInfo> findProjectList(Page<ZSProgramProjectListInfo> page, @Param(Constants.WRAPPER) QueryWrapper<ZSProgramProjectListInfo> wrapper);
 
     String selectInvoiceFlag(@Param("id") String id);
-
+    @InterceptorIgnore(tenantLine = "true")
     IPage<ZsRetureListDto> findList (Page<ZsRetureListDto> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
 
-    List<WorkAttachmentDto> findFiles(@Param("id") String id);
+    @InterceptorIgnore(tenantLine = "true")
+    List<WorkAttachmentInfo> findFiles(@Param("id") String id);
 
     void updateStatusById(@Param("id") String id, @Param("type") String type);
 
@@ -40,14 +41,15 @@ public interface ZsReimbursementInfoMapper extends BaseMapper<ZsReimbursementInf
     IPage<ZsRetureListDto> relationReimbursementList (Page<ZsRetureListDto> page, @Param("id") String id);
 
     IPage<ZsReportNoDto> getReportNoList(Page<ZsReportNoDto> page, @Param(Constants.WRAPPER) QueryWrapper<ZsReportNoDto> queryWrapper);
-
+    @InterceptorIgnore(tenantLine = "true")
     List<ZsReimbursementDetailInfoContract> getContractDetailList(@Param("id") String id);
-
+    @InterceptorIgnore(tenantLine = "true")
     List<ZsReimbursementDetailInfoReport> getReportDetailList(@Param("id") String id);
 
+    @InterceptorIgnore(tenantLine = "true")
     List<ZsReimbursementDetailInfoOther> getOtherDetailList(@Param("id") String id);
-
+    @InterceptorIgnore(tenantLine = "true")
     List<ZsReimbursementDetailInfoProcured> getProcuredDetailList(@Param("id") String id);
-
+    @InterceptorIgnore(tenantLine = "true")
     List<ZsReimbursementDetailInfo> getDetailList(@Param("id") String id);
 }

+ 2 - 2
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/mapper/xml/ZsReimbursementInfoMapper.xml

@@ -170,7 +170,7 @@
 			${ew.customSqlSegment}
 		ORDER BY a.update_time DESC
     </select>
-	<select id="findFiles" resultType="com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto">
+	<select id="findFiles" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
 		SELECT
 			id,
 			url,
@@ -331,7 +331,7 @@
 		ORDER BY a.update_time DESC
 	</select>
     <select id="findProjectList"
-            resultType="com.jeeplus.finance.reimbursementApproval.approvalInfo.domain.ProgramProjectListInfo">
+            resultType="com.jeeplus.centrecareful.approvalInfo.domain.ZSProgramProjectListInfo">
 		SELECT
            a.id,
            b.name AS create_by_id,

+ 41 - 38
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/service/ZsReimbursementInfoService.java

@@ -1,36 +1,36 @@
 package com.jeeplus.centrecareful.approvalInfo.service;
 
 import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.jeeplus.finance.reimbursementApproval.approvalInfo.domain.ProgramProjectListInfo;
+import com.jeeplus.centrecareful.approvalType.service.ZsReimbursementTypeService;
+import com.jeeplus.common.TokenProvider;
 import com.jeeplus.centrecareful.approvalInfo.domain.*;
 import com.jeeplus.centrecareful.approvalInfo.mapper.*;
 import com.jeeplus.centrecareful.approvalInfo.service.dto.*;
 import com.jeeplus.core.query.QueryWrapperGenerator;
-import com.jeeplus.finance.contractRegistration.service.ContractInfoService;
-import com.jeeplus.finance.reimbursementApproval.approvalInfo.service.dto.QueryListDto;
-import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
-import com.jeeplus.pubmodules.oss.mapper.OssServiceMapper;
-import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
-import com.jeeplus.pubmodules.serialNumTpl.service.SerialnumTplService;
+//import com.jeeplus.finance.contractRegistration.service.ContractInfoService;
+//import com.jeeplus.finance.reimbursementApproval.approvalInfo.service.dto.QueryListDto;
 import com.jeeplus.sys.domain.Office;
-import com.jeeplus.sys.service.OfficeService;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import com.jeeplus.sys.feign.IDictApi;
+import com.jeeplus.sys.feign.IOfficeApi;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.feign.IWorkAttachmentApi;
+import com.jeeplus.sys.service.dto.OfficeDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
-import com.jeeplus.sys.utils.DictUtils;
-import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.utils.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
-import com.jeeplus.sys.utils.StringUtils;
 import com.baomidou.mybatisplus.*;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
+
+import java.util.*;
 
 /**
  * @author: 王强
@@ -60,20 +60,23 @@ public class ZsReimbursementInfoService {
     @Resource
     private ZsReimbursementAmountInfoMapper amountInfoMapper;
 
-    @Resource
-    private OssServiceMapper ossServiceMapper;
+//    @Resource
+//    private OssServiceMapper ossServiceMapper;
 
-    @Resource
-    private SerialnumTplService serialnumTplService;
+//    @Resource
+//    private SerialnumTplService serialnumTplService;
 
-    @Resource
-    private ContractInfoService infoService;
+//    @Resource
+//    private ContractInfoService infoService;
 
    /* @Resource
     private MaterialBasicMapper materialBasicMapper;*/
 
+//    @Resource
+//    private OfficeService officeService;
+
     @Resource
-    private OfficeService officeService;
+    private ZsReimbursementTypeService typeService;
 
     /**
      * 报告号查询
@@ -184,20 +187,20 @@ public class ZsReimbursementInfoService {
         return infoMapper.findList(page, queryWrapper);
     }
 
-    public IPage<ProgramProjectListInfo> projectList(Page<ProgramProjectListInfo> page, ProgramProjectListInfo info, String tabType) throws Exception{
+    public IPage<ZSProgramProjectListInfo> projectList(Page<ZSProgramProjectListInfo> page, ZSProgramProjectListInfo info, String tabType) throws Exception{
 
         //获取当前登录人信息
-        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
 
 
-        QueryWrapper<ProgramProjectListInfo> wrapper = QueryWrapperGenerator.buildQueryCondition(info, ProgramProjectListInfo.class);
+        QueryWrapper<ZSProgramProjectListInfo> wrapper = QueryWrapperGenerator.buildQueryCondition(info, ZSProgramProjectListInfo.class);
         wrapper.eq("a.del_flag", "0");
         wrapper.eq("a.tab_type", tabType);
         wrapper.eq("b.office_id", userDTO.getOfficeDTO().getId());
         if (info.getCreateDates() != null) {
             wrapper.between("a.create_date", info.getCreateDates()[0], info.getCreateDates()[1]);
         }
-        IPage<ProgramProjectListInfo> pageList = infoMapper.findProjectList(page, wrapper);
+        IPage<ZSProgramProjectListInfo> pageList = infoMapper.findProjectList(page, wrapper);
         pageList.getRecords().stream().forEach(item ->{
             String isInvoice = infoMapper.selectInvoiceFlag(item.getId());
             item.setIsInvoice(isInvoice);
@@ -207,7 +210,7 @@ public class ZsReimbursementInfoService {
 
     public String save(ZsSaveInfoDto dto) throws Exception{
         // 获取当前登录人信息
-      UserDTO userDTO = UserUtils.getCurrentUserDTO();
+      UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
         if (StringUtils.isNotEmpty(dto.getId())) {
             return update(dto, userDTO);
         } else {
@@ -219,7 +222,7 @@ public class ZsReimbursementInfoService {
         // 生成id
         String id = UUID.randomUUID().toString().replace("-", "");
         // 生成编号
-        String no = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ZsSaveInfoDto.BIZ_CODE);
+        String no = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), ZsSaveInfoDto.BIZ_CODE,TokenProvider.getCurrentToken());
         // 保存基础信息表信息
         ZsReimbursementInfo info = new ZsReimbursementInfo();
         BeanUtils.copyProperties(dto, info);
@@ -289,7 +292,7 @@ public class ZsReimbursementInfoService {
         }
         // 保存附件列表信息
         if (CollectionUtils.isNotEmpty(dto.getFiles())) {
-            infoService.saveFiles(dto.getFiles(), userDTO, id);
+            typeService.saveFiles(dto.getFiles(), userDTO, id);
         }
         return id;
     }
@@ -390,7 +393,7 @@ public class ZsReimbursementInfoService {
         }
         // 修改附件信息列表
         if (CollectionUtils.isNotEmpty(dto.getFiles())) {
-            infoService.updateFiles(dto.getFiles(), userDTO, dto.getId());
+            typeService.updateFiles(dto.getFiles(), userDTO, dto.getId());
         }
         return dto.getId();
     }
@@ -423,9 +426,9 @@ public class ZsReimbursementInfoService {
         amountInfoLambdaQueryWrapper.eq(ZsReimbursementAmountInfo::getInfoId, id);
         amountInfoMapper.delete(amountInfoLambdaQueryWrapper);
         // 删除附件信息
-        LambdaQueryWrapper<WorkAttachment> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(WorkAttachment::getAttachmentId, id);
-        ossServiceMapper.delete(wrapper);
+//        LambdaQueryWrapper<WorkAttachmentInfo> wrapper = new LambdaQueryWrapper<>();
+//        wrapper.eq(WorkAttachmentInfo::getAttachmentId, id);
+        SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(id);
         return "操作成功";
     }
 
@@ -436,7 +439,7 @@ public class ZsReimbursementInfoService {
         if (ObjectUtil.isNotEmpty(info)){
             BeanUtils.copyProperties(info, dto);
             if(StringUtils.isNotBlank(info.getDepartment())) {
-                Office byId = officeService.getById(info.getDepartment());
+                OfficeDTO byId = SpringUtil.getBean ( IOfficeApi.class ).getOfficeById(info.getDepartment());
                 if (ObjectUtil.isNotEmpty(byId)) {
                     dto.setDepartmentName(byId.getName());
                 }
@@ -463,10 +466,10 @@ public class ZsReimbursementInfoService {
             List<ZsReimbursementAmountInfo> amountInfos = amountInfoMapper.selectList(amountInfoLambdaQueryWrapper);
             dto.setAmountInfos(amountInfos);
             // 查询附件信息
-            List<WorkAttachmentDto> files = infoMapper.findFiles(id);
+            List<WorkAttachmentInfo> files = infoMapper.findFiles(id);
             if (CollectionUtils.isNotEmpty(files)) {
-                for (WorkAttachmentDto i : files) {
-                    i.setCreateBy(UserUtils.get(i.getBy()));
+                for (WorkAttachmentInfo i : files) {
+                    i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
                 }
             }
             dto.setFiles(files);
@@ -619,7 +622,7 @@ public class ZsReimbursementInfoService {
                         retureListDto.setContractName(retureListDto.getProjectName());
                         retureListDto.setProjectName("");
                     }
-                    retureListDto.setSourceType(DictUtils.getDictLabel(retureListDto.getSourceType(),"cw_reimbursement_source_type",""));
+                    retureListDto.setSourceType(SpringUtil.getBean ( IDictApi.class ).getDictLabel(retureListDto.getSourceType(),"cw_reimbursement_source_type",""));
                 }
             }
         }

+ 2 - 3
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/service/dto/ZsSaveInfoDto.java

@@ -2,9 +2,8 @@ package com.jeeplus.centrecareful.approvalInfo.service.dto;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.jeeplus.core.domain.BaseEntity;
-import com.jeeplus.finance.reimbursementApproval.approvalInfo.domain.*;
-import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
 import com.jeeplus.centrecareful.approvalInfo.domain.*;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -72,7 +71,7 @@ public class ZsSaveInfoDto extends BaseEntity {
 
     private List<ZsReimbursementAmountInfo> amountInfos;
 
-    private List<WorkAttachmentDto> files;
+    private List<WorkAttachmentInfo> files;
 
     /**
      * 报销类型

+ 323 - 0
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/util/ZSEasyPoiUtil.java

@@ -0,0 +1,323 @@
+package com.jeeplus.centrecareful.approvalInfo.util;
+
+import cn.afterturn.easypoi.excel.ExcelExportUtil;
+import cn.afterturn.easypoi.excel.ExcelImportUtil;
+import cn.afterturn.easypoi.excel.entity.ExportParams;
+import cn.afterturn.easypoi.excel.entity.ImportParams;
+import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+
+/**
+ * @Author Steel.D
+ * @Description easypoi导入导出通用工具类
+ * @Date 2019-7-31 9:29
+ * @Param
+ * @return
+ **/
+
+public class ZSEasyPoiUtil {
+
+    /**
+     * 功能描述:复杂导出Excel,包括文件名以及表名。创建表头
+     *
+     * @param list           导出的实体类
+     * @param title          表头名称
+     * @param sheetName      sheet表名
+     * @param pojoClass      映射的实体类
+     * @param isCreateHeader 是否创建表头
+     * @param fileName
+     * @param response
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 9:30
+     */
+
+    public static void exportExcel(List <?> list, String title, String sheetName, Class <?> pojoClass, String fileName, boolean isCreateHeader, HttpServletResponse response) {
+
+        ExportParams exportParams = new ExportParams ( title, sheetName );
+
+        exportParams.setCreateHeadRows ( isCreateHeader );
+
+        defaultExport ( list, pojoClass, fileName, response, exportParams );
+
+    }
+
+
+    /**
+     * 功能描述:复杂导出Excel,包括文件名以及表名,不创建表头
+     *
+     * @param list      导出的实体类
+     * @param title     表头名称
+     * @param sheetName sheet表名
+     * @param pojoClass 映射的实体类
+     * @param fileName  文件名
+     * @param response
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 9:35
+     */
+
+    public static void exportExcel(List <?> list, String title, String sheetName, Class <?> pojoClass, String fileName, HttpServletResponse response) {
+        ExportParams exportParams = new ExportParams(title, sheetName);
+        exportParams.setDictHandler(new ZSExcelDiceAddressListHandlerImpl());
+        defaultExport ( list, pojoClass, fileName, response, exportParams );
+
+    }
+
+
+    /**
+     * 功能描述:Map 集合导出
+     *
+     * @param list     实体集合
+     * @param fileName 导出的文件名称
+     * @param response
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 9:45
+     */
+
+    public static void exportExcel(List <Map <String, Object>> list, String fileName, HttpServletResponse response) {
+
+        defaultExport ( list, fileName, response );
+
+    }
+
+
+    /**
+     * 功能描述:默认导出方法
+     *
+     * @param list         导出的实体集合
+     * @param fileName     导出的文件名
+     * @param pojoClass    pojo实体
+     * @param exportParams ExportParams封装实体
+     * @param response
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 9:50
+     */
+
+    private static void defaultExport(List <?> list, Class <?> pojoClass, String fileName, HttpServletResponse response, ExportParams exportParams) {
+
+        Workbook workbook = ExcelExportUtil.exportExcel ( exportParams, pojoClass, list );
+
+        if ( workbook != null ) {
+
+            downLoadExcel ( fileName, response, workbook );
+
+        }
+
+    }
+
+    /**
+     * 功能描述:Excel导出
+     *
+     * @param fileName 文件名称
+     * @param response
+     * @param workbook Excel对象
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 10:35
+     */
+
+    private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) {
+
+        try {
+
+            response.setCharacterEncoding ( "UTF-8" );
+
+            response.setHeader ( "content-Type", "application/vnd.ms-excel" );
+
+            response.setHeader ( "Content-Disposition", "attachment;filename=" + URLEncoder.encode ( fileName, "UTF-8" ) );
+
+            workbook.write ( response.getOutputStream ( ) );
+
+        } catch (IOException e) {
+
+            throw new RuntimeException ( e );
+
+        }
+
+    }
+
+
+    /**
+     * 功能描述:默认导出方法
+     *
+     * @param list     导出的实体集合
+     * @param fileName 导出的文件名
+     * @param response
+     * @return
+     * @author SteeL.D
+     * @Date 2019-7-31 10:45
+     */
+
+    private static void defaultExport(List <Map <String, Object>> list, String fileName, HttpServletResponse response) {
+
+        Workbook workbook = ExcelExportUtil.exportExcel ( list, ExcelType.HSSF );
+
+        if ( workbook != null ) ;
+
+        downLoadExcel ( fileName, response, workbook );
+
+    }
+
+
+    /**
+     * 功能描述:根据文件路径来导入Excel
+     *
+     * @param filePath   文件路径
+     * @param titleRows  表标题的行数
+     * @param headerRows 表头行数
+     * @param pojoClass  Excel实体类
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 11:05
+     */
+
+    public static <T> List <T> importExcel(String filePath, Integer titleRows, Integer headerRows, Class <T> pojoClass) {
+
+        //判断文件是否存在
+
+        if ( StringUtils.isBlank ( filePath ) ) {
+
+            return null;
+
+        }
+
+        ImportParams params = new ImportParams ( );
+
+        params.setTitleRows ( titleRows );
+
+        params.setHeadRows ( headerRows );
+
+        List <T> list = null;
+
+        try {
+
+            list = ExcelImportUtil.importExcel ( new File ( filePath ), pojoClass, params );
+
+        } catch (NoSuchElementException e) {
+
+            throw new RuntimeException ( "模板不能为空" );
+
+        } catch (Exception e) {
+
+            e.printStackTrace ( );
+
+
+        }
+
+        return list;
+
+    }
+
+
+    /**
+     * 功能描述:根据接收的Excel文件来导入Excel,并封装成实体类
+     *
+     * @param file       上传的文件
+     * @param titleRows  表标题的行数
+     * @param headerRows 表头行数
+     * @param pojoClass  Excel实体类
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 11:30
+     */
+
+    public static <T> List <T> importExcel(MultipartFile file, Integer titleRows, Integer headerRows, Class <T> pojoClass) {
+
+        if ( file == null ) {
+
+            return null;
+
+        }
+
+        ImportParams params = new ImportParams ( );
+
+        params.setTitleRows ( titleRows );
+
+        params.setHeadRows ( headerRows );
+
+        List <T> list = null;
+
+        try {
+
+            list = ExcelImportUtil.importExcel ( file.getInputStream ( ), pojoClass, params );
+
+        } catch (NoSuchElementException e) {
+
+            throw new RuntimeException ( "excel文件不能为空" );
+
+        } catch (Exception e) {
+            e.printStackTrace ();
+            throw new RuntimeException ( e.getMessage ( ) );
+
+        }
+
+        return list;
+
+    }
+
+    /**
+     * 功能描述:根据接收的Excel文件来导入Excel,并封装成实体类
+     *
+     * @param file       上传的文件
+     * @param titleRows  表标题的行数
+     * @param headerRows 表头行数
+     * @param sheetNum   开始sheet页
+     * @param sheetNum   sheet页数
+     * @param pojoClass  Excel实体类
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 11:30
+     */
+    public static <T> List <T> importSheetExcel(MultipartFile file, Integer titleRows, Integer headerRows, Integer startSheetIndex, Integer sheetNum, Class <T> pojoClass) {
+
+        if ( file == null ) {
+
+            return null;
+
+        }
+
+        ImportParams params = new ImportParams ( );
+
+        params.setTitleRows ( titleRows );
+
+        params.setHeadRows ( headerRows );
+
+        params.setStartSheetIndex(startSheetIndex);
+
+        params.setSheetNum(sheetNum);
+
+        List <T> list = null;
+
+        try {
+
+            list = ExcelImportUtil.importExcel ( file.getInputStream ( ), pojoClass, params );
+
+        } catch (NoSuchElementException e) {
+
+            throw new RuntimeException ( "excel文件不能为空" );
+
+        } catch (Exception e) {
+            e.printStackTrace ();
+            throw new RuntimeException ( e.getMessage ( ) );
+
+        }
+
+        return list;
+
+    }
+
+
+}

+ 75 - 0
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/util/ZSExcelDiceAddressListHandlerImpl.java

@@ -0,0 +1,75 @@
+package com.jeeplus.centrecareful.approvalInfo.util;
+
+import cn.afterturn.easypoi.handler.inter.IExcelDictHandler;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.TypeReference;
+import com.jeeplus.sys.feign.IDictApi;
+import com.jeeplus.sys.service.dto.DictValueInfoDTO;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+//import com.jeeplus.sys.utils.DictUtils;
+//import com.jeeplus.sys.service.dto.DictValueDTO;
+//import com.jeeplus.sys.utils.DictUtils;
+
+/**
+ * 模拟使用,生产请用真实字典
+ *
+ */
+public class ZSExcelDiceAddressListHandlerImpl implements IExcelDictHandler {
+
+    /**
+     * 返回字典所有值
+     * key: dictKey
+     *
+     * @param dict 字典Key
+     * @return
+     */
+    @Override
+    public List<Map> getList(String dict) {
+        List<Map> list = new ArrayList<> ();
+//        Map<String, String> dictMap = new HashMap<>();
+//        dictMap.put("dictKey", "0");
+//        dictMap.put("dictValue", "严重瞌睡");
+//        list.add(dictMap);
+//        dictMap = new HashMap<>();
+//        dictMap.put("dictKey", "1");
+//        dictMap.put("dictValue", "小B");
+//        list.add(dictMap);
+//        dictMap = new HashMap<>();
+//        dictMap.put("dictKey", "1");
+//        dictMap.put("dictValue", "深度富有");
+//        list.add(dictMap);
+        String datas = SpringUtil.getBean ( IDictApi.class ).getDictMap (dict);
+        List<DictValueInfoDTO> dictValueDTOs = JSON.parseObject(datas, new TypeReference<List<DictValueInfoDTO>>() {});
+//        List<DictValueInfoDTO> dictValueDTOs = DictUtils.getDictMap ().get (dict);
+        dictValueDTOs.forEach (dictValueDTO -> {
+            Map<String, String> dictMap = new HashMap<> ();
+            dictMap.put ("dictKey", dictValueDTO.getValue ());
+            dictMap.put ("dictValue", dictValueDTO.getLabel ());
+            list.add (dictMap);
+        });
+        return list;
+    }
+
+    @Override
+    public String toName(String dict, Object obj, String name, Object value) {
+        if (ObjectUtil.isNotEmpty(value)) {
+            return SpringUtil.getBean ( IDictApi.class ).getDictLabel (value.toString (), dict, null);
+        }
+        return "";
+    }
+
+    @Override
+    public String toValue(String dict, Object obj, String name, Object value) {
+        if (ObjectUtil.isNotEmpty(value)) {
+            return SpringUtil.getBean ( IDictApi.class ).getDictLabel (value.toString (), dict, null);
+        }
+        return "";
+    }
+}

+ 6 - 0
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalType/mapper/ZsReimbursementTypeMapper.java

@@ -1,9 +1,11 @@
 package com.jeeplus.centrecareful.approvalType.mapper;
 
 
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.jeeplus.centrecareful.approvalType.domain.ZsReimbursementTypeInfo;
 import com.jeeplus.core.domain.TreeMapper;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -34,4 +36,8 @@ public interface ZsReimbursementTypeMapper extends BaseMapper<ZsReimbursementTyp
      * @return
      */
     List<ZsReimbursementTypeInfo> getAllList(String type);
+    @InterceptorIgnore(tenantLine = "true")
+    List<WorkAttachmentInfo> findList(@Param("id") String id);
+    @InterceptorIgnore(tenantLine = "true")
+    Integer findIsExit(@Param("id") String id, @Param("name")String name);
 }

+ 13 - 0
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalType/mapper/xml/ZsReimbursementTypeMapper.xml

@@ -36,4 +36,17 @@
 			resultType="com.jeeplus.centrecareful.approvalType.domain.ZsReimbursementTypeInfo">
 		select * from cw_reimbursement_type_info where del_flag = '0' order by sort asc
 	</select>
+    <select id="findList" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
+		SELECT * FROM work_attachment WHERE del_flag = 0 AND attachment_id = #{id}
+	</select>
+	<select id="findIsExit" resultType="java.lang.Integer">
+		SELECT
+			COUNT( 0 )
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+			AND attachment_name = #{name}
+	</select>
 </mapper>

+ 113 - 7
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalType/service/ZsReimbursementTypeService.java

@@ -1,17 +1,23 @@
 package com.jeeplus.centrecareful.approvalType.service;
 import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.jeeplus.centrecareful.approvalType.domain.ZsReimbursementTypeInfo;
 import com.jeeplus.centrecareful.approvalType.mapper.ZsReimbursementTypeMapper;
+import com.jeeplus.common.TokenProvider;
 import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.feign.IWorkAttachmentApi;
 import com.jeeplus.sys.service.dto.UserDTO;
-import com.jeeplus.sys.utils.StringUtils;
-import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.utils.StringUtils;
+import org.flowable.editor.language.json.converter.util.CollectionUtils;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
 import javax.annotation.Resource;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
+import java.util.*;
 
 /**
  * @author: 王强
@@ -95,7 +101,7 @@ public class ZsReimbursementTypeService {
             return "false";
         }
         // 获取当前登录人信息
-        UserDTO userDto = UserUtils.getCurrentUserDTO();
+        UserDTO userDto = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
         // 生成id值
         String id = UUID.randomUUID().toString().replace("-", "");
         info.setId(id);
@@ -117,7 +123,7 @@ public class ZsReimbursementTypeService {
      */
     public String update(ZsReimbursementTypeInfo info) {
         // 获取当前登录人信息
-        UserDTO userDto = UserUtils.getCurrentUserDTO();
+        UserDTO userDto = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
         info.setUpdateById(userDto.getId());
         info.setUpdateTime(new Date());
 
@@ -169,4 +175,104 @@ public class ZsReimbursementTypeService {
         }
         return info;
     }
+
+    /**
+     * 修改附件信息
+     * @param list 待修改的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void updateFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
+        int j = 1;
+        String names = new String();
+        //表中存在,但是传过来不存在,说明已删除,表中数据也要删除
+        for (WorkAttachmentInfo dto : list) {
+            names = names + "," +dto.getUrl();
+        }
+        //查询保存的附件信息
+        List<WorkAttachmentInfo> infoList = mapper.findList(id);
+        if (CollectionUtils.isNotEmpty(infoList)) {
+            for (WorkAttachmentInfo i : infoList) {
+                if (!names.contains(i.getUrl())) {
+//                    ossServiceMapper.deleteById(i.getId());
+                    SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (WorkAttachmentInfo dto : list) {
+            //判断是否存在
+            Integer isExit = mapper.findIsExit(id, dto.getName());
+            if (isExit == 0) {
+                WorkAttachmentInfo i = new WorkAttachmentInfo();
+                //包含了url、size、name
+                i.setId(UUID.randomUUID().toString().replace("-", ""));
+//                i.getCreateBy().setId(userDTO.getId());
+                i.setCreateTime(new Date());
+//                i.getUpdateBy().setId(userDTO.getId());
+                i.setUpdateTime(new Date());
+                i.setDelFlag(0);
+                i.setUrl(dto.getUrl());
+                //文件类型处理
+                List<String> strings = Arrays.asList(dto.getName().split("\\."));
+                if (CollectionUtils.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag("cwWorkContract");
+                i.setFileSize(dto.getSize());
+                i.setSort(j);
+                Map<String,String> map = new HashMap<>();
+                String workAttachment = JSON.toJSONString((i));
+                String userDTOInfo = JSON.toJSONString((userDTO));
+                map.put("workAttachment",workAttachment);
+                map.put("userDTO",userDTOInfo);
+                SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+//                ossServiceMapper.insertWorkAttachment(i, userDTO);
+                j++;
+            }
+        }
+    }
+
+    /**
+     * 保存附件信息
+     * @param list 待保存的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void saveFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
+        int j = 1;
+        for (WorkAttachmentInfo dto : list) {
+            WorkAttachmentInfo i = new WorkAttachmentInfo();
+            //包含了url、size、name
+            i.setId(UUID.randomUUID().toString().replace("-", ""));
+//            i.getCreateBy().setId(userDTO.getId());
+            i.setCreateTime(new Date());
+//            i.getUpdateBy().setId(userDTO.getId());
+            i.setUpdateTime(new Date());
+            i.setDelFlag(0);
+            i.setUrl(dto.getUrl());
+            //文件类型处理
+            List<String> strings = Arrays.asList(dto.getName().split("\\."));
+            if (CollectionUtils.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("cwWorkContract");
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+//            ossServiceMapper.insertWorkAttachment(i, userDTO);
+            Map<String,String> map = new HashMap<>();
+            String workAttachment = JSON.toJSONString((i));
+            String userDTOInfo = JSON.toJSONString((userDTO));
+            map.put("workAttachment",workAttachment);
+            map.put("userDTO",userDTOInfo);
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+            j++;
+        }
+    }
 }

+ 2 - 0
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/mapper/CwReimbursementTypeMapper.java

@@ -57,6 +57,7 @@ public interface CwReimbursementTypeMapper extends BaseMapper<CwReimbursementTyp
      * @param id
      * @return
      */
+    @InterceptorIgnore(tenantLine = "true")
     CwReimbursementTypeInfo getById(String id);
     /**
      * 根据name和parentId查询名称是否重复
@@ -76,6 +77,7 @@ public interface CwReimbursementTypeMapper extends BaseMapper<CwReimbursementTyp
      * 获取所有业务类型的数据
      * @return
      */
+    @InterceptorIgnore(tenantLine = "true")
     List<CwReimbursementTypeInfo> getAllList();
 
     /**

+ 1 - 1
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/service/CwReimbursementTypeService.java

@@ -194,7 +194,7 @@ public class CwReimbursementTypeService {
      */
     public CwReimbursementTypeInfo getById(String id) {
         CwReimbursementTypeInfo info = mapper.getById(id);
-        if(null != info.getOfficeDTOList() && info.getOfficeDTOList().size()>0){
+        if( null != info && null != info.getOfficeDTOList() && info.getOfficeDTOList().size()>0){
             List<String> officeIdList = Lists.newArrayList();
             for (OfficeDTO office : info.getOfficeDTOList()) {
                 officeIdList.add(office.getId());

+ 1 - 0
jeeplus-modules/pom.xml

@@ -25,6 +25,7 @@
         <module>jeeplus-finance</module>
         <module>jeeplus-assess</module>
         <module>jeeplus-public-modules</module>
+        <module>jeeplus-centrecareful</module>
     </modules>
 
 </project>