Commit cb98fecd by Administrator

Merge branch 'tzq' into 'develop'

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

See merge request 8timerv2/8timerapiv200!87
parents 592b1ce7 a6be62e5
...@@ -116,7 +116,7 @@ public class SpmkController { ...@@ -116,7 +116,7 @@ public class SpmkController {
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
public Result<Object> saveAtg(@RequestBody SpmkApprovalTemplateG spmkApprovalTemplateG){ 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) { .eq(SpmkApprovalTemplateG::getName, spmkApprovalTemplateG.getName())) > 0) {
return ResultUtil.error("审批模板组名重复!"); return ResultUtil.error("审批模板组名重复!");
} }
...@@ -186,7 +186,7 @@ public class SpmkController { ...@@ -186,7 +186,7 @@ public class SpmkController {
at.setFroms(ObjectUtil.serialize((List<JSONObject>)spmkApprovalTemplateDto.getFroms())); at.setFroms(ObjectUtil.serialize((List<JSONObject>)spmkApprovalTemplateDto.getFroms()));
at.setRouter(ObjectUtil.serialize(spmkApprovalTemplateDto.getRouter())); 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) { .eq(SpmkApprovalTemplate::getName, at.getName())) > 0) {
return ResultUtil.error("审批模板名重复!"); return ResultUtil.error("审批模板名重复!");
} }
...@@ -253,8 +253,9 @@ public class SpmkController { ...@@ -253,8 +253,9 @@ public class SpmkController {
@ApiOperationSupport(order = 9) @ApiOperationSupport(order = 9)
public Result<Object> saveAg(@CurrentUser UserBean userBean, @RequestBody SpmkApprovalG spmkApprovalG){ public Result<Object> saveAg(@CurrentUser UserBean userBean, @RequestBody SpmkApprovalG spmkApprovalG){
if (spmkApprovalG.selectCount(Wrappers.lambdaQuery(spmkApprovalG) if (spmkApprovalG.selectCount(new QueryWrapper<SpmkApprovalG>().lambda()
.eq(SpmkApprovalG::getName, spmkApprovalG.getName())) > 0) { .eq(SpmkApprovalG::getName, spmkApprovalG.getName())
.eq(SpmkApprovalG::getOrgCode, userBean.getOrgCode())) > 0) {
return ResultUtil.error("审批组名重复!"); return ResultUtil.error("审批组名重复!");
} }
...@@ -325,7 +326,7 @@ public class SpmkController { ...@@ -325,7 +326,7 @@ public class SpmkController {
@ApiOperation(value = "13.新增或编辑-自定义审批", httpMethod = "POST", notes = "新增或编辑-自定义审批") @ApiOperation(value = "13.新增或编辑-自定义审批", httpMethod = "POST", notes = "新增或编辑-自定义审批")
@ApiOperationSupport(order = 13) @ApiOperationSupport(order = 13)
@Transactional(rollbackFor = Exception.class) @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(); Integer approvalGId = spmkCustomApprovalDto.getApprovalGId();
if (ObjectUtil.isNull(approvalGId)) if (ObjectUtil.isNull(approvalGId))
return ResultUtil.error("操作失败!-1"); return ResultUtil.error("操作失败!-1");
...@@ -334,8 +335,9 @@ public class SpmkController { ...@@ -334,8 +335,9 @@ public class SpmkController {
BeanUtil.copyProperties(spmkCustomApprovalDto, ca , "froms","router","initiatorConfigs"); BeanUtil.copyProperties(spmkCustomApprovalDto, ca , "froms","router","initiatorConfigs");
if (ca.selectCount(Wrappers.lambdaQuery(ca) if (ca.selectCount(new QueryWrapper<SpmkCustomApproval>().lambda()
.eq(SpmkCustomApproval::getName, ca.getName())) > 0) { .eq(SpmkCustomApproval::getName, ca.getName())
.eq(SpmkCustomApproval::getOrgCode, userBean.getOrgCode())) > 0) {
return ResultUtil.error("自定义审批名重复!"); 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