Browse Source

message:

为节点绑定党员中心户
dev_power_axis
HAHA 3 years ago
parent
commit
9f5276fc65
  1. 35
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerKernelHouseholdController.java
  2. 10
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java
  3. 4
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java
  4. 2
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml

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

@ -19,6 +19,7 @@ import com.epmet.plugin.power.dto.axis.form.PowerKernelHouseFormDTO;
import com.epmet.plugin.power.modules.axis.entity.PowerKernelHouseholdEntity;
import com.epmet.plugin.power.modules.axis.excel.PowerKernelHouseholdExcel;
import com.epmet.plugin.power.modules.axis.service.PowerKernelHouseholdService;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -99,17 +100,29 @@ public class PowerKernelHouseholdController {
Set<String> houseIds = new HashSet<>();
Collections.addAll(houseIds,form.getHouseIdList());
Result<List<HouseInfoDTO>> listResult = govOrgOpenFeignClient.queryListHouseInfo(houseIds, customerId);
// Result<IcHouseDTO> icHouseDTOResult = govOrgOpenFeignClient.get(form.getAxisStructId());
for (HouseInfoDTO dto: listResult.getData()) {
PowerKernelHouseholdEntity entity = new PowerKernelHouseholdEntity();
entity.setCustomerId(dto.getCustomerId());
BigDecimal Latitude = new BigDecimal(dto.getBuildingLatitude());
BigDecimal Longitude = new BigDecimal(dto.getBuildingLongitude());
entity.setLatitude(Latitude);
entity.setLongitude(Longitude);
entity.setAddress(dto.getAllName());
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());
entity.setLongitude(new BigDecimal(houseInfo.getBuildingLongitude()));
entity.setLatitude(new BigDecimal(houseInfo.getBuildingLatitude()));
entity.setAddress(houseInfo.getAllName());
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
entity.setOwnerPhone(houseDto.getOwnerPhone());
entity.setOwnerIdCard(houseDto.getOwnerIdCard());
entity.setOwnerName(houseDto.getOwnerName());
powerKernelHouseholdService.insert(entity);
}
return new Result();

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

@ -131,11 +131,11 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
int structLevel = powerAxisTagService.selectStructLevelByCode(loginUserUtil.getLoginUserCustomerId(), PowerTagCategoryEnum.STRUCT.category(), form.getCategoryCode());
if (PowerTagLevelEnum.ROOT.level() == structLevel) {
if (baseDao.queryCategory(form) > NumConstant.ZERO) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), StringUtils.EMPTY, "同一组织下只允许存在一个顶级节点");
throw new EpmetException("同一组织下只允许存在一个顶级节点");
}
}
if (baseDao.queryName(form) > NumConstant.ZERO) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), StringUtils.EMPTY, "同一组织下不允许存在重名的节点");
throw new EpmetException("同一组织下不允许存在重名的节点");
}
this.assembleStruct(form, loginUserUtil.getLoginUserCustomerId());
@ -166,18 +166,18 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
if (PowerTagLevelEnum.ROOT.level() == structLevel) {
pid = NumConstant.ZERO_STR;
} else {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), StringUtils.EMPTY, "请选择上级节点");
throw new EpmetException("请选择上级节点");
}
}
String agencyId = struct.getAgencyId();
if (NumConstant.ZERO_STR.equals(pid) && StringUtils.isBlank(agencyId)) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), StringUtils.EMPTY, "请选择绑定组织");
throw new EpmetException("请选择绑定组织");
}
if (NumConstant.ZERO_STR.equals(pid)) {
// 新增顶级节点
Result<CustomerAgencyDTO> agencyInfoResult = govOrgOpenFeignClient.getAgencyById(agencyId);
if (!agencyInfoResult.success()) {
throw new EpmetException(agencyInfoResult.getCode(), agencyInfoResult.getInternalMsg(), agencyInfoResult.getMsg());
throw new EpmetException(agencyInfoResult.getMsg());
}
CustomerAgencyDTO agencyInfo = agencyInfoResult.getData();
struct.setAgencyId(agencyInfo.getId());

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

@ -99,7 +99,7 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl<PowerAxisTagDao, Po
public List<PowerAxisTagCategoryResultDTO> listSimple(String tagCategory) {
if (StringUtils.isBlank(tagCategory)) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "缺少参数", EpmetErrorCode.SERVER_ERROR.getMsg());
throw new EpmetException("缺少参数");
}
QueryWrapper<PowerAxisTagEntity> wrapper = new QueryWrapper<>();
@ -126,7 +126,7 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl<PowerAxisTagDao, Po
.select(PowerAxisTagEntity::getStructLevel);
List<PowerAxisTagEntity> list = baseDao.selectList(lqw);
if (list.size() != NumConstant.ONE) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "动力主轴标签配置出错", EpmetErrorCode.SERVER_ERROR.getMsg());
throw new EpmetException("动力主轴标签配置出错");
}
return list.get(NumConstant.ZERO).getStructLevel();
}

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

@ -201,7 +201,7 @@
LEFT JOIN pli_power_axis_struct_leader AS sl ON struct.id = sl.STRUCT_REFERENCE_ID
LEFT JOIN pli_power_axis_leader AS leader ON sl.LEADER_ID = leader.id
WHERE
struct.id = #{agencyId}
struct.agency_id = #{agencyId}
</select>

Loading…
Cancel
Save