Browse Source

平阴项目数据上报 ALL_PARENT_IDS添加平阴的组织ID

master
zhaoqifeng 4 years ago
parent
commit
8f4a84103e
  1. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  2. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java
  3. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java
  4. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java
  5. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -254,4 +254,6 @@ public interface ScreenCustomerAgencyDao extends BaseDao<ScreenCustomerAgencyEnt
*/
List<GridAndOrgCategoryCountResultDTO> selectParentSonAgency(@Param("customerIds") List<String> customerIds ,@Param("customerId") String customerId);
String getParentAgencyId(@Param("agencyId") String agencyId);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java

@ -155,4 +155,13 @@ public interface ScreenCustomerAgencyService extends BaseService<ScreenCustomerA
*/
Map<String, ScreenCustomerAgencyEntity> getAgencyList(String customerId);
/**
* @Description 获取父级组织ID外部客户
* @Param agencyId
* @Return {@link String}
* @Author zhaoqifeng
* @Date 2021/11/10 17:00
*/
String getParentAgencyId(String agencyId);
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java

@ -335,4 +335,17 @@ public class ScreenCustomerAgencyServiceImpl extends BaseServiceImpl<ScreenCusto
return list.stream().collect(Collectors.toMap(ScreenCustomerAgencyEntity::getAgencyId, Function.identity()));
}
/**
* @param agencyId
* @Description 获取父级组织ID外部客户
* @Param agencyId
* @Return {@link String}
* @Author zhaoqifeng
* @Date 2021/11/10 17:00
*/
@Override
public String getParentAgencyId(String agencyId) {
return baseDao.getParentAgencyId(agencyId);
}
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java

@ -42,6 +42,7 @@ import com.epmet.entity.stats.CustomerProjectCategoryDictEntity;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService;
import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryService;
import com.epmet.service.evaluationindex.screen.ScreenProjectDataService;
import com.epmet.service.stats.CustomerProjectCategoryDictService;
@ -79,6 +80,8 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
private CustomerProjectCategoryDictService customerProjectCategoryDictService;
@Resource
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Resource
private ScreenCustomerAgencyService screenCustomerAgencyService;
@Override
public PageData<ScreenProjectDataDTO> page(Map<String, Object> params) {
@ -208,6 +211,10 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
ScreenProjectDataEntity screenProjectDataEntity = ConvertUtils.sourceToTarget(item, ScreenProjectDataEntity.class);
screenProjectDataEntity.setCustomerId(param.getCustomerId());
screenProjectDataEntity.setDataEndTime(param.getDateId());
String agencyId = screenCustomerAgencyService.getParentAgencyId(screenProjectDataEntity.getAllParentIds().split(StrConstant.COMMA)[0]);
if(StringUtils.isNotBlank(agencyId)) {
screenProjectDataEntity.setAllParentIds(agencyId.concat(StrConstant.COMMA).concat(screenProjectDataEntity.getAllParentIds()));
}
baseDao.insert(screenProjectDataEntity);
projectList.add(screenProjectDataEntity);
//插入图片表

11
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml

@ -504,6 +504,17 @@
del_flag = 0
AND customer_id = #{customerId}
</select>
<select id="getParentAgencyId" resultType="java.lang.String">
SELECT
a.AGENCY_ID
FROM
screen_customer_agency a
INNER JOIN screen_customer_agency b ON a.AREA_CODE = b.PARENT_AREA_CODE
AND b.DEL_FLAG = '0'
AND b.AGENCY_ID = #{agencyId}
WHERE
a.DEL_FLAG = '0'
</select>
<!-- 查询父子客户的组织【平阴】 -->
<select id="selectParentSonAgency" resultType="com.epmet.dto.screen.result.GridAndOrgCategoryCountResultDTO">

Loading…
Cancel
Save