Browse Source

大屏接口修改

dev_shibei_match
zhangyongzhangyong 5 years ago
parent
commit
08efa913a7
  1. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java
  2. 66
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataYearlyFormDTO.java
  3. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java
  4. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataMonthlyDao.java
  5. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataYearlyDao.java
  6. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java
  7. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java
  8. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  9. 52
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml
  10. 2
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java

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;
/**
* 1指数相关 入参
* 1指数_按月统计 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class IndexDataFormDTO implements Serializable {
public class IndexDataMonthlyFormDTO implements Serializable {
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;
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.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.utils.Result;
@ -135,20 +133,33 @@ public class ScreenCollController {
}
/**
* 1指数相关
* 1指数_按月统计
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@PostMapping("indexdata")
public Result indexData(@RequestBody List<IndexDataFormDTO> formDTO) {
return screenCollService.insertIndexData(formDTO);
@PostMapping("indexdatamonthly")
public Result indexDataMonthly(@RequestBody List<IndexDataMonthlyFormDTO> 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部门信息上传
*

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;
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 org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -45,7 +45,7 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao<ScreenIndexDataMonthl
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deleteIndexData(@Param("customerId") String customerId,
void deleteIndexDataMonthly(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("orgIds") String[] orgIds);
@ -58,5 +58,5 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao<ScreenIndexDataMonthl
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void batchInsertIndexData(@Param("list") List<IndexDataFormDTO> list);
void batchInsertIndexDataMonthly(@Param("list") List<IndexDataMonthlyFormDTO> list);
}

27
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;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO;
import com.epmet.entity.screen.ScreenIndexDataYearlyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 指数-指数数据(按年统计)
@ -30,4 +34,27 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
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);
/**
* 1指数相关
* 1指数_按月统计
* 1) 根据CUSTOMER_IDYEAR_IDMONTH_IDORG_ID进行查询如果有数据则先进行物理删除
* 2) 在新增
*
@ -113,7 +113,19 @@ public interface ScreenCollService {
* @Author zhangyong
* @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部门信息上传

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
private ScreenCpcBaseDataDao screenCpcBaseDataDao;
@Autowired
private ScreenIndexDataDao screenIndexDataDao;
private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao;
@Autowired
private ScreenCustomerDeptDao screenCustomerDeptDao;
@Autowired
@ -70,7 +70,8 @@ public class ScreenCollServiceImpl implements ScreenCollService {
private ScreenUserJoinDao screenUserJoinDao;
@Autowired
private ScreenPioneerDataDao screenPioneerDataDao;
@Autowired
private ScreenIndexDataYearlyDao screenIndexDataYearlyDao;
@Override
@Transactional(rollbackFor = Exception.class)
public void insertPartyUserRankData(List<PartyUserRankDataFormDTO> formDTO,String customerId) {
@ -214,18 +215,34 @@ public class ScreenCollServiceImpl implements ScreenCollService {
@Override
@Transactional(rollbackFor = Exception.class)
public Result insertIndexData(List<IndexDataFormDTO> formDTO) {
public Result insertIndexDataMonthly(List<IndexDataMonthlyFormDTO> 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();
}
screenIndexDataDao.deleteIndexData(formDTO.get(NumConstant.ZERO).getCustomerId(),
screenIndexDataMonthlyDao.deleteIndexDataMonthly(formDTO.get(NumConstant.ZERO).getCustomerId(),
formDTO.get(NumConstant.ZERO).getYearId(),
formDTO.get(NumConstant.ZERO).getMonthId(),
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();
}

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">
<delete id="deleteIndexData">
<delete id="deleteIndexDataMonthly">
delete from screen_index_data_monthly
where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId}
AND ORG_ID IN
@ -12,7 +12,7 @@
</foreach>
</delete>
<insert id="batchInsertIndexData" parameterType="java.util.List">
<insert id="batchInsertIndexDataMonthly" parameterType="java.util.List">
insert into screen_index_data_monthly
(
ID,

52
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">
<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},
#{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() {
HashMap<String, Object> claim = new HashMap<>();
claim.put("appId", "227fb75ae4baa820755aaf43bf7f0a69");
claim.put("appId", "dbfad3110c124c89948d16e8b06a8888");
claim.put("customerId", "c1");
claim.put("ts", System.currentTimeMillis() - 1000 * 60 * 4);

Loading…
Cancel
Save