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. 110
      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 javax.validation.constraints.NotBlank;
import java.io.Serializable;
@Data
@ -11,10 +12,12 @@ public class PowerAxisStructViewFormDTO implements Serializable {
/**
* 客户id
*/
@NotBlank(message = "所属客户不能为空")
private String customerId;
/**
* 组织id
*/
@NotBlank(message = "所属组织不能为空")
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

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.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/***
@ -59,7 +60,9 @@ public class PowerAxisDataVisualController {
* @date 2022/4/23 10:20
*/
@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);
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);
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);
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 javax.annotation.Resource;
import javax.validation.constraints.NotBlank;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -227,19 +228,19 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
@Override
public PowerAxisStructViewResultDTO getStatistics(PowerAxisStructViewFormDTO form) {
form.setCustomerId(loginUserUtil.getLoginUserCustomerId());
String customerId = form.getCustomerId();
String agencyId = form.getAgencyId();
// 查网格党支部数 grid_party
String gridCateGoryCode = baseDao.getCateGoryCode(form.getCustomerId(), PowerTagLevelEnum.CHILD_FIRST.level(), PowerTagCategoryEnum.STRUCT.category());
int gridParty = baseDao.queryGridParty(form.getAgencyId(), form.getCustomerId(), gridCateGoryCode);
String gridCateGoryCode = baseDao.getCateGoryCode(customerId, PowerTagLevelEnum.CHILD_FIRST.level(), PowerTagCategoryEnum.STRUCT.category());
int gridParty = baseDao.queryGridParty(agencyId, customerId, gridCateGoryCode);
// 查楼院党小组数 group_party
String groupCateGoryCode = baseDao.getCateGoryCode(form.getCustomerId(), PowerTagLevelEnum.CHILD_SECOND.level(), PowerTagCategoryEnum.STRUCT.category());
int groupParty = baseDao.queryGroupParty(form.getAgencyId(), form.getCustomerId(), groupCateGoryCode);
String groupCateGoryCode = baseDao.getCateGoryCode(customerId, PowerTagLevelEnum.CHILD_SECOND.level(), PowerTagCategoryEnum.STRUCT.category());
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();
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.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil;
@ -139,7 +140,11 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl<PowerKernel
@Override
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

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

@ -35,17 +35,17 @@
<select id="selectAllForTree"
resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructLeaderResultDTO">
select
s.ID,
s.NAME,
s.PID,
s.PIDS,
s.CATEGORY_CODE,
s.SORT,
s.CREATED_TIME,
sl.LEADER_ID,
l.NAME as LEADER_NAME,
l.MOBILE as LEADER_MOBILE,
t.STRUCT_LEVEL
s.ID,
s.NAME,
s.PID,
s.PIDS,
s.CATEGORY_CODE,
s.SORT,
s.CREATED_TIME,
sl.LEADER_ID,
l.NAME as LEADER_NAME,
l.MOBILE as LEADER_MOBILE,
t.STRUCT_LEVEL
from pli_power_axis_struct s
left join pli_power_axis_struct_leader sl on s.ID = sl.STRUCT_REFERENCE_ID and sl.del_flag = '0'
left join pli_power_axis_leader l on l.ID = sl.LEADER_ID and l.del_flag = '0'
@ -66,16 +66,16 @@
<select id="queryDeptByName" resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructResultDTO">
SELECT
CUSTOMER_ID,
NAME,
AGENCY_ID,
AGENCY_NAME,
AGENCY_TYPE,
PID,
PIDS,
CATEGORY_CODE
CUSTOMER_ID,
NAME,
AGENCY_ID,
AGENCY_NAME,
AGENCY_TYPE,
PID,
PIDS,
CATEGORY_CODE
FROM
pli_power_axis_struct
pli_power_axis_struct
<where>
1 = 1
<if test="name != null and name != ''">
@ -84,38 +84,38 @@
<if test="agencyId != null and agencyId != ''">
and AGENCY_ID = #{agencyId}
</if>
and del_flag = 0
and customer_id = #{customerId}
and del_flag = 0
and customer_id = #{customerId}
</where>
</select>
<select id="countRepeatStructByName" resultType="java.lang.Integer">
SELECT
count(*)
count(*)
FROM
pli_power_axis_struct s
pli_power_axis_struct s
WHERE
s.CUSTOMER_ID = #{customerId}
AND s.`NAME` = #{name}
<choose>
<when test="agencyId != null and agencyId != ''">AND s.AGENCY_ID = #{agencyId}</when>
<otherwise>
<if test="pid != null and pid != '' and pid != '0'">
AND s.AGENCY_ID = (SELECT t.agency_id FROM pli_power_axis_struct t WHERE t.ID = #{pid})
</if>
</otherwise>
</choose>
<if test="id != null and id != ''">AND s.ID != #{id}</if>
<if test="pid != null and pid != ''">AND s.pid = #{pid}</if>
s.CUSTOMER_ID = #{customerId}
AND s.`NAME` = #{name}
<choose>
<when test="agencyId != null and agencyId != ''">AND s.AGENCY_ID = #{agencyId}</when>
<otherwise>
<if test="pid != null and pid != '' and pid != '0'">
AND s.AGENCY_ID = (SELECT t.agency_id FROM pli_power_axis_struct t WHERE t.ID = #{pid})
</if>
</otherwise>
</choose>
<if test="id != null and id != ''">AND s.ID != #{id}</if>
<if test="pid != null and pid != ''">AND s.pid = #{pid}</if>
</select>
<select id="countRepeatStructByCategory" resultType="java.lang.Integer">
SELECT
count(*)
count(*)
FROM
pli_power_axis_struct
pli_power_axis_struct
WHERE
AGENCY_ID = #{agencyId} and CUSTOMER_ID = #{customerId} and CATEGORY_CODE = #{categoryCode}
<if test="id != null and id != ''">AND id != #{id}</if>
AGENCY_ID = #{agencyId} and CUSTOMER_ID = #{customerId} and CATEGORY_CODE = #{categoryCode}
<if test="id != null and id != ''">AND id != #{id}</if>
</select>
<select id="getIdsByAgencyId" resultType="java.lang.String">
select id from pli_power_axis_struct where agency_id = #{agencyId} and customer_id = #{customerId}
@ -131,6 +131,7 @@
CATEGORY_CODE = #{gridCateGoryCode}
AND
customer_id = #{customerId}
AND del_flag = '0'
</select>
<select id="queryGroupParty" resultType="java.lang.Integer">
SELECT
@ -143,17 +144,20 @@
CATEGORY_CODE = #{groupCateGoryCode}
AND
customer_id = #{customerId}
AND del_flag = '0'
</select>
<select id="getKernelHouseHold" resultType="java.lang.Integer">
<select id="getServiceStation" resultType="java.lang.Integer">
SELECT
count( DISTINCT HOUSE_ID )
count(*)
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
del_flag = '0'
</select>
<select id="getServiceStation" resultType="java.lang.Integer">
select count(*) from pli_power_service_station where del_flag = '0'
h.del_flag = '0'
AND s.AGENCY_ID = #{agencyId}
AND h.CUSTOMER_ID = #{customerId}
</select>
<select id="getStructTree"
resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructTreeResultDTO">
@ -228,6 +232,18 @@
AND
STRUCT_LEVEL = #{level}
</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>
Loading…
Cancel
Save