|
|
@@ -1,9 +1,9 @@
|
|
|
package com.jzg.organization.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.jzg.commons.core.base.BaseController;
|
|
|
import com.jzg.commons.core.page.HttpResult;
|
|
|
import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatch;
|
|
|
import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAction;
|
|
|
@@ -69,14 +69,12 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
|
|
|
|
|
|
@Autowired
|
|
|
PtlAgreementDispatchAfterActionMapper afterActionMapper;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- BaseController baseController;
|
|
|
-
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public String addAgreementDispatch(PtlAgreementDispatchVo.DispatchVo ptlAgreementDispatchVo) {
|
|
|
+ log.info("添加协议调度信息: ptlAgreementDispatchVo=[{}]", JSONUtil.toJsonStr(ptlAgreementDispatchVo));
|
|
|
PtlAgreementDispatch dispatch = new PtlAgreementDispatch(ptlAgreementDispatchVo);
|
|
|
+ // ptl_agreement_dispatch 表中插入数据
|
|
|
baseMapper.insert(dispatch);
|
|
|
|
|
|
for (PtlAgreementDispatchRulesAttrLink link : ptlAgreementDispatchVo.getAttrLinks()){
|
|
|
@@ -84,12 +82,13 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
|
|
|
}
|
|
|
rulesAttrLinkMapper.insert(ptlAgreementDispatchVo.getAttrLinks());
|
|
|
|
|
|
- for (PtlAgreementDispatchAction action : ptlAgreementDispatchVo.getActions()){
|
|
|
- action.setId(IdGenerate.nextId());
|
|
|
- action.setDispatchId(dispatch.getId());
|
|
|
+ if(CollUtil.isNotEmpty(ptlAgreementDispatchVo.getActions())){
|
|
|
+ for (PtlAgreementDispatchAction action : ptlAgreementDispatchVo.getActions()){
|
|
|
+ action.setId(IdGenerate.nextId());
|
|
|
+ action.setDispatchId(dispatch.getId());
|
|
|
+ }
|
|
|
+ actionMapper.insert(ptlAgreementDispatchVo.getActions());
|
|
|
}
|
|
|
- actionMapper.insert(ptlAgreementDispatchVo.getActions());
|
|
|
-
|
|
|
return dispatch.getId();
|
|
|
}
|
|
|
|
|
|
@@ -130,7 +129,7 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
|
|
|
List<String> dispatchIds = ptlAgreementDispatches.stream().map(PtlAgreementDispatch::getId).collect(Collectors.toList());
|
|
|
if (!dispatchIds.isEmpty()) {
|
|
|
List<SysDict> dispatchBeforeActionDict = sysDictService.getByTypeCode("dispatch_before_action");
|
|
|
- List<SysDict> dispatchAfterActionDict = sysDictService.getByTypeCode("dispatch_after_action");
|
|
|
+ //List<SysDict> dispatchAfterActionDict = sysDictService.getByTypeCode("dispatch_after_action");
|
|
|
|
|
|
// 查询保司所有的规则属性 然后进行分组
|
|
|
List<PtlAgreementDispatchRulesAttrLink> ptlAgreementDispatchRulesAttrLinks = rulesAttrLinkMapper.selectList(new LambdaQueryWrapper<PtlAgreementDispatchRulesAttrLink>()
|