Browse Source

Merge remote-tracking branch 'origin/dev_screen_data' into dev_screen_data

dev_shibei_match
yinzuomei 5 years ago
parent
commit
f70063f141
  1. 24
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/MonthPieChartFormDTO.java
  2. 24
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/YearAverageIndexFormDTO.java
  3. 30
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthPieChartResultDTO.java
  4. 35
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/YearAverageIndexResultDTO.java
  5. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java
  6. 42
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java
  7. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java
  8. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.java
  9. 22
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java
  10. 42
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java
  11. 16
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  12. 17
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml
  13. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java
  14. 66
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataYearlyFormDTO.java
  15. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java
  16. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataMonthlyDao.java
  17. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataYearlyDao.java
  18. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java
  19. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java
  20. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  21. 54
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml
  22. 2
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java

24
epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/MonthPieChartFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/19 3:10 下午
*/
@Data
public class MonthPieChartFormDTO implements Serializable {
private static final long serialVersionUID = -3163410637094615814L;
public interface MonthPieChart{}
/**
* 机关ID
*/
@NotBlank(message = "机关ID不能为空",groups = {MonthPieChart.class})
private String agencyId;
}

24
epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/YearAverageIndexFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/19 2:40 下午
*/
@Data
public class YearAverageIndexFormDTO implements Serializable {
private static final long serialVersionUID = -2389432085360116229L;
public interface YearAverageIndex{}
/**
* 机关Id
*/
@NotBlank(message = "机关ID不能为空",groups = {YearAverageIndex.class})
private String agencyId;
}

30
epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthPieChartResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/19 3:12 下午
*/
@Data
public class MonthPieChartResultDTO implements Serializable {
private static final long serialVersionUID = 8399158251970739021L;
/**
* 服务能力
*/
private Double serviceAbility = 0.0;
/**
* 党建能力
*/
private Double partyDevAbility = 0.0;
/**
* 治理能力
*/
private Double governAbility = 0.0;
}

35
epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/YearAverageIndexResultDTO.java

@ -0,0 +1,35 @@
package com.epmet.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/19 2:45 下午
*/
@Data
public class YearAverageIndexResultDTO implements Serializable {
private static final long serialVersionUID = 6453379153616899440L;
/**
* 年度平均指数
*/
private Double yearAverageIndex = 0.0;
/**
* 服务能力
*/
private Double serviceAbility = 0.0;
/**
* 党建能力
*/
private Double partyDevAbility = 0.0;
/**
* 治理能力
*/
private Double governAbility = 0.0;
}

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java

@ -72,7 +72,7 @@ public class DistributionController {
* @author zxc * @author zxc
* @date 2020/8/19 1:29 下午 * @date 2020/8/19 1:29 下午
*/ */
// @ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("project") @PostMapping("project")
public Result<List<ProjectResultDTO>> project(@RequestBody ProjectFormDTO projectFormDTO){ public Result<List<ProjectResultDTO>> project(@RequestBody ProjectFormDTO projectFormDTO){
ValidatorUtils.validateEntity(projectFormDTO, ProjectFormDTO.Project.class); ValidatorUtils.validateEntity(projectFormDTO, ProjectFormDTO.Project.class);
@ -85,7 +85,7 @@ public class DistributionController {
* @author zxc * @author zxc
* @date 2020/8/19 1:52 下午 * @date 2020/8/19 1:52 下午
*/ */
// @ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("topprofile") @PostMapping("topprofile")
public Result<TopProfileResultDTO> topProfile(@RequestBody TopProfileFormDTO topProfileFormDTO){ public Result<TopProfileResultDTO> topProfile(@RequestBody TopProfileFormDTO topProfileFormDTO){
ValidatorUtils.validateEntity(topProfileFormDTO, TopProfileFormDTO.TopProfile.class); ValidatorUtils.validateEntity(topProfileFormDTO, TopProfileFormDTO.TopProfile.class);

42
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java

@ -1,5 +1,16 @@
package com.epmet.datareport.controller.screen; package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.screen.IndexService;
import com.epmet.screen.dto.form.MonthPieChartFormDTO;
import com.epmet.screen.dto.form.YearAverageIndexFormDTO;
import com.epmet.screen.dto.result.MonthPieChartResultDTO;
import com.epmet.screen.dto.result.YearAverageIndexResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
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;
@ -12,4 +23,35 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequestMapping("/screen/index") @RequestMapping("/screen/index")
public class IndexController { public class IndexController {
@Autowired
private IndexService indexService;
/**
* @Description 1年度平均指数
* @param yearAverageIndexFormDTO
* @author zxc
* @date 2020/8/19 2:53 下午
*/
@ExternalAppRequestAuth
@PostMapping("yearaverageindex")
public Result<YearAverageIndexResultDTO> yearAverageIndex(@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){
ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class);
return new Result<YearAverageIndexResultDTO>().ok(indexService.yearAverageIndex(yearAverageIndexFormDTO));
}
/**
* @Description 2月度指数分析-饼状图
* @param monthPieChartFormDTO
* @author zxc
* @date 2020/8/19 3:17 下午
*/
@ExternalAppRequestAuth
@PostMapping("monthindexanalysis/piechart")
public Result<MonthPieChartResultDTO> monthPieChart(@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){
ValidatorUtils.validateEntity(monthPieChartFormDTO, MonthPieChartFormDTO.MonthPieChart.class);
return new Result<MonthPieChartResultDTO>().ok(indexService.monthPieChart(monthPieChartFormDTO));
}
} }

10
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java

@ -17,7 +17,9 @@
package com.epmet.datareport.dao.screen; package com.epmet.datareport.dao.screen;
import com.epmet.screen.dto.result.MonthPieChartResultDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
* 指数-指数数据 * 指数-指数数据
@ -27,5 +29,13 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface ScreenIndexDataMonthlyDao{ public interface ScreenIndexDataMonthlyDao{
/**
* @Description 2月度指数分析-饼状图
* @param agencyId
* @author zxc
* @date 2020/8/19 3:43 下午
*/
MonthPieChartResultDTO selectMonthPieChart(@Param("agencyId")String agencyId);
} }

10
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.java

@ -17,7 +17,9 @@
package com.epmet.datareport.dao.screen; package com.epmet.datareport.dao.screen;
import com.epmet.screen.dto.result.YearAverageIndexResultDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
* 指数-指数数据(按年统计) * 指数-指数数据(按年统计)
@ -27,5 +29,13 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface ScreenIndexDataYearlyDao{ public interface ScreenIndexDataYearlyDao{
/**
* @Description 1年度平均指数
* @param agencyId
* @author zxc
* @date 2020/8/19 3:43 下午
*/
YearAverageIndexResultDTO selectYearAverageIndex(@Param("agencyId")String agencyId);
} }

22
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java

@ -1,5 +1,10 @@
package com.epmet.datareport.service.screen; package com.epmet.datareport.service.screen;
import com.epmet.screen.dto.form.MonthPieChartFormDTO;
import com.epmet.screen.dto.form.YearAverageIndexFormDTO;
import com.epmet.screen.dto.result.MonthPieChartResultDTO;
import com.epmet.screen.dto.result.YearAverageIndexResultDTO;
/** /**
* 指数相关相关各指标查询 * 指数相关相关各指标查询
* *
@ -7,4 +12,21 @@ package com.epmet.datareport.service.screen;
* @date 2020/8/18 10:21 * @date 2020/8/18 10:21
*/ */
public interface IndexService { public interface IndexService {
/**
* @Description 1年度平均指数
* @param yearAverageIndexFormDTO
* @author zxc
* @date 2020/8/19 2:53 下午
*/
YearAverageIndexResultDTO yearAverageIndex(YearAverageIndexFormDTO yearAverageIndexFormDTO);
/**
* @Description 2月度指数分析-饼状图
* @param monthPieChartFormDTO
* @author zxc
* @date 2020/8/19 3:17 下午
*/
MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO);
} }

42
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java

@ -1,6 +1,13 @@
package com.epmet.datareport.service.screen.impl; package com.epmet.datareport.service.screen.impl;
import com.epmet.datareport.dao.screen.ScreenIndexDataMonthlyDao;
import com.epmet.datareport.dao.screen.ScreenIndexDataYearlyDao;
import com.epmet.datareport.service.screen.IndexService; import com.epmet.datareport.service.screen.IndexService;
import com.epmet.screen.dto.form.MonthPieChartFormDTO;
import com.epmet.screen.dto.form.YearAverageIndexFormDTO;
import com.epmet.screen.dto.result.MonthPieChartResultDTO;
import com.epmet.screen.dto.result.YearAverageIndexResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
@ -11,4 +18,39 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class IndexServiceImpl implements IndexService { public class IndexServiceImpl implements IndexService {
@Autowired
private ScreenIndexDataYearlyDao screenIndexDataYearlyDao;
@Autowired
private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao;
/**
* @Description 1年度平均指数
* @param yearAverageIndexFormDTO
* @author zxc
* @date 2020/8/19 2:53 下午
*/
@Override
public YearAverageIndexResultDTO yearAverageIndex(YearAverageIndexFormDTO yearAverageIndexFormDTO) {
YearAverageIndexResultDTO yearAverageIndexResultDTO = screenIndexDataYearlyDao.selectYearAverageIndex(yearAverageIndexFormDTO.getAgencyId());
if (null == yearAverageIndexResultDTO){
return new YearAverageIndexResultDTO();
}
return yearAverageIndexResultDTO;
}
/**
* @Description 2月度指数分析-饼状图
* @param monthPieChartFormDTO
* @author zxc
* @date 2020/8/19 3:17 下午
*/
@Override
public MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO) {
MonthPieChartResultDTO monthPieChartResultDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId());
if (null == monthPieChartFormDTO){
return new MonthPieChartResultDTO();
}
return monthPieChartResultDTO;
}
} }

16
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

@ -3,6 +3,18 @@
<mapper namespace="com.epmet.datareport.dao.screen.ScreenIndexDataMonthlyDao"> <mapper namespace="com.epmet.datareport.dao.screen.ScreenIndexDataMonthlyDao">
<!-- 2、月度指数分析-饼状图 -->
<select id="selectMonthPieChart" resultType="com.epmet.screen.dto.result.MonthPieChartResultDTO">
SELECT
service_ablity AS serviceAbility,
party_dev_ablity AS partyDevAbility,
govern_ablity AS governAbility
FROM
screen_index_data_monthly
WHERE
del_flag = '0'
AND org_type = 'agency'
AND org_id = #{agencyId}
AND month_id = DATE_FORMAT(NOW(),'%Y%m')
</select>
</mapper> </mapper>

17
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml

@ -3,6 +3,19 @@
<mapper namespace="com.epmet.datareport.dao.screen.ScreenIndexDataYearlyDao"> <mapper namespace="com.epmet.datareport.dao.screen.ScreenIndexDataYearlyDao">
<!-- 1、年度平均指数 -->
<select id="selectYearAverageIndex" resultType="com.epmet.screen.dto.result.YearAverageIndexResultDTO">
SELECT
index_total AS yearAverageIndex,
service_ablity AS serviceAbility,
party_dev_ablity AS partyDevAbility,
govern_ablity AS governAbility
FROM
screen_index_data_yearly
WHERE
del_flag = '0'
AND org_type = 'agency'
AND org_id = #{agencyId}
AND year_id = DATE_FORMAT(NOW(),'%Y')
</select>
</mapper> </mapper>

4
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataFormDTO.java → epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java

@ -5,12 +5,12 @@ import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
/** /**
* 1指数相关 入参 * 1指数_按月统计 入参
* @Auther: zhangyong * @Auther: zhangyong
* @Date: 2020-08-18 09:59 * @Date: 2020-08-18 09:59
*/ */
@Data @Data
public class IndexDataFormDTO implements Serializable { public class IndexDataMonthlyFormDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

66
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataYearlyFormDTO.java

@ -0,0 +1,66 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
/**
* 17指数_按年统计 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class IndexDataYearlyFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* yyyy
*/
private String yearId;
/**
* 组织类别 agency组织部门department网格grid
*/
private String orgType;
/**
* 组织Id 可以为网格机关id
*/
private String orgId;
/**
* 上级组织Id
*/
private String parentId;
/**
* 组织名称
*/
private String orgName;
/**
* 总指数
*/
private Integer indexTotal;
/**
* 党建能力指数
*/
private Integer partyDevAblity;
/**
* 服务能力指数
*/
private Integer serviceAblity;
/**
* 治理能力指数
*/
private Integer governAblity;
}

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java

@ -1,7 +1,5 @@
package com.epmet.controller; package com.epmet.controller;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
@ -135,20 +133,33 @@ public class ScreenCollController {
} }
/** /**
* 1指数相关 * 1指数_按月统计
* *
* @param formDTO * @param formDTO
* @return com.epmet.commons.tools.utils.Result * @return com.epmet.commons.tools.utils.Result
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
@PostMapping("indexdata") @PostMapping("indexdatamonthly")
public Result indexData(@RequestBody List<IndexDataFormDTO> formDTO) { public Result indexDataMonthly(@RequestBody List<IndexDataMonthlyFormDTO> formDTO) {
return screenCollService.insertIndexData(formDTO); return screenCollService.insertIndexDataMonthly(formDTO);
} }
// -- // --
/**
* 17指数_按年统计
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@PostMapping("indexdatayearly")
public Result indexDataYearly(@RequestBody List<IndexDataYearlyFormDTO> formDTO) {
return screenCollService.insertIndexDataYearly(formDTO);
}
/** /**
* 16部门信息上传 * 16部门信息上传
* *

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataMonthlyDao.java

@ -18,7 +18,7 @@
package com.epmet.dao.screen; package com.epmet.dao.screen;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screencoll.form.IndexDataFormDTO; import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO;
import com.epmet.entity.screen.ScreenIndexDataMonthlyEntity; import com.epmet.entity.screen.ScreenIndexDataMonthlyEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -45,7 +45,7 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao<ScreenIndexDataMonthl
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deleteIndexData(@Param("customerId") String customerId, void deleteIndexDataMonthly(@Param("customerId") String customerId,
@Param("yearId") String yearId, @Param("yearId") String yearId,
@Param("monthId") String monthId, @Param("monthId") String monthId,
@Param("orgIds") String[] orgIds); @Param("orgIds") String[] orgIds);
@ -58,5 +58,5 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao<ScreenIndexDataMonthl
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void batchInsertIndexData(@Param("list") List<IndexDataFormDTO> list); void batchInsertIndexDataMonthly(@Param("list") List<IndexDataMonthlyFormDTO> list);
} }

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataYearlyDao.java

@ -18,8 +18,12 @@
package com.epmet.dao.screen; package com.epmet.dao.screen;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO;
import com.epmet.entity.screen.ScreenIndexDataYearlyEntity; import com.epmet.entity.screen.ScreenIndexDataYearlyEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 指数-指数数据(按年统计) * 指数-指数数据(按年统计)
@ -29,5 +33,28 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface ScreenIndexDataYearlyDao extends BaseDao<ScreenIndexDataYearlyEntity> { public interface ScreenIndexDataYearlyDao extends BaseDao<ScreenIndexDataYearlyEntity> {
} /**
* 17指数_按年统计
* 1) 根据CUSTOMER_IDYEAR_IDORG_ID进行查询如果有数据则先进行物理删除
*
* @param customerId
* @param yearId
* @param orgIds 组织Id集合
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deleteIndexDataYearly(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("orgIds") String[] orgIds);
/**
* 17指数_按年统计
* 2) 在批量新增
*
* @param list
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void batchInsertIndexDataYearly(@Param("list") List<IndexDataYearlyFormDTO> list);
}

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java

@ -104,7 +104,7 @@ public interface ScreenCollService {
Result insertCpcbaseData(List<CpcBaseDataFormDTO> formDTO); Result insertCpcbaseData(List<CpcBaseDataFormDTO> formDTO);
/** /**
* 1指数相关 * 1指数_按月统计
* 1) 根据CUSTOMER_IDYEAR_IDMONTH_IDORG_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_IDYEAR_IDMONTH_IDORG_ID进行查询如果有数据则先进行物理删除
* 2) 在新增 * 2) 在新增
* *
@ -113,7 +113,19 @@ public interface ScreenCollService {
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
Result insertIndexData(List<IndexDataFormDTO> formDTO); Result insertIndexDataMonthly(List<IndexDataMonthlyFormDTO> formDTO);
/**
* 17指数_按年统计
* 1) 根据CUSTOMER_IDYEAR_IDORG_ID进行查询如果有数据则先进行物理删除
* 2) 在新增
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
Result insertIndexDataYearly(List<IndexDataYearlyFormDTO> formDTO);
/** /**
* 16部门信息上传 * 16部门信息上传

27
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java

@ -57,7 +57,7 @@ public class ScreenCollServiceImpl implements ScreenCollService {
@Autowired @Autowired
private ScreenCpcBaseDataDao screenCpcBaseDataDao; private ScreenCpcBaseDataDao screenCpcBaseDataDao;
@Autowired @Autowired
private ScreenIndexDataDao screenIndexDataDao; private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao;
@Autowired @Autowired
private ScreenCustomerDeptDao screenCustomerDeptDao; private ScreenCustomerDeptDao screenCustomerDeptDao;
@Autowired @Autowired
@ -70,7 +70,8 @@ public class ScreenCollServiceImpl implements ScreenCollService {
private ScreenUserJoinDao screenUserJoinDao; private ScreenUserJoinDao screenUserJoinDao;
@Autowired @Autowired
private ScreenPioneerDataDao screenPioneerDataDao; private ScreenPioneerDataDao screenPioneerDataDao;
@Autowired
private ScreenIndexDataYearlyDao screenIndexDataYearlyDao;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void insertPartyUserRankData(List<PartyUserRankDataFormDTO> formDTO,String customerId) { public void insertPartyUserRankData(List<PartyUserRankDataFormDTO> formDTO,String customerId) {
@ -214,18 +215,34 @@ public class ScreenCollServiceImpl implements ScreenCollService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result insertIndexData(List<IndexDataFormDTO> formDTO) { public Result insertIndexDataMonthly(List<IndexDataMonthlyFormDTO> formDTO) {
if (null != formDTO && formDTO.size() > NumConstant.ZERO){ if (null != formDTO && formDTO.size() > NumConstant.ZERO){
String[] orgIds = new String[formDTO.size()]; String[] orgIds = new String[formDTO.size()];
for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ for (int i = NumConstant.ZERO; i < formDTO.size(); i++){
orgIds[i] = formDTO.get(i).getOrgId(); orgIds[i] = formDTO.get(i).getOrgId();
} }
screenIndexDataDao.deleteIndexData(formDTO.get(NumConstant.ZERO).getCustomerId(), screenIndexDataMonthlyDao.deleteIndexDataMonthly(formDTO.get(NumConstant.ZERO).getCustomerId(),
formDTO.get(NumConstant.ZERO).getYearId(), formDTO.get(NumConstant.ZERO).getYearId(),
formDTO.get(NumConstant.ZERO).getMonthId(), formDTO.get(NumConstant.ZERO).getMonthId(),
orgIds); orgIds);
screenIndexDataDao.batchInsertIndexData(formDTO); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(formDTO);
}
return new Result();
}
@Override
public Result insertIndexDataYearly(List<IndexDataYearlyFormDTO> formDTO) {
if (null != formDTO && formDTO.size() > NumConstant.ZERO){
String[] orgIds = new String[formDTO.size()];
for (int i = NumConstant.ZERO; i < formDTO.size(); i++){
orgIds[i] = formDTO.get(i).getOrgId();
}
screenIndexDataYearlyDao.deleteIndexDataYearly(formDTO.get(NumConstant.ZERO).getCustomerId(),
formDTO.get(NumConstant.ZERO).getYearId(),
orgIds);
screenIndexDataYearlyDao.batchInsertIndexDataYearly(formDTO);
} }
return new Result(); return new Result();
} }

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

@ -3,7 +3,7 @@
<mapper namespace="com.epmet.dao.screen.ScreenIndexDataMonthlyDao"> <mapper namespace="com.epmet.dao.screen.ScreenIndexDataMonthlyDao">
<delete id="deleteIndexData"> <delete id="deleteIndexDataMonthly">
delete from screen_index_data_monthly delete from screen_index_data_monthly
where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId}
AND ORG_ID IN AND ORG_ID IN
@ -12,7 +12,7 @@
</foreach> </foreach>
</delete> </delete>
<insert id="batchInsertIndexData" parameterType="java.util.List"> <insert id="batchInsertIndexDataMonthly" parameterType="java.util.List">
insert into screen_index_data_monthly insert into screen_index_data_monthly
( (
ID, ID,

54
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml

@ -3,6 +3,58 @@
<mapper namespace="com.epmet.dao.screen.ScreenIndexDataYearlyDao"> <mapper namespace="com.epmet.dao.screen.ScreenIndexDataYearlyDao">
<delete id="deleteIndexDataYearly">
delete from screen_index_data_yearly
where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId}
AND ORG_ID IN
<foreach item="item" collection="orgIds" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<insert id="batchInsertIndexDataYearly" parameterType="java.util.List">
insert into screen_index_data_yearly
(
ID,
CUSTOMER_ID,
YEAR_ID,
ORG_TYPE,
ORG_ID,
PARENT_ID,
ORG_NAME,
INDEX_TOTAL,
PARTY_DEV_ABLITY,
SERVICE_ABLITY,
GOVERN_ABLITY,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.customerId},
#{item.yearId},
#{item.orgType},
#{item.orgId},
#{item.parentId},
#{item.orgName},
</mapper> #{item.indexTotal},
#{item.partyDevAblity},
#{item.serviceAblity},
#{item.governAblity},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
</mapper>

2
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java

@ -75,7 +75,7 @@ public class ExtAppJwtTokenUtils {
public static void genToken() { public static void genToken() {
HashMap<String, Object> claim = new HashMap<>(); HashMap<String, Object> claim = new HashMap<>();
claim.put("appId", "227fb75ae4baa820755aaf43bf7f0a69"); claim.put("appId", "dbfad3110c124c89948d16e8b06a8888");
claim.put("customerId", "c1"); claim.put("customerId", "c1");
claim.put("ts", System.currentTimeMillis() - 1000 * 60 * 4); claim.put("ts", System.currentTimeMillis() - 1000 * 60 * 4);

Loading…
Cancel
Save