Browse Source

Merge remote-tracking branch 'origin/dev_0707bugfix' into dev

dev_shibei_match
yinzuomei 4 years ago
parent
commit
725e15d2ad
  1. 13
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java
  2. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java
  3. 7
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java
  4. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java
  5. 57
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java
  6. 6
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml
  7. 14
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml

13
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java

@ -3,7 +3,6 @@ package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
@ -22,4 +21,16 @@ public class FineExampleFormDTO implements Serializable {
*/
@NotBlank(message = "机关ID不能为空",groups = {FineExample.class})
private String agencyId;
/**
* 目前只有平阴在传默认赋值370124,跟随8个街道变化
*/
private String areaCode;
/**
* 当前token中的客户id
*/
@NotBlank(message = "token中的customerId不能为空",groups = {FineExample.class})
private String customerId;
}

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java

@ -30,7 +30,8 @@ public class PartyMemberLeadController {
* @date 2020/8/20 1:56 下午
*/
@PostMapping("fineexample")
public Result<FineExampleResultDTO> fineExample(@RequestBody FineExampleFormDTO fineExampleFormDTO){
public Result<FineExampleResultDTO> fineExample(@RequestHeader("CustomerId") String customerId,@RequestBody FineExampleFormDTO fineExampleFormDTO){
fineExampleFormDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(fineExampleFormDTO, FineExampleFormDTO.FineExample.class);
return new Result<FineExampleResultDTO>().ok(partyMemberLeadService.fineExample(fineExampleFormDTO));
}

7
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java

@ -21,8 +21,6 @@ import com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 党建引领-先锋模范数据
*
@ -43,12 +41,11 @@ public interface ScreenPioneerDataDao{
/**
* @Description 根据地区码查询先锋模范
* @param areaCode
* @param customerId
* @param customerIds - 子级客户列表
* @param dataEndTime 默认是昨天yyyyMMdd
* @return com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO
* @author wangc
* @date 2021.02.24 15:39
*/
FineExampleResultDTO selectFineExampleByAreaCode(@Param("areaCode")String areaCode,@Param("customerId")String customerId,@Param("list") List<String> customerIds);
FineExampleResultDTO selectFineExampleByAreaCode(@Param("areaCode") String areaCode, @Param("dataEndTime") String dataEndTime);
}

1
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java

@ -110,6 +110,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
}
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
if (StringUtils.isNotEmpty(param.getAreaCode())){
// 目前只有平阴大屏才会传areaCode,下面的sql限制住状态为:处理中
result = screenDifficultyDataDao.selectDifficultyByAreaCode(param.getAreaCode(),param.getType());
}else {
result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType());

57
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java

@ -3,16 +3,13 @@ package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.*;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService;
import com.epmet.datareport.utils.DateUtils;
import com.epmet.datareport.utils.ModuleConstant;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ContactMassLineChartFormDTO;
@ -62,41 +59,39 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
private AgencyService screenCustomerAgencyService;
/**
* @Description 1先锋模范
* @param fineExampleFormDTO
* @Description 1先锋模范
* @author zxc
* @date 2020/8/20 1:56 下午
*/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
@Override
public FineExampleResultDTO fineExample(FineExampleFormDTO fineExampleFormDTO) {
ScreenCustomerAgencyDTO agencyInfo = customerAgencyDao.selectByAgencyId(fineExampleFormDTO.getAgencyId());
if(null == agencyInfo) throw new RenException("未找到对应的机关");
String customerId = agencyInfo.getCustomerId();
String areaCode = agencyInfo.getAreaCode();
Result<List<String>> crmResponse = operCrmOpenFeignClient.getAllSubCustomerIds(customerId);
List<String> subCustomers;
if(null == crmResponse || !crmResponse.success())
{subCustomers = null;}
else
{subCustomers = crmResponse.getData();}
FineExampleResultDTO fineExampleResultDTO;
if(CollectionUtils.isEmpty(subCustomers))
fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId());
else
fineExampleResultDTO = screenPioneerDataDao.selectFineExampleByAreaCode(areaCode,customerId,subCustomers);
if (null == fineExampleResultDTO) {
return new FineExampleResultDTO();
FineExampleResultDTO fineExampleResultDTO;
if (StringUtils.isNotBlank(fineExampleFormDTO.getAreaCode())) {
//如果是平阴县的areaCode
if ("370124".equals(fineExampleFormDTO.getAreaCode())) {
String yesterDay = com.epmet.commons.tools.utils.DateUtils.getBeforeNDay(1);
// 只有平阴的需要汇聚 8个街道的数
fineExampleResultDTO = screenPioneerDataDao.selectFineExampleByAreaCode(fineExampleFormDTO.getAreaCode(), yesterDay);
} else {
// 不是平阴的话,依然按照agencyId查询
fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId());
}
fineExampleResultDTO.setIssueRatio(this.getRatio(fineExampleResultDTO.getIssueRatioA()));
fineExampleResultDTO.setPublishIssueRatio(this.getRatio(fineExampleResultDTO.getPublishIssueRatioA()));
fineExampleResultDTO.setResolvedProjectRatio(this.getRatio(fineExampleResultDTO.getResolvedProjectRatioA()));
fineExampleResultDTO.setTopicRatio(this.getRatio(fineExampleResultDTO.getTopicRatioA()));
fineExampleResultDTO.setShiftProjectRatio(this.getRatio(fineExampleResultDTO.getShiftProjectRatioA()));
fineExampleResultDTO.setPlatJoinPartyRatio(this.getRatio(Double.valueOf(fineExampleResultDTO.getPlatJoinPartyRatio())));
return fineExampleResultDTO;
} else {
//单客户直接按照agencyId查询
fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId());
}
if (null == fineExampleResultDTO) {
return new FineExampleResultDTO();
}
fineExampleResultDTO.setIssueRatio(this.getRatio(fineExampleResultDTO.getIssueRatioA()));
fineExampleResultDTO.setPublishIssueRatio(this.getRatio(fineExampleResultDTO.getPublishIssueRatioA()));
fineExampleResultDTO.setResolvedProjectRatio(this.getRatio(fineExampleResultDTO.getResolvedProjectRatioA()));
fineExampleResultDTO.setTopicRatio(this.getRatio(fineExampleResultDTO.getTopicRatioA()));
fineExampleResultDTO.setShiftProjectRatio(this.getRatio(fineExampleResultDTO.getShiftProjectRatioA()));
fineExampleResultDTO.setPlatJoinPartyRatio(this.getRatio(Double.valueOf(fineExampleResultDTO.getPlatJoinPartyRatio())));
return fineExampleResultDTO;
}
/**

6
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml

@ -14,7 +14,7 @@
diff.EVENT_IMG_URL AS imgUrl,
IFNULL(diff.EVENT_CATEGORY_NAME,'') AS categoryName,
diff.EVENT_RE_ORG AS handleDepts,
diff.EVENT_RE_ORG AS handleCount
diff.EVENT_HANDLED_COUNT AS handleCount
FROM
screen_difficulty_data diff
WHERE
@ -63,13 +63,15 @@
diff.EVENT_IMG_URL AS imgUrl,
IFNULL(diff.EVENT_CATEGORY_NAME,'') AS categoryName,
diff.EVENT_RE_ORG AS handleDepts,
diff.EVENT_RE_ORG AS handleCount
diff.EVENT_HANDLED_COUNT AS handleCount
FROM
screen_difficulty_data diff
left join screen_customer_grid scg
on(diff.ORG_ID=scg.GRID_ID and scg.DEL_FLAG='0')
WHERE
diff.DEL_FLAG = '0'
and diff.orgType='grid'
and diff.EVENT_STATUS_CODE in('pending','0')
AND scg.AREA_CODE like concat(#{areaCode},'%')
ORDER BY
(CASE #{type}

14
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml

@ -47,20 +47,12 @@
IFNULL(avg(data.PLAT_JOIN_PARTY_RATIO),0) AS platJoinPartyRatio
FROM
screen_pioneer_data data
LEFT JOIN
screen_customer_agency agency
ON data.org_id = agency.agency_id
ON (data.org_id = agency.agency_id and agency.del_flag='0')
WHERE
data.del_flag = '0'
AND data.org_type = 'agency'
AND agency.area_code LIKE concat(#{areaCode},'%')
<if test=" null != list and list.size() > 0">
<foreach collection="list" item="subId" open="AND ( data.customer_id = #{customerId} OR " separator=" OR " close=" )">
data.customer_id = #{subId}
</foreach>
</if>
ORDER BY data.data_end_time DESC
LIMIT 1
and agency.PARENT_AREA_CODE=#{areaCode}
and data.DATA_END_TIME=#{dataEndTime}
</select>
</mapper>

Loading…
Cancel
Save