diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java index 02ab1a7..8af1281 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java @@ -226,7 +226,7 @@ public class ProjectDeclareAction { @OnTransition(source = "UNDER_CONSTRUCTION", target = "TO_BE_FINALLY_INSPECTED") public void PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); + project.setStatus(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode()); } @OnTransition(source = "UNDER_CONSTRUCTION", target = "TO_BE_PURCHASED") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionController.java new file mode 100644 index 0000000..f44fb07 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionController.java @@ -0,0 +1,87 @@ +package com.ningdatech.pmapi.projectdeclared.controller; + +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.common.util.ExcelDownUtil; +import com.ningdatech.pmapi.projectdeclared.manage.ConstructionManage; +import com.ningdatech.pmapi.projectdeclared.manage.ProjectAdjustmentManage; +import com.ningdatech.pmapi.projectdeclared.manage.PurchaseManage; +import com.ningdatech.pmapi.projectdeclared.model.dto.ContractSaveDTO; +import com.ningdatech.pmapi.projectdeclared.model.dto.PreInsSaveDTO; +import com.ningdatech.pmapi.projectdeclared.model.dto.PurchaseSaveDTO; +import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; +import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsVO; +import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; + +/** + * @Classname ConstructionController + * @Description 申报项目-建设中 + * @Date 2023/5/29 09:29 + * @Author PoffyZhang + */ +@Slf4j +@Validated +@RestController +@RequestMapping("/api/v1/declared/construction") +@Api(value = "ConstructionController", tags = "申报管理-建设中") +@RequiredArgsConstructor +public class ConstructionController { + private final ConstructionManage constructionManage; + + @ApiOperation(value = "待合同备案的项目列表", notes = "合同备案的项目列表") + @GetMapping("/contract/project-list") + public PageVo projectlist(@ModelAttribute ProjectListReq req) { + return constructionManage.projectLibList(req); + } + + @GetMapping("/contract/export") + @ApiOperation("待合同备案的项目列表导出") + public void exportList(ProjectListReq req, HttpServletResponse response){ + ExcelDownUtil.downXls(response,req,constructionManage::exportList); + } + + @ApiOperation(value = "合同备案的详情-通过项目ID", notes = "合同备案的详情-通过项目ID") + @GetMapping("/contract/detail/{projectId}") + public ContractVO detailContractByProjectId(@PathVariable Long projectId) { + return constructionManage.detailContractByProjectId(projectId); + } + + @ApiOperation(value = "填写合同信息", notes = "填写合同信息") + @PostMapping("/submit-contract") + public String submitContract(@Validated @RequestBody ContractSaveDTO dto) { + return constructionManage.submitContract(dto); + } + + @ApiOperation(value = "待初验备案的项目列表", notes = "待初验备案的项目列表") + @GetMapping("/pre-ins/project-list") + public PageVo preProjectlist(@ModelAttribute ProjectListReq req) { + return constructionManage.preProjectlist(req); + } + + @GetMapping("/pre-ins/export") + @ApiOperation("待初验备案的项目列表导出") + public void exportPreList(ProjectListReq req, HttpServletResponse response){ + ExcelDownUtil.downXls(response,req,constructionManage::exportPreList); + } + + @ApiOperation(value = "初验备案的详情-通过项目ID", notes = "初验备案的详情-通过项目ID") + @GetMapping("/pre-ins/detail/{projectId}") + public PreInsVO detailPreInsByProjectId(@PathVariable Long projectId) { + return constructionManage.detailPreInsByProjectId(projectId); + } + + @ApiOperation(value = "填写初验信息", notes = "填写初验信息") + @PostMapping("/submit-pre-ins") + public String submitPreIns(@Validated @RequestBody PreInsSaveDTO dto) { + return constructionManage.submitPreIns(dto); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/PurchaseController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/PurchaseController.java index ffca41c..1b7ea33 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/PurchaseController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/PurchaseController.java @@ -40,9 +40,9 @@ public class PurchaseController { } @ApiOperation(value = "采购结果备案详情", notes = "采购结果备案详情") - @GetMapping("/detail/{ProjectId}") - public PurchaseVO detailByProjectId(@PathVariable Long ProjectId) { - return purchaseManage.detailByProjectId(ProjectId); + @GetMapping("/detail/{projectId}") + public PurchaseVO detailByProjectId(@PathVariable Long projectId) { + return purchaseManage.detailByProjectId(projectId); } @GetMapping("/export") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionManage.java new file mode 100644 index 0000000..b89c796 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionManage.java @@ -0,0 +1,493 @@ +package com.ningdatech.pmapi.projectdeclared.manage; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import com.alibaba.excel.EasyExcel; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.Lists; +import com.ningdatech.basic.function.VUtils; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.basic.util.NdDateUtils; +import com.ningdatech.pmapi.common.constant.BizConst; +import com.ningdatech.pmapi.common.helper.UserInfoHelper; +import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; +import com.ningdatech.pmapi.common.util.ExcelDownUtil; +import com.ningdatech.pmapi.common.util.ExcelExportStyle; +import com.ningdatech.pmapi.projectdeclared.model.dto.ContractSaveDTO; +import com.ningdatech.pmapi.projectdeclared.model.dto.DeclaredProjectExportDTO; +import com.ningdatech.pmapi.projectdeclared.model.dto.PreInsSaveDTO; +import com.ningdatech.pmapi.projectdeclared.model.dto.PurchaseSaveDTO; +import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; +import com.ningdatech.pmapi.projectdeclared.model.entity.PaymentPlan; +import com.ningdatech.pmapi.projectdeclared.model.entity.PreInsAcceptancePerson; +import com.ningdatech.pmapi.projectdeclared.model.entity.Purchase; +import com.ningdatech.pmapi.projectdeclared.model.vo.*; +import com.ningdatech.pmapi.projectdeclared.service.IContractService; +import com.ningdatech.pmapi.projectdeclared.service.IPaymentPlanService; +import com.ningdatech.pmapi.projectdeclared.service.IPreInsAcceptancePersonService; +import com.ningdatech.pmapi.projectdeclared.service.IPurchaseService; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; +import com.ningdatech.pmapi.projectlib.helper.ProjectHelper; +import com.ningdatech.pmapi.projectlib.model.entity.Project; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; +import com.ningdatech.pmapi.projectlib.service.IProjectService; +import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; +import com.ningdatech.pmapi.user.util.LoginUserUtil; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Component; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +/** + * @Classname ContructionManage + * @Description + * @Date 2023/5/29 14:48 + * @Author PoffyZhang + */ +@Component +@Slf4j +@RequiredArgsConstructor +public class ConstructionManage { + + private final IProjectService projectService; + private final UserInfoHelper userInfoHelper; + + private final IPurchaseService purchaseService; + + private final IContractService contractService; + + private final IPaymentPlanService paymentPlanService; + + private final IPreInsAcceptancePersonService acceptancePersonService; + + private final StateMachineUtils stateMachineUtils; + + /** + * 待采购的-项目列表 + * @param req + * @return + */ + public PageVo projectLibList(ProjectListReq req) { + UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); + VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); + LambdaQueryWrapper query = ProjectHelper.projectQuery(req); + //建设中状态 + query.eq(Project::getStatus,ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); + query.eq(Project::getStage,ProjectStatusEnum.PROJECT_APPROVED.getCode()); + query.eq(Project::getNewest,Boolean.TRUE); + query.orderByAsc(Project::getTransactionTime); + Page page = projectService.page(req.page(), query); + long total; + if ((total = page.getTotal()) == 0) { + return PageVo.empty(); + } + + List projectIds = page.getRecords().stream().map(Project::getId).collect(Collectors.toList()); + + List purchases = purchaseService.list(Wrappers.lambdaQuery(Purchase.class) + .in(Purchase::getProjectId, projectIds)); + Map purchaseMap = purchases.stream().collect(Collectors.toMap(Purchase::getProjectId, v -> v)); + + List records = CollUtils.convert(page.getRecords(), w -> { + ProjectLibListItemVO item = new ProjectLibListItemVO(); + item.setId(w.getId()); + item.setProjectName(w.getProjectName()); + item.setCreateOn(w.getCreateOn()); + item.setDeclaredAmount(w.getDeclareAmount()); + item.setStage(w.getStage()); + item.setStatus(w.getStatus()); + item.setProjectType(w.getProjectType()); + item.setProjectYear(w.getProjectYear()); + item.setBuildOrg(w.getBuildOrgName()); + item.setBizDomain(w.getBizDomain()); + item.setProcessStatus(w.getProcessStatus()); + item.setInstCode(w.getInstCode()); + item.setIsHigherSuperOrg(w.getIsHigherSuperOrg()); + item.setApprovedAmount(w.getApprovalAmount()); + item.setApprovalDate(w.getApprovalDate()); + if(purchaseMap.containsKey(w.getId())){ + Purchase purchase = purchaseMap.get(w.getId()); + item.setTransactionAmount(purchase.getTransactionAmount()); + item.setTransactionTime(purchase.getTransactionTime()); + } + return item; + }); + return PageVo.of(records, total); + } + + public void exportList(HttpServletResponse response, ProjectListReq param) { + UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); + VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); + LambdaQueryWrapper query = ProjectHelper.projectQuery(param); + //待采购状态 + query.eq(Project::getStatus,ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); + query.eq(Project::getStage,ProjectStatusEnum.PROJECT_APPROVED.getCode()); + query.eq(Project::getNewest,Boolean.TRUE); + query.orderByAsc(Project::getTransactionTime); + List records = projectService.list(query); + + AtomicInteger serialNumber = new AtomicInteger(0); + List collect = Lists.newArrayList(); + if(CollUtil.isNotEmpty(records)){ + List projectIds = records.stream().map(Project::getId).collect(Collectors.toList()); + + List purchases = purchaseService.list(Wrappers.lambdaQuery(Purchase.class) + .in(Purchase::getProjectId, projectIds)); + Map purchaseMap = purchases.stream().collect(Collectors.toMap(Purchase::getProjectId, v -> v)); + + collect = records.stream().map(r -> { + DeclaredProjectExportDTO exportDTO = new DeclaredProjectExportDTO(); + BeanUtils.copyProperties(r, exportDTO); + exportDTO.setProjectTypeName(ProjectTypeEnum.getDesc(r.getProjectType())); + exportDTO.setStatusName(ProjectStatusEnum.getDesc(r.getStatus())); + String createOnStr = NdDateUtils.format(r.getCreateOn(), "yyyy-MM-dd HH:mm"); + exportDTO.setCreateOn(createOnStr); + exportDTO.setSerialNumber(serialNumber.incrementAndGet()); + if(purchaseMap.containsKey(r.getId())){ + Purchase purchase = purchaseMap.get(r.getId()); + exportDTO.setTransactionAmount(purchase.getTransactionAmount()); + exportDTO.setTransactionTime(purchase.getTransactionTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + } + return exportDTO; + }).collect(Collectors.toList()); + } + + String fileName = "合同备案项目列表"; + ExcelDownUtil.setFileName(fileName,response); + //数据导出处理函数 + try { + EasyExcel.write(response.getOutputStream(), DeclaredProjectExportDTO.class) + .autoCloseStream(false) + .registerWriteHandler(ExcelExportStyle.formalStyle()) + .sheet(fileName) + .doWrite(collect); + } catch (IOException e) { + throw new RuntimeException(e); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * 获取合同备案详情 + * @param projectId + * @return + */ + public ContractVO detailContractByProjectId(Long projectId) { + Contract contract = contractService.getOne(Wrappers.lambdaQuery(Contract.class) + .eq(Contract::getProjectId, projectId) + .last(BizConst.LIMIT_1)); + + ContractVO vo = BeanUtil.copyProperties(contract, ContractVO.class); + + List payments = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class) + .eq(PaymentPlan::getProjectId, projectId) + .orderByAsc(PaymentPlan::getPaymentTime)); + + if(CollUtil.isNotEmpty(payments)){ + vo.setPayments(convertPayments(payments,contract.getTotalAmount())); + } + + return vo; + } + + private List convertPayments(List payments,BigDecimal totalAmount) { + if(CollUtil.isEmpty(payments)){ + return Collections.emptyList(); + } + return payments.stream().map(p -> { + PaymentPlanVO vo = BeanUtil.copyProperties(p, PaymentPlanVO.class); + vo.setRatio((Objects.isNull(totalAmount)||totalAmount.compareTo(BigDecimal.ZERO) == 0) ? "0%" + : p.getPaymentAmount().multiply(BigDecimal.valueOf(100)) + .divide(totalAmount,BigDecimal.ROUND_CEILING,BigDecimal.ROUND_CEILING) + "%"); + return vo; + }) + .collect(Collectors.toList()); + } + + /** + * 填写合同信息 + * @param dto + * @return + */ + public String submitContract(ContractSaveDTO dto) { + UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); + String employeeCode = user.getEmployeeCode(); + VUtils.isTrue(StringUtils.isBlank(employeeCode)).throwMessage("获取登录用户 员工号 失败!"); + + Long projectId = dto.getProjectId(); + VUtils.isTrue(Objects.isNull(projectId)).throwMessage("提交失败 缺少项目ID!"); + Project project = projectService.getNewProject(dto.getProjectId()); + VUtils.isTrue(Objects.isNull(project)).throwMessage("提交失败 此项目不存在!"); + + //首先要判断 项目当前状态 是不是 采购结果备案 + VUtils.isTrue(!ProjectStatusEnum.UNDER_CONSTRUCTION.getCode().equals(project.getStatus()) || + !ProjectStatusEnum.PROJECT_APPROVED.getCode().equals(project.getStage())) + .throwMessage("提交失败 该项目不是 建设中或者已立项阶段"); + + Contract contractEntity = new Contract(); + Contract contract = contractService.getOne(Wrappers.lambdaQuery(Contract.class) + .eq(Contract::getProjectId, projectId) + .last(BizConst.LIMIT_1)); + + BeanUtil.copyProperties(dto,contractEntity); + if(Objects.isNull(contract)){ + contractEntity.setCreateOn(LocalDateTime.now()); + contractEntity.setCreateBy(employeeCode); + }else{ + contractEntity.setId(contract.getId()); + } + contractEntity.setProjectId(projectId); + if(contractService.saveOrUpdate(contractEntity)){ + //存 付款计划信心 + if(Objects.nonNull(dto.getPayments())){ + //先删除 + paymentPlanService.remove(Wrappers.lambdaQuery(PaymentPlan.class) + .eq(PaymentPlan::getProjectId,projectId)); + if(CollUtil.isNotEmpty(dto.getPayments())){ + List payments = dto.getPayments().stream().map(d -> { + PaymentPlan plan = BeanUtil.copyProperties(d, PaymentPlan.class); + plan.setProjectId(projectId); + plan.setCreateOn(LocalDateTime.now()); + plan.setUpdateOn(LocalDateTime.now()); + plan.setCreateBy(employeeCode); + plan.setUpdateBy(employeeCode); + return plan; + }).collect(Collectors.toList()); + + paymentPlanService.saveBatch(payments); + } + } + } + + //判断下 如果和初验都完成了 才进入下一阶段 + if(StringUtils.isNotBlank(project.getPreliminaryInspectionMaterials())){ + //进入到下一状态 + stateMachineUtils.pass(project); + } + project.setUpdateOn(LocalDateTime.now()); + if(Objects.nonNull(dto.getDeliveryTime())){ + project.setDeliveryTime(dto.getDeliveryTime()); + } + if(Objects.nonNull(dto.getTotalAmount())){ + project.setContractAmount(dto.getTotalAmount()); + } + projectService.updateById(project); + + return "填写成功"; + } + + /** + * 待初验项目列表 + * @param req + * @return + */ + public PageVo preProjectlist(ProjectListReq req) { + UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); + VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); + LambdaQueryWrapper query = ProjectHelper.projectQuery(req); + //建设中状态 + query.eq(Project::getStatus,ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); + query.eq(Project::getStage,ProjectStatusEnum.PROJECT_APPROVED.getCode()); + query.eq(Project::getNewest,Boolean.TRUE); + //交货时间 排序 + query.isNotNull(Project::getDeliveryTime); + query.orderByAsc(Project::getDeliveryTime); + Page page = projectService.page(req.page(), query); + long total; + if ((total = page.getTotal()) == 0) { + return PageVo.empty(); + } + + List projectIds = page.getRecords().stream().map(Project::getId).collect(Collectors.toList()); + + List purchases = purchaseService.list(Wrappers.lambdaQuery(Purchase.class) + .in(Purchase::getProjectId, projectIds)); + Map purchaseMap = purchases.stream().collect(Collectors.toMap(Purchase::getProjectId, v -> v)); + + List records = CollUtils.convert(page.getRecords(), w -> { + ProjectLibListItemVO item = new ProjectLibListItemVO(); + item.setId(w.getId()); + item.setProjectName(w.getProjectName()); + item.setCreateOn(w.getCreateOn()); + item.setDeclaredAmount(w.getDeclareAmount()); + item.setStage(w.getStage()); + item.setStatus(w.getStatus()); + item.setProjectType(w.getProjectType()); + item.setProjectYear(w.getProjectYear()); + item.setBuildOrg(w.getBuildOrgName()); + item.setBizDomain(w.getBizDomain()); + item.setProcessStatus(w.getProcessStatus()); + item.setInstCode(w.getInstCode()); + item.setIsHigherSuperOrg(w.getIsHigherSuperOrg()); + item.setApprovedAmount(w.getApprovalAmount()); + item.setApprovalDate(w.getApprovalDate()); + if(purchaseMap.containsKey(w.getId())){ + Purchase purchase = purchaseMap.get(w.getId()); + item.setTransactionAmount(purchase.getTransactionAmount()); + item.setTransactionTime(purchase.getTransactionTime()); + } + item.setDeliveryTime(w.getDeliveryTime()); + item.setContractAmount(w.getContractAmount()); + item.setAnnualPlanAmount(w.getAnnualPlanAmount()); + return item; + }); + return PageVo.of(records, total); + } + + public void exportPreList(HttpServletResponse response, ProjectListReq param) { + UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); + VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); + LambdaQueryWrapper query = ProjectHelper.projectQuery(param); + //待采购状态 + query.eq(Project::getStatus,ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); + query.eq(Project::getStage,ProjectStatusEnum.PROJECT_APPROVED.getCode()); + query.eq(Project::getNewest,Boolean.TRUE); + //交货时间 排序 + query.isNotNull(Project::getDeliveryTime); + query.orderByAsc(Project::getDeliveryTime); + List records = projectService.list(query); + + AtomicInteger serialNumber = new AtomicInteger(0); + List collect = Lists.newArrayList(); + if(CollUtil.isNotEmpty(records)){ + List projectIds = records.stream().map(Project::getId).collect(Collectors.toList()); + + List purchases = purchaseService.list(Wrappers.lambdaQuery(Purchase.class) + .in(Purchase::getProjectId, projectIds)); + Map purchaseMap = purchases.stream().collect(Collectors.toMap(Purchase::getProjectId, v -> v)); + + collect = records.stream().map(r -> { + DeclaredProjectExportDTO exportDTO = new DeclaredProjectExportDTO(); + BeanUtils.copyProperties(r, exportDTO); + exportDTO.setProjectTypeName(ProjectTypeEnum.getDesc(r.getProjectType())); + exportDTO.setStatusName(ProjectStatusEnum.getDesc(r.getStatus())); + String createOnStr = NdDateUtils.format(r.getCreateOn(), "yyyy-MM-dd HH:mm"); + exportDTO.setCreateOn(createOnStr); + exportDTO.setSerialNumber(serialNumber.incrementAndGet()); + exportDTO.setDeliveryTime(r.getDeliveryTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + exportDTO.setContractAmount(r.getContractAmount()); + exportDTO.setAnnualPlanAmount(r.getAnnualPlanAmount()); + return exportDTO; + }).collect(Collectors.toList()); + } + + String fileName = "合同备案项目列表"; + ExcelDownUtil.setFileName(fileName,response); + //数据导出处理函数 + try { + EasyExcel.write(response.getOutputStream(), DeclaredProjectExportDTO.class) + .autoCloseStream(false) + .registerWriteHandler(ExcelExportStyle.formalStyle()) + .sheet(fileName) + .doWrite(collect); + } catch (IOException e) { + throw new RuntimeException(e); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * 查询初验信息 + * @param projectId + * @return + */ + public PreInsVO detailPreInsByProjectId(Long projectId) { + Project project = projectService.getById(projectId); + + PreInsVO vo = new PreInsVO(); + vo.setProjectId(projectId); + vo.setPreliminaryInspectionMaterials(project.getPreliminaryInspectionMaterials()); + + List acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) + .eq(PreInsAcceptancePerson::getProjectId, projectId) + .orderByAsc(PreInsAcceptancePerson::getCreateOn)); + + if(CollUtil.isNotEmpty(acceptancePersons)){ + vo.setAcceptancePersons(convertPersons(acceptancePersons)); + } + + return vo; + } + + private List convertPersons(List acceptancePersons) { + if(CollUtil.isEmpty(acceptancePersons)){ + return Collections.emptyList(); + } + + return acceptancePersons.stream().map(u -> BeanUtil.copyProperties(u,PreInsAcceptancePersonVO.class)).collect(Collectors.toList()); + } + + /** + * 填写初验信息 + * @param dto + * @return + */ + public String submitPreIns(PreInsSaveDTO dto) { + UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); + String employeeCode = user.getEmployeeCode(); + VUtils.isTrue(StringUtils.isBlank(employeeCode)).throwMessage("获取登录用户 员工号 失败!"); + + Long projectId = dto.getProjectId(); + VUtils.isTrue(Objects.isNull(projectId)).throwMessage("提交失败 缺少项目ID!"); + Project project = projectService.getNewProject(dto.getProjectId()); + VUtils.isTrue(Objects.isNull(project)).throwMessage("提交失败 此项目不存在!"); + + //首先要判断 项目当前状态 是不是 采购结果备案 + VUtils.isTrue(!ProjectStatusEnum.UNDER_CONSTRUCTION.getCode().equals(project.getStatus()) || + !ProjectStatusEnum.PROJECT_APPROVED.getCode().equals(project.getStage())) + .throwMessage("提交失败 该项目不是 建设中或者已立项阶段"); + + //初验人员 + if(Objects.nonNull(dto.getAcceptancePersons())){ + //先删除 + acceptancePersonService.remove(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) + .eq(PreInsAcceptancePerson::getProjectId,projectId)); + if(CollUtil.isNotEmpty(dto.getAcceptancePersons())){ + List persons = dto.getAcceptancePersons().stream().map(d -> { + PreInsAcceptancePerson person = BeanUtil.copyProperties(d, PreInsAcceptancePerson.class); + person.setProjectId(projectId); + person.setCreateOn(LocalDateTime.now()); + person.setUpdateOn(LocalDateTime.now()); + person.setCreateBy(employeeCode); + person.setUpdateBy(employeeCode); + return person; + }).collect(Collectors.toList()); + + acceptancePersonService.saveBatch(persons); + } + } + + + //判断下 如果和初验都完成了 才进入下一阶段 + if(Objects.nonNull(project.getDeliveryTime())){ + //进入到下一状态 + stateMachineUtils.pass(project); + } + project.setUpdateOn(LocalDateTime.now()); + project.setPreliminaryInspectionMaterials(dto.getPreliminaryInspectionMaterials()); + projectService.updateById(project); + + return "填写成功"; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java index cf6ac70..5cd652d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.NdDateUtils; +import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; import com.ningdatech.pmapi.common.helper.UserInfoHelper; @@ -100,7 +101,7 @@ public class ConstructionPlanManage { ProjectDTO projectDto = dto.getProjectInfo(); VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); - Project projectInfo = projectService.getById(projectDto.getId()); + Project projectInfo = projectService.getNewProject(projectDto.getId()); VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); VUtils.isTrue(StringUtils.isBlank(projectDto.getConstructionPlanFile())).throwMessage("提交失败 请提交建设方案!"); @@ -112,7 +113,7 @@ public class ConstructionPlanManage { WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) .eq(WflowModels::getRegionCode, regionCode) .eq(WflowModels::getProcessType, ProjectProcessStageEnum.CONSTRUCTION_PROJECT_APPROVAL_PROCESS.getCode()) - .last("limit 1")); + .last(BizConst.LIMIT_1)); if (Objects.isNull(model)) { log.error("此 【{}】区域找不到 建设申报流程配置", regionCode); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java index 3f968ba..121e7d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java @@ -98,7 +98,7 @@ public class PrequalificationDeclaredProjectManage { ProjectDTO projectDto = dto.getProjectInfo(); VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); - Project projectInfo = projectService.getById(projectDto.getId()); + Project projectInfo = projectService.getNewProject(projectDto.getId()); VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); //要判断 当前操作人 是不是项目主管单位的人 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PurchaseManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PurchaseManage.java index f8e5f2a..e7b9583 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PurchaseManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PurchaseManage.java @@ -1,10 +1,12 @@ package com.ningdatech.pmapi.projectdeclared.manage; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.Lists; import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; @@ -35,6 +37,7 @@ import org.springframework.stereotype.Component; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; import java.util.Objects; import java.util.concurrent.atomic.AtomicInteger; @@ -71,6 +74,7 @@ public class PurchaseManage { query.eq(Project::getStatus,ProjectStatusEnum.TO_BE_PURCHASED.getCode()); query.eq(Project::getStage,ProjectStatusEnum.PROJECT_APPROVED.getCode()); query.eq(Project::getNewest,Boolean.TRUE); + query.orderByAsc(Project::getApprovalDate); Page page = projectService.page(req.page(), query); long total; if ((total = page.getTotal()) == 0) { @@ -91,6 +95,8 @@ public class PurchaseManage { item.setProcessStatus(w.getProcessStatus()); item.setInstCode(w.getInstCode()); item.setIsHigherSuperOrg(w.getIsHigherSuperOrg()); + item.setApprovedAmount(w.getApprovalAmount()); + item.setApprovalDate(w.getApprovalDate()); return item; }); return PageVo.of(records, total); @@ -104,19 +110,27 @@ public class PurchaseManage { query.eq(Project::getStatus,ProjectStatusEnum.TO_BE_PURCHASED.getCode()); query.eq(Project::getStage,ProjectStatusEnum.PROJECT_APPROVED.getCode()); query.eq(Project::getNewest,Boolean.TRUE); + query.orderByAsc(Project::getApprovalDate); List records = projectService.list(query); AtomicInteger serialNumber = new AtomicInteger(0); - List collect = records.stream().map(r -> { - DeclaredProjectExportDTO exportDTO = new DeclaredProjectExportDTO(); - BeanUtils.copyProperties(r, exportDTO); - exportDTO.setProjectTypeName(ProjectTypeEnum.getDesc(r.getProjectType())); - exportDTO.setStatusName(ProjectStatusEnum.getDesc(r.getStatus())); - String createOnStr = NdDateUtils.format(r.getCreateOn(), "yyyy-MM-dd HH:mm"); - exportDTO.setCreateOn(createOnStr); - exportDTO.setSerialNumber(serialNumber.incrementAndGet()); - return exportDTO; - }).collect(Collectors.toList()); + List data = Lists.newArrayList(); + + if(CollUtil.isNotEmpty(records)){ + data = records.stream().map(r -> { + DeclaredProjectExportDTO exportDTO = new DeclaredProjectExportDTO(); + BeanUtils.copyProperties(r, exportDTO); + exportDTO.setProjectTypeName(ProjectTypeEnum.getDesc(r.getProjectType())); + exportDTO.setStatusName(ProjectStatusEnum.getDesc(r.getStatus())); + String createOnStr = NdDateUtils.format(r.getCreateOn(), "yyyy-MM-dd HH:mm"); + exportDTO.setCreateOn(createOnStr); + exportDTO.setSerialNumber(serialNumber.incrementAndGet()); + exportDTO.setApprovedAmount(r.getApprovalAmount()); + exportDTO.setApprovalDate(r.getApprovalDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + return exportDTO; + }).collect(Collectors.toList()); + } + String fileName = "采购结果待备案项目列表"; ExcelDownUtil.setFileName(fileName,response); //数据导出处理函数 @@ -125,7 +139,7 @@ public class PurchaseManage { .autoCloseStream(false) .registerWriteHandler(ExcelExportStyle.formalStyle()) .sheet(fileName) - .doWrite(collect); + .doWrite(data); } catch (IOException e) { throw new RuntimeException(e); } @@ -156,7 +170,7 @@ public class PurchaseManage { Long projectId = dto.getProjectId(); VUtils.isTrue(Objects.isNull(projectId)).throwMessage("提交失败 缺少项目ID!"); - Project project = projectService.getById(projectId); + Project project = projectService.getNewProject(dto.getProjectId()); VUtils.isTrue(Objects.isNull(project)).throwMessage("提交失败 此项目不存在!"); //首先要判断 项目当前状态 是不是 采购结果备案 @@ -182,6 +196,8 @@ public class PurchaseManage { //进入到下一状态 stateMachineUtils.pass(project); project.setUpdateOn(LocalDateTime.now()); + project.setTransactionAmount(dto.getTransactionAmount()); + project.setTransactionTime(dto.getTransactionTime()); projectService.updateById(project); return "填写成功"; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java index ecc359a..765e07d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java @@ -63,7 +63,7 @@ public class ReviewByDeptJointManage { String startUserCode = project.getSponsor(); VUtils.isTrue(Objects.isNull(project.getId())).throwMessage("提交失败 缺少项目ID!"); - Project projectInfo = projectService.getById(project.getId()); + Project projectInfo = projectService.getNewProject(project.getId()); VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); String regionCode = projectInfo.getAreaCode(); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java index 08116a7..7083e68 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java @@ -85,7 +85,7 @@ public class ReviewByProvincialDeptManage { public String restartTheProcess(DefaultDeclaredDTO declaringDTO) { ProjectDTO project = declaringDTO.getProjectInfo(); VUtils.isTrue(Objects.isNull(project.getId())).throwMessage("提交失败 缺少项目ID!"); - Project projectInfo = projectService.getById(project.getId()); + Project projectInfo = projectService.getNewProject(project.getId()); VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); String regionCode = projectInfo.getAreaCode(); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/ContractMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/ContractMapper.java new file mode 100644 index 0000000..0d91d08 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/ContractMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.projectdeclared.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; + +/** + *

+ * Mapper 接口 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +public interface ContractMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/ContractMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/ContractMapper.xml new file mode 100644 index 0000000..29cb5e1 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/ContractMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/PaymentPlanMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/PaymentPlanMapper.java new file mode 100644 index 0000000..fa0a66a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/PaymentPlanMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.projectdeclared.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.projectdeclared.model.entity.PaymentPlan; + +/** + *

+ * Mapper 接口 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +public interface PaymentPlanMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/PaymentPlanMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/PaymentPlanMapper.xml new file mode 100644 index 0000000..944f7b2 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/PaymentPlanMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/PreInsAcceptancePersonMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/PreInsAcceptancePersonMapper.java new file mode 100644 index 0000000..16f9e74 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/PreInsAcceptancePersonMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.projectdeclared.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.projectdeclared.model.entity.PreInsAcceptancePerson; + +/** + *

+ * Mapper 接口 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +public interface PreInsAcceptancePersonMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/PreInsAcceptancePersonMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/PreInsAcceptancePersonMapper.xml new file mode 100644 index 0000000..8ffebfa --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/PreInsAcceptancePersonMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/ContractSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/ContractSaveDTO.java new file mode 100644 index 0000000..b99766b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/ContractSaveDTO.java @@ -0,0 +1,60 @@ +package com.ningdatech.pmapi.projectdeclared.model.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +/** + * @Classname Contract + * @Description + * @Date 2023/5/30 15:35 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "合同对象", description = "") +public class ContractSaveDTO { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("项目ID") + @NotNull(message = "项目ID不能为空") + private Long projectId; + + @ApiModelProperty("合同名称") + private String name; + + @ApiModelProperty("合同总金额") + private BigDecimal totalAmount; + + @ApiModelProperty("供应商开户行") + private String supplierBank; + + @ApiModelProperty("供应商开户行帐号") + private String supplierAccount; + + @ApiModelProperty("质保期 年") + private Integer warrantyPeriod; + + @ApiModelProperty("质保金") + private BigDecimal retentionMoney; + + @ApiModelProperty("合同完成时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDateTime contractTime; + + @ApiModelProperty("交货日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDateTime deliveryTime; + + @ApiModelProperty("附件") + private String attachment; + + @ApiModelProperty("支付计划") + private List payments; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/DeclaredProjectExportDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/DeclaredProjectExportDTO.java index 14c2d20..b1ca87c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/DeclaredProjectExportDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/DeclaredProjectExportDTO.java @@ -1,12 +1,12 @@ package com.ningdatech.pmapi.projectdeclared.model.dto; import com.alibaba.excel.annotation.ExcelProperty; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.math.BigDecimal; +import java.time.LocalDate; import java.time.LocalDateTime; @@ -42,4 +42,24 @@ public class DeclaredProjectExportDTO { @ExcelProperty("项目状态") private String statusName; + @ExcelProperty("批复金额") + private BigDecimal approvedAmount; + + @ExcelProperty("立项批复时间") + private String approvalDate; + + @ExcelProperty("成交金额") + private BigDecimal transactionAmount; + + @ExcelProperty("成交时间") + private String transactionTime; + + @ExcelProperty("成交时间") + private String deliveryTime; + + @ExcelProperty("合同金额") + private BigDecimal contractAmount; + + @ExcelProperty("年度预算") + private BigDecimal annualPlanAmount; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PaymentPlanSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PaymentPlanSaveDTO.java new file mode 100644 index 0000000..cac0f09 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PaymentPlanSaveDTO.java @@ -0,0 +1,36 @@ +package com.ningdatech.pmapi.projectdeclared.model.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * @Classname PaymentPlan + * @Description + * @Date 2023/5/30 16:11 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "PaymentPlan", description = "") +public class PaymentPlanSaveDTO { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("付款计划") + private String planAmount; + + @ApiModelProperty("支付金额") + private BigDecimal paymentAmount; + + @ApiModelProperty("支付时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDateTime paymentTime; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PreInsAcceptancePersonSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PreInsAcceptancePersonSaveDTO.java new file mode 100644 index 0000000..591d831 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PreInsAcceptancePersonSaveDTO.java @@ -0,0 +1,30 @@ +package com.ningdatech.pmapi.projectdeclared.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; + +/** + * @Classname PreInsAcceptancePerson + * @Description 初验人员 + * @Date 2023/5/30 15:35 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "PreInsAcceptancePersonSaveDTO", description = "") +public class PreInsAcceptancePersonSaveDTO { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("人员名称") + private String personName; + + @ApiModelProperty("单位") + private String unit; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PreInsSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PreInsSaveDTO.java new file mode 100644 index 0000000..289179f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PreInsSaveDTO.java @@ -0,0 +1,36 @@ +package com.ningdatech.pmapi.projectdeclared.model.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +/** + * @Classname PreInsSaveDTO + * @Description + * @Date 2023/5/30 15:35 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "PreInsSaveDTO", description = "") +public class PreInsSaveDTO { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("项目ID") + @NotNull(message = "项目ID不能为空") + private Long projectId; + + @ApiModelProperty("初验材料") + @NotBlank(message = "请提交初验材料") + private String preliminaryInspectionMaterials; + + @ApiModelProperty("初验验收人员") + private List acceptancePersons; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PurchaseSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PurchaseSaveDTO.java index 2d3d6b6..784c639 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PurchaseSaveDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PurchaseSaveDTO.java @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.projectdeclared.model.dto; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; @@ -40,6 +41,7 @@ public class PurchaseSaveDTO { private BigDecimal transactionAmount; @ApiModelProperty("成交时间") + @JsonFormat(pattern = "yyyy-MM-dd") private LocalDateTime transactionTime; @ApiModelProperty("代理机构") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/Contract.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/Contract.java new file mode 100644 index 0000000..3d8a5a6 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/Contract.java @@ -0,0 +1,70 @@ +package com.ningdatech.pmapi.projectdeclared.model.entity; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.joda.time.LocalDate; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * @Classname Contract + * @Description + * @Date 2023/5/30 15:35 + * @Author PoffyZhang + */ +@Data +@TableName("nd_contract") +@ApiModel(value = "合同对象", description = "") +public class Contract { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("创建人") + private String createBy; + + @ApiModelProperty("修改人人") + private String updateBy; + + @ApiModelProperty("创建时间") + private LocalDateTime createOn; + + @ApiModelProperty("修改时间") + private LocalDateTime updateOn; + + @ApiModelProperty("合同名称") + private String name; + + @ApiModelProperty("合同总金额") + private BigDecimal totalAmount; + + @ApiModelProperty("供应商开户行") + private String supplierBank; + + @ApiModelProperty("供应商开户行帐号") + private String supplierAccount; + + @ApiModelProperty("质保期 年") + private Integer warrantyPeriod; + + @ApiModelProperty("质保金") + private BigDecimal retentionMoney; + + @ApiModelProperty("合同完成时间") + private LocalDateTime contractTime; + + @ApiModelProperty("交货日期") + private LocalDateTime deliveryTime; + + @ApiModelProperty("附件") + private String attachment; + + @ApiModelProperty("项目ID") + private Long projectId; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/PaymentPlan.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/PaymentPlan.java new file mode 100644 index 0000000..08dff7a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/PaymentPlan.java @@ -0,0 +1,53 @@ +package com.ningdatech.pmapi.projectdeclared.model.entity; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * @Classname PaymentPlan + * @Description + * @Date 2023/5/30 16:11 + * @Author PoffyZhang + */ +@Data +@TableName("nd_payment_plan") +@ApiModel(value = "PaymentPlan", description = "") +public class PaymentPlan { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("创建人") + private String createBy; + + @ApiModelProperty("修改人人") + private String updateBy; + + @ApiModelProperty("创建时间") + private LocalDateTime createOn; + + @ApiModelProperty("修改时间") + private LocalDateTime updateOn; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("付款计划") + private String planAmount; + + @ApiModelProperty("支付金额") + private BigDecimal paymentAmount; + + @ApiModelProperty("支付时间") + private LocalDateTime paymentTime; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/PreInsAcceptancePerson.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/PreInsAcceptancePerson.java new file mode 100644 index 0000000..886469e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/PreInsAcceptancePerson.java @@ -0,0 +1,50 @@ +package com.ningdatech.pmapi.projectdeclared.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * @Classname PreInsAcceptancePerson + * @Description 初验人员 + * @Date 2023/5/30 15:35 + * @Author PoffyZhang + */ +@Data +@TableName("nd_pre_ins_acceptance_person") +@ApiModel(value = "PreInsAcceptancePerson", description = "") +public class PreInsAcceptancePerson { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("创建人") + private String createBy; + + @ApiModelProperty("修改人人") + private String updateBy; + + @ApiModelProperty("创建时间") + private LocalDateTime createOn; + + @ApiModelProperty("修改时间") + private LocalDateTime updateOn; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("人员名称") + private String personName; + + @ApiModelProperty("单位") + private String unit; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/Purchase.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/Purchase.java index fdc1c8a..9479327 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/Purchase.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/Purchase.java @@ -8,9 +8,8 @@ import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; import java.math.BigDecimal; +import java.time.LocalDate; import java.time.LocalDateTime; /** diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ContractVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ContractVO.java new file mode 100644 index 0000000..4530e38 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ContractVO.java @@ -0,0 +1,77 @@ +package com.ningdatech.pmapi.projectdeclared.model.vo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.List; + +/** + * @Classname Contract + * @Description + * @Date 2023/5/30 15:35 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "ContractVO", description = "") +public class ContractVO { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("创建人") + @TableField(fill = FieldFill.INSERT) + private String createBy; + + @ApiModelProperty("修改人人") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + @ApiModelProperty("创建时间") + private LocalDateTime createOn; + + @ApiModelProperty("修改时间") + private LocalDateTime updateOn; + + @ApiModelProperty("合同名称") + private String name; + + @ApiModelProperty("合同总金额") + private BigDecimal totalAmount; + + @ApiModelProperty("供应商开户行") + private String supplierBank; + + @ApiModelProperty("供应商开户行帐号") + private String supplierAccount; + + @ApiModelProperty("质保期 年") + private Integer warrantyPeriod; + + @ApiModelProperty("质保金") + private BigDecimal retentionMoney; + + @ApiModelProperty("合同完成时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDateTime contractTime; + + @ApiModelProperty("交货日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDateTime deliveryTime; + + @ApiModelProperty("附件") + private String attachment; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("支付计划") + private List payments; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PaymentPlanVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PaymentPlanVO.java new file mode 100644 index 0000000..774cf2a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PaymentPlanVO.java @@ -0,0 +1,58 @@ +package com.ningdatech.pmapi.projectdeclared.model.vo; + +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * @Classname PaymentPlan + * @Description + * @Date 2023/5/30 16:11 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "PaymentPlanVO", description = "") +public class PaymentPlanVO { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("创建人") + @TableField(fill = FieldFill.INSERT) + private String createBy; + + @ApiModelProperty("修改人人") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + @ApiModelProperty("创建时间") + private LocalDateTime createOn; + + @ApiModelProperty("修改时间") + private LocalDateTime updateOn; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("付款计划") + private String planAmount; + + @ApiModelProperty("支付金额") + private BigDecimal paymentAmount; + + @ApiModelProperty("支付比例") + private String ratio; + + @ApiModelProperty("支付时间") + @JSONField(format = "yyyy-MM-dd") + private LocalDateTime paymentTime; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PreInsAcceptancePersonVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PreInsAcceptancePersonVO.java new file mode 100644 index 0000000..98ea3f4 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PreInsAcceptancePersonVO.java @@ -0,0 +1,47 @@ +package com.ningdatech.pmapi.projectdeclared.model.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @Classname PreInsAcceptancePerson + * @Description 初验人员 + * @Date 2023/5/30 15:35 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "PreInsAcceptancePersonVO", description = "") +public class PreInsAcceptancePersonVO { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("创建人") + private String createBy; + + @ApiModelProperty("修改人人") + private String updateBy; + + @ApiModelProperty("创建时间") + private LocalDateTime createOn; + + @ApiModelProperty("修改时间") + private LocalDateTime updateOn; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("人员名称") + private String personName; + + @ApiModelProperty("单位") + private String unit; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PreInsVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PreInsVO.java new file mode 100644 index 0000000..dee5f45 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PreInsVO.java @@ -0,0 +1,34 @@ +package com.ningdatech.pmapi.projectdeclared.model.vo; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +/** + * @Classname PreInsVO + * @Description + * @Date 2023/5/30 15:35 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "PreInsVO", description = "初验备案详情") +public class PreInsVO { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("初验材料") + private String preliminaryInspectionMaterials; + + @ApiModelProperty("初验验收人员") + private List acceptancePersons; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IContractService.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IContractService.java new file mode 100644 index 0000000..ae75108 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IContractService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.projectdeclared.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; + +/** + *

+ * 服务类 + *

+ * + * @author zpf + * @since 2023-05-29 + */ +public interface IContractService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IPaymentPlanService.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IPaymentPlanService.java new file mode 100644 index 0000000..d3e3431 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IPaymentPlanService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.projectdeclared.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.projectdeclared.model.entity.PaymentPlan; + +/** + *

+ * 服务类 + *

+ * + * @author zpf + * @since 2023-05-29 + */ +public interface IPaymentPlanService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IPreInsAcceptancePersonService.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IPreInsAcceptancePersonService.java new file mode 100644 index 0000000..ed7043f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IPreInsAcceptancePersonService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.projectdeclared.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.projectdeclared.model.entity.PreInsAcceptancePerson; + +/** + *

+ * 服务类 + *

+ * + * @author zpf + * @since 2023-05-29 + */ +public interface IPreInsAcceptancePersonService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/ContractServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/ContractServiceImpl.java new file mode 100644 index 0000000..19e224c --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/ContractServiceImpl.java @@ -0,0 +1,21 @@ +package com.ningdatech.pmapi.projectdeclared.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.projectdeclared.mapper.ContractMapper; +import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; +import com.ningdatech.pmapi.projectdeclared.service.IContractService; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +@Service +public class ContractServiceImpl extends ServiceImpl + implements IContractService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/PaymentPlanServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/PaymentPlanServiceImpl.java new file mode 100644 index 0000000..ad51158 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/PaymentPlanServiceImpl.java @@ -0,0 +1,21 @@ +package com.ningdatech.pmapi.projectdeclared.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.projectdeclared.mapper.PaymentPlanMapper; +import com.ningdatech.pmapi.projectdeclared.model.entity.PaymentPlan; +import com.ningdatech.pmapi.projectdeclared.service.IPaymentPlanService; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +@Service +public class PaymentPlanServiceImpl extends ServiceImpl + implements IPaymentPlanService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/PreInsAcceptancePersonServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/PreInsAcceptancePersonServiceImpl.java new file mode 100644 index 0000000..506c440 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/PreInsAcceptancePersonServiceImpl.java @@ -0,0 +1,21 @@ +package com.ningdatech.pmapi.projectdeclared.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.projectdeclared.mapper.PreInsAcceptancePersonMapper; +import com.ningdatech.pmapi.projectdeclared.model.entity.PreInsAcceptancePerson; +import com.ningdatech.pmapi.projectdeclared.service.IPreInsAcceptancePersonService; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +@Service +public class PreInsAcceptancePersonServiceImpl extends ServiceImpl + implements IPreInsAcceptancePersonService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java index 90057aa..2d580e4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java @@ -7,6 +7,8 @@ import java.util.Objects; import cn.hutool.core.collection.CollUtil; import com.google.common.collect.Lists; import com.ningdatech.basic.util.NdDateUtils; +import com.ningdatech.pmapi.common.constant.BizConst; +import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil; import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; import com.wflow.workflow.bean.process.ProgressNode; @@ -35,12 +37,17 @@ import com.wflow.workflow.service.ProcessInstanceService; public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { private final IProjectInstService projectInstService; + + private final IProjectService projectService; private final ProcessInstanceService processInstanceService; private final BuildUserUtils buildUserUtils; private final ProjectVersionUtil projectVersionUtil; - public DeptUnitedReviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils, ProjectVersionUtil projectVersionUtil){ + public DeptUnitedReviewHandle(IProjectInstService projectInstService,IProjectService projectService + , ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils, + ProjectVersionUtil projectVersionUtil){ this.projectInstService = projectInstService; + this.projectService = projectService; this.processInstanceService = processInstanceService; this.buildUserUtils = buildUserUtils; this.projectVersionUtil = projectVersionUtil; @@ -49,12 +56,16 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { @Override void businessHandle(Long projectId, List processSchedule) { ProcessDetailVO processDetailVO = new ProcessDetailVO(); + + //查出历史版本的 所有项目ID + List allVersionProjectIds = projectService.getAllVersionProjectId(projectId); + // 根据项目ID查询出部门联审流程的流程状态 ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) - .eq(ProjectInst::getProjectId, projectId) + .in(ProjectInst::getProjectId, allVersionProjectIds) .eq(ProjectInst::getInstType, InstTypeEnum.DEPT_UNITED_REVIEW.getCode()) .orderByDesc(ProjectInst::getCreatOn) - .last("limit 1")); + .last(BizConst.LIMIT_1)); if (Objects.isNull(projectInst)){ processDetailVO.setStepStatus(StepStatusEnum.NOT_START); processDetailVO.setProcessName(CommonConst.DEPT_UNITED_REVIEW); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java index 27208d2..c1a853e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java @@ -329,4 +329,22 @@ public class Project implements Serializable { @ApiModelProperty("是否是最新版本") private Boolean newest; + + @ApiModelProperty("成交金额") + private BigDecimal transactionAmount; + + @ApiModelProperty("成交时间") + private LocalDateTime transactionTime; + + @ApiModelProperty("交货时间") + private LocalDateTime deliveryTime; + + @ApiModelProperty("初验材料") + private String preliminaryInspectionMaterials; + + @ApiModelProperty("终验材料") + private String finalAcceptanceMaterials; + + @ApiModelProperty("合同总金额") + private BigDecimal contractAmount; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index 178e9e2..1e4e122 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -1,6 +1,8 @@ package com.ningdatech.pmapi.projectlib.model.vo; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonFormat; import com.ningdatech.pmapi.common.util.BizUtils; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; import io.swagger.annotations.ApiModel; @@ -331,6 +333,27 @@ public class ProjectDetailVO { private LocalDateTime createOn; private LocalDateTime updateOn; + @ApiModelProperty("成交金额") + private BigDecimal transactionAmount; + + @ApiModelProperty("成交时间") + @JSONField(format = "yyyy-MM-dd") + private LocalDateTime transactionTime; + + @ApiModelProperty("交货时间") + @JSONField(format = "yyyy-MM-dd") + private LocalDateTime deliveryTime; + + @ApiModelProperty("初验材料") + private String preliminaryInspectionMaterials; + + @ApiModelProperty("终验材料") + private String finalAcceptanceMaterials; + + @ApiModelProperty("合同总金额") + private BigDecimal contractAmount; + + public String getProjectTypeName() { if (Objects.nonNull(this.projectType)) { Optional.ofNullable(ProjectTypeEnum.getDesc(this.projectType)) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java index 08a6959..9a3fb15 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.projectlib.model.vo; +import com.alibaba.fastjson.annotation.JSONField; import com.fasterxml.jackson.annotation.JsonFormat; import com.ningdatech.pmapi.common.enumeration.CommonEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; @@ -13,6 +14,7 @@ import lombok.Data; import lombok.experimental.Tolerate; import java.math.BigDecimal; +import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Objects; import java.util.Optional; @@ -46,6 +48,9 @@ public class ProjectLibListItemVO { @ApiModelProperty("批复金额") private BigDecimal approvedAmount; + @ApiModelProperty("立项批复时间") + private LocalDate approvalDate; + @ApiModelProperty("项目类型") private Integer projectType; @@ -78,6 +83,23 @@ public class ProjectLibListItemVO { private String projectTypeName; + @ApiModelProperty("成交金额") + private BigDecimal transactionAmount; + + @ApiModelProperty("成交时间") + @JSONField(format = "yyyy-MM-dd") + private LocalDateTime transactionTime; + + @ApiModelProperty("交货时间") + @JSONField(format = "yyyy-MM-dd") + private LocalDateTime deliveryTime; + + @ApiModelProperty("合同总金额") + private BigDecimal contractAmount; + + @ApiModelProperty("年度支付计划-年度支付计划(元)") + private BigDecimal annualPlanAmount; + public String getProjectTypeName() { if (Objects.nonNull(this.projectType)) { Optional.ofNullable(ProjectTypeEnum.getDesc(this.projectType)) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java index f614611..9c8031d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java @@ -16,4 +16,8 @@ import java.util.List; public interface IProjectService extends IService { public List getAllVersionProjectId(Project project); + + public List getAllVersionProjectId(Long projectId); + + Project getNewProject(Long projectId); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java index 38a9536..c966ad5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java @@ -1,7 +1,9 @@ package com.ningdatech.pmapi.projectlib.service.impl; import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.mapper.ProjectMapper; import com.ningdatech.pmapi.projectlib.service.IProjectService; @@ -10,6 +12,7 @@ import org.springframework.stereotype.Service; import java.util.Collections; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; /** @@ -37,4 +40,34 @@ public class ProjectServiceImpl extends ServiceImpl impl return projects.stream().map(Project::getId).collect(Collectors.toList()); } + + @Override + public List getAllVersionProjectId(Long projectId) { + Project project = getById(projectId); + + if(Objects.isNull(project)){ + return null; + } + + return getAllVersionProjectId(project); + } + + @Override + public Project getNewProject(Long projectId) { + Project project = getById(projectId); + + if(Objects.isNull(project)){ + return null; + } + + String projectCode = project.getProjectCode(); + + LambdaQueryWrapper last = Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .eq(Project::getProjectCode, projectCode) + .last(BizConst.LIMIT_1); + Project newest = getOne(last); + + return newest; + } } diff --git a/pmapi/src/main/resources/application-prod.yml b/pmapi/src/main/resources/application-prod.yml index 7a31cbb..a7f8ee7 100644 --- a/pmapi/src/main/resources/application-prod.yml +++ b/pmapi/src/main/resources/application-prod.yml @@ -44,7 +44,7 @@ spring: driverClassName: com.kingbase8.Driver # 数据源 druid: - url: jdbc:kingbase8://120.26.44.207:54321/nd_project_management?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 + url: jdbc:kingbase8://10.221.140.251:54321/nd_project_management?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&nullCatalogMeansCurrent=false username: SYSTEM password: Ndkj1234 # 初始连接数 @@ -120,12 +120,12 @@ nd: file: storage-type: ALI_OSS ali: - protocol: https:// - bucket: devplat - urlPrefix: oss-cn-hangzhou.aliyuncs.com - endpoint: oss-cn-hangzhou.aliyuncs.com - accessKeyId: LTAI4GL7uypycnBjiRn55rMG - accessKeySecret: qwYC7bW9bkStsko7qkLVnToAzj0Y98 + protocol: http:// + bucket: projectmangmentoss + urlPrefix: oss-cn-lishui-gov-d01-a.ops.lsdx-zw.gov.cn + endpoint: oss-cn-lishui-gov-d01-a.ops.lsdx-zw.gov.cn + accessKeyId: XS3kNLtfW5i41SaC + accessKeySecret: 2cywvSZWANml7pZXxRAeAiHfisIhqm # 日志文件配置 log: path: ./logs @@ -145,6 +145,7 @@ flowable: async-executor-activate: true #关闭一些不需要的功能服务 rest-api-enabled: false +# database-schema-update: false idm: enabled: false common: diff --git a/pmapi/src/main/resources/security/auth-prod.yml b/pmapi/src/main/resources/security/auth-prod.yml index 349a3b9..9512d15 100644 --- a/pmapi/src/main/resources/security/auth-prod.yml +++ b/pmapi/src/main/resources/security/auth-prod.yml @@ -3,7 +3,9 @@ security: auth-require-url: /api/v1/user/auth/auth-require invalid-session-url: /api/v1/user/auth/invalid-session password-login-url: /api/v1/user/auth/login + agent-login-url: /api/v1/user/auth/agent-login logout-url: /api/v1/user/auth/logout + common-login-url: /api/v1/user/auth/common-login ignore-auth-urls: - /v2/api-docs - /swagger-ui.html @@ -11,10 +13,27 @@ security: - /swagger-resources/** - /webjars/ - /api/v1/user/auth/register + - /api/v1/user/auth/auth-require + - /api/v1/user/auth/invalid-session - /api/v1/user/auth/login/password - /api/v1/user/auth/forget-password + - /api/v1/user/auth/common-login - /doc.html - /ok.html + - /open/api/** + - /oa/** + - /wflow/** + - /sys/** + - /api/v1/verification/** + - /api/v1/expert/registration + - /api/v1/meta/dictionary/list + - /api/v1/meta/tag + - /api/v1/organization/tree-list + - /api/v1/organization/get-child-list + - /api/v1/region/tree + - /api/v1/expert/get-zzd-info + - /file/upload + - /file/download ignore-csrf-urls: - /api/v1/user/auth/** - /v2/api-docs @@ -28,9 +47,23 @@ security: - /file/** - /optLog/** - /dict/** + - /oa/** + - /wflow/** + - /sys/** + - /api/v1/verification/** + - /api/v1/expert/registration + - /api/v1/meta/dictionary/list + - /api/v1/meta/tag + - /api/v1/organization/tree-list + - /api/v1/organization/get-child-list + - /api/v1/region/tree + - /api/v1/expert/get-zzd-info + - /file/upload + - /file/download role-map: "engineer": "project_manager": + - /api/v1/user-info/kick-off/** "enterprise_admin": "regional_general_manager": "driver": diff --git a/pmapi/src/test/resources/security/auth-prod.yml b/pmapi/src/test/resources/security/auth-prod.yml index 349a3b9..53ec385 100644 --- a/pmapi/src/test/resources/security/auth-prod.yml +++ b/pmapi/src/test/resources/security/auth-prod.yml @@ -3,7 +3,9 @@ security: auth-require-url: /api/v1/user/auth/auth-require invalid-session-url: /api/v1/user/auth/invalid-session password-login-url: /api/v1/user/auth/login + agent-login-url: /api/v1/user/auth/agent-login logout-url: /api/v1/user/auth/logout + common-login-url: /api/v1/user/auth/common-login ignore-auth-urls: - /v2/api-docs - /swagger-ui.html @@ -11,10 +13,24 @@ security: - /swagger-resources/** - /webjars/ - /api/v1/user/auth/register + - /api/v1/user/auth/auth-require + - /api/v1/user/auth/invalid-session - /api/v1/user/auth/login/password - /api/v1/user/auth/forget-password + - /api/v1/user/auth/common-login - /doc.html - /ok.html + - /open/api/** + - /oa/** + - /wflow/** + - /sys/** + - /api/v1/verification/** + - /api/v1/expert/registration + - /api/v1/meta/dictionary/list + - /api/v1/meta/tag + - /api/v1/organization/tree-list + - /api/v1/organization/get-child-list + - /api/v1/region/tree ignore-csrf-urls: - /api/v1/user/auth/** - /v2/api-docs @@ -28,9 +44,20 @@ security: - /file/** - /optLog/** - /dict/** + - /oa/** + - /wflow/** + - /sys/** + - /api/v1/verification/** + - /api/v1/expert/registration + - /api/v1/meta/dictionary/list + - /api/v1/meta/tag + - /api/v1/organization/tree-list + - /api/v1/organization/get-child-list + - /api/v1/region/tree role-map: "engineer": "project_manager": + - /api/v1/user-info/kick-off/** "enterprise_admin": "regional_general_manager": "driver":