|
@@ -55,6 +55,16 @@ public class ReportCreditController extends BaseController {
|
|
|
private static String COMPANYTYPE_MANAGEMENT = "03";
|
|
|
|
|
|
/**
|
|
|
+ * 时间维度类型 00周
|
|
|
+ */
|
|
|
+ private static String DATE_WEEK = "00";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 时间维度类型 01年
|
|
|
+ */
|
|
|
+ private static String DATE_YEAR = "01";
|
|
|
+
|
|
|
+ /**
|
|
|
* 查询企业持有融信额度
|
|
|
* @return
|
|
|
*/
|
|
@@ -115,18 +125,20 @@ public class ReportCreditController extends BaseController {
|
|
|
if(CommonUtil.isEmpty(zfpType)){
|
|
|
zfpType = "1";
|
|
|
}
|
|
|
- map.put("zfpType", zfpType);
|
|
|
//获取企业类型
|
|
|
String type = use.getCompanyType();
|
|
|
if(COMPANYTYPE_CORE.equals(type)){
|
|
|
//核心企业
|
|
|
map.put("coreCompanyId", companyId);
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
}else if(COMPANYTYPE_SUPPLIER.equals(type)){
|
|
|
//供应商
|
|
|
map.put("supplierCompanyId", companyId);
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
}else if(COMPANYTYPE_MANAGEMENT.equals(type)){
|
|
|
//资金方
|
|
|
map.put("managementCompanyId", companyId);
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
}
|
|
|
String allAmount = reportCreditService.getAvailableBalance(map);
|
|
|
Map m = new HashMap();
|
|
@@ -151,18 +163,20 @@ public class ReportCreditController extends BaseController {
|
|
|
if(CommonUtil.isEmpty(zfpType)){
|
|
|
zfpType = "1";
|
|
|
}
|
|
|
- map.put("zfpType", zfpType);
|
|
|
//获取企业类型
|
|
|
String type = use.getCompanyType();
|
|
|
if(COMPANYTYPE_CORE.equals(type)){
|
|
|
//核心企业
|
|
|
map.put("coreCompanyId", companyId);
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
}else if(COMPANYTYPE_SUPPLIER.equals(type)){
|
|
|
//供应商
|
|
|
map.put("supplierCompanyId", companyId);
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
}else if(COMPANYTYPE_MANAGEMENT.equals(type)){
|
|
|
//资金方
|
|
|
map.put("managementCompanyId", companyId);
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
}
|
|
|
String allAmount = reportCreditService.getEffectBalance(map);
|
|
|
Map m = new HashMap();
|
|
@@ -187,18 +201,20 @@ public class ReportCreditController extends BaseController {
|
|
|
if(CommonUtil.isEmpty(zfpType)){
|
|
|
zfpType = "1";
|
|
|
}
|
|
|
- map.put("zfpType", zfpType);
|
|
|
//获取企业类型
|
|
|
String type = use.getCompanyType();
|
|
|
if(COMPANYTYPE_CORE.equals(type)){
|
|
|
//核心企业
|
|
|
map.put("coreCompanyId", companyId);
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
}else if(COMPANYTYPE_SUPPLIER.equals(type)){
|
|
|
//供应商
|
|
|
map.put("supplierCompanyId", companyId);
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
}else if(COMPANYTYPE_MANAGEMENT.equals(type)){
|
|
|
//资金方
|
|
|
map.put("managementCompanyId", companyId);
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
}
|
|
|
String allAmount = reportCreditService.getLoanBalance(map);
|
|
|
Map m = new HashMap();
|
|
@@ -223,18 +239,20 @@ public class ReportCreditController extends BaseController {
|
|
|
if(CommonUtil.isEmpty(zfpType)){
|
|
|
zfpType = "1";
|
|
|
}
|
|
|
- map.put("zfpType", zfpType);
|
|
|
//获取企业类型
|
|
|
String type = use.getCompanyType();
|
|
|
if(COMPANYTYPE_CORE.equals(type)){
|
|
|
//核心企业
|
|
|
map.put("coreCompanyId", companyId);
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
}else if(COMPANYTYPE_SUPPLIER.equals(type)){
|
|
|
//供应商
|
|
|
map.put("supplierCompanyId", companyId);
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
}else if(COMPANYTYPE_MANAGEMENT.equals(type)){
|
|
|
//资金方
|
|
|
map.put("managementCompanyId", companyId);
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
}
|
|
|
String allAmount = reportCreditService.getReturnBalance(map);
|
|
|
Map m = new HashMap();
|
|
@@ -344,16 +362,18 @@ public class ReportCreditController extends BaseController {
|
|
|
Map addMap = new HashMap();
|
|
|
addMap.put("name","已用额度");
|
|
|
addMap.put("data",data);
|
|
|
+ addMap.put("stack","total");
|
|
|
dataList.add(addMap);
|
|
|
//开立额度数据对象
|
|
|
Map subMap = new HashMap();
|
|
|
subMap.put("name","可用额度");
|
|
|
subMap.put("data",subData);
|
|
|
+ subMap.put("stack","total");
|
|
|
dataList.add(subMap);
|
|
|
Map result = new HashMap();
|
|
|
result.put("dataList",dataList);
|
|
|
result.put("dateList",dateList);
|
|
|
- return AjaxResult.success(list);
|
|
|
+ return AjaxResult.success(result);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -392,7 +412,7 @@ public class ReportCreditController extends BaseController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getExpiredBalance")
|
|
|
- public AjaxResult getExpiredBalance()
|
|
|
+ public AjaxResult getExpiredBalance(String zfpType)
|
|
|
{
|
|
|
//获取当前企业的编号
|
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
@@ -408,24 +428,25 @@ public class ReportCreditController extends BaseController {
|
|
|
String endDate = DateUtils.getFetureDate(30);
|
|
|
map.put("startDate",startDate);
|
|
|
map.put("endDate",endDate);
|
|
|
- //融信额度
|
|
|
- String allAmount = "0";
|
|
|
- if(COMPANYTYPE_TERRACE.equals(type)){
|
|
|
- //平台
|
|
|
- allAmount = reportCreditService.getCreditLineAll(map);
|
|
|
- }else if(COMPANYTYPE_CORE.equals(type)){
|
|
|
+ //默认反向
|
|
|
+ if(CommonUtil.isEmpty(zfpType)){
|
|
|
+ zfpType = "1";
|
|
|
+ }
|
|
|
+ if(COMPANYTYPE_CORE.equals(type)){
|
|
|
//核心企业
|
|
|
+ map.put("zfpType",zfpType);
|
|
|
map.put("coreCompanyId", companyId);
|
|
|
- allAmount = reportCreditService.getCreditLineAll(map);
|
|
|
}else if(COMPANYTYPE_SUPPLIER.equals(type)){
|
|
|
//供应商
|
|
|
+ map.put("zfpType",zfpType);
|
|
|
map.put("supplierCompanyId", companyId);
|
|
|
- allAmount = reportCreditService.getSupplierCreditLineAll(map);
|
|
|
}else if(COMPANYTYPE_MANAGEMENT.equals(type)){
|
|
|
//资金方
|
|
|
+ map.put("zfpType",zfpType);
|
|
|
map.put("managementCompanyId", companyId);
|
|
|
- allAmount = reportCreditService.getCreditLineAll(map);
|
|
|
}
|
|
|
+ //融信额度
|
|
|
+ String allAmount = reportCreditService.getExpiredBalance(map);
|
|
|
Map m = new HashMap();
|
|
|
m.put("allAmount",allAmount);
|
|
|
return AjaxResult.success(m);
|
|
@@ -476,7 +497,7 @@ public class ReportCreditController extends BaseController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getCreditLineList")
|
|
|
- public AjaxResult getCreditLineList(QueryRequest request)
|
|
|
+ public AjaxResult getCreditLineList(String zfpType, QueryRequest request)
|
|
|
{
|
|
|
//获取当前企业的编号
|
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
@@ -486,8 +507,13 @@ public class ReportCreditController extends BaseController {
|
|
|
String companyId = use.getCompanyId();
|
|
|
//获取企业类型
|
|
|
String type = use.getCompanyType();
|
|
|
+ //默认反向
|
|
|
+ if(CommonUtil.isEmpty(zfpType)){
|
|
|
+ zfpType = "1";
|
|
|
+ }
|
|
|
if(COMPANYTYPE_CORE.equals(type)){
|
|
|
//核心企业
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
map.put("coreCompanyId", companyId);
|
|
|
}
|
|
|
IPage<Map> list = reportCreditService.getCreditLineList(map,request);
|
|
@@ -514,7 +540,7 @@ public class ReportCreditController extends BaseController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getCreditLineNumList")
|
|
|
- public AjaxResult getCreditLineNumList(QueryRequest request)
|
|
|
+ public AjaxResult getCreditLineNumList(String zfpType, QueryRequest request)
|
|
|
{
|
|
|
//获取当前企业的编号
|
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
@@ -524,8 +550,13 @@ public class ReportCreditController extends BaseController {
|
|
|
String companyId = use.getCompanyId();
|
|
|
//获取企业类型
|
|
|
String type = use.getCompanyType();
|
|
|
+ //默认反向
|
|
|
+ if(CommonUtil.isEmpty(zfpType)){
|
|
|
+ zfpType = "1";
|
|
|
+ }
|
|
|
if(COMPANYTYPE_CORE.equals(type)){
|
|
|
//核心企业
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
map.put("coreCompanyId", companyId);
|
|
|
}
|
|
|
IPage<Map> list = reportCreditService.getCreditLineNumList(map,request);
|
|
@@ -537,7 +568,7 @@ public class ReportCreditController extends BaseController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/financeRecordMonth")
|
|
|
- public AjaxResult financeRecordMonth(){
|
|
|
+ public AjaxResult financeRecordMonth(String zfpType, String dateType){
|
|
|
//获取当前企业的编号
|
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
|
SysUser use = userInfo.getSysUser();
|
|
@@ -545,22 +576,41 @@ public class ReportCreditController extends BaseController {
|
|
|
String companyId = use.getCompanyId();
|
|
|
//获取企业类型
|
|
|
String type = use.getCompanyType();
|
|
|
+ //默认反向
|
|
|
+ if(CommonUtil.isEmpty(zfpType)){
|
|
|
+ zfpType = "1";
|
|
|
+ }
|
|
|
//默认当年
|
|
|
String year = DateUtils.getDate().substring(0,4);
|
|
|
//月份集合
|
|
|
- List<String> dateList = getMonth();
|
|
|
+ List<String> dateList = new ArrayList<>();
|
|
|
+ if(DATE_WEEK.equals(dateType)){
|
|
|
+ //周
|
|
|
+ dateList = findDaysStr(DateUtils.getPastDate(7),DateUtils.dateTimeNow("yyyy-MM-dd"));
|
|
|
+ }else if(DATE_YEAR.equals(dateType)){
|
|
|
+ //年
|
|
|
+ dateList = getMonth();
|
|
|
+ }
|
|
|
//数据集合
|
|
|
List<Map> dataList = new ArrayList<>();
|
|
|
//开立额度
|
|
|
List<String> data = new ArrayList<>();
|
|
|
for (String date : dateList) {
|
|
|
- date = year.concat("-").concat(date).replace("月","");
|
|
|
Map map = new HashMap();
|
|
|
if(COMPANYTYPE_CORE.equals(type)){
|
|
|
//核心企业
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
map.put("coreCompanyId", companyId);
|
|
|
}
|
|
|
- map.put("month",date);
|
|
|
+ if(DATE_YEAR.equals(dateType)){
|
|
|
+ date = date.replaceAll("月","");
|
|
|
+ date = year.concat("-").concat(CommonUtil.compare(date, "10") < 0 ? "0".concat(date) : date);
|
|
|
+ //年
|
|
|
+ map.put("month",date);
|
|
|
+ }else{
|
|
|
+ //周
|
|
|
+ map.put("date",date);
|
|
|
+ }
|
|
|
//报销所含项目
|
|
|
String amt = reportCreditService.financeRecordMonth(map);
|
|
|
data.add(amt);
|
|
@@ -573,13 +623,21 @@ public class ReportCreditController extends BaseController {
|
|
|
//还款额度
|
|
|
List<String> returnData = new ArrayList<>();
|
|
|
for (String date : dateList) {
|
|
|
- date = year.concat("-").concat(date).replace("月","");
|
|
|
Map map = new HashMap();
|
|
|
if(COMPANYTYPE_CORE.equals(type)){
|
|
|
//核心企业
|
|
|
+ map.put("zfpType", zfpType);
|
|
|
map.put("coreCompanyId", companyId);
|
|
|
}
|
|
|
- map.put("month",date);
|
|
|
+ if(DATE_YEAR.equals(dateType)){
|
|
|
+ date = date.replaceAll("月","");
|
|
|
+ date = year.concat("-").concat(CommonUtil.compare(date, "10") < 0 ? "0".concat(date) : date);
|
|
|
+ //年
|
|
|
+ map.put("returnMonth",date);
|
|
|
+ }else{
|
|
|
+ //周
|
|
|
+ map.put("returnDate",date);
|
|
|
+ }
|
|
|
map.put("applyStatus","01");
|
|
|
//报销所含项目
|
|
|
String amt = reportCreditService.financeRecordMonth(map);
|
|
@@ -665,7 +723,8 @@ public class ReportCreditController extends BaseController {
|
|
|
List<String> dateList = new ArrayList<>();
|
|
|
//循环添加所有月份
|
|
|
for(int i = 1; i < 13; i++){
|
|
|
- dateList.add(i + "月");
|
|
|
+ String date = i + "月";
|
|
|
+ dateList.add(date);
|
|
|
}
|
|
|
return dateList;
|
|
|
}
|