省侧大屏-工程统计
This commit is contained in:
parent
2797d00bf3
commit
18bbf3aebd
|
|
@ -45,6 +45,10 @@ public class Constant {
|
||||||
public final static String MANAGER = "manager";
|
public final static String MANAGER = "manager";
|
||||||
public final static String DUTY = "duty";
|
public final static String DUTY = "duty";
|
||||||
public final static String CITY = "city";
|
public final static String CITY = "city";
|
||||||
|
public final static String ZJ = "在建";
|
||||||
|
public final static String DJ = "待建";
|
||||||
|
public final static String TC = "投产";
|
||||||
|
public final static String TG = "停工";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||||
import com.securitycontrol.screen.service.IScIndexService;
|
import com.securitycontrol.screen.service.IScIndexService;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
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.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
|
@ -17,14 +18,14 @@ import javax.annotation.Resource;
|
||||||
* @description:省侧大屏-web
|
* @description:省侧大屏-web
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/screen/scIndex/")
|
@RequestMapping("/largeScreen/scIndex/")
|
||||||
public class ScIndexController {
|
public class ScIndexController {
|
||||||
|
|
||||||
@Resource(name = "IScIndexService")
|
@Resource(name = "IScIndexService")
|
||||||
private IScIndexService service;
|
private IScIndexService service;
|
||||||
|
|
||||||
@ApiOperation(value = "工程统计")
|
@ApiOperation(value = "工程统计")
|
||||||
@GetMapping("proStatusStatistics")
|
@PostMapping("proStatusStatistics")
|
||||||
public AjaxResult proStatusStatistics(ScreenParamDto dto){
|
public AjaxResult proStatusStatistics(ScreenParamDto dto){
|
||||||
return service.proStatusStatistics(dto);
|
return service.proStatusStatistics(dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,12 @@
|
||||||
package com.securitycontrol.screen.mapper;
|
package com.securitycontrol.screen.mapper;
|
||||||
|
|
||||||
|
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||||
|
import org.apache.ibatis.annotations.MapKey;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author:cwchen
|
* @author:cwchen
|
||||||
* @date:2024-03-27-10:15
|
* @date:2024-03-27-10:15
|
||||||
|
|
@ -10,4 +15,14 @@ import org.springframework.stereotype.Repository;
|
||||||
*/
|
*/
|
||||||
@Repository(value = "IScIndexMapper")
|
@Repository(value = "IScIndexMapper")
|
||||||
public interface IScIndexMapper {
|
public interface IScIndexMapper {
|
||||||
|
/**
|
||||||
|
* 工程统计
|
||||||
|
* @param dto
|
||||||
|
* @return List<Map < Object>>
|
||||||
|
* @description
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/3/27 13:15
|
||||||
|
*/
|
||||||
|
@MapKey("id")
|
||||||
|
List<Map<String, Object>> proStatusStatistics(ScreenParamDto dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.securitycontrol.screen.service.impl;
|
package com.securitycontrol.screen.service.impl;
|
||||||
|
|
||||||
|
import com.securitycontrol.common.core.constant.Constant;
|
||||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||||
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||||
import com.securitycontrol.screen.mapper.IScIndexMapper;
|
import com.securitycontrol.screen.mapper.IScIndexMapper;
|
||||||
|
|
@ -8,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author:cwchen
|
* @author:cwchen
|
||||||
|
|
@ -24,6 +26,31 @@ public class ScIndexServiceImpl implements IScIndexService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult proStatusStatistics(ScreenParamDto dto) {
|
public AjaxResult proStatusStatistics(ScreenParamDto dto) {
|
||||||
return null;
|
Map<Object, Object> dataMap = new HashMap<>(16);
|
||||||
|
List<Map<String, Object>> list = new ArrayList<>(16);
|
||||||
|
int zjNum = 0, djNum = 0, tcNum = 0, tgNum = 0;
|
||||||
|
try {
|
||||||
|
list = mapper.proStatusStatistics(dto);
|
||||||
|
for (Map<String, Object> map : list) {
|
||||||
|
String name = String.valueOf(map.get("name"));
|
||||||
|
if(Objects.equals(name, Constant.ZJ)){
|
||||||
|
zjNum = Integer.parseInt(String.valueOf(map.get("num")));
|
||||||
|
}else if(Objects.equals(name, Constant.DJ)){
|
||||||
|
djNum = Integer.parseInt(String.valueOf(map.get("num")));
|
||||||
|
}else if(Objects.equals(name, Constant.TC)){
|
||||||
|
tcNum = Integer.parseInt(String.valueOf(map.get("num")));
|
||||||
|
}else if(Objects.equals(name, Constant.TG)){
|
||||||
|
tgNum = Integer.parseInt(String.valueOf(map.get("num")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("工程统计", e);
|
||||||
|
}
|
||||||
|
dataMap.put("zjNum", zjNum);
|
||||||
|
dataMap.put("djNum", djNum);
|
||||||
|
dataMap.put("tcNum", tcNum);
|
||||||
|
dataMap.put("tgNum", tgNum);
|
||||||
|
dataMap.put("allNum", zjNum + djNum + tcNum + tgNum);
|
||||||
|
return AjaxResult.success(dataMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,19 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="com.securitycontrol.screen.mapper.IScIndexMapper">
|
<mapper namespace="com.securitycontrol.screen.mapper.IScIndexMapper">
|
||||||
|
|
||||||
|
<!--工程统计-->
|
||||||
|
<select id="proStatusStatistics" resultType="java.util.Map">
|
||||||
|
SELECT sd.dict_code AS id,
|
||||||
|
sd.dict_name AS name,
|
||||||
|
IFNULL(a.num,0) AS num
|
||||||
|
FROM sys_dict sd
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT tp.status,
|
||||||
|
COUNT(tp.status) AS num
|
||||||
|
FROM tb_project tp
|
||||||
|
LEFT JOIN sys_dict sd ON tp.status = sd.dict_code AND sd.dict_code = 0
|
||||||
|
GROUP BY sd.dict_code
|
||||||
|
) a ON a.status = sd.dict_code
|
||||||
|
WHERE sd.p_code = 1200 AND sd.del_flag = 0
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue