Commit f05fe12e authored by hezhuozhi's avatar hezhuozhi

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

parents 41e754f6 83e499aa
......@@ -45,6 +45,8 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
List<String> getRegionNode(String province);
List<String> getRegionNodeByCode(String code);
List<DropDown> getRegionAll();
@UserEmpower(field ={"hygf_regional_companies.regional_companies_code"} ,dealerField ={"hygf_unit_info.amos_company_code","hygf_regional_companies.regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
......
package com.yeejoin.amos.boot.module.hygf.api.mapper;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
public interface StatisticsHomepageMapper {
public List<Map<String,Object>> surveyStatusTotal(@RequestParam(value = "developerCode") String developerCode, @RequestParam(value = "regionalCompaniesCode")String regionalCompaniesCode, @RequestParam(value = "province")String province, @RequestParam(value = "city") String city, @RequestParam(value = "district")String district);
public List<Map<String,Object>> contractStatusTotal(@RequestParam(value = "developerCode") String developerCode, @RequestParam(value = "regionalCompaniesCode")String regionalCompaniesCode, @RequestParam(value = "province")String province, @RequestParam(value = "city") String city, @RequestParam(value = "district")String district);
public List<Map<String,Object>> desionTotal(@RequestParam(value = "developerCode") String developerCode, @RequestParam(value = "regionalCompaniesCode")String regionalCompaniesCode, @RequestParam(value = "province")String province, @RequestParam(value = "city") String city, @RequestParam(value = "district")String district);
public List<Map<String,Object>> preparationMoneyTotal(@RequestParam(value = "developerCode") String developerCode, @RequestParam(value = "regionalCompaniesCode")String regionalCompaniesCode, @RequestParam(value = "province")String province, @RequestParam(value = "city") String city, @RequestParam(value = "district")String district);
public List<Map<String,Object>> workOrderTotal(@RequestParam(value = "developerCode") String developerCode, @RequestParam(value = "regionalCompaniesCode")String regionalCompaniesCode, @RequestParam(value = "province")String province, @RequestParam(value = "city") String city, @RequestParam(value = "district")String district);
public List<Map<String,Object>> gridStatusTotal(@RequestParam(value = "developerCode") String developerCode, @RequestParam(value = "regionalCompaniesCode")String regionalCompaniesCode, @RequestParam(value = "province")String province, @RequestParam(value = "city") String city, @RequestParam(value = "district")String district);
public List<Map<String,Object>> acceptanceStatusTotal(@RequestParam(value = "developerCode") String developerCode, @RequestParam(value = "regionalCompaniesCode")String regionalCompaniesCode, @RequestParam(value = "province")String province, @RequestParam(value = "city") String city, @RequestParam(value = "district")String district);
public List<Map<String,Object>> financingStatusTotal(@RequestParam(value = "developerCode") String developerCode, @RequestParam(value = "regionalCompaniesCode")String regionalCompaniesCode, @RequestParam(value = "province")String province, @RequestParam(value = "city") String city, @RequestParam(value = "district")String district);
public List<Map<String,Object>> inverterTotal(@RequestParam(value = "developerCode") String developerCode, @RequestParam(value = "regionalCompaniesCode")String regionalCompaniesCode, @RequestParam(value = "province")String province, @RequestParam(value = "city") String city, @RequestParam(value = "district")String district, @RequestParam(value = "regions")List<String> regions);
}
......@@ -273,6 +273,28 @@
Subtree;
</select>
<select id="getRegionNodeByCode" resultType="string">
WITH RECURSIVE Subtree AS (
SELECT
SEQUENCE_NBR
FROM
systemctl_region sr
WHERE
sr.REGION_CODE = #{code}
UNION ALL
SELECT
h.SEQUENCE_NBR
FROM
systemctl_region h
JOIN
Subtree s ON h.PARENT_ID = s.SEQUENCE_NBR
)
SELECT
*
FROM
Subtree;
</select>
<select id="getRegionByProvince" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.DropDown">
SELECT privilege_company.ORG_CODE orgCode,
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.StatisticsHomepageMapper">
<select id="surveyStatusTotal" resultType="map">
SELECT
SUM(CASE WHEN ps.process_status = '不通过' THEN 1 ELSE 0 END) AS '未通过',
SUM(CASE WHEN ps.process_status = '进行中' AND ps.business_status = '通过' THEN 1 ELSE 0 END) AS '已完成(法务审核)',
SUM(CASE WHEN ps.process_status = '完成' THEN 1 ELSE 0 END) AS completeTotal,
SUM(CASE WHEN ps.process_status = '进行中' AND (ps.business_status IS NULL OR ps.design_status IS NULL OR ps.technology_status IS NULL) THEN 1 ELSE 0 END) AS '进行中(审核)',
( SELECT count(*) FROM hygf_peasant_household WHERE construction_state = '待勘察' and is_delete = 0
<if test="developerCode != null and developerCode != ''">
AND hygf_peasant_household.developer_code = #{developerCode}
</if>
<if test="regionalCompaniesCode != null and regionalCompaniesCode != ''">
AND hygf_peasant_household.regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="province != null and province != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{province},'%')
</if>
<if test="city != null and city != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{city},'%')
</if>
<if test="district != null and district != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{district},'%')
</if>
) AS '未勘察'
FROM
hygf_power_station ps
LEFT JOIN
hygf_peasant_household ph ON ps.peasant_household_id = ph.sequence_nbr
WHERE
ps.is_delete = 0
<if test="developerCode != null and developerCode != ''">
AND ph.developer_code = #{developerCode}
</if>
<if test="regionalCompaniesCode != null and regionalCompaniesCode != ''">
AND ph.regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="province != null and province != ''">
AND ph.project_address LIKE CONCAT ('%',#{province},'%')
</if>
<if test="city != null and city != ''">
AND ph.project_address LIKE CONCAT ('%',#{city},'%')
</if>
<if test="district != null and district != ''">
AND ph.project_address LIKE CONCAT ('%',#{district},'%')
</if>
</select>
<select id="contractStatusTotal" resultType="map">
SELECT
SUM(CASE WHEN status = '未签署' and initiate_status = '未发起' THEN 1 ELSE 0 END) AS '未发起',
SUM(CASE WHEN status = '双方已签署' THEN 1 ELSE 0 END) AS '双方已签署',
SUM(CASE WHEN status = '农户已签署' THEN 1 ELSE 0 END) AS '农户已签署'
FROM
hygf_household_contract
LEFT JOIN
hygf_peasant_household ON hygf_household_contract.peasant_household_id = hygf_peasant_household.sequence_nbr WHERE
status != '已作废'
<if test="developerCode != null and developerCode != ''">
AND hygf_peasant_household.developer_code = #{developerCode}
</if>
<if test="regionalCompaniesCode != null and regionalCompaniesCode != ''">
AND hygf_peasant_household.regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="province != null and province != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{province},'%')
</if>
<if test="city != null and city != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{city},'%')
</if>
<if test="district != null and district != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{district},'%')
</if>
</select>
<select id="desionTotal" resultType="map">
SELECT
count( typical_diagram ) '典设图已上传',
SUM( CASE WHEN component_layout IS NOT NULL THEN 1 ELSE 0 END ) AS '施工图已上传'
FROM
hygf_design_information
LEFT JOIN
hygf_peasant_household ON hygf_design_information.peasant_household_id = hygf_peasant_household.sequence_nbr
<if test="developerCode != null and developerCode != ''">
AND hygf_peasant_household.developer_code = #{developerCode}
</if>
<if test="regionalCompaniesCode != null and regionalCompaniesCode != ''">
AND hygf_peasant_household.regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="province != null and province != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{province},'%')
</if>
<if test="city != null and city != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{city},'%')
</if>
<if test="district != null and district != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{district},'%')
</if>
</select>
<select id="preparationMoneyTotal" resultType="map">
SELECT
SUM( CASE WHEN preparation_money_state = '待发货' or preparation_money_state = '暂存发货' THEN 1 ELSE 0 END ) AS '待发货',
SUM( CASE WHEN preparation_money_state = '备货完成' THEN 1 ELSE 0 END ) AS '已收货',
SUM( CASE WHEN preparation_money_state = '待收货' THEN 1 ELSE 0 END ) AS '已发货'
FROM
hygf_peasant_household
WHERE
preparation_money_state IS NOT NULL
<if test="developerCode != null and developerCode != ''">
AND hygf_peasant_household.developer_code = #{developerCode}
</if>
<if test="regionalCompaniesCode != null and regionalCompaniesCode != ''">
AND hygf_peasant_household.regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="province != null and province != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{province},'%')
</if>
<if test="city != null and city != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{city},'%')
</if>
<if test="district != null and district != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{district},'%')
</if>
</select>
<select id="workOrderTotal" resultType="map">
SELECT
count(*) AS total,
(CASE WHEN power_station_construction_status = '待施工' THEN '派工发料'
WHEN power_station_construction_status = '未通过' THEN '未通过'
WHEN power_station_construction_status = '施工中' or power_station_construction_status = '待登记' THEN '施工资料已上传'
WHEN power_station_construction_status = '待审核' and work_order_power_station_node IS NULL THEN '完工登记'
WHEN power_station_construction_status = '待审核' and work_order_power_station_node ='area' THEN '完工自审'
WHEN power_station_construction_status = '待审核' and work_order_power_station_node in ('engineering','design') THEN '审核中'
ELSE '已完成' END )
AS statusText,
ROUND(COALESCE(SUM(ei.real_scale), 0), 2) AS realScale FROM
hygf_work_order_power_station
LEFT JOIN
hygf_power_station_engineering_info ei on ei.work_order_power_station_id =hygf_work_order_power_station.sequence_nbr
LEFT JOIN
hygf_peasant_household ON hygf_work_order_power_station.peasant_household_id = hygf_peasant_household.sequence_nbr
<if test="developerCode != null and developerCode != ''">
AND hygf_peasant_household.developer_code = #{developerCode}
</if>
<if test="regionalCompaniesCode != null and regionalCompaniesCode != ''">
AND hygf_peasant_household.regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="province != null and province != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{province},'%')
</if>
<if test="city != null and city != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{city},'%')
</if>
<if test="district != null and district != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{district},'%')
</if>
GROUP BY
power_station_construction_status,work_order_power_station_node
</select>
<select id="gridStatusTotal" resultType="map">
SELECT
COUNT( * ) AS total,
CASE WHEN grid_status = '1' THEN '待登记'
WHEN grid_status = '2' THEN '审核中'
WHEN grid_status = '3' THEN '已完成'
WHEN grid_status = '4' THEN '未通过'
WHEN grid_status = '5' THEN '审核中'
WHEN grid_status = '6' THEN '审核中'
WHEN grid_status = '7' THEN '审核中'
WHEN grid_status = '8' THEN '审核中'
WHEN grid_status = '9' THEN '整改待审核'
ELSE '待整改' END AS statusText,
ROUND(COALESCE(SUM(ei.real_scale), 0), 2) AS realScale
FROM
hygf_basic_grid_record
LEFT JOIN hygf_work_order_power_station ps ON ps.sequence_nbr = hygf_basic_grid_record.work_order_power_station_id
LEFT JOIN hygf_power_station_engineering_info ei ON ei.work_order_power_station_id = ps.sequence_nbr
LEFT JOIN hygf_peasant_household ON hygf_basic_grid_record.peasant_household_id = hygf_peasant_household.sequence_nbr
<if test="developerCode != null and developerCode != ''">
AND hygf_peasant_household.developer_code = #{developerCode}
</if>
<if test="regionalCompaniesCode != null and regionalCompaniesCode != ''">
AND hygf_peasant_household.regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="province != null and province != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{province},'%')
</if>
<if test="city != null and city != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{city},'%')
</if>
<if test="district != null and district != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{district},'%')
</if>
GROUP BY
grid_status
</select>
<select id="acceptanceStatusTotal" resultType="map">
SELECT
COUNT(*) AS total,
CASE
WHEN acceptance_check_status = '15' THEN '待提交'
WHEN acceptance_check_status = '2' THEN '审核中'
WHEN acceptance_check_status = '3' THEN '已完成'
WHEN acceptance_check_status = '4' THEN '未通过'
WHEN acceptance_check_status = '7' THEN '审核中'
WHEN acceptance_check_status = '9' THEN '整改待审核'
WHEN acceptance_check_status = '11' THEN '审核中'
WHEN acceptance_check_status = '12' THEN '审核中'
WHEN acceptance_check_status = '13' THEN '审核中'
WHEN acceptance_check_status = '14' THEN '审核中'
ELSE '待整改'
END AS statusText,
ROUND(COALESCE(SUM(ei.real_scale), 0), 2) AS realScale
FROM
hygf_acceptance_check
LEFT JOIN
hygf_work_order_power_station ps ON ps.sequence_nbr = hygf_acceptance_check.work_order_power_station_id
LEFT JOIN
hygf_power_station_engineering_info ei ON ei.work_order_power_station_id = ps.sequence_nbr
LEFT JOIN
hygf_peasant_household ON hygf_acceptance_check.peasant_household_id = hygf_peasant_household.sequence_nbr
<if test="developerCode != null and developerCode != ''">
AND hygf_peasant_household.developer_code = #{developerCode}
</if>
<if test="regionalCompaniesCode != null and regionalCompaniesCode != ''">
AND hygf_peasant_household.regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="province != null and province != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{province},'%')
</if>
<if test="city != null and city != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{city},'%')
</if>
<if test="district != null and district != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{district},'%')
</if>
GROUP BY
acceptance_check_status
</select>
<select id="financingStatusTotal" resultType="map">
SELECT
COUNT( * ) AS total,
status AS statusText,
ROUND(COALESCE(SUM(ei.real_scale), 0), 2) AS realScale
FROM
hygf_financing_info
LEFT JOIN hygf_work_order_power_station ps ON ps.peasant_household_id = hygf_financing_info.peasant_household_id
LEFT JOIN hygf_power_station_engineering_info ei ON ei.work_order_power_station_id = ps.sequence_nbr
LEFT JOIN hygf_peasant_household ON hygf_financing_info.peasant_household_id = hygf_peasant_household.sequence_nbr
<if test="developerCode != null and developerCode != ''">
AND hygf_peasant_household.developer_code = #{developerCode}
</if>
<if test="regionalCompaniesCode != null and regionalCompaniesCode != ''">
AND hygf_peasant_household.regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="province != null and province != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{province},'%')
</if>
<if test="city != null and city != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{city},'%')
</if>
<if test="district != null and district != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{district},'%')
</if>
GROUP BY
status
</select>
<select id="inverterTotal" resultType="map">
SELECT
COUNT(*) total,
'接入逆变器' AS statusText
FROM
hygf_jp_inverter ji
LEFT JOIN hygf_jp_station jp ON jp.third_station_id = ji.third_station_id
LEFT JOIN privilege_company pc on jp.regional_companies_code = pc.ORG_CODE
WHERE
jp.regional_companies_code IS NOT NULL
AND jp.amos_company_code IS NOT NULL
<if test="developerCode != null and developerCode != ''">
AND jp.amos_company_code = #{developerCode}
</if>
<if test="regionalCompaniesCode != null and regionalCompaniesCode != ''">
AND jp.regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="regions != null and regions.size()>0 ">
and pc.REGION_SEQ in
<foreach collection="regions" separator="," open="(" close=")" item="item">
#{item}
</foreach>
</if>
UNION ALL
SELECT
FLOOR(SUM((LENGTH(construction_inverter_info)-LENGTH(REPLACE(construction_inverter_info,'id',''))))/LENGTH('id')) AS total,
'户用开发逆变器' AS statusText
FROM
hygf_power_station_construction_data
LEFT JOIN
hygf_work_order_power_station on hygf_power_station_construction_data.work_order_power_station_id =hygf_work_order_power_station.sequence_nbr
LEFT JOIN
hygf_peasant_household ON hygf_work_order_power_station.peasant_household_id = hygf_peasant_household.sequence_nbr
<if test="developerCode != null and developerCode != ''">
AND hygf_peasant_household.developer_code = #{developerCode}
</if>
<if test="regionalCompaniesCode != null and regionalCompaniesCode != ''">
AND hygf_peasant_household.regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="province != null and province != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{province},'%')
</if>
<if test="city != null and city != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{city},'%')
</if>
<if test="district != null and district != ''">
AND hygf_peasant_household.project_address LIKE CONCAT ('%',#{district},'%')
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.CommerceInfoDto;
import com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseNewUtil;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.FinancingInfoServiceImpl;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.StatisticsHomepageServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -28,6 +29,8 @@ public class CommonController {
FinancingInfoServiceImpl financingInfoService;
@Autowired
CommonServiceImpl commonService;
@Autowired
StatisticsHomepageServiceImpl statisticsHomepageService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/selectRegion")
......@@ -95,4 +98,24 @@ public class CommonController {
}
/**
* 统计首页环形图
*
* @return
*/
@GetMapping(value = "/statisticsHomepage")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "资料下载进度获取", notes = "资料下载进度获取")
public ResponseModel<Map<String, Object>> getSchedule(@RequestParam(required = false) String developerCode,
@RequestParam(required = false) String regionalCompaniesCode,
@RequestParam(required = false) String province,
@RequestParam(required = false) String city,
@RequestParam(required = false) String district) {
return ResponseHelper.buildResponse(statisticsHomepageService.statisticsHomepage(developerCode,regionalCompaniesCode,province,city,district));
}
}
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.map.MapBuilder;
import com.sun.org.apache.bcel.internal.generic.SWITCH;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.StatisticsHomepageMapper;
import org.apache.activemq.util.MapHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@Service
public class StatisticsHomepageServiceImpl {
@Autowired
StatisticsHomepageMapper statisticsHomepageMapper;
@Autowired
JpStationMapper jpStationMapper;
public Map<String, Object> statisticsHomepage( String developerCode,String regionalCompaniesCode, String province, String city, String district){
Map<String, Object> resultMap = MapBuilder.<String, Object>create().build();
List<Map<String, Object>> surveyMaps = statisticsHomepageMapper.surveyStatusTotal(developerCode, regionalCompaniesCode, province, city, district);
this.resuleMapBuild(resultMap,surveyMaps,"surey");
List<Map<String, Object>> desionMaps = statisticsHomepageMapper.desionTotal(developerCode, regionalCompaniesCode, province, city, district);
this.resuleMapBuild(resultMap,desionMaps,"desion");
List<Map<String, Object>> contractMaps = statisticsHomepageMapper.contractStatusTotal(developerCode, regionalCompaniesCode, province, city, district);
this.resuleMapBuild(resultMap,contractMaps,"contract");
List<Map<String, Object>> preparationMoneyMaps = statisticsHomepageMapper.preparationMoneyTotal(developerCode, regionalCompaniesCode, province, city, district);
this.resuleMapBuild(resultMap,preparationMoneyMaps,"preparationMoney");
List<Map<String, Object>> workOrderMaps = statisticsHomepageMapper.workOrderTotal(developerCode, regionalCompaniesCode, province, city, district);
this.resuleMapBuild(resultMap,workOrderMaps,"workOrder");
List<Map<String, Object>> gridMaps = statisticsHomepageMapper.gridStatusTotal(developerCode, regionalCompaniesCode, province, city, district);
this.resuleMapBuild(resultMap,gridMaps,"grid");
List<Map<String, Object>> acceptanceMaps = statisticsHomepageMapper.acceptanceStatusTotal(developerCode, regionalCompaniesCode, province, city, district);
this.resuleMapBuild(resultMap,acceptanceMaps,"acceptance");
List<Map<String, Object>> financingMaps = statisticsHomepageMapper.financingStatusTotal(developerCode, regionalCompaniesCode, province, city, district);
this.resuleMapBuild(resultMap,financingMaps,"financing");
List<String> regionNodeByCode = jpStationMapper.getRegionNodeByCode(province);
List<Map<String, Object>> inverterMaps = statisticsHomepageMapper.inverterTotal(developerCode, regionalCompaniesCode, province, city, district,regionNodeByCode);
this.resuleMapBuild(resultMap,inverterMaps,"inverter");
return resultMap;
}
Map<String,Object> resuleMapBuild( Map<String, Object> resultMap,List<Map<String, Object>> maps,String type){
long total= 0;
double realScale = 0.00;
List<Map<String, Object>> list = new ArrayList<>();
switch(type){
case "surey" :
Map<String, Object> surey = maps.get(0);
surey.keySet().forEach(e->{
if (!e.equals("审核完成")){
list.add( MapBuilder.<String, Object>create().put("statusText",e).put("total",surey.get(e)).build());
}
});
resultMap.put("surey",list);
resultMap.put("sureyComplete",surey.get("completeTotal"));
break;
case "desion":
Map<String, Object> desion = maps.get(0);
desion.keySet().forEach(e->{
list.add( MapBuilder.<String, Object>create().put("statusText",e).put("total",desion.get(e)).build());
});
if (resultMap.containsKey("sureyComplete")){
list.add( MapBuilder.<String, Object>create().put("statusText","审核完成").put("total",resultMap.get("sureyComplete")).build());
resultMap.remove("sureyComplete");
}else {
list.add( MapBuilder.<String, Object>create().put("statusText","审核完成").put("total",0).build());
}
resultMap.put("desion",list);
break;
case "contract":
Map<String, Object> contract = maps.get(0);
contract.keySet().forEach(e->{
list.add( MapBuilder.<String, Object>create().put("statusText",e).put("total",contract.get(e)).build());
});
resultMap.put("contract",list);
break;
case "preparationMoney":
Map<String, Object> preparationMoney = maps.get(0);
preparationMoney.keySet().forEach(e->{
list.add( MapBuilder.<String, Object>create().put("statusText",e).put("total",preparationMoney.get(e)).build());
});
resultMap.put("preparationMoney",list);
break;
case "workOrder":
Iterator<Map<String, Object>> iterator = maps.iterator();
while (iterator.hasNext()) {
Map<String, Object> map = iterator.next();
if ("审核中".equals(map.get("statusText"))) {
total += (long) map.get("total");
realScale += (double) map.get("realScale");
iterator.remove();
}
}
maps.add(MapBuilder.<String, Object>create().put("statusText","审核中").put("total",total).put("realScale",realScale).build());
resultMap.put("workOrder",maps);
break;
case "grid":
Iterator<Map<String, Object>> iterator1 = maps.iterator();
while (iterator1.hasNext()) {
Map<String, Object> map = iterator1.next();
if ("审核中".equals(map.get("statusText"))) {
total +=(long) map.get("total");
realScale += (double) map.get("realScale");
iterator1.remove();
}
}
maps.add(MapBuilder.<String, Object>create().put("statusText","审核中").put("total",total).put("realScale",realScale).build());
resultMap.put("grid",maps);
break;
case "acceptance":
Iterator<Map<String, Object>> iterator2 = maps.iterator();
while (iterator2.hasNext()) {
Map<String, Object> map = iterator2.next();
if ("审核中".equals(map.get("statusText"))) {
total += (long) map.get("total");
realScale += (double) map.get("realScale");
iterator2.remove();
}
}
maps.add(MapBuilder.<String, Object>create().put("statusText","审核中").put("total",total).put("realScale",realScale).build());
resultMap.put("acceptance",maps);
break;
case "financing":
resultMap.put("financing",maps);
break;
default:
resultMap.put("inverter",maps);
break;
}
return resultMap;
}
}
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