|
@@ -59,6 +59,19 @@ public class OwnCreditController extends BaseController {
|
|
//产品服务类
|
|
//产品服务类
|
|
@Autowired
|
|
@Autowired
|
|
private IZcFinanceProductService productService;
|
|
private IZcFinanceProductService productService;
|
|
|
|
+ //收付款与发票关系表
|
|
|
|
+ @Autowired
|
|
|
|
+ private IZcBillInvoiceRelService billInvoiceRelService;
|
|
|
|
+ //发票服务
|
|
|
|
+ @Autowired
|
|
|
|
+ private IZcInvoiceInfService invoiceInfService;
|
|
|
|
+ //文件服务类
|
|
|
|
+ @Autowired
|
|
|
|
+ private IPubFileInfService fileInfService;
|
|
|
|
+ //收付款和文件的关系表服务类
|
|
|
|
+ @Autowired
|
|
|
|
+ private IZcBillFileRelService billFileRelService;
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -292,6 +305,11 @@ public class OwnCreditController extends BaseController {
|
|
}
|
|
}
|
|
//非供应商申请
|
|
//非供应商申请
|
|
if(!"0".equals(type)){
|
|
if(!"0".equals(type)){
|
|
|
|
+ //获取可用额度
|
|
|
|
+ String availableAmt = CommonUtil.objToString(map.get("availableAmt"));
|
|
|
|
+ if(CommonUtil.compare(zfiAmount,availableAmt) == 1){
|
|
|
|
+ throw new Exception("签发金额不可大于可用额度");
|
|
|
|
+ }
|
|
//承诺付款日
|
|
//承诺付款日
|
|
String zfiExpireDate = CommonUtil.objToString(map.get("zfiExpireDate"));
|
|
String zfiExpireDate = CommonUtil.objToString(map.get("zfiExpireDate"));
|
|
//签发有效期
|
|
//签发有效期
|
|
@@ -341,15 +359,10 @@ public class OwnCreditController extends BaseController {
|
|
|
|
|
|
}
|
|
}
|
|
}else if("0".equals(type) || "2".equals(type)){//供应商开立/申请
|
|
}else if("0".equals(type) || "2".equals(type)){//供应商开立/申请
|
|
- //获取可用额度
|
|
|
|
- String availableAmt = CommonUtil.objToString(map.get("availableAmt"));
|
|
|
|
//获取合计金额
|
|
//获取合计金额
|
|
String checkTotalAmt = CommonUtil.objToString(map.get("checkTotalAmt"));
|
|
String checkTotalAmt = CommonUtil.objToString(map.get("checkTotalAmt"));
|
|
//供应商开立
|
|
//供应商开立
|
|
if("2".equals(type)){
|
|
if("2".equals(type)){
|
|
- if(CommonUtil.compare(zfiAmount,availableAmt) == 1){
|
|
|
|
- throw new Exception("签发金额不可大于可用额度");
|
|
|
|
- }
|
|
|
|
//供应商企业授信额度
|
|
//供应商企业授信额度
|
|
String zfiSupplierQuotaId = CommonUtil.objToString(map.get("zfiSupplierQuotaId"));
|
|
String zfiSupplierQuotaId = CommonUtil.objToString(map.get("zfiSupplierQuotaId"));
|
|
inf.setZfiSupplierQuotaId(zfiSupplierQuotaId);
|
|
inf.setZfiSupplierQuotaId(zfiSupplierQuotaId);
|
|
@@ -362,17 +375,16 @@ public class OwnCreditController extends BaseController {
|
|
//核心授信额度
|
|
//核心授信额度
|
|
inf.setZfiCoreQuotaId(zfsqCoreQuotaId);
|
|
inf.setZfiCoreQuotaId(zfsqCoreQuotaId);
|
|
//获取收款账号
|
|
//获取收款账号
|
|
- String zfiCollectionAccount = CommonUtil.objToString(map.get("zfiCollectionAccount"));
|
|
|
|
|
|
+ /* String zfiCollectionAccount = CommonUtil.objToString(map.get("zfiCollectionAccount"));
|
|
//获取放款方式--供应商指定的话为收款账号必输
|
|
//获取放款方式--供应商指定的话为收款账号必输
|
|
if("1".equals(zfpcrLoanType)){
|
|
if("1".equals(zfpcrLoanType)){
|
|
if(CommonUtil.isEmpty(zfiCollectionAccount)){
|
|
if(CommonUtil.isEmpty(zfiCollectionAccount)){
|
|
throw new Exception("请输入收款账号");
|
|
throw new Exception("请输入收款账号");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //非电子
|
|
|
|
if(!"0".equals(zfpcrLoanType)){
|
|
if(!"0".equals(zfpcrLoanType)){
|
|
inf.setZfiCollectionAccount(zfiCollectionAccount);
|
|
inf.setZfiCollectionAccount(zfiCollectionAccount);
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
if(CommonUtil.compare(zfiAmount,checkTotalAmt) == 1){
|
|
if(CommonUtil.compare(zfiAmount,checkTotalAmt) == 1){
|
|
throw new Exception("签发金额不可大于合计金额");
|
|
throw new Exception("签发金额不可大于合计金额");
|
|
@@ -551,6 +563,11 @@ public class OwnCreditController extends BaseController {
|
|
}
|
|
}
|
|
//非供应商申请
|
|
//非供应商申请
|
|
if(!"0".equals(type)){
|
|
if(!"0".equals(type)){
|
|
|
|
+ //获取可用额度
|
|
|
|
+ String availableAmt = CommonUtil.objToString(map.get("availableAmt"));
|
|
|
|
+ if(CommonUtil.compare(zfiAmount,availableAmt) == 1){
|
|
|
|
+ throw new Exception("签发金额不可大于可用额度");
|
|
|
|
+ }
|
|
//承诺付款日
|
|
//承诺付款日
|
|
String zfiExpireDate = CommonUtil.objToString(map.get("zfiExpireDate"));
|
|
String zfiExpireDate = CommonUtil.objToString(map.get("zfiExpireDate"));
|
|
//签发有效期
|
|
//签发有效期
|
|
@@ -568,8 +585,6 @@ public class OwnCreditController extends BaseController {
|
|
inf.setZfiExpireDate(signDate);
|
|
inf.setZfiExpireDate(signDate);
|
|
}
|
|
}
|
|
|
|
|
|
- //融信状态
|
|
|
|
- inf.setZfiStatus("");
|
|
|
|
//创建人
|
|
//创建人
|
|
inf.setCreateBy(userId);
|
|
inf.setCreateBy(userId);
|
|
//创建时间
|
|
//创建时间
|
|
@@ -606,16 +621,17 @@ public class OwnCreditController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ // TODO 融信状态 后期根据有没有开启审批赋值
|
|
|
|
+ //待签收
|
|
|
|
+ inf.setZfiStatus("01");
|
|
}else if("0".equals(type) || "2".equals(type)){//供应商开立/申请
|
|
}else if("0".equals(type) || "2".equals(type)){//供应商开立/申请
|
|
- //获取可用额度
|
|
|
|
- String availableAmt = CommonUtil.objToString(map.get("availableAmt"));
|
|
|
|
|
|
+ // TODO 融信状态 后期根据有没有开启审批赋值
|
|
|
|
+ //待确权
|
|
|
|
+ inf.setZfiStatus("00");
|
|
//获取合计金额
|
|
//获取合计金额
|
|
String checkTotalAmt = CommonUtil.objToString(map.get("checkTotalAmt"));
|
|
String checkTotalAmt = CommonUtil.objToString(map.get("checkTotalAmt"));
|
|
//供应商开立
|
|
//供应商开立
|
|
if("2".equals(type)){
|
|
if("2".equals(type)){
|
|
- if(CommonUtil.compare(zfiAmount,availableAmt) == 1){
|
|
|
|
- throw new Exception("签发金额不可大于可用额度");
|
|
|
|
- }
|
|
|
|
//供应商企业授信额度
|
|
//供应商企业授信额度
|
|
String zfiSupplierQuotaId = CommonUtil.objToString(map.get("zfiSupplierQuotaId"));
|
|
String zfiSupplierQuotaId = CommonUtil.objToString(map.get("zfiSupplierQuotaId"));
|
|
inf.setZfiSupplierQuotaId(zfiSupplierQuotaId);
|
|
inf.setZfiSupplierQuotaId(zfiSupplierQuotaId);
|
|
@@ -628,17 +644,16 @@ public class OwnCreditController extends BaseController {
|
|
//核心授信额度
|
|
//核心授信额度
|
|
inf.setZfiCoreQuotaId(zfsqCoreQuotaId);
|
|
inf.setZfiCoreQuotaId(zfsqCoreQuotaId);
|
|
//获取收款账号
|
|
//获取收款账号
|
|
- String zfiCollectionAccount = CommonUtil.objToString(map.get("zfiCollectionAccount"));
|
|
|
|
|
|
+ /*String zfiCollectionAccount = CommonUtil.objToString(map.get("zfiCollectionAccount"));
|
|
//获取放款方式--供应商指定的话为收款账号必输
|
|
//获取放款方式--供应商指定的话为收款账号必输
|
|
if("1".equals(zfpcrLoanType)){
|
|
if("1".equals(zfpcrLoanType)){
|
|
if(CommonUtil.isEmpty(zfiCollectionAccount)){
|
|
if(CommonUtil.isEmpty(zfiCollectionAccount)){
|
|
throw new Exception("请输入收款账号");
|
|
throw new Exception("请输入收款账号");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //非电子
|
|
|
|
if(!"0".equals(zfpcrLoanType)){
|
|
if(!"0".equals(zfpcrLoanType)){
|
|
inf.setZfiCollectionAccount(zfiCollectionAccount);
|
|
inf.setZfiCollectionAccount(zfiCollectionAccount);
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
if(CommonUtil.compare(zfiAmount,checkTotalAmt) == 1){
|
|
if(CommonUtil.compare(zfiAmount,checkTotalAmt) == 1){
|
|
throw new Exception("签发金额不可大于合计金额");
|
|
throw new Exception("签发金额不可大于合计金额");
|
|
@@ -745,6 +760,8 @@ public class OwnCreditController extends BaseController {
|
|
@GetMapping("/getAccountsCollection")
|
|
@GetMapping("/getAccountsCollection")
|
|
public AjaxResult getAccountsCollection(@RequestParam(required=false) String zbiName,
|
|
public AjaxResult getAccountsCollection(@RequestParam(required=false) String zbiName,
|
|
@RequestParam(required=false) String payName,
|
|
@RequestParam(required=false) String payName,
|
|
|
|
+ @RequestParam(required=false) String payId,
|
|
|
|
+ @RequestParam(required=false) String zfiSupplierId,
|
|
QueryRequest request) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
|
|
QueryRequest request) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
|
|
//获取当前企业的编号
|
|
//获取当前企业的编号
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
@@ -760,12 +777,20 @@ public class OwnCreditController extends BaseController {
|
|
List<String> billIdList = CommonUtil.getIdFromList(relList,"zfbrBillId");
|
|
List<String> billIdList = CommonUtil.getIdFromList(relList,"zfbrBillId");
|
|
map.put("billIdList",CommonUtil.listToStr4InSql(billIdList));
|
|
map.put("billIdList",CommonUtil.listToStr4InSql(billIdList));
|
|
}
|
|
}
|
|
- //应收企业
|
|
|
|
- map.put("zbiPayeeId",companyId);
|
|
|
|
|
|
+ //接收方
|
|
|
|
+ if(!CommonUtil.isEmpty(zfiSupplierId)){
|
|
|
|
+ //应收企业
|
|
|
|
+ map.put("zbiPayeeId",zfiSupplierId);
|
|
|
|
+ }else{
|
|
|
|
+ //应收企业
|
|
|
|
+ map.put("zbiPayeeId",companyId);
|
|
|
|
+ }
|
|
//账款名称
|
|
//账款名称
|
|
map.put("zbiName",zbiName);
|
|
map.put("zbiName",zbiName);
|
|
//应付企业
|
|
//应付企业
|
|
map.put("payName",payName);
|
|
map.put("payName",payName);
|
|
|
|
+ //应付企业编号
|
|
|
|
+ map.put("payId",payId);
|
|
IPage<Map> collectionList = ownCreditService.getAccountsCollection(map,request);
|
|
IPage<Map> collectionList = ownCreditService.getAccountsCollection(map,request);
|
|
return AjaxResult.success(collectionList);
|
|
return AjaxResult.success(collectionList);
|
|
}
|
|
}
|
|
@@ -847,6 +872,100 @@ public class OwnCreditController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取收付款下的附件信息
|
|
|
|
+ * @param m
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/getFile")
|
|
|
|
+ public AjaxResult getFile(@RequestBody Map<String, Object> m) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
|
|
|
|
+
|
|
|
|
+ //发票文件
|
|
|
|
+ List<PubFileInf> invoiceFileList = new ArrayList<>();
|
|
|
|
+ //收付款的合同类型的文件
|
|
|
|
+ List<PubFileInf> contractFileList = new ArrayList<>();
|
|
|
|
+ //收付款的其他文件
|
|
|
|
+ List<PubFileInf> otherFileList = new ArrayList<>();
|
|
|
|
+ Map map = new HashMap();
|
|
|
|
+ //获取传过来的收付款信息
|
|
|
|
+ List<Map<String,String>> ticketList = (List<Map<String, String>>) m.get("ticketList");
|
|
|
|
+ if (ticketList.size() < 1){
|
|
|
|
+ //发票
|
|
|
|
+ map.put("invoiceFileList",invoiceFileList);
|
|
|
|
+ //合同
|
|
|
|
+ map.put("contractFileList",contractFileList);
|
|
|
|
+ //其他类型
|
|
|
|
+ map.put("otherFileList",otherFileList);
|
|
|
|
+ return AjaxResult.success(map);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //提取收付款编号
|
|
|
|
+ List<String> zbiIdList = CommonUtil.getIdFromList(ticketList,"zbiId");
|
|
|
|
+
|
|
|
|
+ //发票与收付款相关
|
|
|
|
+ LambdaQueryWrapper<ZcBillInvoiceRel> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ lambdaQueryWrapper.in(ZcBillInvoiceRel::getZbirBillId,zbiIdList);
|
|
|
|
+ List<ZcBillInvoiceRel> relList = billInvoiceRelService.findZcBillInvoiceRels(lambdaQueryWrapper);
|
|
|
|
+ //有关联的发票
|
|
|
|
+ if(relList.size() > 0 ){
|
|
|
|
+ List<String> invoiceIdList = CommonUtil.getIdFromList(relList,"zbirInvoiceId");
|
|
|
|
+ //查询发票
|
|
|
|
+ LambdaQueryWrapper<ZcInvoiceInf> invoiceInfLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ invoiceInfLambdaQueryWrapper.in(ZcInvoiceInf::getZiiId,invoiceIdList);
|
|
|
|
+ invoiceInfLambdaQueryWrapper.eq(ZcInvoiceInf::getZiiStatus,"00");
|
|
|
|
+ List<ZcInvoiceInf> invoiceInfList = invoiceInfService.findZcInvoiceInfs(invoiceInfLambdaQueryWrapper);
|
|
|
|
+ //发票信息不为空
|
|
|
|
+ if(invoiceInfList.size() > 0){
|
|
|
|
+ //提取出文件信息
|
|
|
|
+ List<String> fileIdList = CommonUtil.getIdFromList(invoiceInfList,"ziiFile");
|
|
|
|
+ LambdaQueryWrapper<PubFileInf> fileInfLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ fileInfLambdaQueryWrapper.in(PubFileInf::getPfiFileId,fileIdList);
|
|
|
|
+ fileInfLambdaQueryWrapper.eq(PubFileInf::getPfiIsDel,"00");
|
|
|
|
+ //查询文件
|
|
|
|
+ invoiceFileList = fileInfService.findPubFileInfs(fileInfLambdaQueryWrapper);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ map.put("invoiceFileList",invoiceFileList);
|
|
|
|
+
|
|
|
|
+ //查询文件关系表
|
|
|
|
+ LambdaQueryWrapper<ZcBillFileRel> billFileRelLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ billFileRelLambdaQueryWrapper.in(ZcBillFileRel::getZbfrBillId,zbiIdList);
|
|
|
|
+ billFileRelLambdaQueryWrapper.eq(ZcBillFileRel::getZbfrType,"0");
|
|
|
|
+ List<ZcBillFileRel> billFileRelList = billFileRelService.findZcBillFileRels(billFileRelLambdaQueryWrapper);
|
|
|
|
+ //不为空
|
|
|
|
+ if(billFileRelList.size() > 0){
|
|
|
|
+ //提取文件编号
|
|
|
|
+ List<String> idList = CommonUtil.getIdFromList(billFileRelList,"zbfrFileId");
|
|
|
|
+ LambdaQueryWrapper<PubFileInf> fileInfLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ fileInfLambdaQueryWrapper.in(PubFileInf::getPfiFileId,idList);
|
|
|
|
+ fileInfLambdaQueryWrapper.eq(PubFileInf::getPfiIsDel,"00");
|
|
|
|
+ contractFileList = fileInfService.findPubFileInfs(fileInfLambdaQueryWrapper);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ map.put("contractFileList",contractFileList);
|
|
|
|
+
|
|
|
|
+ //查询文件关系表
|
|
|
|
+ LambdaQueryWrapper<ZcBillFileRel> fileRelLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ fileRelLambdaQueryWrapper.in(ZcBillFileRel::getZbfrBillId,zbiIdList);
|
|
|
|
+ fileRelLambdaQueryWrapper.eq(ZcBillFileRel::getZbfrType,"2");
|
|
|
|
+ List<ZcBillFileRel> relFileList = billFileRelService.findZcBillFileRels(fileRelLambdaQueryWrapper);
|
|
|
|
+ //不为空
|
|
|
|
+ if(relFileList.size() > 0){
|
|
|
|
+ //提取文件编号
|
|
|
|
+ List<String> idList = CommonUtil.getIdFromList(relFileList,"zbfrFileId");
|
|
|
|
+ LambdaQueryWrapper<PubFileInf> fileInfLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ fileInfLambdaQueryWrapper.in(PubFileInf::getPfiFileId,idList);
|
|
|
|
+ fileInfLambdaQueryWrapper.eq(PubFileInf::getPfiIsDel,"00");
|
|
|
|
+ otherFileList = fileInfService.findPubFileInfs(fileInfLambdaQueryWrapper);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ map.put("otherFileList",otherFileList);
|
|
|
|
+ return AjaxResult.success(map);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|