Browse Source

Merge remote-tracking branch 'origin/dev_power_axis' into develop

develop
HAHA 3 years ago
parent
commit
fe14054684
  1. 3
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructViewFormDTO.java
  2. 2
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java
  3. 4
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructViewResultDTO.java
  4. 5
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java
  5. 10
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java
  6. 17
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java
  7. 7
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java
  8. 30
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml

3
epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructViewFormDTO.java

@ -2,6 +2,7 @@ package com.epmet.plugin.power.dto.axis.form;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
@Data @Data
@ -11,10 +12,12 @@ public class PowerAxisStructViewFormDTO implements Serializable {
/** /**
* 客户id * 客户id
*/ */
@NotBlank(message = "所属客户不能为空")
private String customerId; private String customerId;
/** /**
* 组织id * 组织id
*/ */
@NotBlank(message = "所属组织不能为空")
private String agencyId; private String agencyId;
} }

2
epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java

@ -19,7 +19,7 @@ public class PowerKernelListPostitionFormDTO implements Serializable {
/** /**
* 条数 * 条数
*/ */
private int limit; private Integer limit;
/** /**
* 客户id * 客户id

4
epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructViewResultDTO.java

@ -22,7 +22,7 @@ public class PowerAxisStructViewResultDTO implements Serializable {
/** /**
* 党员数 * 党员数
*/ */
private int partyMemberNum; // private int partyMemberNum;
/** /**
* 党员中心户数 * 党员中心户数
@ -37,5 +37,5 @@ public class PowerAxisStructViewResultDTO implements Serializable {
/** /**
* 志愿队伍数 * 志愿队伍数
*/ */
private int volunteerTeamNum; // private int volunteerTeamNum;
} }

5
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java

@ -14,6 +14,7 @@ import com.epmet.plugin.power.modules.axis.service.PowerServiceStationService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List; import java.util.List;
/*** /***
@ -59,7 +60,9 @@ public class PowerAxisDataVisualController {
* @date 2022/4/23 10:20 * @date 2022/4/23 10:20
*/ */
@PostMapping("axis/statistics") @PostMapping("axis/statistics")
public Result getStatistics(@RequestBody PowerAxisStructViewFormDTO form) { public Result getStatistics(@RequestBody PowerAxisStructViewFormDTO form, @LoginUser TokenDto tokenDto) {
form.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(form);
PowerAxisStructViewResultDTO result = powerAxisStructService.getStatistics(form); PowerAxisStructViewResultDTO result = powerAxisStructService.getStatistics(form);
return new Result().ok(result); return new Result().ok(result);
} }

10
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java

@ -75,19 +75,19 @@ public interface PowerAxisStructDao extends BaseDao<PowerAxisStructEntity> {
List<String> getIdsByAgencyId(String agencyId, String customerId); List<String> getIdsByAgencyId(String agencyId, String customerId);
int queryGridParty(@Param("agencyId") String agencyId,@Param("customerId") String customerId,@Param("gridCateGoryCode") String gridCateGoryCode); int queryGridParty(@Param("agencyId") String agencyId, @Param("customerId") String customerId, @Param("gridCateGoryCode") String gridCateGoryCode);
int queryGroupParty(@Param("agencyId") String agencyId,@Param("customerId") String customerId,@Param("groupCateGoryCode") String groupCateGoryCode); int queryGroupParty(@Param("agencyId") String agencyId, @Param("customerId") String customerId, @Param("groupCateGoryCode") String groupCateGoryCode);
int getKernelHouseHold(PowerAxisStructViewFormDTO form); int getKernelHouseHold(@Param("agencyId") String agencyId, @Param("customerId") String customerId);
int getServiceStation(PowerAxisStructViewFormDTO form); int getServiceStation(@Param("agencyId") String agencyId,@Param("customerId") String customerId);
List<PowerAxisStructTreeResultDTO> getStructTree(PowerAxisStructStructTreeFormDTO form); List<PowerAxisStructTreeResultDTO> getStructTree(PowerAxisStructStructTreeFormDTO form);
String queryCategoryCode(PowerAxisListPositionFormDTO form); String queryCategoryCode(PowerAxisListPositionFormDTO form);
List<PowerAxisListPositionResultDTO> querylistPosition(@Param("customerId") String customerId,@Param("code") String code ,@Param("agencyId") String agencyId); List<PowerAxisListPositionResultDTO> querylistPosition(@Param("customerId") String customerId, @Param("code") String code, @Param("agencyId") String agencyId);
/** /**
* 根据节点接报组装其上级节点树 * 根据节点接报组装其上级节点树

17
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java

@ -31,6 +31,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.constraints.NotBlank;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -227,19 +228,19 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
@Override @Override
public PowerAxisStructViewResultDTO getStatistics(PowerAxisStructViewFormDTO form) { public PowerAxisStructViewResultDTO getStatistics(PowerAxisStructViewFormDTO form) {
form.setCustomerId(loginUserUtil.getLoginUserCustomerId()); String customerId = form.getCustomerId();
String agencyId = form.getAgencyId();
// 查网格党支部数 grid_party // 查网格党支部数 grid_party
String gridCateGoryCode = baseDao.getCateGoryCode(form.getCustomerId(), PowerTagLevelEnum.CHILD_FIRST.level(), PowerTagCategoryEnum.STRUCT.category()); String gridCateGoryCode = baseDao.getCateGoryCode(customerId, PowerTagLevelEnum.CHILD_FIRST.level(), PowerTagCategoryEnum.STRUCT.category());
int gridParty = baseDao.queryGridParty(form.getAgencyId(), form.getCustomerId(), gridCateGoryCode); int gridParty = baseDao.queryGridParty(agencyId, customerId, gridCateGoryCode);
// 查楼院党小组数 group_party // 查楼院党小组数 group_party
String groupCateGoryCode = baseDao.getCateGoryCode(form.getCustomerId(), PowerTagLevelEnum.CHILD_SECOND.level(), PowerTagCategoryEnum.STRUCT.category()); String groupCateGoryCode = baseDao.getCateGoryCode(customerId, PowerTagLevelEnum.CHILD_SECOND.level(), PowerTagCategoryEnum.STRUCT.category());
int groupParty = baseDao.queryGroupParty(form.getAgencyId(), form.getCustomerId(), groupCateGoryCode); int groupParty = baseDao.queryGroupParty(agencyId, customerId, groupCateGoryCode);
// 查询党员中心户数 // 查询党员中心户数
int kernelHouseHold = baseDao.getKernelHouseHold(form); int kernelHouseHold = baseDao.getKernelHouseHold(agencyId, customerId);
// 查询服务站数 // 查询服务站数
int serviceStation = baseDao.getServiceStation(form); int serviceStation = baseDao.getServiceStation(agencyId, customerId);
PowerAxisStructViewResultDTO result = new PowerAxisStructViewResultDTO(); PowerAxisStructViewResultDTO result = new PowerAxisStructViewResultDTO();
result.setGridNum(gridParty); result.setGridNum(gridParty);

7
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.security.user.LoginUserUtil;
@ -139,7 +140,11 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl<PowerKernel
@Override @Override
public List<PowerKernelListPostitionResultDTO> getListPosition(PowerKernelListPostitionFormDTO form) { public List<PowerKernelListPostitionResultDTO> getListPosition(PowerKernelListPostitionFormDTO form) {
return baseDao.queryListPosition(form.getAxisStructId(), form.getCustomerId(), form.getLimit()); Integer limit = form.getLimit();
if (null == limit || NumConstant.ZERO_L == limit) {
limit = 999;
}
return baseDao.queryListPosition(form.getAxisStructId(), form.getCustomerId(), limit);
} }
@Override @Override

30
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml

@ -131,6 +131,7 @@
CATEGORY_CODE = #{gridCateGoryCode} CATEGORY_CODE = #{gridCateGoryCode}
AND AND
customer_id = #{customerId} customer_id = #{customerId}
AND del_flag = '0'
</select> </select>
<select id="queryGroupParty" resultType="java.lang.Integer"> <select id="queryGroupParty" resultType="java.lang.Integer">
SELECT SELECT
@ -143,17 +144,20 @@
CATEGORY_CODE = #{groupCateGoryCode} CATEGORY_CODE = #{groupCateGoryCode}
AND AND
customer_id = #{customerId} customer_id = #{customerId}
AND del_flag = '0'
</select> </select>
<select id="getKernelHouseHold" resultType="java.lang.Integer">
<select id="getServiceStation" resultType="java.lang.Integer">
SELECT SELECT
count( DISTINCT HOUSE_ID ) count(*)
FROM FROM
pli_power_kernel_household pli_power_service_station h
LEFT JOIN pli_power_axis_struct s ON h.STRUCT_REFERENCE_ID = s.ID
AND s.DEL_FLAG = '0'
WHERE WHERE
del_flag = '0' h.del_flag = '0'
</select> AND s.AGENCY_ID = #{agencyId}
<select id="getServiceStation" resultType="java.lang.Integer"> AND h.CUSTOMER_ID = #{customerId}
select count(*) from pli_power_service_station where del_flag = '0'
</select> </select>
<select id="getStructTree" <select id="getStructTree"
resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructTreeResultDTO"> resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructTreeResultDTO">
@ -228,6 +232,18 @@
AND AND
STRUCT_LEVEL = #{level} STRUCT_LEVEL = #{level}
</select> </select>
<select id="getKernelHouseHold" resultType="java.lang.Integer">
SELECT
count( DISTINCT HOUSE_ID )
FROM
pli_power_kernel_household h
LEFT JOIN pli_power_axis_struct s ON h.STRUCT_REFERENCE_ID = s.ID
AND s.DEL_FLAG = '0'
WHERE
h.del_flag = '0'
AND s.AGENCY_ID = #{agencyId}
AND h.CUSTOMER_ID = #{customerId}
</select>
</mapper> </mapper>
Loading…
Cancel
Save