Browse Source

update

dev_power_axis
YUJT 4 years ago
parent
commit
7bfaacaa93
  1. 6
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java
  2. 4
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java
  3. 2
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisTagService.java
  4. 44
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java
  5. 4
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java
  6. 10
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerServiceStationServiceImpl.java
  7. 6
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml

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

@ -1,7 +1,9 @@
package com.epmet.plugin.power.modules.axis.controller; package com.epmet.plugin.power.modules.axis.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.AssertUtils;
@ -88,8 +90,8 @@ public class PowerAxisTagController {
* @date 2022/4/18/0018 18:12 * @date 2022/4/18/0018 18:12
*/ */
@PostMapping("listSimple/{tagCategory}") @PostMapping("listSimple/{tagCategory}")
public Result<List<PowerAxisTagCategoryResultDTO>> listSimple(@PathVariable("tagCategory") String tagCategory) { public Result<List<PowerAxisTagCategoryResultDTO>> listSimple(@PathVariable("tagCategory") String tagCategory, @LoginUser TokenDto tokenDto) {
return new Result().ok(powerAxisTagService.listSimple(tagCategory)); return new Result().ok(powerAxisTagService.listSimple(tagCategory, tokenDto.getCustomerId()));
} }
/** /**

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

@ -60,9 +60,9 @@ public interface PowerAxisStructDao extends BaseDao<PowerAxisStructEntity> {
List<PowerAxisStructPartyCommResultDTO> getPartyCommList(); List<PowerAxisStructPartyCommResultDTO> getPartyCommList();
int countByRepeatStruct(PowerAxisStructEntity form); int countRepeatStructByName(PowerAxisStructEntity form);
int queryCategory(PowerAxisStructEntity form); int countRepeatStructByCategory(PowerAxisStructEntity form);
List<String> getIdsByAgencyId(String agencyId); List<String> getIdsByAgencyId(String agencyId);

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

@ -87,7 +87,7 @@ public interface PowerAxisTagService extends BaseService<PowerAxisTagEntity> {
* @author work@yujt.net.cn * @author work@yujt.net.cn
* @date 2022/4/18/0018 17:24 * @date 2022/4/18/0018 17:24
*/ */
List<PowerAxisTagCategoryResultDTO> listSimple(String tagCategory); List<PowerAxisTagCategoryResultDTO> listSimple(String tagCategory, String 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

@ -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;
} }

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

@ -96,7 +96,7 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl<PowerAxisTagDao, Po
} }
@Override @Override
public List<PowerAxisTagCategoryResultDTO> listSimple(String tagCategory) { public List<PowerAxisTagCategoryResultDTO> listSimple(String tagCategory, String customerId) {
if (StringUtils.isBlank(tagCategory)) { if (StringUtils.isBlank(tagCategory)) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "缺少参数"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "缺少参数");
@ -105,7 +105,7 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl<PowerAxisTagDao, Po
QueryWrapper<PowerAxisTagEntity> wrapper = new QueryWrapper<>(); QueryWrapper<PowerAxisTagEntity> wrapper = new QueryWrapper<>();
wrapper.eq("TAG_CATEGORY", tagCategory) wrapper.eq("TAG_CATEGORY", tagCategory)
.eq("FORBIDDEN_FLAG", EpmetDelFlagEnum.NORMAL.value()) .eq("FORBIDDEN_FLAG", EpmetDelFlagEnum.NORMAL.value())
.eq(FieldConstant.CUSTOMER_ID, loginUserUtil.getLoginUserCustomerId()) .eq(FieldConstant.CUSTOMER_ID, customerId)
.orderByAsc("STRUCT_LEVEL", FieldConstant.CREATED_TIME); .orderByAsc("STRUCT_LEVEL", FieldConstant.CREATED_TIME);
return ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), PowerAxisTagCategoryResultDTO.class); return ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), PowerAxisTagCategoryResultDTO.class);

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

@ -49,11 +49,15 @@ public class PowerServiceStationServiceImpl extends BaseServiceImpl<PowerService
return ConvertUtils.sourceToTarget(entityList, PowerServiceStationDTO.class); return ConvertUtils.sourceToTarget(entityList, PowerServiceStationDTO.class);
} }
private QueryWrapper<PowerServiceStationEntity> getWrapper(Map<String, Object> params){ private QueryWrapper<PowerServiceStationEntity> getWrapper(Map<String, Object> params) {
String id = (String)params.get(FieldConstant.ID_HUMP); String id = (String) params.get(FieldConstant.ID_HUMP);
String name = (String) params.get("name");
String axisStructId = (String) params.get("axisStructId");
QueryWrapper<PowerServiceStationEntity> wrapper = new QueryWrapper<>(); QueryWrapper<PowerServiceStationEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id)
.eq(StringUtils.isNotBlank(name), "NAME", name)
.eq(StringUtils.isNotBlank(axisStructId), "STRUCT_REFERENCE_ID", name);
return wrapper; return wrapper;
} }

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

@ -129,7 +129,7 @@
AND AND
del_flag = 0 del_flag = 0
</select> </select>
<select id="countByRepeatStruct" resultType="java.lang.Integer"> <select id="countRepeatStructByName" resultType="java.lang.Integer">
SELECT SELECT
count(*) count(*)
FROM FROM
@ -146,13 +146,13 @@
</otherwise> </otherwise>
</choose> </choose>
</select> </select>
<select id="queryCategory" resultType="java.lang.Integer"> <select id="countRepeatStructByCategory" resultType="java.lang.Integer">
SELECT SELECT
count(*) count(*)
FROM FROM
pli_power_axis_struct pli_power_axis_struct
WHERE WHERE
AGENCY_ID = #{agencyId} AGENCY_ID = #{agencyId} and CUSTOMER_ID = #{customerId} and CATEGORY_CODE = #{categoryCode}
</select> </select>
<select id="getIdsByAgencyId" resultType="java.lang.String"> <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}

Loading…
Cancel
Save