|
@@ -51,6 +51,7 @@ import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.api.R;
|
|
|
|
|
+import org.springblade.core.tool.utils.CollectionUtil;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
import org.springblade.core.tool.utils.StringUtil;
|
|
import org.springblade.core.tool.utils.StringUtil;
|
|
|
|
|
|
|
@@ -228,6 +229,20 @@ public class ClaimServiceImpl extends ServiceImpl<ClaimMapper, Claim> implements
|
|
|
throw new SecurityException("开启审批失败:未查询到审批信息");
|
|
throw new SecurityException("开启审批失败:未查询到审批信息");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //获得明细
|
|
|
|
|
+ LambdaQueryWrapper<ClaimItem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ lambdaQueryWrapper.eq(ClaimItem::getTenantId, AuthUtil.getTenantId());
|
|
|
|
|
+ lambdaQueryWrapper.eq(ClaimItem::getIsDeleted, 0);
|
|
|
|
|
+ lambdaQueryWrapper.eq(ClaimItem::getPid, claim.getId());
|
|
|
|
|
+ List<ClaimItem> list = claimItemMapper.selectList(lambdaQueryWrapper);
|
|
|
|
|
+ if (CollectionUtil.isEmpty(list)){
|
|
|
|
|
+ throw new SecurityException("开启审批失败:单据明细不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ //明细总数量
|
|
|
|
|
+ BigDecimal quantity = list.stream().map(ClaimItem::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
+ //总金额
|
|
|
|
|
+ BigDecimal amount = list.stream().map(ClaimItem::getAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
+
|
|
|
AuditProecessDTO auditProecessDTO = new AuditProecessDTO();
|
|
AuditProecessDTO auditProecessDTO = new AuditProecessDTO();
|
|
|
// 绑定审核类型
|
|
// 绑定审核类型
|
|
|
auditProecessDTO.setCheckType(claim.getCheckType());
|
|
auditProecessDTO.setCheckType(claim.getCheckType());
|
|
@@ -244,6 +259,8 @@ public class ClaimServiceImpl extends ServiceImpl<ClaimMapper, Claim> implements
|
|
|
auditProecessDTO.setSendUserId(AuthUtil.getUserId());
|
|
auditProecessDTO.setSendUserId(AuthUtil.getUserId());
|
|
|
auditProecessDTO.setSendName(AuthUtil.getUserName());
|
|
auditProecessDTO.setSendName(AuthUtil.getUserName());
|
|
|
auditProecessDTO.setSendTime(new Date());
|
|
auditProecessDTO.setSendTime(new Date());
|
|
|
|
|
+ auditProecessDTO.setOrderQuantity(quantity);//数量
|
|
|
|
|
+ auditProecessDTO.setAmount(amount);//金额
|
|
|
R financeProcess = checkClient.createFinanceProcess(auditProecessDTO);
|
|
R financeProcess = checkClient.createFinanceProcess(auditProecessDTO);
|
|
|
if (!financeProcess.isSuccess()) {
|
|
if (!financeProcess.isSuccess()) {
|
|
|
throw new SecurityException("操作失败,请联系管理员");
|
|
throw new SecurityException("操作失败,请联系管理员");
|