|
@@ -12,8 +12,11 @@ import com.sunxung.factoring.component.util.CodeUtil;
|
|
|
import com.sunxung.factoring.component.util.CollectionUtil;
|
|
|
import com.sunxung.factoring.component.util.ConstantConversionUtil;
|
|
|
import com.sunxung.factoring.component.util.ThreadLocalUtil;
|
|
|
+import com.sunxung.factoring.dict.impl.CashFlowOutTypeDict;
|
|
|
import com.sunxung.factoring.entity.GridPage;
|
|
|
import com.sunxung.factoring.entity.ResponseJson;
|
|
|
+import com.sunxung.factoring.entity.cashflowmanage.CashFlowManageBasicInfo;
|
|
|
+import com.sunxung.factoring.entity.cashflowmanage.CashFlowManageOutInfo;
|
|
|
import com.sunxung.factoring.entity.entprise.Enterprise;
|
|
|
import com.sunxung.factoring.entity.smb.FinancingPaymentInfo;
|
|
|
import com.sunxung.factoring.entity.smb.SmbRefinancingInfo;
|
|
@@ -22,6 +25,8 @@ import com.sunxung.factoring.entity.sys.Permission;
|
|
|
import com.sunxung.factoring.entity.sys.UserOrgRel;
|
|
|
import com.sunxung.factoring.entity.sys.UserRoleRel;
|
|
|
import com.sunxung.factoring.mapper.smb.FinancingPaymentInfoMapper;
|
|
|
+import com.sunxung.factoring.service.cashflowmanage.CashFlowManageBasicInfoService;
|
|
|
+import com.sunxung.factoring.service.cashflowmanage.CashFlowManageOutInfoService;
|
|
|
import com.sunxung.factoring.service.entprise.IEnterpriseService;
|
|
|
import com.sunxung.factoring.service.smb.IFinancingPaymentInfoService;
|
|
|
import com.sunxung.factoring.service.smbApi.api.SMBApiService;
|
|
@@ -41,7 +46,6 @@ import org.springframework.web.client.RestTemplate;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
-import java.util.UUID;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -75,6 +79,12 @@ public class FinancingPaymentInfoServiceImpl extends ServiceImpl<FinancingPaymen
|
|
|
@Autowired
|
|
|
private RestTemplate restTemplate;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CashFlowManageBasicInfoService cashFlowManageBasicInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CashFlowManageOutInfoService cashFlowManageOutInfoService;
|
|
|
+
|
|
|
@Override
|
|
|
public GridPage<FinancingPaymentInfo> findBySearch(FinancingPaymentInfoSearch search) {
|
|
|
Long currentUserId = ThreadLocalUtil.getUserId();
|
|
@@ -190,6 +200,25 @@ public class FinancingPaymentInfoServiceImpl extends ServiceImpl<FinancingPaymen
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void repayApplyAgainProcess() {
|
|
|
+ //获取所有类型为资方融资款 状态为处理中的现金流信息
|
|
|
+ List<CashFlowManageBasicInfo> cashFlowManageBasicInfoList = cashFlowManageBasicInfoService.lambdaQuery()
|
|
|
+ .eq(CashFlowManageBasicInfo::getCashType, CashFlowOutTypeDict.ChildEnum.MANAGEMENT_AMOUNT.getCode())
|
|
|
+ .eq(CashFlowManageBasicInfo::getCashStatus, 3).list();
|
|
|
+ if (CollectionUtil.isNotEmpty(cashFlowManageBasicInfoList)) {
|
|
|
+ for (CashFlowManageBasicInfo cashFlowManageBasicInfo : cashFlowManageBasicInfoList) {
|
|
|
+ //判断是否有出账记录
|
|
|
+ CashFlowManageOutInfo outInfo = cashFlowManageOutInfoService.lambdaQuery().eq(CashFlowManageOutInfo::getCashFlowManageBasicInfoId, cashFlowManageBasicInfo.getId()).one();
|
|
|
+ if (outInfo != null) {
|
|
|
+ //有出账记录说明OA已审批结束,重新发起还款申请
|
|
|
+ cashFlowManageBasicInfoService.repayApplyAgain(cashFlowManageBasicInfo.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 修改资方还款信息
|
|
|
*
|