Commit 16be9bf5 authored by zhangyingbin's avatar zhangyingbin

项目监控地图统计接口修改

parent 8a96560c
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project; import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
...@@ -46,4 +47,11 @@ public interface ProjectMapper extends BaseMapper<Project> { ...@@ -46,4 +47,11 @@ public interface ProjectMapper extends BaseMapper<Project> {
String projectBuiltUnit(Long companyId); String projectBuiltUnit(Long companyId);
String projectUnderConstructionUnit(Long companyId); String projectUnderConstructionUnit(Long companyId);
/**
* 获取当前登陆人所在单位下的项目情况(已完成、未完成)
* @param projectIds
* @return
*/
List<Map<String,String>> getProjectComplete(@Param("projectIds") Set<Long> projectIds);
} }
...@@ -244,4 +244,29 @@ ...@@ -244,4 +244,29 @@
where o.scheludel != 100; where o.scheludel != 100;
</select> </select>
<select id="getProjectComplete" resultType="java.util.Map">
SELECT
a.完成情况 AS name,
COUNT(1) AS value
FROM (SELECT
a.name,
a.进度,
case WHEN a.进度>1 THEN '已完成' ELSE '未完成' END AS 完成情况
FROM (SELECT
up.name,
ifNull((weldNum/(length/10)),0) AS 进度
FROM tz_ugp_project AS up
LEFT JOIN (SELECT project_id,count(1) AS weldNum FROM tz_ugp_weld GROUP BY project_id) AS uw ON uw.project_id = up.sequence_nbr
<where>
<if test="projectIds!=null and projectIds.size>0">
and up.sequence_nbr in
<foreach collection="projectIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
) AS a) AS a
GROUP BY a.完成情况
</select>
</mapper> </mapper>
...@@ -405,7 +405,7 @@ public class ProjectController extends BaseController { ...@@ -405,7 +405,7 @@ public class ProjectController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "项目进度", notes = "项目进度") @ApiOperation(httpMethod = "GET", value = "项目进度", notes = "项目进度")
@GetMapping(value = "/projectSchedule") @GetMapping(value = "/projectSchedule")
public ResponseModel <Map<String,List<String>>> projectSchedule(){ public ResponseModel <List<Map<String,String>>> projectSchedule(){
return ResponseHelper.buildResponse(projectServiceImpl.projectSchedule()); return ResponseHelper.buildResponse(projectServiceImpl.projectSchedule());
} }
......
...@@ -351,25 +351,15 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project ...@@ -351,25 +351,15 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
@BusinessIdentify @BusinessIdentify
public Map<String, List<String>> projectSchedule() { public List<Map<String, String>> projectSchedule() {
Map<String, List<String>> map = new HashMap<>(); List<Project> projectList = projectResourceService.getProjectList();
ReginParams ReginParams = orgService.getReginParams(); Set<Long> projectIds = new HashSet<>();
String companyType = ReginParams.getBusinessInfo().getCompanyType(); if(!ValidationUtil.isEmpty(projectList)){
Long companyId = ReginParams.getBusinessInfo().getCompanySequenceNbr(); for (Project project :projectList){
if (OrgEnum.监察部门.getKey().equals(companyType)) { projectIds.add(project.getSequenceNbr());
List<String> strings1 = projectMapper.projectScheduleSuperviseName(companyId);
map.put("axisData",strings1);
List<String> strings2 = projectMapper.projectScheduleSuperviseNum(companyId);
map.put("seriesData",strings2);
return map;
} else if (OrgEnum.监检机构.getKey().equals(companyType)) {
List<String> strings1 = projectMapper.projectScheduleInspectionName(companyId);
map.put("axisData",strings1);
List<String> strings2 = projectMapper.projectScheduleInspectionNum(companyId);
map.put("seriesData",strings2);
return map;
} }
return null; }
return projectMapper.getProjectComplete(projectIds);
} }
public List<Map<String,String>> projectOverview() { public List<Map<String,String>> projectOverview() {
......
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