mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-22 06:01:53 +08:00
Compare commits
47 Commits
feature-co
...
feature-pm
Author | SHA1 | Date | |
---|---|---|---|
![]() |
92070e3c57 | ||
![]() |
1df906c0db | ||
![]() |
cb6816d4b7 | ||
![]() |
f2cfb723a9 | ||
![]() |
d9c2bc5ce6 | ||
![]() |
e166428f5e | ||
![]() |
1d079654b3 | ||
![]() |
8e41517755 | ||
![]() |
51ec3731a1 | ||
![]() |
d3513e0cfb | ||
![]() |
684d20bedb | ||
![]() |
579a647566 | ||
![]() |
fff41eda04 | ||
![]() |
4c72939f29 | ||
![]() |
e0ebf5c67e | ||
![]() |
194383276a | ||
![]() |
791ec26468 | ||
![]() |
6d4885c051 | ||
![]() |
2e9937cad2 | ||
![]() |
e0c60dd15b | ||
![]() |
83e39a0197 | ||
![]() |
365d3de0dd | ||
![]() |
6ca5de888f | ||
![]() |
bff455be96 | ||
![]() |
ad63ca24c0 | ||
![]() |
44c6558602 | ||
![]() |
7446e57a48 | ||
![]() |
982f817f4c | ||
![]() |
d6725f3040 | ||
![]() |
8ebbf12016 | ||
![]() |
504f7f7615 | ||
![]() |
a224d73203 | ||
![]() |
698906fb08 | ||
![]() |
027a5d1e1c | ||
![]() |
0a52eddbc6 | ||
![]() |
787f153bf1 | ||
![]() |
3114d32995 | ||
![]() |
ca58994bd6 | ||
![]() |
73d09ffea0 | ||
![]() |
871ddf4aab | ||
![]() |
47adca8394 | ||
![]() |
171c0cc018 | ||
![]() |
9d82236a89 | ||
![]() |
dafc8cb432 | ||
![]() |
05b6707709 | ||
![]() |
b0ff4a7666 | ||
![]() |
99a33c9c41 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -50,4 +50,5 @@ rebel.xml
|
||||
|
||||
application-my.yaml
|
||||
|
||||
application-local.yaml
|
||||
/yudao-ui-app/unpackage/
|
||||
|
55
sql/cms/codegen-cms-exthistory-sql.sql
Normal file
55
sql/cms/codegen-cms-exthistory-sql.sql
Normal file
@@ -0,0 +1,55 @@
|
||||
-- 菜单 SQL
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status, component_name
|
||||
)
|
||||
VALUES (
|
||||
'外部合同管理', '', 2, 0, 2758,
|
||||
'ext-contract-history', '', 'cms/extcontracthistory/index', 0, 'ExtContractHistory'
|
||||
);
|
||||
|
||||
-- 按钮父菜单ID
|
||||
-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外部合同查询', 'cms:ext-contract-history:query', 3, 1, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外部合同创建', 'cms:ext-contract-history:create', 3, 2, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外部合同更新', 'cms:ext-contract-history:update', 3, 3, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外部合同删除', 'cms:ext-contract-history:delete', 3, 4, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外部合同导出', 'cms:ext-contract-history:export', 3, 5, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
@@ -2,8 +2,12 @@ package cn.iocoder.yudao.module.bpm.api.task;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceRespDTO;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmTaskRespDTO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程实例 Api 接口
|
||||
*
|
||||
@@ -20,4 +24,20 @@ public interface BpmProcessInstanceApi {
|
||||
*/
|
||||
String createProcessInstance(Long userId, @Valid BpmProcessInstanceCreateReqDTO reqDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 查询流程
|
||||
*
|
||||
* @param id 流程id
|
||||
* @return
|
||||
*/
|
||||
BpmProcessInstanceRespDTO getProcessInstance(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询指定流程的任务
|
||||
* @param id 流程id
|
||||
* @return
|
||||
*/
|
||||
List<BpmTaskRespDTO> getTask(String id);
|
||||
}
|
||||
|
@@ -0,0 +1,115 @@
|
||||
package cn.iocoder.yudao.module.bpm.api.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程定义
|
||||
*/
|
||||
@Data
|
||||
public class BpmProcessDefinitionRespDTO {
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 流程标识
|
||||
*/
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* 流程图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 流程描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 流程分类
|
||||
*/
|
||||
private String category;
|
||||
/**
|
||||
* 流程分类名字
|
||||
*/
|
||||
private String categoryName;
|
||||
|
||||
/**
|
||||
* 表单类型
|
||||
*/
|
||||
private Integer formType;
|
||||
|
||||
/**
|
||||
* 表单编号
|
||||
*/
|
||||
private Long formId;
|
||||
|
||||
/**
|
||||
* 表单名字
|
||||
*/
|
||||
private String formName;
|
||||
/**
|
||||
* 表单的配置
|
||||
*/
|
||||
private String formConf;
|
||||
|
||||
/**
|
||||
* 表单项的数组
|
||||
*/
|
||||
private List<String> formFields;
|
||||
|
||||
/**
|
||||
* 自定义表单的提交路径
|
||||
*/
|
||||
private String formCustomCreatePath;
|
||||
|
||||
/**
|
||||
* 自定义表单的查看路径
|
||||
*/
|
||||
private String formCustomViewPath;
|
||||
|
||||
/**
|
||||
* 中断状态-参见 SuspensionState 枚举
|
||||
*/
|
||||
private Integer suspensionState; // 参见 SuspensionState 枚举
|
||||
|
||||
/**
|
||||
* 部署时间
|
||||
*/
|
||||
private LocalDateTime deploymentTime; // 需要从对应的 Deployment 读取,非必须返回
|
||||
|
||||
/**
|
||||
* BPMN XML
|
||||
*/
|
||||
private String bpmnXml; // 需要从对应的 BpmnModel 读取,非必须返回
|
||||
|
||||
/**
|
||||
* 发起用户需要选择审批人的任务数组
|
||||
*/
|
||||
private List<UserTask> startUserSelectTasks; // 需要从对应的 BpmnModel 读取,非必须返回
|
||||
|
||||
@Data
|
||||
public static class UserTask {
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -19,6 +19,7 @@ public class BpmProcessInstanceCreateReqDTO {
|
||||
*/
|
||||
@NotEmpty(message = "流程定义的标识不能为空")
|
||||
private String processDefinitionKey;
|
||||
|
||||
/**
|
||||
* 变量实例(动态表单)
|
||||
*/
|
||||
|
@@ -0,0 +1,118 @@
|
||||
package cn.iocoder.yudao.module.bpm.api.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程实例的获得 Resp DTO
|
||||
*/
|
||||
@Data
|
||||
public class BpmProcessInstanceRespDTO {
|
||||
|
||||
/**
|
||||
* 流程实例编号
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 流程实例名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 流程分类
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 流程分类名称
|
||||
*/
|
||||
private String categoryName;
|
||||
|
||||
/**
|
||||
* 流程实例状态
|
||||
*/
|
||||
private Integer status; // 参见 BpmProcessInstanceStatusEnum 枚举
|
||||
|
||||
/**
|
||||
* 发起时间
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 持续时间
|
||||
*/
|
||||
private Long durationInMillis;
|
||||
|
||||
/**
|
||||
* 发起流程的用户
|
||||
*/
|
||||
private User startUser;
|
||||
|
||||
/**
|
||||
* 流程定义编号
|
||||
*/
|
||||
|
||||
private String processDefinitionId;
|
||||
/**
|
||||
* 流程定义
|
||||
*/
|
||||
private BpmProcessDefinitionRespDTO processDefinition;
|
||||
|
||||
|
||||
/**
|
||||
* 当前审批中的任务
|
||||
*/
|
||||
private List<Task> tasks; // 仅在流程实例分页才返回
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*/
|
||||
@Data
|
||||
public static class User {
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 部门编号
|
||||
*/
|
||||
private Long deptId;
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程任务
|
||||
*/
|
||||
@Data
|
||||
public static class Task {
|
||||
|
||||
/**
|
||||
* 流程任务编号
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,144 @@
|
||||
package cn.iocoder.yudao.module.bpm.api.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 指定流程实例的任务
|
||||
*/
|
||||
@Data
|
||||
public class BpmTaskRespDTO {
|
||||
|
||||
/**
|
||||
* 任务编号
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 任务名字
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
|
||||
|
||||
/**
|
||||
* 持续时间
|
||||
*/
|
||||
private Long durationInMillis;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*/
|
||||
private Integer status; // 参见 BpmTaskStatusEnum 枚举
|
||||
|
||||
/**
|
||||
* 审批理由
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 负责人的用户信息
|
||||
*/
|
||||
private BpmProcessInstanceRespDTO.User ownerUser;
|
||||
/**
|
||||
* 审核的用户信息
|
||||
*/
|
||||
private BpmProcessInstanceRespDTO.User assigneeUser;
|
||||
|
||||
/**
|
||||
* 任务定义的标识
|
||||
*/
|
||||
private String taskDefinitionKey;
|
||||
|
||||
/**
|
||||
* 所属流程实例编号
|
||||
*/
|
||||
private String processInstanceId;
|
||||
/**
|
||||
* 所属流程实例
|
||||
*/
|
||||
private ProcessInstance processInstance;
|
||||
|
||||
/**
|
||||
* 父任务编号
|
||||
*/
|
||||
private String parentTaskId;
|
||||
|
||||
/**
|
||||
* 子任务列表(由加签生成)
|
||||
*/
|
||||
private List<BpmTaskRespDTO> children;
|
||||
|
||||
/**
|
||||
* 表单编号
|
||||
*/
|
||||
private Long formId;
|
||||
|
||||
/**
|
||||
* 表单名字
|
||||
*/
|
||||
private String formName;
|
||||
|
||||
/**
|
||||
* 表单的配置-JSON 字符串
|
||||
*/
|
||||
private String formConf;
|
||||
|
||||
/**
|
||||
* 表单项的数组
|
||||
*/
|
||||
private List<String> formFields;
|
||||
|
||||
/**
|
||||
* 提交的表单值
|
||||
*/
|
||||
private Map<String, Object> formVariables;
|
||||
|
||||
|
||||
/**
|
||||
* 流程实例
|
||||
*/
|
||||
@Data
|
||||
public static class ProcessInstance {
|
||||
|
||||
/**
|
||||
* 流程实例编号
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 流程实例名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 提交时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 流程定义的编号
|
||||
*/
|
||||
private String processDefinitionId;
|
||||
|
||||
/**
|
||||
* 发起人的用户信息
|
||||
*/
|
||||
private BpmProcessInstanceRespDTO.User startUser;
|
||||
|
||||
}
|
||||
}
|
@@ -1,13 +1,42 @@
|
||||
package cn.iocoder.yudao.module.bpm.api.task;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceRespDTO;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmTaskRespDTO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.convert.task.BpmProcessInstanceConvert;
|
||||
import cn.iocoder.yudao.module.bpm.convert.task.BpmTaskConvert;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO;
|
||||
import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils;
|
||||
import cn.iocoder.yudao.module.bpm.service.definition.BpmFormService;
|
||||
import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import org.flowable.engine.history.HistoricProcessInstance;
|
||||
import org.flowable.engine.repository.ProcessDefinition;
|
||||
import org.flowable.task.api.history.HistoricTaskInstance;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Stream;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSetByFlatMap;
|
||||
|
||||
/**
|
||||
* Flowable 流程实例 Api 实现类
|
||||
*
|
||||
@@ -21,8 +50,80 @@ public class BpmProcessInstanceApiImpl implements BpmProcessInstanceApi {
|
||||
@Resource
|
||||
private BpmProcessInstanceService processInstanceService;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@Resource
|
||||
private BpmProcessDefinitionService processDefinitionService;
|
||||
|
||||
@Resource
|
||||
private BpmTaskService taskService;
|
||||
|
||||
@Resource
|
||||
private BpmFormService formService;
|
||||
|
||||
@Override
|
||||
public String createProcessInstance(Long userId, @Valid BpmProcessInstanceCreateReqDTO reqDTO) {
|
||||
return processInstanceService.createProcessInstance(userId, reqDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BpmProcessInstanceRespDTO getProcessInstance(String id) {
|
||||
|
||||
HistoricProcessInstance processInstance = processInstanceService.getHistoricProcessInstance(id);
|
||||
if (processInstance == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 拼接返回
|
||||
ProcessDefinition processDefinition = processDefinitionService.getProcessDefinition(
|
||||
processInstance.getProcessDefinitionId());
|
||||
BpmProcessDefinitionInfoDO processDefinitionInfo = processDefinitionService.getProcessDefinitionInfo(
|
||||
processInstance.getProcessDefinitionId());
|
||||
|
||||
String bpmnXml = BpmnModelUtils.getBpmnXml(
|
||||
processDefinitionService.getProcessDefinitionBpmnModel(processInstance.getProcessDefinitionId()));
|
||||
|
||||
AdminUserRespDTO startUser = adminUserApi.getUser(NumberUtils.parseLong(processInstance.getStartUserId()));
|
||||
DeptRespDTO dept = null;
|
||||
if (startUser != null) {
|
||||
dept = deptApi.getDept(startUser.getDeptId());
|
||||
}
|
||||
BpmProcessInstanceRespVO bpmProcessInstanceRespVO = BpmProcessInstanceConvert.INSTANCE.buildProcessInstance(processInstance,
|
||||
processDefinition, processDefinitionInfo, bpmnXml, startUser, dept);
|
||||
|
||||
return BeanUtils.toBean(bpmProcessInstanceRespVO, BpmProcessInstanceRespDTO.class);
|
||||
|
||||
}
|
||||
|
||||
//List<BpmTaskRespVO>
|
||||
@Override
|
||||
public List<BpmTaskRespDTO> getTask(String id) {
|
||||
List<HistoricTaskInstance> taskList = taskService.getTaskListByProcessInstanceId(id);
|
||||
if (CollUtil.isEmpty(taskList)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 拼接数据
|
||||
HistoricProcessInstance processInstance = processInstanceService.getHistoricProcessInstance(id);
|
||||
// 获得 User 和 Dept Map
|
||||
Set<Long> userIds = convertSetByFlatMap(taskList, task ->
|
||||
Stream.of(NumberUtils.parseLong(task.getAssignee()), NumberUtils.parseLong(task.getOwner())));
|
||||
userIds.add(NumberUtils.parseLong(processInstance.getStartUserId()));
|
||||
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(userIds);
|
||||
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(
|
||||
convertSet(userMap.values(), AdminUserRespDTO::getDeptId));
|
||||
// 获得 Form Map
|
||||
Map<Long, BpmFormDO> formMap = formService.getFormMap(
|
||||
convertSet(taskList, task -> NumberUtils.parseLong(task.getFormKey())));
|
||||
List<BpmTaskRespVO> bpmTaskRespVOS = BpmTaskConvert.INSTANCE.buildTaskListByProcessInstanceId(taskList, processInstance,
|
||||
formMap, userMap, deptMap);
|
||||
return BeanUtils.toBean(bpmTaskRespVOS, BpmTaskRespDTO.class);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -20,6 +20,7 @@ public class BpmProcessInstanceRespVO {
|
||||
|
||||
@Schema(description = "流程分类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "流程分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "请假")
|
||||
private String categoryName;
|
||||
|
||||
|
@@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.cms.api.contract;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.api.contract.dto.ContractDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.cms.api.contract.dto.ContractRespDTO;
|
||||
|
||||
public interface ContractApi {
|
||||
|
||||
/**
|
||||
* 获得合同部分信息
|
||||
*/
|
||||
ContractRespDTO getContract(Long id);
|
||||
|
||||
/**
|
||||
* 获得合同detail信息
|
||||
*/
|
||||
ContractDetailRespDTO getContractDetailById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 判断合同是否存在
|
||||
*/
|
||||
void vaildContractExist(Long id);
|
||||
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.cms.api.contract.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ContractDetailRespDTO {
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 合同进展
|
||||
*/
|
||||
private String progress;
|
||||
/**
|
||||
* 合同状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 签订合同总额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 审定金额
|
||||
*/
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.cms.api.contract.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ContractRespDTO {
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 合同进展
|
||||
*/
|
||||
private String progress;
|
||||
/**
|
||||
* 合同状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 签订合同总额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 审定金额
|
||||
*/
|
||||
private BigDecimal approvedAmount;
|
||||
/**
|
||||
* 计费方式
|
||||
*/
|
||||
private String countType;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.cms.api.outscontract;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.api.contract.dto.ContractRespDTO;
|
||||
import cn.iocoder.yudao.module.cms.api.outscontract.dto.OutscontractRespDTO;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
public interface OutscontractApi {
|
||||
|
||||
OutscontractRespDTO getOutsContract(Long id);
|
||||
|
||||
BigDecimal getOutsContractAmount(Long contractId);
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.cms.api.outscontract.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class OutscontractRespDTO {
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 主合同id
|
||||
*/
|
||||
private Long contractId;
|
||||
/**
|
||||
* 外包合同金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.cms.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author wyw
|
||||
* @description 收费标注枚举
|
||||
* @date 2024/7/31
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ChargingStandardEnum {
|
||||
//厦建设
|
||||
XIA_BUILDING("0","xia_building"),
|
||||
//包干价
|
||||
LUMP("1","lump"),
|
||||
//其他省份
|
||||
OTHER("2","other");
|
||||
|
||||
/**
|
||||
* 类型编号
|
||||
*/
|
||||
private final String code;
|
||||
/**
|
||||
* 类型编码
|
||||
*/
|
||||
private final String no;
|
||||
|
||||
/**
|
||||
* 通过code获取no
|
||||
* @param code 字典编号
|
||||
* @return 类型编码
|
||||
*/
|
||||
public static String getNoByCode(String code) {
|
||||
for (ChargingStandardEnum value : values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value.getNo();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.cms.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author wyw
|
||||
* @description 合同状态枚举
|
||||
* @date 2024/7/31
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ContractStatusEnum {
|
||||
//应签未签
|
||||
NO_SIGN("0","no_sign"),
|
||||
//已拟定
|
||||
PREPARED("1","prepared"),
|
||||
//已盖章
|
||||
STAMP("2","stamp"),
|
||||
//已签订
|
||||
SIGN("3","sign"),
|
||||
//已终止
|
||||
TERMINATION("4","termination"),;
|
||||
|
||||
/**
|
||||
* 类型编号
|
||||
*/
|
||||
private final String code;
|
||||
/**
|
||||
* 类型编码
|
||||
*/
|
||||
private final String no;
|
||||
|
||||
/**
|
||||
* 通过code获取no
|
||||
* @param code 字典编号
|
||||
* @return 类型编码
|
||||
*/
|
||||
public static String getNoByCode(String code) {
|
||||
for (ContractStatusEnum value : values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value.getNo();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,46 @@
|
||||
package cn.iocoder.yudao.module.cms.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author wyw
|
||||
* @description 合同类型枚举
|
||||
* @date 2024/7/31
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ContractTypeEnum {
|
||||
//勘察设计
|
||||
SURVEY("0","survey"),
|
||||
//检测
|
||||
DETECTION("1","detection"),
|
||||
//总承包合同
|
||||
GENERAL_CONTRACT("2","general_contract"),
|
||||
//全过程咨询
|
||||
PROCESS_CONSULTATION("3","process_consultation");
|
||||
|
||||
|
||||
/**
|
||||
* 类型编号
|
||||
*/
|
||||
private final String code;
|
||||
/**
|
||||
* 类型编码
|
||||
*/
|
||||
private final String no;
|
||||
|
||||
/**
|
||||
* 通过code获取no
|
||||
* @param code 字典编号
|
||||
* @return 类型编码
|
||||
*/
|
||||
public static String getNoByCode(String code) {
|
||||
for (ContractTypeEnum value : values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value.getNo();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.cms.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author wyw
|
||||
* @description 计费方式枚举
|
||||
* @date 2024/7/31
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CountTypeEnum {
|
||||
//费率合同
|
||||
RATE_CONTRACT("0","rate_contract"),
|
||||
//包干合同
|
||||
RES_CONTRACT("1","res_contract");
|
||||
/**
|
||||
* 类型编号
|
||||
*/
|
||||
private final String code;
|
||||
/**
|
||||
* 类型编码
|
||||
*/
|
||||
private final String no;
|
||||
|
||||
/**
|
||||
* 通过code获取no
|
||||
* @param code 字典编号
|
||||
* @return 类型编码
|
||||
*/
|
||||
public static String getNoByCode(String code) {
|
||||
for (CountTypeEnum value : values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value.getNo();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.cms.enums;
|
||||
|
||||
/**
|
||||
* @author hhyykk
|
||||
* @description 字典枚举
|
||||
* @date 2024/7/3
|
||||
*/
|
||||
public interface DictTypeConstants {
|
||||
|
||||
// ***** 字典名称 ******
|
||||
String CONTRACT_TYPE = "contract_type"; // 合同类型
|
||||
String CONTRACT_STATUS = "contract_status"; // 合同类型
|
||||
String COUNT_TYPE = "count_type";
|
||||
String SOURCE = "source";
|
||||
String PROCESS_STATUS = "process_status";
|
||||
String CHARGING_STANDARD = "charging_standard";
|
||||
String OUTS_CONTRACT_MAJOR = "outs_contract_major";
|
||||
}
|
@@ -8,19 +8,14 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
* @date 2024/7/3
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
ErrorCode CUSTOMER_COMPANY_NOT_EXISTS = new ErrorCode(1_020_000_000, "客户公司管理不存在");
|
||||
// ========== 客户公司 1_020_000_000 ==========
|
||||
ErrorCode CUSTOMER_COMPANY_NOT_EXISTS = new ErrorCode(1_020_000_000, "客户公司不存在");
|
||||
// ========== 项目信息 1_021_000_000 ==========
|
||||
ErrorCode PROJECT_NOT_EXISTS = new ErrorCode(1_021_000_000, "项目信息不存在");
|
||||
// ========== 请求参数 1_022_000_000 ==========
|
||||
ErrorCode PARAM_NOT_EXISTS = new ErrorCode(1_022_000_000, "请求参数不存在");
|
||||
|
||||
ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(2_024_000_000, "合同不存在");
|
||||
|
||||
ErrorCode CONTRACT_HISTORY_NOT_EXISTS = new ErrorCode(2_025_000_000, "历史合同不存在");
|
||||
|
||||
|
||||
ErrorCode EXT_CONTRACT_NOT_EXISTS = new ErrorCode(2_026_000_000, "外部合同不存在");
|
||||
|
||||
|
||||
ErrorCode EXT_CONTRACT_HISTORY_NOT_EXISTS = new ErrorCode(2_027_000_000, "历史外部合同不存在");
|
||||
|
||||
ErrorCode CONTRACT_EXT_NOT_EXISTS = new ErrorCode(2_028_000_000, "外部合同关联不存在");
|
||||
ErrorCode PARAM_ERROR = new ErrorCode(1_022_001_000, "请求参数错误");
|
||||
|
||||
// ========== 外包合同 2_021_000_000 ==========
|
||||
ErrorCode OUTS_CONTRACT_NOT_EXISTS = new ErrorCode(2_021_000_000, "外包合同不存在");
|
||||
@@ -31,5 +26,28 @@ public interface ErrorCodeConstants {
|
||||
// ========== 外包合同关联 2_023_000_000 ==========
|
||||
ErrorCode CONTRACT_OUTS_NOT_EXISTS = new ErrorCode(2_023_000_000, "外包合同关联不存在");
|
||||
|
||||
ErrorCode CONTRACT_OUTS_ALREADY_EXISTS = new ErrorCode(2_023_001_000, "外包合同关联已经存在");
|
||||
|
||||
// ========== 合同信息 2_024_000_000 ==========
|
||||
ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(2_024_000_000, "合同不存在");
|
||||
|
||||
|
||||
ErrorCode CONTRACT_NAME_NOT_EXISTS = new ErrorCode(2_024_001_000, "合同名称不存在");
|
||||
|
||||
ErrorCode CONTRACT_ALREADY_EXISTS = new ErrorCode(2_024_002_000, "该合同已经创建");
|
||||
|
||||
|
||||
// ========== 历史合同信息 2_025_000_000 ==========
|
||||
ErrorCode CONTRACT_HISTORY_NOT_EXISTS = new ErrorCode(2_025_000_000, "历史合同不存在");
|
||||
|
||||
// ========== 外部合同信息 2_026_000_000 ==========
|
||||
ErrorCode EXT_CONTRACT_NOT_EXISTS = new ErrorCode(2_026_000_000, "外部合同不存在");
|
||||
|
||||
// ========== 历史外部合同信息 2_027_000_000 ==========
|
||||
ErrorCode EXT_CONTRACT_HISTORY_NOT_EXISTS = new ErrorCode(2_027_000_000, "历史外部合同不存在");
|
||||
|
||||
// ========== 外部合同关联 2_028_000_000 ==========
|
||||
ErrorCode CONTRACT_EXT_NOT_EXISTS = new ErrorCode(2_028_000_000, "外部合同关联不存在");
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.cms.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author wyw
|
||||
* @description 外包合同专业枚举
|
||||
* @date 2024/7/31
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OutsContractMajorEnum {
|
||||
//地勘
|
||||
GROUND_SERVICE("0","ground_service"),
|
||||
//景观
|
||||
SCENERY("1","scenery"),
|
||||
//建筑
|
||||
ARCHITECTURE("2","architecture"),
|
||||
//测量
|
||||
MEASURE("3","measure"),
|
||||
//效果图
|
||||
EFFECT_PICTURE("4","effect_picture");
|
||||
|
||||
/**
|
||||
* 类型编号
|
||||
*/
|
||||
private final String code;
|
||||
/**
|
||||
* 类型编码
|
||||
*/
|
||||
private final String no;
|
||||
|
||||
/**
|
||||
* 通过code获取no
|
||||
* @param code 字典编号
|
||||
* @return 类型编码
|
||||
*/
|
||||
public static String getNoByCode(String code) {
|
||||
for (OutsContractMajorEnum value : values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value.getNo();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.cms.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author wyw
|
||||
* @description 收费标注枚举
|
||||
* @date 2024/7/31
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ProcessStatusEnum {
|
||||
//未执行
|
||||
NO_EXECUTION("0","no_execution"),
|
||||
//正在执行
|
||||
EXECUTING("1","executing"),
|
||||
//执行完成
|
||||
COMPLETED("2","completed");
|
||||
|
||||
/**
|
||||
* 类型编号
|
||||
*/
|
||||
private final String code;
|
||||
/**
|
||||
* 类型编码
|
||||
*/
|
||||
private final String no;
|
||||
|
||||
/**
|
||||
* 通过code获取no
|
||||
* @param code 字典编号
|
||||
* @return 类型编码
|
||||
*/
|
||||
public static String getNoByCode(String code) {
|
||||
for (ProcessStatusEnum value : values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value.getNo();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.cms.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author wyw
|
||||
* @description 资金来源枚举
|
||||
* @date 2024/7/31
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SourceEnum {
|
||||
//市财政
|
||||
MUNICIPAL_FINANCE("0","municipal_finance"),
|
||||
//区财政
|
||||
DISTRICT_FINANCE("1","district_finance"),
|
||||
//业主自筹
|
||||
OWNER_FINANCE("2","owner_finance");
|
||||
/**
|
||||
* 类型编号
|
||||
*/
|
||||
private final String code;
|
||||
/**
|
||||
* 类型编码
|
||||
*/
|
||||
private final String no;
|
||||
|
||||
/**
|
||||
* 通过code获取no
|
||||
* @param code 字典编号
|
||||
* @return 类型编码
|
||||
*/
|
||||
public static String getNoByCode(String code) {
|
||||
for (SourceEnum value : values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value.getNo();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -35,6 +35,7 @@
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
|
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.cms.api.contract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.cms.api.contract.dto.ContractDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.cms.api.contract.dto.ContractRespDTO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.CONTRACT_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstants.PROJECT_NOT_EXISTS;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class ContractImpl implements ContractApi{
|
||||
|
||||
@Resource
|
||||
private ContractMapper contractMapper;
|
||||
|
||||
@Override
|
||||
public ContractRespDTO getContract(Long id) {
|
||||
ContractDO contractDO = contractMapper.selectById(id);
|
||||
ContractRespDTO contractRespDTO = BeanUtils.toBean(contractDO, ContractRespDTO.class);
|
||||
return contractRespDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractDetailRespDTO getContractDetailById(Long id) {
|
||||
// 优化
|
||||
ContractDO contractRespDTO1 = contractMapper.selectById(id);
|
||||
ContractDetailRespDTO contractDetailRespDTO = BeanUtils.toBean(contractRespDTO1, ContractDetailRespDTO.class);
|
||||
return contractDetailRespDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void vaildContractExist(Long id) {
|
||||
if (contractMapper.selectById(id)==null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.cms.api.outscontract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.cms.api.outscontract.dto.OutscontractRespDTO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.outscontract.OutsContractMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class OutscontractImpl implements OutscontractApi{
|
||||
|
||||
@Resource
|
||||
private OutsContractMapper outsContractMapper;
|
||||
|
||||
@Override
|
||||
public OutscontractRespDTO getOutsContract(Long id) {
|
||||
OutsContractDO outsContractDO = outsContractMapper.selectById(id);
|
||||
OutscontractRespDTO outscontractRespDTO = BeanUtils.toBean(outsContractDO, OutscontractRespDTO.class);
|
||||
return outscontractRespDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getOutsContractAmount(Long contractId) {
|
||||
List<OutsContractDO> contractIds = outsContractMapper.selectList("contract_id", contractId);
|
||||
BigDecimal res = new BigDecimal(0);
|
||||
for (OutsContractDO contract:contractIds){
|
||||
res = res.add(contract.getAmount());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
@@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractProcessInstanceRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractSaveReqVO;
|
||||
@@ -14,15 +15,21 @@ import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Tag(name = "管理后台 - 合同管理")
|
||||
@RestController
|
||||
@@ -33,18 +40,20 @@ public class ContractController {
|
||||
@Resource
|
||||
private ContractService contractService;
|
||||
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:create')")
|
||||
public CommonResult<Long> createContract(@Valid @RequestBody ContractSaveReqVO createReqVO) {
|
||||
return success(contractService.createContract(createReqVO));
|
||||
return success(contractService.createContract(getLoginUserId(), createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:update')")
|
||||
public CommonResult<Boolean> updateContract(@Valid @RequestBody ContractSaveReqVO updateReqVO) {
|
||||
contractService.updateContract(updateReqVO);
|
||||
contractService.updateContract(getLoginUserId(), updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@@ -79,12 +88,30 @@ public class ContractController {
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportContractExcel(@Valid ContractPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ContractRespVO> list = contractService.getContractPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "合同.xls", "数据", ContractRespVO.class,
|
||||
BeanUtils.toBean(list, ContractRespVO.class));
|
||||
BeanUtils.toBean(list, ContractRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/get_process")
|
||||
@Operation(summary = "查询流程")
|
||||
@Parameter(name = "id", description = "合同id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:process')")
|
||||
public CommonResult<ContractProcessInstanceRespVO> getContractProcess(@RequestParam("id") Long id) {
|
||||
ContractProcessInstanceRespVO contractProcessInstance = contractService.getContractProcess(id);
|
||||
return success(contractProcessInstance);
|
||||
}
|
||||
|
||||
@GetMapping("/get_HistoryProcess")
|
||||
@Operation(summary = "查询历史合同流程")
|
||||
@Parameter(name = "projectId", description = "项目id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:process')")
|
||||
public CommonResult<List<ContractProcessInstanceRespVO>> getHisContractProcess(@RequestParam("projectId") Long projectId) {
|
||||
List<ContractProcessInstanceRespVO> historyContractProcess = contractService.getHistoryContractProcess(projectId);
|
||||
return success(historyContractProcess);
|
||||
}
|
||||
|
||||
}
|
@@ -1,14 +1,10 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 合同分页 Request VO")
|
||||
@Data
|
||||
@@ -24,83 +20,17 @@ public class ContractPageReqVO extends PageParam {
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", example = "2")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展")
|
||||
@Schema(description = "合同进展",example = "1")
|
||||
private String progress;
|
||||
|
||||
@Schema(description = "合同拟定时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] expectedTime;
|
||||
|
||||
@Schema(description = "合同用印时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] printingTime;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] signingTime;
|
||||
|
||||
@Schema(description = "归档时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] archiveTime;
|
||||
|
||||
@Schema(description = "合同状态", example = "1")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
|
||||
private String status;
|
||||
|
||||
@Schema(description = "计费方式", example = "1")
|
||||
@DictFormat(DictTypeConstants.COUNT_TYPE)
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "合同url", example = "https://www.iocoder.cn")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "建安费")
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "优惠", example = "17910")
|
||||
private String discount;
|
||||
|
||||
@Schema(description = "是否联合体")
|
||||
private Boolean consortium;
|
||||
|
||||
@Schema(description = "联合体单位")
|
||||
private String consortiumCompany;
|
||||
|
||||
@Schema(description = "占主合同比例")
|
||||
private String extProportion;
|
||||
|
||||
@Schema(description = "审定金额")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||
private String reviewFileUrl;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "前期费")
|
||||
private BigDecimal preAmount;
|
||||
|
||||
@Schema(description = "设计费")
|
||||
private BigDecimal designAmount;
|
||||
|
||||
@Schema(description = "勘测费")
|
||||
private BigDecimal surveyFees;
|
||||
|
||||
@Schema(description = "测量费")
|
||||
private BigDecimal measurementFee;
|
||||
|
||||
@Schema(description = "其他费")
|
||||
private BigDecimal otherFee;
|
||||
|
||||
}
|
@@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
@Schema(description = "管理后台 - 流程实例的 Response VO")
|
||||
@Data
|
||||
public class ContractProcessInstanceRespVO {
|
||||
|
||||
@Schema(description = "流程实例的编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String id;
|
||||
|
||||
@Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String name;
|
||||
|
||||
@Schema(description = "流程实例的状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer status; // 参见 BpmProcessInstanceStatusEnum 枚举
|
||||
|
||||
@Schema(description = "发起时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Schema(description = "持续时间", example = "1000")
|
||||
private Long durationInMillis;
|
||||
|
||||
|
||||
/**
|
||||
* 发起流程的用户
|
||||
*/
|
||||
private User startUser;
|
||||
|
||||
/**
|
||||
* 当前审批中的任务
|
||||
*/
|
||||
private List<Task> tasks; // 仅在流程实例分页才返回
|
||||
|
||||
@Schema(description = "用户信息")
|
||||
@Data
|
||||
public static class User {
|
||||
|
||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long deptId;
|
||||
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "研发部")
|
||||
private String deptName;
|
||||
|
||||
}
|
||||
|
||||
@Schema(description = "流程任务")
|
||||
@Data
|
||||
public static class Task {
|
||||
|
||||
@Schema(description = "流程任务的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,5 +1,8 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@@ -11,6 +14,7 @@ import com.alibaba.excel.annotation.*;
|
||||
@Schema(description = "管理后台 - 合同 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@EqualsAndHashCode
|
||||
public class ContractRespVO {
|
||||
|
||||
|
||||
@@ -49,6 +53,7 @@ public class ContractRespVO {
|
||||
|
||||
@Schema(description = "合同类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("合同类型")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@@ -73,12 +78,15 @@ public class ContractRespVO {
|
||||
|
||||
@Schema(description = "合同状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("合同状态")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
|
||||
private String status;
|
||||
|
||||
@Schema(description = "计费方式", example = "1")
|
||||
@ExcelProperty("计费方式")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String countType;
|
||||
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
@@ -93,6 +101,7 @@ public class ContractRespVO {
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
@ExcelProperty("资金来源")
|
||||
@DictFormat(DictTypeConstants.SOURCE)
|
||||
private String source;
|
||||
|
||||
@Schema(description = "优惠", example = "17910")
|
||||
@@ -119,10 +128,6 @@ public class ContractRespVO {
|
||||
@ExcelProperty("审核文件url")
|
||||
private String reviewFileUrl;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
@ExcelProperty("签订合同总额")
|
||||
private BigDecimal amount;
|
||||
|
@@ -1,4 +1,7 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
@@ -7,20 +10,52 @@ import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 合同新增/修改 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode
|
||||
public class ContractSaveReqVO {
|
||||
|
||||
@Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||
@ExcelProperty("项目编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||
@ExcelProperty("主控部门")
|
||||
private String trackingDep;
|
||||
|
||||
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目经理")
|
||||
private String projectManager;
|
||||
|
||||
@Schema(description = "分包合同提示时间")
|
||||
@ExcelProperty("分包合同提示时间")
|
||||
private LocalDateTime reminderTime;
|
||||
|
||||
@Schema(description = "暂定结算数")
|
||||
@ExcelProperty("暂定结算数")
|
||||
private BigDecimal provisionalSettlement;
|
||||
|
||||
@Schema(description = "出图公司", requiredMode = Schema.RequiredMode.REQUIRED,example = "***设计院")
|
||||
@ExcelProperty("出图公司")
|
||||
private String drawingCompany;
|
||||
|
||||
@Schema(description = "预计合同金额", requiredMode = Schema.RequiredMode.REQUIRED,example = "200.0000")
|
||||
@ExcelProperty("预计合同金额")
|
||||
private BigDecimal expectedContractAmount;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "合同名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "合同类型不能为空")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@@ -43,9 +78,11 @@ public class ContractSaveReqVO {
|
||||
|
||||
@Schema(description = "合同状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "合同状态不能为空")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
|
||||
private String status;
|
||||
|
||||
@Schema(description = "计费方式", example = "1")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@@ -58,6 +95,7 @@ public class ContractSaveReqVO {
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
@DictFormat(DictTypeConstants.SOURCE)
|
||||
private String source;
|
||||
|
||||
@Schema(description = "优惠", example = "17910")
|
||||
@@ -97,24 +135,4 @@ public class ContractSaveReqVO {
|
||||
@Schema(description = "其他费")
|
||||
private BigDecimal otherFee;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "创建时间不能为空")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "更新时间不能为空")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12587")
|
||||
@NotNull(message = "租户编号不能为空")
|
||||
private Long tenantId;
|
||||
|
||||
|
||||
|
||||
}
|
@@ -1,7 +1,4 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contractHistory;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractHistory.ContractHistoryDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
|
||||
import cn.iocoder.yudao.module.cms.service.contractHistory.ContractHistoryService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -14,7 +11,6 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
@@ -28,6 +24,7 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo.*;
|
||||
|
||||
@@ -40,33 +37,12 @@ public class ContractHistoryController {
|
||||
@Resource
|
||||
private ContractHistoryService contractHistoryService;
|
||||
|
||||
@Resource
|
||||
private ContractMapper contractMapper;
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建历史合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-history:create')")
|
||||
public CommonResult<Long> createContractHistory(@Valid @RequestBody ContractHistorySaveReqVO createReqVO) {
|
||||
return success(contractHistoryService.createContractHistory(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新历史合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-history:update')")
|
||||
public CommonResult<Boolean> updateContractHistory(@Valid @RequestBody ContractHistorySaveReqVO updateReqVO) {
|
||||
contractHistoryService.updateContractHistory(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除历史合同")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-history:delete')")
|
||||
public CommonResult<Boolean> deleteContractHistory(@RequestParam("id") Long id) {
|
||||
contractHistoryService.deleteContractHistory(id);
|
||||
contractHistoryService.updateContractHistory(getLoginUserId(),updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@@ -74,17 +50,17 @@ public class ContractHistoryController {
|
||||
@Operation(summary = "获得历史合同")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-history:query')")
|
||||
public CommonResult<ContractHistoryDO> getContractHistory(@RequestParam("id") Long id) {
|
||||
ContractHistoryDO contractHistory = contractHistoryService.getContractHistory(id);
|
||||
return success(BeanUtils.toBean(contractHistory, ContractHistoryDO.class));
|
||||
public CommonResult<ContractHistoryRespVO> getContractHistory(@RequestParam("id") Long id) {
|
||||
ContractHistoryRespVO contractHistory = contractHistoryService.getContractHistory(id);
|
||||
return success(contractHistory);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得历史合同分页")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-history:query')")
|
||||
public CommonResult<PageResult<ContractHistoryRespVO>> getContractHistoryPage(@Valid ContractHistoryPageReqVO pageReqVO) {
|
||||
PageResult<ContractHistoryDO> pageResult = contractHistoryService.getContractHistoryPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ContractHistoryRespVO.class));
|
||||
PageResult<ContractHistoryRespVO> pageResult = contractHistoryService.getContractHistoryPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@@ -94,10 +70,9 @@ public class ContractHistoryController {
|
||||
public void exportContractHistoryExcel(@Valid ContractHistoryPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ContractHistoryDO> list = contractHistoryService.getContractHistoryPage(pageReqVO).getList();
|
||||
List<ContractHistoryRespVO> list = contractHistoryService.getContractHistoryPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "历史合同.xls", "数据", ContractHistoryRespVO.class,
|
||||
BeanUtils.toBean(list, ContractHistoryRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@@ -1,20 +1,22 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 历史合同分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ContractHistoryPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "合同编号")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "流程实体id", example = "12536")
|
||||
private String processInstanceId;
|
||||
|
||||
@@ -22,108 +24,22 @@ public class ContractHistoryPageReqVO extends PageParam {
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", example = "2")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展")
|
||||
private String progress;
|
||||
|
||||
@Schema(description = "合同拟定时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] expectedTime;
|
||||
|
||||
@Schema(description = "合同用印时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] printingTime;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] signingTime;
|
||||
|
||||
@Schema(description = "归档时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] archiveTime;
|
||||
|
||||
@Schema(description = "合同状态", example = "1")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
|
||||
private String status;
|
||||
|
||||
@Schema(description = "计费方式", example = "2")
|
||||
@Schema(description = "计费方式")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "合同url", example = "https://www.iocoder.cn")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "建安费")
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "优惠", example = "18154")
|
||||
private String discount;
|
||||
|
||||
@Schema(description = "是否联合体")
|
||||
private Boolean consortium;
|
||||
|
||||
@Schema(description = "联合体单位")
|
||||
private String consortiumCompany;
|
||||
|
||||
@Schema(description = "占主合同比例")
|
||||
private String extProportion;
|
||||
|
||||
@Schema(description = "审定金额")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||
private String reviewFileUrl;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] updateTime;
|
||||
|
||||
@Schema(description = "是否删除")
|
||||
private Boolean deleted;
|
||||
|
||||
@Schema(description = "租户编号", example = "23584")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "前期费")
|
||||
private BigDecimal preAmount;
|
||||
|
||||
@Schema(description = "设计费")
|
||||
private BigDecimal designAmount;
|
||||
|
||||
@Schema(description = "勘测费")
|
||||
private BigDecimal surveyFees;
|
||||
|
||||
@Schema(description = "测量费")
|
||||
private BigDecimal measurementFee;
|
||||
|
||||
@Schema(description = "其他费")
|
||||
private BigDecimal otherFee;
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
@DictFormat(DictTypeConstants.PROCESS_STATUS)
|
||||
private String processStatus;
|
||||
|
||||
@Schema(description = "合同", example = "20704")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "版本")
|
||||
private String version;
|
||||
|
||||
}
|
@@ -1,5 +1,7 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@@ -46,13 +48,13 @@ public class ContractHistoryRespVO {
|
||||
@ExcelProperty("流程实体id")
|
||||
private String processInstanceId;
|
||||
|
||||
|
||||
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("合同名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("合同类型")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@@ -77,10 +79,12 @@ public class ContractHistoryRespVO {
|
||||
|
||||
@Schema(description = "合同状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("合同状态")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
|
||||
private String status;
|
||||
|
||||
@Schema(description = "计费方式", example = "2")
|
||||
@ExcelProperty("计费方式")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@@ -97,6 +101,7 @@ public class ContractHistoryRespVO {
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
@ExcelProperty("资金来源")
|
||||
@DictFormat(DictTypeConstants.SOURCE)
|
||||
private String source;
|
||||
|
||||
@Schema(description = "优惠", example = "18154")
|
||||
@@ -123,29 +128,6 @@ public class ContractHistoryRespVO {
|
||||
@ExcelProperty("审核文件url")
|
||||
private String reviewFileUrl;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
@ExcelProperty("创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
@ExcelProperty("更新者")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否删除")
|
||||
private Boolean deleted;
|
||||
|
||||
@Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23584")
|
||||
@ExcelProperty("租户编号")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
@ExcelProperty("签订合同总额")
|
||||
@@ -171,14 +153,15 @@ public class ContractHistoryRespVO {
|
||||
@ExcelProperty("其他费")
|
||||
private BigDecimal otherFee;
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
@ExcelProperty("流程状态")
|
||||
private String processStatus;
|
||||
|
||||
@Schema(description = "合同", example = "20704")
|
||||
@ExcelProperty("合同")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
@ExcelProperty("流程状态")
|
||||
@DictFormat(DictTypeConstants.PROCESS_STATUS)
|
||||
private String processStatus;
|
||||
|
||||
@Schema(description = "版本")
|
||||
@ExcelProperty("版本")
|
||||
private String version;
|
||||
|
@@ -1,8 +1,12 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -13,18 +17,47 @@ public class ContractHistorySaveReqVO {
|
||||
@Schema(description = "历史合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "流程实体id", example = "12536")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||
@ExcelProperty("项目编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||
@ExcelProperty("主控部门")
|
||||
private String trackingDep;
|
||||
|
||||
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目经理")
|
||||
private String projectManager;
|
||||
|
||||
@Schema(description = "分包合同提示时间")
|
||||
@ExcelProperty("分包合同提示时间")
|
||||
private LocalDateTime ReminderTime;
|
||||
|
||||
@Schema(description = "暂定结算数")
|
||||
@ExcelProperty("暂定结算数")
|
||||
private BigDecimal provisionalSettlement;
|
||||
|
||||
@Schema(description = "出图公司", requiredMode = Schema.RequiredMode.REQUIRED, example = "***设计院")
|
||||
@ExcelProperty("出图公司")
|
||||
private String drawingCompany;
|
||||
|
||||
@Schema(description = "预计合同金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "200.0000")
|
||||
@ExcelProperty("预计合同金额")
|
||||
private BigDecimal expectedContractAmount;
|
||||
|
||||
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "合同名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "合同类型不能为空")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@@ -47,9 +80,11 @@ public class ContractHistorySaveReqVO {
|
||||
|
||||
@Schema(description = "合同状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "合同状态不能为空")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
|
||||
private String status;
|
||||
|
||||
@Schema(description = "计费方式", example = "2")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@@ -62,6 +97,7 @@ public class ContractHistorySaveReqVO {
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
@DictFormat(DictTypeConstants.SOURCE)
|
||||
private String source;
|
||||
|
||||
@Schema(description = "优惠", example = "18154")
|
||||
@@ -83,28 +119,6 @@ public class ContractHistorySaveReqVO {
|
||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||
private String reviewFileUrl;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "创建时间不能为空")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "更新时间不能为空")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否删除不能为空")
|
||||
private Boolean deleted;
|
||||
|
||||
@Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23584")
|
||||
@NotNull(message = "租户编号不能为空")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@@ -124,6 +138,7 @@ public class ContractHistorySaveReqVO {
|
||||
private BigDecimal otherFee;
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
@DictFormat(DictTypeConstants.PROCESS_STATUS)
|
||||
private String processStatus;
|
||||
|
||||
@Schema(description = "合同", example = "20704")
|
||||
|
@@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contractouts;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsSaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO;
|
||||
import cn.iocoder.yudao.module.cms.service.contractouts.ContractOutsService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Tag(name = "管理后台 - 外包合同关联")
|
||||
@RestController
|
||||
@RequestMapping("/cms/contract-outs")
|
||||
@Validated
|
||||
public class ContractOutsController {
|
||||
|
||||
@Resource
|
||||
private ContractOutsService contractOutsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建外包合同关联")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-outs:create')")
|
||||
public CommonResult<Long> createContractOuts(@Valid @RequestBody ContractOutsSaveReqVO createReqVO) {
|
||||
return success(contractOutsService.createContractOuts(getLoginUserId(),createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新外包合同关联")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-outs:update')")
|
||||
public CommonResult<Boolean> updateContractOuts(@Valid @RequestBody ContractOutsSaveReqVO updateReqVO) {
|
||||
contractOutsService.updateContractOuts(getLoginUserId(),updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除外包合同关联")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-outs:delete')")
|
||||
public CommonResult<Boolean> deleteContractOuts(@RequestParam("id") Long id) {
|
||||
contractOutsService.deleteContractOuts(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得外包合同关联")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-outs:query')")
|
||||
public CommonResult<ContractOutsRespVO> getContractOuts(@RequestParam("id") Long id) {
|
||||
ContractOutsDO contractOuts = contractOutsService.getContractOuts(id);
|
||||
return success(BeanUtils.toBean(contractOuts, ContractOutsRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得外包合同关联分页")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-outs:query')")
|
||||
public CommonResult<PageResult<ContractOutsRespVO>> getContractOutsPage(@Valid ContractOutsPageReqVO pageReqVO) {
|
||||
PageResult<ContractOutsDO> pageResult = contractOutsService.getContractOutsPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ContractOutsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出外包合同关联 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-outs:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportContractOutsExcel(@Valid ContractOutsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ContractOutsDO> list = contractOutsService.getContractOutsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "外包合同关联.xls", "数据", ContractOutsRespVO.class,
|
||||
BeanUtils.toBean(list, ContractOutsRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同关联分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ContractOutsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "合同id", example = "16187")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "外包合同id", example = "9277")
|
||||
private Long outsContractId;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同关联 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ContractOutsRespVO {
|
||||
|
||||
@Schema(description = "合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16187")
|
||||
@ExcelProperty("合同id")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "外包合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9277")
|
||||
@ExcelProperty("外包合同id")
|
||||
private Long outsContractId;
|
||||
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同关联新增/修改 Request VO")
|
||||
@Data
|
||||
public class ContractOutsSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7688")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16187")
|
||||
@NotNull(message = "合同id不能为空")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "外包合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9277")
|
||||
@NotNull(message = "外包合同id不能为空")
|
||||
private Long outsContractId;
|
||||
|
||||
}
|
@@ -1,9 +1,10 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.extContract;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractProcessInstanceRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractSaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.service.extcontract.ExtContractService;
|
||||
import cn.iocoder.yudao.module.cms.service.extContract.ExtContractService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -27,6 +28,7 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 外部合同")
|
||||
@@ -42,14 +44,14 @@ public class ExtContractController {
|
||||
@Operation(summary = "创建外部合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:create')")
|
||||
public CommonResult<Long> createExtContract(@Valid @RequestBody ExtContractSaveReqVO createReqVO) {
|
||||
return success(extContractService.createExtContract(createReqVO));
|
||||
return success(extContractService.createExtContract(getLoginUserId(),createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新外部合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:update')")
|
||||
public CommonResult<Boolean> updateExtContract(@Valid @RequestBody ExtContractSaveReqVO updateReqVO) {
|
||||
extContractService.updateExtContract(updateReqVO);
|
||||
extContractService.updateExtContract(getLoginUserId(),updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@@ -92,4 +94,22 @@ public class ExtContractController {
|
||||
BeanUtils.toBean(list, ExtContractRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/get_process")
|
||||
@Operation(summary = "查询流程")
|
||||
@Parameter(name = "id", description = "外部合同id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:process')")
|
||||
public CommonResult<ContractProcessInstanceRespVO> getContractProcess(@RequestParam("id") Long id) {
|
||||
ContractProcessInstanceRespVO contractProcessInstance = extContractService.getContractProcess(id);
|
||||
return success(contractProcessInstance);
|
||||
}
|
||||
|
||||
@GetMapping("/get_HistoryProcess")
|
||||
@Operation(summary = "查询历史外部合同流程")
|
||||
@Parameter(name = "projectId", description = "项目id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:process')")
|
||||
public CommonResult<List<ContractProcessInstanceRespVO>> getHisContractProcess(@RequestParam("projectId") Long projectId) {
|
||||
List<ContractProcessInstanceRespVO> historyContractProcess = extContractService.getHistoryContractProcess(projectId);
|
||||
return success(historyContractProcess);
|
||||
}
|
||||
|
||||
}
|
@@ -1,5 +1,7 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.extContract.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
@@ -22,6 +24,7 @@ public class ExtContractPageReqVO extends PageParam {
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", example = "1")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String type;
|
||||
|
||||
@Schema(description = "客户公司id", example = "25191")
|
||||
@@ -30,80 +33,11 @@ public class ExtContractPageReqVO extends PageParam {
|
||||
@Schema(description = "合同进展")
|
||||
private String progress;
|
||||
|
||||
@Schema(description = "预计签订时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] expectedTime;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] signingTime;
|
||||
|
||||
@Schema(description = "归档时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] archiveTime;
|
||||
|
||||
@Schema(description = "状态", example = "2")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
|
||||
private String status;
|
||||
|
||||
@Schema(description = "合同金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "前期费用")
|
||||
private BigDecimal preAmount;
|
||||
|
||||
@Schema(description = "设计费")
|
||||
private BigDecimal designFee;
|
||||
|
||||
@Schema(description = "勘测费")
|
||||
private BigDecimal surveyFees;
|
||||
|
||||
@Schema(description = "检测费")
|
||||
private BigDecimal testingFee;
|
||||
|
||||
@Schema(description = "其他费")
|
||||
private String otherFee;
|
||||
|
||||
@Schema(description = "计费方式", example = "1")
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "合同附件url", example = "https://www.iocoder.cn")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "建安费")
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "收费标准")
|
||||
private String chargingStandard;
|
||||
|
||||
@Schema(description = "优惠", example = "15529")
|
||||
private String discount;
|
||||
|
||||
@Schema(description = "是否联合体")
|
||||
private Boolean consortium;
|
||||
|
||||
@Schema(description = "联合体单位")
|
||||
private String consortiumCompany;
|
||||
|
||||
@Schema(description = "分包合同提示时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] reminderTime;
|
||||
|
||||
@Schema(description = "审定金额")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||
private String reviewFileUrl;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "合同id", example = "27460")
|
||||
private Long contractId;
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.extContract.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.*;
|
||||
@@ -17,13 +19,13 @@ public class ExtContractRespVO {
|
||||
@ExcelProperty("项目编号")
|
||||
private String code;
|
||||
|
||||
|
||||
@Schema(description = "合同名称", example = "芋艿")
|
||||
@ExcelProperty("合同名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", example = "1")
|
||||
@ExcelProperty("合同类型")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String type;
|
||||
|
||||
|
||||
@@ -39,9 +41,9 @@ public class ExtContractRespVO {
|
||||
@ExcelProperty("项目经理")
|
||||
private String projectManager;
|
||||
|
||||
@Schema(description = "分包合同提示时间")
|
||||
@ExcelProperty("分包合同提示时间")
|
||||
private LocalDateTime reminderTime;
|
||||
@Schema(description = "合同商议提示时间")
|
||||
@ExcelProperty("合同商议提示时间")
|
||||
private LocalDateTime exReminderTime;
|
||||
|
||||
@Schema(description = "合同进展")
|
||||
@ExcelProperty("合同进展")
|
||||
@@ -61,6 +63,7 @@ public class ExtContractRespVO {
|
||||
|
||||
@Schema(description = "状态", example = "2")
|
||||
@ExcelProperty("状态")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
|
||||
private String status;
|
||||
|
||||
@Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@@ -89,6 +92,7 @@ public class ExtContractRespVO {
|
||||
|
||||
@Schema(description = "计费方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("计费方式")
|
||||
@DictFormat(DictTypeConstants.COUNT_TYPE)
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@@ -105,15 +109,16 @@ public class ExtContractRespVO {
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
@ExcelProperty("资金来源")
|
||||
@DictFormat(DictTypeConstants.SOURCE)
|
||||
private String source;
|
||||
|
||||
|
||||
@Schema(description = "合同提示时间")
|
||||
@ExcelProperty("合同提示时间")
|
||||
private LocalDateTime exReminderTime;
|
||||
@Schema(description = "分包合同提示时间")
|
||||
@ExcelProperty("分包合同提示时间")
|
||||
private LocalDateTime reminderTime;
|
||||
|
||||
@Schema(description = "收费标准", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("收费标准")
|
||||
@DictFormat(DictTypeConstants.CHARGING_STANDARD)
|
||||
private String chargingStandard;
|
||||
|
||||
@Schema(description = "优惠", example = "15529")
|
||||
@@ -143,18 +148,5 @@ public class ExtContractRespVO {
|
||||
private Long contractId;
|
||||
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "创建时间不能为空")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "更新时间不能为空")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
@@ -1,5 +1,8 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.extContract.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
@@ -18,15 +21,39 @@ public class ExtContractSaveReqVO {
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "合同名称", example = "芋艿")
|
||||
private String name;
|
||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||
@ExcelProperty("项目编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "客户名称")
|
||||
@ExcelProperty("客户名称")
|
||||
private String customerCompanyName;
|
||||
|
||||
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||
@ExcelProperty("主控部门")
|
||||
private String trackingDep;
|
||||
|
||||
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目经理")
|
||||
private String projectManager;
|
||||
|
||||
@Schema(description = "合同提示时间")
|
||||
@ExcelProperty("合同提示时间")
|
||||
private LocalDateTime exReminderTime;
|
||||
|
||||
@Schema(description = "合同类型", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "客户公司id", example = "25191")
|
||||
private Long customerCompanyId;
|
||||
|
||||
@Schema(description = "合同名称", example = "芋艿")
|
||||
@ExcelProperty("合同名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", example = "1")
|
||||
@ExcelProperty("合同类型")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展")
|
||||
private String progress;
|
||||
|
||||
@@ -41,6 +68,7 @@ public class ExtContractSaveReqVO {
|
||||
private LocalDateTime archiveTime;
|
||||
|
||||
@Schema(description = "状态", example = "2")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
|
||||
private String status;
|
||||
|
||||
@Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@@ -64,6 +92,7 @@ public class ExtContractSaveReqVO {
|
||||
|
||||
@Schema(description = "计费方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "计费方式不能为空")
|
||||
@DictFormat(DictTypeConstants.COUNT_TYPE)
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@@ -76,10 +105,12 @@ public class ExtContractSaveReqVO {
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
@DictFormat(DictTypeConstants.SOURCE)
|
||||
private String source;
|
||||
|
||||
@Schema(description = "收费标准", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "收费标准不能为空")
|
||||
@DictFormat(DictTypeConstants.CHARGING_STANDARD)
|
||||
private String chargingStandard;
|
||||
|
||||
@Schema(description = "优惠", example = "15529")
|
||||
@@ -104,22 +135,5 @@ public class ExtContractSaveReqVO {
|
||||
@Schema(description = "合同id", example = "27460")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "创建时间不能为空")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "更新时间不能为空")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12587")
|
||||
@NotNull(message = "租户编号不能为空")
|
||||
private Long tenantId;
|
||||
|
||||
}
|
@@ -0,0 +1,79 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo.*;
|
||||
import cn.iocoder.yudao.module.cms.service.extcontracthistory.ExtContractHistoryService;
|
||||
|
||||
@Tag(name = "管理后台 - 外部合同历史")
|
||||
@RestController
|
||||
@RequestMapping("/cms/ext-contract-history")
|
||||
@Validated
|
||||
public class ExtContractHistoryController {
|
||||
|
||||
|
||||
|
||||
@Resource
|
||||
private ExtContractHistoryService extContractHistoryService;
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新外部合同历史历史")
|
||||
@PreAuthorize("@ss.hasPermission('cms:ext-contract-history:update')")
|
||||
public CommonResult<Boolean> updateExtContractHistory(@Valid @RequestBody ExtContractHistorySaveReqVO updateReqVO) {
|
||||
extContractHistoryService.updateExtContractHistory(getLoginUserId(),updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得外部合同历史历史")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('cms:ext-contract-history:query')")
|
||||
public CommonResult<ExtContractHistoryRespVO> getExtContractHistory(@RequestParam("id") Long id) {
|
||||
ExtContractHistoryRespVO extContractHistory = extContractHistoryService.getExtContractHistory(id);
|
||||
return success(extContractHistory);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得外部合同历史历史分页")
|
||||
@PreAuthorize("@ss.hasPermission('cms:ext-contract-history:query')")
|
||||
public CommonResult<PageResult<ExtContractHistoryRespVO>> getExtContractHistoryPage(@Valid ExtContractHistoryPageReqVO pageReqVO) {
|
||||
PageResult<ExtContractHistoryRespVO> pageResult = extContractHistoryService.getExtContractHistoryPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出外部合同历史历史 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('cms:ext-contract-history:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportExtContractHistoryExcel(@Valid ExtContractHistoryPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ExtContractHistoryRespVO> list = extContractHistoryService.getExtContractHistoryPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "外部合同历史历史.xls", "数据", ExtContractHistoryRespVO.class,
|
||||
BeanUtils.toBean(list, ExtContractHistoryRespVO.class));
|
||||
}
|
||||
}
|
@@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
|
||||
@Schema(description = "管理后台 - 外部合同分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ExtContractHistoryPageReqVO extends PageParam {
|
||||
|
||||
|
||||
@Schema(description = "项目id", example = "6935")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "合同名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", example = "1")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String type;
|
||||
|
||||
@Schema(description = "客户公司id", example = "28989")
|
||||
private Long customerCompanyId;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
|
||||
private String status;
|
||||
|
||||
|
||||
@Schema(description = "流程实体id", example = "8911")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
@DictFormat(DictTypeConstants.PROCESS_STATUS)
|
||||
private String processStatus;
|
||||
|
||||
@Schema(description = "合同id", example = "26795")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "外部合同id", example = "12093")
|
||||
private Long extContractId;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,174 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 外部合同 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ExtContractHistoryRespVO {
|
||||
|
||||
|
||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||
@ExcelProperty("项目编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "客户名称")
|
||||
@ExcelProperty("客户名称")
|
||||
private String customerCompanyName;
|
||||
|
||||
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||
@ExcelProperty("主控部门")
|
||||
private String trackingDep;
|
||||
|
||||
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目经理")
|
||||
private String projectManager;
|
||||
|
||||
@Schema(description = "合同提示时间")
|
||||
@ExcelProperty("合同提示时间")
|
||||
private LocalDateTime exReminderTime;
|
||||
|
||||
@Schema(description = "客户公司id", example = "28989")
|
||||
@ExcelProperty("客户公司id")
|
||||
private Long customerCompanyId;
|
||||
|
||||
@Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("合同金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
|
||||
@Schema(description = "合同名称", example = "张三")
|
||||
@ExcelProperty("合同名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", example = "1")
|
||||
@ExcelProperty("合同类型")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String type;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "合同进展")
|
||||
@ExcelProperty("合同进展")
|
||||
private String progress;
|
||||
|
||||
@Schema(description = "预计签订时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("预计签订时间")
|
||||
private LocalDateTime expectedTime;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@ExcelProperty("签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "归档时间")
|
||||
@ExcelProperty("归档时间")
|
||||
private LocalDateTime archiveTime;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
@ExcelProperty("状态")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
|
||||
private String status;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "前期费用")
|
||||
@ExcelProperty("前期费用")
|
||||
private BigDecimal preAmount;
|
||||
|
||||
@Schema(description = "设计费")
|
||||
@ExcelProperty("设计费")
|
||||
private BigDecimal designFee;
|
||||
|
||||
@Schema(description = "勘测费")
|
||||
@ExcelProperty("勘测费")
|
||||
private BigDecimal surveyFees;
|
||||
|
||||
@Schema(description = "检测费")
|
||||
@ExcelProperty("检测费")
|
||||
private BigDecimal testingFee;
|
||||
|
||||
@Schema(description = "其他费")
|
||||
@ExcelProperty("其他费")
|
||||
private String otherFee;
|
||||
|
||||
@Schema(description = "计费方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty(value = "计费方式", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.COUNT_TYPE)
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "合同附件url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("合同附件url")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "建安费")
|
||||
@ExcelProperty("建安费")
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
@ExcelProperty(value = "资金来源", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.COUNT_TYPE)
|
||||
private String source;
|
||||
|
||||
@Schema(description = "收费标准", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("收费标准")
|
||||
@DictFormat(DictTypeConstants.CHARGING_STANDARD)
|
||||
private String chargingStandard;
|
||||
|
||||
@Schema(description = "优惠", example = "7511")
|
||||
@ExcelProperty("优惠")
|
||||
private String discount;
|
||||
|
||||
@Schema(description = "是否联合体", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否联合体")
|
||||
private Boolean consortium;
|
||||
|
||||
@Schema(description = "联合体单位")
|
||||
@ExcelProperty("联合体单位")
|
||||
private String consortiumCompany;
|
||||
|
||||
@Schema(description = "合同提示时间")
|
||||
@ExcelProperty("合同提示时间")
|
||||
private LocalDateTime reminderTime;
|
||||
|
||||
@Schema(description = "审定金额")
|
||||
@ExcelProperty("审定金额")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("审核文件url")
|
||||
private String reviewFileUrl;
|
||||
|
||||
@Schema(description = "流程实体id", example = "8911")
|
||||
@ExcelProperty("流程实体id")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
@ExcelProperty(value = "流程状态", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.PROCESS_STATUS)
|
||||
private String processStatus;
|
||||
|
||||
@Schema(description = "合同id", example = "26795")
|
||||
@ExcelProperty("合同id")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "外部合同id", example = "12093")
|
||||
@ExcelProperty("外部合同id")
|
||||
private Long extContractId;
|
||||
|
||||
@Schema(description = "版本")
|
||||
@ExcelProperty("版本")
|
||||
private String version;
|
||||
|
||||
}
|
@@ -0,0 +1,153 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 外部合同新增/修改 Request VO")
|
||||
@Data
|
||||
public class ExtContractHistorySaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "17790")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6935")
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
|
||||
|
||||
@Schema(description = "流程实体id", example = "8911")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||
@ExcelProperty("项目编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "客户名称")
|
||||
@ExcelProperty("客户名称")
|
||||
private String customerCompanyName;
|
||||
|
||||
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||
@ExcelProperty("主控部门")
|
||||
private String trackingDep;
|
||||
|
||||
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目经理")
|
||||
private String projectManager;
|
||||
|
||||
@Schema(description = "合同提示时间")
|
||||
@ExcelProperty("合同提示时间")
|
||||
private LocalDateTime exReminderTime;
|
||||
|
||||
@Schema(description = "客户公司id", example = "28989")
|
||||
private Long customerCompanyId;
|
||||
|
||||
@Schema(description = "合同名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", example = "1")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||
private String type;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "合同进展")
|
||||
private String progress;
|
||||
|
||||
@Schema(description = "预计签订时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "预计签订时间不能为空")
|
||||
private LocalDateTime expectedTime;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "归档时间")
|
||||
private LocalDateTime archiveTime;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
|
||||
private String status;
|
||||
|
||||
@Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "合同金额不能为空")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "前期费用")
|
||||
private BigDecimal preAmount;
|
||||
|
||||
@Schema(description = "设计费")
|
||||
private BigDecimal designFee;
|
||||
|
||||
@Schema(description = "勘测费")
|
||||
private BigDecimal surveyFees;
|
||||
|
||||
@Schema(description = "检测费")
|
||||
private BigDecimal testingFee;
|
||||
|
||||
@Schema(description = "其他费")
|
||||
private String otherFee;
|
||||
|
||||
@Schema(description = "计费方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "计费方式不能为空")
|
||||
@DictFormat(DictTypeConstants.COUNT_TYPE)
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "合同附件url", example = "https://www.iocoder.cn")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "建安费")
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
@DictFormat(DictTypeConstants.SOURCE)
|
||||
private String source;
|
||||
|
||||
@Schema(description = "收费标准", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "收费标准不能为空")
|
||||
@DictFormat(DictTypeConstants.CHARGING_STANDARD)
|
||||
private String chargingStandard;
|
||||
|
||||
@Schema(description = "优惠", example = "7511")
|
||||
private String discount;
|
||||
|
||||
@Schema(description = "是否联合体", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否联合体不能为空")
|
||||
private Boolean consortium;
|
||||
|
||||
@Schema(description = "联合体单位")
|
||||
private String consortiumCompany;
|
||||
|
||||
@Schema(description = "合同提示时间")
|
||||
private LocalDateTime reminderTime;
|
||||
|
||||
@Schema(description = "审定金额")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||
private String reviewFileUrl;
|
||||
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
@DictFormat(DictTypeConstants.PROCESS_STATUS)
|
||||
private String processStatus;
|
||||
|
||||
@Schema(description = "合同id", example = "26795")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "外部合同id", example = "12093")
|
||||
private Long extContractId;
|
||||
|
||||
@Schema(description = "版本")
|
||||
private String version;
|
||||
|
||||
}
|
@@ -0,0 +1,112 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontract;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractProcessInstanceRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractSaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO;
|
||||
import cn.iocoder.yudao.module.cms.service.outscontract.OutsContractService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Tag(name = "管理后台 - 外包合同")
|
||||
@RestController
|
||||
@RequestMapping("/cms/outs-contract")
|
||||
@Validated
|
||||
public class OutsContractController {
|
||||
|
||||
@Resource
|
||||
private OutsContractService outsContractService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建外包合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract:create')")
|
||||
public CommonResult<Long> createOutsContract(@Valid @RequestBody OutsContractSaveReqVO createReqVO) {
|
||||
return success(outsContractService.createOutsContract(getLoginUserId(),createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新外包合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract:update')")
|
||||
public CommonResult<Boolean> updateOutsContract(@Valid @RequestBody OutsContractSaveReqVO updateReqVO) {
|
||||
outsContractService.updateOutsContract(getLoginUserId(),updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除外包合同")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract:delete')")
|
||||
public CommonResult<Boolean> deleteOutsContract(@RequestParam("id") Long id) {
|
||||
outsContractService.deleteOutsContract(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得外包合同")
|
||||
@Parameter(name = "id", description = "主合同编号", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract:query')")
|
||||
public CommonResult<OutsContractRespVO> getOutsContract(@RequestParam("id") Long id) {
|
||||
OutsContractRespVO outsContractRespVO = outsContractService.getOutsContract(id);
|
||||
return success(outsContractRespVO);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得外包合同分页")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract:query')")
|
||||
public CommonResult<PageResult<OutsContractRespVO>> getOutsContractPage(@Valid OutsContractPageReqVO pageReqVO) {
|
||||
PageResult<OutsContractRespVO> pageResult = outsContractService.getOutsContractPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出外包合同 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportOutsContractExcel(@Valid OutsContractPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<OutsContractRespVO> list = outsContractService.getOutsContractPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "外包合同.xls", "数据", OutsContractRespVO.class,
|
||||
BeanUtils.toBean(list, OutsContractRespVO.class));
|
||||
}
|
||||
@GetMapping("/get_process")
|
||||
@Operation(summary = "查询流程")
|
||||
@Parameter(name = "id", description = "外包合同id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:process')")
|
||||
public CommonResult<ContractProcessInstanceRespVO> getContractProcess(@RequestParam("id") Long id) {
|
||||
ContractProcessInstanceRespVO contractProcessInstance = outsContractService.getContractProcess(id);
|
||||
return success(contractProcessInstance);
|
||||
}
|
||||
|
||||
@GetMapping("/get_HistoryProcess")
|
||||
@Operation(summary = "查询历史外包合同流程")
|
||||
@Parameter(name = "projectId", description = "项目id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:process')")
|
||||
public CommonResult<List<ContractProcessInstanceRespVO>> getHisContractProcess(@RequestParam("projectId") Long projectId) {
|
||||
List<ContractProcessInstanceRespVO> historyContractProcess = outsContractService.getHistoryContractProcess(projectId);
|
||||
return success(historyContractProcess);
|
||||
}
|
||||
}
|
@@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class OutsContractPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "项目id", example = "27415")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "合同名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "主合同id", example = "19816")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "计费类型", example = "2")
|
||||
@DictFormat(DictTypeConstants.COUNT_TYPE)
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "合同金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "专业")
|
||||
@DictFormat(DictTypeConstants.OUTS_CONTRACT_MAJOR)
|
||||
private String major;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] signingTime;
|
||||
|
||||
@Schema(description = "结算数")
|
||||
private BigDecimal settlementAmount;
|
||||
|
||||
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
||||
private String contractFileUrl;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,76 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class OutsContractRespVO {
|
||||
|
||||
@Schema(description = "合同名称", example = "张三")
|
||||
@ExcelProperty("合同名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||
@ExcelProperty("主控部门")
|
||||
private String trackingDep;
|
||||
|
||||
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目经理")
|
||||
private String projectManager;
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
@ExcelProperty("签订合同总额")
|
||||
private BigDecimal outsAmount;
|
||||
|
||||
|
||||
@Schema(description = "外包合同编号")
|
||||
@ExcelProperty("编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "外包单位")
|
||||
@ExcelProperty("外包单位")
|
||||
private String outsCompany;
|
||||
|
||||
@Schema(description = "主合同id", example = "19816")
|
||||
@ExcelProperty("主合同id")
|
||||
private Long contractId;
|
||||
|
||||
|
||||
@Schema(description = "外包合同类型", example = "2")
|
||||
@ExcelProperty(value = "外包合同类型", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.COUNT_TYPE)
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "外包合同总额")
|
||||
@ExcelProperty("外包合同总额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "专业")
|
||||
@ExcelProperty(value = "专业", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.OUTS_CONTRACT_MAJOR)
|
||||
private String major;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@ExcelProperty("签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "结算数")
|
||||
@ExcelProperty("结算数")
|
||||
private BigDecimal settlementAmount;
|
||||
|
||||
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("合同文件url")
|
||||
private String contractFileUrl;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,83 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同新增/修改 Request VO")
|
||||
@Data
|
||||
public class OutsContractSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2034")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "27415")
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
|
||||
|
||||
@Schema(description = "合同名称", example = "张三")
|
||||
@ExcelProperty("合同名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||
@ExcelProperty("主控部门")
|
||||
private String trackingDep;
|
||||
|
||||
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目经理")
|
||||
private String projectManager;
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
@ExcelProperty("签订合同总额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "外包合同编号")
|
||||
@ExcelProperty("编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "外包单位")
|
||||
@ExcelProperty("外包单位")
|
||||
private String outsCompany;
|
||||
|
||||
@Schema(description = "主合同id", example = "19816")
|
||||
@ExcelProperty("主合同id")
|
||||
private Long contractId;
|
||||
|
||||
|
||||
@Schema(description = "外包合同类型", example = "2")
|
||||
@ExcelProperty(value = "外包合同类型", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.COUNT_TYPE)
|
||||
private String countType;
|
||||
|
||||
|
||||
@Schema(description = "外包合同金额")
|
||||
@ExcelProperty("外包合同金额")
|
||||
private BigDecimal outsAmount;
|
||||
|
||||
|
||||
@Schema(description = "专业")
|
||||
@ExcelProperty(value = "专业", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.OUTS_CONTRACT_MAJOR)
|
||||
private String major;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@ExcelProperty("签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "结算数")
|
||||
@ExcelProperty("结算数")
|
||||
private BigDecimal settlementAmount;
|
||||
|
||||
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("合同文件url")
|
||||
private String contractFileUrl;
|
||||
|
||||
}
|
@@ -0,0 +1,76 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistorySaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.service.outscontracthistory.OutsContractHistoryService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 外包合同历史")
|
||||
@RestController
|
||||
@RequestMapping("/cms/outs-contract-history")
|
||||
@Validated
|
||||
public class OutsContractHistoryController {
|
||||
|
||||
@Resource
|
||||
private OutsContractHistoryService outsContractHistoryService;
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新外包合同历史")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:update')")
|
||||
public CommonResult<Boolean> updateOutsContractHistory(@Valid @RequestBody OutsContractHistorySaveReqVO updateReqVO) {
|
||||
outsContractHistoryService.updateOutsContractHistory(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得外包合同历史")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:query')")
|
||||
public CommonResult<OutsContractHistoryRespVO> getOutsContractHistory(@RequestParam("id") Long id) {
|
||||
OutsContractHistoryRespVO outsContractHistory = outsContractHistoryService.getOutsContractHistory(id);
|
||||
return success(outsContractHistory);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得外包合同历史分页")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:query')")
|
||||
public CommonResult<PageResult<OutsContractHistoryRespVO>> getOutsContractHistoryPage(@Valid OutsContractHistoryPageReqVO pageReqVO) {
|
||||
PageResult<OutsContractHistoryRespVO> pageResult = outsContractHistoryService.getOutsContractHistoryPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出外包合同历史 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportOutsContractHistoryExcel(@Valid OutsContractHistoryPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<OutsContractHistoryRespVO> list = outsContractHistoryService.getOutsContractHistoryPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "外包合同历史.xls", "数据", OutsContractHistoryRespVO.class,
|
||||
BeanUtils.toBean(list, OutsContractHistoryRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同历史分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class OutsContractHistoryPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "项目id", example = "31803")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "合同名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "主合同id", example = "19949")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "专业")
|
||||
private String major;
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
private String processStatus;
|
||||
|
||||
@Schema(description = "外包合同id", example = "24736")
|
||||
private Long outsContractId;
|
||||
|
||||
@Schema(description = "版本")
|
||||
private String version;
|
||||
|
||||
}
|
@@ -0,0 +1,85 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同历史 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class OutsContractHistoryRespVO {
|
||||
|
||||
@Schema(description = "合同名称", example = "张三")
|
||||
@ExcelProperty("合同名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||
@ExcelProperty("主控部门")
|
||||
private String trackingDep;
|
||||
|
||||
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目经理")
|
||||
private String projectManager;
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
@ExcelProperty("签订合同总额")
|
||||
private BigDecimal outsAmount;
|
||||
|
||||
|
||||
@Schema(description = "主合同id", example = "19949")
|
||||
@ExcelProperty("主合同id")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
@ExcelProperty(value = "类型", converter = DictConvert.class)
|
||||
@DictFormat("contract_billing_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "合同金额")
|
||||
@ExcelProperty("合同金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "编号")
|
||||
@ExcelProperty("编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "专业")
|
||||
@ExcelProperty(value = "专业", converter = DictConvert.class)
|
||||
@DictFormat("major") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String major;
|
||||
|
||||
@Schema(description = "流程实体id", example = "32397")
|
||||
@ExcelProperty("流程实体id")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@ExcelProperty("签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "结算数")
|
||||
@ExcelProperty("结算数")
|
||||
private BigDecimal settlementAmount;
|
||||
|
||||
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("合同文件url")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
@ExcelProperty("流程状态")
|
||||
private String processStatus;
|
||||
|
||||
@Schema(description = "外包合同id", example = "24736")
|
||||
@ExcelProperty("外包合同id")
|
||||
private Long outsContractId;
|
||||
|
||||
@Schema(description = "版本")
|
||||
@ExcelProperty("版本")
|
||||
private String version;
|
||||
|
||||
}
|
@@ -0,0 +1,77 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同历史新增/修改 Request VO")
|
||||
@Data
|
||||
public class OutsContractHistorySaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16040")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31803")
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
|
||||
|
||||
@Schema(description = "合同名称", example = "张三")
|
||||
@ExcelProperty("合同名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||
@ExcelProperty("主控部门")
|
||||
private String trackingDep;
|
||||
|
||||
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目经理")
|
||||
private String projectManager;
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
@ExcelProperty("签订合同总额")
|
||||
private BigDecimal outsAmount;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "主合同id", example = "19949")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "合同金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "专业")
|
||||
private String major;
|
||||
|
||||
@Schema(description = "流程实体id", example = "32397")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "结算数")
|
||||
private BigDecimal settlementAmount;
|
||||
|
||||
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
private String processStatus;
|
||||
|
||||
@Schema(description = "外包合同id", example = "24736")
|
||||
private Long outsContractId;
|
||||
|
||||
@Schema(description = "版本")
|
||||
private String version;
|
||||
|
||||
}
|
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.dataobject.contract;
|
||||
|
||||
import cn.iocoder.yudao.module.pms.enums.DictTypeConstants;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -38,6 +39,8 @@ public class ContractDO extends BaseDO {
|
||||
private String name;
|
||||
/**
|
||||
* 合同类型
|
||||
*
|
||||
* 枚举 枚举 {@link DictTypeConstants}
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
|
@@ -148,5 +148,4 @@ public class ContractHistoryDO extends BaseDO {
|
||||
* 版本
|
||||
*/
|
||||
private String version;
|
||||
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.dataobject.contractouts;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 外包合同关联 DO
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@TableName("cms_contract_outs")
|
||||
@KeySequence("cms_contract_outs_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ContractOutsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 合同id
|
||||
*/
|
||||
private Long contractId;
|
||||
/**
|
||||
* 外包合同id
|
||||
*/
|
||||
private Long outsContractId;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updater;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
private String tenantId;
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.dataobject.extContract;
|
||||
package cn.iocoder.yudao.module.cms.dal.dataobject.extcontract;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
@@ -0,0 +1,166 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.dataobject.extcontracthistory;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 外部合同 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("cms_ext_contract_history")
|
||||
@KeySequence("cms_ext_contract_history_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ExtContractHistoryDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 客户公司id
|
||||
*/
|
||||
private Long customerCompanyId;
|
||||
/**
|
||||
* 合同进展
|
||||
*/
|
||||
private String progress;
|
||||
/**
|
||||
* 预计签订时间
|
||||
*/
|
||||
private LocalDateTime expectedTime;
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
private LocalDateTime signingTime;
|
||||
/**
|
||||
* 归档时间
|
||||
*/
|
||||
private LocalDateTime archiveTime;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 前期费用
|
||||
*/
|
||||
private BigDecimal preAmount;
|
||||
/**
|
||||
* 设计费
|
||||
*/
|
||||
private BigDecimal designFee;
|
||||
/**
|
||||
* 勘测费
|
||||
*/
|
||||
private BigDecimal surveyFees;
|
||||
/**
|
||||
* 检测费
|
||||
*/
|
||||
private BigDecimal testingFee;
|
||||
/**
|
||||
* 其他费
|
||||
*/
|
||||
private String otherFee;
|
||||
/**
|
||||
* 计费方式
|
||||
*
|
||||
* 枚举 {@link //TODO contract_billing_type 对应的类}
|
||||
*/
|
||||
private String countType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 合同附件url
|
||||
*/
|
||||
private String contractFileUrl;
|
||||
/**
|
||||
* 建安费
|
||||
*/
|
||||
private BigDecimal constructionCost;
|
||||
/**
|
||||
* 资金来源
|
||||
*
|
||||
* 枚举 {@link //TODO funds_source 对应的类}
|
||||
*/
|
||||
private String source;
|
||||
/**
|
||||
* 收费标准
|
||||
*/
|
||||
private String chargingStandard;
|
||||
/**
|
||||
* 优惠
|
||||
*/
|
||||
private String discount;
|
||||
/**
|
||||
* 是否联合体
|
||||
*/
|
||||
private Boolean consortium;
|
||||
/**
|
||||
* 联合体单位
|
||||
*/
|
||||
private String consortiumCompany;
|
||||
/**
|
||||
* 合同提示时间
|
||||
*/
|
||||
private LocalDateTime reminderTime;
|
||||
/**
|
||||
* 审定金额
|
||||
*/
|
||||
private BigDecimal approvedAmount;
|
||||
/**
|
||||
* 审核文件url
|
||||
*/
|
||||
private String reviewFileUrl;
|
||||
/**
|
||||
* 流程实体id
|
||||
*/
|
||||
private String processInstanceId;
|
||||
/**
|
||||
* 流程状态
|
||||
*
|
||||
* 枚举 {@link //TODO bpm_process_instance_status 对应的类}
|
||||
*/
|
||||
private String processStatus;
|
||||
/**
|
||||
* 合同id
|
||||
*/
|
||||
private Long contractId;
|
||||
/**
|
||||
* 外部合同id
|
||||
*/
|
||||
private Long extContractId;
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
private String version;
|
||||
|
||||
}
|
@@ -0,0 +1,77 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.dataobject.outscontract;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 外包合同 DO
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@TableName("cms_outs_contract")
|
||||
@KeySequence("cms_outs_contract_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OutsContractDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 主合同id
|
||||
*/
|
||||
private Long contractId;
|
||||
/**
|
||||
* 类型
|
||||
*
|
||||
* 枚举 //// TODO 搞成枚举
|
||||
*/
|
||||
private String countType;
|
||||
/**
|
||||
* 外包合同金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 专业
|
||||
*
|
||||
* 枚举 // TODO 搞成枚举
|
||||
*/
|
||||
private String major;
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
private LocalDateTime signingTime;
|
||||
/**
|
||||
* 结算数
|
||||
*/
|
||||
private BigDecimal settlementAmount;
|
||||
/**
|
||||
* 合同文件url
|
||||
*/
|
||||
private String contractFileUrl;
|
||||
|
||||
}
|
@@ -0,0 +1,94 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 外包合同历史 DO
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@TableName("cms_outs_contract_history")
|
||||
@KeySequence("cms_outs_contract_history_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OutsContractHistoryDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 主合同id
|
||||
*/
|
||||
private Long contractId;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*
|
||||
* 枚举 {@link // TODO contract_billing_type 对应的类}
|
||||
*/
|
||||
private String countType;
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 专业
|
||||
*
|
||||
* 枚举 {@link //TODO major 对应的类}
|
||||
*/
|
||||
private String major;
|
||||
/**
|
||||
* 流程实体id
|
||||
*/
|
||||
private String processInstanceId;
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
private LocalDateTime signingTime;
|
||||
/**
|
||||
* 结算数
|
||||
*/
|
||||
private BigDecimal settlementAmount;
|
||||
/**
|
||||
* 合同文件url
|
||||
*/
|
||||
private String contractFileUrl;
|
||||
/**
|
||||
* 流程状态
|
||||
*/
|
||||
private String processStatus;
|
||||
/**
|
||||
* 外包合同id
|
||||
*/
|
||||
private Long outsContractId;
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
private String version;
|
||||
|
||||
}
|
@@ -19,32 +19,11 @@ public interface ContractMapper extends BaseMapperX<ContractDO> {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ContractDO>()
|
||||
.likeIfPresent(ContractDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ContractDO::getType, reqVO.getType())
|
||||
.eqIfPresent(ContractDO::getProjectId, reqVO.getProjectId())
|
||||
.eqIfPresent(ContractDO::getProgress, reqVO.getProgress())
|
||||
.betweenIfPresent(ContractDO::getExpectedTime, reqVO.getExpectedTime())
|
||||
.betweenIfPresent(ContractDO::getPrintingTime, reqVO.getPrintingTime())
|
||||
.betweenIfPresent(ContractDO::getSigningTime, reqVO.getSigningTime())
|
||||
.betweenIfPresent(ContractDO::getArchiveTime, reqVO.getArchiveTime())
|
||||
.eqIfPresent(ContractDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ContractDO::getCountType, reqVO.getCountType())
|
||||
.eqIfPresent(ContractDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(ContractDO::getContractFileUrl, reqVO.getContractFileUrl())
|
||||
.eqIfPresent(ContractDO::getConstructionCost, reqVO.getConstructionCost())
|
||||
.eqIfPresent(ContractDO::getSource, reqVO.getSource())
|
||||
.eqIfPresent(ContractDO::getDiscount, reqVO.getDiscount())
|
||||
.eqIfPresent(ContractDO::getConsortium, reqVO.getConsortium())
|
||||
.eqIfPresent(ContractDO::getConsortiumCompany, reqVO.getConsortiumCompany())
|
||||
.eqIfPresent(ContractDO::getExtProportion, reqVO.getExtProportion())
|
||||
.eqIfPresent(ContractDO::getApprovedAmount, reqVO.getApprovedAmount())
|
||||
.eqIfPresent(ContractDO::getReviewFileUrl, reqVO.getReviewFileUrl())
|
||||
.betweenIfPresent(ContractDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(ContractDO::getAmount, reqVO.getAmount())
|
||||
.eqIfPresent(ContractDO::getPreAmount, reqVO.getPreAmount())
|
||||
.eqIfPresent(ContractDO::getDesignAmount, reqVO.getDesignAmount())
|
||||
.eqIfPresent(ContractDO::getSurveyFees, reqVO.getSurveyFees())
|
||||
.eqIfPresent(ContractDO::getMeasurementFee, reqVO.getMeasurementFee())
|
||||
.eqIfPresent(ContractDO::getOtherFee, reqVO.getOtherFee())
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -19,39 +19,13 @@ public interface ContractHistoryMapper extends BaseMapperX<ContractHistoryDO> {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ContractHistoryDO>()
|
||||
.eqIfPresent(ContractHistoryDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
||||
.likeIfPresent(ContractHistoryDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ContractHistoryDO::getProjectId,reqVO.getProjectId())
|
||||
.eqIfPresent(ContractHistoryDO::getType, reqVO.getType())
|
||||
.eqIfPresent(ContractHistoryDO::getProgress, reqVO.getProgress())
|
||||
.betweenIfPresent(ContractHistoryDO::getExpectedTime, reqVO.getExpectedTime())
|
||||
.betweenIfPresent(ContractHistoryDO::getPrintingTime, reqVO.getPrintingTime())
|
||||
.betweenIfPresent(ContractHistoryDO::getSigningTime, reqVO.getSigningTime())
|
||||
.betweenIfPresent(ContractHistoryDO::getArchiveTime, reqVO.getArchiveTime())
|
||||
.eqIfPresent(ContractHistoryDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ContractHistoryDO::getCountType, reqVO.getCountType())
|
||||
.eqIfPresent(ContractHistoryDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(ContractHistoryDO::getContractFileUrl, reqVO.getContractFileUrl())
|
||||
.eqIfPresent(ContractHistoryDO::getConstructionCost, reqVO.getConstructionCost())
|
||||
.eqIfPresent(ContractHistoryDO::getSource, reqVO.getSource())
|
||||
.eqIfPresent(ContractHistoryDO::getDiscount, reqVO.getDiscount())
|
||||
.eqIfPresent(ContractHistoryDO::getConsortium, reqVO.getConsortium())
|
||||
.eqIfPresent(ContractHistoryDO::getConsortiumCompany, reqVO.getConsortiumCompany())
|
||||
.eqIfPresent(ContractHistoryDO::getExtProportion, reqVO.getExtProportion())
|
||||
.eqIfPresent(ContractHistoryDO::getApprovedAmount, reqVO.getApprovedAmount())
|
||||
.eqIfPresent(ContractHistoryDO::getReviewFileUrl, reqVO.getReviewFileUrl())
|
||||
.eqIfPresent(ContractHistoryDO::getCreator, reqVO.getCreator())
|
||||
.betweenIfPresent(ContractHistoryDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(ContractHistoryDO::getUpdater, reqVO.getUpdater())
|
||||
.betweenIfPresent(ContractHistoryDO::getUpdateTime, reqVO.getUpdateTime())
|
||||
.eqIfPresent(ContractHistoryDO::getDeleted, reqVO.getDeleted())
|
||||
.eqIfPresent(ContractHistoryDO::getAmount, reqVO.getAmount())
|
||||
.eqIfPresent(ContractHistoryDO::getPreAmount, reqVO.getPreAmount())
|
||||
.eqIfPresent(ContractHistoryDO::getDesignAmount, reqVO.getDesignAmount())
|
||||
.eqIfPresent(ContractHistoryDO::getSurveyFees, reqVO.getSurveyFees())
|
||||
.eqIfPresent(ContractHistoryDO::getMeasurementFee, reqVO.getMeasurementFee())
|
||||
.eqIfPresent(ContractHistoryDO::getOtherFee, reqVO.getOtherFee())
|
||||
.eqIfPresent(ContractHistoryDO::getProcessStatus, reqVO.getProcessStatus())
|
||||
.eqIfPresent(ContractHistoryDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(ContractHistoryDO::getVersion, reqVO.getVersion())
|
||||
.orderByDesc(ContractHistoryDO::getId));
|
||||
.eqIfPresent(ContractHistoryDO::getContractId, reqVO.getContractId()));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.mysql.contractouts;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 外包合同关联 Mapper
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@Mapper
|
||||
public interface ContractOutsMapper extends BaseMapperX<ContractOutsDO> {
|
||||
|
||||
default PageResult<ContractOutsDO> selectPage(ContractOutsPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ContractOutsDO>()
|
||||
.eqIfPresent(ContractOutsDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(ContractOutsDO::getOutsContractId, reqVO.getOutsContractId())
|
||||
.orderByDesc(ContractOutsDO::getId));
|
||||
}
|
||||
|
||||
}
|
@@ -1,10 +1,10 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.mysql.extContract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.extContract.ExtContractDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
@@ -21,31 +21,8 @@ public interface ExtContractMapper extends BaseMapperX<ExtContractDO> {
|
||||
.eqIfPresent(ExtContractDO::getType, reqVO.getType())
|
||||
.eqIfPresent(ExtContractDO::getCustomerCompanyId, reqVO.getCustomerCompanyId())
|
||||
.eqIfPresent(ExtContractDO::getProgress, reqVO.getProgress())
|
||||
.betweenIfPresent(ExtContractDO::getExpectedTime, reqVO.getExpectedTime())
|
||||
.betweenIfPresent(ExtContractDO::getSigningTime, reqVO.getSigningTime())
|
||||
.betweenIfPresent(ExtContractDO::getArchiveTime, reqVO.getArchiveTime())
|
||||
.eqIfPresent(ExtContractDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ExtContractDO::getAmount, reqVO.getAmount())
|
||||
.eqIfPresent(ExtContractDO::getPreAmount, reqVO.getPreAmount())
|
||||
.eqIfPresent(ExtContractDO::getDesignFee, reqVO.getDesignFee())
|
||||
.eqIfPresent(ExtContractDO::getSurveyFees, reqVO.getSurveyFees())
|
||||
.eqIfPresent(ExtContractDO::getTestingFee, reqVO.getTestingFee())
|
||||
.eqIfPresent(ExtContractDO::getOtherFee, reqVO.getOtherFee())
|
||||
.eqIfPresent(ExtContractDO::getCountType, reqVO.getCountType())
|
||||
.eqIfPresent(ExtContractDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(ExtContractDO::getContractFileUrl, reqVO.getContractFileUrl())
|
||||
.eqIfPresent(ExtContractDO::getConstructionCost, reqVO.getConstructionCost())
|
||||
.eqIfPresent(ExtContractDO::getSource, reqVO.getSource())
|
||||
.eqIfPresent(ExtContractDO::getChargingStandard, reqVO.getChargingStandard())
|
||||
.eqIfPresent(ExtContractDO::getDiscount, reqVO.getDiscount())
|
||||
.eqIfPresent(ExtContractDO::getConsortium, reqVO.getConsortium())
|
||||
.eqIfPresent(ExtContractDO::getConsortiumCompany, reqVO.getConsortiumCompany())
|
||||
.eqIfPresent(ExtContractDO::getApprovedAmount, reqVO.getApprovedAmount())
|
||||
.eqIfPresent(ExtContractDO::getReviewFileUrl, reqVO.getReviewFileUrl())
|
||||
.betweenIfPresent(ExtContractDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(ExtContractDO::getContractId, reqVO.getContractId())
|
||||
|
||||
);
|
||||
.eqIfPresent(ExtContractDO::getContractId, reqVO.getContractId()));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.mysql.extcontracthistory;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontracthistory.ExtContractHistoryDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo.*;
|
||||
|
||||
/**
|
||||
* 外部合同 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExtContractHistoryMapper extends BaseMapperX<ExtContractHistoryDO> {
|
||||
|
||||
default PageResult<ExtContractHistoryDO> selectPage(ExtContractHistoryPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ExtContractHistoryDO>()
|
||||
.eqIfPresent(ExtContractHistoryDO::getProjectId, reqVO.getProjectId())
|
||||
.likeIfPresent(ExtContractHistoryDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ExtContractHistoryDO::getType, reqVO.getType())
|
||||
.eqIfPresent(ExtContractHistoryDO::getCustomerCompanyId, reqVO.getCustomerCompanyId())
|
||||
.eqIfPresent(ExtContractHistoryDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ExtContractHistoryDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
||||
.eqIfPresent(ExtContractHistoryDO::getProcessStatus, reqVO.getProcessStatus())
|
||||
.eqIfPresent(ExtContractHistoryDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(ExtContractHistoryDO::getExtContractId, reqVO.getExtContractId()));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.mysql.outscontract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 外包合同 Mapper
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@Mapper
|
||||
public interface OutsContractMapper extends BaseMapperX<OutsContractDO> {
|
||||
|
||||
default PageResult<OutsContractDO> selectPage(OutsContractPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<OutsContractDO>()
|
||||
.eqIfPresent(OutsContractDO::getProjectId, reqVO.getProjectId())
|
||||
.likeIfPresent(OutsContractDO::getName, reqVO.getName())
|
||||
.eqIfPresent(OutsContractDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(OutsContractDO::getCountType, reqVO.getCountType())
|
||||
.eqIfPresent(OutsContractDO::getAmount, reqVO.getAmount())
|
||||
.eqIfPresent(OutsContractDO::getCode, reqVO.getCode())
|
||||
.eqIfPresent(OutsContractDO::getMajor, reqVO.getMajor())
|
||||
.betweenIfPresent(OutsContractDO::getSigningTime, reqVO.getSigningTime())
|
||||
.eqIfPresent(OutsContractDO::getSettlementAmount, reqVO.getSettlementAmount())
|
||||
.eqIfPresent(OutsContractDO::getContractFileUrl, reqVO.getContractFileUrl())
|
||||
.orderByDesc(OutsContractDO::getId));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.mysql.outscontracthistory;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 外包合同历史 Mapper
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@Mapper
|
||||
public interface OutsContractHistoryMapper extends BaseMapperX<OutsContractHistoryDO> {
|
||||
|
||||
default PageResult<OutsContractHistoryDO> selectPage(OutsContractHistoryPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<OutsContractHistoryDO>()
|
||||
.eqIfPresent(OutsContractHistoryDO::getProjectId, reqVO.getProjectId())
|
||||
.likeIfPresent(OutsContractHistoryDO::getName, reqVO.getName())
|
||||
.eqIfPresent(OutsContractHistoryDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(OutsContractHistoryDO::getCountType, reqVO.getCountType())
|
||||
.eqIfPresent(OutsContractHistoryDO::getMajor, reqVO.getMajor())
|
||||
.eqIfPresent(OutsContractHistoryDO::getProcessStatus, reqVO.getProcessStatus())
|
||||
.eqIfPresent(OutsContractHistoryDO::getOutsContractId, reqVO.getOutsContractId())
|
||||
.eqIfPresent(OutsContractHistoryDO::getVersion, reqVO.getVersion()));
|
||||
}
|
||||
|
||||
}
|
@@ -2,10 +2,10 @@ package cn.iocoder.yudao.module.cms.service.contract;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.*;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 合同 Service 接口
|
||||
@@ -20,14 +20,14 @@ public interface ContractService {
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createContract(@Valid ContractSaveReqVO createReqVO);
|
||||
Long createContract(Long loginUserId,@Valid ContractSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新合同
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateContract(@Valid ContractSaveReqVO updateReqVO);
|
||||
void updateContract(Long loginUserId,@Valid ContractSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除合同
|
||||
@@ -53,9 +53,39 @@ public interface ContractService {
|
||||
PageResult<ContractRespVO> getContractPage(ContractPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得暂定结算金额
|
||||
* 通过id获得暂定结算金额
|
||||
* @param id 合同编号
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getProvisionalSettlement(Long id);
|
||||
BigDecimal getProvisionalSettlementById(Long id);
|
||||
|
||||
/**
|
||||
* 通过输入的合同获得暂定结算金额
|
||||
* @param contractSaveReqVO
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getProvisionalSettlement(ContractSaveReqVO contractSaveReqVO);
|
||||
|
||||
/**
|
||||
* 判断合同是否存在
|
||||
* @param id 合同id
|
||||
*/
|
||||
void validateContractExists(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询流程
|
||||
* @param id 合同id
|
||||
*/
|
||||
ContractProcessInstanceRespVO getContractProcess(Long id);
|
||||
|
||||
/**
|
||||
* 查询合同历史流程
|
||||
* @param projectId 项目id
|
||||
* @return
|
||||
*/
|
||||
List<ContractProcessInstanceRespVO> getHistoryContractProcess(Long projectId);
|
||||
|
||||
|
||||
|
||||
}
|
@@ -1,12 +1,16 @@
|
||||
package cn.iocoder.yudao.module.cms.service.contract;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceRespDTO;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmTaskRespDTO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractHistory.ContractHistoryDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.extContract.ExtContractMapper;
|
||||
import cn.iocoder.yudao.module.pms.api.ProjectApi;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.contractHistory.ContractHistoryMapper;
|
||||
import cn.iocoder.yudao.module.pms.api.project.ProjectApi;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -19,9 +23,11 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.USER_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 合同 Service 实现类
|
||||
@@ -32,7 +38,16 @@ import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||
@Validated
|
||||
public class ContractServiceImpl implements ContractService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ContractServiceImpl.class);
|
||||
/**
|
||||
* 合同立项审批流程定义
|
||||
*/
|
||||
public static final String PROCESS_KEY = "contract_init";
|
||||
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
public static String VERSION = "1";
|
||||
|
||||
@Resource
|
||||
private ContractMapper contractMapper;
|
||||
|
||||
@@ -40,22 +55,129 @@ public class ContractServiceImpl implements ContractService {
|
||||
private ProjectApi projectApi;
|
||||
|
||||
@Resource
|
||||
private ExtContractMapper extContractMapper;
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceApi processInstanceApi;
|
||||
|
||||
@Resource
|
||||
private ContractHistoryMapper contractHistoryMapper;
|
||||
|
||||
@Override
|
||||
public Long createContract(ContractSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
public Long createContract(Long loginUserId, ContractSaveReqVO createReqVO) {
|
||||
|
||||
if (loginUserId == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
if (userName == null) {
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
|
||||
|
||||
//校验,项目是否存在
|
||||
Long projectId = createReqVO.getProjectId();
|
||||
projectApi.validProjectExist(projectId);
|
||||
|
||||
//校验联表的字段是否和所联系的表内容相同
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||
|
||||
|
||||
//todo 待提取
|
||||
String code = createReqVO.getCode();
|
||||
String trackingDep = createReqVO.getTrackingDep();
|
||||
String projectManager = createReqVO.getProjectManager();
|
||||
String drawingCompany = createReqVO.getDrawingCompany();
|
||||
BigDecimal expectedContractAmount = createReqVO.getExpectedContractAmount();
|
||||
BigDecimal provisionalSettlement = createReqVO.getProvisionalSettlement();
|
||||
|
||||
//LocalDateTime reminderTime = createReqVO.getReminderTime();
|
||||
|
||||
if (!project.getCode().equals(code)) {
|
||||
throw exception(PARAM_ERROR);
|
||||
}
|
||||
if (!projectDetail.getTrackingDepName().equals(trackingDep)) {
|
||||
throw exception(PARAM_ERROR);
|
||||
}
|
||||
if (!projectDetail.getProjectManagerName().equals(projectManager)) {
|
||||
throw exception(PARAM_ERROR);
|
||||
}
|
||||
if (!project.getDrawingCompany().equals(drawingCompany)) {
|
||||
throw exception(PARAM_ERROR);
|
||||
}
|
||||
if (!Objects.equals(project.getContractAmount(), expectedContractAmount)) {
|
||||
throw exception(PARAM_ERROR);
|
||||
}
|
||||
if (!Objects.equals(provisionalSettlement, getProvisionalSettlement(createReqVO))) {
|
||||
throw exception(PARAM_ERROR);
|
||||
}
|
||||
|
||||
|
||||
ContractDO contract = BeanUtils.toBean(createReqVO, ContractDO.class);
|
||||
ContractRespVO contractResp = BeanUtils.toBean(contract, ContractRespVO.class);
|
||||
contract.setCreator(userName);
|
||||
contract.setUpdater(userName);
|
||||
|
||||
|
||||
//判断该合同是否已经存在,比较各个字段值是否完全一样
|
||||
//得到所有的合同?逐个比较?
|
||||
|
||||
|
||||
List<ContractDO> contractList = contractMapper.selectList("project_id", projectId);
|
||||
List<ContractRespVO> respVOList = BeanUtils.toBean(contractList, ContractRespVO.class);
|
||||
|
||||
for (ContractRespVO respVO : respVOList) {
|
||||
if (respVO.equals(contractResp)) {
|
||||
throw exception(CONTRACT_ALREADY_EXISTS);
|
||||
}
|
||||
}
|
||||
contractMapper.insert(contract);
|
||||
// 返回
|
||||
|
||||
|
||||
Long contractId = contract.getId();
|
||||
ContractHistoryDO contractHistory = BeanUtils.toBean(contract, ContractHistoryDO.class);
|
||||
|
||||
|
||||
// 启动流程,同时写入历史合同
|
||||
if (createReqVO.getId() == null) {
|
||||
String processInstanceId = processInstanceApi.createProcessInstance(loginUserId,
|
||||
new BpmProcessInstanceCreateReqDTO()
|
||||
.setProcessDefinitionKey(PROCESS_KEY).setBusinessKey(String.valueOf(contractId)));
|
||||
|
||||
// 写入工作流编号
|
||||
contractHistory.setProcessInstanceId(processInstanceId);
|
||||
contractHistory.setContractId(contractId);
|
||||
|
||||
Long count = contractHistoryMapper.selectCount("project_id", projectId);
|
||||
if (count < 1) {
|
||||
contractHistory.setVersion(VERSION);
|
||||
} else {
|
||||
contractHistory.setVersion(String.valueOf(count + 1));
|
||||
}
|
||||
|
||||
contractHistory.setProcessStatus("0");
|
||||
contractHistoryMapper.insert(contractHistory);
|
||||
}
|
||||
|
||||
|
||||
//返回
|
||||
return contract.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateContract(ContractSaveReqVO updateReqVO) {
|
||||
public void updateContract(Long loginUserId, ContractSaveReqVO updateReqVO) {
|
||||
//校验
|
||||
validateContractExists(updateReqVO.getId());
|
||||
projectApi.validProjectExist(updateReqVO.getProjectId());
|
||||
// 更新
|
||||
ContractDO updateObj = BeanUtils.toBean(updateReqVO, ContractDO.class);
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
if (userName == null) {
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
updateObj.setUpdater(userName);
|
||||
contractMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@@ -67,17 +189,24 @@ public class ContractServiceImpl implements ContractService {
|
||||
contractMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateContractExists(Long projectId) {
|
||||
if (contractMapper.selectById(projectId) == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractRespVO getContract(Long id) {
|
||||
//校验
|
||||
if (id == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
ContractDO contractDO = contractMapper.selectById(id);
|
||||
if (contractDO == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
Long projectId = contractDO.getProjectId();
|
||||
|
||||
if (projectId == null) {
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
ContractRespVO contractRespVO = BeanUtils.toBean(contractDO, ContractRespVO.class);
|
||||
|
||||
// 需要联表查询
|
||||
@@ -88,22 +217,22 @@ public class ContractServiceImpl implements ContractService {
|
||||
// 5.预计合同金额 pms_project 直接 √
|
||||
// 6.分包合同商议提示 √
|
||||
// 7.暂定结算数 √
|
||||
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
contractRespVO.setCode(project.getCode());
|
||||
contractRespVO.setDrawingCompany(project.getDrawingCompany());
|
||||
contractRespVO.setExpectedContractAmount(project.getContractAmount());
|
||||
|
||||
contractRespVO.setCode(project.getCode()); // 项目编号
|
||||
contractRespVO.setDrawingCompany(project.getDrawingCompany()); // 出图公司
|
||||
contractRespVO.setExpectedContractAmount(project.getContractAmount()); // 预计合同金额
|
||||
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||
contractRespVO.setTrackingDep(projectDetail.getTrackingDepName());
|
||||
contractRespVO.setProjectManager(projectDetail.getProjectManagerName());
|
||||
contractRespVO.setTrackingDep(projectDetail.getTrackingDepName()); // 主控部门
|
||||
contractRespVO.setProjectManager(projectDetail.getProjectManagerName()); // 项目经理
|
||||
|
||||
//分包合同商议提示
|
||||
// ExtContractDO extContractDO = extContractMapper.selectOne("project_id",projectId);
|
||||
// LocalDateTime reminderTime = extContractDO.getSubReminderTime();
|
||||
// contractRespVO.setSubReminderTime(reminderTime);
|
||||
//分包合同商议提示 TODO 待优化
|
||||
// ExtContractDO extContractDO = extContractMapper.selectOne("project_id", projectId);
|
||||
// LocalDateTime reminderTime = extContractDO.getReminderTime();
|
||||
contractRespVO.setReminderTime(null);
|
||||
|
||||
//暂定结算数
|
||||
BigDecimal provisionalSettlement = getProvisionalSettlement(id);
|
||||
BigDecimal provisionalSettlement = getProvisionalSettlementById(id);
|
||||
contractRespVO.setProvisionalSettlement(provisionalSettlement);
|
||||
|
||||
|
||||
@@ -112,6 +241,17 @@ public class ContractServiceImpl implements ContractService {
|
||||
|
||||
@Override
|
||||
public PageResult<ContractRespVO> getContractPage(ContractPageReqVO pageReqVO) {
|
||||
//校验
|
||||
if (pageReqVO == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
|
||||
Long projectId = pageReqVO.getProjectId();
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
if (project == null) {
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
PageResult<ContractDO> contractDOPageResult = contractMapper.selectPage(pageReqVO);
|
||||
List<ContractDO> contractDOList = contractDOPageResult.getList();
|
||||
List<ContractRespVO> contractRespVOList = new ArrayList<>();
|
||||
@@ -128,7 +268,7 @@ public class ContractServiceImpl implements ContractService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getProvisionalSettlement(Long id) {
|
||||
public BigDecimal getProvisionalSettlementById(Long id) {
|
||||
ContractDO contractDO = contractMapper.selectById(id);
|
||||
String type = contractDO.getCountType();
|
||||
BigDecimal amount = contractDO.getAmount();
|
||||
@@ -143,5 +283,70 @@ public class ContractServiceImpl implements ContractService {
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getProvisionalSettlement(ContractSaveReqVO contractSaveReqVO) {
|
||||
String type = contractSaveReqVO.getCountType();
|
||||
BigDecimal amount = contractSaveReqVO.getAmount();
|
||||
BigDecimal bigDecimal = new BigDecimal(String.valueOf(amount));
|
||||
BigDecimal mul = new BigDecimal("0.85");
|
||||
BigDecimal res = null;
|
||||
if ("费率合同".equals(type)) {
|
||||
res = bigDecimal.multiply(mul);
|
||||
} else if ("总价合同".equals(type)) {
|
||||
res = amount;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void validateContractExists(Long id) {
|
||||
if (contractMapper.selectById(id) == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractProcessInstanceRespVO getContractProcess(Long id) {
|
||||
validateContractExists(id);
|
||||
//去历史里面找
|
||||
ContractHistoryDO contractHistory = contractHistoryMapper.selectOne("contract_id", id);
|
||||
if (contractHistory == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
//拿到历史之后 找到process_instance_id 和 status
|
||||
String processInstanceId = contractHistory.getProcessInstanceId();
|
||||
String processStatus = contractHistory.getProcessStatus();
|
||||
//与当前流程里的进行比较
|
||||
String status = String.valueOf(processInstanceApi.getProcessInstance(processInstanceId).getStatus());
|
||||
|
||||
//如果不相等
|
||||
if (!status.equals(processStatus)){
|
||||
//更新当前合同对应历史表里面的状态
|
||||
contractHistory.setProcessStatus(status);
|
||||
contractHistoryMapper.updateById(contractHistory);
|
||||
}
|
||||
//返回给前端必要的数据 当前流程里面对应的数据
|
||||
BpmProcessInstanceRespDTO processInstance = processInstanceApi.getProcessInstance(processInstanceId);
|
||||
List<BpmTaskRespDTO> tasks = processInstanceApi.getTask(processInstanceId);
|
||||
List<BpmProcessInstanceRespDTO.Task> taskList = BeanUtils.toBean(tasks, BpmProcessInstanceRespDTO.Task.class);
|
||||
processInstance.setTasks(taskList);
|
||||
|
||||
return BeanUtils.toBean(processInstance, ContractProcessInstanceRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ContractProcessInstanceRespVO> getHistoryContractProcess(Long projectId) {
|
||||
List<ContractHistoryDO> projectList = contractHistoryMapper.selectList("project_id", projectId);
|
||||
List<ContractProcessInstanceRespVO> contractProcessInstanceRespVOList = new ArrayList<>();
|
||||
for (ContractHistoryDO contractHistoryDO : projectList) {
|
||||
Long id = contractHistoryDO.getId();
|
||||
ContractProcessInstanceRespVO contractProcess = getContractProcess(id);
|
||||
contractProcessInstanceRespVOList.add(contractProcess);
|
||||
}
|
||||
|
||||
return contractProcessInstanceRespVOList;
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -12,27 +12,12 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
*/
|
||||
public interface ContractHistoryService {
|
||||
|
||||
/**
|
||||
* 创建历史合同
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createContractHistory(@Valid ContractHistorySaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新历史合同
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateContractHistory(@Valid ContractHistorySaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除历史合同
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteContractHistory(Long id);
|
||||
void updateContractHistory(Long loginUserId,@Valid ContractHistorySaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 获得历史合同
|
||||
@@ -40,7 +25,7 @@ public interface ContractHistoryService {
|
||||
* @param contractId 现有合同编号
|
||||
* @return 历史合同
|
||||
*/
|
||||
ContractHistoryDO getContractHistory(Long contractId);
|
||||
ContractHistoryRespVO getContractHistory(Long contractId);
|
||||
|
||||
/**
|
||||
* 获得历史合同分页
|
||||
@@ -48,6 +33,6 @@ public interface ContractHistoryService {
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 历史合同分页
|
||||
*/
|
||||
PageResult<ContractHistoryDO> getContractHistoryPage(ContractHistoryPageReqVO pageReqVO);
|
||||
PageResult<ContractHistoryRespVO> getContractHistoryPage(ContractHistoryPageReqVO pageReqVO);
|
||||
|
||||
}
|
@@ -1,19 +1,29 @@
|
||||
package cn.iocoder.yudao.module.cms.service.contractHistory;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
|
||||
import cn.iocoder.yudao.module.cms.enums.ContractStatusEnum;
|
||||
import cn.iocoder.yudao.module.cms.enums.ContractTypeEnum;
|
||||
import cn.iocoder.yudao.module.cms.service.contract.ContractService;
|
||||
import cn.iocoder.yudao.module.pms.api.project.ProjectApi;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo.*;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractHistory.ContractHistoryDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.contractHistory.ContractHistoryMapper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.USER_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 历史合同 Service 实现类
|
||||
@@ -27,47 +37,130 @@ public class ContractHistoryServiceImpl implements cn.iocoder.yudao.module.cms.s
|
||||
@Resource
|
||||
private ContractHistoryMapper contractHistoryMapper;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
|
||||
@Resource
|
||||
private ContractService contractService;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Long createContractHistory(ContractHistorySaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ContractHistoryDO contractHistory = BeanUtils.toBean(createReqVO, ContractHistoryDO.class);
|
||||
contractHistoryMapper.insert(contractHistory);
|
||||
// 返回
|
||||
return contractHistory.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateContractHistory(ContractHistorySaveReqVO updateReqVO) {
|
||||
public void updateContractHistory(Long loginUserId,ContractHistorySaveReqVO updateReqVO) {
|
||||
//校验
|
||||
Long id = updateReqVO.getId();
|
||||
validateContractHistoryExists(id);
|
||||
if (loginUserId == null){
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
Long projectId = updateReqVO.getProjectId();
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
if (project == null){
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
// 更新
|
||||
ContractHistoryDO updateObj = BeanUtils.toBean(updateReqVO, ContractHistoryDO.class);
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
updateObj.setUpdater(userName);
|
||||
contractHistoryMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void deleteContractHistory(Long id) {
|
||||
// 校验存在
|
||||
validateContractHistoryExists(id);
|
||||
// 删除
|
||||
contractHistoryMapper.deleteById(id);
|
||||
public ContractHistoryRespVO getContractHistory(Long id) {
|
||||
//校验
|
||||
if (id == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
ContractHistoryDO contractHistoryDO = contractHistoryMapper.selectById(id);
|
||||
if (contractHistoryDO == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
Long projectId = contractHistoryDO.getProjectId();
|
||||
|
||||
if (projectId == null) {
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
ContractHistoryRespVO contractHistoryRespVO = BeanUtils.toBean(contractHistoryDO, ContractHistoryRespVO.class);
|
||||
|
||||
// 需要联表查询
|
||||
// 1.项目编号 pms_project 直接 √
|
||||
// 2.主控部门(跟踪部门) pms_project找到的是id 需要联表 √
|
||||
// 3.项目经理 pms_project找到的是id 需要联表 √
|
||||
// 4.出图公司 pms_project 直接 √
|
||||
// 5.预计合同金额 pms_project 直接 √
|
||||
// 6.分包合同商议提示 √
|
||||
// 7.暂定结算数 √
|
||||
|
||||
// TODO 枚举优化
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
contractHistoryRespVO.setCode(project.getCode());
|
||||
contractHistoryRespVO.setDrawingCompany(project.getDrawingCompany());
|
||||
contractHistoryRespVO.setExpectedContractAmount(project.getContractAmount());
|
||||
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||
contractHistoryRespVO.setTrackingDep(projectDetail.getTrackingDepName());
|
||||
contractHistoryRespVO.setProjectManager(projectDetail.getProjectManagerName());
|
||||
|
||||
contractHistoryRespVO.setType(ContractTypeEnum.getNoByCode(contractHistoryRespVO.getType()));
|
||||
contractHistoryRespVO.setStatus(ContractStatusEnum.getNoByCode(contractHistoryRespVO.getStatus()));
|
||||
contractHistoryRespVO.setCountType(ContractStatusEnum.getNoByCode(contractHistoryRespVO.getCountType()));
|
||||
contractHistoryRespVO.setSource(ContractStatusEnum.getNoByCode(contractHistoryRespVO.getSource()));
|
||||
|
||||
//分包合同商议提示 TODO 待优化
|
||||
// ExtContractDO extContractDO = extContractMapper.selectOne("project_id", projectId);
|
||||
// LocalDateTime reminderTime = extContractDO.getReminderTime();
|
||||
contractHistoryRespVO.setReminderTime(null);
|
||||
|
||||
//暂定结算数
|
||||
BigDecimal provisionalSettlement =contractService.getProvisionalSettlementById(id);
|
||||
contractHistoryRespVO.setProvisionalSettlement(provisionalSettlement);
|
||||
|
||||
|
||||
return contractHistoryRespVO;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageResult<ContractHistoryRespVO> getContractHistoryPage(ContractHistoryPageReqVO pageReqVO) {
|
||||
//校验
|
||||
if (pageReqVO == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
|
||||
Long projectId = pageReqVO.getProjectId();
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
if (project == null) {
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
PageResult<ContractHistoryDO> contractHistoryDOPageResult = contractHistoryMapper.selectPage(pageReqVO);
|
||||
List<ContractHistoryDO> pageResultList = contractHistoryDOPageResult.getList();
|
||||
List<ContractHistoryRespVO> contractHistoryRespVOS = new ArrayList<>();
|
||||
|
||||
|
||||
for (ContractHistoryDO contractHistoryDO : pageResultList) {
|
||||
Long id = contractHistoryDO.getId();
|
||||
ContractHistoryRespVO contractHistory = getContractHistory(id);
|
||||
contractHistoryRespVOS.add(contractHistory);
|
||||
}
|
||||
|
||||
PageResult<ContractHistoryRespVO> pageResult = new PageResult<>();
|
||||
pageResult.setList(contractHistoryRespVOS);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
|
||||
private void validateContractHistoryExists(Long id) {
|
||||
if (contractHistoryMapper.selectById(id) == null) {
|
||||
throw exception(CONTRACT_HISTORY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractHistoryDO getContractHistory(Long id) {
|
||||
return contractHistoryMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageResult<ContractHistoryDO> getContractHistoryPage(ContractHistoryPageReqVO pageReqVO) {
|
||||
return contractHistoryMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.cms.service.contractouts;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsSaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* 外包合同关联 Service 接口
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
public interface ContractOutsService {
|
||||
|
||||
/**
|
||||
* 创建外包合同关联
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createContractOuts(Long loginUserId ,@Valid ContractOutsSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新外包合同关联
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateContractOuts(Long loginUserId,@Valid ContractOutsSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除外包合同关联
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteContractOuts(Long id);
|
||||
|
||||
/**
|
||||
* 获得外包合同关联
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 外包合同关联
|
||||
*/
|
||||
ContractOutsDO getContractOuts(Long id);
|
||||
|
||||
/**
|
||||
* 获得外包合同关联分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 外包合同关联分页
|
||||
*/
|
||||
PageResult<ContractOutsDO> getContractOutsPage(ContractOutsPageReqVO pageReqVO);
|
||||
|
||||
}
|
@@ -0,0 +1,116 @@
|
||||
package cn.iocoder.yudao.module.cms.service.contractouts;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsSaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.contractouts.ContractOutsMapper;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.USER_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 外包合同关联 Service 实现类
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ContractOutsServiceImpl implements ContractOutsService {
|
||||
|
||||
@Resource
|
||||
private ContractOutsMapper contractOutsMapper;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Override
|
||||
public Long createContractOuts(Long loginUserId, ContractOutsSaveReqVO createReqVO) {
|
||||
ContractOutsDO outsDO = BeanUtils.toBean(createReqVO, ContractOutsDO.class);
|
||||
Long contractId = createReqVO.getContractId();
|
||||
Long outsContractId = createReqVO.getOutsContractId();
|
||||
if (contractId == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
if (outsContractId == null) {
|
||||
throw exception(CONTRACT_OUTS_NOT_EXISTS);
|
||||
}
|
||||
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
//用户不存在
|
||||
if (userName == null || userName.isEmpty()) {
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
//如果这条记录不存在,则创建者就是登陆者,如果存在,只更新更新者,创建者不再改变
|
||||
QueryWrapper<ContractOutsDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("contract_id", contractId);
|
||||
queryWrapper.eq("outs_contract_id", outsContractId);
|
||||
Long count = contractOutsMapper.selectCount(queryWrapper);
|
||||
if (count >= 1) {
|
||||
throw exception(CONTRACT_OUTS_ALREADY_EXISTS);
|
||||
}
|
||||
ContractOutsDO contractOutsDO = contractOutsMapper.selectOne(queryWrapper);
|
||||
|
||||
if (contractOutsDO == null) {
|
||||
outsDO.setCreator(userName);
|
||||
outsDO.setUpdater(userName);
|
||||
}
|
||||
|
||||
// 返回
|
||||
return (long) contractOutsMapper.insert(outsDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateContractOuts(Long loginUserId,ContractOutsSaveReqVO updateReqVO) {
|
||||
|
||||
// 校验存在
|
||||
validateContractOutsExists(updateReqVO.getId());
|
||||
if (loginUserId == null){
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
// 更新
|
||||
ContractOutsDO updateObj = BeanUtils.toBean(updateReqVO, ContractOutsDO.class);
|
||||
//校验
|
||||
ContractOutsDO contractOutsDO = contractOutsMapper.selectById(updateObj.getId());
|
||||
if (contractOutsDO == null) {
|
||||
throw exception(CONTRACT_OUTS_NOT_EXISTS);
|
||||
}
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
updateObj.setUpdater(userName);
|
||||
|
||||
contractOutsMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteContractOuts(Long id) {
|
||||
// 校验存在
|
||||
validateContractOutsExists(id);
|
||||
// 删除
|
||||
contractOutsMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateContractOutsExists(Long id) {
|
||||
if (contractOutsMapper.selectById(id) == null) {
|
||||
throw exception(CONTRACT_OUTS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractOutsDO getContractOuts(Long id) {
|
||||
return contractOutsMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ContractOutsDO> getContractOutsPage(ContractOutsPageReqVO pageReqVO) {
|
||||
return contractOutsMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@@ -3,13 +3,10 @@ package cn.iocoder.yudao.module.cms.service.customerCompany;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.cms.service.extcontract;
|
||||
package cn.iocoder.yudao.module.cms.service.extContract;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractProcessInstanceRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractSaveReqVO;
|
||||
@@ -8,6 +9,7 @@ import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 外部合同 Service 接口
|
||||
@@ -22,14 +24,14 @@ public interface ExtContractService {
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createExtContract(@Valid ExtContractSaveReqVO createReqVO);
|
||||
Long createExtContract(Long loginUserId,@Valid ExtContractSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新外部合同
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateExtContract(@Valid ExtContractSaveReqVO updateReqVO);
|
||||
void updateExtContract(Long loginUserId,@Valid ExtContractSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除外部合同
|
||||
@@ -56,8 +58,30 @@ public interface ExtContractService {
|
||||
|
||||
/**
|
||||
* 合同总金额
|
||||
* @param id
|
||||
* @param id 通过id计算
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getContractAmount(Long id);
|
||||
BigDecimal getContractAmountById(Long id);
|
||||
/**
|
||||
* 合同总金额
|
||||
* @param createReqVO 通过对象计算
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getContractAmount(ExtContractSaveReqVO createReqVO);
|
||||
|
||||
|
||||
/**
|
||||
* 查询流程
|
||||
* @param id 合同id
|
||||
*/
|
||||
ContractProcessInstanceRespVO getContractProcess(Long id);
|
||||
|
||||
/**
|
||||
* 查询历史外部合同流程
|
||||
* @param projectId 项目id
|
||||
* @return
|
||||
*/
|
||||
List<ContractProcessInstanceRespVO> getHistoryContractProcess(Long projectId);
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,374 @@
|
||||
package cn.iocoder.yudao.module.cms.service.extContract;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceRespDTO;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmTaskRespDTO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractProcessInstanceRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractSaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractHistory.ContractHistoryDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontracthistory.ExtContractHistoryDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.extContract.ExtContractMapper;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.extcontracthistory.ExtContractHistoryMapper;
|
||||
import cn.iocoder.yudao.module.cms.enums.ChargingStandardEnum;
|
||||
import cn.iocoder.yudao.module.cms.enums.ContractStatusEnum;
|
||||
import cn.iocoder.yudao.module.cms.enums.ContractTypeEnum;
|
||||
import cn.iocoder.yudao.module.pms.api.project.ProjectApi;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.USER_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 外部合同 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ExtContractServiceImpl implements ExtContractService {
|
||||
|
||||
/**
|
||||
* 外部合同立项审批流程定义
|
||||
*/
|
||||
public static final String PROCESS_KEY = "ext_contract_init";
|
||||
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
public static String VERSION = "1";
|
||||
|
||||
@Resource
|
||||
private ExtContractMapper extContractMapper;
|
||||
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
|
||||
@Resource
|
||||
private CustomerCompanyMapper customerCompanyMapper;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceApi processInstanceApi;
|
||||
|
||||
@Resource
|
||||
private ExtContractHistoryMapper extContractHistoryMapper;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Long createExtContract(Long loginUserId, ExtContractSaveReqVO createReqVO) {
|
||||
|
||||
|
||||
if (createReqVO == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
if (loginUserId == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
if (userName == null) {
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
|
||||
ExtContractDO extContract = BeanUtils.toBean(createReqVO, ExtContractDO.class);
|
||||
//校验
|
||||
Long projectId = extContract.getProjectId();
|
||||
projectApi.validProjectExist(projectId);
|
||||
|
||||
|
||||
//校验联表的字段是否和所联系的表内容相同
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||
|
||||
// 需要联表查询
|
||||
// 1.项目编号 pms_project 直接 √
|
||||
// 2.主控部门(跟踪部门) pms_project找到的是id 需要联表 √
|
||||
// 3.项目经理 pms_project找到的是id 需要联表 √
|
||||
// 4.客户公司名称 pms_project 联表 √
|
||||
// 5.合同总金额 √
|
||||
// 6.合同商议提示(和分包提示不一样)√
|
||||
|
||||
//todo 待提取 枚举优化
|
||||
String code = createReqVO.getCode();
|
||||
String trackingDep = createReqVO.getTrackingDep();
|
||||
String projectManager = createReqVO.getProjectManager();
|
||||
String customerCompanyName = createReqVO.getCustomerCompanyName();
|
||||
//LocalDateTime exReminderTime = createReqVO.getExReminderTime();
|
||||
BigDecimal amount = createReqVO.getAmount();
|
||||
|
||||
|
||||
|
||||
|
||||
if (!project.getCode().equals(code)){
|
||||
throw exception(PARAM_ERROR);
|
||||
}
|
||||
if (!projectDetail.getTrackingDepName().equals(trackingDep)){
|
||||
throw exception(PARAM_ERROR);
|
||||
}
|
||||
if (!projectDetail.getProjectManagerName().equals(projectManager)){
|
||||
throw exception(PARAM_ERROR);
|
||||
}
|
||||
String name = customerCompanyMapper.selectById(createReqVO.getCustomerCompanyId()).getName();
|
||||
if (!name.equals(customerCompanyName)){
|
||||
throw exception(PARAM_ERROR);
|
||||
}
|
||||
if (!Objects.equals(amount, getContractAmount(createReqVO))){
|
||||
throw exception(PARAM_ERROR);
|
||||
}
|
||||
|
||||
|
||||
ExtContractDO extContractDO = BeanUtils.toBean(createReqVO, ExtContractDO.class);
|
||||
ExtContractRespVO contractRespVO = BeanUtils.toBean(extContractDO, ExtContractRespVO.class);
|
||||
extContractDO.setCreator(userName);
|
||||
extContractDO.setUpdater(userName);
|
||||
|
||||
|
||||
|
||||
//判断该合同是否已经存在,比较各个字段值是否完全一样
|
||||
//得到所有的合同?逐个比较?
|
||||
|
||||
|
||||
List<ExtContractDO> extContractList = extContractMapper.selectList("project_id",projectId);
|
||||
List<ExtContractRespVO> respVOList = BeanUtils.toBean(extContractList, ExtContractRespVO.class);
|
||||
|
||||
for (ExtContractRespVO respVO : respVOList) {
|
||||
if (respVO.equals(contractRespVO)){
|
||||
throw exception(CONTRACT_ALREADY_EXISTS);
|
||||
}
|
||||
}
|
||||
extContractMapper.insert(extContractDO);
|
||||
|
||||
|
||||
Long extContractId = extContractDO.getId();
|
||||
ExtContractHistoryDO extContractHistory = BeanUtils.toBean(extContractDO, ExtContractHistoryDO.class);
|
||||
|
||||
|
||||
// 启动流程,同时写入历史合同
|
||||
if (createReqVO.getId() == null) {
|
||||
String processInstanceId = processInstanceApi.createProcessInstance(loginUserId,
|
||||
new BpmProcessInstanceCreateReqDTO()
|
||||
.setProcessDefinitionKey(PROCESS_KEY).setBusinessKey(String.valueOf(extContractId)));
|
||||
|
||||
// 写入工作流编号
|
||||
extContractHistory.setProcessInstanceId(processInstanceId);
|
||||
extContractHistory.setExtContractId(extContractId);
|
||||
|
||||
Long count = extContractHistoryMapper.selectCount("project_id", projectId);
|
||||
if (count < 1) {
|
||||
extContractHistory.setVersion(VERSION);
|
||||
} else {
|
||||
extContractHistory.setVersion(String.valueOf(count+1));
|
||||
}
|
||||
|
||||
extContractHistory.setProcessStatus("0");
|
||||
extContractHistoryMapper.insert(extContractHistory);
|
||||
}
|
||||
|
||||
|
||||
//返回
|
||||
return extContract.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExtContract(Long loginUserId, ExtContractSaveReqVO updateReqVO) {
|
||||
//校验
|
||||
if (updateReqVO == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
|
||||
validateExtContractExists(updateReqVO.getId());
|
||||
projectApi.validProjectExist(updateReqVO.getProjectId());
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
if (userName == null) {
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
// 更新
|
||||
ExtContractDO updateObj = BeanUtils.toBean(updateReqVO, ExtContractDO.class);
|
||||
updateObj.setUpdater(userName);
|
||||
extContractMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteExtContract(Long id) {
|
||||
// 校验存在
|
||||
validateExtContractExists(id);
|
||||
// 删除
|
||||
extContractMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
// 需要联表查询
|
||||
// 1.项目编号 pms_project 直接 √
|
||||
// 2.主控部门(跟踪部门) pms_project找到的是id 需要联表 √
|
||||
// 3.项目经理 pms_project找到的是id 需要联表 √
|
||||
// 4.客户公司名称 pms_project 联表 √
|
||||
// 5.合同总金额 √
|
||||
// 6.合同商议提示(和分包提示不一样)√
|
||||
@Override
|
||||
public ExtContractRespVO getExtContract(Long id) {
|
||||
//校验
|
||||
if (id == null) {
|
||||
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
ExtContractDO extContractDO = extContractMapper.selectById(id);
|
||||
if (extContractDO == null) {
|
||||
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
Long projectId = extContractDO.getProjectId();
|
||||
if (projectApi.getProject(projectId) == null) {
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
Long customerCompanyId = extContractDO.getCustomerCompanyId();
|
||||
ExtContractRespVO extContractRespVO = BeanUtils.toBean(extContractDO, ExtContractRespVO.class);
|
||||
|
||||
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
extContractRespVO.setCode(project.getCode());
|
||||
|
||||
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||
extContractRespVO.setTrackingDep(projectDetail.getTrackingDepName());
|
||||
extContractRespVO.setProjectManager(projectDetail.getProjectManagerName());
|
||||
|
||||
//用客户公司id查询
|
||||
CustomerCompanyDO customerCompanyDO = customerCompanyMapper.selectById(customerCompanyId);
|
||||
String name = customerCompanyDO.getName();
|
||||
extContractRespVO.setCustomerCompanyName(name);
|
||||
|
||||
|
||||
//合同总金额
|
||||
|
||||
BigDecimal contractAmount = getContractAmountById(id);
|
||||
extContractRespVO.setAmount(contractAmount);
|
||||
|
||||
//合同商议提示 // TODO 待优化
|
||||
extContractRespVO.setExReminderTime(null);
|
||||
|
||||
extContractRespVO.setType(ContractTypeEnum.getNoByCode(extContractRespVO.getType()));
|
||||
extContractRespVO.setStatus(ContractStatusEnum.getNoByCode(extContractRespVO.getStatus()));
|
||||
extContractRespVO.setCountType(ContractStatusEnum.getNoByCode(extContractRespVO.getCountType()));
|
||||
extContractRespVO.setSource(ContractStatusEnum.getNoByCode(extContractRespVO.getSource()));
|
||||
extContractRespVO.setChargingStandard(ChargingStandardEnum.getNoByCode(extContractRespVO.getChargingStandard()));
|
||||
|
||||
|
||||
return extContractRespVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ExtContractRespVO> getExtContractPage(ExtContractPageReqVO pageReqVO) {
|
||||
if (pageReqVO == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
|
||||
PageResult<ExtContractDO> extContractDOPageResult = extContractMapper.selectPage(pageReqVO);
|
||||
List<ExtContractDO> excontractDOList = extContractDOPageResult.getList();
|
||||
List<ExtContractRespVO> extContractRespVOList = new ArrayList<>();
|
||||
|
||||
|
||||
for (ExtContractDO extContractDO : excontractDOList) {
|
||||
Long id = extContractDO.getId();
|
||||
ExtContractRespVO extContractRespVO = getExtContract(id);
|
||||
extContractRespVOList.add(extContractRespVO);
|
||||
}
|
||||
PageResult<ExtContractRespVO> pageResult = new PageResult<>();
|
||||
pageResult.setList(extContractRespVOList);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getContractAmountById(Long id) {
|
||||
//前期+设计+地勘+其他+检测
|
||||
ExtContractDO extContract = extContractMapper.selectById(id);
|
||||
BigDecimal preAmount = new BigDecimal(String.valueOf(extContract.getPreAmount()));
|
||||
BigDecimal designFee = new BigDecimal(String.valueOf(extContract.getDesignFee()));
|
||||
BigDecimal surveyFees = new BigDecimal(String.valueOf(extContract.getSurveyFees()));
|
||||
BigDecimal testingFee = new BigDecimal(String.valueOf(extContract.getTestingFee()));
|
||||
BigDecimal other = new BigDecimal(extContract.getOtherFee());
|
||||
return preAmount.add(designFee).add(surveyFees).add(testingFee).add(other);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getContractAmount(ExtContractSaveReqVO extContractSaveReqVO) {
|
||||
//前期+设计+地勘+其他+检测
|
||||
BigDecimal preAmount = new BigDecimal(String.valueOf(extContractSaveReqVO.getPreAmount()));
|
||||
BigDecimal designFee = new BigDecimal(String.valueOf(extContractSaveReqVO.getDesignFee()));
|
||||
BigDecimal surveyFees = new BigDecimal(String.valueOf(extContractSaveReqVO.getSurveyFees()));
|
||||
BigDecimal testingFee = new BigDecimal(String.valueOf(extContractSaveReqVO.getTestingFee()));
|
||||
BigDecimal other = new BigDecimal(extContractSaveReqVO.getOtherFee());
|
||||
return preAmount.add(designFee).add(surveyFees).add(testingFee).add(other);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractProcessInstanceRespVO getContractProcess(Long id) {
|
||||
validateExtContractExists(id);
|
||||
//去历史里面找
|
||||
ExtContractHistoryDO extContractHistoryDO = extContractHistoryMapper.selectOne("ext_contract_id", id);
|
||||
if (extContractHistoryDO == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
//拿到历史之后 找到process_instance_id 和 status
|
||||
String processInstanceId = extContractHistoryDO.getProcessInstanceId();
|
||||
String processStatus = extContractHistoryDO.getProcessStatus();
|
||||
//与当前流程里的进行比较
|
||||
String status = String.valueOf(processInstanceApi.getProcessInstance(processInstanceId).getStatus());
|
||||
|
||||
//如果不相等
|
||||
if (!status.equals(processStatus)){
|
||||
//更新当前合同对应历史表里面的状态
|
||||
extContractHistoryDO.setProcessStatus(status);
|
||||
extContractHistoryMapper.updateById(extContractHistoryDO);
|
||||
}
|
||||
//返回给前端必要的数据 当前流程里面对应的数据
|
||||
BpmProcessInstanceRespDTO processInstance = processInstanceApi.getProcessInstance(processInstanceId);
|
||||
List<BpmTaskRespDTO> tasks = processInstanceApi.getTask(processInstanceId);
|
||||
List<BpmProcessInstanceRespDTO.Task> taskList = BeanUtils.toBean(tasks, BpmProcessInstanceRespDTO.Task.class);
|
||||
processInstance.setTasks(taskList);
|
||||
|
||||
return BeanUtils.toBean(processInstance, ContractProcessInstanceRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ContractProcessInstanceRespVO> getHistoryContractProcess(Long projectId) {
|
||||
List<ExtContractHistoryDO> contractHistoryList = extContractHistoryMapper.selectList("project_id", projectId);
|
||||
List<ContractProcessInstanceRespVO> contractProcessInstanceRespVOList = new ArrayList<>();
|
||||
for (ExtContractHistoryDO contractHistory : contractHistoryList) {
|
||||
Long id = contractHistory.getId();
|
||||
ContractProcessInstanceRespVO contractProcess = getContractProcess(id);
|
||||
contractProcessInstanceRespVOList.add(contractProcess);
|
||||
}
|
||||
|
||||
return contractProcessInstanceRespVOList;
|
||||
}
|
||||
|
||||
|
||||
private void validateExtContractExists(Long id) {
|
||||
if (extContractMapper.selectById(id) == null) {
|
||||
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -1,145 +0,0 @@
|
||||
package cn.iocoder.yudao.module.cms.service.extcontract;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractSaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.extContract.ExtContractDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.extContract.ExtContractMapper;
|
||||
import cn.iocoder.yudao.module.pms.api.ProjectApi;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.EXT_CONTRACT_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 外部合同 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ExtContractServiceImpl implements ExtContractService {
|
||||
|
||||
@Resource
|
||||
private ExtContractMapper extContractMapper;
|
||||
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
|
||||
@Resource
|
||||
private CustomerCompanyMapper customerCompanyMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public Long createExtContract(ExtContractSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ExtContractDO extContract = BeanUtils.toBean(createReqVO, ExtContractDO.class);
|
||||
extContractMapper.insert(extContract);
|
||||
// 返回
|
||||
return extContract.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExtContract(ExtContractSaveReqVO updateReqVO) {
|
||||
//校验
|
||||
Long id = updateReqVO.getId();
|
||||
validateExtContractExists(id);
|
||||
// 更新
|
||||
ExtContractDO updateObj = BeanUtils.toBean(updateReqVO, ExtContractDO.class);
|
||||
extContractMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteExtContract(Long id) {
|
||||
// 校验存在
|
||||
validateExtContractExists(id);
|
||||
// 删除
|
||||
extContractMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateExtContractExists(Long id) {
|
||||
if (extContractMapper.selectById(id) == null) {
|
||||
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
// 需要联表查询
|
||||
// 1.项目编号 pms_project 直接 √
|
||||
// 2.主控部门(跟踪部门) pms_project找到的是id 需要联表 √
|
||||
// 3.项目经理 pms_project找到的是id 需要联表 √
|
||||
// 4.客户公司名称 pms_project 联表 √
|
||||
// 5.合同总金额 √
|
||||
// 6.合同商议提示(和分包提示不一样)
|
||||
@Override
|
||||
public ExtContractRespVO getExtContract(Long id) {
|
||||
ExtContractDO extContractDO = extContractMapper.selectById(id);
|
||||
Long projectId = extContractDO.getProjectId();
|
||||
Long customerCompanyId = extContractDO.getCustomerCompanyId();
|
||||
ExtContractRespVO extContractRespVO = BeanUtils.toBean(extContractDO, ExtContractRespVO.class);
|
||||
|
||||
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
extContractRespVO.setCode(project.getCode());
|
||||
|
||||
|
||||
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||
extContractRespVO.setTrackingDep(projectDetail.getTrackingDepName());
|
||||
extContractRespVO.setProjectManager(projectDetail.getProjectManagerName());
|
||||
|
||||
//用客户公司id查询
|
||||
CustomerCompanyDO customerCompanyDO = customerCompanyMapper.selectById(customerCompanyId);
|
||||
String name = customerCompanyDO.getName();
|
||||
extContractRespVO.setCustomerCompanyName(name);
|
||||
|
||||
|
||||
//合同总金额
|
||||
BigDecimal contractAmount = getContractAmount(id);
|
||||
extContractRespVO.setAmount(contractAmount);
|
||||
|
||||
|
||||
return extContractRespVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ExtContractRespVO> getExtContractPage(ExtContractPageReqVO pageReqVO) {
|
||||
|
||||
PageResult<ExtContractDO> extContractDOPageResult = extContractMapper.selectPage(pageReqVO);
|
||||
List<ExtContractDO> excontractDOList = extContractDOPageResult.getList();
|
||||
List<ExtContractRespVO> extContractRespVOList = new ArrayList<>();
|
||||
|
||||
|
||||
for (ExtContractDO extContractDO : excontractDOList) {
|
||||
Long id = extContractDO.getId();
|
||||
ExtContractRespVO extContractRespVO = getExtContract(id);
|
||||
extContractRespVOList.add(extContractRespVO);
|
||||
}
|
||||
PageResult<ExtContractRespVO> pageResult = new PageResult<>();
|
||||
pageResult.setList(extContractRespVOList);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getContractAmount(Long id) {
|
||||
//前期+设计+地勘+其他+检测
|
||||
ExtContractDO extContract = extContractMapper.selectById(id);
|
||||
BigDecimal preAmount = new BigDecimal(String.valueOf(extContract.getPreAmount()));
|
||||
BigDecimal designFee = new BigDecimal(String.valueOf(extContract.getDesignFee()));
|
||||
BigDecimal surveyFees = new BigDecimal(String.valueOf(extContract.getSurveyFees()));
|
||||
BigDecimal testingFee = new BigDecimal(String.valueOf(extContract.getTestingFee()));
|
||||
BigDecimal other = new BigDecimal(extContract.getOtherFee());
|
||||
return preAmount.add(designFee).add(surveyFees).add(testingFee).add(other);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.cms.service.extcontracthistory;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 外部合同历史历史 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface ExtContractHistoryService {
|
||||
/**
|
||||
* 更新外部合同历史历史
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateExtContractHistory(Long loginUserId,@Valid ExtContractHistorySaveReqVO updateReqVO);
|
||||
/**
|
||||
* 获得外部合同历史历史
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 外部合同历史历史
|
||||
*/
|
||||
ExtContractHistoryRespVO getExtContractHistory(Long id);
|
||||
|
||||
/**
|
||||
* 获得外部合同历史历史分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 外部合同历史历史分页
|
||||
*/
|
||||
PageResult<ExtContractHistoryRespVO> getExtContractHistoryPage(ExtContractHistoryPageReqVO pageReqVO);
|
||||
|
||||
}
|
@@ -0,0 +1,165 @@
|
||||
package cn.iocoder.yudao.module.cms.service.extcontracthistory;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper;
|
||||
import cn.iocoder.yudao.module.cms.enums.ChargingStandardEnum;
|
||||
import cn.iocoder.yudao.module.cms.enums.ContractStatusEnum;
|
||||
import cn.iocoder.yudao.module.cms.enums.ContractTypeEnum;
|
||||
import cn.iocoder.yudao.module.cms.service.extContract.ExtContractService;
|
||||
import cn.iocoder.yudao.module.pms.api.project.ProjectApi;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo.*;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontracthistory.ExtContractHistoryDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.extcontracthistory.ExtContractHistoryMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.USER_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 外部合同历史 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ExtContractHistoryServiceImpl implements ExtContractHistoryService {
|
||||
|
||||
@Resource
|
||||
private ExtContractHistoryMapper extContractHistoryMapper;
|
||||
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Resource
|
||||
private CustomerCompanyMapper customerCompanyMapper;
|
||||
|
||||
@Resource
|
||||
private ExtContractService extContractService;
|
||||
|
||||
@Override
|
||||
public void updateExtContractHistory(Long loginUserId,ExtContractHistorySaveReqVO updateReqVO) {
|
||||
//校验
|
||||
if (updateReqVO == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
|
||||
validateExtContractHistoryExists(updateReqVO.getId());
|
||||
projectApi.validProjectExist(updateReqVO.getProjectId());
|
||||
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);
|
||||
updateObj.setUpdater(userName);
|
||||
extContractHistoryMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExtContractHistoryRespVO getExtContractHistory(Long id) {
|
||||
//校验
|
||||
if (id == null) {
|
||||
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
ExtContractHistoryDO extContractHistoryDO = extContractHistoryMapper.selectById(id);
|
||||
if (extContractHistoryDO == null) {
|
||||
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
Long projectId = extContractHistoryDO.getProjectId();
|
||||
if (projectApi.getProject(projectId) == null) {
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
Long customerCompanyId = extContractHistoryDO.getCustomerCompanyId();
|
||||
ExtContractHistoryRespVO HistoryResp = BeanUtils.toBean(extContractHistoryDO, ExtContractHistoryRespVO.class);
|
||||
|
||||
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
HistoryResp.setCode(project.getCode());
|
||||
|
||||
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||
HistoryResp.setTrackingDep(projectDetail.getTrackingDepName());
|
||||
HistoryResp.setProjectManager(projectDetail.getProjectManagerName());
|
||||
|
||||
//用客户公司id查询
|
||||
CustomerCompanyDO customerCompanyDO = customerCompanyMapper.selectById(customerCompanyId);
|
||||
String name = customerCompanyDO.getName();
|
||||
HistoryResp.setCustomerCompanyName(name);
|
||||
// TODO 枚举优化
|
||||
|
||||
//合同总金额
|
||||
|
||||
BigDecimal contractAmount = extContractService.getContractAmountById(id);
|
||||
HistoryResp.setAmount(contractAmount);
|
||||
|
||||
//合同商议提示 // TODO 待优化
|
||||
HistoryResp.setExReminderTime(null);
|
||||
|
||||
HistoryResp.setType(ContractTypeEnum.getNoByCode(HistoryResp.getType()));
|
||||
HistoryResp.setStatus(ContractStatusEnum.getNoByCode(HistoryResp.getStatus()));
|
||||
HistoryResp.setCountType(ContractStatusEnum.getNoByCode(HistoryResp.getCountType()));
|
||||
HistoryResp.setSource(ContractStatusEnum.getNoByCode(HistoryResp.getSource()));
|
||||
HistoryResp.setChargingStandard(ChargingStandardEnum.getNoByCode(HistoryResp.getChargingStandard()));
|
||||
|
||||
|
||||
return HistoryResp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ExtContractHistoryRespVO> getExtContractHistoryPage(ExtContractHistoryPageReqVO pageReqVO) {
|
||||
//校验
|
||||
if (pageReqVO == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
|
||||
Long projectId = pageReqVO.getProjectId();
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
if (project == null) {
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
PageResult<ExtContractHistoryDO> extContractHistoryPageResult = extContractHistoryMapper.selectPage(pageReqVO);
|
||||
List<ExtContractHistoryDO> pageResultList = extContractHistoryPageResult.getList();
|
||||
List<ExtContractHistoryRespVO> contractHistoryRespVOS = new ArrayList<>();
|
||||
|
||||
|
||||
for (ExtContractHistoryDO extContractHistoryDO : pageResultList) {
|
||||
Long id = extContractHistoryDO.getId();
|
||||
ExtContractHistoryRespVO extContractHistory = getExtContractHistory(id);
|
||||
contractHistoryRespVOS.add(extContractHistory);
|
||||
}
|
||||
|
||||
PageResult<ExtContractHistoryRespVO> pageResult = new PageResult<>();
|
||||
pageResult.setList(contractHistoryRespVOS);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
|
||||
private void validateExtContractHistoryExists(Long id) {
|
||||
if (extContractHistoryMapper.selectById(id) == null) {
|
||||
throw exception(EXT_CONTRACT_HISTORY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,72 @@
|
||||
package cn.iocoder.yudao.module.cms.service.outscontract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractProcessInstanceRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractSaveReqVO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 外包合同 Service 接口
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
public interface OutsContractService {
|
||||
|
||||
/**
|
||||
* 创建外包合同
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createOutsContract(Long loginUserId,@Valid OutsContractSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新外包合同
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateOutsContract(Long loginUserId,@Valid OutsContractSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除外包合同
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteOutsContract(Long id);
|
||||
|
||||
/**
|
||||
* 获得外包合同
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 外包合同
|
||||
*/
|
||||
OutsContractRespVO getOutsContract(Long id);
|
||||
|
||||
/**
|
||||
* 获得外包合同分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 外包合同分页
|
||||
*/
|
||||
PageResult<OutsContractRespVO> getOutsContractPage(OutsContractPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 查询流程
|
||||
* @param id 合同id
|
||||
*/
|
||||
ContractProcessInstanceRespVO getContractProcess(Long id);
|
||||
|
||||
/**
|
||||
* 查询历史外包合同流程
|
||||
* @param projectId 项目id
|
||||
* @return
|
||||
*/
|
||||
List<ContractProcessInstanceRespVO> getHistoryContractProcess(Long projectId);
|
||||
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,311 @@
|
||||
package cn.iocoder.yudao.module.cms.service.outscontract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceRespDTO;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmTaskRespDTO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractProcessInstanceRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractSaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.outscontract.OutsContractMapper;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.outscontracthistory.OutsContractHistoryMapper;
|
||||
import cn.iocoder.yudao.module.cms.enums.*;
|
||||
import cn.iocoder.yudao.module.cms.service.contract.ContractService;
|
||||
import cn.iocoder.yudao.module.pms.api.project.ProjectApi;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.USER_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 外包合同 Service 实现类
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class OutsContractServiceImpl implements OutsContractService {
|
||||
|
||||
/**
|
||||
* 外包合同立项审批流程定义
|
||||
*/
|
||||
public static final String PROCESS_KEY = "outs_contract_init";
|
||||
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
public static String VERSION = "1";
|
||||
@Resource
|
||||
private OutsContractMapper outsContractMapper;
|
||||
|
||||
@Resource
|
||||
private ContractService contractService;
|
||||
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceApi processInstanceApi;
|
||||
|
||||
@Resource
|
||||
private OutsContractHistoryMapper outsContractHistoryMapper;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Long createOutsContract(Long loginUserId,OutsContractSaveReqVO createReqVO) {
|
||||
if (createReqVO == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
if (loginUserId == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
if (userName == null) {
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
|
||||
OutsContractDO outsContractDO = BeanUtils.toBean(createReqVO, OutsContractDO.class);
|
||||
//校验
|
||||
Long projectId = outsContractDO.getProjectId();
|
||||
projectApi.validProjectExist(projectId);
|
||||
|
||||
|
||||
//校验联表的字段是否和所联系的表内容相同
|
||||
ContractRespVO contract = contractService.getContract(createReqVO.getContractId());
|
||||
// 需要联表查询
|
||||
// 1.合同名称 √
|
||||
// 2.主控部门(跟踪部门) √
|
||||
// 3.项目经理 √
|
||||
// 4.签订合同总额 √
|
||||
|
||||
//todo 待提取 枚举优化
|
||||
String name = createReqVO.getName();
|
||||
String trackingDep = createReqVO.getTrackingDep();
|
||||
String projectManager = createReqVO.getProjectManager();
|
||||
BigDecimal outsAmount = createReqVO.getOutsAmount();
|
||||
|
||||
|
||||
if (!contract.getName().equals(name)){
|
||||
throw exception(PARAM_ERROR);
|
||||
}
|
||||
if (!contract.getTrackingDep().equals(trackingDep)){
|
||||
throw exception(PARAM_ERROR);
|
||||
}
|
||||
if (!contract.getProjectManager().equals(projectManager)){
|
||||
throw exception(PARAM_ERROR);
|
||||
}
|
||||
if (contract.getAmount().compareTo(outsAmount) != 0){
|
||||
throw exception(PARAM_ERROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
OutsContractRespVO outsContractRespVO = BeanUtils.toBean(outsContractDO, OutsContractRespVO.class);
|
||||
outsContractDO.setCreator(userName);
|
||||
outsContractDO.setUpdater(userName);
|
||||
|
||||
|
||||
|
||||
//判断该合同是否已经存在,比较各个字段值是否完全一样
|
||||
//得到所有的合同?逐个比较?
|
||||
|
||||
|
||||
List<OutsContractDO> outsContractDOList = outsContractMapper.selectList("project_id", projectId);
|
||||
List<OutsContractRespVO> outsContractRespList = BeanUtils.toBean(outsContractDOList, OutsContractRespVO.class);
|
||||
|
||||
for (OutsContractRespVO respVO : outsContractRespList) {
|
||||
if (respVO.equals(outsContractRespVO)){
|
||||
throw exception(CONTRACT_ALREADY_EXISTS);
|
||||
}
|
||||
}
|
||||
outsContractMapper.insert(outsContractDO);
|
||||
|
||||
|
||||
Long outsContractDOId = outsContractDO.getId();
|
||||
OutsContractHistoryDO outsContractHistoryDO = BeanUtils.toBean(outsContractDO, OutsContractHistoryDO.class);
|
||||
|
||||
|
||||
// 启动流程,同时写入历史合同
|
||||
if (createReqVO.getId() == null) {
|
||||
String processInstanceId = processInstanceApi.createProcessInstance(loginUserId,
|
||||
new BpmProcessInstanceCreateReqDTO()
|
||||
.setProcessDefinitionKey(PROCESS_KEY).setBusinessKey(String.valueOf(outsContractDOId)));
|
||||
|
||||
// 写入工作流编号
|
||||
outsContractHistoryDO.setProcessInstanceId(processInstanceId);
|
||||
outsContractHistoryDO.setOutsContractId(outsContractDOId);
|
||||
|
||||
Long count = outsContractHistoryMapper.selectCount("project_id", projectId);
|
||||
if (count < 1) {
|
||||
outsContractHistoryDO.setVersion(VERSION);
|
||||
} else {
|
||||
outsContractHistoryDO.setVersion(String.valueOf(count+1));
|
||||
}
|
||||
|
||||
outsContractHistoryDO.setProcessStatus("0");
|
||||
outsContractHistoryMapper.insert(outsContractHistoryDO);
|
||||
}
|
||||
|
||||
return outsContractDO.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOutsContract(Long loginUserId,OutsContractSaveReqVO updateReqVO) {
|
||||
// 校验
|
||||
validateOutsContractExists(updateReqVO.getId());
|
||||
|
||||
Long contractId = updateReqVO.getContractId();
|
||||
ContractRespVO contract = contractService.getContract(contractId);
|
||||
if (contract == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
OutsContractDO outsContractDO = outsContractMapper.selectById(updateReqVO.getId());
|
||||
if (!Objects.equals(updateReqVO.getProjectId(), outsContractDO.getProjectId())) {
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
if (userName == null){
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
// 更新
|
||||
OutsContractDO updateObj = BeanUtils.toBean(updateReqVO, OutsContractDO.class);
|
||||
updateObj.setUpdater(userName);
|
||||
outsContractMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteOutsContract(Long id) {
|
||||
// 校验
|
||||
validateOutsContractExists(id);
|
||||
// 删除
|
||||
outsContractMapper.deleteById(id);
|
||||
}
|
||||
|
||||
// 需要联表查询
|
||||
// 1.合同名称 √
|
||||
// 2.主控部门(跟踪部门) √
|
||||
// 3.项目经理 √
|
||||
// 4.签订合同总额 √
|
||||
|
||||
@Override
|
||||
public OutsContractRespVO getOutsContract(Long id) {
|
||||
//校验
|
||||
if (id == null) {
|
||||
throw exception(OUTS_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
OutsContractDO outsContractDO = outsContractMapper.selectById(id);
|
||||
OutsContractRespVO outsContractRespVO = BeanUtils.toBean(outsContractDO, OutsContractRespVO.class);
|
||||
Long contractId = outsContractDO.getContractId();
|
||||
ContractRespVO contract = contractService.getContract(contractId);
|
||||
|
||||
outsContractRespVO.setName(contract.getName());
|
||||
outsContractRespVO.setTrackingDep(contract.getTrackingDep());
|
||||
outsContractRespVO.setProjectManager(contract.getProjectManager());
|
||||
outsContractRespVO.setOutsAmount(contract.getAmount());
|
||||
|
||||
outsContractRespVO.setMajor(OutsContractMajorEnum.getNoByCode(outsContractRespVO.getMajor()));
|
||||
outsContractRespVO.setCountType(CountTypeEnum.getNoByCode(outsContractRespVO.getCountType()));
|
||||
|
||||
return outsContractRespVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OutsContractRespVO> getOutsContractPage(OutsContractPageReqVO pageReqVO) {
|
||||
|
||||
if (pageReqVO == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
|
||||
Long projectId = pageReqVO.getProjectId();
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
if (project == null) {
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
PageResult<OutsContractDO> outsContractDOPageResult = outsContractMapper.selectPage(pageReqVO);
|
||||
List<OutsContractDO> outsContractDOList = outsContractDOPageResult.getList();
|
||||
List<OutsContractRespVO> outsContractRespVOList = new ArrayList<>();
|
||||
|
||||
|
||||
for (OutsContractDO outsContractDO : outsContractDOList) {
|
||||
Long id = outsContractDO.getId();
|
||||
OutsContractRespVO outsContract = getOutsContract(id);
|
||||
outsContractRespVOList.add(outsContract);
|
||||
}
|
||||
|
||||
PageResult<OutsContractRespVO> pageResult = new PageResult<>();
|
||||
pageResult.setList(outsContractRespVOList);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractProcessInstanceRespVO getContractProcess(Long id) {
|
||||
validateOutsContractExists(id);
|
||||
//去历史里面找
|
||||
OutsContractHistoryDO outsContractHistory = outsContractHistoryMapper.selectOne("outs_contract_id", id);
|
||||
if (outsContractHistory == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
//拿到历史之后 找到process_instance_id 和 status
|
||||
String processInstanceId = outsContractHistory.getProcessInstanceId();
|
||||
String processStatus = outsContractHistory.getProcessStatus();
|
||||
//与当前流程里的进行比较
|
||||
String status = String.valueOf(processInstanceApi.getProcessInstance(processInstanceId).getStatus());
|
||||
|
||||
//如果不相等
|
||||
if (!status.equals(processStatus)){
|
||||
//更新当前合同对应历史表里面的状态
|
||||
outsContractHistory.setProcessStatus(status);
|
||||
outsContractHistoryMapper.updateById(outsContractHistory);
|
||||
}
|
||||
//返回给前端必要的数据 当前流程里面对应的数据
|
||||
BpmProcessInstanceRespDTO processInstance = processInstanceApi.getProcessInstance(processInstanceId);
|
||||
List<BpmTaskRespDTO> tasks = processInstanceApi.getTask(processInstanceId);
|
||||
List<BpmProcessInstanceRespDTO.Task> taskList = BeanUtils.toBean(tasks, BpmProcessInstanceRespDTO.Task.class);
|
||||
processInstance.setTasks(taskList);
|
||||
|
||||
return BeanUtils.toBean(processInstance, ContractProcessInstanceRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ContractProcessInstanceRespVO> getHistoryContractProcess(Long projectId) {
|
||||
List<OutsContractHistoryDO> outsContracts= outsContractHistoryMapper.selectList("project_id", projectId);
|
||||
List<ContractProcessInstanceRespVO> contractProcessInstanceRespVOList = new ArrayList<>();
|
||||
for (OutsContractHistoryDO outsContract : outsContracts) {
|
||||
Long id = outsContract.getId();
|
||||
ContractProcessInstanceRespVO contractProcess = getContractProcess(id);
|
||||
contractProcessInstanceRespVOList.add(contractProcess);
|
||||
}
|
||||
|
||||
return contractProcessInstanceRespVOList;
|
||||
}
|
||||
|
||||
|
||||
private void validateOutsContractExists(Long id) {
|
||||
if (outsContractMapper.selectById(id) == null) {
|
||||
throw exception(OUTS_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.cms.service.outscontracthistory;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistorySaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* 外包合同历史 Service 接口
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
public interface OutsContractHistoryService {
|
||||
|
||||
/**
|
||||
* 更新外包合同历史
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateOutsContractHistory(@Valid OutsContractHistorySaveReqVO updateReqVO);
|
||||
|
||||
|
||||
/**
|
||||
* 获得外包合同历史
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 外包合同历史
|
||||
*/
|
||||
OutsContractHistoryRespVO getOutsContractHistory(Long id);
|
||||
|
||||
/**
|
||||
* 获得外包合同历史分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 外包合同历史分页
|
||||
*/
|
||||
PageResult<OutsContractHistoryRespVO> getOutsContractHistoryPage(OutsContractHistoryPageReqVO pageReqVO);
|
||||
|
||||
}
|
@@ -0,0 +1,110 @@
|
||||
package cn.iocoder.yudao.module.cms.service.outscontracthistory;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistorySaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.outscontracthistory.OutsContractHistoryMapper;
|
||||
import cn.iocoder.yudao.module.cms.enums.CountTypeEnum;
|
||||
import cn.iocoder.yudao.module.cms.enums.OutsContractMajorEnum;
|
||||
import cn.iocoder.yudao.module.cms.service.contract.ContractService;
|
||||
import cn.iocoder.yudao.module.pms.api.project.ProjectApi;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.PROJECT_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 外包合同历史 Service 实现类
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class OutsContractHistoryServiceImpl implements OutsContractHistoryService {
|
||||
|
||||
@Resource
|
||||
private OutsContractHistoryMapper outsContractHistoryMapper;
|
||||
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
|
||||
@Resource
|
||||
private ContractService contractService;
|
||||
|
||||
@Override
|
||||
public void updateOutsContractHistory(OutsContractHistorySaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateOutsContractHistoryExists(updateReqVO.getId());
|
||||
// 更新
|
||||
OutsContractHistoryDO updateObj = BeanUtils.toBean(updateReqVO, OutsContractHistoryDO.class);
|
||||
outsContractHistoryMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
private void validateOutsContractHistoryExists(Long id) {
|
||||
if (outsContractHistoryMapper.selectById(id) == null) {
|
||||
throw exception(OUTS_CONTRACT_HISTORY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public OutsContractHistoryRespVO getOutsContractHistory(Long id) {
|
||||
//校验
|
||||
if (id == null) {
|
||||
throw exception(OUTS_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
OutsContractHistoryDO outsContractHistoryDO = outsContractHistoryMapper.selectById(id);
|
||||
OutsContractHistoryRespVO outsContractHistoryResp = BeanUtils.toBean(outsContractHistoryDO, OutsContractHistoryRespVO.class);
|
||||
Long contractId = outsContractHistoryResp.getContractId();
|
||||
ContractRespVO contract = contractService.getContract(contractId);
|
||||
|
||||
outsContractHistoryResp.setName(contract.getName());
|
||||
outsContractHistoryResp.setTrackingDep(contract.getTrackingDep());
|
||||
outsContractHistoryResp.setProjectManager(contract.getProjectManager());
|
||||
outsContractHistoryResp.setOutsAmount(contract.getAmount());
|
||||
|
||||
outsContractHistoryResp.setMajor(OutsContractMajorEnum.getNoByCode(outsContractHistoryResp.getMajor()));
|
||||
outsContractHistoryResp.setCountType(CountTypeEnum.getNoByCode(outsContractHistoryResp.getCountType()));
|
||||
|
||||
return outsContractHistoryResp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OutsContractHistoryRespVO> getOutsContractHistoryPage(OutsContractHistoryPageReqVO pageReqVO) {
|
||||
if (pageReqVO == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
|
||||
Long projectId = pageReqVO.getProjectId();
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
if (project == null) {
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
PageResult<OutsContractHistoryDO> outsContractHistoryPage = outsContractHistoryMapper.selectPage(pageReqVO);
|
||||
List<OutsContractHistoryDO> outsContractDOList = outsContractHistoryPage.getList();
|
||||
List<OutsContractHistoryRespVO> outsContractRespVOList = new ArrayList<>();
|
||||
|
||||
|
||||
for (OutsContractHistoryDO outsContractHistoryDO : outsContractDOList) {
|
||||
Long id = outsContractHistoryDO.getId();
|
||||
OutsContractHistoryRespVO outsContractHistory = getOutsContractHistory(id);
|
||||
outsContractRespVOList.add(outsContractHistory);
|
||||
}
|
||||
|
||||
PageResult<OutsContractHistoryRespVO> pageResult = new PageResult<>();
|
||||
pageResult.setList(outsContractRespVOList);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
<?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="cn.iocoder.yudao.module.cms.dal.mysql.extcontract.ExtContractMapper">
|
||||
<mapper namespace="cn.iocoder.yudao.module.cms.dal.mysql.extContract.ExtContractMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
@@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.pms.api.budegt;
|
||||
|
||||
import cn.iocoder.yudao.module.pms.api.budegt.dto.BudegtDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.api.budegt.dto.BudegtResDTO;
|
||||
|
||||
public interface BudgetApi {
|
||||
/**
|
||||
* 获得应收款的部分信息
|
||||
*/
|
||||
BudegtResDTO getBudegt(Long id);
|
||||
|
||||
/**
|
||||
* 获得应收款的detail信息
|
||||
*/
|
||||
BudegtDetailRespDTO getBudegtDetail(Long id);
|
||||
}
|
@@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.pms.api.budegt.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class BudegtDetailRespDTO {
|
||||
/**
|
||||
* 合同管理
|
||||
*/
|
||||
private Long contractId;
|
||||
/**
|
||||
* 预算文件url
|
||||
*/
|
||||
private String budgetFileUrl;
|
||||
/**
|
||||
* 预算外包成本
|
||||
*/
|
||||
private BigDecimal outsourcingCosts;
|
||||
/**
|
||||
* 人力成本
|
||||
*/
|
||||
private BigDecimal laborCosts;
|
||||
/**
|
||||
* 累计人力成本
|
||||
*/
|
||||
private BigDecimal accumulatedLaborCosts;
|
||||
/**
|
||||
* 生产成本
|
||||
*/
|
||||
private BigDecimal productCosts;
|
||||
/**
|
||||
* 累计生产成本
|
||||
*/
|
||||
private BigDecimal accumulatedProductCosts;
|
||||
/**
|
||||
* 财务成本
|
||||
*/
|
||||
private BigDecimal financialCosts;
|
||||
/**
|
||||
* 累计财务成本
|
||||
*/
|
||||
private BigDecimal accumulatedFinancialCosts;
|
||||
/**
|
||||
* 回款情况
|
||||
*/
|
||||
private String collectionSituation;
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.pms.api.budegt.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class BudegtResDTO {
|
||||
|
||||
/**
|
||||
* 合同管理
|
||||
*/
|
||||
private Long contractId;
|
||||
/**
|
||||
* 预算文件url
|
||||
*/
|
||||
private String budgetFileUrl;
|
||||
/**
|
||||
* 预算外包成本
|
||||
*/
|
||||
private BigDecimal outsourcingCosts;
|
||||
/**
|
||||
* 人力成本
|
||||
*/
|
||||
private BigDecimal laborCosts;
|
||||
/**
|
||||
* 累计人力成本
|
||||
*/
|
||||
private BigDecimal accumulatedLaborCosts;
|
||||
/**
|
||||
* 生产成本
|
||||
*/
|
||||
private BigDecimal productCosts;
|
||||
/**
|
||||
* 累计生产成本
|
||||
*/
|
||||
private BigDecimal accumulatedProductCosts;
|
||||
/**
|
||||
* 财务成本
|
||||
*/
|
||||
private BigDecimal financialCosts;
|
||||
/**
|
||||
* 累计财务成本
|
||||
*/
|
||||
private BigDecimal accumulatedFinancialCosts;
|
||||
/**
|
||||
* 回款情况
|
||||
*/
|
||||
private String collectionSituation;
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
package cn.iocoder.yudao.module.pms.api;
|
||||
package cn.iocoder.yudao.module.pms.api.project;
|
||||
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||
@@ -14,4 +14,10 @@ public interface ProjectApi {
|
||||
*/
|
||||
ProjectDetailRespDTO getProjectDetailById(Long projectId);
|
||||
|
||||
/**
|
||||
* 判断项目是否存在
|
||||
* @param projectId
|
||||
*/
|
||||
void validProjectExist(Long projectId);
|
||||
|
||||
}
|
@@ -19,4 +19,5 @@ public class ProjectDetailRespDTO {
|
||||
*/
|
||||
private String customerCompanyName;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.pms.api.project.dto;
|
||||
|
||||
import cn.iocoder.yudao.module.pms.enums.DictTypeConstants;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -8,7 +9,7 @@ import java.math.BigDecimal;
|
||||
* 项目基本信息 dto
|
||||
*/
|
||||
@Data
|
||||
public class ProjectRespDTO {
|
||||
public class ProjectRespDTO{
|
||||
|
||||
|
||||
/**
|
||||
@@ -41,6 +42,23 @@ public class ProjectRespDTO {
|
||||
*/
|
||||
private BigDecimal contractAmount;
|
||||
|
||||
/**
|
||||
* 跟踪编号
|
||||
*/
|
||||
private String trackingCode;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*
|
||||
* 枚举 {@link DictTypeConstants}
|
||||
*/
|
||||
private String type;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@ public interface DictTypeConstants {
|
||||
String PROCESS_STATUS = "process_status"; // 流程状态
|
||||
String POSSIBILITY_OF_LANDING = "possibility_of_landing"; // 可能性
|
||||
String BPM_PROCESS_INSTANCE_STATUS = "bpm_process_instance_status"; // 流程实例状态
|
||||
String TRACKING_DEPLOYMENT = "tracking_deployment";
|
||||
|
||||
|
||||
|
||||
|
@@ -24,4 +24,17 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode RECEIVABLES_NOT_EXISTS = new ErrorCode(1_024_000_000, "应收款管理不存在");
|
||||
// ========== 应收款管理历史记录 1_024_000_000 ==========
|
||||
ErrorCode RECEIVABLES_HISTORY_NOT_EXISTS = new ErrorCode(1_024_000_000, "应收款管理历史记录不存在");
|
||||
|
||||
// ========== 请求参数不存在 1_025_000_000 ==========
|
||||
ErrorCode PARAM_NOT_EXISTS = new ErrorCode(1_024_100_000, "请求参数不存在");
|
||||
|
||||
ErrorCode PARAM_ERROR = new ErrorCode(1_024_200_000, "请求参数错误");
|
||||
|
||||
ErrorCode BUDGET_ALREADY_EXISTS = new ErrorCode(1_024_003_000, "该预算已经创建");
|
||||
|
||||
ErrorCode PROFIT_MARGIN_ERROR = new ErrorCode(1_024_004_000, "利润率计算错误");
|
||||
|
||||
ErrorCode RECEIVABLES_ALREADY_EXISTS = new ErrorCode(1_024_005_000, "该应收款已经创建");
|
||||
|
||||
ErrorCode RECEIVABLES_CALCULATION_ERROR = new ErrorCode(1_024_006_000, "合同应收款计算错误");
|
||||
}
|
||||
|
@@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.pms.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author wyw
|
||||
* @description 主控部门枚举
|
||||
* @date 2024/7/31
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum TrackingDepEnum {
|
||||
// 生产一部
|
||||
FIRST_PRODUCE("first-produce", "FP"),
|
||||
// 生产二部
|
||||
SECOND_PRODUCE("second_produce", "DP"),
|
||||
// 检测院
|
||||
LOD("lod", "LO");
|
||||
/**
|
||||
* 类型编号
|
||||
*/
|
||||
private final String code;
|
||||
/**
|
||||
* 类型编码
|
||||
*/
|
||||
private final String no;
|
||||
|
||||
/**
|
||||
* 通过code获取no
|
||||
* @param code 字典编号
|
||||
* @return 类型编码
|
||||
*/
|
||||
public static String getNoByCode(String code) {
|
||||
for (TrackingDepEnum value : values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value.getNo();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.pms.api.project;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.pms.api.budegt.BudgetApi;
|
||||
import cn.iocoder.yudao.module.pms.api.budegt.dto.BudegtDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.api.budegt.dto.BudegtResDTO;
|
||||
import cn.iocoder.yudao.module.pms.dal.dataobject.budget.BudgetDO;
|
||||
import cn.iocoder.yudao.module.pms.dal.mysql.budget.BudgetMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class BudgetImpl implements BudgetApi {
|
||||
|
||||
@Resource
|
||||
private BudgetMapper budgetMapper;
|
||||
|
||||
@Override
|
||||
public BudegtResDTO getBudegt(Long id) {
|
||||
BudgetDO budgetDO = budgetMapper.selectById(id);
|
||||
BudegtResDTO budegtResDTO = BeanUtils.toBean(budgetDO, BudegtResDTO.class);
|
||||
return budegtResDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BudegtDetailRespDTO getBudegtDetail(Long id) {
|
||||
// budgetMapper.
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.pms.api.project;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.pms.api.ProjectApi;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.dal.dataobject.project.ProjectDO;
|
||||
@@ -11,10 +10,14 @@ import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstants.PROJECT_NOT_EXISTS;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class ProjectImpl implements ProjectApi {
|
||||
|
||||
|
||||
@Resource
|
||||
private ProjectMapper projectMapper;
|
||||
|
||||
@@ -22,14 +25,20 @@ public class ProjectImpl implements ProjectApi {
|
||||
@Override
|
||||
public ProjectRespDTO getProject(Long projectId) {
|
||||
ProjectDO projectDO = projectMapper.selectById(projectId);
|
||||
ProjectRespDTO projectRespDTO = BeanUtils.toBean(projectDO, ProjectRespDTO.class);
|
||||
return projectRespDTO;
|
||||
return BeanUtils.toBean(projectDO, ProjectRespDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectDetailRespDTO getProjectDetailById(Long projectId) {
|
||||
ProjectDetailDO projectMapperDetail = projectMapper.getDetailById(projectId);
|
||||
ProjectDetailRespDTO detailRespDTO = BeanUtils.toBean(projectMapperDetail, ProjectDetailRespDTO.class);
|
||||
return detailRespDTO;
|
||||
return BeanUtils.toBean(projectMapperDetail, ProjectDetailRespDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validProjectExist(Long projectId) {
|
||||
if (projectMapper.selectById(projectId) == null) {
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -8,7 +8,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
@@ -24,9 +23,9 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
import cn.iocoder.yudao.module.pms.controller.admin.budget.vo.*;
|
||||
import cn.iocoder.yudao.module.pms.dal.dataobject.budget.BudgetDO;
|
||||
import cn.iocoder.yudao.module.pms.service.budget.BudgetService;
|
||||
|
||||
@Tag(name = "管理后台 - 预算管理")
|
||||
@@ -42,14 +41,14 @@ public class BudgetController {
|
||||
@Operation(summary = "创建预算管理")
|
||||
@PreAuthorize("@ss.hasPermission('pms:budget:create')")
|
||||
public CommonResult<Long> createBudget(@Valid @RequestBody BudgetSaveReqVO createReqVO) {
|
||||
return success(budgetService.createBudget(createReqVO));
|
||||
return success(budgetService.createBudget(getLoginUserId(),createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新预算管理")
|
||||
@PreAuthorize("@ss.hasPermission('pms:budget:update')")
|
||||
public CommonResult<Boolean> updateBudget(@Valid @RequestBody BudgetSaveReqVO updateReqVO) {
|
||||
budgetService.updateBudget(updateReqVO);
|
||||
budgetService.updateBudget(getLoginUserId(),updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@@ -67,16 +66,16 @@ public class BudgetController {
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('pms:budget:query')")
|
||||
public CommonResult<BudgetRespVO> getBudget(@RequestParam("id") Long id) {
|
||||
BudgetDO budget = budgetService.getBudget(id);
|
||||
return success(BeanUtils.toBean(budget, BudgetRespVO.class));
|
||||
BudgetRespVO budgetRespVO = budgetService.getBudget(id);
|
||||
return success(budgetRespVO);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得预算管理分页")
|
||||
@PreAuthorize("@ss.hasPermission('pms:budget:query')")
|
||||
public CommonResult<PageResult<BudgetRespVO>> getBudgetPage(@Valid BudgetPageReqVO pageReqVO) {
|
||||
PageResult<BudgetDO> pageResult = budgetService.getBudgetPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BudgetRespVO.class));
|
||||
PageResult<BudgetRespVO> pageResult = budgetService.getBudgetPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@@ -86,7 +85,7 @@ public class BudgetController {
|
||||
public void exportBudgetExcel(@Valid BudgetPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<BudgetDO> list = budgetService.getBudgetPage(pageReqVO).getList();
|
||||
List<BudgetRespVO> list = budgetService.getBudgetPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "预算管理.xls", "数据", BudgetRespVO.class,
|
||||
BeanUtils.toBean(list, BudgetRespVO.class));
|
||||
|
@@ -13,6 +13,55 @@ import com.alibaba.excel.annotation.*;
|
||||
@ExcelIgnoreUnannotated
|
||||
public class BudgetRespVO {
|
||||
|
||||
@Schema(description = "跟踪项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "XS24001")
|
||||
@ExcelProperty("跟踪项目编号")
|
||||
private String trackingProjectCode;
|
||||
|
||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||
@ExcelProperty("项目编号")
|
||||
private String projectCode;
|
||||
|
||||
@Schema(description = "跟踪项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "规划一路道路工程")
|
||||
@ExcelProperty("跟踪项目名称")
|
||||
private String trackingProjectName;
|
||||
|
||||
@Schema(description = "项目类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "设计")
|
||||
@ExcelProperty("项目类型")
|
||||
private String projectType;
|
||||
|
||||
@Schema(description = "预计合同金额", requiredMode = Schema.RequiredMode.REQUIRED,example = "200.0000")
|
||||
@ExcelProperty("预计合同金额")
|
||||
private BigDecimal expectedContractAmount;
|
||||
|
||||
@Schema(description = "暂定结算数")
|
||||
@ExcelProperty("暂定结算数")
|
||||
private BigDecimal provisionalSettlement;
|
||||
|
||||
@Schema(description = "包干/审定金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("包干/审定金额")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "外包合同金额")
|
||||
@ExcelProperty("外包合同金额")
|
||||
private BigDecimal outAmount;
|
||||
|
||||
@Schema(description = "有效合同金额")
|
||||
@ExcelProperty("有效合同金额")
|
||||
private BigDecimal validContractAmount;
|
||||
|
||||
@Schema(description = "预估利润率")
|
||||
@ExcelProperty("预估利润率")
|
||||
private BigDecimal estimatedProfitMargin;
|
||||
|
||||
@Schema(description = "实际利润率")
|
||||
@ExcelProperty("实际利润率")
|
||||
private BigDecimal realProfitMargin;
|
||||
|
||||
@Schema(description = "利润预警")
|
||||
@ExcelProperty("利润预警")
|
||||
private String profitWarning;
|
||||
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25375")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.pms.controller.admin.budget.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
@@ -10,6 +11,56 @@ import java.math.BigDecimal;
|
||||
@Data
|
||||
public class BudgetSaveReqVO {
|
||||
|
||||
@Schema(description = "跟踪项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "XS24001")
|
||||
@ExcelProperty("跟踪项目编号")
|
||||
private String trackingProjectCode;
|
||||
|
||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||
@ExcelProperty("项目编号")
|
||||
private String projectCode;
|
||||
|
||||
@Schema(description = "跟踪项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "规划一路道路工程")
|
||||
@ExcelProperty("跟踪项目名称")
|
||||
private String trackingProjectName;
|
||||
|
||||
@Schema(description = "项目类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "设计")
|
||||
@ExcelProperty("项目类型")
|
||||
private String projectType;
|
||||
|
||||
@Schema(description = "预计合同金额", requiredMode = Schema.RequiredMode.REQUIRED,example = "200.0000")
|
||||
@ExcelProperty("预计合同金额")
|
||||
private BigDecimal expectedContractAmount;
|
||||
|
||||
@Schema(description = "暂定结算数")
|
||||
@ExcelProperty("暂定结算数")
|
||||
private BigDecimal provisionalSettlement;
|
||||
|
||||
@Schema(description = "包干/审定金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("包干/审定金额")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "外包合同金额")
|
||||
@ExcelProperty("外包合同金额")
|
||||
private BigDecimal outAmount;
|
||||
|
||||
@Schema(description = "有效合同金额")
|
||||
@ExcelProperty("有效合同金额")
|
||||
private BigDecimal validContractAmount;
|
||||
|
||||
@Schema(description = "预估利润率")
|
||||
@ExcelProperty("预估利润率")
|
||||
private BigDecimal estimatedProfitMargin;
|
||||
|
||||
@Schema(description = "实际利润率")
|
||||
@ExcelProperty("实际利润率")
|
||||
private BigDecimal realProfitMargin;
|
||||
|
||||
@Schema(description = "利润预警")
|
||||
@ExcelProperty("利润预警")
|
||||
private String profitWarning;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25375")
|
||||
private Long id;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user