|
|
@ -1,8 +1,10 @@ |
|
|
package com.epmet.plugin.power.modules.axis.service.impl; |
|
|
package com.epmet.plugin.power.modules.axis.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
|
|
|
|
|
|
|
import com.epmet.commons.mybatis.enums.EpmetDelFlagEnum; |
|
|
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.NumConstant; |
|
|
@ -23,6 +25,7 @@ import com.epmet.plugin.power.enums.PowerTagCategoryEnum; |
|
|
import com.epmet.plugin.power.enums.PowerTagLevelEnum; |
|
|
import com.epmet.plugin.power.enums.PowerTagLevelEnum; |
|
|
import com.epmet.plugin.power.modules.axis.dao.PowerAxisStructDao; |
|
|
import com.epmet.plugin.power.modules.axis.dao.PowerAxisStructDao; |
|
|
import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity; |
|
|
import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity; |
|
|
|
|
|
import com.epmet.plugin.power.modules.axis.entity.PowerAxisTagEntity; |
|
|
import com.epmet.plugin.power.modules.axis.service.PowerAxisStructService; |
|
|
import com.epmet.plugin.power.modules.axis.service.PowerAxisStructService; |
|
|
import com.epmet.plugin.power.modules.axis.service.PowerAxisTagService; |
|
|
import com.epmet.plugin.power.modules.axis.service.PowerAxisTagService; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
@ -153,11 +156,11 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD |
|
|
private void verifyStructField(PowerAxisStructEntity struct) { |
|
|
private void verifyStructField(PowerAxisStructEntity struct) { |
|
|
int structLevel = powerAxisTagService.selectStructLevelByCode(loginUserUtil.getLoginUserCustomerId(), PowerTagCategoryEnum.STRUCT.category(), struct.getCategoryCode()); |
|
|
int structLevel = powerAxisTagService.selectStructLevelByCode(loginUserUtil.getLoginUserCustomerId(), PowerTagCategoryEnum.STRUCT.category(), struct.getCategoryCode()); |
|
|
if (PowerTagLevelEnum.ROOT.level() == structLevel) { |
|
|
if (PowerTagLevelEnum.ROOT.level() == structLevel) { |
|
|
if (baseDao.queryCategory(struct) > NumConstant.ZERO) { |
|
|
if (baseDao.countRepeatStructByCategory(struct) > NumConstant.ZERO) { |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下只允许存在一个顶级节点"); |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下只允许存在一个顶级节点"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (baseDao.countByRepeatStruct(struct) > NumConstant.ZERO) { |
|
|
if (baseDao.countRepeatStructByName(struct) > NumConstant.ZERO) { |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下不允许存在重名的节点"); |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下不允许存在重名的节点"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -265,6 +268,7 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PowerAxisStructViewResultDTO getStatistics(PowerAxisStructViewFormDTO form) { |
|
|
public PowerAxisStructViewResultDTO getStatistics(PowerAxisStructViewFormDTO form) { |
|
|
|
|
|
|
|
|
// 查网格党支部数 grid_party
|
|
|
// 查网格党支部数 grid_party
|
|
|
int gridParty = baseDao.queryGridParty(form); |
|
|
int gridParty = baseDao.queryGridParty(form); |
|
|
// 查楼院党小组数 group_party
|
|
|
// 查楼院党小组数 group_party
|
|
|
@ -276,14 +280,46 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD |
|
|
// 查询服务站数
|
|
|
// 查询服务站数
|
|
|
int serviceStation = baseDao.getServiceStation(); |
|
|
int serviceStation = baseDao.getServiceStation(); |
|
|
// 查询志愿者队伍数
|
|
|
// 查询志愿者队伍数
|
|
|
int VolunteerTeamNum = 0; |
|
|
int volunteerTeamNum = 0; |
|
|
|
|
|
|
|
|
PowerAxisStructViewResultDTO result = new PowerAxisStructViewResultDTO(); |
|
|
PowerAxisStructViewResultDTO result = new PowerAxisStructViewResultDTO(); |
|
|
result.setGridNum(gridParty); |
|
|
result.setGridNum(gridParty); |
|
|
result.setGroupNum(groupParty); |
|
|
result.setGroupNum(groupParty); |
|
|
result.setPartyMemberNum(partyNum); |
|
|
result.setPartyMemberNum(partyNum); |
|
|
result.setKernelHouseHoldNum(kernelHouseHold); |
|
|
result.setKernelHouseHoldNum(kernelHouseHold); |
|
|
result.setServiceStationNum(serviceStation); |
|
|
result.setServiceStationNum(serviceStation); |
|
|
result.setVolunteerTeamNum(VolunteerTeamNum); |
|
|
result.setVolunteerTeamNum(volunteerTeamNum); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<PowerAxisTagCategoryResultDTO> tagList = powerAxisTagService.listSimple(PowerTagCategoryEnum.PARAM.category(), loginUserUtil.getLoginUserCustomerId()); |
|
|
|
|
|
tagList.forEach( |
|
|
|
|
|
item -> { |
|
|
|
|
|
int numTemp; |
|
|
|
|
|
switch (item.getCategoryCode()) { |
|
|
|
|
|
case "volunteerTeamNum": |
|
|
|
|
|
numTemp = Integer.parseInt(item.getCategoryName()); |
|
|
|
|
|
if (numTemp > NumConstant.ZERO) { |
|
|
|
|
|
result.setVolunteerTeamNum(numTemp); |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
case "partyMemberNum": |
|
|
|
|
|
numTemp = Integer.parseInt(item.getCategoryName()); |
|
|
|
|
|
if (numTemp > NumConstant.ZERO) { |
|
|
|
|
|
result.setPartyMemberNum(numTemp); |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
case "kernelHouseHoldNum": |
|
|
|
|
|
numTemp = Integer.parseInt(item.getCategoryName()); |
|
|
|
|
|
if (numTemp > NumConstant.ZERO) { |
|
|
|
|
|
result.setKernelHouseHoldNum(numTemp); |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|