|
|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.huyi.service.base.entity.*;
|
|
|
import com.huyi.service.base.service.*;
|
|
|
import com.huyi.service.credit.service.OwnCreditService;
|
|
|
+import com.huyi.service.util.FlowableService;
|
|
|
import com.keao.tianhu.starter.mybatis.plus.entity.QueryRequest;
|
|
|
import com.tianhu.common.core.domain.R;
|
|
|
import com.tianhu.common.core.utils.AmtUtil;
|
|
|
@@ -74,8 +75,7 @@ public class OwnCreditController extends BaseController {
|
|
|
@Autowired
|
|
|
private IZcBillFileRelService billFileRelService;
|
|
|
@Autowired
|
|
|
- private ISysUserService iSysUserService;
|
|
|
-
|
|
|
+ private FlowableService flowableService;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -164,6 +164,8 @@ public class OwnCreditController extends BaseController {
|
|
|
map.put("endAmt",CommonUtil.objToBigDecimal(endAmt));
|
|
|
//获取企业类型
|
|
|
String companyType = use.getCompanyType();
|
|
|
+ map.put("companyType",companyType);
|
|
|
+ map.put("companyId",companyId);
|
|
|
IPage<Map> list = ownCreditService.selectCreditList(map,request);
|
|
|
return R.ok(list);
|
|
|
}
|
|
|
@@ -603,9 +605,25 @@ public class OwnCreditController extends BaseController {
|
|
|
inf.setZfiRate(zfiRate);
|
|
|
//核心开立
|
|
|
if("1".equals(type)){
|
|
|
- //TODO 根据有无审批流做判断
|
|
|
- //核心企业状态
|
|
|
- inf.setZfiCoreStatus("03");
|
|
|
+ //根据有无审批流做判断
|
|
|
+ Map<String,Object> pp = new HashMap<>();
|
|
|
+ pp.put("menuId","1000000000");
|
|
|
+ pp.put("companyId",companyId);
|
|
|
+ Map<String,Object> mmp = flowableService.selectApproval(pp);
|
|
|
+ //不等于200
|
|
|
+ if(CommonUtil.compare(CommonUtil.objToString(mmp.get("code")),"200") != 0){
|
|
|
+ throw new Exception("查询审批流程失败");
|
|
|
+ }
|
|
|
+ List<Map<String,Object>> list = (List<Map<String, Object>>) mmp.get("data");
|
|
|
+ //未开启流程审批
|
|
|
+ if(list.size() < 1){
|
|
|
+ //通过
|
|
|
+ inf.setZfiCoreStatus("01");
|
|
|
+ }else{
|
|
|
+ //核心企业状态--暂存
|
|
|
+ inf.setZfiCoreStatus("03");
|
|
|
+ }
|
|
|
+
|
|
|
//接收企业
|
|
|
String zfiSupplierId = CommonUtil.objToString(map.get("zfiSupplierId"));
|
|
|
inf.setZfiSupplierId(zfiSupplierId);
|
|
|
@@ -631,12 +649,29 @@ public class OwnCreditController extends BaseController {
|
|
|
|
|
|
}
|
|
|
}else if("0".equals(type) || "2".equals(type)){//供应商开立/申请
|
|
|
- //TODO 根据有无审批流做判断
|
|
|
- inf.setZfiSupplierStatus("03");
|
|
|
+ // 根据有无审批流做判断
|
|
|
//获取合计金额
|
|
|
String checkTotalAmt = CommonUtil.objToString(map.get("checkTotalAmt"));
|
|
|
//供应商开立
|
|
|
if("2".equals(type)){
|
|
|
+ //根据有无审批流做判断
|
|
|
+ Map<String,Object> pp = new HashMap<>();
|
|
|
+ pp.put("menuId","1000000001");
|
|
|
+ pp.put("companyId",companyId);
|
|
|
+ Map<String,Object> mmp = flowableService.selectApproval(pp);
|
|
|
+ //不等于200
|
|
|
+ if(CommonUtil.compare(CommonUtil.objToString(mmp.get("code")),"200") != 0){
|
|
|
+ throw new Exception("查询审批流程失败");
|
|
|
+ }
|
|
|
+ List<Map<String,Object>> list = (List<Map<String, Object>>) mmp.get("data");
|
|
|
+ //未开启流程审批
|
|
|
+ if(list.size() < 1){
|
|
|
+ //通过
|
|
|
+ inf.setZfiSupplierStatus("01");
|
|
|
+ }else{
|
|
|
+ //供应商企业状态--暂存
|
|
|
+ inf.setZfiSupplierStatus("03");
|
|
|
+ }
|
|
|
//供应商企业授信额度
|
|
|
String zfiSupplierQuotaId = CommonUtil.objToString(map.get("zfiSupplierQuotaId"));
|
|
|
inf.setZfiSupplierQuotaId(zfiSupplierQuotaId);
|
|
|
@@ -659,6 +694,26 @@ public class OwnCreditController extends BaseController {
|
|
|
if(!"0".equals(zfpcrLoanType)){
|
|
|
inf.setZfiCollectionAccount(zfiCollectionAccount);
|
|
|
}*/
|
|
|
+ }else if("0".equals(type)){//供应商申请
|
|
|
+ //根据有无审批流做判断
|
|
|
+ Map<String,Object> pp = new HashMap<>();
|
|
|
+ pp.put("menuId","1000000002");
|
|
|
+ pp.put("companyId",companyId);
|
|
|
+ Map<String,Object> mmp = flowableService.selectApproval(pp);
|
|
|
+ //不等于200
|
|
|
+ if(CommonUtil.compare(CommonUtil.objToString(mmp.get("code")),"200") != 0){
|
|
|
+ throw new Exception("查询审批流程失败");
|
|
|
+ }
|
|
|
+ List<Map<String,Object>> list = (List<Map<String, Object>>) mmp.get("data");
|
|
|
+ //未开启流程审批
|
|
|
+ if(list.size() < 1){
|
|
|
+ //通过
|
|
|
+ inf.setZfiSupplierStatus("01");
|
|
|
+ }else{
|
|
|
+ //供应商企业状态--暂存
|
|
|
+ inf.setZfiSupplierStatus("03");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
if(CommonUtil.compare(zfiAmount,checkTotalAmt) == 1){
|
|
|
throw new Exception("签发金额不可大于合计金额");
|