Browse Source

Merge remote-tracking branch 'origin/dev'

dev_shibei_match
yinzuomei 4 years ago
parent
commit
d8004d9954
  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. 35
      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 lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -22,4 +21,16 @@ public class FineExampleFormDTO implements Serializable {
*/ */
@NotBlank(message = "机关ID不能为空",groups = {FineExample.class}) @NotBlank(message = "机关ID不能为空",groups = {FineExample.class})
private String agencyId; 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 下午 * @date 2020/8/20 1:56 下午
*/ */
@PostMapping("fineexample") @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); ValidatorUtils.validateEntity(fineExampleFormDTO, FineExampleFormDTO.FineExample.class);
return new Result<FineExampleResultDTO>().ok(partyMemberLeadService.fineExample(fineExampleFormDTO)); 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.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 党建引领-先锋模范数据 * 党建引领-先锋模范数据
* *
@ -43,12 +41,11 @@ public interface ScreenPioneerDataDao{
/** /**
* @Description 根据地区码查询先锋模范 * @Description 根据地区码查询先锋模范
* @param areaCode * @param areaCode
* @param customerId * @param dataEndTime 默认是昨天yyyyMMdd
* @param customerIds - 子级客户列表
* @return com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO * @return com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO
* @author wangc * @author wangc
* @date 2021.02.24 15:39 * @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()); PageHelper.startPage(NumConstant.ONE,param.getTopNum());
if (StringUtils.isNotEmpty(param.getAreaCode())){ if (StringUtils.isNotEmpty(param.getAreaCode())){
// 目前只有平阴大屏才会传areaCode,下面的sql限制住状态为:处理中
result = screenDifficultyDataDao.selectDifficultyByAreaCode(param.getAreaCode(),param.getType()); result = screenDifficultyDataDao.selectDifficultyByAreaCode(param.getAreaCode(),param.getType());
}else { }else {
result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType()); result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType());

35
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.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant; 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.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.*; import com.epmet.datareport.dao.evaluationindex.screen.*;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService;
import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.DateUtils;
import com.epmet.datareport.utils.ModuleConstant; import com.epmet.datareport.utils.ModuleConstant;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
import com.epmet.evaluationindex.screen.constant.ScreenConstant; import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ContactMassLineChartFormDTO; import com.epmet.evaluationindex.screen.dto.form.ContactMassLineChartFormDTO;
@ -62,31 +59,29 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
private AgencyService screenCustomerAgencyService; private AgencyService screenCustomerAgencyService;
/** /**
* @Description 1先锋模范
* @param fineExampleFormDTO * @param fineExampleFormDTO
* @Description 1先锋模范
* @author zxc * @author zxc
* @date 2020/8/20 1:56 下午 * @date 2020/8/20 1:56 下午
*/ */
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
@Override @Override
public FineExampleResultDTO fineExample(FineExampleFormDTO fineExampleFormDTO) { 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; FineExampleResultDTO fineExampleResultDTO;
if(CollectionUtils.isEmpty(subCustomers)) 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 = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId());
else }
fineExampleResultDTO = screenPioneerDataDao.selectFineExampleByAreaCode(areaCode,customerId,subCustomers); } else {
//单客户直接按照agencyId查询
fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId());
}
if (null == fineExampleResultDTO) { if (null == fineExampleResultDTO) {
return new FineExampleResultDTO(); return new 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, diff.EVENT_IMG_URL AS imgUrl,
IFNULL(diff.EVENT_CATEGORY_NAME,'') AS categoryName, IFNULL(diff.EVENT_CATEGORY_NAME,'') AS categoryName,
diff.EVENT_RE_ORG AS handleDepts, diff.EVENT_RE_ORG AS handleDepts,
diff.EVENT_RE_ORG AS handleCount diff.EVENT_HANDLED_COUNT AS handleCount
FROM FROM
screen_difficulty_data diff screen_difficulty_data diff
WHERE WHERE
@ -63,13 +63,15 @@
diff.EVENT_IMG_URL AS imgUrl, diff.EVENT_IMG_URL AS imgUrl,
IFNULL(diff.EVENT_CATEGORY_NAME,'') AS categoryName, IFNULL(diff.EVENT_CATEGORY_NAME,'') AS categoryName,
diff.EVENT_RE_ORG AS handleDepts, diff.EVENT_RE_ORG AS handleDepts,
diff.EVENT_RE_ORG AS handleCount diff.EVENT_HANDLED_COUNT AS handleCount
FROM FROM
screen_difficulty_data diff screen_difficulty_data diff
left join screen_customer_grid scg left join screen_customer_grid scg
on(diff.ORG_ID=scg.GRID_ID and scg.DEL_FLAG='0') on(diff.ORG_ID=scg.GRID_ID and scg.DEL_FLAG='0')
WHERE WHERE
diff.DEL_FLAG = '0' diff.DEL_FLAG = '0'
and diff.orgType='grid'
and diff.EVENT_STATUS_CODE in('pending','0')
AND scg.AREA_CODE like concat(#{areaCode},'%') AND scg.AREA_CODE like concat(#{areaCode},'%')
ORDER BY ORDER BY
(CASE #{type} (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 IFNULL(avg(data.PLAT_JOIN_PARTY_RATIO),0) AS platJoinPartyRatio
FROM FROM
screen_pioneer_data data screen_pioneer_data data
LEFT JOIN LEFT JOIN
screen_customer_agency agency screen_customer_agency agency
ON data.org_id = agency.agency_id ON (data.org_id = agency.agency_id and agency.del_flag='0')
WHERE WHERE
data.del_flag = '0' data.del_flag = '0'
AND data.org_type = 'agency' and agency.PARENT_AREA_CODE=#{areaCode}
AND agency.area_code LIKE concat(#{areaCode},'%') and data.DATA_END_TIME=#{dataEndTime}
<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
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save