fix:理事会bug
This commit is contained in:
+13
-2
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.data.controller;
|
package com.jero.data.controller;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@@ -11,7 +12,9 @@ import com.jero.common.api.vo.Result;
|
|||||||
import com.jero.common.aspect.annotation.AutoLog;
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
import com.jero.common.system.base.controller.JeroController;
|
import com.jero.common.system.base.controller.JeroController;
|
||||||
import com.jero.data.entity.PayCaseCouncil;
|
import com.jero.data.entity.PayCaseCouncil;
|
||||||
|
import com.jero.data.entity.PayCaseCouncilSubitem;
|
||||||
import com.jero.data.service.IPayCaseCouncilService;
|
import com.jero.data.service.IPayCaseCouncilService;
|
||||||
|
import com.jero.data.service.IPayCaseCouncilSubitemService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
@@ -36,6 +39,8 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
public class PayCaseCouncilController extends JeroController<PayCaseCouncil, IPayCaseCouncilService> {
|
public class PayCaseCouncilController extends JeroController<PayCaseCouncil, IPayCaseCouncilService> {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPayCaseCouncilService payCaseCouncilService;
|
private IPayCaseCouncilService payCaseCouncilService;
|
||||||
|
@Autowired
|
||||||
|
private IPayCaseCouncilSubitemService payCaseCouncilSubitemService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
@@ -66,7 +71,7 @@ public class PayCaseCouncilController extends JeroController<PayCaseCouncil, IPa
|
|||||||
* 编辑
|
* 编辑
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("committee:edit")
|
@RequiresPermissions("council:edit")
|
||||||
@Transactional
|
@Transactional
|
||||||
@AutoLog(value = "理事会-编辑")
|
@AutoLog(value = "理事会-编辑")
|
||||||
@ApiOperation(value="理事会-编辑", notes="理事会-编辑")
|
@ApiOperation(value="理事会-编辑", notes="理事会-编辑")
|
||||||
@@ -94,11 +99,17 @@ public class PayCaseCouncilController extends JeroController<PayCaseCouncil, IPa
|
|||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@RequiresPermissions("council:delete")
|
||||||
@AutoLog(value = "理事会-通过id删除")
|
@AutoLog(value = "理事会-通过id删除")
|
||||||
@ApiOperation(value="理事会-通过id删除", notes="理事会-通过id删除")
|
@ApiOperation(value="理事会-通过id删除", notes="理事会-通过id删除")
|
||||||
@GetMapping(value = "/delete")
|
@GetMapping(value = "/delete")
|
||||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
payCaseCouncilService.removeById(id);
|
LambdaQueryWrapper<PayCaseCouncilSubitem> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(PayCaseCouncilSubitem::getCouncilId,id);
|
||||||
|
List<PayCaseCouncilSubitem> payCaseCommitteeSubitems = payCaseCouncilSubitemService.list(queryWrapper);
|
||||||
|
if(payCaseCommitteeSubitems.size()>0){
|
||||||
|
return Result.error("理事会下级仍有数据,不可删除!");
|
||||||
|
}payCaseCouncilSubitemService.removeById(id);
|
||||||
return Result.OK("删除成功!");
|
return Result.OK("删除成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
-20
@@ -101,7 +101,7 @@ public class PayCaseCouncilSubitemController extends JeroController<PayCaseCounc
|
|||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
*/
|
*/
|
||||||
// @RequiresPermissions("committee:addMember")
|
@RequiresPermissions("council:addMember")
|
||||||
@Transactional
|
@Transactional
|
||||||
@AutoLog(value = "理事会成员表-添加")
|
@AutoLog(value = "理事会成员表-添加")
|
||||||
@ApiOperation(value="理事会成员表-添加", notes="理事会成员表-添加")
|
@ApiOperation(value="理事会成员表-添加", notes="理事会成员表-添加")
|
||||||
@@ -112,7 +112,7 @@ public class PayCaseCouncilSubitemController extends JeroController<PayCaseCounc
|
|||||||
// 新增时校验重复ne
|
// 新增时校验重复ne
|
||||||
LambdaQueryWrapper<PayCaseCouncilSubitem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PayCaseCouncilSubitem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(PayCaseCouncilSubitem::getContactsId, payCaseCouncilSubitem.getContactsId());
|
lambdaQueryWrapper.eq(PayCaseCouncilSubitem::getContactsId, payCaseCouncilSubitem.getContactsId());
|
||||||
lambdaQueryWrapper.ne(PayCaseCouncilSubitem::getCouncilId, payCaseCouncilSubitem.getCouncilId());
|
lambdaQueryWrapper.eq(PayCaseCouncilSubitem::getCouncilId, payCaseCouncilSubitem.getCouncilId());
|
||||||
int count = payCaseCouncilSubitemService.count(lambdaQueryWrapper);
|
int count = payCaseCouncilSubitemService.count(lambdaQueryWrapper);
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
return Result.error("联系人重复,请重新选择");
|
return Result.error("联系人重复,请重新选择");
|
||||||
@@ -129,7 +129,7 @@ public class PayCaseCouncilSubitemController extends JeroController<PayCaseCounc
|
|||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("council:delete")
|
@RequiresPermissions("council:member:delete")
|
||||||
@AutoLog(value = "理事会成员-通过id删除")
|
@AutoLog(value = "理事会成员-通过id删除")
|
||||||
@ApiOperation(value="理事会成员-通过id删除", notes="理事会成员-通过id删除")
|
@ApiOperation(value="理事会成员-通过id删除", notes="理事会成员-通过id删除")
|
||||||
@GetMapping(value = "/delete")
|
@GetMapping(value = "/delete")
|
||||||
@@ -152,23 +152,23 @@ public class PayCaseCouncilSubitemController extends JeroController<PayCaseCounc
|
|||||||
// this.payCaseCouncilSubitemService.removeByIds(Arrays.asList(ids.split(",")));
|
// this.payCaseCouncilSubitemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
// return Result.OK("批量删除成功!");
|
// return Result.OK("批量删除成功!");
|
||||||
// }
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 通过id查询
|
// * 通过id查询
|
||||||
*
|
// *
|
||||||
* @param id
|
// * @param id
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@AutoLog(value = "理事会成员-通过id查询")
|
// @AutoLog(value = "理事会成员-通过id查询")
|
||||||
@ApiOperation(value="理事会成员-通过id查询", notes="理事会成员-通过id查询")
|
// @ApiOperation(value="理事会成员-通过id查询", notes="理事会成员-通过id查询")
|
||||||
@GetMapping(value = "/queryById")
|
// @GetMapping(value = "/queryById")
|
||||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
// public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
PayCaseCouncilSubitem payCaseCouncilSubitem = payCaseCouncilSubitemService.getById(id);
|
// PayCaseCouncilSubitem payCaseCouncilSubitem = payCaseCouncilSubitemService.getById(id);
|
||||||
if(payCaseCouncilSubitem==null) {
|
// if(payCaseCouncilSubitem==null) {
|
||||||
return Result.error("未找到对应数据");
|
// return Result.error("未找到对应数据");
|
||||||
}
|
// }
|
||||||
return Result.OK(payCaseCouncilSubitem);
|
// return Result.OK(payCaseCouncilSubitem);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user