Browse Source

大屏接口放在data_report服务

dev
sunyuchao 3 years ago
parent
commit
68c60affc7
  1. 53
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/HistoryScoreListFormDTO.java
  2. 160
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/HistoryScoreDetailResultDTO.java
  3. 7
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java
  4. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java
  5. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java
  6. 26
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java
  7. 29
      epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml

53
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/HistoryScoreListFormDTO.java

@ -0,0 +1,53 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@Data
public class HistoryScoreListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface List extends CustomerClientShowGroup {}
/**
* 标题
*/
private String title;
/**
* 起始时间
*/
//@JsonFormat(pattern = "yyyy-MM-dd")
@NotBlank(message = "起始时间不能为空", groups = List.class)
private String startTime;
/**
* 截止时间
*/
//@JsonFormat(pattern = "yyyy-MM-dd")
@NotBlank(message = "截止时间不能为空", groups = List.class)
private String endTime;
/**
* 当前页
*/
private Integer pageNo = 1;
/**
* 每页记录数
*/
private Integer pageSize = 20;
/**
* 是否分页true分 false不分
*/
private Boolean isPage = true;
private String customerId;
private String userId;
}

160
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/HistoryScoreDetailResultDTO.java

@ -0,0 +1,160 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
public class HistoryScoreDetailResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface Add extends CustomerClientShowGroup {
}
public interface Edit extends CustomerClientShowGroup {
}
/**
* id
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 标题
*/
private String title;
/**
* 起始时间
*/
private Date startTime;
/**
* 截止时间
*/
private Date endTime;
/**
* 时间区间
*/
private String time;
/**
* 发布时间
*/
private Date releaseTime;
/**
* 截止时间
*/
private List<Detail> detailList;
@Data
public static class Detail implements Serializable {
/**
* id
*/
private String id;
/**
* screen_py_history_score.id
*/
private String historyScoreId;
/**
* 街道组织Id
*/
private String agencyId = "";
/**
* 街道名称
*/
private String agencyName = "";
/**
* 网格活跃度
*/
private BigDecimal wghyd = new BigDecimal(0);
/**
* 事件赋分
*/
private BigDecimal sjff = new BigDecimal(0);
/**
* 接入率
*/
private BigDecimal jrl = new BigDecimal(0);
/**
* 在线率
*/
private BigDecimal zxl = new BigDecimal(0);
/**
* 出图率
*/
private BigDecimal ctl = new BigDecimal(0);
/**
* 雪亮工程
*/
private BigDecimal xlgc = new BigDecimal(0);
/**
* 完成进度
*/
private BigDecimal wcjd = new BigDecimal(0);
/**
* 未补检
*/
private BigDecimal wbj = new BigDecimal(0);
/**
* 反馈抽检
*/
private BigDecimal fkcj = new BigDecimal(0);
/**
* 日核周调
*/
private BigDecimal rhzt = new BigDecimal(0);
/**
* 亮点工作
*/
private BigDecimal ldgz = new BigDecimal(0);
/**
* 亮点工作备注
*/
private String ldgzbz;
/**
* 其他工作
*/
private BigDecimal qtgz = new BigDecimal(0);
/**
* 其他工作备注
*/
private String qtgzbz;
/**
* 能力得分
*/
private BigDecimal nldf = new BigDecimal(0);
}
}

7
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java

@ -21,6 +21,8 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; import com.epmet.datareport.service.evaluationindex.index.IndexExplainService;
import com.epmet.dto.form.HistoryScoreListFormDTO;
import com.epmet.dto.result.HistoryScoreDetailResultDTO;
import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; import com.epmet.evaluationindex.index.form.IndexExplainFormDTO;
import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; import com.epmet.evaluationindex.index.form.IndexScoreFormDTO;
import com.epmet.evaluationindex.index.result.IndexExplainResult; import com.epmet.evaluationindex.index.result.IndexExplainResult;
@ -78,5 +80,10 @@ public class IndexExplainController {
return new Result<IndexDictResultDTO>().ok(result); return new Result<IndexDictResultDTO>().ok(result);
} }
@RequestMapping("dplist")
public Result<List<HistoryScoreDetailResultDTO.Detail>> dplist(@RequestBody HistoryScoreListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, HistoryScoreListFormDTO.List.class);
return new Result<List<HistoryScoreDetailResultDTO.Detail>>().ok(indexExplainService.dplist(formDTO));
}
} }

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java

@ -17,6 +17,8 @@
package com.epmet.datareport.dao.evaluationindex.index; package com.epmet.datareport.dao.evaluationindex.index;
import com.epmet.dto.form.HistoryScoreListFormDTO;
import com.epmet.dto.result.HistoryScoreDetailResultDTO;
import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -33,4 +35,6 @@ import java.util.List;
public interface IndexExplainDao { public interface IndexExplainDao {
List<IndexExplainTreeDTO> getIndexExplainTreeByOrgType(@Param("orgLevel") String orgLevel); List<IndexExplainTreeDTO> getIndexExplainTreeByOrgType(@Param("orgLevel") String orgLevel);
List<HistoryScoreDetailResultDTO.Detail> selectDpList(HistoryScoreListFormDTO formDTO);
} }

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java

@ -17,6 +17,8 @@
package com.epmet.datareport.service.evaluationindex.index; package com.epmet.datareport.service.evaluationindex.index;
import com.epmet.dto.form.HistoryScoreListFormDTO;
import com.epmet.dto.result.HistoryScoreDetailResultDTO;
import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; import com.epmet.evaluationindex.index.form.IndexExplainFormDTO;
import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; import com.epmet.evaluationindex.index.form.IndexScoreFormDTO;
import com.epmet.evaluationindex.index.result.IndexExplainResult; import com.epmet.evaluationindex.index.result.IndexExplainResult;
@ -51,4 +53,6 @@ public interface IndexExplainService {
* @date 2021/5/20 10:20 上午 * @date 2021/5/20 10:20 上午
*/ */
IndexDictResultDTO getIndexMeaning(IndexScoreFormDTO formDTO); IndexDictResultDTO getIndexMeaning(IndexScoreFormDTO formDTO);
List<HistoryScoreDetailResultDTO.Detail> dplist(HistoryScoreListFormDTO formDTO);
} }

26
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java

@ -29,6 +29,8 @@ import com.epmet.datareport.dao.evaluationindex.index.IndexExplainDao;
import com.epmet.datareport.dao.evaluationindex.index.IndexGroupDetailDao; import com.epmet.datareport.dao.evaluationindex.index.IndexGroupDetailDao;
import com.epmet.datareport.dao.fact.*; import com.epmet.datareport.dao.fact.*;
import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; import com.epmet.datareport.service.evaluationindex.index.IndexExplainService;
import com.epmet.dto.form.HistoryScoreListFormDTO;
import com.epmet.dto.result.HistoryScoreDetailResultDTO;
import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO;
import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; import com.epmet.evaluationindex.index.form.IndexExplainFormDTO;
import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; import com.epmet.evaluationindex.index.form.IndexScoreFormDTO;
@ -45,6 +47,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -436,4 +439,25 @@ public class IndexExplainServiceImpl implements IndexExplainService {
return headers; return headers;
} }
}
@Override
public List<HistoryScoreDetailResultDTO.Detail> dplist(HistoryScoreListFormDTO formDTO) {
//按条件查询数据,并做加和取平均值操作
List<HistoryScoreDetailResultDTO.Detail> resultList = indexExplainDao.selectDpList(formDTO);
Map<String,String> map = new HashMap<>();
map.put("1258587398679126017","榆山街道");map.put("1215437824174608386","锦水街道");
map.put("f8d4a6af53b3fc5991ab1434b6ad39b8","东阿镇");map.put("d20a7488eedf5bcfd5231c3771bc0e3d","玫瑰镇");
map.put("ea78a8e9252f567517c4a8d60250c714","安城镇");map.put("1234085031077498881","孔村镇");
map.put("f279343a67653fc20d8333c6b2e4dbee","孝直镇");map.put("c259c3b1d27f960b9b379fb2886179ba","洪范池镇");
resultList.forEach(re->{
map.remove(re.getAgencyId());
});
for (String ma : map.keySet()){
HistoryScoreDetailResultDTO.Detail detail = new HistoryScoreDetailResultDTO.Detail();
detail.setAgencyId(ma);
detail.setAgencyName(map.get(ma));
resultList.add(detail);
}
return resultList;
}

29
epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml

@ -37,4 +37,33 @@
AND PID = #{pid} AND PID = #{pid}
ORDER BY SORT ORDER BY SORT
</select> </select>
<select id="selectDpList" resultType="com.epmet.dto.result.HistoryScoreDetailResultDTO$Detail">
SELECT
b.agency_id agencyId,
b.agency_name agencyName,
avg(b.wghyd) wghyd,
avg(b.sjff) sjff,
avg(b.xlgc) xlgc,
avg(b.rhzt) rhzt,
avg(b.ldgz) ldgz,
avg(b.qtgz) qtgz,
avg(b.nldf) nldf
FROM
screen_py_history_score a
LEFT JOIN screen_py_history_score_detail b ON a.id = b.history_score_id
WHERE
a.del_flag = '0'
<if test="startTime != null and startTime.trim() != ''">
AND DATE_FORMAT(a.start_time, '%Y-%m-%d') >= #{startTime}
</if>
<if test="endTime != null and endTime.trim() != ''">
<![CDATA[AND DATE_FORMAT(a.end_time, '%Y-%m-%d') <= #{endTime}]]>
</if>
GROUP BY
b.agency_id
ORDER BY
avg(b.nldf) DESC, b.agency_name ASC
</select>
</mapper> </mapper>

Loading…
Cancel
Save