施工质量
This commit is contained in:
parent
18bbf3aebd
commit
35da115d83
|
|
@ -0,0 +1,29 @@
|
|||
package com.securitycontrol.entity.screen.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author:cwchen
|
||||
* @date:2024-03-27-15:23
|
||||
* @version:1.0
|
||||
* @description:施工质量-VO
|
||||
*/
|
||||
@Data
|
||||
public class ConstrQuality {
|
||||
|
||||
@ApiModelProperty("标段编码")
|
||||
private String bidCode;
|
||||
@ApiModelProperty("标段工程名称")
|
||||
private String bidName;
|
||||
@ApiModelProperty("班组名称")
|
||||
private String teamName;
|
||||
@ApiModelProperty("班组长")
|
||||
private String teamLeader;
|
||||
@ApiModelProperty("施工质量")
|
||||
private String constrQuality;
|
||||
@ApiModelProperty("班组ID")
|
||||
private String teamId;
|
||||
@ApiModelProperty("分数")
|
||||
private double score;
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.securitycontrol.entity.screen.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author:cwchen
|
||||
* @date:2024-03-27-15:04
|
||||
* @version:1.0
|
||||
* @description:地图风险点
|
||||
*/
|
||||
@Data
|
||||
public class MapRiskVo {
|
||||
|
||||
@ApiModelProperty("站班会ID")
|
||||
private String classId;
|
||||
|
||||
@ApiModelProperty("经度")
|
||||
private String lon;
|
||||
|
||||
@ApiModelProperty("纬度")
|
||||
private String lat;
|
||||
|
||||
@ApiModelProperty("标段编码")
|
||||
private String bidCode;
|
||||
|
||||
@ApiModelProperty("标段工程名称")
|
||||
private String bidName;
|
||||
|
||||
@ApiModelProperty("班组名称")
|
||||
private String teamName;
|
||||
|
||||
@ApiModelProperty("风险等级")
|
||||
private String riskLevel;
|
||||
|
||||
@ApiModelProperty("工作内容")
|
||||
private String workContent;
|
||||
|
||||
@ApiModelProperty("班组长")
|
||||
private String workManager;
|
||||
}
|
||||
|
|
@ -4,7 +4,6 @@ import com.securitycontrol.common.core.web.domain.AjaxResult;
|
|||
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||
import com.securitycontrol.screen.service.IScIndexService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
|
@ -29,4 +28,16 @@ public class ScIndexController {
|
|||
public AjaxResult proStatusStatistics(ScreenParamDto dto){
|
||||
return service.proStatusStatistics(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "地图风险点")
|
||||
@PostMapping("riskStatistics")
|
||||
public AjaxResult riskStatistics(ScreenParamDto dto){
|
||||
return service.riskStatistics(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "施工质量")
|
||||
@PostMapping("constrQuality")
|
||||
public AjaxResult constrQuality(ScreenParamDto dto){
|
||||
return service.constrQuality(dto);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.securitycontrol.screen.mapper;
|
||||
|
||||
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||
import com.securitycontrol.entity.screen.vo.ConstrQuality;
|
||||
import com.securitycontrol.entity.screen.vo.MapRiskVo;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
|
@ -17,6 +19,7 @@ import java.util.Map;
|
|||
public interface IScIndexMapper {
|
||||
/**
|
||||
* 工程统计
|
||||
*
|
||||
* @param dto
|
||||
* @return List<Map < Object>>
|
||||
* @description
|
||||
|
|
@ -25,4 +28,25 @@ public interface IScIndexMapper {
|
|||
*/
|
||||
@MapKey("id")
|
||||
List<Map<String, Object>> proStatusStatistics(ScreenParamDto dto);
|
||||
|
||||
/**
|
||||
* 地图风险点
|
||||
*
|
||||
* @param dto
|
||||
* @return List<MapRiskVo>
|
||||
* @description
|
||||
* @author cwchen
|
||||
* @date 2024/3/27 15:06
|
||||
*/
|
||||
List<MapRiskVo> riskStatistics(ScreenParamDto dto);
|
||||
|
||||
/**
|
||||
* 施工质量
|
||||
* @param dto
|
||||
* @return List<ConstrQuality>
|
||||
* @description
|
||||
* @author cwchen
|
||||
* @date 2024/3/27 15:26
|
||||
*/
|
||||
List<ConstrQuality> constrQuality(ScreenParamDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
|||
public interface IScIndexService {
|
||||
/**
|
||||
* 工程统计
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
|
|
@ -19,4 +20,25 @@ public interface IScIndexService {
|
|||
* @date 2024/3/27 10:42
|
||||
*/
|
||||
AjaxResult proStatusStatistics(ScreenParamDto dto);
|
||||
|
||||
/**
|
||||
* 地图风险点
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
* @author cwchen
|
||||
* @date 2024/3/27 15:03
|
||||
*/
|
||||
AjaxResult riskStatistics(ScreenParamDto dto);
|
||||
|
||||
/**
|
||||
* 施工质量
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
* @author cwchen
|
||||
* @date 2024/3/27 15:18
|
||||
*/
|
||||
AjaxResult constrQuality(ScreenParamDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,21 @@
|
|||
package com.securitycontrol.screen.service.impl;
|
||||
|
||||
import com.securitycontrol.common.core.constant.Constant;
|
||||
import com.securitycontrol.common.core.utils.StringUtils;
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||
import com.securitycontrol.entity.screen.vo.ConstrQuality;
|
||||
import com.securitycontrol.entity.screen.vo.MapRiskVo;
|
||||
import com.securitycontrol.screen.mapper.IScIndexMapper;
|
||||
import com.securitycontrol.screen.service.IScIndexService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author:cwchen
|
||||
|
|
@ -53,4 +59,63 @@ public class ScIndexServiceImpl implements IScIndexService {
|
|||
dataMap.put("allNum", zjNum + djNum + tcNum + tgNum);
|
||||
return AjaxResult.success(dataMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult riskStatistics(ScreenParamDto dto) {
|
||||
List<MapRiskVo> list = new ArrayList<>(500);
|
||||
try {
|
||||
list = mapper.riskStatistics(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("地图风险点", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult constrQuality(ScreenParamDto dto) {
|
||||
List<ConstrQuality> dataList = new ArrayList<>(160);
|
||||
List<ConstrQuality> list = new ArrayList<>(2000);
|
||||
try {
|
||||
list = mapper.constrQuality(dto);
|
||||
Map<String, List<ConstrQuality>> map = list.stream().collect(Collectors.groupingBy(item -> {
|
||||
return item.getTeamId();
|
||||
}));
|
||||
map.forEach((k, v) -> {
|
||||
ConstrQuality vo = new ConstrQuality();
|
||||
BigDecimal score = new BigDecimal("0");
|
||||
BigDecimal multipleValue = new BigDecimal("20");
|
||||
for (int i = 0; i < v.size(); i++) {
|
||||
String constrQuality = v.get(i).getConstrQuality();
|
||||
boolean flag = isNumeric(constrQuality);
|
||||
if(flag){
|
||||
BigDecimal value = new BigDecimal(constrQuality);
|
||||
score = score.add(value);
|
||||
}
|
||||
}
|
||||
// 分数 * 20 在除以分组数量
|
||||
BigDecimal divideValue = BigDecimal.valueOf(v.size());
|
||||
score = score.multiply(multipleValue);
|
||||
score = score.divide(divideValue, 0, BigDecimal.ROUND_HALF_UP);
|
||||
BeanUtils.copyProperties(v.get(0), vo);
|
||||
vo.setScore(score.doubleValue());
|
||||
dataList.add(vo);
|
||||
});
|
||||
} catch (Exception e) {
|
||||
log.error("施工质量", e);
|
||||
}
|
||||
List<ConstrQuality> sortDataList = dataList.stream().sorted(Comparator.comparing(ConstrQuality::getScore, Comparator.reverseOrder())).collect(Collectors.toList());
|
||||
return AjaxResult.success(sortDataList);
|
||||
}
|
||||
|
||||
public static boolean isNumeric(String str) {
|
||||
if (str == null || str.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
Double.parseDouble(str);
|
||||
return true;
|
||||
} catch (NumberFormatException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,4 +17,31 @@
|
|||
) a ON a.status = sd.dict_code
|
||||
WHERE sd.p_code = 1200 AND sd.del_flag = 0
|
||||
</select>
|
||||
<!--地图风险点-->
|
||||
<select id="riskStatistics" resultType="com.securitycontrol.entity.screen.vo.MapRiskVo">
|
||||
SELECT tcm.class_id AS classId,
|
||||
tcm.lon,
|
||||
tcm.lat,
|
||||
tcm.bid_name AS bidName,
|
||||
tcm.team_name AS teamName,
|
||||
tcm.risk_level AS riskLevel,
|
||||
tcm.work_content AS workContent,
|
||||
tcm.bid_code AS bidCode,
|
||||
tcm.work_manager AS workManager
|
||||
FROM t_class_metting tcm
|
||||
WHERE tcm.work_day = CURRENT_DATE AND tcm.del_flag = 0
|
||||
</select>
|
||||
<!--施工质量-->
|
||||
<select id="constrQuality" resultType="com.securitycontrol.entity.screen.vo.ConstrQuality">
|
||||
SELECT tte.team_id AS teamId,
|
||||
tp.pro_name AS bidName,
|
||||
tp.bid_code AS bidCode,
|
||||
twt.team_name AS teamName,
|
||||
twt.team_leader AS teamLeader,
|
||||
tte.score AS constrQuality
|
||||
FROM tb_team_eval tte
|
||||
LEFT JOIN tb_work_team twt on tte.team_id = twt.team_id
|
||||
LEFT JOIN tb_project tp ON tp.bid_code = twt.bid_code AND tp.del_flag = 0
|
||||
WHERE tte.del_falge = 0
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue