Selaa lähdekoodia

合同取消流程和其他调整

user5 7 kuukautta sitten
vanhempi
commit
497e0121b3

+ 51 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/controller/JyReimbursementInfoController.java

@@ -2,12 +2,14 @@ package com.jeeplus.business.reimbursement.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.collect.Lists;
 import com.jeeplus.business.drive.service.dto.DriveApplyDTO;
 import com.jeeplus.business.finance.util.EasyPoiUtil;
 import com.jeeplus.business.project.domain.JyProject;
 import com.jeeplus.business.project.service.dto.JyProjectDTO;
 import com.jeeplus.business.reimbursement.domain.JyReimbursementInfo;
 import com.jeeplus.business.reimbursement.service.JyReimbursementInfoService;
+import com.jeeplus.business.reimbursement.service.dto.JyReimbursementDetailInfoProjectDTO;
 import com.jeeplus.business.reimbursement.service.dto.JyReimbursementInfoDTO;
 import com.jeeplus.common.excel.ExcelOptions;
 import com.jeeplus.common.excel.annotation.ExportMode;
@@ -156,6 +158,55 @@ public class JyReimbursementInfoController {
 
 
 
+    @ApiLog(value = "项目报销数据导出")
+    @GetMapping("exportReimbursementProjectFile")
+    @ApiOperation(value = "项目报销数据导出")
+    public void exportReimbursementProjectFile(JyReimbursementInfoDTO cwDTO, Page <JyReimbursementInfoDTO> page, ExcelOptions options, HttpServletResponse response) throws Exception {
+        String fileName = "项目报销数据表";
+        String sheetName = "项目报销列表";
+        List<JyReimbursementInfoDTO> result = new ArrayList<>();
+        if (com.jeeplus.common.excel.ExportMode.current.equals ( options.getMode() ) ) {
+            result = jyReimbursementInfoService.list (page,cwDTO).getRecords();
+        } else if (com.jeeplus.common.excel.ExportMode.selected.equals ( options.getMode() )) {
+            result = jyReimbursementInfoService.list (page,cwDTO).getRecords().stream ( ).filter ( item ->
+                    options.getSelectIds ( ).contains ( item.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize (-1);
+            page.setCurrent (0);
+            result = jyReimbursementInfoService.list (page,cwDTO).getRecords();
+        }
+        List<String> idList = Lists.newArrayList();
+        for (JyReimbursementInfoDTO listDto : result) {
+            idList.add(listDto.getId());
+        }
+        List<JyReimbursementDetailInfoProjectDTO> reimbursementProjectList = Lists.newArrayList();
+        if(idList.size()>0){
+            reimbursementProjectList = jyReimbursementInfoService.getReimbursementProjectList(idList);
+        }
+
+        EasyPoiUtil.exportExcel ( reimbursementProjectList, sheetName,  sheetName, JyReimbursementDetailInfoProjectDTO.class, fileName, response );
+
+    }
+
+
+    @ApiLog(value = "项目报销数据导出")
+    @GetMapping("exportReimbursementProjectFileById")
+    @ApiOperation(value = "项目报销数据导出")
+    public void exportReimbursementProjectFileById(String id, HttpServletResponse response) throws Exception {
+        String fileName = "项目报销数据表";
+        String sheetName = "项目报销列表";
+        List<String> idList = Lists.newArrayList();
+        idList.add(id);
+        List<JyReimbursementDetailInfoProjectDTO> reimbursementProjectList = Lists.newArrayList();
+        if(idList.size()>0){
+            reimbursementProjectList = jyReimbursementInfoService.getReimbursementProjectList(idList);
+        }
+
+        EasyPoiUtil.exportExcel ( reimbursementProjectList, sheetName,  sheetName, JyReimbursementDetailInfoProjectDTO.class, fileName, response );
+
+    }
+
 
 
 

+ 4 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/JyReimbursementInfoMapper.java

@@ -7,6 +7,7 @@ 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.business.reimbursement.domain.*;
+import com.jeeplus.business.reimbursement.service.dto.JyReimbursementDetailInfoProjectDTO;
 import com.jeeplus.business.reimbursement.service.dto.JyReimbursementInfoDTO;
 import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import org.apache.ibatis.annotations.Mapper;
@@ -41,4 +42,7 @@ public interface JyReimbursementInfoMapper extends BaseMapper<JyReimbursementInf
     List<JyReimbursementInfoDTO> queryByProjectId(@Param("projectId") String projectId);
 
     JyReimbursementInfoDTO getById(@Param("id") String s);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<JyReimbursementDetailInfoProjectDTO> getReimbursementProjectList(@Param("idList") List<String> idList);
 }

+ 36 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/mapper/xml/JyReimbursementInfoMapper.xml

@@ -434,5 +434,41 @@
 			where b2.id = #{id} and a.del_flag = '0'
 	</select>
 
+	<select id="getReimbursementProjectList" resultType="com.jeeplus.business.reimbursement.service.dto.JyReimbursementDetailInfoProjectDTO">
+		select
+		a.user_id,
+		su.name as "userName",
+		a.dept_id,
+		so.name as "deptName",
+		a.type_id,
+		jrti.name as "typeName",
+		a.project_id,
+		jpr.name as "projectName",
+		jpr.no as "projectNumber",
+		jri.no as "reimbursementNo",
+		wcei.name as "clientName",
+		a.number as "number",
+		a.receipt_number as "receiptNumber",
+		a.days,
+		a.content
+		from jy_reimbursement_detail_info_project a
+		left join jy_reimbursement_info jri on jri.id = a.info_id
+		left join sys_user su on su.id = a.user_id
+		left join sys_office so on so.id = a.dept_id
+		left join jy_project_record jpr on jpr.id = a.project_id
+		left join jy_reimbursement_type_info jrti on jrti.id = a.type_id
+		left join jy_work_contract_info jwci on jwci.id = jpr.contract_id
+		left join jy_work_client_info wcei on wcei.id = jwci.client_id
+		<where>
+			a.del_flag = 0
+			<if test="idList != null">
+				AND a.info_id IN
+				<foreach collection="idList" item="item" index="index" open="(" close=")" separator=",">
+					#{item}
+				</foreach>
+			</if>
+		</where>
+	</select>
+
 
 </mapper>

+ 38 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/service/JyReimbursementInfoService.java

@@ -18,6 +18,7 @@ import com.jeeplus.business.project.service.JyProjectService;
 import com.jeeplus.business.project.service.dto.JyProjectDTO;
 import com.jeeplus.business.reimbursement.domain.*;
 import com.jeeplus.business.reimbursement.mapper.*;
+import com.jeeplus.business.reimbursement.service.dto.JyReimbursementDetailInfoProjectDTO;
 import com.jeeplus.business.reimbursement.service.dto.JyReimbursementInfoDTO;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.core.query.QueryWrapperGenerator;
@@ -612,4 +613,41 @@ public class JyReimbursementInfoService {
         List<JyReimbursementInfoDTO> infoDTOList = list.stream().distinct().collect(Collectors.toList());
         return infoDTOList;
     }
+
+
+    public List<JyReimbursementDetailInfoProjectDTO> getReimbursementProjectList(List<String> idList) {
+        List<JyReimbursementDetailInfoProjectDTO> list = jyReimbursementInfoMapper.getReimbursementProjectList(idList);
+        list.stream().forEach(projectDetail -> {
+            String projectName = "";
+            String projectNumber = "";
+            if (StringUtils.isNotBlank(projectDetail.getProjectId())) {
+                List<JyProject> projectList = getProjectByIds(projectDetail.getProjectId());
+                if (CollectionUtil.isNotEmpty(projectList)) {
+                    projectName = projectList.stream().map(JyProject::getName).collect(Collectors.joining(","));
+                    projectNumber = projectList.stream().map(JyProject::getNo).collect(Collectors.joining(","));
+                }
+                projectDetail.setProjectName(projectName);
+                projectDetail.setProjectNumber(projectNumber);
+            } else {
+                projectDetail.setProjectName("");
+                projectDetail.setProjectNumber("");
+            }
+        });
+
+        return list;
+    }
+
+
+
+    /**
+     * 根据项目id查询项目名称
+     * @param ids 以逗号分隔的多个项目id字符串
+     * @return
+     */
+    public List<JyProject> getProjectByIds(String ids) {
+        String[] split = ids.split(",");
+        List<String> idList = Arrays.asList(split);
+        List<JyProject> list = jyProjectService.getListByIds(idList);
+        return list;
+    }
 }

+ 96 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/reimbursement/service/dto/JyReimbursementDetailInfoProjectDTO.java

@@ -0,0 +1,96 @@
+package com.jeeplus.business.reimbursement.service.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+public class JyReimbursementDetailInfoProjectDTO extends BaseEntity {
+    /**
+     * 报销编号
+     */
+    @Excel(name = "报销编号", width = 16, orderNum = "1")
+    private String reimbursementNo;
+    /**
+     * 项目编号
+     */
+    @Excel(name = "项目编号", width = 32, orderNum = "2")
+    private String projectNumber;
+    /**
+     * 项目名称
+     */
+    @Excel(name = "项目名称", width = 32, orderNum = "3")
+    private String projectName;
+    /**
+     * 报销项目id
+     */
+    private String projectId;
+
+    /**
+     * 建设单位
+     */
+    @Excel(name = "建设单位", width = 16, orderNum = "5")
+    private String clientName;
+    /**
+     * 报销id
+     */
+    private String reimbursementId;
+
+    /**
+     * 报销人
+     */
+    private String userId;
+
+    /**
+     * 报销人名称
+     */
+    @Excel(name = "报销人", width = 16, orderNum = "6")
+    private String userName;
+
+    /**
+     * 报销部门
+     */
+    private String deptId;
+
+    /**
+     * 报销部门名称
+     */
+    @Excel(name = "报销部门", width = 16, orderNum = "7")
+    private String deptName;
+
+    /**
+     * 报销类型
+     */
+    private String typeId;
+
+    /**
+     * 报销类型名称
+     */
+    @Excel(name = "报销类型", width = 16, orderNum = "8")
+    private String typeName;
+
+    /**
+     * 费用(元)
+     */
+    @Excel(name = "报销费用(元)", width = 16, orderNum = "9")
+    private String number;
+
+    /**
+     * 收据张数
+     */
+    @Excel(name = "收据张数", width = 16, orderNum = "10")
+    private Integer receiptNumber;
+
+    /**
+     * 出差天数
+     */
+    @Excel(name = "出差天数", width = 16, orderNum = "11")
+    private Integer days;
+
+    /**
+     * 内容
+     */
+    @Excel(name = "内容", width = 16, orderNum = "12")
+    private String content;
+}

+ 36 - 34
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workContractInfo/service/JyWorkContractService.java

@@ -154,24 +154,24 @@ public class JyWorkContractService {
         StringBuffer sb = new StringBuffer();
         if (CollectionUtil.isNotEmpty(contractTypes)){
             for (List<String> contractType : contractTypes) {
-//                if (contractType.size()>0){
-//                    switch (contractType.get(0)){
-//                        case "1": //环境监测
-//                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE4,TokenProvider.getCurrentToken());
-//                            break;
-//                        case "2": //环境影响评价
-//                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE3,TokenProvider.getCurrentToken());
-//                            break;
-//                        case "3": //水土保持
-//                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE2,TokenProvider.getCurrentToken());
-//                            break;
-//                        case "4": //其他
-//                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE1,TokenProvider.getCurrentToken());
-//                            break;
-//                        default:
-//                            return null;
-//                    }
-//                }
+                if (contractType.size()>0){
+                    switch (contractType.get(0)){
+                        case "1": //环境监测
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE4,TokenProvider.getCurrentToken());
+                            break;
+                        case "2": //环境影响评价
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE3,TokenProvider.getCurrentToken());
+                            break;
+                        case "3": //水土保持
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE2,TokenProvider.getCurrentToken());
+                            break;
+                        case "4": //其他
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE1,TokenProvider.getCurrentToken());
+                            break;
+                        default:
+                            return null;
+                    }
+                }
                 //判断合同类型是否有二级
                 if (contractType.size()>1){
                     sb.append(contractType.get(1)+",");
@@ -192,6 +192,7 @@ public class JyWorkContractService {
         info.setCreateTime(new Date());
         info.setUpdateById(userDTO.getId());
         info.setUpdateTime(new Date());
+        info.setStatus("5");
         info.setPrimaryLinkman(workContractInfoDto.getPrimaryLinkman()); //主委托人
         info.setContractAmount(workContractInfoDto.getContractAmount()); //金额
         info.setPaymentDescribe(workContractInfoDto.getPaymentDescribe()); //付款摘要
@@ -245,6 +246,7 @@ public class JyWorkContractService {
 //        info.setNo(serialNum);
         info.setUpdateById(userDTO.getId());
         info.setUpdateTime(new Date());
+        info.setStatus("5");
         if (StringUtils.isBlank(workContractInfoDto.getContractNo())){
             //合同编号生成
             List<List<String>> contractTypes = new ArrayList<>();
@@ -254,22 +256,22 @@ public class JyWorkContractService {
             StringBuffer sb = new StringBuffer();
             for (List<String> contractType : contractTypes) {
                 if (contractType.size()>0){
-//                    switch (contractType.get(0)){
-//                        case "1": //环境监测
-//                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE4,TokenProvider.getCurrentToken());
-//                            break;
-//                        case "2": //环境影响评价
-//                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE3,TokenProvider.getCurrentToken());
-//                            break;
-//                        case "3": //水土保持
-//                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE2,TokenProvider.getCurrentToken());
-//                            break;
-//                        case "4": //其他
-//                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE1,TokenProvider.getCurrentToken());
-//                            break;
-//                        default:
-//                            return null;
-//                    }
+                    switch (contractType.get(0)){
+                        case "1": //环境监测
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE4,TokenProvider.getCurrentToken());
+                            break;
+                        case "2": //环境影响评价
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE3,TokenProvider.getCurrentToken());
+                            break;
+                        case "3": //水土保持
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE2,TokenProvider.getCurrentToken());
+                            break;
+                        case "4": //其他
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE1,TokenProvider.getCurrentToken());
+                            break;
+                        default:
+                            return null;
+                    }
                 }
                 //判断合同类型是否有二级
                 if (contractType.size()>1){

+ 14 - 0
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/reimApprovalType/controller/CwReimbursementTypeController.java

@@ -150,4 +150,18 @@ public class CwReimbursementTypeController {
         return ResponseEntity.ok(infos);
     }
 
+
+    /**
+     * 根据报销类型查询判定项目是否单选还是多选
+     * @param typeId
+     * @return
+     */
+    @ApiOperation(value = "根据报销类型查询判定项目是否单选还是多选")
+    @GetMapping("/findReimbursementTypeSingleSelectById")
+    public ResponseEntity<CwReimbursementTypeInfo> findReimbursementTypeSingleSelectById(@RequestParam String typeId){
+        CwReimbursementTypeInfo s = service.findReimbursementTypeSingleSelectById(typeId);
+        return ResponseEntity.ok(s);
+    }
+
+
 }

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

@@ -92,4 +92,6 @@ public interface CwReimbursementTypeMapper extends BaseMapper<CwReimbursementTyp
      * @param OfficeIdList
      */
     void saveReimbursementTypeOfficeInfo(@Param("id") String id , @Param("officeIdList") List<String> OfficeIdList);
+
+    CwReimbursementTypeInfo findReimbursementTypeSingleSelectById(String id);
 }

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

@@ -279,4 +279,16 @@
 			insert into cw_reimbursement_type_office_info(reimbursement_type_id,office_id) values(#{id},#{officeId})
 		</foreach>
 	</insert>
+
+
+
+
+	<select id="findReimbursementTypeSingleSelectById" resultType="com.jeeplus.pubmodules.reimApprovalType.domain.CwReimbursementTypeInfo">
+		select
+		<include refid="Base_Column_List"></include>
+		from cw_reimbursement_type_info a
+		<where>
+			a.del_flag = 0 and a.id = (select parent_id from cw_reimbursement_type_info where id = #{id})
+		</where>
+	</select>
 </mapper>

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

@@ -356,4 +356,17 @@ public class CwReimbursementTypeService {
         }
         return info;
     }
+
+
+
+    /**
+     * 根据报销类型查询判定项目是否单选还是多选
+     * @param typeId
+     * @return
+     */
+    public CwReimbursementTypeInfo findReimbursementTypeSingleSelectById(String typeId) {
+        //根据id查询父节点信息
+        CwReimbursementTypeInfo reimbursementTypeSingleSelectById = mapper.findReimbursementTypeSingleSelectById(typeId);
+        return reimbursementTypeSingleSelectById;
+    }
 }