@@ -3,11 +3,13 @@ package com.hz.pm.api.projectdeclared.controller; | |||
import com.hz.pm.api.common.util.ExcelDownUtil; | |||
import com.hz.pm.api.projectdeclared.manage.PurchaseManage; | |||
import com.hz.pm.api.projectdeclared.model.dto.PurchaseSaveDTO; | |||
import com.hz.pm.api.projectdeclared.model.dto.XcfhxApplySaveDTO; | |||
import com.hz.pm.api.projectdeclared.model.req.*; | |||
import com.hz.pm.api.projectdeclared.model.req.SubmitPurchaseNoticeReq.PurchaseNoticeTenderDTO; | |||
import com.hz.pm.api.projectdeclared.model.vo.PurchaseVO; | |||
import com.hz.pm.api.projectdeclared.model.vo.TestValidListVO; | |||
import com.hz.pm.api.projectdeclared.model.vo.XcfhxApplyListVO; | |||
import com.hz.pm.api.projectdeclared.model.vo.XinchuangVO; | |||
import com.hz.pm.api.projectlib.model.req.ProjectListReq; | |||
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | |||
import com.ningdatech.basic.model.PageVo; | |||
@@ -122,6 +124,19 @@ public class PurchaseController { | |||
return purchaseManage.pageXcfhxApply(req); | |||
} | |||
@GetMapping("/pageXcfhxApply-detail/{id}") | |||
@ApiOperation("获取信创符合性申请列表") | |||
public XinchuangVO pageXcfhxApply(@PathVariable Long id) { | |||
return purchaseManage.detailXcfhxApply(id); | |||
} | |||
@ApiOperation("新增系统") | |||
@WebLog("新增系统") | |||
@PostMapping("/add-system") | |||
public Long addSystem(@Validated @RequestBody XcfhxApplySaveDTO dto) { | |||
return purchaseManage.addSystem(dto); | |||
} | |||
@GetMapping("/purchaseIntention/{unitId}") | |||
@ApiOperation("获取采购意向") | |||
public List<PurchaseNoticeTenderDTO> listPurchaseIntention(@PathVariable Long unitId) { | |||
@@ -1,6 +1,7 @@ | |||
package com.hz.pm.api.projectdeclared.manage; | |||
import cn.hutool.core.bean.BeanUtil; | |||
import cn.hutool.core.collection.CollUtil; | |||
import cn.hutool.core.date.DateUtil; | |||
import cn.hutool.core.date.LocalDateTimeUtil; | |||
import cn.hutool.core.io.FileUtil; | |||
@@ -15,6 +16,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.google.common.collect.Lists; | |||
import com.google.common.collect.Maps; | |||
import com.hz.pm.api.common.enumeration.ProjectProcessType; | |||
import com.hz.pm.api.common.helper.UserInfoHelper; | |||
import com.hz.pm.api.common.statemachine.event.AbstractStateChangeEvent; | |||
@@ -34,21 +36,18 @@ import com.hz.pm.api.external.model.dto.MhPurchaseIntentionDTO; | |||
import com.hz.pm.api.external.model.dto.MhPurchaseNoticeDTO; | |||
import com.hz.pm.api.projectdeclared.model.dto.DeclaredProjectExportDTO; | |||
import com.hz.pm.api.projectdeclared.model.dto.PurchaseSaveDTO; | |||
import com.hz.pm.api.projectdeclared.model.entity.Contract; | |||
import com.hz.pm.api.projectdeclared.model.entity.Operation; | |||
import com.hz.pm.api.projectdeclared.model.entity.Purchase; | |||
import com.hz.pm.api.projectdeclared.model.entity.PurchaseInst; | |||
import com.hz.pm.api.projectdeclared.model.dto.XcfhxApplySaveDTO; | |||
import com.hz.pm.api.projectdeclared.model.entity.*; | |||
import com.hz.pm.api.projectdeclared.model.enumerization.BidTypeEnum; | |||
import com.hz.pm.api.projectdeclared.model.enumerization.PurchaseScopeEnum; | |||
import com.hz.pm.api.projectdeclared.model.enumerization.PurchaseSourceTypeEnum; | |||
import com.hz.pm.api.projectdeclared.model.req.*; | |||
import com.hz.pm.api.projectdeclared.model.req.SubmitPurchaseNoticeReq.PurchaseNoticeTenderDTO; | |||
import com.hz.pm.api.projectdeclared.model.vo.PurchaseVO; | |||
import com.hz.pm.api.projectdeclared.model.vo.TestValidListVO; | |||
import com.hz.pm.api.projectdeclared.model.vo.XcfhxApplyListVO; | |||
import com.hz.pm.api.projectdeclared.service.IContractService; | |||
import com.hz.pm.api.projectdeclared.service.IOperationService; | |||
import com.hz.pm.api.projectdeclared.service.IPurchaseInstService; | |||
import com.hz.pm.api.projectdeclared.service.IPurchaseService; | |||
import com.hz.pm.api.projectdeclared.model.vo.XinchuangVO; | |||
import com.hz.pm.api.projectdeclared.service.*; | |||
import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil; | |||
import com.hz.pm.api.projectlib.entity.PurchaseStatusChange; | |||
import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | |||
@@ -81,6 +80,7 @@ import com.wflow.workflow.bean.vo.ProcessStartParamsVo; | |||
import com.wflow.workflow.service.ProcessInstanceService; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.beans.factory.annotation.Value; | |||
import org.springframework.stereotype.Component; | |||
@@ -95,6 +95,7 @@ import java.time.format.DateTimeFormatter; | |||
import java.util.*; | |||
import java.util.concurrent.atomic.AtomicInteger; | |||
import java.util.stream.Collectors; | |||
import java.util.stream.Stream; | |||
/** | |||
* <p> | |||
@@ -131,6 +132,8 @@ public class PurchaseManage { | |||
private final EnvironmentUtil environmentUtil; | |||
private final IPurchaseStatusChangeService purchaseStatusChangeService; | |||
private final IXinchuangService xinchuangService; | |||
private boolean buildPurchaseQueryPermission(LambdaQueryWrapper<Purchase> query, UserFullInfoDTO user) { | |||
boolean queryState = true; | |||
Optional<DataScopeDTO> datascope = DataScopeUtil.getCurrentUserDataScopeHasUserId(user); | |||
@@ -703,48 +706,81 @@ public class PurchaseManage { | |||
} | |||
public PageVo<XcfhxApplyListVO> pageXcfhxApply(XcfhxListReq req) { | |||
Integer pageNumber = req.getPageNumber(); | |||
Integer pageSize = req.getPageSize(); | |||
//手动添加的 | |||
List<XcfhxApplyListVO> manuals = xinchuangService.listXcfhxApplyListVO(req); | |||
LambdaQueryWrapper<Purchase> query = Wrappers.lambdaQuery(Purchase.class) | |||
.like(StrUtil.isNotBlank(req.getBidName()), Purchase::getBidName, req.getBidName()) | |||
.le(req.getCreateOnMax() != null, Purchase::getCreateOn, req.getCreateOnMax()) | |||
.ge(req.getCreateOnMin() != null, Purchase::getCreateOn, req.getCreateOnMin()) | |||
.eq(req.getStatus() != null, Purchase::getXcfhxApplyStatus, req.getStatus()) | |||
.eq(req.getSourceType() != null,Purchase::getSourceType,req.getSourceType() ) | |||
.orderByDesc(Purchase::getCreateOn); | |||
if (Boolean.TRUE.equals(req.getFinished())) { | |||
query.eq(Purchase::getXcfhxApplyStatus, TenderXcfhxApplyStatus.XCFHX_APPLY_PASSED.getCode()); | |||
} else { | |||
} else if (Boolean.FALSE.equals(req.getFinished())){ | |||
query.ne(Purchase::getXcfhxApplyStatus, TenderXcfhxApplyStatus.XCFHX_APPLY_PASSED.getCode()); | |||
} | |||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | |||
if (!buildPurchaseQueryPermission(query, user)) { | |||
return PageVo.empty(); | |||
} | |||
Page<Purchase> page = purchaseService.page(req.page(), query); | |||
if (page.getTotal() == 0) { | |||
return PageVo.empty(); | |||
List<Purchase> purchases = purchaseService.list(query); | |||
List<XcfhxApplyListVO> others = Lists.newArrayList(); | |||
if (CollUtil.isNotEmpty(purchases)) { | |||
Set<Long> projectIds = CollUtils.fieldSet(purchases, Purchase::getProjectId); | |||
List<Project> projects = projectIds.isEmpty() ? Lists.newArrayList() : projectService.listByIds(projectIds); | |||
Map<Long, Project> projectMap = CollUtils.listToMap(projects, Project::getId); | |||
Map<Long, Contract> contractMap = projectIds.isEmpty() ? Maps.newHashMap() | |||
: contractService.listByProjectIds(projectIds); | |||
others = purchases.stream().map(w -> { | |||
XcfhxApplyListVO item = XcfhxApplyListVO.builder() | |||
.bidId(w.getId()) | |||
.bizName(w.getBidName()) | |||
.status(w.getXcfhxApplyStatus()) | |||
.projectId(w.getProjectId()) | |||
.createOn(w.getCreateOn()) | |||
.sourceType(w.getSourceType()) | |||
.build(); | |||
if(Objects.nonNull(w.getProjectId()) && projectMap.containsKey(w.getProjectId())){ | |||
Project project = projectMap.get(w.getProjectId()); | |||
item.setProjectCode(project.getProjectCode()); | |||
item.setProjectName(project.getProjectName()); | |||
item.setBuildOrgCode(project.getBuildOrgCode()); | |||
item.setBuildOrgName(project.getBuildOrgName()); | |||
}else{ | |||
item.setProjectName(w.getProjectName()); | |||
} | |||
Contract contract = contractMap.get(w.getId()); | |||
if (contract != null) { | |||
item.setContractAmount(contract.getTotalAmount()); | |||
} | |||
return item; | |||
}).collect(Collectors.toList()); | |||
} | |||
List<Purchase> records = page.getRecords(); | |||
Set<Long> projectIds = CollUtils.fieldSet(records, Purchase::getProjectId); | |||
List<Project> projects = projectService.listByIds(projectIds); | |||
Map<Long, Project> projectMap = CollUtils.listToMap(projects, Project::getId); | |||
Map<Long, Contract> contractMap = contractService.listByProjectIds(projectIds); | |||
List<XcfhxApplyListVO> data = records.stream().map(w -> { | |||
Project project = projectMap.get(w.getProjectId()); | |||
XcfhxApplyListVO item = XcfhxApplyListVO.builder() | |||
.bidId(w.getId()) | |||
.bizName(w.getBidName()) | |||
.status(w.getXcfhxApplyStatus()) | |||
.projectId(w.getProjectId()) | |||
.projectCode(project.getProjectCode()) | |||
.projectName(project.getProjectName()) | |||
.createOn(w.getCreateOn()) | |||
.build(); | |||
Contract contract = contractMap.get(w.getId()); | |||
if (contract != null) { | |||
item.setContractAmount(contract.getTotalAmount()); | |||
} | |||
return item; | |||
}).collect(Collectors.toList()); | |||
return PageVo.of(data, page.getTotal()); | |||
//合并 | |||
List<XcfhxApplyListVO> merge = Stream.of(manuals, others) | |||
.flatMap(List::stream) | |||
.collect(Collectors.toList()); | |||
return PageVo.of(merge.stream().sorted(Comparator.comparing(XcfhxApplyListVO::getCreateOn).reversed()) | |||
.skip((long) (pageNumber - 1) * pageSize) | |||
.limit(pageSize).collect(Collectors.toList()), merge.size()); | |||
} | |||
/** | |||
* 详情 | |||
* @param id | |||
* @return | |||
*/ | |||
public XinchuangVO detailXcfhxApply(Long id) { | |||
Xinchuang xinchuang = xinchuangService.getById(id); | |||
if(Objects.isNull(xinchuang)){ | |||
return null; | |||
} | |||
return BeanUtil.copyProperties(xinchuang, XinchuangVO.class); | |||
} | |||
public List<PurchaseNoticeTenderDTO> listPurchaseIntention(Long unitId) { | |||
@@ -771,4 +807,17 @@ public class PurchaseManage { | |||
}).collect(Collectors.toList()); | |||
} | |||
/** | |||
* 新增信创系统 | |||
* @param dto | |||
* @return | |||
*/ | |||
public Long addSystem(XcfhxApplySaveDTO dto) { | |||
Xinchuang xinchuang = BeanUtil.copyProperties(dto, Xinchuang.class); | |||
xinchuang.setSourceType(PurchaseSourceTypeEnum.MANUAL_ADDITION.getCode()); | |||
if(xinchuangService.save(xinchuang)){ | |||
return xinchuang.getId(); | |||
} | |||
throw BizException.wrap("新增失败"); | |||
} | |||
} |
@@ -0,0 +1,16 @@ | |||
package com.hz.pm.api.projectdeclared.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.hz.pm.api.projectdeclared.model.entity.Xinchuang; | |||
/** | |||
* <p> | |||
* Mapper 接口 | |||
* </p> | |||
* | |||
* @author zpf | |||
* @since 2024-07-02 | |||
*/ | |||
public interface XinchuangMapper extends BaseMapper<Xinchuang> { | |||
} |
@@ -0,0 +1,5 @@ | |||
<?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="com.hz.pm.api.projectdeclared.mapper.XinchuangMapper"> | |||
</mapper> |
@@ -0,0 +1,51 @@ | |||
package com.hz.pm.api.projectdeclared.model.dto; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
/** | |||
* @Classname XcfhxApplySaveDTO | |||
* @Description | |||
* @Date 2024/7/2 15:38 | |||
* @Author PoffyZhang | |||
*/ | |||
@Data | |||
@ApiModel(value = "信创审查对象", description = "采购对象") | |||
@AllArgsConstructor | |||
public class XcfhxApplySaveDTO { | |||
@ApiModelProperty("系统名称") | |||
@NotBlank(message = "系统名称必填") | |||
private String bidName; | |||
@ApiModelProperty("项目名称") | |||
@NotBlank(message = "项目名称必填") | |||
private String projectName; | |||
@ApiModelProperty("信创符合性测评报告文件") | |||
private String mhXcfhxReportFile; | |||
@ApiModelProperty("信创符合性测评记录ID") | |||
private String mhXcfhxReportRecordId; | |||
@ApiModelProperty("是否符合信创符合性要求") | |||
@NotNull(message = "复合型要求必填") | |||
private Boolean matchXcfhx; | |||
@ApiModelProperty("信创符合性申请备注") | |||
private String xcfhxApplyRemark; | |||
@ApiModelProperty("信创符合性申请其他附件") | |||
private String xcfhxApplyFiles; | |||
@ApiModelProperty("信创报告") | |||
private String xcfhxReportFiles; | |||
@ApiModelProperty("资源类型 1手动新增 2系统生成 3大数据局") | |||
private Integer sourceType; | |||
} |
@@ -164,4 +164,10 @@ public class Purchase { | |||
@ApiModelProperty("信创符合性申请状态") | |||
private Integer xcfhxApplyStatus; | |||
@ApiModelProperty("资源类型 1手动新增 2系统生成 3大数据局") | |||
private Integer sourceType; | |||
@ApiModelProperty("项目名称") | |||
private String projectName; | |||
} |
@@ -0,0 +1,71 @@ | |||
package com.hz.pm.api.projectdeclared.model.entity; | |||
import com.baomidou.mybatisplus.annotation.*; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.time.LocalDateTime; | |||
/** | |||
* <p> | |||
* 信创信息 | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 15:07 2024/7/2 | |||
*/ | |||
@Data | |||
@TableName("nd_xinchuang") | |||
@ApiModel(value = "信创对象") | |||
public class Xinchuang { | |||
@TableId(type = IdType.AUTO) | |||
@ApiModelProperty("id") | |||
private Long id; | |||
@ApiModelProperty("系统名称") | |||
private String bidName; | |||
@ApiModelProperty("创建时间") | |||
@TableField(fill = FieldFill.INSERT) | |||
private LocalDateTime createOn; | |||
@ApiModelProperty("修改时间") | |||
@TableField(fill = FieldFill.INSERT_UPDATE) | |||
private LocalDateTime updateOn; | |||
@ApiModelProperty("创建人 工号") | |||
@TableField(fill = FieldFill.INSERT) | |||
private String createBy; | |||
@ApiModelProperty("修改人 工号") | |||
@TableField(fill = FieldFill.INSERT_UPDATE) | |||
private String updateBy; | |||
private Integer status; | |||
@ApiModelProperty("是否符合信创符合性要求") | |||
private Boolean matchXcfhx; | |||
@ApiModelProperty("信创符合性申请备注") | |||
private String xcfhxApplyRemark; | |||
@ApiModelProperty("信创符合性申请其他附件") | |||
private String xcfhxApplyFiles; | |||
@ApiModelProperty("信创符合性测评报告文件") | |||
private String mhXcfhxReportFile; | |||
@ApiModelProperty("信创符合性测评记录ID") | |||
private String mhXcfhxReportRecordId; | |||
@ApiModelProperty("信创报告") | |||
private String xcfhxReportFiles; | |||
@ApiModelProperty("资源类型 1手动新增 2系统生成 3大数据局") | |||
private Integer sourceType; | |||
@ApiModelProperty("项目名称") | |||
private String projectName; | |||
} |
@@ -0,0 +1,50 @@ | |||
package com.hz.pm.api.projectdeclared.model.enumerization; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; | |||
import org.apache.commons.lang3.StringUtils; | |||
import java.util.Arrays; | |||
import java.util.Optional; | |||
/** | |||
* <p> | |||
* PurchaseScopeEnum | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 13:28 2024/3/25 | |||
*/ | |||
@Getter | |||
@AllArgsConstructor | |||
public enum PurchaseSourceTypeEnum { | |||
/** | |||
* 资源类型 | |||
*/ | |||
MANUAL_ADDITION(1, "手动新增"), | |||
SYSTEM_AUTO(2, "系统生成"), | |||
BIG_DATA(3, "大数据局推送"); | |||
private final Integer code; | |||
private final String desc; | |||
public boolean eq(Integer code) { | |||
return this.code.equals(code); | |||
} | |||
public static PurchaseSourceTypeEnum match(Integer code) { | |||
return Arrays.stream(values()) | |||
.filter(w -> w.getCode().equals(code)) | |||
.findFirst().orElse(null); | |||
} | |||
public static String desc(Integer code) { | |||
Optional<PurchaseSourceTypeEnum> optional = Arrays.stream(values()) | |||
.filter(w -> w.getCode().equals(code)) | |||
.findFirst(); | |||
if(optional.isPresent()) { | |||
return optional.get().getDesc(); | |||
} | |||
return StringUtils.EMPTY; | |||
} | |||
} |
@@ -23,6 +23,8 @@ public class XcfhxListReq extends PagePo { | |||
private Integer status; | |||
private Integer sourceType; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private LocalDateTime createOnMin; | |||
@@ -155,4 +155,9 @@ public class PurchaseVO { | |||
@ApiModelProperty("终验申报材料") | |||
private String finalInspectionMaterials; | |||
@ApiModelProperty("资源类型 1手动新增 2系统生成 3大数据局") | |||
private Integer sourceType; | |||
@ApiModelProperty("项目名称") | |||
private String projectName; | |||
} |
@@ -1,5 +1,7 @@ | |||
package com.hz.pm.api.projectdeclared.model.vo; | |||
import com.hz.pm.api.common.compare.Compare; | |||
import com.hz.pm.api.projectdeclared.model.enumerization.PurchaseSourceTypeEnum; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Builder; | |||
import lombok.Data; | |||
@@ -19,6 +21,9 @@ import java.time.LocalDateTime; | |||
@Builder | |||
public class XcfhxApplyListVO { | |||
@ApiModelProperty("id") | |||
private Long id; | |||
@ApiModelProperty("标段ID") | |||
private Long bidId; | |||
@@ -41,4 +46,21 @@ public class XcfhxApplyListVO { | |||
private String projectCode; | |||
@ApiModelProperty("资源类型 1手动新增 2系统生成 3大数据局") | |||
private Integer sourceType; | |||
@ApiModelProperty("资源类型 中文名") | |||
private String sourceTypeName; | |||
@ApiModelProperty("建设单位名称") | |||
@Compare("建设单位名称") | |||
private String buildOrgName; | |||
@ApiModelProperty("公司编码code") | |||
@Compare("公司编码code") | |||
private String buildOrgCode; | |||
public String getSourceTypeName() { | |||
return PurchaseSourceTypeEnum.desc(this.sourceType); | |||
} | |||
} |
@@ -0,0 +1,74 @@ | |||
package com.hz.pm.api.projectdeclared.model.vo; | |||
import com.baomidou.mybatisplus.annotation.*; | |||
import com.hz.pm.api.projectdeclared.model.enumerization.PurchaseSourceTypeEnum; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.time.LocalDateTime; | |||
/** | |||
* <p> | |||
* 信创信息 | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 15:07 2024/7/2 | |||
*/ | |||
@Data | |||
@ApiModel(value = "信创对象") | |||
public class XinchuangVO { | |||
@ApiModelProperty("id") | |||
private Long id; | |||
@ApiModelProperty("系统名称") | |||
private String bidName; | |||
@ApiModelProperty("创建时间") | |||
@TableField(fill = FieldFill.INSERT) | |||
private LocalDateTime createOn; | |||
@ApiModelProperty("修改时间") | |||
@TableField(fill = FieldFill.INSERT_UPDATE) | |||
private LocalDateTime updateOn; | |||
@ApiModelProperty("创建人 工号") | |||
@TableField(fill = FieldFill.INSERT) | |||
private String createBy; | |||
@ApiModelProperty("修改人 工号") | |||
@TableField(fill = FieldFill.INSERT_UPDATE) | |||
private String updateBy; | |||
private Integer status; | |||
@ApiModelProperty("是否符合信创符合性要求") | |||
private Boolean matchXcfhx; | |||
@ApiModelProperty("信创符合性申请备注") | |||
private String xcfhxApplyRemark; | |||
@ApiModelProperty("信创符合性申请其他附件") | |||
private String xcfhxApplyFiles; | |||
@ApiModelProperty("信创符合性测评报告文件") | |||
private String mhXcfhxReportFile; | |||
@ApiModelProperty("信创符合性测评记录ID") | |||
private String mhXcfhxReportRecordId; | |||
@ApiModelProperty("信创报告") | |||
private String xcfhxReportFiles; | |||
@ApiModelProperty("资源类型 1手动新增 2系统生成 3大数据局") | |||
private Integer sourceType; | |||
@ApiModelProperty("项目名称") | |||
private String projectName; | |||
public String getSourceTypeName() { | |||
return PurchaseSourceTypeEnum.desc(this.sourceType); | |||
} | |||
} |
@@ -3,6 +3,7 @@ package com.hz.pm.api.projectdeclared.service; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import com.hz.pm.api.common.model.constant.BizConst; | |||
import com.hz.pm.api.projectdeclared.model.entity.Contract; | |||
import com.ningdatech.basic.util.CollUtils; | |||
@@ -25,6 +26,13 @@ public interface IContractService extends IService<Contract> { | |||
return CollUtils.listToMap(list(query), Contract::getBidId); | |||
} | |||
default Contract getByBidId(Long bidId) { | |||
LambdaQueryWrapper<Contract> query = Wrappers.lambdaQuery(Contract.class) | |||
.eq(Contract::getBidId, bidId) | |||
.last(BizConst.LIMIT_1); | |||
return getOne(query); | |||
} | |||
default Map<Long, Contract> listByProjectIds(Collection<Long> projectIds) { | |||
LambdaQueryWrapper<Contract> query = Wrappers.lambdaQuery(Contract.class) | |||
.in(Contract::getProjectId, projectIds); | |||
@@ -0,0 +1,23 @@ | |||
package com.hz.pm.api.projectdeclared.service; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import com.hz.pm.api.projectdeclared.model.entity.Xinchuang; | |||
import com.hz.pm.api.projectdeclared.model.req.XcfhxListReq; | |||
import com.hz.pm.api.projectdeclared.model.vo.XcfhxApplyListVO; | |||
import java.util.List; | |||
/** | |||
* <p> | |||
* 服务类 | |||
* </p> | |||
* | |||
* @author zpf | |||
* @since 2024-07-2 | |||
*/ | |||
public interface IXinchuangService extends IService<Xinchuang> { | |||
List<XcfhxApplyListVO> listXcfhxApplyListVO(XcfhxListReq req); | |||
} |
@@ -0,0 +1,54 @@ | |||
package com.hz.pm.api.projectdeclared.service.impl; | |||
import cn.hutool.core.bean.BeanUtil; | |||
import cn.hutool.core.util.StrUtil; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import com.google.common.collect.Lists; | |||
import com.hz.pm.api.projectdeclared.mapper.XinchuangMapper; | |||
import com.hz.pm.api.projectdeclared.model.entity.Purchase; | |||
import com.hz.pm.api.projectdeclared.model.entity.Xinchuang; | |||
import com.hz.pm.api.projectdeclared.model.req.XcfhxListReq; | |||
import com.hz.pm.api.projectdeclared.model.vo.XcfhxApplyListVO; | |||
import com.hz.pm.api.projectdeclared.service.IXinchuangService; | |||
import com.hz.pm.api.projectlib.model.enumeration.status.TenderXcfhxApplyStatus; | |||
import com.hz.pm.api.user.security.model.UserFullInfoDTO; | |||
import com.hz.pm.api.user.util.LoginUserUtil; | |||
import com.ningdatech.basic.model.PageVo; | |||
import org.springframework.stereotype.Service; | |||
import java.util.List; | |||
import java.util.stream.Collectors; | |||
/** | |||
* <p> | |||
* 服务实现类 | |||
* </p> | |||
* | |||
* @author zpf | |||
* @since 2024-07-02 | |||
*/ | |||
@Service | |||
public class XinchuangServiceImpl extends ServiceImpl<XinchuangMapper, Xinchuang> | |||
implements IXinchuangService { | |||
@Override | |||
public List<XcfhxApplyListVO> listXcfhxApplyListVO(XcfhxListReq req) { | |||
LambdaQueryWrapper<Xinchuang> query = Wrappers.lambdaQuery(Xinchuang.class) | |||
.like(StrUtil.isNotBlank(req.getBidName()), Xinchuang::getBidName, req.getBidName()) | |||
.le(req.getCreateOnMax() != null, Xinchuang::getCreateOn, req.getCreateOnMax()) | |||
.ge(req.getCreateOnMin() != null, Xinchuang::getCreateOn, req.getCreateOnMin()) | |||
.eq(req.getStatus() != null, Xinchuang::getStatus, req.getStatus()) | |||
.eq(req.getSourceType() != null,Xinchuang::getSourceType,req.getSourceType() ) | |||
.orderByDesc(Xinchuang::getCreateOn); | |||
if (Boolean.TRUE.equals(req.getFinished())) { | |||
query.eq(Xinchuang::getStatus, TenderXcfhxApplyStatus.XCFHX_APPLY_PASSED.getCode()); | |||
} else if (Boolean.FALSE.equals(req.getFinished())){ | |||
query.ne(Xinchuang::getStatus, TenderXcfhxApplyStatus.XCFHX_APPLY_PASSED.getCode()); | |||
} | |||
List<Xinchuang> list = list(query); | |||
return list.stream().map(x -> BeanUtil.copyProperties(x,XcfhxApplyListVO.class)) | |||
.collect(Collectors.toList()); | |||
} | |||
} |