Commit a6be62e5 by tangzhaoqian

审批组、自定义审批 重名约束

parent 592b1ce7
......@@ -116,7 +116,7 @@ public class SpmkController {
@ApiOperationSupport(order = 1)
public Result<Object> saveAtg(@RequestBody SpmkApprovalTemplateG spmkApprovalTemplateG){
if (spmkApprovalTemplateG.selectCount(Wrappers.lambdaQuery(spmkApprovalTemplateG)
if (spmkApprovalTemplateG.selectCount(new QueryWrapper<SpmkApprovalTemplateG>().lambda()
.eq(SpmkApprovalTemplateG::getName, spmkApprovalTemplateG.getName())) > 0) {
return ResultUtil.error("审批模板组名重复!");
}
......@@ -186,7 +186,7 @@ public class SpmkController {
at.setFroms(ObjectUtil.serialize((List<JSONObject>)spmkApprovalTemplateDto.getFroms()));
at.setRouter(ObjectUtil.serialize(spmkApprovalTemplateDto.getRouter()));
if (at.selectCount(Wrappers.lambdaQuery(at)
if (at.selectCount(new QueryWrapper<SpmkApprovalTemplate>().lambda()
.eq(SpmkApprovalTemplate::getName, at.getName())) > 0) {
return ResultUtil.error("审批模板名重复!");
}
......@@ -253,8 +253,9 @@ public class SpmkController {
@ApiOperationSupport(order = 9)
public Result<Object> saveAg(@CurrentUser UserBean userBean, @RequestBody SpmkApprovalG spmkApprovalG){
if (spmkApprovalG.selectCount(Wrappers.lambdaQuery(spmkApprovalG)
.eq(SpmkApprovalG::getName, spmkApprovalG.getName())) > 0) {
if (spmkApprovalG.selectCount(new QueryWrapper<SpmkApprovalG>().lambda()
.eq(SpmkApprovalG::getName, spmkApprovalG.getName())
.eq(SpmkApprovalG::getOrgCode, userBean.getOrgCode())) > 0) {
return ResultUtil.error("审批组名重复!");
}
......@@ -325,7 +326,7 @@ public class SpmkController {
@ApiOperation(value = "13.新增或编辑-自定义审批", httpMethod = "POST", notes = "新增或编辑-自定义审批")
@ApiOperationSupport(order = 13)
@Transactional(rollbackFor = Exception.class)
public Result<Object> saveCa(@RequestBody SpmkCustomApprovalDto spmkCustomApprovalDto) throws Exception{
public Result<Object> saveCa(@CurrentUser UserBean userBean, @RequestBody SpmkCustomApprovalDto spmkCustomApprovalDto) throws Exception{
Integer approvalGId = spmkCustomApprovalDto.getApprovalGId();
if (ObjectUtil.isNull(approvalGId))
return ResultUtil.error("操作失败!-1");
......@@ -334,8 +335,9 @@ public class SpmkController {
BeanUtil.copyProperties(spmkCustomApprovalDto, ca , "froms","router","initiatorConfigs");
if (ca.selectCount(Wrappers.lambdaQuery(ca)
.eq(SpmkCustomApproval::getName, ca.getName())) > 0) {
if (ca.selectCount(new QueryWrapper<SpmkCustomApproval>().lambda()
.eq(SpmkCustomApproval::getName, ca.getName())
.eq(SpmkCustomApproval::getOrgCode, userBean.getOrgCode())) > 0) {
return ResultUtil.error("自定义审批名重复!");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment