|
@@ -51,6 +51,7 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
|
|
|
private IZEngineeringNodeService izEngineeringNodeService;
|
|
|
@Resource
|
|
|
private IZMaterialStatisticsService izMaterialStatisticsService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询民用工程
|
|
|
*/
|
|
@@ -172,7 +173,7 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
|
|
|
zEngineeringNodeBo.setCivliId(zEngineeringCivilVo.getId());
|
|
|
zEngineeringNodeBo.setCreateTime(zEngineeringCivilVo.getCreateTime());
|
|
|
ZEngineeringNodeBo query = zEngineeringNodeService.query(zEngineeringNodeBo);
|
|
|
- if (!ObjectUtils.isEmpty(query)){
|
|
|
+ if (!ObjectUtils.isEmpty(query)) {
|
|
|
zEngineeringNodeBo.setId(query.getId());
|
|
|
}
|
|
|
zEngineeringNodeService.insert(zEngineeringNodeBo);
|
|
@@ -205,7 +206,7 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
|
|
|
if (flag) {
|
|
|
ZEngineeringCivilVo zEngineeringCivilVo = baseMapper.selectVoById(update.getId());
|
|
|
ZEngineeringNodeBo zEngineeringNodeBo = bo.getzEngineeringNodeBo();
|
|
|
- if (!ObjectUtils.isEmpty(zEngineeringNodeBo)){
|
|
|
+ if (!ObjectUtils.isEmpty(zEngineeringNodeBo)) {
|
|
|
zEngineeringNodeBo.setCivliId(zEngineeringCivilVo.getId());
|
|
|
zEngineeringNodeBo.setCreateTime(zEngineeringCivilVo.getCreateTime());
|
|
|
zEngineeringNodeService.update(zEngineeringNodeBo);
|
|
@@ -256,21 +257,37 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
|
|
|
|
|
|
@Override
|
|
|
public List getObtainRoomcCompletionInformationList(ZEngineeringCivilBo bo) {
|
|
|
- List<roomStatusVo> roomStatusList= baseMapper.getObtainRoomcCompletionInformationList(bo);
|
|
|
- Map<String ,List<roomStatusVo>> map=new HashMap<>();
|
|
|
- map= roomStatusList.stream().collect(Collectors.groupingBy(item->item.getUnitName()));
|
|
|
- List areaList=new ArrayList();
|
|
|
- map.forEach((key,value)->{
|
|
|
- BulidingStatusVo bulidingStatusVo=new BulidingStatusVo();
|
|
|
+ List<roomStatusVo> roomStatusList = baseMapper.getObtainRoomcCompletionInformationList(bo);
|
|
|
+ Map<String, List<roomStatusVo>> map = new HashMap<>();
|
|
|
+ map = roomStatusList.stream().collect(Collectors.groupingBy(item -> item.getUnitName()));
|
|
|
+ List areaList = new ArrayList();
|
|
|
+ map.forEach((key, value) -> {
|
|
|
+ BulidingStatusVo bulidingStatusVo = new BulidingStatusVo();
|
|
|
bulidingStatusVo.setUnitName(key);
|
|
|
bulidingStatusVo.setUnitId(value.get(0).getUnitId());
|
|
|
//bulidingStatusVo.setRoomStatusVoList(value);
|
|
|
- Map<String ,List<roomStatusVo>> roomMap= value.stream().collect(Collectors.groupingBy(item-> String.valueOf(item.getRoomName().length()>3?item.getRoomName().charAt(1):item.getRoomName().charAt(0))));;
|
|
|
- List willDone = value.stream().filter(item->item.getRoomStatus().equals("未完工")).collect(Collectors.toList());
|
|
|
- List notstart =value.stream().filter(item->item.getRoomStatus().equals("未开工")).collect(Collectors.toList());
|
|
|
- List done =value.stream().filter(item->item.getRoomStatus().equals("完工")).collect(Collectors.toList());
|
|
|
- List<List<roomStatusVo>> roomStatusVoList=new ArrayList<>();
|
|
|
- roomMap.forEach((key1,value1)->{
|
|
|
+ Map<String, List<roomStatusVo>> roomMap = value.stream().collect(Collectors.groupingBy(item ->
|
|
|
+ String.valueOf(item.getRoomName().length() > 3 ? item.getRoomName().indexOf('(') == -1 ?
|
|
|
+ item.getRoomName().substring(0, 2) :
|
|
|
+ item.getRoomName().substring(0, item.getRoomName().indexOf('(')).trim().length() > 3 ?
|
|
|
+ item.getRoomName().substring(0, item.getRoomName().indexOf('(')).trim().substring(0, 2) :
|
|
|
+ item.getRoomName().substring(0, item.getRoomName().indexOf('(')).trim().substring(0, 1) :
|
|
|
+ item.getRoomName().substring(0, 1))));
|
|
|
+ List willDone = value.stream().filter(item -> item.getRoomStatus().equals("未完工")).collect(Collectors.toList());
|
|
|
+ List notstart = value.stream().filter(item -> item.getRoomStatus().equals("未开工")).collect(Collectors.toList());
|
|
|
+ List done = value.stream().filter(item -> item.getRoomStatus().equals("完工")).collect(Collectors.toList());
|
|
|
+ List<List<roomStatusVo>> roomStatusVoList = new ArrayList<>();
|
|
|
+ Map<String, List<roomStatusVo>> sortMap = roomMap.entrySet().stream()
|
|
|
+ .sorted(Comparator.comparingInt(entry -> Integer.parseInt(entry.getKey())))
|
|
|
+ .collect(
|
|
|
+ Collectors.toMap(
|
|
|
+ Map.Entry::getKey,
|
|
|
+ Map.Entry::getValue,
|
|
|
+ (oldVal, newVal) -> oldVal,
|
|
|
+ LinkedHashMap::new
|
|
|
+ ));
|
|
|
+ sortMap.forEach((key1, value1) -> {
|
|
|
+ System.out.println(key1);
|
|
|
roomStatusVoList.add(value1);
|
|
|
});
|
|
|
bulidingStatusVo.setRoomStatusVoList(roomStatusVoList);
|
|
@@ -279,29 +296,28 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
|
|
|
bulidingStatusVo.setNotstart(String.valueOf(notstart.size()));
|
|
|
areaList.add(bulidingStatusVo);
|
|
|
});
|
|
|
- return areaList ;
|
|
|
+ return areaList;
|
|
|
}
|
|
|
-
|
|
|
@Override
|
|
|
- public TableDataInfo<areaStatusVo> getAreaCompletionInformationList(ZEngineeringCivilBo bo,PageQuery po) {
|
|
|
- LambdaQueryWrapper<ZArea> lqw =Wrappers.lambdaQuery();
|
|
|
+ public TableDataInfo<areaStatusVo> getAreaCompletionInformationList(ZEngineeringCivilBo bo, PageQuery po) {
|
|
|
+ LambdaQueryWrapper<ZArea> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getAreaId()), ZArea::getId, bo.getAreaId());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getDistrict()), ZArea::getDistrict, bo.getDistrict());
|
|
|
Page<ZBuildingBo> page = new Page<>(po.getPageNum(), po.getPageSize());
|
|
|
- Page<ZAreaVo> result = zAreaMapper.selectVoPage(po.build(),lqw);
|
|
|
- List<ZAreaVo> IdList= result.getRecords();
|
|
|
- List Id=new ArrayList();
|
|
|
- IdList.stream().forEach(item->{
|
|
|
+ Page<ZAreaVo> result = zAreaMapper.selectVoPage(po.build(), lqw);
|
|
|
+ List<ZAreaVo> IdList = result.getRecords();
|
|
|
+ List Id = new ArrayList();
|
|
|
+ IdList.stream().forEach(item -> {
|
|
|
Id.add(item.getId());
|
|
|
});
|
|
|
- List<areaWillDoneVo> hourseList=baseMapper.getAreaCompletionInformationList(Id,bo.getEnginCycle());
|
|
|
- Map<String,List<areaWillDoneVo>> stringListMap= hourseList.stream().collect(Collectors.groupingBy(item->item.getAreaId()));
|
|
|
- List<areaStatusVo> areaList=new ArrayList<>();
|
|
|
- stringListMap.forEach((key,value)->{
|
|
|
- areaStatusVo areaStatusVo=new areaStatusVo();
|
|
|
- List willDone = value.stream().filter(item->item.getRoomStatus().equals("未完工")).collect(Collectors.toList());
|
|
|
- List notstart =value.stream().filter(item->item.getRoomStatus().equals("未开工")).collect(Collectors.toList());
|
|
|
- List done =value.stream().filter(item->item.getRoomStatus().equals("完工")).collect(Collectors.toList());
|
|
|
+ List<areaWillDoneVo> hourseList = baseMapper.getAreaCompletionInformationList(Id, bo.getEnginCycle());
|
|
|
+ Map<String, List<areaWillDoneVo>> stringListMap = hourseList.stream().collect(Collectors.groupingBy(item -> item.getAreaId()));
|
|
|
+ List<areaStatusVo> areaList = new ArrayList<>();
|
|
|
+ stringListMap.forEach((key, value) -> {
|
|
|
+ areaStatusVo areaStatusVo = new areaStatusVo();
|
|
|
+ List willDone = value.stream().filter(item -> item.getRoomStatus().equals("未完工")).collect(Collectors.toList());
|
|
|
+ List notstart = value.stream().filter(item -> item.getRoomStatus().equals("未开工")).collect(Collectors.toList());
|
|
|
+ List done = value.stream().filter(item -> item.getRoomStatus().equals("完工")).collect(Collectors.toList());
|
|
|
areaStatusVo.setAreaId(key);
|
|
|
areaStatusVo.setAreaName(value.get(0).getName());
|
|
|
areaStatusVo.setWillDone(String.valueOf(willDone.size()));
|
|
@@ -309,21 +325,21 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
|
|
|
areaStatusVo.setDone(String.valueOf(done.size()));
|
|
|
areaList.add(areaStatusVo);
|
|
|
});
|
|
|
- Page<areaStatusVo> page2=new Page<>();
|
|
|
- BeanUtils.copyProperties(result,page2);
|
|
|
+ Page<areaStatusVo> page2 = new Page<>();
|
|
|
+ BeanUtils.copyProperties(result, page2);
|
|
|
page2.setRecords(areaList);
|
|
|
return TableDataInfo.build(page2);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public areaStatusVo getsumStatus(ZEngineeringCivilBo bo) {
|
|
|
- areaStatusVo areaStatusVo= baseMapper.getsumStatus(bo.getEnginCycle());
|
|
|
- areaStatusVo.setNotstart(String.valueOf(Integer.parseInt(areaStatusVo.getNotstart())-Integer.parseInt(areaStatusVo.getWillDone())-Integer.parseInt(areaStatusVo.getDone())));
|
|
|
+ areaStatusVo areaStatusVo = baseMapper.getsumStatus(bo.getEnginCycle());
|
|
|
+ areaStatusVo.setNotstart(String.valueOf(Integer.parseInt(areaStatusVo.getNotstart()) - Integer.parseInt(areaStatusVo.getWillDone()) - Integer.parseInt(areaStatusVo.getDone())));
|
|
|
return areaStatusVo;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int batchReview(ZEngineeringCivilBo bo,ZEngineeringNodeBo zEngineeringNodeBo) {
|
|
|
+ public int batchReview(ZEngineeringCivilBo bo, ZEngineeringNodeBo zEngineeringNodeBo) {
|
|
|
ZEngineeringCivil add = BeanUtil.toBean(bo, ZEngineeringCivil.class);
|
|
|
validEntityBeforeSave(add);
|
|
|
LambdaQueryWrapper<ZEngineeringCivil> lqw = Wrappers.lambdaQuery();
|
|
@@ -334,25 +350,23 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getEnginCycle()), ZEngineeringCivil::getEnginCycle, bo.getEnginCycle());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getEnginClassification()), ZEngineeringCivil::getEnginClassification, bo.getEnginClassification());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getEnginType()), ZEngineeringCivil::getEnginType, bo.getEnginType());
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
|
|
|
- lqw.like(StringUtils.isNotBlank(bo.getCreateTime().toString()), ZEngineeringCivil::getCreateTime, "%"+dateFormat.format(bo.getCreateTime())+"%");
|
|
|
- Long sumcount=baseMapper.selectCount(lqw);
|
|
|
+// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
|
|
|
+ lqw.like(StringUtils.isNotBlank(bo.getReviewTime().toString()), ZEngineeringCivil::getCreateTime, "%" + bo.getReviewTime() + "%");
|
|
|
+ Long sumcount = baseMapper.selectCount(lqw);
|
|
|
// List<ZEngineeringCivil> zEngineeringCivilList=baseMapper.selectList(lqw);
|
|
|
/**
|
|
|
* 线程执行插入量
|
|
|
*/
|
|
|
- int count=5000;
|
|
|
- List <ZEngineeringCivil> newList = new ArrayList() ;
|
|
|
- if (sumcount>0)
|
|
|
- {
|
|
|
+ int count = 5000;
|
|
|
+ List<ZEngineeringCivil> newList = new ArrayList();
|
|
|
+ if (sumcount > 0) {
|
|
|
//线程数量(根据查询总数量进行分配线程数量)
|
|
|
- int runSize= (int) (sumcount/count+1);
|
|
|
- ScheduledThreadPoolExecutor threadPoolTaskExecutor=new ScheduledThreadPoolExecutor(runSize);
|
|
|
+ int runSize = (int) (sumcount / count + 1);
|
|
|
+ ScheduledThreadPoolExecutor threadPoolTaskExecutor = new ScheduledThreadPoolExecutor(runSize);
|
|
|
CountDownLatch countDownLatch = new CountDownLatch(runSize);
|
|
|
- for(int i=0;i<runSize;i++)
|
|
|
- {
|
|
|
- Page page=new Page<>(i,count);
|
|
|
- Page<ZEngineeringCivil> zEngineeringCivilPage=baseMapper.selectPage(page,lqw);
|
|
|
+ for (int i = 0; i < runSize; i++) {
|
|
|
+ Page page = new Page<>(i, count);
|
|
|
+ Page<ZEngineeringCivil> zEngineeringCivilPage = baseMapper.selectPage(page, lqw);
|
|
|
// if((i+1)==runSize){
|
|
|
// int startIndex = (i*count);;
|
|
|
// int endIndex = zEngineeringCivilList.size();
|
|
@@ -363,7 +377,7 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
|
|
|
// newList =zEngineeringCivilList.subList(startIndex,endIndex);
|
|
|
// }
|
|
|
|
|
|
- threadPoolTaskExecutor.execute(new RiewTask(zEngineeringCivilPage.getRecords(),zEngineeringNodeBo,countDownLatch));
|
|
|
+ threadPoolTaskExecutor.execute(new RiewTask(zEngineeringCivilPage.getRecords(), zEngineeringNodeBo, countDownLatch));
|
|
|
}
|
|
|
threadPoolTaskExecutor.shutdown();
|
|
|
// try {
|