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. 6
      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;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
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.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -88,8 +90,8 @@ public class PowerAxisTagController {
* @date 2022/4/18/0018 18:12
*/
@PostMapping("listSimple/{tagCategory}")
public Result<List<PowerAxisTagCategoryResultDTO>> listSimple(@PathVariable("tagCategory") String tagCategory) {
return new Result().ok(powerAxisTagService.listSimple(tagCategory));
public Result<List<PowerAxisTagCategoryResultDTO>> listSimple(@PathVariable("tagCategory") String tagCategory, @LoginUser TokenDto tokenDto) {
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();
int countByRepeatStruct(PowerAxisStructEntity form);
int countRepeatStructByName(PowerAxisStructEntity form);
int queryCategory(PowerAxisStructEntity form);
int countRepeatStructByCategory(PowerAxisStructEntity form);
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
* @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;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.tools.constant.FieldConstant;
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.modules.axis.dao.PowerAxisStructDao;
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.PowerAxisTagService;
import org.apache.commons.lang3.StringUtils;
@ -153,11 +156,11 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
private void verifyStructField(PowerAxisStructEntity struct) {
int structLevel = powerAxisTagService.selectStructLevelByCode(loginUserUtil.getLoginUserCustomerId(), PowerTagCategoryEnum.STRUCT.category(), struct.getCategoryCode());
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(), "同一组织下只允许存在一个顶级节点");
}
}
if (baseDao.countByRepeatStruct(struct) > NumConstant.ZERO) {
if (baseDao.countRepeatStructByName(struct) > NumConstant.ZERO) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下不允许存在重名的节点");
}
}
@ -265,6 +268,7 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
@Override
public PowerAxisStructViewResultDTO getStatistics(PowerAxisStructViewFormDTO form) {
// 查网格党支部数 grid_party
int gridParty = baseDao.queryGridParty(form);
// 查楼院党小组数 group_party
@ -276,14 +280,46 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
// 查询服务站数
int serviceStation = baseDao.getServiceStation();
// 查询志愿者队伍数
int VolunteerTeamNum = 0;
int volunteerTeamNum = 0;
PowerAxisStructViewResultDTO result = new PowerAxisStructViewResultDTO();
result.setGridNum(gridParty);
result.setGroupNum(groupParty);
result.setPartyMemberNum(partyNum);
result.setKernelHouseHoldNum(kernelHouseHold);
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;
}

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
public List<PowerAxisTagCategoryResultDTO> listSimple(String tagCategory) {
public List<PowerAxisTagCategoryResultDTO> listSimple(String tagCategory, String customerId) {
if (StringUtils.isBlank(tagCategory)) {
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<>();
wrapper.eq("TAG_CATEGORY", tagCategory)
.eq("FORBIDDEN_FLAG", EpmetDelFlagEnum.NORMAL.value())
.eq(FieldConstant.CUSTOMER_ID, loginUserUtil.getLoginUserCustomerId())
.eq(FieldConstant.CUSTOMER_ID, customerId)
.orderByAsc("STRUCT_LEVEL", FieldConstant.CREATED_TIME);
return ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), PowerAxisTagCategoryResultDTO.class);

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

@ -51,9 +51,13 @@ public class PowerServiceStationServiceImpl extends BaseServiceImpl<PowerService
private QueryWrapper<PowerServiceStationEntity> getWrapper(Map<String, Object> params) {
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<>();
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;
}

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

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

Loading…
Cancel
Save