Commit b595180a authored by neo.wang's avatar neo.wang

Merge branch 'dev_neo' into 'dev'

[BUGFIX] use equal instead of == compate Integer

See merge request root/atms!19
parents eaaa229e a94e5592
......@@ -134,11 +134,11 @@ public class ProjectServiceImpl implements ProjectService {
orgList.forEach(p -> {
List<ProjectDisplayDto> fixList = data.stream()
.filter((Predicate<ProjectDisplayDto>) x -> x.getOrganizationID() == p.getOrganizationID()
&& x.getEnterpriseAccountSetID() == p.getEnterpriseAccountSetID()
&& x.getServiceTypeID() == p.getServiceTypeID()
&& x.getYear() == p.getYear()
&& (x.getStartPeriod() != p.getStartPeriod() || x.getEndPeriod() != p.getEndPeriod()))
.filter((Predicate<ProjectDisplayDto>) x -> x.getOrganizationID().equals(p.getOrganizationID())
&& x.getEnterpriseAccountSetID().equals(p.getEnterpriseAccountSetID())
&& x.getServiceTypeID().equals(p.getServiceTypeID())
&& x.getYear().equals(p.getYear())
&& (!x.getStartPeriod().equals(p.getStartPeriod()) || x.getEndPeriod().equals(p.getEndPeriod())))
.collect(Collectors.toList());
if (fixList != null && !fixList.isEmpty()) {
......@@ -210,7 +210,7 @@ public class ProjectServiceImpl implements ProjectService {
addProjectResult.setDbName(project.getDbName());
addProjectResult.setProjectID(project.getID());
return addProjectResult;
}catch (Exception e){
} catch (Exception e) {
operationLogService.addDataAddLog(null, OperationModule.Project, userName,
Message.Project.AddProjectFail, e.getMessage(), projectDto.getName(), LOG_TYPE);
......@@ -224,10 +224,10 @@ public class ProjectServiceImpl implements ProjectService {
@Override
public Map<Integer, Integer> getProjectAllStatus(String dbName) {
List<ProjectStatusManage> psmList= projectMapper.selectProjectAllStatus(dbName);
Map<Integer,Integer> result =new HashMap<>(psmList.size());
psmList.forEach(m->{
result.put(m.getPeriodId(),m.getStatus());
List<ProjectStatusManage> psmList = projectMapper.selectProjectAllStatus(dbName);
Map<Integer, Integer> result = new HashMap<>(psmList.size());
psmList.forEach(m -> {
result.put(m.getPeriodId(), m.getStatus());
});
return result;
......@@ -243,7 +243,7 @@ public class ProjectServiceImpl implements ProjectService {
int post = Integer.parseInt(maxName.substring(3)) + 1;
if (post >= 100000) {
Integer pre = Integer.parseInt(String.valueOf(maxName.charAt(0)));
pre2 = ((char)(pre+1))+"";
pre2 = ((char) (pre + 1)) + "";
post2 = "00000";
} else if (post >= 10000) {
post2 = post + "";
......@@ -277,12 +277,12 @@ public class ProjectServiceImpl implements ProjectService {
//判断是否已经创建过该项目
//对于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() == dto.getYear()
&& t.getServiceTypeID() == dto.getServiceTypeID()
&& t.getOrganizationID() == dto.getOrganizationID()
&& t.getEnterpriseAccountSetID() == dto.getEnterpriseAccountSetID()
&& t.getStartPeriod() == dto.getStartPeriod()
&& t.getEndPeriod() == dto.getEndPeriod())) {
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);
}
});
......
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