mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-02-13 09:04:59 +08:00
[feat] 新增外部合同的流程管理 新增外部合同历史管理
This commit is contained in:
parent
f12b055dfe
commit
ca81820971
@ -1,5 +1,9 @@
|
|||||||
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory;
|
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.util.file.FileUtils;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDetailDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontracthistory.ExtContractHistoryDetailDO;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -50,8 +54,13 @@ public class ExtContractHistoryController {
|
|||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('cms:ext-contract-history:query')")
|
@PreAuthorize("@ss.hasPermission('cms:ext-contract-history:query')")
|
||||||
public CommonResult<ExtContractHistoryRespVO> getExtContractHistory(@RequestParam("id") Long id) {
|
public CommonResult<ExtContractHistoryRespVO> getExtContractHistory(@RequestParam("id") Long id) {
|
||||||
ExtContractHistoryRespVO extContractHistory = extContractHistoryService.getExtContractHistory(id);
|
ExtContractHistoryDetailDO extContractHistoryDetail = extContractHistoryService.getContractDetail(id);
|
||||||
return success(extContractHistory);
|
ExtContractHistoryRespVO contractHistoryRespVO = new ExtContractHistoryRespVO();
|
||||||
|
org.springframework.beans.BeanUtils.copyProperties(extContractHistoryDetail, contractHistoryRespVO, "contractFileUrl", "reviewFileUrl");
|
||||||
|
contractHistoryRespVO.setReviewFileUrl(FileUtils.covertJSONStringToFile(extContractHistoryDetail.getReviewFileUrl()));
|
||||||
|
contractHistoryRespVO.setContractFileUrl(FileUtils.covertJSONStringToFile(extContractHistoryDetail.getContractFileUrl()));
|
||||||
|
|
||||||
|
return success(contractHistoryRespVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo;
|
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.FileDTO;
|
||||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||||
@ -9,6 +10,7 @@ import lombok.*;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 外部合同新增/修改 Request VO")
|
@Schema(description = "管理后台 - 外部合同新增/修改 Request VO")
|
||||||
@Data
|
@Data
|
||||||
@ -85,7 +87,7 @@ public class ExtContractHistorySaveReqVO {
|
|||||||
|
|
||||||
@Schema(description = "合同附件url", example = "https://www.iocoder.cn")
|
@Schema(description = "合同附件url", example = "https://www.iocoder.cn")
|
||||||
@ExcelProperty("合同附件url")
|
@ExcelProperty("合同附件url")
|
||||||
private String contractFileUrl;
|
private List<FileDTO> contractFileUrl;
|
||||||
|
|
||||||
@Schema(description = "建安费")
|
@Schema(description = "建安费")
|
||||||
@ExcelProperty("建安费")
|
@ExcelProperty("建安费")
|
||||||
@ -123,16 +125,12 @@ public class ExtContractHistorySaveReqVO {
|
|||||||
|
|
||||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||||
@ExcelProperty("审核文件url")
|
@ExcelProperty("审核文件url")
|
||||||
private String reviewFileUrl;
|
private List<FileDTO> reviewFileUrl;
|
||||||
|
|
||||||
@Schema(description = "最后编辑人")
|
@Schema(description = "最后编辑人")
|
||||||
@ExcelProperty("最后编辑人")
|
@ExcelProperty("最后编辑人")
|
||||||
private String finalEditor;
|
private String finalEditor;
|
||||||
|
|
||||||
@Schema(description = "流程实体id", example = "24870")
|
|
||||||
@ExcelProperty("流程实体id")
|
|
||||||
private String processInstanceId;
|
|
||||||
|
|
||||||
@Schema(description = "流程状态")
|
@Schema(description = "流程状态")
|
||||||
@ExcelProperty(value = "流程状态", converter = DictConvert.class)
|
@ExcelProperty(value = "流程状态", converter = DictConvert.class)
|
||||||
@DictFormat(DictTypeConstants.PROCESS_STATUS)
|
@DictFormat(DictTypeConstants.PROCESS_STATUS)
|
||||||
|
@ -0,0 +1,45 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.dal.dataobject.contractHistory;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wyw
|
||||||
|
* @description
|
||||||
|
* @date 2024/8/14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ContractHistoryDetailDO extends ContractHistoryDO {
|
||||||
|
/**
|
||||||
|
* 项目编号
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跟踪部门
|
||||||
|
*/
|
||||||
|
private String trackingDep;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出图公司
|
||||||
|
*/
|
||||||
|
private String drawingCompany;
|
||||||
|
/**
|
||||||
|
* 预计公司合同总金额
|
||||||
|
*/
|
||||||
|
private BigDecimal expectedContractAmount;
|
||||||
|
/**
|
||||||
|
* 项目负责人
|
||||||
|
*/
|
||||||
|
private String projectManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同商议提示
|
||||||
|
*/
|
||||||
|
private LocalDateTime reminderTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.dal.dataobject.extcontracthistory;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDO;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wyw
|
||||||
|
* @description
|
||||||
|
* @date 2024/8/14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ExtContractHistoryDetailDO extends ExtContractHistoryDO {
|
||||||
|
/**
|
||||||
|
* 项目编号
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 建设方
|
||||||
|
*/
|
||||||
|
private String constructionSide;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主控部门
|
||||||
|
*/
|
||||||
|
private String trackingDep;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目负责人
|
||||||
|
*/
|
||||||
|
private String projectManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部合同商议提示
|
||||||
|
*/
|
||||||
|
private LocalDateTime exReminderTime;
|
||||||
|
|
||||||
|
}
|
@ -62,4 +62,9 @@ public interface ExtContractService {
|
|||||||
String createProcess(Long loginUserId,Long id);
|
String createProcess(Long loginUserId,Long id);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断外部合同是否存在
|
||||||
|
* @param id 外部合同id
|
||||||
|
*/
|
||||||
|
void validateExtContractExists(Long id);
|
||||||
}
|
}
|
@ -191,7 +191,7 @@ public class ExtContractServiceImpl implements ExtContractService {
|
|||||||
return processInstanceId;
|
return processInstanceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateExtContractExists(Long id) {
|
public void validateExtContractExists(Long id) {
|
||||||
if (extContractMapper.selectById(id) == null) {
|
if (extContractMapper.selectById(id) == null) {
|
||||||
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.cms.service.extcontracthistory;
|
package cn.iocoder.yudao.module.cms.service.extcontracthistory;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontracthistory.ExtContractHistoryDetailDO;
|
||||||
import jakarta.validation.*;
|
import jakarta.validation.*;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo.*;
|
import cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo.*;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
@ -32,4 +33,12 @@ public interface ExtContractHistoryService {
|
|||||||
*/
|
*/
|
||||||
PageResult<ExtContractHistoryRespVO> getExtContractHistoryPage(ExtContractHistoryPageReqVO pageReqVO);
|
PageResult<ExtContractHistoryRespVO> getExtContractHistoryPage(ExtContractHistoryPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取外部合同历史基本信息
|
||||||
|
* @param id 外部合同历史id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ExtContractHistoryDetailDO getContractDetail(Long id);
|
||||||
|
|
||||||
}
|
}
|
@ -1,6 +1,15 @@
|
|||||||
package cn.iocoder.yudao.module.cms.service.extcontracthistory;
|
package cn.iocoder.yudao.module.cms.service.extcontracthistory;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDetailDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontracthistory.ExtContractHistoryDetailDO;
|
||||||
import cn.iocoder.yudao.module.cms.service.extContract.ExtContractService;
|
import cn.iocoder.yudao.module.cms.service.extContract.ExtContractService;
|
||||||
|
import cn.iocoder.yudao.module.pms.api.projectschedule.ProjectScheduleApi;
|
||||||
|
import cn.iocoder.yudao.module.pms.api.projectschedule.dto.ProjectScheduleDetailDTO;
|
||||||
|
import cn.iocoder.yudao.module.pms.api.projecttracking.ProjectTrackingApi;
|
||||||
|
import cn.iocoder.yudao.module.pms.api.projecttracking.dto.ProjectTrackingDetailDTO;
|
||||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@ -35,26 +44,22 @@ public class ExtContractHistoryServiceImpl implements ExtContractHistoryService
|
|||||||
@Resource
|
@Resource
|
||||||
private AdminUserApi adminUserApi;
|
private AdminUserApi adminUserApi;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ExtContractService extContractService;
|
private ExtContractService extContractService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectTrackingApi projectTrackingApi;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectScheduleApi projectScheduleApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateExtContractHistory(Long loginUserId,ExtContractHistorySaveReqVO updateReqVO) {
|
public void updateExtContractHistory(Long loginUserId,ExtContractHistorySaveReqVO updateReqVO) {
|
||||||
//校验
|
//校验
|
||||||
if (updateReqVO == null) {
|
|
||||||
throw exception(PARAM_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
|
|
||||||
validateExtContractHistoryExists(updateReqVO.getId());
|
validateExtContractHistoryExists(updateReqVO.getId());
|
||||||
|
extContractService.validateExtContractExists(updateReqVO.getExtContractId());
|
||||||
|
projectTrackingApi.validateProjectExists(updateReqVO.getProjectId());
|
||||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||||
if (userName == null) {
|
|
||||||
throw exception(USER_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
//校验customer_id contract_id extract_id
|
|
||||||
|
|
||||||
|
|
||||||
// 更新
|
// 更新
|
||||||
ExtContractHistoryDO updateObj = BeanUtils.toBean(updateReqVO, ExtContractHistoryDO.class);
|
ExtContractHistoryDO updateObj = BeanUtils.toBean(updateReqVO, ExtContractHistoryDO.class);
|
||||||
updateObj.setUpdater(userName);
|
updateObj.setUpdater(userName);
|
||||||
@ -82,25 +87,38 @@ public class ExtContractHistoryServiceImpl implements ExtContractHistoryService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<ExtContractHistoryRespVO> getExtContractHistoryPage(ExtContractHistoryPageReqVO pageReqVO) {
|
public PageResult<ExtContractHistoryRespVO> getExtContractHistoryPage(ExtContractHistoryPageReqVO pageReqVO) {
|
||||||
//校验
|
PageResult<ExtContractHistoryDO> extContractHistoryPage = extContractHistoryMapper.selectPage(pageReqVO);
|
||||||
if (pageReqVO == null) {
|
List<ExtContractHistoryDO> list = extContractHistoryPage.getList();
|
||||||
throw exception(PARAM_NOT_EXISTS);
|
List<ExtContractHistoryDetailDO> extContractDetailDOList = new ArrayList<>();
|
||||||
}
|
|
||||||
|
|
||||||
PageResult<ExtContractHistoryDO> extContractHistoryPageResult = extContractHistoryMapper.selectPage(pageReqVO);
|
for (ExtContractHistoryDO extContractHistoryDO : list) {
|
||||||
List<ExtContractHistoryDO> pageResultList = extContractHistoryPageResult.getList();
|
|
||||||
List<ExtContractHistoryRespVO> contractHistoryRespVOS = new ArrayList<>();
|
|
||||||
|
|
||||||
|
|
||||||
for (ExtContractHistoryDO extContractHistoryDO : pageResultList) {
|
|
||||||
Long id = extContractHistoryDO.getId();
|
Long id = extContractHistoryDO.getId();
|
||||||
ExtContractHistoryRespVO extContractHistory = getExtContractHistory(id);
|
ExtContractHistoryDetailDO contractDetail = getContractDetail(id);
|
||||||
contractHistoryRespVOS.add(extContractHistory);
|
extContractDetailDOList.add(contractDetail);
|
||||||
|
}
|
||||||
|
List<ExtContractHistoryRespVO> respVOS = BeanUtils.toBean(extContractDetailDOList, ExtContractHistoryRespVO.class);
|
||||||
|
PageResult<ExtContractHistoryRespVO> pageResult = new PageResult<>();
|
||||||
|
pageResult.setList(respVOS);
|
||||||
|
return pageResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
PageResult<ExtContractHistoryRespVO> pageResult = new PageResult<>();
|
@Override
|
||||||
pageResult.setList(contractHistoryRespVOS);
|
public ExtContractHistoryDetailDO getContractDetail(Long id) {
|
||||||
return pageResult;
|
ExtContractHistoryDetailDO extContractDetailDO = new ExtContractHistoryDetailDO();
|
||||||
|
ExtContractHistoryDO extContractHistory = extContractHistoryMapper.selectById(id);
|
||||||
|
//校验
|
||||||
|
if (extContractHistory == null) {
|
||||||
|
throw exception(EXT_CONTRACT_HISTORY_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
Long projectId = extContractHistory.getProjectId();
|
||||||
|
ProjectScheduleDetailDTO projectScheduleDetail = projectScheduleApi.getProjectScheduleDetail(projectId);
|
||||||
|
ProjectTrackingDetailDTO projectTracking = projectTrackingApi.getProjectTracking(projectId);
|
||||||
|
BeanUtil.copyProperties(extContractHistory, extContractDetailDO);
|
||||||
|
BeanUtil.copyProperties(projectTracking, extContractDetailDO);
|
||||||
|
BeanUtil.copyProperties(projectScheduleDetail, extContractDetailDO);
|
||||||
|
|
||||||
|
return extContractDetailDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user