|
|
@@ -120,15 +120,17 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
// 年 year 去年 lastYear 今年 nowYear
|
|
|
|
|
|
|
|
|
- String dateCondition = "";
|
|
|
+ String dateCondition = "";String year = "";
|
|
|
|
|
|
// 在岗培训人员统计情况
|
|
|
if (dates.contains("-")){
|
|
|
+ year = dates.substring(0,4);
|
|
|
// 月
|
|
|
dashBoardDTO.setPxrytjqkDtoList(getYmdData(getAllDatesOfMonth(dates),dept,"month",""));
|
|
|
dateCondition = String.format(" AND DATE_FORMAT(pei_xun_shi_jian_, '%%Y-%%m') = '%s'", dates);
|
|
|
}else {
|
|
|
// 年
|
|
|
+ year =dates;
|
|
|
dashBoardDTO.setPxrytjqkDtoList(getYmdData(getYearMonth(),dept,"year",dates));
|
|
|
dateCondition = String.format(" AND DATE_FORMAT(pei_xun_shi_jian_, '%%Y') = '%s'", dates);
|
|
|
}
|
|
|
@@ -143,10 +145,10 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
dashBoardDTO.setObjectDto(getObjectRate(dept,dateCondition));
|
|
|
|
|
|
// 本年度岗前培训计划
|
|
|
- dashBoardDTO.setNdgqpxList(getCurrentYearData(getYearMonth(),dept));
|
|
|
+ dashBoardDTO.setNdgqpxList(getCurrentYearData(getYearMonth(),dept,year));
|
|
|
|
|
|
// 本年度岗前培训类别占比
|
|
|
- dashBoardDTO.setYearPreWorkDto(getYearPre(dept));
|
|
|
+ dashBoardDTO.setYearPreWorkDto(getYearPre(dept,year));
|
|
|
|
|
|
list.add(dashBoardDTO);
|
|
|
return list;
|
|
|
@@ -169,7 +171,7 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
// 部门设备寿命情况统计
|
|
|
equipDTO.setLifeTimeData(getEquipServiceLife());
|
|
|
|
|
|
- // 设备调整情况
|
|
|
+ // 设备整体情况
|
|
|
|
|
|
// 各部门设备完好情况
|
|
|
|
|
|
@@ -183,6 +185,33 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ private void setEntirety(int total){
|
|
|
+ EquipEntiretyDTO entiretyDTO = new EquipEntiretyDTO();
|
|
|
+ // 设备总数
|
|
|
+ EquipTotalityDTO totalityDTO = new EquipTotalityDTO();
|
|
|
+ totalityDTO.setSum(total);
|
|
|
+ Map<String,Object> tYear = new HashMap<>();
|
|
|
+ Map<String,Object> tMonth = new HashMap<>();
|
|
|
+ String ySql = "SELECT count(*)as nums from t_sbdj WHERE DATE_FORMAT(create_time_,'%Y')=YEAR(CURDATE()) and di_dian_='%s' ";
|
|
|
+ String mSql = "SELECT count(*)as nums from t_sbdj WHERE DATE_FORMAT(create_time_,'%Y-%m')=CONCAT(YEAR(CURDATE()),'-',LPAD(MONTH(CURDATE()),2,'0')) and di_dian_='%s'";
|
|
|
+ ySql = String.format(ySql,getDiDian());
|
|
|
+ mSql = String.format(mSql,getDiDian());
|
|
|
+ int yAdd = Integer.parseInt(commonDao.queryOne(ySql).get("nums").toString());
|
|
|
+ int mAdd = Integer.parseInt(commonDao.queryOne(mSql).get("nums").toString());
|
|
|
+ // 本年
|
|
|
+ tYear.put("add",yAdd);// 新增
|
|
|
+ tYear.put("outService","");// 停用
|
|
|
+ tYear.put("scrap","");// 报废
|
|
|
+ // 本月
|
|
|
+ tMonth.put("add",mAdd);
|
|
|
+ tMonth.put("outService","");
|
|
|
+ tMonth.put("scrap","");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public List<EquipServiceLifeDTO> getEquipServiceLife(){
|
|
|
Set<String> existsDept = new HashSet<>();
|
|
|
List<EquipServiceLifeDTO> lifeDTOList = new ArrayList<>();
|
|
|
@@ -343,9 +372,10 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
|
|
|
public TrainGuardAutoPlanDto getPlanRate(String dept){
|
|
|
TrainGuardAutoPlanDto planDto = new TrainGuardAutoPlanDto();
|
|
|
- String zdSql = "select count(*) as auto from t_rypxcjb where ji_hua_wai_jian_ in(select id_ from t_ndrypxjhzb) and ji_hua_lei_xing_='在岗培训' %s";
|
|
|
+ String zdSql = "select count(*) as auto from t_rypxcjb where ji_hua_wai_jian_ in(select id_ from t_ndrypxjhzb " +
|
|
|
+ "where di_dian_='"+getDiDian()+"') and ji_hua_lei_xing_='在岗培训' %s";
|
|
|
String zsSql = "select count(*) as total from t_rypxcjb where ji_hua_lei_xing_='在岗培训' %s ";
|
|
|
- String dateCondition = String.format(" AND di_dian_ = '%s' ", getDiDian());
|
|
|
+ String dateCondition = String.format(" AND di_dian_ = '%s' and shi_fou_guo_shen_='已结束' ", getDiDian());
|
|
|
if (BeanUtils.isNotEmpty(dept)){
|
|
|
dateCondition += String.format(" AND bian_zhi_bu_men_ = '%s' ", dept);
|
|
|
}
|
|
|
@@ -459,7 +489,7 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
return typeDto;
|
|
|
}
|
|
|
|
|
|
- public TrainYearPreWorkDto getYearPre(String dept){
|
|
|
+ public TrainYearPreWorkDto getYearPre(String dept,String year){
|
|
|
TrainYearPreWorkDto preWorkDto = new TrainYearPreWorkDto();
|
|
|
preWorkDto.setRemark("本年度岗前培训类别占比");
|
|
|
List<TrainRateDto> rateDtoList = new ArrayList<>();
|
|
|
@@ -471,6 +501,7 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
if (BeanUtils.isNotEmpty(dept)){
|
|
|
dateCondition += String.format(" AND bian_zhi_bu_men_ = '%s' ", dept);
|
|
|
}
|
|
|
+ dateCondition += String.format(" AND DATE_FORMAT(pei_xun_shi_jian_,'%%Y-%%m')='%s' ", year);
|
|
|
sql = String.format(sql,dateCondition);
|
|
|
talSql = String.format(talSql,dateCondition);
|
|
|
List<Map<String,Object>> list = (List<Map<String, Object>>) commonDao.query(sql);
|
|
|
@@ -490,11 +521,10 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
return preWorkDto;
|
|
|
}
|
|
|
|
|
|
- public List<Map<String, Object>> getCurrentYearData(List<String> dateStr, String dept) {
|
|
|
+ public List<Map<String, Object>> getCurrentYearData(List<String> dateStr, String dept,String year) {
|
|
|
String baseSql = "SELECT count(*) AS total FROM t_rypxcjb WHERE ji_hua_lei_xing_ = '岗前培训' AND shi_fou_guo_shen_ = '已结束' and di_dian_='%s'";
|
|
|
baseSql = String.format(baseSql,getDiDian());
|
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
|
- int year = Year.now().getValue();
|
|
|
for (String date : dateStr) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("date", date + "月");
|