Browse Source

message:

完善查询条件customerId
dev_power_axis
HAHA 3 years ago
parent
commit
147d7ad31b
  1. 1
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisLeaderDetailFormDTO.java
  2. 10
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisListPositionFormDTO.java
  3. 1
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructFormDTO.java
  4. 1
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructListByCategoryCodeFormDTO.java
  5. 1
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructStructTreeFormDTO.java
  6. 1
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructViewFormDTO.java
  7. 1
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseHoldViewListFormDTO.java
  8. 1
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java
  9. 11
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisListPositionResultDTO.java
  10. 17
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/ViewController/PowerAxisStructViewController.java
  11. 7
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/ViewController/PowerViewServiceStationController.java
  12. 42
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerKernelHouseholdController.java
  13. 2
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisLeaderDao.java
  14. 19
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java
  15. 2
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructLeaderDao.java
  16. 4
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java
  17. 2
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerKernelHouseholdService.java
  18. 8
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.java
  19. 8
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java
  20. 44
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java
  21. 65
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java
  22. 3
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisLeaderDao.xml
  23. 57
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml
  24. 1
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructLeaderDao.xml
  25. 8
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerKernelHouseholdDao.xml

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

@ -6,4 +6,5 @@ import lombok.Data;
public class PowerAxisLeaderDetailFormDTO {
private String axisStructId;
private String leaderId;
private String customerId;
}

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

@ -0,0 +1,10 @@
package com.epmet.plugin.power.dto.axis.form;
import lombok.Data;
@Data
public class PowerAxisListPositionFormDTO {
private String tagCategory;
private String customerId;
private int structLevel;
}

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

@ -10,4 +10,5 @@ import lombok.NoArgsConstructor;
public class PowerAxisStructFormDTO{
private String agencyId;
private String name;
private String customerId;
}

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

@ -6,4 +6,5 @@ import lombok.Data;
public class PowerAxisStructListByCategoryCodeFormDTO {
private String agencyId;
private String categoryCode;
private String customerId;
}

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

@ -5,4 +5,5 @@ import lombok.Data;
@Data
public class PowerAxisStructStructTreeFormDTO {
private String agencyId;
private String customerId;
}

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

@ -4,5 +4,6 @@ import lombok.Data;
@Data
public class PowerAxisStructViewFormDTO {
private String customerId;
private String agencyId;
}

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

@ -7,4 +7,5 @@ public class PowerKernelHouseHoldViewListFormDTO {
private String axisStructId;
private int pageNo;
private int pageSize;
private String customerId;
}

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

@ -6,4 +6,5 @@ import lombok.Data;
public class PowerKernelListPostitionFormDTO {
private String axisStructId;
private int limit;
private String customerId;
}

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

@ -0,0 +1,11 @@
package com.epmet.plugin.power.dto.axis.result;
import lombok.Data;
@Data
public class PowerAxisListPositionResultDTO {
private String axisStructId;
private String longitude;
private String latitude;
private String axisStructName;
}

17
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/ViewController/PowerAxisStructViewController.java

@ -1,21 +1,16 @@
package com.epmet.plugin.power.modules.axis.ViewController;
import com.epmet.commons.tools.utils.Result;
import com.epmet.plugin.power.dto.axis.ResultDTO;
import com.epmet.plugin.power.dto.axis.form.PowerAxisLeaderDetailFormDTO;
import com.epmet.plugin.power.dto.axis.form.PowerAxisStructStructTreeFormDTO;
import com.epmet.plugin.power.dto.axis.form.PowerAxisStructViewFormDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisLeaderDetailResultDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisStructResultDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisStructTreeResultDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisStructViewResultDTO;
import com.epmet.plugin.power.dto.axis.result.*;
import com.epmet.plugin.power.modules.axis.service.PowerAxisLeaderService;
import com.epmet.plugin.power.modules.axis.service.PowerAxisStructService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -55,4 +50,10 @@ public class PowerAxisStructViewController {
List<PowerAxisStructTreeResultDTO> dto = powerAxisStructService.getStructTree(form);
return new Result().ok(dto);
}
@PostMapping("/{structLevel}/listPosition")
public ResultDTO getListPosition(@PathVariable int structLevel){
List<PowerAxisListPositionResultDTO> list = powerAxisStructService.getListPosition(structLevel);
return ResultDTO.success("成功",list,powerAxisStructService.queryTotal(structLevel));
}
}

7
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/ViewController/PowerViewServiceStationController.java

@ -21,6 +21,13 @@ public class PowerViewServiceStationController {
@Autowired
private PowerServiceStationService powerServiceStationService;
/**
* 党群服务站集合坐标
* @param form
* @return com.epmet.plugin.power.dto.axis.ResultDTO
* @author LZN
* @date 2022/4/22 19:53
*/
@PostMapping("/listPosition")
public ResultDTO getListPostition(@RequestBody PowerAxisServiceStationFormDTO form){
List<PowerAxisServiceStationResultDTO> list = powerServiceStationService.getListPosition(form);

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

@ -42,11 +42,7 @@ public class PowerKernelHouseholdController {
@Autowired
private PowerKernelHouseholdService powerKernelHouseholdService;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private LoginUserUtil loginUserUtil;
@RequestMapping("page")
public Result<PageData<PowerKernelHouseholdDTO>> page(@RequestParam Map<String, Object> params){
@ -97,43 +93,7 @@ public class PowerKernelHouseholdController {
*/
@PostMapping("/bind")
public Result Bind(@RequestBody PowerKernelHouseFormDTO form){
String customerId = loginUserUtil.getLoginUserCustomerId();
Set<String> houseIds = new HashSet<>();
Collections.addAll(houseIds,form.getHouseIdList());
Result<List<HouseInfoDTO>> listResult = govOrgOpenFeignClient.queryListHouseInfo(houseIds, customerId);
if(!listResult.success()){
return listResult;
}
List<HouseInfoDTO> houseList = listResult.getData();
List<PowerKernelHouseholdEntity> list = Lists.newArrayList();
PowerKernelHouseholdEntity entity;
for(HouseInfoDTO houseInfo : houseList){
Result<IcHouseDTO> icHouseDTOResult = govOrgOpenFeignClient.get(houseInfo.getHomeId());
if(!icHouseDTOResult.success()){
continue ;
}
IcHouseDTO houseDto = icHouseDTOResult.getData();
entity = new PowerKernelHouseholdEntity();
entity.setHouseId(houseInfo.getHomeId());
if(!StringUtils.isEmpty(houseInfo.getBuildingLatitude()) && !StringUtils.isEmpty(houseInfo.getBuildingLongitude())){
entity.setLatitude(new BigDecimal(houseInfo.getBuildingLatitude()));
entity.setLongitude(new BigDecimal(houseInfo.getBuildingLongitude()));
} else {
entity.setLatitude(BigDecimal.ZERO);
entity.setLongitude(BigDecimal.ZERO);
}
entity.setAddress(houseInfo.getAllName());
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
entity.setOwnerPhone(houseDto.getOwnerPhone());
entity.setOwnerIdCard(houseDto.getOwnerIdCard());
entity.setOwnerName(houseDto.getOwnerName());
entity.setStructReferenceId(form.getAxisStructId());
powerKernelHouseholdService.insert(entity);
}
powerKernelHouseholdService.bind(form);
return new Result();
}

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

@ -21,7 +21,7 @@ import java.util.List;
public interface PowerAxisLeaderDao extends BaseDao<PowerAxisLeaderEntity> {
List<PowerAxisSimpleListDTO> getSimpleList(List<String> ids);
List<PowerAxisSimpleListDTO> getSimpleList(List<String> ids,String customerId);
PowerAxisLeaderDetailResultDTO getLeaderDetail(PowerAxisLeaderDetailFormDTO form);
}

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

@ -47,24 +47,24 @@ public interface PowerAxisStructDao extends BaseDao<PowerAxisStructEntity> {
/**
* 获取上级网格党支部
*/
List<PowerAxisStructGridPartyBranchResultDTO> getGridPartyBranchList();
List<PowerAxisStructGridPartyBranchResultDTO> getGridPartyBranchList(String customerId);
/**
* 获取pid
*/
List<String> getPid();
List<String> getPid(String customerId);
/**
* 获取上级党委
*/
List<PowerAxisStructPartyCommResultDTO> getPartyCommList();
List<PowerAxisStructPartyCommResultDTO> getPartyCommList(String customerId);
int countRepeatStructByName(PowerAxisStructEntity form);
int countRepeatStructByCategory(PowerAxisStructEntity form);
List<String> getIdsByAgencyId(String agencyId);
List<String> getIdsByAgencyId(String agencyId,String customerId);
List<PowerAixsStructListByCategoryResultDTO> getListByCategoryCode(PowerAxisStructListByCategoryCodeFormDTO form);
@ -72,9 +72,16 @@ public interface PowerAxisStructDao extends BaseDao<PowerAxisStructEntity> {
int queryGroupParty(PowerAxisStructViewFormDTO form);
int getKernelHouseHold();
int getKernelHouseHold(PowerAxisStructViewFormDTO form);
int getServiceStation();
int getServiceStation(PowerAxisStructViewFormDTO form);
List<PowerAxisStructTreeResultDTO> getStructTree(PowerAxisStructStructTreeFormDTO form);
String queryCategoryCode(PowerAxisListPositionFormDTO form);
List<PowerAxisListPositionResultDTO> querylistPosition(String customerId, String code);
long queryTotal(String customerId, String code);
}

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

@ -14,5 +14,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface PowerAxisStructLeaderDao extends BaseDao<PowerAxisStructLeaderEntity> {
PowerAxisSLeaderResultDTO queryLeaderDetailById(String axisStructId);
PowerAxisSLeaderResultDTO queryLeaderDetailById(String axisStructId,String customerId);
}

4
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java

@ -156,4 +156,8 @@ public interface PowerAxisStructService extends BaseService<PowerAxisStructEntit
* 树结构
*/
List<PowerAxisStructTreeResultDTO> getStructTree(PowerAxisStructStructTreeFormDTO form);
List<PowerAxisListPositionResultDTO> getListPosition(int structLevel);
long queryTotal(int structLevel);
}

2
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerKernelHouseholdService.java

@ -95,4 +95,6 @@ public interface PowerKernelHouseholdService extends BaseService<PowerKernelHous
List<PowerKernelListPostitionResultDTO> getListPosition(PowerKernelListPostitionFormDTO form);
long getListTotal(PowerKernelListPostitionFormDTO form);
void bind(PowerKernelHouseFormDTO form);
}

8
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.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.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.plugin.power.dto.axis.PowerAxisLeaderDTO;
import com.epmet.plugin.power.dto.axis.form.PowerAxisLeaderDetailFormDTO;
@ -39,6 +40,9 @@ public class PowerAxisLeaderServiceImpl extends BaseServiceImpl<PowerAxisLeaderD
@Resource
PowerAxisStructLeaderDao powerAxisStructLeaderDao;
@Autowired
LoginUserUtil loginUserUtil;
@Override
public PageData<PowerAxisLeaderDTO> page(Map<String, Object> params) {
IPage<PowerAxisLeaderEntity> page = baseDao.selectPage(
@ -105,11 +109,13 @@ public class PowerAxisLeaderServiceImpl extends BaseServiceImpl<PowerAxisLeaderD
@Override
public List<PowerAxisSimpleListDTO> getSimpleList(List<String> ids) {
return baseDao.getSimpleList(ids);
String customerId = loginUserUtil.getLoginUserCustomerId();
return baseDao.getSimpleList(ids,customerId);
}
@Override
public PowerAxisLeaderDetailResultDTO getLeaderDetail(PowerAxisLeaderDetailFormDTO form) {
form.setCustomerId(loginUserUtil.getLoginUserCustomerId());
return baseDao.getLeaderDetail(form);
}

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

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.plugin.power.dto.axis.result.PowerAxisSLeaderResultDTO;
@ -12,6 +13,7 @@ import com.epmet.plugin.power.dto.axis.PowerAxisStructLeaderDTO;
import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity;
import com.epmet.plugin.power.modules.axis.service.PowerAxisStructLeaderService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -31,6 +33,9 @@ public class PowerAxisStructLeaderServiceImpl extends BaseServiceImpl<PowerAxisS
// @Autowired
// private PowerAxisStructLeaderRedis powerAxisStructLeaderRedis;
@Autowired
LoginUserUtil loginUserUtil;
@Override
public PageData<PowerAxisStructLeaderDTO> page(Map<String, Object> params) {
IPage<PowerAxisStructLeaderEntity> page = baseDao.selectPage(
@ -85,7 +90,8 @@ public class PowerAxisStructLeaderServiceImpl extends BaseServiceImpl<PowerAxisS
@Override
public PowerAxisSLeaderResultDTO queryLeaderDetailById(String axisStructId) {
return baseDao.queryLeaderDetailById(axisStructId);
String customerId = loginUserUtil.getLoginUserCustomerId();
return baseDao.queryLeaderDetailById(axisStructId,customerId);
}
}

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

@ -113,6 +113,8 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
@Override
public List<PowerAxisStructResultDTO> queryDeptByName(PowerAxisStructFormDTO form) {
String customerId = loginUserUtil.getLoginUserCustomerId();
form.setCustomerId(customerId);
List<PowerAxisStructResultDTO> list = powerAxisStructDao.queryDeptByName(form);
return list;
}
@ -229,19 +231,22 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
*/
@Override
public List<PowerAxisStructGridPartyBranchResultDTO> getGridPartyBranchList() {
List<PowerAxisStructGridPartyBranchResultDTO> list = baseDao.getGridPartyBranchList();
String customerId = loginUserUtil.getLoginUserCustomerId();
List<PowerAxisStructGridPartyBranchResultDTO> list = baseDao.getGridPartyBranchList(customerId);
return list;
}
@Override
public List<String> getPid() {
List<String> pid = baseDao.getPid();
String customerId = loginUserUtil.getLoginUserCustomerId();
List<String> pid = baseDao.getPid(customerId);
return pid;
}
@Override
public List<PowerAxisStructPartyCommResultDTO> getPartyCommList() {
List<PowerAxisStructPartyCommResultDTO> list = baseDao.getPartyCommList();
String customerId = loginUserUtil.getLoginUserCustomerId();
List<PowerAxisStructPartyCommResultDTO> list = baseDao.getPartyCommList(customerId);
return list;
}
@ -253,7 +258,8 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
@Override
public List<String> getIdByAgencyId(String agencyId) {
List<String> ids = baseDao.getIdsByAgencyId(agencyId);
String customerId = loginUserUtil.getLoginUserCustomerId();
List<String> ids = baseDao.getIdsByAgencyId(agencyId,customerId);
return ids;
}
@ -262,6 +268,7 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
*/
@Override
public List<PowerAixsStructListByCategoryResultDTO> getListByCategoryCode(PowerAxisStructListByCategoryCodeFormDTO form) {
form.setCustomerId(loginUserUtil.getLoginUserCustomerId());
List<PowerAixsStructListByCategoryResultDTO> dto = baseDao.getListByCategoryCode(form);
return dto;
}
@ -276,9 +283,9 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
// 查询党员数
int partyNum = 0;
// 查询党员中心户数
int kernelHouseHold = baseDao.getKernelHouseHold();
int kernelHouseHold = baseDao.getKernelHouseHold(form);
// 查询服务站数
int serviceStation = baseDao.getServiceStation();
int serviceStation = baseDao.getServiceStation(form);
// 查询志愿者队伍数
int volunteerTeamNum = 0;
@ -325,9 +332,34 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
@Override
public List<PowerAxisStructTreeResultDTO> getStructTree(PowerAxisStructStructTreeFormDTO form) {
form.setCustomerId(loginUserUtil.getLoginUserCustomerId());
List<PowerAxisStructTreeResultDTO> dto = baseDao.getStructTree(form);
return TreeUtils.build(dto);
}
@Override
public List<PowerAxisListPositionResultDTO> getListPosition(int structLevel) {
PowerAxisListPositionFormDTO form = new PowerAxisListPositionFormDTO();
String customerId = loginUserUtil.getLoginUserCustomerId();
form.setCustomerId(customerId);
form.setStructLevel(structLevel);
form.setTagCategory(PowerTagCategoryEnum.STRUCT.category());
String code = baseDao.queryCategoryCode(form);
List<PowerAxisListPositionResultDTO> list = baseDao.querylistPosition(customerId,code);
return list;
}
@Override
public long queryTotal(int structLevel) {
PowerAxisListPositionFormDTO form = new PowerAxisListPositionFormDTO();
String customerId = loginUserUtil.getLoginUserCustomerId();
form.setCustomerId(customerId);
form.setStructLevel(structLevel);
form.setTagCategory(PowerTagCategoryEnum.STRUCT.category());
String code = baseDao.queryCategoryCode(form);
long total = baseDao.queryTotal(customerId,code);
return total;
}
}

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

@ -6,7 +6,12 @@ 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.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.plugin.power.dto.axis.PowerKernelHouseholdDTO;
import com.epmet.plugin.power.dto.axis.form.PowerKernelHouseFormDTO;
import com.epmet.plugin.power.dto.axis.form.PowerKernelHouseHoldViewListFormDTO;
@ -17,14 +22,14 @@ import com.epmet.plugin.power.modules.axis.dao.PowerKernelHouseholdDao;
import com.epmet.plugin.power.modules.axis.entity.PowerKernelHouseholdEntity;
import com.epmet.plugin.power.modules.axis.redis.PowerKernelHouseholdRedis;
import com.epmet.plugin.power.modules.axis.service.PowerKernelHouseholdService;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.math.BigDecimal;
import java.util.*;
/**
* 动力主轴党员中心户
@ -38,6 +43,15 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl<PowerKernel
@Autowired
private PowerKernelHouseholdRedis powerKernelHouseholdRedis;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private LoginUserUtil loginUserUtil;
@Autowired
private PowerKernelHouseholdService powerKernelHouseholdService;
@Override
public PageData<PowerKernelHouseholdDTO> page(Map<String, Object> params) {
IPage<PowerKernelHouseholdEntity> page = baseDao.selectPage(
@ -100,25 +114,70 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl<PowerKernel
@Override
public List<PowerKernelHouseHoldViewListResultDTO> getList(PowerKernelHouseHoldViewListFormDTO form) {
form.setPageNo((form.getPageNo() - 1) * form.getPageSize());
form.setCustomerId(loginUserUtil.getLoginUserCustomerId());
List<PowerKernelHouseHoldViewListResultDTO> dto = baseDao.getList(form);
return dto;
}
@Override
public long getTotal(PowerKernelHouseHoldViewListFormDTO form) {
form.setCustomerId(loginUserUtil.getLoginUserCustomerId());
return baseDao.getTotal(form);
}
@Override
public List<PowerKernelListPostitionResultDTO> getListPosition(PowerKernelListPostitionFormDTO form) {
form.setCustomerId(loginUserUtil.getLoginUserCustomerId());
List<PowerKernelListPostitionResultDTO> dto = baseDao.getListPosition(form);
return dto;
}
@Override
public long getListTotal(PowerKernelListPostitionFormDTO form) {
form.setCustomerId(loginUserUtil.getLoginUserCustomerId());
return baseDao.getListTotal(form);
}
@Override
public void bind(PowerKernelHouseFormDTO form) {
String customerId = loginUserUtil.getLoginUserCustomerId();
Set<String> houseIds = new HashSet<>();
Collections.addAll(houseIds,form.getHouseIdList());
Result<List<HouseInfoDTO>> listResult = govOrgOpenFeignClient.queryListHouseInfo(houseIds, customerId);
if(!listResult.success()){
return ;
}
List<HouseInfoDTO> houseList = listResult.getData();
List<PowerKernelHouseholdEntity> list = Lists.newArrayList();
PowerKernelHouseholdEntity entity;
for(HouseInfoDTO houseInfo : houseList){
Result<IcHouseDTO> icHouseDTOResult = govOrgOpenFeignClient.get(houseInfo.getHomeId());
if(!icHouseDTOResult.success()){
continue ;
}
IcHouseDTO houseDto = icHouseDTOResult.getData();
entity = new PowerKernelHouseholdEntity();
entity.setHouseId(houseInfo.getHomeId());
if(!org.springframework.util.StringUtils.isEmpty(houseInfo.getBuildingLatitude()) && !org.springframework.util.StringUtils.isEmpty(houseInfo.getBuildingLongitude())){
entity.setLatitude(new BigDecimal(houseInfo.getBuildingLatitude()));
entity.setLongitude(new BigDecimal(houseInfo.getBuildingLongitude()));
} else {
entity.setLatitude(BigDecimal.ZERO);
entity.setLongitude(BigDecimal.ZERO);
}
entity.setAddress(houseInfo.getAllName());
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
entity.setOwnerPhone(houseDto.getOwnerPhone());
entity.setOwnerIdCard(houseDto.getOwnerIdCard());
entity.setOwnerName(houseDto.getOwnerName());
entity.setStructReferenceId(form.getAxisStructId());
powerKernelHouseholdService.insert(entity);
}
}
}

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

@ -33,6 +33,7 @@
<foreach collection="list" item="id">
STRUCT_REFERENCE_ID = #{id}
</foreach>
and ppal.customer_id = #{customerId}
</where>
</select>
<select id="getLeaderDetail"
@ -56,6 +57,8 @@
poas.CATEGORY_CODE = ppat.CATEGORY_CODE
WHERE
ppal.id = #{leaderId}
AND
ppal.customer_id = #{customerId}
</select>

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

@ -84,6 +84,7 @@
and AGENCY_ID = #{agencyId}
</if>
and del_flag = 0
and customer_id = #{customerId}
</where>
</select>
<select id="queryList" resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructListResultDTO">
@ -104,6 +105,8 @@
CATEGORY_CODE = 'grid_party'
AND
del_flag = 0
AND
customer_id = #{customerId}
</select>
<select id="getPid" resultType="java.lang.String">
SELECT
@ -114,7 +117,7 @@
FROM
pli_power_axis_struct
WHERE
CATEGORY_CODE = 'community_party' )
CATEGORY_CODE = 'community_party' and customer_id = #{customerId} )
AS a
</select>
<select id="getPartyCommList"
@ -128,6 +131,8 @@
CATEGORY_CODE = 'community_party'
AND
del_flag = 0
AND
customer_id = #{customerId}
</select>
<select id="countRepeatStructByName" resultType="java.lang.Integer">
SELECT
@ -155,7 +160,7 @@
AGENCY_ID = #{agencyId} and CUSTOMER_ID = #{customerId} and CATEGORY_CODE = #{categoryCode}
</select>
<select id="getIdsByAgencyId" resultType="java.lang.String">
select id from pli_power_axis_struct where agency_id = #{agencyId}
select id from pli_power_axis_struct where agency_id = #{agencyId} and customer_id = #{customerId}
</select>
<select id="getListByCategoryCode"
resultType="com.epmet.plugin.power.dto.axis.result.PowerAixsStructListByCategoryResultDTO">
@ -168,6 +173,8 @@
AGENCY_ID = #{agencyId}
and
CATEGORY_CODE = #{categoryCode}
and
customer_id = #{customerId}
</select>
<select id="queryGridParty" resultType="java.lang.Integer">
SELECT
@ -178,6 +185,8 @@
AGENCY_ID = #{agencyId}
AND
CATEGORY_CODE = 'grid_party'
AND
customer_id = #{customerId}
</select>
<select id="queryGroupParty" resultType="java.lang.Integer">
SELECT
@ -188,12 +197,14 @@
AGENCY_ID = #{agencyId}
AND
CATEGORY_CODE = 'group_party'
AND
customer_id = #{customerId}
</select>
<select id="getKernelHouseHold" resultType="java.lang.Integer">
select count(*) from pli_power_kernel_household
select count(*) from pli_power_kernel_household and customer_id = #{customerId}
</select>
<select id="getServiceStation" resultType="java.lang.Integer">
select count(*) from pli_power_service_station
select count(*) from pli_power_service_station and customer_id = #{customerId}
</select>
<select id="getStructTree"
resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructTreeResultDTO">
@ -209,6 +220,44 @@
LEFT JOIN pli_power_axis_leader AS leader ON sl.LEADER_ID = leader.id
WHERE
struct.agency_id = #{agencyId}
AND
struct.customer_id = #{customerId}
</select>
<select id="queryCategoryCode" resultType="java.lang.String">
SELECT
CATEGORY_CODE
FROM
pli_power_axis_tag
WHERE
CUSTOMER_ID = #{customerId}
AND
STRUCT_LEVEL = #{structLevel}
AND
TAG_CATEGORY = #{tagCategory}
</select>
<select id="querylistPosition"
resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisListPositionResultDTO">
SELECT
id AS axisStructId,
LONGITUDE,
LATITUDE,
NAME AS axisStructName
FROM
pli_power_axis_struct
WHERE
CUSTOMER_ID = #{customerId}
and
CATEGORY_CODE = #{code}
</select>
<select id="queryTotal" resultType="java.lang.Long">
select
count(*)
FROM
pli_power_axis_struct
WHERE
CUSTOMER_ID = #{customerId}
AND
CATEGORY_CODE = #{code}
</select>

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

@ -31,6 +31,7 @@
LEFT JOIN pli_power_axis_struct_leader sl ON sl.LEADER_ID = l.ID
WHERE sl.STRUCT_REFERENCE_ID = #{axisStructId}
AND sl.DEL_FLAG = '0' AND l.DEL_FLAG = '0'
and l.customer_id = #{customerId}
</select>

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

@ -28,6 +28,8 @@
pli_power_kernel_household
WHERE
STRUCT_REFERENCE_ID = #{axisStructId}
AND
customer_id = #{customerrId}
</select>
<select id="getListPosition"
resultType="com.epmet.plugin.power.dto.axis.result.PowerKernelListPostitionResultDTO">
@ -40,6 +42,8 @@
pli_power_kernel_household
WHERE
STRUCT_REFERENCE_ID = #{axisStructId}
AND
customer_id = #{customerId}
limit #{limit}
</select>
<select id="getListTotal" resultType="java.lang.Long">
@ -49,6 +53,8 @@
pli_power_kernel_household
where
STRUCT_REFERENCE_ID = #{axisStructId}
AND
customer_id = #{customerId}
</select>
<select id="getList"
resultType="com.epmet.plugin.power.dto.axis.result.PowerKernelHouseHoldViewListResultDTO">
@ -60,6 +66,8 @@
pli_power_kernel_household
WHERE
STRUCT_REFERENCE_ID = #{axisStructId}
and
customer_id = #{customerId}
limit
#{pageNo},#{pageSize}
</select>

Loading…
Cancel
Save