询价测试

This commit is contained in:
dxc
2021-05-12 09:15:38 +08:00
parent e893420b0c
commit ca690d7232
4 changed files with 48 additions and 3 deletions

View File

@ -112,7 +112,8 @@ public class ProjectEntrustInquiryServiceImpl extends BaseServiceImpl<ProjectEnt
* @param inquiryNoticeVO 询价返回信息结果实体
* @return 返回结果
*/
private boolean initInquiryProject(InquiryNoticeVO inquiryNoticeVO){
@Transactional(rollbackFor = Exception.class)
public boolean initInquiryProject(InquiryNoticeVO inquiryNoticeVO){
boolean result = false;
ProjectEntrust projectEntrust = this.getOne(new QueryWrapper<ProjectEntrust>().eq("procurement_plan_id",inquiryNoticeVO.getInquiryId()).ne("status",ProjectCommonUtil.ENTRUS_STATUS_9));
if(null == projectEntrust){
@ -146,7 +147,8 @@ public class ProjectEntrustInquiryServiceImpl extends BaseServiceImpl<ProjectEnt
* @param inquiryVO 询价单信息
* @return 返回拼装信息
*/
private ProjectEntrustVO assembleProjectEntrust(InquiryVO inquiryVO) {
@Transactional(rollbackFor = Exception.class)
public ProjectEntrustVO assembleProjectEntrust(InquiryVO inquiryVO) {
ProjectEntrustVO result = new ProjectEntrustVO();
@ -202,7 +204,8 @@ public class ProjectEntrustInquiryServiceImpl extends BaseServiceImpl<ProjectEnt
* 校验询价信息
* @param inquiryVO 询价实体类
*/
private void checkInquiryVO(InquiryVO inquiryVO){
@Transactional(rollbackFor = Exception.class)
public void checkInquiryVO(InquiryVO inquiryVO){
//询价单ID
if(StringUtils.isEmpty(inquiryVO.getInquiryId())){
ProjectExceptionEnum.FRAME_EXCEPTION_INQUIRY_ID_EMPTY.throwException();

View File

@ -381,4 +381,16 @@ public class ProjectSectionController{
return BaseResponse.success(projectSectionService.selectListByProjectId(projectId));
}
/**
* 根据项目ID获取标段最快流程
* @param projectId 项目ID
* @return 返回结果
*/
@ApiOperation("根据项目ID获取标段最快流程")
@GetMapping("/getMaxBusinessModule/{projectId}")
public BaseResponse<Integer> getMaxBusinessModule(@ApiParam(value = "项目ID", required = true) @PathVariable String projectId){
return BaseResponse.success(projectSectionService.getMaxBusinessModule(projectId));
}
}

View File

@ -194,4 +194,11 @@ public interface IProjectSectionService extends IBaseService<ProjectSection>{
* @return 返回结果
*/
List<ProjectSectionVO> selectListByProjectId(String projectId);
/**
* 根据项目ID获取标段最快流程
* @param projectId 项目ID
* @return 返回业务流程
*/
Integer getMaxBusinessModule(String projectId);
}

View File

@ -531,6 +531,29 @@ public class ProjectSectionServiceImpl extends BaseServiceImpl<ProjectSectionMap
return resultList;
}
@Override
public Integer getMaxBusinessModule(String projectId) {
Integer maxBusinessModule = 0;
//根据项目ID获取标段集合
ProjectSectionVO sectionVO = new ProjectSectionVO();
sectionVO.setProjectId(projectId);
List<ProjectSection> sectionList = this.getList(sectionVO);
//标段为空 报错提示
if(!CollectionUtils.isEmpty(sectionList)){
//获取标段是否有异常 如果有异常直接流程是归档 12
long count = sectionList.stream().filter(n -> (ProjectCommonUtil.SECTION_STATUS_9 == n.getStatus())).count();
if(count > 0){
maxBusinessModule = ProjectCommonUtil.BUSINESS_MODULE_12;
}else{
//不是异常获取最大的业务流程
maxBusinessModule = sectionList.stream().mapToInt(ProjectSection::getBusinessModule).max().getAsInt();
}
}else{
ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_SECTION_NOT_FIND.throwException();
}
return maxBusinessModule;
}
/**
* 拼装标段模块修改流程实体并插入数据
* @param sectionId 标段ID