|
@@ -73,14 +73,14 @@ public class ProjectListService {
|
|
|
@Resource
|
|
|
private ProofreadIssuedService proofreadIssuedService;
|
|
|
|
|
|
- public String save(ProjectListDto dto) throws Exception{
|
|
|
+ public String save(ProjectListDto dto,String tabType) throws Exception{
|
|
|
if (StringUtils.isNotEmpty(dto.getId())) {
|
|
|
return update(dto);
|
|
|
}
|
|
|
- return add(dto);
|
|
|
+ return add(dto,tabType);
|
|
|
}
|
|
|
|
|
|
- public String add(ProjectListDto dto) throws Exception{
|
|
|
+ public String add(ProjectListDto dto,String tabType) throws Exception{
|
|
|
ProgramProjectListInfo info = new ProgramProjectListInfo();
|
|
|
//获取当前登录人信息
|
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
@@ -99,6 +99,7 @@ public class ProjectListService {
|
|
|
info.setUpdateBy(userDTO.getId());
|
|
|
info.setUpdateDate(new Date());
|
|
|
info.setDelFlag(0);
|
|
|
+ info.setTabType(tabType);
|
|
|
projectListMapper.insert(info);
|
|
|
// 保存项目直接对接人信息
|
|
|
if (CollectionUtils.isNotEmpty(dto.getLinks())) {
|
|
@@ -151,6 +152,35 @@ public class ProjectListService {
|
|
|
programArchive.setProgramId(info.getId());
|
|
|
programArchive.setStatus("0");
|
|
|
programArchiveMapper.insert(programArchive);
|
|
|
+ // 当项目登记审核同意的时候,生成合同编号。根据createContractNo的值是“1”的时候,就是审核同意的时候
|
|
|
+ if (ObjectUtil.isNotEmpty(dto)) {
|
|
|
+ if (StringUtils.isNotBlank(dto.getCreateContractNo())) {
|
|
|
+ if ("1".equals(dto.getCreateContractNo())) {
|
|
|
+ ProgramProjectListInfo programProjectListInfo = projectListMapper.getById(info.getId());
|
|
|
+ if (ObjectUtil.isNotEmpty(programProjectListInfo)) {
|
|
|
+ // 根据项目id查询关联的合同信息-》找到合同id
|
|
|
+ String contractId = programProjectListInfo.getContractId();
|
|
|
+ if (StringUtils.isNotBlank(programProjectListInfo.getReportType())) {
|
|
|
+ if ("1".equals(programProjectListInfo.getReportType())) {
|
|
|
+ // 生成合同编号-评估类
|
|
|
+ String serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), WorkContractInfoDto.BIZ_CODE);
|
|
|
+ // 根据合同id和合同编号来修改合同数据
|
|
|
+ WorkContractInfo workContractInfo = new WorkContractInfo();
|
|
|
+ workContractInfo.setNo(serialNum);
|
|
|
+ workContractInfoMapper.update(workContractInfo, new QueryWrapper<WorkContractInfo>().lambda().eq(WorkContractInfo::getId, contractId));
|
|
|
+ }else if("2".equals(programProjectListInfo.getReportType())){
|
|
|
+ // 生成合同编号-咨询类
|
|
|
+ String serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), WorkContractInfoDto.BIZ_CODE_);
|
|
|
+ // 根据合同id和合同编号来修改合同数据
|
|
|
+ WorkContractInfo workContractInfo = new WorkContractInfo();
|
|
|
+ workContractInfo.setNo(serialNum);
|
|
|
+ workContractInfoMapper.update(workContractInfo, new QueryWrapper<WorkContractInfo>().lambda().eq(WorkContractInfo::getId, contractId));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return id;
|
|
|
}
|
|
|
|
|
@@ -411,9 +441,10 @@ public class ProjectListService {
|
|
|
return "操作成功";
|
|
|
}
|
|
|
|
|
|
- public IPage<ProgramProjectListInfo> list(Page<ProgramProjectListInfo> page, ProgramProjectListInfo info) throws Exception{
|
|
|
+ public IPage<ProgramProjectListInfo> list(Page<ProgramProjectListInfo> page, ProgramProjectListInfo info, String tabType) throws Exception{
|
|
|
QueryWrapper<ProgramProjectListInfo> wrapper = QueryWrapperGenerator.buildQueryCondition(info, ProgramProjectListInfo.class);
|
|
|
wrapper.eq("a.del_flag", "0");
|
|
|
+ wrapper.eq("a.tab_type", tabType);
|
|
|
if (info.getCreateDates() != null) {
|
|
|
wrapper.between("a.create_date", info.getCreateDates()[0], info.getCreateDates()[1]);
|
|
|
}
|