|
|
|
|
@ -59,7 +59,7 @@ public class CrmGiftApplyServiceImpl implements ICrmGiftApplyService {
|
|
|
|
|
private final CrmGiftInfoMapper giftInfoMapper;
|
|
|
|
|
|
|
|
|
|
/** 礼品申请编码规则 */
|
|
|
|
|
private static final String GIFT_APPLY_CODE_RULE = "1019";
|
|
|
|
|
private static final String GIFT_APPLY_CODE_RULE = "1020";
|
|
|
|
|
|
|
|
|
|
@DubboReference(timeout = 30000)
|
|
|
|
|
private RemoteWorkflowService remoteWorkflowService;
|
|
|
|
|
@ -154,6 +154,14 @@ public class CrmGiftApplyServiceImpl implements ICrmGiftApplyService {
|
|
|
|
|
if (StringUtils.isBlank(add.getApplicationCode())) {
|
|
|
|
|
add.setApplicationCode(remoteCodeRuleService.selectCodeRuleCode(GIFT_APPLY_CODE_RULE));
|
|
|
|
|
}
|
|
|
|
|
// 补齐申请部门名称(有些前端浏览器可能未带出)
|
|
|
|
|
if (StringUtils.isBlank(add.getApplicantDeptName())) {
|
|
|
|
|
try {
|
|
|
|
|
add.setApplicantDeptName(LoginHelper.getLoginUser().getDeptName());
|
|
|
|
|
} catch (Exception ignored) {
|
|
|
|
|
// 保底:前端未传且无法获取则保持空,避免提交失败
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 新增时设置默认状态为草稿
|
|
|
|
|
if (StringUtils.isBlank(add.getApplicationStatus())) {
|
|
|
|
|
add.setApplicationStatus(OAStatusEnum.DRAFT.getStatus());
|
|
|
|
|
@ -620,7 +628,8 @@ public class CrmGiftApplyServiceImpl implements ICrmGiftApplyService {
|
|
|
|
|
try {
|
|
|
|
|
record.setIssueDeptName(LoginHelper.getLoginUser().getDeptName());
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
// 获取失败时忽略
|
|
|
|
|
// 获取失败时使用部门ID字符串兜底
|
|
|
|
|
record.setIssueDeptName(Convert.toStr(LoginHelper.getDeptId()));
|
|
|
|
|
}
|
|
|
|
|
record.setBeforeInventory(currentInventory);
|
|
|
|
|
record.setAfterInventory(currentInventory - detail.getApplicationQuantity());
|
|
|
|
|
|