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

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

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

Loading…
Cancel
Save