Browse Source

message:

完善修改,
完善返回报错信息
dev_power_axis
HAHA 3 years ago
parent
commit
34beaaf3b7
  1. 11
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java
  2. 2
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java
  3. 22
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java
  4. 2
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml

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

@ -128,16 +128,7 @@ public class PowerAxisStructController {
*/ */
@PostMapping("/modifyOrg") @PostMapping("/modifyOrg")
public Result modifyOrg(@RequestBody PowerAxisStructEntity form){ public Result modifyOrg(@RequestBody PowerAxisStructEntity form){
int i = powerAxisStructService.modifyRog(form); powerAxisStructService.modifyRog(form);
if(i == 0){
return new Result().error(1,"不能所属自己");
}
if(i == -2){
return new Result().error(1,"同一组织下只允许存在一个党委");
}
if(i == -3){
return new Result().error(1,"名字重复");
}
return new Result(); return new Result();
} }

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

@ -107,7 +107,7 @@ public interface PowerAxisStructService extends BaseService<PowerAxisStructEntit
/** /**
* 修改组织 * 修改组织
*/ */
int modifyRog(PowerAxisStructEntity form); void modifyRog(PowerAxisStructEntity form);
/** /**
* 删除 * 删除

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

@ -197,27 +197,23 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
} }
@Override @Override
public int modifyRog(PowerAxisStructEntity form) { public void modifyRog(PowerAxisStructEntity form) {
if (form.getId().equals(form.getPid())) { if (form.getId().equals(form.getPid())) {
return 0; throw new EpmetException("不能所属自己");
} }
if (form.getCategoryCode().equals("community_party")) { int structLevel = powerAxisTagService.selectStructLevelByCode(loginUserUtil.getLoginUserCustomerId(), PowerTagCategoryEnum.STRUCT.category(), form.getCategoryCode());
int y = baseDao.queryCategory(form); if (PowerTagLevelEnum.ROOT.level() == structLevel) {
y = y - 1; if (baseDao.queryCategory(form) > NumConstant.ZERO) {
if (y != 0) { throw new EpmetException("同一组织下只允许存在一个顶级节点");
return -2;
} }
} }
int x = baseDao.queryName(form); if(baseDao.queryName(form) > NumConstant.ZERO){
x = x - 1; throw new EpmetException("同一组织下不允许存在重名的节点");
if (x != 0) {
return -3;
} }
this.assembleStruct(form, loginUserUtil.getLoginUserCustomerId()); this.assembleStruct(form, loginUserUtil.getLoginUserCustomerId());
int i = baseDao.updateById(form); baseDao.updateById(form);
return i;
} }
@Override @Override

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

@ -137,7 +137,7 @@
WHERE WHERE
NAME = #{name} NAME = #{name}
AND AND
pid = #{pid} agency_id = #{agencyId}
</select> </select>
<select id="queryCategory" resultType="java.lang.Integer"> <select id="queryCategory" resultType="java.lang.Integer">
SELECT SELECT

Loading…
Cancel
Save