|
@@ -311,10 +311,22 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
model.setNo(IdGeneratorUtils.getPreparationNo(++count));
|
|
|
model.setStatus(PreparationStatusEnum.NOT_ALLOCATED.getValue()); // 待主管审核
|
|
|
model.setNodeNum(PreparationNodeEnum.APPLY.getValue());
|
|
|
+ // 根据是否有审核主管,判断审核节点和状态
|
|
|
+ boolean sendToVerify = Boolean.TRUE;
|
|
|
+ if(StringUtils.isEmpty(model.getApplyVerifyUserId())){
|
|
|
+ model.setStatus(PreparationStatusEnum.APPLY_MANAGER_VERIFY_SUCCESS.getValue()); // 待主管审核
|
|
|
+ model.setNodeNum(PreparationNodeEnum.APPLY_MANAGER_VERIFY.getValue());
|
|
|
+ sendToVerify = Boolean.FALSE;
|
|
|
+ }
|
|
|
model.setDelUserId("[]");
|
|
|
Preparation preparation = this.saveModelByDTO(model);
|
|
|
// 给申请部门主管发送信息,通知审核
|
|
|
- SysUser sendUser = sysUserMapper.selectByPrimaryKey(model.getApplyVerifyUserId());
|
|
|
+ SysUser sendUser = null;
|
|
|
+ if(sendToVerify){
|
|
|
+ sendUser = sysUserMapper.selectByPrimaryKey(model.getApplyVerifyUserId());
|
|
|
+ }else{
|
|
|
+ sendUser = sysUserMapper.selectByPrimaryKey(model.getApplyVerifyLeader());
|
|
|
+ }
|
|
|
sendMessageToApplyManger(sendUser, preparation);
|
|
|
// 存储操作记录
|
|
|
addRecord(preparation, PreparationRecordTypeEnum.FLOW.getValue(), model.getRemark());
|