|
@@ -101,6 +101,8 @@ public class FinanceRecordController extends BaseController {
|
|
|
|
|
|
//正整数正则
|
|
|
private static final String REGEX = "^[0-9]*[1-9][0-9]*$";
|
|
|
+ //金额
|
|
|
+ private static final String AMOUNT = "10000";
|
|
|
|
|
|
/**
|
|
|
* 查询融资管理列表
|
|
@@ -113,13 +115,17 @@ public class FinanceRecordController extends BaseController {
|
|
|
@RequestParam (required = false) String zfrStatus,QueryRequest request) {
|
|
|
//查询当前操作员
|
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
|
- SysUser use = userInfo.getSysUser();
|
|
|
+ SysUser user = userInfo.getSysUser();
|
|
|
//获取企业
|
|
|
- String companyId = use.getCompanyId();
|
|
|
+ String companyId = user.getCompanyId();
|
|
|
+ //获取企业类型
|
|
|
+ String companyType = user.getCompanyType();
|
|
|
Map map = new HashMap();
|
|
|
-// if (!SalaryConstants.OPEX.equals(companyId)) {
|
|
|
-// map.put("companyId", companyId);
|
|
|
-// }
|
|
|
+ if (!SalaryConstants.OPEX.equals(companyId)) {
|
|
|
+ map.put("companyId", companyId);
|
|
|
+ }
|
|
|
+ //企业类型
|
|
|
+ map.put("companyType",companyType);
|
|
|
map.put("zfrStatus",zfrStatus);
|
|
|
//00:我签收的 01:我开立的
|
|
|
if ("00".equals(zfrTypes)){
|
|
@@ -138,6 +144,18 @@ public class FinanceRecordController extends BaseController {
|
|
|
map.put("zfrRate", zfrValue);
|
|
|
}
|
|
|
IPage<Map> list = financeRecordService.selectFinanceRecordList(map, request);
|
|
|
+ List listAll = list.getRecords();
|
|
|
+ for (int j = 0; j < listAll.size(); j++) {
|
|
|
+ Map<String,String> m = (Map<String, String>) listAll.get(j);
|
|
|
+ //融资金额
|
|
|
+ String zfrAmount = m.get("zfrAmount");
|
|
|
+ zfrAmount = AmtUtil.divide(zfrAmount,AMOUNT,2);
|
|
|
+ //实际放款金额
|
|
|
+ String zfrLoanAmount = m.get("zfrLoanAmount");
|
|
|
+ zfrLoanAmount = AmtUtil.divide(zfrLoanAmount,AMOUNT,2);
|
|
|
+ m.put("zfrAmount",zfrAmount);
|
|
|
+ m.put("zfrLoanAmount",zfrLoanAmount);
|
|
|
+ }
|
|
|
return R.ok(list);
|
|
|
}
|
|
|
|
|
@@ -182,7 +200,8 @@ public class FinanceRecordController extends BaseController {
|
|
|
zfpcrChargeRate = AmtUtil.divide(zfpcrChargeRate,"100",4);
|
|
|
needPay = AmtUtil.multiply(zfrAmount,zfpcrChargeRate,2);
|
|
|
}
|
|
|
- map.put("needPay",needPay);
|
|
|
+ map.put("needPay",AmtUtil.multiply(needPay,AMOUNT,2));
|
|
|
+ map.put("zfrAmount",AmtUtil.divide(zfrAmount,AMOUNT,2));
|
|
|
return AjaxResult.success(map);
|
|
|
}
|
|
|
|
|
@@ -221,6 +240,7 @@ public class FinanceRecordController extends BaseController {
|
|
|
String zfrFinanceId = CommonUtil.objToString(map.get("zfrFinanceId"));
|
|
|
//融资金额
|
|
|
String zfrAmount = CommonUtil.objToString(map.get("zfrAmount"));
|
|
|
+ zfrAmount = AmtUtil.multiply(zfrAmount,AMOUNT,2);
|
|
|
//融资收款账号
|
|
|
String zfrCollectionAccount = CommonUtil.objToString(map.get("zfrCollectionAccount"));
|
|
|
//融资利率
|
|
@@ -318,19 +338,26 @@ public class FinanceRecordController extends BaseController {
|
|
|
//创建时间
|
|
|
zcFinanceRecord.setCreateTime(createTime);
|
|
|
/*-------------新增费用表--------*/
|
|
|
- ZcChargeInf zcChargeInf = new ZcChargeInf();
|
|
|
- //主键
|
|
|
- zcChargeInf.setZciId(IdUtils.fastSimpleUUID());
|
|
|
- //融资id
|
|
|
- zcChargeInf.setZciFinanceId(zfrId);
|
|
|
- //手续费
|
|
|
- String zciAmount = AmtUtil.divide(zfpcrChargeRate,"100",4);
|
|
|
- zciAmount = AmtUtil.subtract(zfrAmount,zciAmount,2);
|
|
|
- zcChargeInf.setZciAmount(zciAmount);
|
|
|
- //创建人
|
|
|
- zcChargeInf.setCreateBy(userId);
|
|
|
- //创建时间
|
|
|
- zcChargeInf.setCreateTime(DateUtils.getNowDate());
|
|
|
+ //查询此融资是否已存在
|
|
|
+ LambdaQueryWrapper<ZcChargeInf> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(ZcChargeInf::getZciFinanceId,zfrFinanceId);
|
|
|
+ int count = iZcChargeInfService.count(queryWrapper);
|
|
|
+ if (count == 0) {
|
|
|
+ ZcChargeInf zcChargeInf = new ZcChargeInf();
|
|
|
+ //主键
|
|
|
+ zcChargeInf.setZciId(IdUtils.fastSimpleUUID());
|
|
|
+ //融资id
|
|
|
+ zcChargeInf.setZciFinanceId(zfrId);
|
|
|
+ //手续费
|
|
|
+ String zciAmount = AmtUtil.divide(zfpcrChargeRate, "100", 4);
|
|
|
+ zciAmount = AmtUtil.subtract(zfrAmount, zciAmount, 2);
|
|
|
+ zcChargeInf.setZciAmount(zciAmount);
|
|
|
+ //创建人
|
|
|
+ zcChargeInf.setCreateBy(userId);
|
|
|
+ //创建时间
|
|
|
+ zcChargeInf.setCreateTime(DateUtils.getNowDate());
|
|
|
+ iZcChargeInfService.createZcChargeInf(zcChargeInf);
|
|
|
+ }
|
|
|
/*----------修改融信表状态---------------*/
|
|
|
ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
//融信id
|
|
@@ -342,7 +369,7 @@ public class FinanceRecordController extends BaseController {
|
|
|
//修改时间
|
|
|
zcFinanceInf.setUpdateTime(DateUtils.getNowDate());
|
|
|
iZcFinanceInfService.updateZcFinanceInf(zcFinanceInf);
|
|
|
- iZcChargeInfService.createZcChargeInf(zcChargeInf);
|
|
|
+
|
|
|
iZcFinanceRecordService.createZcFinanceRecord(zcFinanceRecord);
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
@@ -367,8 +394,10 @@ public class FinanceRecordController extends BaseController {
|
|
|
String userId = user.getUserId() + "";
|
|
|
//放款金额
|
|
|
String zfrLoanAmount = CommonUtil.objToString(map.get("zfrLoanAmount"));
|
|
|
+ zfrLoanAmount = AmtUtil.multiply(zfrLoanAmount,AMOUNT,2);
|
|
|
//融资金额
|
|
|
String zfrAmount = CommonUtil.objToString(map.get("zfrAmount"));
|
|
|
+ zfrAmount = AmtUtil.multiply(zfrAmount,AMOUNT,2);
|
|
|
//融信id
|
|
|
String zfrFinanceId = CommonUtil.objToString(map.get("zfrFinanceId"));
|
|
|
//授信额度
|
|
@@ -449,6 +478,10 @@ public class FinanceRecordController extends BaseController {
|
|
|
map.put("billIdList",CommonUtil.listToStr4InSql(billIdList));
|
|
|
}
|
|
|
List<Map> list = financeRecordService.selectBillInfList(map);
|
|
|
+ for (Map map1 : list){
|
|
|
+ String zbiAmount = CommonUtil.objToString(map1.get("zbiAmount"));
|
|
|
+ map1.put("zbiAmount",AmtUtil.divide(zbiAmount,AMOUNT,2));
|
|
|
+ }
|
|
|
return AjaxResult.success(list);
|
|
|
}
|
|
|
|