Commit d2be721a authored by chenzhao's avatar chenzhao

Merge remote-tracking branch 'origin/developer_bw' into developer_bw

parents 06709f82 4dc10863
...@@ -292,7 +292,7 @@ public class StatisticsHomepageServiceImpl { ...@@ -292,7 +292,7 @@ public class StatisticsHomepageServiceImpl {
resultMap.put("financing",maps); resultMap.put("financing",maps);
} }
li.put("financingNum",financingNum); li.put("financingNum",financingNum);
li.put("disbursementMoney",new BigDecimal(disbursementMoney).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); li.put("disbursementMoney",new BigDecimal(disbursementMoney/10000).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
break; break;
default: default:
resultMap.put("inverter",maps); resultMap.put("inverter",maps);
......
...@@ -269,7 +269,11 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -269,7 +269,11 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
//删除待办 //删除待办
toDoTasksService.deleteTodoByBusinessIds(businessIds); toDoTasksService.deleteTodoByBusinessIds(businessIds);
} }
workOrderPowerStationMapper.delete(up);
LambdaQueryWrapper<WorkOrderPowerStation> deleteWrapper = new LambdaQueryWrapper();
deleteWrapper.eq(WorkOrderPowerStation::getWorkOrderId, model.getSequenceNbr());
deleteWrapper.eq(WorkOrderPowerStation::getPowerStationConstructionStatus, "待施工");
workOrderPowerStationMapper.delete(deleteWrapper);
// 保存派工单 电站信息 // 保存派工单 电站信息
List<PeasantHousehold> peasantHouseholdId = model.getPeasantHouseholdId(); List<PeasantHousehold> peasantHouseholdId = model.getPeasantHouseholdId();
List<WorkOrderPowerStation> li = new ArrayList<>(); List<WorkOrderPowerStation> li = new ArrayList<>();
...@@ -320,7 +324,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -320,7 +324,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
private void dealWorkOrderPowerStation(List<WorkOrderPowerStation> newWorkOrderPowerStations,List<WorkOrderPowerStation> oldWorkOrderPowerStations) { private void dealWorkOrderPowerStation(List<WorkOrderPowerStation> newWorkOrderPowerStations,List<WorkOrderPowerStation> oldWorkOrderPowerStations) {
//判断是否有非待施工的农户没有选中 //判断是否有非待施工的农户没有选中
if (CollectionUtil.isNotEmpty(oldWorkOrderPowerStations) && CollectionUtil.isNotEmpty(newWorkOrderPowerStations)){ if (CollectionUtil.isNotEmpty(oldWorkOrderPowerStations) && CollectionUtil.isNotEmpty(newWorkOrderPowerStations)){
List<Long> notWorkOrderPeasantHouseholdIds = new ArrayList<>(); Set<Long> notWorkOrderPeasantHouseholdIds = new HashSet<>();
Map<Long,Long> map = new HashMap<>(); Map<Long,Long> map = new HashMap<>();
for (WorkOrderPowerStation oldWorkOrderPowerStation : oldWorkOrderPowerStations) { for (WorkOrderPowerStation oldWorkOrderPowerStation : oldWorkOrderPowerStations) {
if(!"待施工".equals(oldWorkOrderPowerStation.getPowerStationConstructionStatus())){ if(!"待施工".equals(oldWorkOrderPowerStation.getPowerStationConstructionStatus())){
...@@ -328,16 +332,27 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -328,16 +332,27 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
} }
map.put(oldWorkOrderPowerStation.getPeasantHouseholdId(),oldWorkOrderPowerStation.getSequenceNbr()); map.put(oldWorkOrderPowerStation.getPeasantHouseholdId(),oldWorkOrderPowerStation.getSequenceNbr());
} }
Set<Long> newPeasantHouseholdIds =new HashSet<>();
Map<Long,WorkOrderPowerStation> newMap = new HashMap<>();
for (WorkOrderPowerStation newWorkOrderPowerStation : newWorkOrderPowerStations) { for (WorkOrderPowerStation newWorkOrderPowerStation : newWorkOrderPowerStations) {
Long peasantHouseholdId = newWorkOrderPowerStation.getPeasantHouseholdId(); Long peasantHouseholdId = newWorkOrderPowerStation.getPeasantHouseholdId();
if(notWorkOrderPeasantHouseholdIds.contains(peasantHouseholdId)){ newPeasantHouseholdIds.add(peasantHouseholdId);
PeasantHousehold peasantHousehold = peasantHouseholdMapper.selectById(peasantHouseholdId);
throw new BadRequest(peasantHousehold.getOwnersName() + "电站已经进行施工,不能删除");
}
newWorkOrderPowerStation.setSequenceNbr(map.get(peasantHouseholdId)); newWorkOrderPowerStation.setSequenceNbr(map.get(peasantHouseholdId));
newMap.put(peasantHouseholdId,newWorkOrderPowerStation);
}
if(CollectionUtil.isNotEmpty(notWorkOrderPeasantHouseholdIds)){
for (Long notWorkOrderPeasantHouseholdId : notWorkOrderPeasantHouseholdIds) {
if(!newPeasantHouseholdIds.contains(notWorkOrderPeasantHouseholdId)){
PeasantHousehold peasantHousehold = peasantHouseholdMapper.selectById(notWorkOrderPeasantHouseholdId);
throw new BadRequest(peasantHousehold.getOwnersName() + "电站已经进行施工,不能删除");
}
newWorkOrderPowerStations.remove(newMap.get(notWorkOrderPeasantHouseholdId));
}
} }
} }
workOrderPowerStationServiceImpl.saveBatch(newWorkOrderPowerStations); if(CollectionUtil.isNotEmpty(newWorkOrderPowerStations)){
workOrderPowerStationServiceImpl.saveOrUpdateBatch(newWorkOrderPowerStations);
}
} }
public WorkOrder selectOne(Long sequenceNbr) { public WorkOrder selectOne(Long sequenceNbr) {
...@@ -872,10 +887,13 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -872,10 +887,13 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
LambdaQueryWrapper<WorkOrderPowerStation> qu = new LambdaQueryWrapper(); LambdaQueryWrapper<WorkOrderPowerStation> qu = new LambdaQueryWrapper();
qu.eq(WorkOrderPowerStation::getSequenceNbr, workOrderPowerStationId); qu.eq(WorkOrderPowerStation::getSequenceNbr, workOrderPowerStationId);
WorkOrderPowerStation workOrderPowerStation = workOrderPowerStationMapper.selectOne(qu); WorkOrderPowerStation workOrderPowerStation = workOrderPowerStationMapper.selectOne(qu);
PowerStationEngineeringInfoAllDto surveyInfoAllDto = new PowerStationEngineeringInfoAllDto();
if(Objects.isNull(workOrderPowerStation)){
return surveyInfoAllDto;
}
Long peasantHouseholdId = workOrderPowerStation.getPeasantHouseholdId(); Long peasantHouseholdId = workOrderPowerStation.getPeasantHouseholdId();
Long workOrderId = workOrderPowerStation.getWorkOrderId(); Long workOrderId = workOrderPowerStation.getWorkOrderId();
PowerStationEngineeringInfoAllDto surveyInfoAllDto = new PowerStationEngineeringInfoAllDto();
PeasantHousehold peasantHousehold = new PeasantHousehold(); PeasantHousehold peasantHousehold = new PeasantHousehold();
LambdaQueryWrapper<PeasantHousehold> peasantHouseholdWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PeasantHousehold> peasantHouseholdWrapper = new LambdaQueryWrapper<>();
......
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