fix:理事会bug
This commit is contained in:
+4
-2
@@ -164,7 +164,7 @@ public class PayCaseCommitteeController extends JeroController<PayCaseCommittee,
|
|||||||
LambdaQueryWrapper<PayCaseCommittee> queryWrapper2 = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PayCaseCommittee> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||||
queryWrapper2.eq(PayCaseCommittee::getAbbreviation,payCaseCommitteeDTO.getAbbreviation());
|
queryWrapper2.eq(PayCaseCommittee::getAbbreviation,payCaseCommitteeDTO.getAbbreviation());
|
||||||
PayCaseCommittee one2 = payCaseCommitteeService.getOne(queryWrapper2,false);
|
PayCaseCommittee one2 = payCaseCommitteeService.getOne(queryWrapper2,false);
|
||||||
if (ObjectUtils.isEmpty(one2)) {
|
if (!ObjectUtils.isEmpty(one2)) {
|
||||||
return Result.error("分标简称已存在");
|
return Result.error("分标简称已存在");
|
||||||
}
|
}
|
||||||
PayCaseCommittee payCaseCommittee = new PayCaseCommittee();
|
PayCaseCommittee payCaseCommittee = new PayCaseCommittee();
|
||||||
@@ -187,14 +187,16 @@ public class PayCaseCommitteeController extends JeroController<PayCaseCommittee,
|
|||||||
public Result<?> edit( @Valid @RequestBody PayCaseCommitteeUpdateDTO payCaseCommitteeUpdateDTO) {
|
public Result<?> edit( @Valid @RequestBody PayCaseCommitteeUpdateDTO payCaseCommitteeUpdateDTO) {
|
||||||
LambdaQueryWrapper<PayCaseCommittee> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PayCaseCommittee> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(PayCaseCommittee::getName,payCaseCommitteeUpdateDTO.getName());
|
queryWrapper.eq(PayCaseCommittee::getName,payCaseCommitteeUpdateDTO.getName());
|
||||||
|
queryWrapper.ne(PayCaseCommittee::getId,payCaseCommitteeUpdateDTO.getId());
|
||||||
PayCaseCommittee one = payCaseCommitteeService.getOne(queryWrapper,false);
|
PayCaseCommittee one = payCaseCommitteeService.getOne(queryWrapper,false);
|
||||||
if (!ObjectUtils.isEmpty(one)) {
|
if (!ObjectUtils.isEmpty(one)) {
|
||||||
return Result.error("分标委名已存在");
|
return Result.error("分标委名已存在");
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<PayCaseCommittee> queryWrapper2 = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PayCaseCommittee> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||||
queryWrapper2.eq(PayCaseCommittee::getAbbreviation,payCaseCommitteeUpdateDTO.getAbbreviation());
|
queryWrapper2.eq(PayCaseCommittee::getAbbreviation,payCaseCommitteeUpdateDTO.getAbbreviation());
|
||||||
|
queryWrapper2.ne(PayCaseCommittee::getId,payCaseCommitteeUpdateDTO.getId());
|
||||||
PayCaseCommittee one2 = payCaseCommitteeService.getOne(queryWrapper2,false);
|
PayCaseCommittee one2 = payCaseCommitteeService.getOne(queryWrapper2,false);
|
||||||
if (ObjectUtils.isEmpty(one2)) {
|
if (!ObjectUtils.isEmpty(one2)) {
|
||||||
return Result.error("分标简称已存在");
|
return Result.error("分标简称已存在");
|
||||||
}
|
}
|
||||||
PayCaseCommittee payCaseCommittee = new PayCaseCommittee();
|
PayCaseCommittee payCaseCommittee = new PayCaseCommittee();
|
||||||
|
|||||||
+6
-4
@@ -14,6 +14,7 @@ import com.jero.data.entity.PayCaseCouncil;
|
|||||||
import com.jero.data.service.IPayCaseCouncilService;
|
import com.jero.data.service.IPayCaseCouncilService;
|
||||||
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.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -42,7 +43,7 @@ public class PayCaseCouncilController extends JeroController<PayCaseCouncil, IPa
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
// @RequiresPermissions("committee:add")
|
@RequiresPermissions("council:add")
|
||||||
@AutoLog(value = "理事会-添加")
|
@AutoLog(value = "理事会-添加")
|
||||||
@ApiOperation(value="理事会-添加", notes="理事会-添加")
|
@ApiOperation(value="理事会-添加", notes="理事会-添加")
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
@@ -51,7 +52,7 @@ public class PayCaseCouncilController extends JeroController<PayCaseCouncil, IPa
|
|||||||
queryWrapper.eq(PayCaseCouncil::getName,payCaseCouncil.getName());
|
queryWrapper.eq(PayCaseCouncil::getName,payCaseCouncil.getName());
|
||||||
PayCaseCouncil one = payCaseCouncilService.getOne(queryWrapper,false);
|
PayCaseCouncil one = payCaseCouncilService.getOne(queryWrapper,false);
|
||||||
if (!ObjectUtils.isEmpty(one)) {
|
if (!ObjectUtils.isEmpty(one)) {
|
||||||
return Result.error("分标委名已存在");
|
return Result.error("理事会名已存在");
|
||||||
}
|
}
|
||||||
PayCaseCouncil payCaseCouncil1 = new PayCaseCouncil();
|
PayCaseCouncil payCaseCouncil1 = new PayCaseCouncil();
|
||||||
BeanUtils.copyProperties(payCaseCouncil, payCaseCouncil1);
|
BeanUtils.copyProperties(payCaseCouncil, payCaseCouncil1);
|
||||||
@@ -65,7 +66,7 @@ public class PayCaseCouncilController extends JeroController<PayCaseCouncil, IPa
|
|||||||
* 编辑
|
* 编辑
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
// @RequiresPermissions("committee:edit")
|
@RequiresPermissions("committee:edit")
|
||||||
@Transactional
|
@Transactional
|
||||||
@AutoLog(value = "理事会-编辑")
|
@AutoLog(value = "理事会-编辑")
|
||||||
@ApiOperation(value="理事会-编辑", notes="理事会-编辑")
|
@ApiOperation(value="理事会-编辑", notes="理事会-编辑")
|
||||||
@@ -76,9 +77,10 @@ public class PayCaseCouncilController extends JeroController<PayCaseCouncil, IPa
|
|||||||
}
|
}
|
||||||
LambdaQueryWrapper<PayCaseCouncil> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PayCaseCouncil> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(PayCaseCouncil::getName,payCaseCouncil.getName());
|
queryWrapper.eq(PayCaseCouncil::getName,payCaseCouncil.getName());
|
||||||
|
queryWrapper.ne(PayCaseCouncil::getId,payCaseCouncil.getId());
|
||||||
PayCaseCouncil one = payCaseCouncilService.getOne(queryWrapper,false);
|
PayCaseCouncil one = payCaseCouncilService.getOne(queryWrapper,false);
|
||||||
if (!ObjectUtils.isEmpty(one)) {
|
if (!ObjectUtils.isEmpty(one)) {
|
||||||
return Result.error("分标委名已存在");
|
return Result.error("理事会名已存在");
|
||||||
}
|
}
|
||||||
PayCaseCouncil payCaseCouncil1 = new PayCaseCouncil();
|
PayCaseCouncil payCaseCouncil1 = new PayCaseCouncil();
|
||||||
BeanUtils.copyProperties(payCaseCouncil, payCaseCouncil1);
|
BeanUtils.copyProperties(payCaseCouncil, payCaseCouncil1);
|
||||||
|
|||||||
+19
-17
@@ -56,7 +56,7 @@ public class PayCaseCouncilSubitemController extends JeroController<PayCaseCounc
|
|||||||
* 理事会成员表
|
* 理事会成员表
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
// @RequiresPermissions("committee:search")
|
@RequiresPermissions("council:search")
|
||||||
@ApiOperation(value="理事会成员表-搜索", notes="理事会成员表-搜索",response = FindByName.class)
|
@ApiOperation(value="理事会成员表-搜索", notes="理事会成员表-搜索",response = FindByName.class)
|
||||||
@GetMapping(value = "/find")
|
@GetMapping(value = "/find")
|
||||||
public Result<?> find(@RequestParam(name="contactsName",required =false) String contactsName,
|
public Result<?> find(@RequestParam(name="contactsName",required =false) String contactsName,
|
||||||
@@ -109,10 +109,10 @@ public class PayCaseCouncilSubitemController extends JeroController<PayCaseCounc
|
|||||||
public Result<?> add(@Valid @RequestBody PayCaseCouncilSubitem payCaseCouncilSubitem) {
|
public Result<?> add(@Valid @RequestBody PayCaseCouncilSubitem payCaseCouncilSubitem) {
|
||||||
PayCaseCouncilSubitem payCaseCouncilSubitem1 = new PayCaseCouncilSubitem();
|
PayCaseCouncilSubitem payCaseCouncilSubitem1 = new PayCaseCouncilSubitem();
|
||||||
BeanUtils.copyProperties(payCaseCouncilSubitem,payCaseCouncilSubitem1);
|
BeanUtils.copyProperties(payCaseCouncilSubitem,payCaseCouncilSubitem1);
|
||||||
// 新增时校验重复
|
// 新增时校验重复ne
|
||||||
LambdaQueryWrapper<PayCaseCouncilSubitem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PayCaseCouncilSubitem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(PayCaseCouncilSubitem::getContactsId, payCaseCouncilSubitem.getContactsId());
|
lambdaQueryWrapper.eq(PayCaseCouncilSubitem::getContactsId, payCaseCouncilSubitem.getContactsId());
|
||||||
lambdaQueryWrapper.eq(PayCaseCouncilSubitem::getCouncilId, payCaseCouncilSubitem.getCouncilId());
|
lambdaQueryWrapper.ne(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,6 +129,7 @@ public class PayCaseCouncilSubitemController extends JeroController<PayCaseCounc
|
|||||||
* @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")
|
||||||
@@ -137,19 +138,20 @@ public class PayCaseCouncilSubitemController extends JeroController<PayCaseCounc
|
|||||||
return Result.OK("删除成功!");
|
return Result.OK("删除成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 批量删除
|
// * 批量删除
|
||||||
*
|
// *
|
||||||
* @param ids
|
// * @param ids
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@AutoLog(value = "理事会成员-批量删除")
|
// @RequiresPermissions("council:batchDel")
|
||||||
@ApiOperation(value="理事会成员-批量删除", notes="理事会成员-批量删除")
|
// @AutoLog(value = "理事会成员-批量删除")
|
||||||
@GetMapping(value = "/deleteBatch")
|
// @ApiOperation(value="理事会成员-批量删除", notes="理事会成员-批量删除")
|
||||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
// @GetMapping(value = "/deleteBatch")
|
||||||
this.payCaseCouncilSubitemService.removeByIds(Arrays.asList(ids.split(",")));
|
// public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
return Result.OK("批量删除成功!");
|
// this.payCaseCouncilSubitemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
}
|
// return Result.OK("批量删除成功!");
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
@@ -175,7 +177,7 @@ public class PayCaseCouncilSubitemController extends JeroController<PayCaseCounc
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@RequiresPermissions("committee:export")
|
@RequiresPermissions("council:export")
|
||||||
@AutoLog(value = "分标委表导出-导出")
|
@AutoLog(value = "分标委表导出-导出")
|
||||||
@ApiOperation(value="分标委表导出-导出", notes="分标委表导出-导出")
|
@ApiOperation(value="分标委表导出-导出", notes="分标委表导出-导出")
|
||||||
@GetMapping(value = "/exportXls",produces = "text/text;charset=utf-8")
|
@GetMapping(value = "/exportXls",produces = "text/text;charset=utf-8")
|
||||||
|
|||||||
Reference in New Issue
Block a user