|
|
@ -30,6 +30,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.oa.biz.oaappendix.OaAppendixService; |
|
|
|
import com.yxt.anrui.oa.biz.oaform.OaFormDto; |
|
|
|
import com.yxt.anrui.oa.biz.oaform.OaFormRuleEnum; |
|
|
|
import com.yxt.anrui.oa.biz.oaform.OaFormService; |
|
|
|
import com.yxt.anrui.oa.biz.oaform.flowable.*; |
|
|
|
import com.yxt.anrui.oa.feign.file.OaFileEnum; |
|
|
@ -144,6 +145,7 @@ public class OaMendApplyService extends MybatisBaseService<OaMendApplyMapper, Oa |
|
|
|
OaFormDto oaFormDto = new OaFormDto(); |
|
|
|
BeanUtil.copyProperties(dto, oaFormDto); |
|
|
|
oaFormDto.setBillNo("BKSQ"); |
|
|
|
oaFormDto.setSid(entity.getSid()); |
|
|
|
ResultBean<String> resultBean = oaFormService.saveOaForm(oaFormDto); |
|
|
|
|
|
|
|
if (!resultBean.getSuccess()) { |
|
|
@ -178,6 +180,24 @@ public class OaMendApplyService extends MybatisBaseService<OaMendApplyMapper, Oa |
|
|
|
return vo; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean delAll(String[] sids) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
//查询该sid中是否有流程不是待提交的
|
|
|
|
int count = baseMapper.selectBySid(StringUtils.join(sids, ",")); |
|
|
|
if (count > 0) { |
|
|
|
return rb.setMsg("删除的数据中包含已提交或已办结审批的数据,删除失败"); |
|
|
|
} |
|
|
|
delBySids(sids); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 提交 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean submit(SubmitOaMendApplyDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
ResultBean<String> stringResultBean = saveOrUpdateDto(dto); |
|
|
@ -197,23 +217,13 @@ public class OaMendApplyService extends MybatisBaseService<OaMendApplyMapper, Oa |
|
|
|
formVariables.put("app", appMap); |
|
|
|
submitDto.setFormVariables(formVariables); |
|
|
|
submitDto.setProcDefId(ProcDefEnum.OAMENDAPPLY.getProDefId()); |
|
|
|
//若申请单中选择了下一处理人,则需赋值给下一处理人字段
|
|
|
|
submitDto.setNextNodeUserSids(""); |
|
|
|
submitDto.setNextNodeSid(dto.getTaskId()); |
|
|
|
//若申请单中选择了下一处理人,则需赋值给下一处理人字段,若没有则删除
|
|
|
|
// submitDto.setNextNodeUserSids("");
|
|
|
|
submitDto.setNextTaskId(dto.getTaskId()); |
|
|
|
submitDto.setRule(OaFormRuleEnum.DIRECTLY_UNDER.getRule()); |
|
|
|
return oaFormService.submit(submitDto); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean delAll(String[] sids) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
//查询该sid中是否有流程不是待提交的
|
|
|
|
int count = baseMapper.selectBySid(StringUtils.join(sids, ",")); |
|
|
|
if (count > 0) { |
|
|
|
return rb.setMsg("删除的数据中包含已提交或已办结审批的数据,删除失败"); |
|
|
|
} |
|
|
|
delBySids(sids); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 办理(同意) |
|
|
|
* |
|
|
@ -252,7 +262,12 @@ public class OaMendApplyService extends MybatisBaseService<OaMendApplyMapper, Oa |
|
|
|
return oaFormService.reject(dto); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<List<NodeVo>> getPreviousNodesForReject(NodeQuery query) { |
|
|
|
/** |
|
|
|
* 提交时获取下一环节 |
|
|
|
* @param query |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean<List<NodeVo>> getNextNodesForSubmit(NodeQuery query) { |
|
|
|
Map<String, Object> formVariables = query.getFormVariables(); |
|
|
|
//添加网关
|
|
|
|
// formVariables.put("", "");
|
|
|
@ -261,10 +276,15 @@ public class OaMendApplyService extends MybatisBaseService<OaMendApplyMapper, Oa |
|
|
|
appMap.put("sid", query.getBusinessSid()); |
|
|
|
formVariables.put("app", appMap); |
|
|
|
query.setFormVariables(formVariables); |
|
|
|
return oaFormService.getPreviousNodesForReject(query); |
|
|
|
return oaFormService.getNextNodesForSubmit(query); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<List<NodeVo>> getNextNodesForSubmit(NodeQuery query) { |
|
|
|
/** |
|
|
|
* 驳回时获取上一环节 |
|
|
|
* @param query |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean<List<NodeVo>> getPreviousNodesForReject(NodeQuery query) { |
|
|
|
Map<String, Object> formVariables = query.getFormVariables(); |
|
|
|
//添加网关
|
|
|
|
// formVariables.put("", "");
|
|
|
@ -273,6 +293,11 @@ public class OaMendApplyService extends MybatisBaseService<OaMendApplyMapper, Oa |
|
|
|
appMap.put("sid", query.getBusinessSid()); |
|
|
|
formVariables.put("app", appMap); |
|
|
|
query.setFormVariables(formVariables); |
|
|
|
return oaFormService.getNextNodesForSubmit(query); |
|
|
|
return oaFormService.getPreviousNodesForReject(query); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 具体申请设置网关参数的统一方法 |
|
|
|
*/ |
|
|
|
|
|
|
|
} |