优化
This commit is contained in:
parent
eb777e9189
commit
69d0e6c858
@ -273,7 +273,11 @@ public class BaseModuleController {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
titles.clear();
|
||||
}
|
||||
} else {
|
||||
titles.clear();
|
||||
}
|
||||
return Result.success(titles);
|
||||
}
|
||||
|
||||
@ -38,6 +38,9 @@ public class EngineeringPageDto {
|
||||
@ApiModelProperty(value = "工程状态(1:未开工;2:在建)")
|
||||
private Integer state;
|
||||
|
||||
@ApiModelProperty(value = "工程状态(1:未开工;2:在建)")
|
||||
private String stateName;
|
||||
|
||||
@ApiModelProperty(value = "工程AI预警信息统计")
|
||||
private String aiAlarmStat;
|
||||
}
|
||||
|
||||
@ -37,6 +37,6 @@
|
||||
</select>
|
||||
|
||||
<select id="queryDistrict" resultType="java.util.Map">
|
||||
SELECT district as label, district as value FROM engineering where district != '' AND examine_state = 3 GROUP BY district
|
||||
SELECT district as label, district as value FROM engineering where district != '' GROUP BY district
|
||||
</select>
|
||||
</mapper>
|
||||
@ -217,7 +217,7 @@ public class EngineeringServiceImpl extends ServiceImpl<EngineeringMapper, Engin
|
||||
AppIndexTopStatDto dto = new AppIndexTopStatDto();
|
||||
if (engineeringList != null && engineeringList.size() > 0) {
|
||||
dto.setBuilding(engineeringList.stream().filter(e -> e.getState() == 2).collect(Collectors.toList()).size());
|
||||
dto.setNewBuild(engineeringList.stream().filter(e -> e.getStartTime().getYear() == new Date().getYear()).collect(Collectors.toList()).size());
|
||||
dto.setNewBuild(engineeringList.stream().filter(e -> e.getStartTime().getYear() == new Date().getYear() && e.getState() > 1).collect(Collectors.toList()).size());
|
||||
dto.setFinish(engineeringList.stream().filter(e -> e.getState() == 7).collect(Collectors.toList()).size());
|
||||
}
|
||||
return dto;
|
||||
|
||||
@ -7,9 +7,11 @@ import com.zhgd.xmgl.modules.basicdata.entity.EngineeringMain;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.EngineeringMainPerson;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.EngineeringSingle;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.EngineeringSingleMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.*;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IAnnexFileService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEngineeringMainPersonService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEngineeringMainService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEngineeringSingleService;
|
||||
import com.zhgd.xmgl.modules.basicdata.vo.EngineeringVo;
|
||||
import com.zhgd.xmgl.modules.safety.service.IEnterpriseScoreService;
|
||||
import com.zhgd.xmgl.util.ParamEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -37,12 +39,6 @@ public class EngineeringSingleServiceImpl extends ServiceImpl<EngineeringSingleM
|
||||
@Autowired
|
||||
private IEngineeringMainPersonService engineeringMainPersonService;
|
||||
|
||||
@Autowired
|
||||
private IEnterpriseScoreService enterpriseScoreService;
|
||||
|
||||
@Autowired
|
||||
private IProjectService projectService;
|
||||
|
||||
@Override
|
||||
public boolean saveDetail(EngineeringVo engineeringVo) {
|
||||
for (EngineeringSingle engineeringSingle : engineeringVo.getEngineeringSingles()) {
|
||||
|
||||
@ -86,7 +86,7 @@ public class EnvironmentAlarm implements Serializable {
|
||||
*/
|
||||
@Excel(name = "恢复数据", width = 15)
|
||||
@ApiModelProperty(value = "恢复数据")
|
||||
private String solveValue;
|
||||
private Double solveValue;
|
||||
/**
|
||||
* 项目唯一标识
|
||||
*/
|
||||
|
||||
@ -17,8 +17,10 @@ import com.zhgd.xmgl.modules.basicdata.constant.CacheConstants;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.EngineeringDeviceDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.ProjectDeviceDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Engineering;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemDictData;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEngineeringService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IProjectService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemDictDataService;
|
||||
import com.zhgd.xmgl.modules.wisdom.dto.EnvironmentDevDto;
|
||||
import com.zhgd.xmgl.modules.wisdom.dto.EnvironmentDevStatDto;
|
||||
import com.zhgd.xmgl.modules.wisdom.entity.DustNoiseData;
|
||||
@ -28,6 +30,8 @@ import com.zhgd.xmgl.modules.wisdom.mapper.EnvironmentDevMapper;
|
||||
import com.zhgd.xmgl.modules.wisdom.service.IDustNoiseDataService;
|
||||
import com.zhgd.xmgl.modules.wisdom.service.IEnvironmentAlarmService;
|
||||
import com.zhgd.xmgl.modules.wisdom.service.IEnvironmentDevService;
|
||||
import com.zhgd.xmgl.util.CommonUtil;
|
||||
import com.zhgd.xmgl.util.ParamEnum;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -62,6 +66,9 @@ public class EnvironmentDevServiceImpl extends ServiceImpl<EnvironmentDevMapper,
|
||||
@Autowired
|
||||
private IEnvironmentAlarmService environmentAlarmService;
|
||||
|
||||
@Autowired
|
||||
private ISystemDictDataService systemDictDataService;
|
||||
|
||||
@Override
|
||||
public Page<EnvironmentDev> pageList(Page page, Wrapper<EnvironmentDev> wrapper) {
|
||||
return baseMapper.pageList(page, wrapper);
|
||||
@ -69,12 +76,14 @@ public class EnvironmentDevServiceImpl extends ServiceImpl<EnvironmentDevMapper,
|
||||
|
||||
@Override
|
||||
public Page<EngineeringDeviceDto> pageListForSuperior(Map<String, Object> map) {
|
||||
Page<EngineeringDeviceDto> pageListByGov = PageUtil.copyProperties(engineeringService.pageListForSuperior(map), EngineeringDeviceDto.class);
|
||||
pageListByGov.getRecords().stream().forEach(e -> {
|
||||
Page<EngineeringDeviceDto> engineeringDeviceDtoPage = PageUtil.copyProperties(engineeringService.pageListForSuperior(map), EngineeringDeviceDto.class);
|
||||
List<SystemDictData> engineeringStates = systemDictDataService.getByType(ParamEnum.SysDictType.ENGINEERING_STATE.getValue());
|
||||
engineeringDeviceDtoPage.getRecords().stream().forEach(e -> {
|
||||
e.setDeviceNum(baseMapper.selectCount(Wrappers.<EnvironmentDev>lambdaQuery().eq(EnvironmentDev::getEngineeringSn, e.getEngineeringSn())));
|
||||
e.setEnvironAlarmFlag(environmentAlarmService.checkAlarm(e.getEngineeringSn()));
|
||||
e.setStateName(CommonUtil.getDictValue(engineeringStates, e.getState()));
|
||||
});
|
||||
return pageListByGov;
|
||||
return engineeringDeviceDtoPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -11,7 +11,7 @@ import java.util.stream.Collectors;
|
||||
@UtilityClass
|
||||
public class CommonUtil {
|
||||
|
||||
public final String PW_PATTERN = "^(?![A-Za-z0-9]+$)(?![a-z0-9\\W]+$)(?![A-Za-z\\W]+$)(?![A-Z0-9\\W]+$)[a-zA-Z0-9\\W]{8,}$";
|
||||
public final String PW_PATTERN = "^(?![A-Za-z0-9]+$)(?![a-z0-9\\W]+$)(?![A-Za-z\\W]+$)(?![A-Z0-9\\W]+$)[a-zA-Z0-9\\W]{9,}$";
|
||||
|
||||
|
||||
public String getUUid() {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
http.port=6023
|
||||
server.port=6688
|
||||
# 数据库配置
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/wisdomsitezw?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false
|
||||
spring.datasource.url=jdbc:mysql://139.9.66.234:3306/wisdomsitezw?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false
|
||||
# 数据库加密配置
|
||||
#spring.datasource.username=ENC(XR4C/hvTYCUqudS49Wh/jA==)
|
||||
#spring.datasource.password=ENC(hHkiHEc6vSWjqfOtg2/2Uiihs0vX3l7V)
|
||||
@ -56,12 +56,12 @@ opencv.filePath=D://opencv//
|
||||
arcsoft.appId=13eRvuSeQYts8Tqcrqy4yFyg7h6XQqdUGkjJuh9ct2E2
|
||||
arcsoft.sdkKey=GLc2xHQ7yAwNxrWctSgNgVqwYqMTbz9RKTWWHQNMdJPU
|
||||
arcsoft.linux.sdkKey=
|
||||
arcsoft.dllPath=D:/zhgd3/dll
|
||||
arcsoft.dllPath=D:/dll
|
||||
|
||||
#关闭页面
|
||||
#magic-api.show-url=false
|
||||
#配置web页面入口
|
||||
magic-api.resource.location=classpath:magic
|
||||
magic-api.resource.location=D://data//magic-api
|
||||
magic-api.security.username=admin
|
||||
magic-api.security.password=JXJ@admin
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#环境选择
|
||||
spring.profiles.active=dev
|
||||
spring.profiles.active=test
|
||||
# 国际化配置
|
||||
spring.messages.basename=i18n/messages
|
||||
spring.messages.encoding=utf-8
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
"groupId" : "1f3d3e5b9fe340bab84de67b0de08f44",
|
||||
"name" : "投资管理",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1690543632559,
|
||||
"updateTime" : 1698730660209,
|
||||
"lock" : null,
|
||||
"createBy" : "admin",
|
||||
"updateBy" : "admin",
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
"groupId" : "485e36d471af4f809398babc4abadafe",
|
||||
"name" : "查询工程分类统计",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1695117310293,
|
||||
"updateTime" : 1699250036244,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : "admin",
|
||||
@ -16,7 +16,7 @@
|
||||
"requestBody" : "",
|
||||
"headers" : [ {
|
||||
"name" : "Authorization",
|
||||
"value" : "Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJnZGFkbWluIiwiaWF0IjoxNjg0MjAxNzgwLCJleHAiOjE2ODQyODgxODB9.QDnW2gWL3dXo5IcVbFCkGWapOxm74MmSpqkJ6Zci7rc",
|
||||
"value" : "Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJjc3p3IiwiaWF0IjoxNjk5MjQ5NDUyLCJleHAiOjE2OTkzMzU4NTJ9.vVpWEt2-sdJ91jcvecKd2JSNyV-D3EsppFdPFQGI0ZQ",
|
||||
"description" : null,
|
||||
"required" : false,
|
||||
"dataType" : "String",
|
||||
@ -28,24 +28,74 @@
|
||||
"children" : null
|
||||
} ],
|
||||
"paths" : [ ],
|
||||
"responseBody" : "{\n \"result\": [\n {\n \"num\": 1,\n \"dict_value\": \"房屋建筑\",\n \"ratio\": 100\n },\n {\n \"num\": 0,\n \"dict_value\": \"市政公用\",\n \"ratio\": 0\n },\n {\n \"num\": 0,\n \"dict_value\": \"其他\",\n \"ratio\": 0\n }\n ],\n \"code\": 200,\n \"success\": true,\n \"message\": \"success\",\n \"timestamp\": \"1684201634237\"\n}",
|
||||
"responseBody" : "{\n \"result\": [\n {\n \"num\": 1,\n \"dict_value\": \"房屋建筑\",\n \"ratio\": 50\n },\n {\n \"num\": 0,\n \"dict_value\": \"市政公用\",\n \"ratio\": 0\n },\n {\n \"num\": 1,\n \"dict_value\": \"其他\",\n \"ratio\": 50\n }\n ],\n \"code\": 200,\n \"success\": true,\n \"message\": \"success\",\n \"timestamp\": \"1699250029028\"\n}",
|
||||
"description" : null,
|
||||
"requestBodyDefinition" : null,
|
||||
"responseBodyDefinition" : null
|
||||
"responseBodyDefinition" : {
|
||||
"name" : "",
|
||||
"value" : "",
|
||||
"description" : "",
|
||||
"required" : false,
|
||||
"dataType" : "Object",
|
||||
"type" : null,
|
||||
"defaultValue" : null,
|
||||
"validateType" : "",
|
||||
"error" : "",
|
||||
"expression" : "",
|
||||
"children" : [ {
|
||||
"name" : "code",
|
||||
"value" : "401",
|
||||
"description" : "",
|
||||
"required" : false,
|
||||
"dataType" : "String",
|
||||
"type" : null,
|
||||
"defaultValue" : null,
|
||||
"validateType" : "",
|
||||
"error" : "",
|
||||
"expression" : "",
|
||||
"children" : [ ]
|
||||
}, {
|
||||
"name" : "success",
|
||||
"value" : "false",
|
||||
"description" : "",
|
||||
"required" : false,
|
||||
"dataType" : "Boolean",
|
||||
"type" : null,
|
||||
"defaultValue" : null,
|
||||
"validateType" : "",
|
||||
"error" : "",
|
||||
"expression" : "",
|
||||
"children" : [ ]
|
||||
}, {
|
||||
"name" : "message",
|
||||
"value" : "登录信息异常,请刷新或重新登录!",
|
||||
"description" : "",
|
||||
"required" : false,
|
||||
"dataType" : "String",
|
||||
"type" : null,
|
||||
"defaultValue" : null,
|
||||
"validateType" : "",
|
||||
"error" : "",
|
||||
"expression" : "",
|
||||
"children" : [ ]
|
||||
} ]
|
||||
}
|
||||
}
|
||||
================================
|
||||
import java.math.BigDecimal
|
||||
List list = db.select("SELECT d.dict_value, COUNT( a.id ) num FROM engineering a RIGHT JOIN system_dict_data d ON a.engineering_type = d.dict_label AND #projectalias WHERE a.examine_state = 3 AND d.dict_type = 'engineering_type' GROUP BY d.dict_value ORDER BY d.dict_sort")
|
||||
|
||||
List dictList = db.select("SELECT dict_value, dict_label num FROM system_dict_data where dict_type = 'engineering_type' ORDER BY dict_sort")
|
||||
|
||||
Map totalMap = db.selectOne("SELECT COUNT(id) num FROM engineering WHERE examine_state = 3 AND #project")
|
||||
String total = totalMap.get("num")
|
||||
List result = new ArrayList();
|
||||
Integer other = 0;
|
||||
Integer index = 0
|
||||
for (item in list) {
|
||||
for (item in dictList) {
|
||||
Map map = item
|
||||
var dict_value = map.get("dict_value")
|
||||
var num = map.get("num")::int
|
||||
var num = list.filter(item => item.dict_value.equals(dict_value)).size()
|
||||
Map resultMap = new HashMap();
|
||||
if (index < 2){
|
||||
resultMap.put("dict_value" ,dict_value)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user