|
@@ -59,7 +59,7 @@ public class ReportCreditController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@GetMapping("/getCreditLineAll")
|
|
@GetMapping("/getCreditLineAll")
|
|
- public AjaxResult getCreditLineAll()
|
|
|
|
|
|
+ public AjaxResult getCreditLineAll(String zfpType)
|
|
{
|
|
{
|
|
//获取当前企业的编号
|
|
//获取当前企业的编号
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
@@ -69,6 +69,10 @@ public class ReportCreditController extends BaseController {
|
|
String companyId = use.getCompanyId();
|
|
String companyId = use.getCompanyId();
|
|
//获取企业类型
|
|
//获取企业类型
|
|
String type = use.getCompanyType();
|
|
String type = use.getCompanyType();
|
|
|
|
+ //默认反向
|
|
|
|
+ if(CommonUtil.isEmpty(zfpType)){
|
|
|
|
+ zfpType = "1";
|
|
|
|
+ }
|
|
//融信额度
|
|
//融信额度
|
|
String allAmount = "0";
|
|
String allAmount = "0";
|
|
if(COMPANYTYPE_TERRACE.equals(type)){
|
|
if(COMPANYTYPE_TERRACE.equals(type)){
|
|
@@ -77,9 +81,11 @@ public class ReportCreditController extends BaseController {
|
|
}else if(COMPANYTYPE_CORE.equals(type)){
|
|
}else if(COMPANYTYPE_CORE.equals(type)){
|
|
//核心企业
|
|
//核心企业
|
|
map.put("coreCompanyId", companyId);
|
|
map.put("coreCompanyId", companyId);
|
|
|
|
+ map.put("zfpType", zfpType);
|
|
allAmount = reportCreditService.getCreditLineAll(map);
|
|
allAmount = reportCreditService.getCreditLineAll(map);
|
|
}else if(COMPANYTYPE_SUPPLIER.equals(type)){
|
|
}else if(COMPANYTYPE_SUPPLIER.equals(type)){
|
|
//供应商
|
|
//供应商
|
|
|
|
+ map.put("zfpType", zfpType);
|
|
map.put("supplierCompanyId", companyId);
|
|
map.put("supplierCompanyId", companyId);
|
|
allAmount = reportCreditService.getSupplierCreditLineAll(map);
|
|
allAmount = reportCreditService.getSupplierCreditLineAll(map);
|
|
}else if(COMPANYTYPE_MANAGEMENT.equals(type)){
|
|
}else if(COMPANYTYPE_MANAGEMENT.equals(type)){
|
|
@@ -97,7 +103,7 @@ public class ReportCreditController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@GetMapping("/getAvailableBalance")
|
|
@GetMapping("/getAvailableBalance")
|
|
- public AjaxResult getAvailableBalance()
|
|
|
|
|
|
+ public AjaxResult getAvailableBalance(String zfpType)
|
|
{
|
|
{
|
|
//获取当前企业的编号
|
|
//获取当前企业的编号
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
@@ -105,6 +111,11 @@ public class ReportCreditController extends BaseController {
|
|
Map<String,String> map = new HashMap<>();
|
|
Map<String,String> map = new HashMap<>();
|
|
//获取企业
|
|
//获取企业
|
|
String companyId = use.getCompanyId();
|
|
String companyId = use.getCompanyId();
|
|
|
|
+ //默认反向
|
|
|
|
+ if(CommonUtil.isEmpty(zfpType)){
|
|
|
|
+ zfpType = "1";
|
|
|
|
+ }
|
|
|
|
+ map.put("zfpType", zfpType);
|
|
//获取企业类型
|
|
//获取企业类型
|
|
String type = use.getCompanyType();
|
|
String type = use.getCompanyType();
|
|
if(COMPANYTYPE_CORE.equals(type)){
|
|
if(COMPANYTYPE_CORE.equals(type)){
|
|
@@ -124,6 +135,228 @@ public class ReportCreditController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 企业生效中额度
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getEffectBalance")
|
|
|
|
+ public AjaxResult getEffectBalance(String zfpType)
|
|
|
|
+ {
|
|
|
|
+ //获取当前企业的编号
|
|
|
|
+ LoginUser userInfo = tokenService.getLoginUser();
|
|
|
|
+ SysUser use = userInfo.getSysUser();
|
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
|
+ //获取企业
|
|
|
|
+ String companyId = use.getCompanyId();
|
|
|
|
+ //默认反向
|
|
|
|
+ if(CommonUtil.isEmpty(zfpType)){
|
|
|
|
+ zfpType = "1";
|
|
|
|
+ }
|
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
|
+ //获取企业类型
|
|
|
|
+ String type = use.getCompanyType();
|
|
|
|
+ if(COMPANYTYPE_CORE.equals(type)){
|
|
|
|
+ //核心企业
|
|
|
|
+ map.put("coreCompanyId", companyId);
|
|
|
|
+ }else if(COMPANYTYPE_SUPPLIER.equals(type)){
|
|
|
|
+ //供应商
|
|
|
|
+ map.put("supplierCompanyId", companyId);
|
|
|
|
+ }else if(COMPANYTYPE_MANAGEMENT.equals(type)){
|
|
|
|
+ //资金方
|
|
|
|
+ map.put("managementCompanyId", companyId);
|
|
|
|
+ }
|
|
|
|
+ String allAmount = reportCreditService.getEffectBalance(map);
|
|
|
|
+ Map m = new HashMap();
|
|
|
|
+ m.put("allAmount",allAmount);
|
|
|
|
+ return AjaxResult.success(m);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 企业已放款额度
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getLoanBalance")
|
|
|
|
+ public AjaxResult getLoanBalance(String zfpType)
|
|
|
|
+ {
|
|
|
|
+ //获取当前企业的编号
|
|
|
|
+ LoginUser userInfo = tokenService.getLoginUser();
|
|
|
|
+ SysUser use = userInfo.getSysUser();
|
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
|
+ //获取企业
|
|
|
|
+ String companyId = use.getCompanyId();
|
|
|
|
+ //默认反向
|
|
|
|
+ if(CommonUtil.isEmpty(zfpType)){
|
|
|
|
+ zfpType = "1";
|
|
|
|
+ }
|
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
|
+ //获取企业类型
|
|
|
|
+ String type = use.getCompanyType();
|
|
|
|
+ if(COMPANYTYPE_CORE.equals(type)){
|
|
|
|
+ //核心企业
|
|
|
|
+ map.put("coreCompanyId", companyId);
|
|
|
|
+ }else if(COMPANYTYPE_SUPPLIER.equals(type)){
|
|
|
|
+ //供应商
|
|
|
|
+ map.put("supplierCompanyId", companyId);
|
|
|
|
+ }else if(COMPANYTYPE_MANAGEMENT.equals(type)){
|
|
|
|
+ //资金方
|
|
|
|
+ map.put("managementCompanyId", companyId);
|
|
|
|
+ }
|
|
|
|
+ String allAmount = reportCreditService.getLoanBalance(map);
|
|
|
|
+ Map m = new HashMap();
|
|
|
|
+ m.put("allAmount",allAmount);
|
|
|
|
+ return AjaxResult.success(m);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 企业已还款额度
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getReturnBalance")
|
|
|
|
+ public AjaxResult getReturnBalance(String zfpType)
|
|
|
|
+ {
|
|
|
|
+ //获取当前企业的编号
|
|
|
|
+ LoginUser userInfo = tokenService.getLoginUser();
|
|
|
|
+ SysUser use = userInfo.getSysUser();
|
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
|
+ //获取企业
|
|
|
|
+ String companyId = use.getCompanyId();
|
|
|
|
+ //默认反向
|
|
|
|
+ if(CommonUtil.isEmpty(zfpType)){
|
|
|
|
+ zfpType = "1";
|
|
|
|
+ }
|
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
|
+ //获取企业类型
|
|
|
|
+ String type = use.getCompanyType();
|
|
|
|
+ if(COMPANYTYPE_CORE.equals(type)){
|
|
|
|
+ //核心企业
|
|
|
|
+ map.put("coreCompanyId", companyId);
|
|
|
|
+ }else if(COMPANYTYPE_SUPPLIER.equals(type)){
|
|
|
|
+ //供应商
|
|
|
|
+ map.put("supplierCompanyId", companyId);
|
|
|
|
+ }else if(COMPANYTYPE_MANAGEMENT.equals(type)){
|
|
|
|
+ //资金方
|
|
|
|
+ map.put("managementCompanyId", companyId);
|
|
|
|
+ }
|
|
|
|
+ String allAmount = reportCreditService.getReturnBalance(map);
|
|
|
|
+ Map m = new HashMap();
|
|
|
|
+ m.put("allAmount",allAmount);
|
|
|
|
+ return AjaxResult.success(m);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询平台资金 -- 饼图
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getFinanceAmount")
|
|
|
|
+ public AjaxResult getFinanceAmount()
|
|
|
|
+ {
|
|
|
|
+ //获取当前企业的编号
|
|
|
|
+ LoginUser userInfo = tokenService.getLoginUser();
|
|
|
|
+ SysUser use = userInfo.getSysUser();
|
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
|
+ //获取企业
|
|
|
|
+ String companyId = use.getCompanyId();
|
|
|
|
+ //获取企业类型
|
|
|
|
+ String type = use.getCompanyType();
|
|
|
|
+ if(COMPANYTYPE_CORE.equals(type)){
|
|
|
|
+ //核心企业
|
|
|
|
+ map.put("coreCompanyId", companyId);
|
|
|
|
+ }
|
|
|
|
+ //融信总额度
|
|
|
|
+ String allAmount = reportCreditService.getCreditLineAll(map);
|
|
|
|
+ //融资中额度
|
|
|
|
+ String availableAmount = reportCreditService.getAvailableBalance(map);
|
|
|
|
+ //生效中额度
|
|
|
|
+ String effectBalance = reportCreditService.getEffectBalance(map);
|
|
|
|
+ //已放款额度
|
|
|
|
+ String loanBalance = reportCreditService.getLoanBalance(map);
|
|
|
|
+ //可用融信
|
|
|
|
+ String subAmount = AmtUtil.subtract(allAmount,AmtUtil.add(AmtUtil.add(availableAmount,effectBalance),loanBalance));
|
|
|
|
+ //返回图形数组
|
|
|
|
+ List list = new ArrayList();
|
|
|
|
+ //融资中额度图形对象
|
|
|
|
+ Map availableMap = new HashMap();
|
|
|
|
+ availableMap.put("name","融资中额度");
|
|
|
|
+ availableMap.put("value",availableAmount);
|
|
|
|
+ list.add(availableMap);
|
|
|
|
+ //生效中额度图形对象
|
|
|
|
+ Map effectMap = new HashMap();
|
|
|
|
+ effectMap.put("name","生效中额度");
|
|
|
|
+ effectMap.put("value",effectBalance);
|
|
|
|
+ list.add(effectMap);
|
|
|
|
+ //已放款额度图形对象
|
|
|
|
+ Map loanMap = new HashMap();
|
|
|
|
+ loanMap.put("name","已放款额度");
|
|
|
|
+ loanMap.put("value",loanBalance);
|
|
|
|
+ list.add(loanMap);
|
|
|
|
+ //可用额度图形对象
|
|
|
|
+ Map subMap = new HashMap();
|
|
|
|
+ subMap.put("name","剩余额度");
|
|
|
|
+ subMap.put("value",subAmount);
|
|
|
|
+ list.add(subMap);
|
|
|
|
+ return AjaxResult.success(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 核心企业额度比例 -- 柱状图
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getFinanceAmountAll")
|
|
|
|
+ public AjaxResult getFinanceAmountAll(QueryRequest request)
|
|
|
|
+ {
|
|
|
|
+ //获取当前企业的编号
|
|
|
|
+ LoginUser userInfo = tokenService.getLoginUser();
|
|
|
|
+ SysUser use = userInfo.getSysUser();
|
|
|
|
+ Map map = new HashMap<>();
|
|
|
|
+ //融信总额度
|
|
|
|
+ IPage<Map> list = reportCreditService.getFinanceAmountAll(map,request);
|
|
|
|
+ //企业集合
|
|
|
|
+ List<String> dateList = new ArrayList<>();
|
|
|
|
+ //已用额度
|
|
|
|
+ List<String> data = new ArrayList<>();
|
|
|
|
+ //可用额度
|
|
|
|
+ List<String> subData = new ArrayList<>();
|
|
|
|
+ for (Map dataMap : list.getRecords()) {
|
|
|
|
+ //总额度
|
|
|
|
+ String allAmount = dataMap.get("allAmount").toString();
|
|
|
|
+ //企业名称
|
|
|
|
+ String coreCompanyName = dataMap.get("coreCompanyName").toString();
|
|
|
|
+ //企业id
|
|
|
|
+ String coreCompanyId = dataMap.get("coreCompanyId").toString();
|
|
|
|
+ //核心企业
|
|
|
|
+ map.put("coreCompanyId", coreCompanyId);
|
|
|
|
+ //融资中额度
|
|
|
|
+ String availableAmount = reportCreditService.getAvailableBalance(map);
|
|
|
|
+ //生效中额度
|
|
|
|
+ String effectBalance = reportCreditService.getEffectBalance(map);
|
|
|
|
+ //已放款额度
|
|
|
|
+ String loanBalance = reportCreditService.getLoanBalance(map);
|
|
|
|
+ //已用额度
|
|
|
|
+ String addAmount = AmtUtil.add(AmtUtil.add(availableAmount,effectBalance),loanBalance);
|
|
|
|
+ //可用融信
|
|
|
|
+ String subAmount = AmtUtil.subtract(allAmount,addAmount);
|
|
|
|
+ dateList.add(coreCompanyName);
|
|
|
|
+ data.add(addAmount);
|
|
|
|
+ subData.add(subAmount);
|
|
|
|
+ }
|
|
|
|
+ //数据集合
|
|
|
|
+ List<Map> dataList = new ArrayList<>();
|
|
|
|
+ //开立额度数据对象
|
|
|
|
+ Map addMap = new HashMap();
|
|
|
|
+ addMap.put("name","已用额度");
|
|
|
|
+ addMap.put("data",data);
|
|
|
|
+ dataList.add(addMap);
|
|
|
|
+ //开立额度数据对象
|
|
|
|
+ Map subMap = new HashMap();
|
|
|
|
+ subMap.put("name","可用额度");
|
|
|
|
+ subMap.put("data",subData);
|
|
|
|
+ dataList.add(subMap);
|
|
|
|
+ Map result = new HashMap();
|
|
|
|
+ result.put("dataList",dataList);
|
|
|
|
+ result.put("dateList",dateList);
|
|
|
|
+ return AjaxResult.success(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 企业已融资额度
|
|
* 企业已融资额度
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -213,10 +446,6 @@ public class ReportCreditController extends BaseController {
|
|
String companyId = use.getCompanyId();
|
|
String companyId = use.getCompanyId();
|
|
//获取企业类型
|
|
//获取企业类型
|
|
String type = use.getCompanyType();
|
|
String type = use.getCompanyType();
|
|
-// //融信额度
|
|
|
|
-// String allAmount = "0";
|
|
|
|
-// //已用融信
|
|
|
|
-// String availableAmount = "0";
|
|
|
|
if(COMPANYTYPE_CORE.equals(type)){
|
|
if(COMPANYTYPE_CORE.equals(type)){
|
|
//核心企业
|
|
//核心企业
|
|
map.put("coreCompanyId", companyId);
|
|
map.put("coreCompanyId", companyId);
|
|
@@ -271,7 +500,7 @@ public class ReportCreditController extends BaseController {
|
|
Map availableMap = new HashMap();
|
|
Map availableMap = new HashMap();
|
|
map.put("managementCompanyId", managementCompanyId);
|
|
map.put("managementCompanyId", managementCompanyId);
|
|
//总额度
|
|
//总额度
|
|
- String allAmount = reportCreditService.getCreditLineGroup(map);
|
|
|
|
|
|
+ String allAmount = reportCreditService.getCreditLineAll(map);
|
|
map1.put("allAmount",allAmount);
|
|
map1.put("allAmount",allAmount);
|
|
//可用融信
|
|
//可用融信
|
|
String subAmount = AmtUtil.subtract(allAmount,availableAmount);
|
|
String subAmount = AmtUtil.subtract(allAmount,availableAmount);
|
|
@@ -331,7 +560,7 @@ public class ReportCreditController extends BaseController {
|
|
//核心企业
|
|
//核心企业
|
|
map.put("coreCompanyId", companyId);
|
|
map.put("coreCompanyId", companyId);
|
|
}
|
|
}
|
|
- map.put("date",date);
|
|
|
|
|
|
+ map.put("month",date);
|
|
//报销所含项目
|
|
//报销所含项目
|
|
String amt = reportCreditService.financeRecordMonth(map);
|
|
String amt = reportCreditService.financeRecordMonth(map);
|
|
data.add(amt);
|
|
data.add(amt);
|
|
@@ -350,7 +579,7 @@ public class ReportCreditController extends BaseController {
|
|
//核心企业
|
|
//核心企业
|
|
map.put("coreCompanyId", companyId);
|
|
map.put("coreCompanyId", companyId);
|
|
}
|
|
}
|
|
- map.put("returnDate",date);
|
|
|
|
|
|
+ map.put("month",date);
|
|
map.put("applyStatus","01");
|
|
map.put("applyStatus","01");
|
|
//报销所含项目
|
|
//报销所含项目
|
|
String amt = reportCreditService.financeRecordMonth(map);
|
|
String amt = reportCreditService.financeRecordMonth(map);
|
|
@@ -422,25 +651,6 @@ public class ReportCreditController extends BaseController {
|
|
returnDataMap.put("name","还款额度");
|
|
returnDataMap.put("name","还款额度");
|
|
returnDataMap.put("data",returnData);
|
|
returnDataMap.put("data",returnData);
|
|
dataList.add(returnDataMap);
|
|
dataList.add(returnDataMap);
|
|
- //未开立额度
|
|
|
|
- List<String> closeData = new ArrayList<>();
|
|
|
|
- for (String date : dateList) {
|
|
|
|
- Map map = new HashMap();
|
|
|
|
- if(COMPANYTYPE_CORE.equals(type)){
|
|
|
|
- //核心企业
|
|
|
|
- map.put("coreCompanyId", companyId);
|
|
|
|
- }
|
|
|
|
- map.put("returnDate",date);
|
|
|
|
- map.put("status","00");
|
|
|
|
- //报销所含项目
|
|
|
|
- String amt = reportCreditService.financeRecordMonth(map);
|
|
|
|
- closeData.add(amt);
|
|
|
|
- }
|
|
|
|
- //未开立额度数据对象
|
|
|
|
- Map closeDataMap = new HashMap();
|
|
|
|
- closeDataMap.put("name","未开立额度");
|
|
|
|
- closeDataMap.put("data",closeData);
|
|
|
|
- dataList.add(closeDataMap);
|
|
|
|
Map result = new HashMap();
|
|
Map result = new HashMap();
|
|
result.put("dataList",dataList);
|
|
result.put("dataList",dataList);
|
|
result.put("dateList",dateList);
|
|
result.put("dateList",dateList);
|
|
@@ -490,9 +700,4 @@ public class ReportCreditController extends BaseController {
|
|
}
|
|
}
|
|
return daysStrList;
|
|
return daysStrList;
|
|
}
|
|
}
|
|
-
|
|
|
|
- public static void main(String[] args) {
|
|
|
|
-
|
|
|
|
- System.out.println(findDaysStr(DateUtils.getPastDate(30),DateUtils.dateTimeNow("yyyy-MM-dd")));
|
|
|
|
- }
|
|
|
|
}
|
|
}
|