Commit 95a8067b authored by hcing's avatar hcing

fix:统计服务,大屏综合统计查询接口--人员统计

parent f65026ad
package com.yeejoin.amos.boot.module.statistics.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public enum PersonTypeEnum {
/**
* *人员类型
*/
jyry("检验人员"),
jcry("检测人员"),
aqy("安全员"),
agwfzr("安改维负责人"),
zyfzr("主要负责人"),
aqzj("安全总监"),
zlaqy("质量安全员"),
zlaqzj("质量安全总监");
private final String name;
}
...@@ -16,6 +16,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -16,6 +16,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional;
/** /**
* 综合统计分析API * 综合统计分析API
...@@ -177,7 +178,35 @@ public class ComprehensiveStatisticalAnalysisController extends BaseController { ...@@ -177,7 +178,35 @@ public class ComprehensiveStatisticalAnalysisController extends BaseController {
@PostMapping(value = "/page") @PostMapping(value = "/page")
@ApiOperation(httpMethod = "POST", value = "综合统计分析接口分页查询", notes = "综合统计分析接口分页查询") @ApiOperation(httpMethod = "POST", value = "综合统计分析接口分页查询", notes = "综合统计分析接口分页查询")
public ResponseModel<JSONObject> queryForPage(@RequestBody Map<String, Object> map) { public ResponseModel<JSONObject> queryForPage(@RequestBody Map<String, Object> map) {
return ResponseHelper.buildResponse(statisticalAnalysisService.queryForPage(new JSONObject(map)));
}
/**
* 综合统计分析接口分页查询-大屏中人员列表
* 区别在于【资质状态】 无资质 certNo_0
* @param map
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/person/page")
@ApiOperation(httpMethod = "POST", value = "综合统计分析接口分页查询-大屏中人员列表", notes = "综合统计分析接口分页查询-大屏中人员列表")
public ResponseModel<JSONObject> queryPersonForPage(@RequestBody Map<String, Object> map) {
JSONObject jsonObject = new JSONObject(map); JSONObject jsonObject = new JSONObject(map);
String targetValue = "certNo_0";
boolean containsTarget = Optional.of(jsonObject)
.map(obj -> obj.getJSONObject("filterParams"))
.map(filterParams -> filterParams.getJSONArray("expiryDate"))
.map(expiryDateArray -> expiryDateArray.contains(targetValue))
.orElse(false);
if (containsTarget) {
JSONObject filterParams = jsonObject.getJSONObject("filterParams");
JSONArray expiryDate = filterParams.getJSONArray("expiryDate");
expiryDate.remove(targetValue);
JSONArray certNo = filterParams.getJSONArray("certNo");
certNo.add("0");
filterParams.fluentPut("expiryDate", expiryDate).fluentPut("certNo", certNo);
jsonObject.put("filterParams", filterParams);
}
return ResponseHelper.buildResponse(statisticalAnalysisService.queryForPage(jsonObject)); return ResponseHelper.buildResponse(statisticalAnalysisService.queryForPage(jsonObject));
} }
...@@ -197,16 +226,6 @@ public class ComprehensiveStatisticalAnalysisController extends BaseController { ...@@ -197,16 +226,6 @@ public class ComprehensiveStatisticalAnalysisController extends BaseController {
} }
/** /**
* 大屏综合统计--人员统计
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/dp/statistics/person")
@ApiOperation(httpMethod = "POST", value = "大屏综合统计查询接口--人员统计", notes = "大屏综合统计查询接口--人员统计")
public ResponseModel<JSONObject> queryDpStatisticsForPerson(@RequestBody Map<String, Object> map) {
return ResponseHelper.buildResponse(statisticalAnalysisService.queryDpStatisticsForPerson(new JSONObject(map)));
}
/**
* 综合统计分析接口-导出 * 综合统计分析接口-导出
* *
* @param map 入参 * @param map 入参
......
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