Commit 7e3974a5 authored by tangwei's avatar tangwei

修改bug

parent 7a7b97eb
......@@ -315,8 +315,8 @@
a.biz_org_name bizOrgName,
a.build_name buildName,
a.build_id buildId,
c.keySiteCount,
( SELECT v.biz_org_name FROM cb_org_usr v WHERE v.sequence_nbr = a.parent_id ) parentName,
c.keySiteCount keySiteCount,
( SELECT v.biz_org_name FROM cb_org_usr v WHERE v.sequence_nbr = a.parent_id ) parentName,
max( CASE b.field_code WHEN 'businessCategory' THEN b.field_value_label ELSE "" END ) AS 'businessCategory',
max( CASE b.field_code WHEN 'companyFemaleEmployees' THEN b.field_value ELSE "" END ) AS 'companyFemaleEmployees',
max( CASE b.field_code WHEN 'companyLocation' THEN b.field_value ELSE "" END ) AS 'companyLocation',
......@@ -328,7 +328,7 @@
FROM
cb_org_usr a
LEFT JOIN cb_dynamic_form_instance b ON a.sequence_nbr = b.instance_id
LEFT JOIN (select belong_id, count(*) keySiteCount from cb_key_site group by belong_id) c on c.belong_id = a.sequence_nbr
LEFT JOIN (select belong_id belongId , count(*) keySiteCount from cb_key_site group by belong_id) c on c.belongId = a.sequence_nbr
WHERE
a.biz_org_name = #{bizOrgName}
</select>
......
......@@ -734,22 +734,22 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
List<OrgUsrzhDto> unitInvolvedDto = iOrgUsrService.getOrgUsrzhDto(alertCalled.getUnitInvolved());
JSONObject a1 = new JSONObject();
a1.put("name", "单位名称");
a1.put("value", ValidationUtil.isEmpty(unitInvolvedDto.get(0)) ? unitInvolvedDto.get(0).getBizOrgName() : "");
a1.put("value", !ValidationUtil.isEmpty(unitInvolvedDto.get(0)) ? unitInvolvedDto.get(0).getBizOrgName() : "");
JSONObject a2 = new JSONObject();
a2.put("name", "单位性质");
a2.put("value", ValidationUtil.isEmpty(unitInvolvedDto.get(0)) ? unitInvolvedDto.get(0).getCompanyNature() :
a2.put("value", !ValidationUtil.isEmpty(unitInvolvedDto.get(0)) ? unitInvolvedDto.get(0).getCompanyNature() :
"");
JSONObject a3 = new JSONObject();
a3.put("name", "单位电话");
a3.put("value", ValidationUtil.isEmpty(unitInvolvedDto.get(0)) ? unitInvolvedDto.get(0).getCompanyPhone() :
a3.put("value", !ValidationUtil.isEmpty(unitInvolvedDto.get(0)) ? unitInvolvedDto.get(0).getCompanyPhone() :
"");
JSONObject a4 = new JSONObject();
a4.put("name", "单位地址");
a4.put("value", ValidationUtil.isEmpty(unitInvolvedDto.get(0)) ? unitInvolvedDto.get(0).getCompanyLocation() :
a4.put("value", !ValidationUtil.isEmpty(unitInvolvedDto.get(0)) ? unitInvolvedDto.get(0).getCompanyLocation() :
"");
JSONObject a5 = new JSONObject();
a5.put("name", "重点部位数量");
a5.put("value", ValidationUtil.isEmpty(unitInvolvedDto.get(0).getKeySiteCount()) ? 0 : unitInvolvedDto.get(0).getKeySiteCount() + "个");
a5.put("value", !ValidationUtil.isEmpty(unitInvolvedDto.get(0)) ? unitInvolvedDto.get(0).getKeySiteCount()!=null?unitInvolvedDto.get(0).getKeySiteCount():0:0 + "个");
resultList.add(a1);
resultList.add(a2);
resultList.add(a3);
......
......@@ -539,7 +539,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
});
JSONObject resourceStatistics = new JSONObject();
Long carTotal = carResourcePage.getTotal();
double carTotal = carResourcePage.getTotal();
// 车辆统计
carCount(arrivedCarList, resourceStatistics, carTotal, "car");
......@@ -558,7 +558,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
return resourceStatistics;
}
public void carCount(List<Map<String, Object>> arrivedCarList, JSONObject resourceStatistics, Long carTotal, String jsoKey) {
public void carCount(List<Map<String, Object>> arrivedCarList, JSONObject resourceStatistics, double carTotal, String jsoKey) {
JSONObject car = new JSONObject();
car.put("total", carTotal);
car.put("count", arrivedCarList.size());
......@@ -588,12 +588,19 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
public void fireAgentOnCarCount(List<Map<String, Object>> totalCarList, List<Map<String, Object>> arrivedCarList,
JSONObject resourceStatistics, String equipType, String jsonKey) {
double agentCountAll = totalCarList.stream().mapToDouble(car -> ((List<Map<String, Object>>) car.get(
double agentCountAll = totalCarList.stream().mapToDouble(car -> car.get(
"resourceList")!=null?((List<Map<String, Object>>) car.get(
"resourceList")).stream().filter(res -> equipType.equals(res.get(
"equipType"))).mapToDouble(c -> (double) c.get("equipCount")).sum()).sum();
double agentCountArrived = arrivedCarList.stream().mapToDouble(car -> ((List<Map<String, Object>>) car.get(
"equipType"))).mapToDouble(c -> (double) c.get("equipCount")).sum():0).sum();
double agentCountArrived = arrivedCarList.stream().mapToDouble(car ->car.get("resourceList")!=null? ((List<Map<String, Object>>) car.get(
"resourceList")).stream().filter(res -> equipType.equals(res.get(
"equipType"))).mapToDouble(c -> (double) c.get("equipCount")).sum()).sum();
"equipType"))).mapToDouble(c -> (double) c.get("equipCount")).sum():0).sum();
JSONObject jsonObject = new JSONObject();
jsonObject.put("total", agentCountAll);
jsonObject.put("count", agentCountArrived);
......
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