diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerAxisLeaderDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerAxisLeaderDTO.java index 5e5f016..159d00f 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerAxisLeaderDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerAxisLeaderDTO.java @@ -56,6 +56,11 @@ public class PowerAxisLeaderDTO implements Serializable { */ private String avatar; + /** + * 类别编码 + */ + private String categoryCode; + /** * 删除标识 0.未删除 1.已删除 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisLeaderController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisLeaderController.java index 8ab74a1..49f3a9a 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisLeaderController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisLeaderController.java @@ -12,10 +12,8 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.plugin.power.dto.axis.PowerAxisLeaderDTO; -import com.epmet.plugin.power.dto.axis.form.PowerAxisStructLeaderFormDTO; import com.epmet.plugin.power.dto.axis.result.PowerAxisSLeaderResultDTO; import com.epmet.plugin.power.dto.axis.result.PowerAxisSimpleListDTO; -import com.epmet.plugin.power.modules.axis.dao.PowerAxisStructLeaderDao; import com.epmet.plugin.power.modules.axis.excel.PowerAxisLeaderExcel; import com.epmet.plugin.power.modules.axis.service.PowerAxisLeaderService; import com.epmet.plugin.power.modules.axis.service.PowerAxisStructLeaderService; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.java index 0d205d2..aec5228 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.java @@ -1,5 +1,6 @@ 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.service.impl.BaseServiceImpl; @@ -13,6 +14,7 @@ import com.epmet.plugin.power.dto.axis.result.PowerAxisSimpleListDTO; import com.epmet.plugin.power.modules.axis.dao.PowerAxisLeaderDao; import com.epmet.plugin.power.modules.axis.dao.PowerAxisStructLeaderDao; import com.epmet.plugin.power.modules.axis.entity.PowerAxisLeaderEntity; +import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity; import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity; import com.epmet.plugin.power.modules.axis.service.PowerAxisLeaderService; import org.apache.commons.lang3.StringUtils; @@ -26,7 +28,7 @@ import java.util.List; import java.util.Map; /** - * 动力主轴领导人 + * 动力主轴领导人 * * @author generator generator@elink-cn.com * @since v1.0.0 2022-04-18 @@ -53,8 +55,8 @@ public class PowerAxisLeaderServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -73,12 +75,10 @@ public class PowerAxisLeaderServiceImpl extends BaseServiceImpl getSimpleList(List ids) { - List list = baseDao.getSimpleList(ids); - return list; + return baseDao.getSimpleList(ids); } @Override public PowerAxisLeaderDetailResultDTO getLeaderDetail(PowerAxisLeaderDetailFormDTO form) { - PowerAxisLeaderDetailResultDTO dto = baseDao.getLeaderDetail(form); - return dto; + return baseDao.getLeaderDetail(form); } + private void delStructLeaderRelation(String customerId, String structId) { + LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); + lqw.eq(PowerAxisStructLeaderEntity::getStructReferenceId, structId) + .eq(PowerAxisStructLeaderEntity::getCustomerId, customerId); + powerAxisStructLeaderDao.delete(lqw); + } + private void addStructLeaderRelation(String customerId, String structId, String leaderId, String categoryCode) { + PowerAxisStructLeaderEntity structLeader = new PowerAxisStructLeaderEntity(); + structLeader.setCustomerId(customerId); + structLeader.setLeaderId(leaderId); + structLeader.setStructReferenceId(structId); + structLeader.setCategoryCode(categoryCode); + powerAxisStructLeaderDao.insert(structLeader); + } } \ No newline at end of file