|
@@ -22,6 +22,7 @@ import com.fjhx.purchase.service.pay.PayService;
|
|
|
import com.fjhx.purchase.service.purchase.PurchaseService;
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -102,50 +103,50 @@ public class PayFlow extends FlowDelegate {
|
|
|
if (ObjectUtils.isEmpty(pay)) {
|
|
|
throw new ServiceException("采购付款单不存在");
|
|
|
}
|
|
|
-
|
|
|
// 修改采购状态为审批通过
|
|
|
pay.setStatus(PayStatusEnum.PASS.getKey());
|
|
|
pay.setApprovedDate(new Date());
|
|
|
payService.updateById(pay);
|
|
|
- // 添加一条付款流水
|
|
|
- AccountPayment payment = new AccountPayment();
|
|
|
- payment.setAccountManagementId(pay.getAccountManagementId());
|
|
|
- payment.setBusinessId(pay.getId());
|
|
|
- payment.setCurrency(pay.getCurrency());
|
|
|
-
|
|
|
- DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
|
- SysUser sysUser = userService.getOne(IWrapper.<SysUser>getWrapper().eq(SysUser::getUserId, pay.getCreateUser()));
|
|
|
- DynamicDataSourceContextHolder.poll();
|
|
|
- if (ObjectUtils.isNotEmpty(sysUser)) {
|
|
|
- payment.setDepartmentId(sysUser.getDeptId());
|
|
|
+ if(!StringUtils.equals(pay.getPayType(),"3")){
|
|
|
+
|
|
|
+ // 添加一条付款流水
|
|
|
+ AccountPayment payment = new AccountPayment();
|
|
|
+ payment.setAccountManagementId(pay.getAccountManagementId());
|
|
|
+ payment.setBusinessId(pay.getId());
|
|
|
+ payment.setCurrency(pay.getCurrency());
|
|
|
+
|
|
|
+ DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
|
+ SysUser sysUser = userService.getOne(IWrapper.<SysUser>getWrapper().eq(SysUser::getUserId, pay.getCreateUser()));
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
+ if (ObjectUtils.isNotEmpty(sysUser)) {
|
|
|
+ payment.setDepartmentId(sysUser.getDeptId());
|
|
|
+ }
|
|
|
+ // todo 暂时写死人民币
|
|
|
+ payment.setPaymentRemark(pay.getRemark());
|
|
|
+ payment.setType(PaymentTypeEnum.REJECT.getKey());
|
|
|
+ payment.setStatus(PaymentStatusEnum.UNDER_REVIEW.getKey());
|
|
|
+ payment.setCorporationId(pay.getCorporationId());
|
|
|
+ payment.setAmount(pay.getAmount());
|
|
|
+ payment.setIncomeAmount(pay.getAmount());
|
|
|
+ payment.setName(pay.getName());
|
|
|
+ payment.setDataUser(pay.getCreateUser());
|
|
|
+ payment.setBusinessManagementId(pay.getAccountManagementId());
|
|
|
+ payment.setOpeningBank(pay.getOpeningBank());
|
|
|
+ payment.setBusinessCurrency(pay.getCurrency());
|
|
|
+ payment.setAccountOpening(pay.getAccountOpening());
|
|
|
+ payment.setInterbankNumber(pay.getInterbankNumber());
|
|
|
+ payment.setPaymentMethod(pay.getPayType());
|
|
|
+ payment.setApplyForTime(pay.getCreateTime());//申请时间
|
|
|
+ accountPaymentService.save(payment);
|
|
|
}
|
|
|
- // todo 暂时写死人民币
|
|
|
- payment.setPaymentRemark(pay.getRemark());
|
|
|
- payment.setType(PaymentTypeEnum.REJECT.getKey());
|
|
|
- payment.setStatus(PaymentStatusEnum.UNDER_REVIEW.getKey());
|
|
|
- payment.setCorporationId(pay.getCorporationId());
|
|
|
- payment.setAmount(pay.getAmount());
|
|
|
- payment.setIncomeAmount(pay.getAmount());
|
|
|
- payment.setName(pay.getName());
|
|
|
- payment.setDataUser(pay.getCreateUser());
|
|
|
- payment.setBusinessManagementId(pay.getAccountManagementId());
|
|
|
- payment.setOpeningBank(pay.getOpeningBank());
|
|
|
- payment.setBusinessCurrency(pay.getCurrency());
|
|
|
- payment.setAccountOpening(pay.getAccountOpening());
|
|
|
- payment.setInterbankNumber(pay.getInterbankNumber());
|
|
|
- payment.setPaymentMethod(pay.getPayType());
|
|
|
- payment.setApplyForTime(pay.getCreateTime());//申请时间
|
|
|
- accountPaymentService.save(payment);
|
|
|
-
|
|
|
// 修改合同付款状态
|
|
|
updatePurchasePayStatus(businessId);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void defaultMethod(Long flowId, Long businessId, FlowStatusEnum flowStatusEnum, JSONObject submitData) {
|
|
|
-
|
|
|
- }
|
|
|
+// @Override
|
|
|
+// public void defaultMethod(Long flowId, Long businessId, FlowStatusEnum flowStatusEnum, JSONObject submitData) {
|
|
|
+//
|
|
|
+// }
|
|
|
|
|
|
|
|
|
/**
|