Commit d31ff831 authored by chenzhao's avatar chenzhao

统计top开发

parent dbbfa1b3
......@@ -39,7 +39,13 @@ public interface StatisticsHomepageMapper {
@UserEmpower(field ={"hygf_peasant_household.regional_companies_code"},dealerField ={"hygf_peasant_household.developer_code"} ,fieldConditions ={"eq"} ,relationship="and")
public Map<String,Object> stationNum(String developerCode, String regionalCompaniesCode, String province, String city, String district);
@UserEmpower(field ={"ph.regional_companies_code"},dealerField ={"hygf_peasant_household.developer_code"} ,fieldConditions ={"eq"} ,relationship="and")
public Map<String,Object> statisticsPowerStation(String developerCode, String regionalCompaniesCode, String province, String city, String district);
@UserEmpower(field ={"ph.regional_companies_code"},dealerField ={"hygf_peasant_household.developer_code"} ,fieldConditions ={"eq"} ,relationship="and")
public Map<String,Object> statisticsPreparationMoney(String developerCode, String regionalCompaniesCode, String province, String city, String district);
public String selectProvince (String regionSeq);
public List<Map<String,Object>> getRent (String regionalCompaniesCode);
}
......@@ -7,7 +7,7 @@
SUM(CASE WHEN ps.process_status = '不通过' THEN 1 ELSE 0 END)AS '未通过',
SUM(CASE WHEN ps.process_status = '进行中' AND ps.business_status = '通过' AND next_node_name = '设计上传典型图库' 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 '进行中(审核)',
SUM(CASE WHEN ps.process_status = '进行中' AND (ps.business_status IS NULL OR ps.design_status IS NULL OR ps.technology_status IS NULL or ps.business_status = '' OR ps.design_status = '' OR ps.technology_status = '') 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}
......@@ -80,8 +80,8 @@
<select id="desionTotal" resultType="map">
SELECT
SUM( CASE WHEN next_node_name = '经销商设计人员上传设计图' THEN 1 ELSE 0 END ) AS '施工图已上传',
SUM( CASE WHEN next_node_name = '设计上传典型图库' THEN 1 ELSE 0 END ) AS '典设图已上传'
SUM( CASE WHEN next_node_name = '经销商设计人员上传设计图' and process_status = '进行中'THEN 1 ELSE 0 END ) AS '典设图已上传',
SUM( CASE WHEN next_node_name = '设计图纸审核' and process_status = '进行中'THEN 1 ELSE 0 END ) AS '施工图已上传'
FROM
`hygf_power_station`
LEFT JOIN
......@@ -142,7 +142,7 @@
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 ='area' THEN '已完成'
WHEN power_station_construction_status = '已完' THEN '已完成'
WHEN power_station_construction_status = '待审核' and work_order_power_station_node in ('engineering','design') THEN '审核中'
ELSE power_station_construction_status END )
AS statusText,
......@@ -547,4 +547,65 @@
GROUP BY
regional_companies_code
</select>
<select id="statisticsPowerStation" resultType="map">
SELECT
SUM( CASE WHEN ps.process_status = '不通过' THEN 1 ELSE 0 END ) AS kcwtg,
SUM( CASE WHEN ps.process_status = '进行中' THEN 1 ELSE 0 END ) AS kcjxz,
SUM( CASE WHEN ps.process_status = '完成' THEN 1 ELSE 0 END ) AS kcywc,
SUM( CASE WHEN hc.STATUS = '未签署' THEN 1 ELSE 0 END ) AS wqs,
SUM( CASE WHEN hc.STATUS = '农户已签署' THEN 1 ELSE 0 END ) AS nhyqs,
SUM( CASE WHEN hc.STATUS = '双方已签署' THEN 1 ELSE 0 END ) AS sfyqs,
SUM( CASE WHEN hc.STATUS = '已作废' THEN 1 ELSE 0 END ) AS yzf
FROM
hygf_peasant_household ph
LEFT JOIN hygf_power_station ps ON ps.peasant_household_id = ph.sequence_nbr
LEFT JOIN hygf_household_contract hc ON hc.peasant_household_id = ph.sequence_nbr
WHERE
ps.is_delete = 0 and ph.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="statisticsPreparationMoney" resultType="map">
SELECT
SUM( CASE WHEN preparation_money_state = '待发货' or preparation_money_state = '暂存发货' THEN 1 ELSE 0 END ) AS dfh,
SUM( CASE WHEN preparation_money_state = '待补货' THEN 1 ELSE 0 END ) AS dbh,
SUM( CASE WHEN preparation_money_state = '备货完成' THEN 1 ELSE 0 END ) AS ysh,
SUM( CASE WHEN preparation_money_state = '待收货' THEN 1 ELSE 0 END ) AS yfh
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>
</mapper>
\ No newline at end of file
......@@ -108,7 +108,7 @@ public class CommonController {
*/
@GetMapping(value = "/statisticsHomepage")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "资料下载进度获取", notes = "资料下载进度获取")
@ApiOperation(httpMethod = "GET", value = "首页统计环形图及统计表", notes = "首页统计环形图及统计表")
@UserLimits
public ResponseModel<Map<String, Object>> statisticsHomepage(@RequestParam(required = false) String developerCode,
@RequestParam(required = false) String regionalCompaniesCode,
......@@ -125,6 +125,26 @@ public class CommonController {
*
* @return
*/
@GetMapping(value = "/statisticsTop")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "列表上方统计表", notes = "列表上方统计表")
@UserLimits
public ResponseModel<Map<String, Object>> statisticsTop(@RequestParam(required = false) String developerCode,
@RequestParam(required = false) String regionalCompaniesCode,
@RequestParam(required = false) String province,
@RequestParam(required = false) String city,
@RequestParam(required = true) String type,
@RequestParam(required = false) String district) {
return ResponseHelper.buildResponse(statisticsHomepageService.statisticsTop(type,developerCode,regionalCompaniesCode,province,city,district));
}
/**
* 统计首页环形图
*
* @return
*/
@GetMapping(value = "/homePageExport")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "资料下载进度获取", notes = "资料下载进度获取")
......
......@@ -134,9 +134,9 @@ public class StatisticsHomepageServiceImpl {
desionKeys.removeAll(desion.keySet());
for (String e : desion.keySet()) {
list.add( MapBuilder.<String, Object>create().put("statusText",e).put("total",desion.get(e)).build());
sureyNum += new BigDecimal(desion.get(e).toString()).longValue();
surveNum += new BigDecimal(desion.get(e).toString()).longValue();
}
li.put("surveNum",sureyNum);
li.put("surveNum",surveNum);
list = this.nullDataBuildResult(list,desionKeys);
if (resultMap.containsKey("sureyComplete")){
list.add( MapBuilder.<String, Object>create().put("statusText","审核完成").put("total",resultMap.get("sureyComplete")).build());
......@@ -479,4 +479,69 @@ public class StatisticsHomepageServiceImpl {
RegionUtil.setBorderLeft(BorderStyle.THIN,mergedRegion,sheet);
RegionUtil.setBorderRight(BorderStyle.THIN,mergedRegion,sheet);
}
public Map<String, Object> statisticsTop(String type, String developerCode,String regionalCompaniesCode, String province, String city, String district){
Map<String, Object> resultMap = MapBuilder.<String, Object>create().build();
Map<String, Object> map = MapBuilder.<String, Object>create().build();
Map<String, Object> map1 = MapBuilder.<String, Object>create().build();
switch (type){
case "survey":
Map<String, Object> surveyMaps = statisticsHomepageMapper.statisticsPowerStation(developerCode, regionalCompaniesCode, province, city, district);
for (String key : surveyMaps.keySet()) {
resultMap.put(key,Arrays.asList(surveyMaps.get(key),"0"));
}
break;
case "preparationMoney":
Map<String, Object> preparationMoney = statisticsHomepageMapper.statisticsPreparationMoney(developerCode, regionalCompaniesCode, province, city, district);
for (String key : preparationMoney.keySet()) {
resultMap.put(key,Arrays.asList(preparationMoney.get(key),"0"));
}
break;
case "workOrder":
List<Map<String, Object>> workOrderMaps = statisticsHomepageMapper.workOrderTotal(developerCode, regionalCompaniesCode, province, city, district);
this.resuleMapBuild(map,map1,workOrderMaps,"workOrder");
List<Map<String, Object>> workOrder = (List<Map<String, Object>>) map1.get("workOrder");
for (Map<String, Object> objectMap : workOrder) {
String key = objectMap.get("statusText").toString();
resultMap.put(key,Arrays.asList(objectMap.get("total"),objectMap.get("realScale")));
}
break;
case "grid":
List<Map<String, Object>> grid = statisticsHomepageMapper.gridStatusTotal(developerCode, regionalCompaniesCode, province, city, district);
this.resuleMapBuild(map,map1,grid,"grid");
List<Map<String, Object>> gridMaps = (List<Map<String, Object>>) map1.get("workOrder");
for (Map<String, Object> objectMap : gridMaps) {
String key = objectMap.get("statusText").toString();
resultMap.put(key,Arrays.asList(objectMap.get("total"),objectMap.get("realScale")));
}
break;
case "acceptance":
List<Map<String, Object>> acceptanceMaps = statisticsHomepageMapper.acceptanceStatusTotal(developerCode, regionalCompaniesCode, province, city, district);
this.resuleMapBuild(map,map1,acceptanceMaps,"acceptance");
List<Map<String, Object>> acceptance = (List<Map<String, Object>>) map1.get("workOrder");
for (Map<String, Object> objectMap : acceptance) {
String key = objectMap.get("statusText").toString();
resultMap.put(key,Arrays.asList(objectMap.get("total"),objectMap.get("realScale")));
}
break;
case "financing":
List<Map<String, Object>> financingMaps = statisticsHomepageMapper.financingStatusTotal(developerCode, regionalCompaniesCode, province, city, district);
this.resuleMapBuild(map,map1,financingMaps,"financing");
List<Map<String, Object>> financing = (List<Map<String, Object>>) map1.get("workOrder");
for (Map<String, Object> objectMap : financing) {
String key = objectMap.get("statusText").toString();
resultMap.put(key,Arrays.asList(objectMap.get("total"),objectMap.get("realScale")));
}
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