Commit 2ea71e79 authored by neo's avatar neo

[bugfix] fixe getallprojectlist bug

parent b8342f16
......@@ -238,21 +238,44 @@ public class ProjectServiceImpl {
//去除project表已经存在的项目 g
data.forEach(dto -> {
getOrgProjectYears(dto.getEffectiveDate(), dto.getExpiredDate()).forEach(yDto -> {
dto.setYear(yDto.year);
dto.setStartPeriod(yDto.startMonth);
dto.setEndPeriod(yDto.endMonth);
dto.setName(dto.getOrganizationName() + "(" + dto.getYear() + ")");
ProjectDisplayDto orgDto = new ProjectDisplayDto();
orgDto.setCreateTime(dto.getCreateTime());
orgDto.setActive(dto.getActive());
orgDto.setOrganizationId(dto.getOrganizationId());
orgDto.setCode(dto.getCode());
orgDto.setId(dto.getId());
orgDto.setIndustryId(dto.getIndustryId());
orgDto.setRegionId(dto.getRegionId());
orgDto.setRuleType(dto.getRuleType());
orgDto.setServiceTypeId(dto.getServiceTypeId());
orgDto.setUpDate(dto.getUpDate());
orgDto.setServiceTypeName(dto.getServiceTypeName());
orgDto.setOrganizationName(dto.getOrganizationName());
orgDto.setIndustryName(dto.getIndustryName());
orgDto.setTemplateGroupId(dto.getTemplateGroupId());
orgDto.setTemplateGroupName(dto.getTemplateGroupName());
orgDto.setClientCode(dto.getClientCode());
orgDto.setDbName(dto.getDbName());
orgDto.setHaveCreateProject(dto.getHaveCreateProject());
orgDto.setEnterpriseAccountSetId(dto.getEnterpriseAccountSetId());
orgDto.setEffectiveDate(dto.getEffectiveDate());
orgDto.setExpiredDate(dto.getExpiredDate());
orgDto.setRegionName(dto.getRegionName());
orgDto.setYear(yDto.year);
orgDto.setStartPeriod(yDto.startMonth);
orgDto.setEndPeriod(yDto.endMonth);
orgDto.setName(orgDto.getOrganizationName() + "(" + orgDto.getYear() + ")");
//判断是否已经创建过该项目
//对于VAT,只创建今年及之后年份的项目(2018.1.2经Michelle确定,已放开vat限制)
//if ((projectList != null && projectList.Count > 0) || (int.Parse(orgDto.ServiceTypeId) == 2 && orgDto.Year < DateTime.Now.Year))
if (!pList.stream().anyMatch((Predicate<ProjectDisplayDto>) t -> t.getYear().equals(dto.getYear())
&& t.getServiceTypeId().equals(dto.getServiceTypeId())
&& t.getOrganizationId().equals(dto.getOrganizationId())
&& t.getEnterpriseAccountSetId().equals(dto.getEnterpriseAccountSetId())
&& t.getStartPeriod().equals(dto.getStartPeriod())
&& t.getEndPeriod().equals(dto.getEndPeriod()))) {
list.add(dto);
if (!pList.stream().anyMatch((Predicate<ProjectDisplayDto>) t -> t.getYear().equals(orgDto.getYear())
&& t.getServiceTypeId().equals(orgDto.getServiceTypeId())
&& t.getOrganizationId().equals(orgDto.getOrganizationId())
&& t.getEnterpriseAccountSetId().equals(orgDto.getEnterpriseAccountSetId())
&& t.getStartPeriod().equals(orgDto.getStartPeriod())
&& t.getEndPeriod().equals(orgDto.getEndPeriod()))) {
list.add(orgDto);
}
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment