瀏覽代碼

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	sc-service/src/main/java/com/huyi/service/common/flowable/controller/FlowableController.java
#	sc-service/src/main/java/com/huyi/service/common/flowable/service/impl/ApprovalServiceImpl.java
peixh 3 年之前
父節點
當前提交
d5340d91f6

+ 80 - 36
sc-service/src/main/java/com/huyi/service/common/flowable/controller/FlowableController.java

@@ -2,14 +2,8 @@ package com.huyi.service.common.flowable.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.huyi.service.base.entity.PubApprovalProcess;
-import com.huyi.service.base.entity.ZcFinanceInf;
-import com.huyi.service.base.entity.ZcFinanceProduct;
-import com.huyi.service.base.entity.ZcFinanceRecord;
-import com.huyi.service.base.service.IPubApprovalProcessService;
-import com.huyi.service.base.service.IZcFinanceInfService;
-import com.huyi.service.base.service.IZcFinanceProductService;
-import com.huyi.service.base.service.IZcFinanceRecordService;
+import com.huyi.service.base.entity.*;
+import com.huyi.service.base.service.*;
 import com.huyi.service.common.flowable.service.ApprovalService;
 import com.keao.tianhu.starter.mybatis.plus.entity.QueryRequest;
 import com.tianhu.common.core.utils.CommonUtil;
@@ -32,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.lang.reflect.InvocationTargetException;
 import java.text.ParseException;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -44,6 +39,9 @@ import java.util.Map;
 public class  FlowableController extends BaseController
 {
 
+    @Autowired
+    private RemoteSystemService remoteSystemService;
+
     /**
      *  自动生成的流程审批服务类
      */
@@ -70,7 +68,9 @@ public class  FlowableController extends BaseController
     @Autowired
     private IZcFinanceProductService iZcFinanceProductService;
     @Autowired
-    private RemoteSystemService remoteSystemService;
+    private ISysUserService iSysUserService;
+    @Autowired
+    private ISysUserCompanyRelService iSysUserCompanyRelService;
 
 
 
@@ -109,38 +109,81 @@ public class  FlowableController extends BaseController
             @RequestParam("companyId") String companyId) throws Exception {
         //核心企业融信开立审批
         if("1000000000".equals(menuId)){
+            //修改
             ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
             //主键
             zcFinanceInf.setZfiId(id);
             //审批通过
             zcFinanceInf.setZfiCoreStatus("01");
-            zcFinanceInf.setZfiSupplierStatus("00");
-            //待签收
-            //TODO 不更改融信状态
-            //TODo 给核心企业经办人生成盖章待办
-            //TODO 发起人最终结果【通过】消息通知
-            zcFinanceInf.setZfiStatus("01");
             zcFinanceInfService.updateById(zcFinanceInf);
-        //核心企业确权审批
+            //根据id获取融信信息
+            ZcFinanceInf financeInf = zcFinanceInfService.getById(id);
+            //核心企业id
+            String zfiCoreId = financeInf.getZfiCoreId();
+            //发起人
+            Long userId = Long.valueOf(financeInf.getCreateBy());
+            //融信编号
+            String zfiNumber = financeInf.getZfiNumber();
+            //获取发起人的姓名
+            SysUser sysUser = iSysUserService.getById(userId);
+            String userName = sysUser.getNickName();
+            //查询企业经办人
+            LambdaQueryWrapper<SysUserCompanyRel> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+            //核心企业id
+            lambdaQueryWrapper.eq(SysUserCompanyRel::getSucrCompanyId,zfiCoreId);
+            //是否经办人(1:是)
+            lambdaQueryWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
+            List<SysUserCompanyRel> listUser = iSysUserCompanyRelService.findSysUserCompanyRels(lambdaQueryWrapper);
+            //获取发送人
+            Long use = null;
+            List<Long> longUserList = new ArrayList<>();
+            if(listUser.size() > 0) {
+                use = listUser.get(0).getSucrUserId();
+                longUserList.add(use);
+            }
+            //发送盖章待办
+            remoteSystemService.sendNotice(zfiCoreId, id,
+                    "核心企业开立审批融信编号为" + zfiNumber + "的资料待盖章,审批发起人为" + userName,
+                    "00",null,"03","0", longUserList,null);
+            //向发起人发起最终结果
+            //发送人
+            List<Long> longUser = new ArrayList<>();
+            longUser.add(userId);
+            remoteSystemService.sendNotice(zfiCoreId, id,
+                    "核心企业开立融信编号为" + zfiNumber + "的资料审批已通过",
+                    "01","01",null,"0", longUser, null);
+            //核心企业确权审批
         }else if("1000000007".equals(menuId)){
             //融信主键
             ZcFinanceInf zcFinanceInf = zcFinanceInfService.getById(id);
-            //融信创建(0:供应商申请, 1:核心企业开立, 2:供应商开立)
-            String type = zcFinanceInf.getZfiCreateType();
-            if("0".equals(type)){
-                //TODO  删除不需要调用签收审批
-                //调用融资企业签收审批
-                approvalService.addSignApproval(CommonUtil.entityToMap(zcFinanceInf));
-            }else if("2".equals(type)){
-                //TODO  删除
-                //已生效
-                zcFinanceInf.setZfiStatus("02");
-                //签收时间
-                zcFinanceInf.setZfiSignDate(DateUtils.getNowDate());
-                zcFinanceInfService.updateById(zcFinanceInf);
+            zcFinanceInf.setZfiCoreStatus("01");
+            zcFinanceInfService.updateById(zcFinanceInf);
+            //核心企业Id
+            String zfiCoreId = zcFinanceInf.getZfiCoreId();
+            //融信编号
+            String zfiNumber = zcFinanceInf.getZfiNumber();
+            //发起人Id
+            Long userId = Long.valueOf(zcFinanceInf.getCreateBy());
+            //根据发起人Id获取发送人姓名
+            SysUser sysUser = iSysUserService.getById(userId);
+            //姓名
+            String userName = sysUser.getNickName();
+            //获取核心企业经办人
+            LambdaQueryWrapper<SysUserCompanyRel> queryWrapper = new LambdaQueryWrapper<>();
+            //核心企业Id
+            queryWrapper.eq(SysUserCompanyRel::getSucrCompanyId,zfiCoreId);
+            //是否经办人(1:是)
+            queryWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
+            List<SysUserCompanyRel> list = iSysUserCompanyRelService.findSysUserCompanyRels(queryWrapper);
+            Long use = null;
+            List<Long> longUserList = new ArrayList<>();
+            if(list.size() > 0){
+                use = list.get(0).getSucrUserId();
+                longUserList.add(use);
             }
-            //TODO 将核心企业审批状态改为审批通过
-            //TODo 核心企业经办人盖章待办
+            remoteSystemService.sendNotice(zfiCoreId, id,
+                    "确权审批融信编号为" + zfiNumber + "的资料待盖章,审批发起人为" + userName,
+                    "00",null,"03","0", longUserList,null);
         }
         //融资企业融信申请审批通过
         else if("1000000002".equals(menuId)){
@@ -248,8 +291,8 @@ public class  FlowableController extends BaseController
                 //融资方审批状态(00:审批中, 01:审批通过, 02:审批拒绝, 03:暂存)
                 financeInf.setZfiSupplierStatus("01");
                 //融信状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资 06:平台退回)
-                //不更改融信状态
-//                financeInf.setZfiStatus("02");
+                //TODo 不更改融信状态
+                financeInf.setZfiStatus("02");
                 //签收日期
                 financeInf.setZfiSignDate(DateUtils.getNowDate());
                 zcFinanceInfService.updateById(financeInf);
@@ -277,8 +320,8 @@ public class  FlowableController extends BaseController
                 zcFinanceInf.setZfiStatus("02");
                 //签收日期
                 zcFinanceInf.setZfiSignDate(DateUtils.getNowDate());
-                //融资企业开立时不能更改融信状态
-            }else if ("0".equals(zfiCreateType)){
+                //TODo 融资企业开立时不能更改融信状态
+            }else if ("0".equals(zfiCreateType) || "2".equals(zfiCreateType)){
                 //融信状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资 06:平台退回)
                 zcFinanceInf.setZfiStatus("00");
             }
@@ -340,7 +383,8 @@ public class  FlowableController extends BaseController
                                      @RequestParam("id") String id,
                                      @RequestParam("menuId") String menuId,
                                      @RequestParam("companyId") String companyId,
-                                     @RequestParam("state") String state) throws Exception {
+                                     @RequestParam("state") String state,
+                                     @RequestParam("reason") String reason) throws Exception {
         //核心企业融信开立审批
         if("1000000000".equals(menuId)){
             ZcFinanceInf zcFinanceInf = new ZcFinanceInf();

+ 106 - 55
sc-service/src/main/java/com/huyi/service/common/flowable/service/impl/ApprovalServiceImpl.java

@@ -8,18 +8,25 @@ import com.huyi.service.common.flowable.service.ApprovalService;
 import com.huyi.service.util.FlowableService;
 import com.tianhu.common.core.utils.CommonUtil;
 import com.tianhu.common.core.utils.DateUtils;
+import com.tianhu.common.security.service.TokenService;
 import com.tianhu.system.api.RemoteSystemService;
+import com.tianhu.system.api.model.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cglib.beans.BeanMap;
 import org.springframework.stereotype.Service;
 import org.springframework.web.bind.annotation.RequestBody;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 @Service
 public class ApprovalServiceImpl implements ApprovalService {
+
+    @Autowired
+    private RemoteSystemService remoteSystemService;
+
     @Autowired
     private FlowableService flowableService;
     // 开始流程
@@ -43,7 +50,8 @@ public class ApprovalServiceImpl implements ApprovalService {
     @Autowired
     private IZcFinanceProductService zcFinanceProductService;
     @Autowired
-    private RemoteSystemService remoteSystemService;
+    private TokenService tokenService;
+
 
 
     /**
@@ -55,36 +63,41 @@ public class ApprovalServiceImpl implements ApprovalService {
     @Override
     public void coreApproval(@RequestBody Map map) throws Exception {
         Map<String, Object> flowParam = new HashMap<String, Object>();
+        //融信Id
+        String zfiId = CommonUtil.objToString(map.get("zfiId"));
+        //融信编号
+        String zfiNumber = CommonUtil.objToString(map.get("zfiNumber"));
         //核心企业Id
         String zfiCoreId = 	CommonUtil.objToString(map.get("zfiCoreId"));
+        //融资企业Id
+        String zfiSupplierId = CommonUtil.objToString(map.get("zfiSupplierId"));
         LambdaQueryWrapper<SysCompany> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(SysCompany::getScyId,zfiCoreId);
         List<SysCompany> list = iSysCompanyService.findSysCompanys(queryWrapper);
-        //根据企业id获取用户id
-        LambdaQueryWrapper<SysUserCompanyRel> userQuery = new LambdaQueryWrapper<>();
-        userQuery.eq(SysUserCompanyRel::getSucrCompanyId,zfiCoreId);
-        //是否经办人
-        userQuery.eq(SysUserCompanyRel::getSucrHandler,"1");
-        List<SysUserCompanyRel> userList = iSysUserCompanyRelService.findSysUserCompanyRels(userQuery);
-        //获取userId
-        String userId = String.valueOf(userList.get(0).getSucrUserId());
-        //获取userName
-        SysUser sysUser = iSysUserService.getById(userId);
-        String userName = sysUser.getNickName();
+        //核心企业名称
+        String scyName = list.get(0).getScyName();
         //查询当前操作员
+        LoginUser user = tokenService.getLoginUser();
+        //当前企业ID
+        String companyId = user.getSysUser().getCompanyId();
+        Long userId = user.getSysUser().getUserId();
         flowParam.put("menuId", "1000000000");
-        flowParam.put("companyId", zfiCoreId);
+        flowParam.put("companyId", user.getSysUser().getCompanyId());
         //双主键
-        flowParam.put("businessKey", CommonUtil.objToString(map.get("zfiId")));
+        flowParam.put("businessKey", zfiId);
         //员工编号
         flowParam.put("sessionUserId", userId);
-            flowParam.put("name",userName + "在" + DateUtils.getDate() + "发起融信开立审批");
+        if (!CommonUtil.isEmpty(scyName)){
+            flowParam.put("name",scyName + "在" + DateUtils.getDate() + "发起融信开立审批");
+        }
         JSONObject jsonObj = new JSONObject(map);
         flowParam.put("paras", jsonObj.toString());
         Map<String, Object> resMap = flowableService.apiPost(STRART_FLOW, flowParam);
         if("200".equals(resMap.get("code"))){
             ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
-            zcFinanceInf.setZfiId(CommonUtil.objToString(map.get("zfiId")));
+            //主键
+            zcFinanceInf.setZfiId(zfiId);
+            //核心企业融资状态(00:审批中, 01:审批通过, 02:审批拒绝, 03:暂存)
             zcFinanceInf.setZfiCoreStatus("00");
             zcFinanceInfService.updateById(zcFinanceInf);
         }else
@@ -93,15 +106,35 @@ public class ApprovalServiceImpl implements ApprovalService {
                 //修改状态为通过
                 ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
                 //融信Id
-                zcFinanceInf.setZfiId(CommonUtil.objToString(map.get("zfiId")));
+                zcFinanceInf.setZfiId(zfiId);
                 //核心企业融资状态(审批通过)
                 zcFinanceInf.setZfiCoreStatus("01");
-                //审核通过(待签收)
-                zcFinanceInf.setZfiStatus("01");
-                zcFinanceInf.setUpdateBy(userId);
-                zcFinanceInf.setUpdateTime(DateUtils.getNowDate());
                 zcFinanceInfService.updateById(zcFinanceInf);
-                //TODO 发起人最终结果【通过】消息通知
+                //查询融资企业经办人
+                LambdaQueryWrapper<SysUserCompanyRel> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+                //融资企业id
+                lambdaQueryWrapper.eq(SysUserCompanyRel::getSucrCompanyId,zfiSupplierId);
+                //是否经办人(1:是)
+                lambdaQueryWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
+                List<SysUserCompanyRel> listUser = iSysUserCompanyRelService.findSysUserCompanyRels(lambdaQueryWrapper);
+                //获取发送人
+                Long use = null;
+                List<Long> userIdList = new ArrayList<>();
+                if(listUser.size() > 0) {
+                    use = listUser.get(0).getSucrUserId();
+                    userIdList.add(use);
+                }
+                //发送盖章待办
+                remoteSystemService.sendNotice(zfiSupplierId, zfiId,
+                        "核心企业开立审批由"+ scyName + "发起的融信编号为" + zfiNumber + "的资料待盖章",
+                        "00",null,"03","0", userIdList,null);
+                //获取发送人
+                List<Long> longUser = new ArrayList<>();
+                longUser.add(userId);
+                //向发起人发送最终结果【通过】消息通知
+                remoteSystemService.sendNotice(companyId, String.valueOf(userId),
+                        "核心企业开立审批融信编号为" + zfiNumber + "的资料审批已通过",
+                        "01","01",null,"0", longUser, null);
             }else if ("450".equals(resMap.get("code"))) {
                 throw new Exception("未配置审批流程");
             }else if (!"200".equals(resMap.get("code"))) {
@@ -154,12 +187,13 @@ public class ApprovalServiceImpl implements ApprovalService {
             zcFinanceInf.setZfiPlatformStatus("01");
             if ("1".equals(zfiCreateType)) {
                 //融信状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资 06:平台退回)
-                //不能更改融信状态
-//                zcFinanceInf.setZfiStatus("02");
+                //TODo 不能更改融信状态
+                zcFinanceInf.setZfiStatus("02");
                 //签收日期
                 zcFinanceInf.setZfiSignDate(DateUtils.getNowDate());
                 //TODo 给融资企业经办人盖章代办
-            }else if ("0".equals(zfiCreateType)){
+                //TODo 融资企业开立时不应该修改融信状态
+            }else if ("0".equals(zfiCreateType) || "2".equals(zfiCreateType)){
                 //融信状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资 06:平台退回)
                 zcFinanceInf.setZfiStatus("00");
                 //TODO 融资企业经办人 最终结果【通过】消息通知
@@ -182,24 +216,36 @@ public class ApprovalServiceImpl implements ApprovalService {
     @Override
     public void coreConfirmationApproval(@RequestBody Map map) throws Exception {
         Map<String, Object> flowParam = new HashMap<String, Object>();
+        //主键
+        String zfiId = CommonUtil.objToString(map.get("zfiId"));
         //核心企业Id
         String zfiCoreId = 	CommonUtil.objToString(map.get("zfiCoreId"));
-        //根据企业id获取用户id
+        //根据主键获取实体
+        ZcFinanceInf financeInf = zcFinanceInfService.getById(zfiId);
+        //融信编号
+        String zfiNumber = financeInf.getZfiNumber();
+        //发起人
+        Long user = Long.valueOf(financeInf.getCreateBy());
+        //获取userName
+        SysUser sysUser = iSysUserService.getById(user);
+        String userName = sysUser.getNickName();
+        //获取核心企业经办人
         LambdaQueryWrapper<SysUserCompanyRel> userQuery = new LambdaQueryWrapper<>();
         userQuery.eq(SysUserCompanyRel::getSucrCompanyId,zfiCoreId);
         //是否经办人
         userQuery.eq(SysUserCompanyRel::getSucrHandler,"1");
         List<SysUserCompanyRel> userList = iSysUserCompanyRelService.findSysUserCompanyRels(userQuery);
-        //获取userId
-        String userId = String.valueOf(userList.get(0).getSucrUserId());
-        //获取userName
-        SysUser sysUser = iSysUserService.getById(userId);
-        String userName = sysUser.getNickName();
-
+        //获取经办人Id
+        Long userId = null;
+        List<Long> longUserList = new ArrayList<>();
+        if(userList.size() > 0) {
+            userId = userList.get(0).getSucrUserId();
+            longUserList.add(userId);
+        }
         flowParam.put("menuId", "1000000007");
         flowParam.put("companyId", zfiCoreId);
         //双主键
-        flowParam.put("businessKey", CommonUtil.objToString(map.get("zfiId")));
+        flowParam.put("businessKey", zfiId);
         //员工编号
         flowParam.put("sessionUserId", userId);
         flowParam.put("name", userName + "在" + DateUtils.getDate() + "发起确权审批");
@@ -208,29 +254,34 @@ public class ApprovalServiceImpl implements ApprovalService {
         Map<String, Object> resMap = flowableService.apiPost(STRART_FLOW, flowParam);
         //成功
         if("200".equals(resMap.get("code"))){
-            //TODo 核心企业经办人盖章待办
+            //改为审批中
+            ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
+            zcFinanceInf.setZfiId(zfiId);
+            zcFinanceInf.setZfiCoreStatus("00");
+            zcFinanceInfService.updateById(zcFinanceInf);
         }else
-        //未开启流程实例
-        if("300".equals(resMap.get("code")) || "350".equals(resMap.get("code"))){
-            ZcFinanceInf zcFinanceInf = zcFinanceInfService.getById(CommonUtil.objToString(map.get("zfiId")));
-            String type = zcFinanceInf.getZfiCreateType();
-            if("0".equals(type)){
-                approvalService.addSignApproval(map);
-            }else if("2".equals(type)){
-                //已生效
-                zcFinanceInf.setZfiStatus("02");
-                //签收时间
-                zcFinanceInf.setZfiSignDate(DateUtils.getNowDate());
+            //未开启流程实例
+            if("300".equals(resMap.get("code")) || "350".equals(resMap.get("code"))){
+                //审批通过
+                ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
+                zcFinanceInf.setZfiId(zfiId);
+                zcFinanceInf.setZfiCoreStatus("01");
                 zcFinanceInfService.updateById(zcFinanceInf);
+                List<Long> longUser = new ArrayList<>();
+                longUser.add(user);
+                remoteSystemService.sendNotice(zfiCoreId, zfiId,
+                        "确权审批融信编号为" + zfiNumber + "的资料审批已通过",
+                        "01","01",null,"0", longUser, null);
+                //向核心企业经办人发送盖章待办
+                remoteSystemService.sendNotice(zfiCoreId, zfiId,
+                        "确权审批融信编号为" + zfiNumber + "的资料待盖章,审批发起人为" + userName,
+                        "00",null,"03","0", longUserList,null);
+                //未配置审批流程
+            }else if ("450".equals(resMap.get("code"))) {
+                throw new Exception("未配置审批流程");
+            }else if (!"200".equals(resMap.get("code"))) {
+                throw new Exception(resMap.get("message").toString());
             }
-            //TODO 核心企业经办人最终结果【通过】消息通知
-            //TODo  核心企业盖章待办事项。
-            //未配置审批流程
-        }else if ("450".equals(resMap.get("code"))) {
-            throw new Exception("未配置审批流程");
-        }else if (!"200".equals(resMap.get("code"))) {
-            throw new Exception(resMap.get("message").toString());
-        }
     }
 
 
@@ -449,9 +500,9 @@ public class ApprovalServiceImpl implements ApprovalService {
                 financeInf.setZfiPlatformStatus("01");
                 //融资方审批状态(00:审批中, 01:审批通过, 02:审批拒绝, 03:暂存)
                 financeInf.setZfiSupplierStatus("01");
-                //融信状态不更改
+                //TODO 融信状态不更改
                 //融信状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资 06:平台退回)
-//                financeInf.setZfiStatus("02");
+                financeInf.setZfiStatus("02");
                 //签收日期
                 financeInf.setZfiSignDate(DateUtils.getNowDate());
                 zcFinanceInfService.updateById(financeInf);

+ 37 - 145
sc-service/src/main/java/com/huyi/service/common/report/controller/ReportCompanyController.java

@@ -1,10 +1,7 @@
 package com.huyi.service.common.report.controller;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.huyi.service.common.report.service.ReportCompanyService;
 import com.huyi.service.common.report.service.ReportCreditService;
-import com.keao.tianhu.starter.mybatis.plus.entity.QueryRequest;
-import com.tianhu.common.core.utils.AmtUtil;
 import com.tianhu.common.core.utils.CommonUtil;
 import com.tianhu.common.core.utils.DateUtils;
 import com.tianhu.common.core.web.controller.BaseController;
@@ -48,24 +45,9 @@ public class ReportCompanyController extends BaseController {
     private static String DATE_WEEK = "00";
 
     /**
-     * 时间维度类型 01
+     * 时间维度类型 01
      */
-    private static String DATE_MONTH = "01";
-
-    /**
-     * 时间维度类型 02季度
-     */
-    private static String DATE_QUARTER = "02";
-
-    /**
-     * 时间维度类型 03半年
-     */
-    private static String DATE_HALF = "03";
-
-    /**
-     * 时间维度类型 04年
-     */
-    private static String DATE_YEAR = "04";
+    private static String DATE_YEAR = "01";
 
     /**
      * 类型 00注册数量
@@ -313,19 +295,16 @@ public class ReportCompanyController extends BaseController {
     }
 
     /**
-     * 用户数据统计 -- 柱状图
-     * @param type      数据类型
+     * 平台用户统计 -- 柱状图
      * @param dateType  时间维度类型
-     * @param dates     时间范围
      * @return
      */
     @GetMapping("/getCompanyReport")
-    public AjaxResult getCompanyReport(String type,String dateType,List dates)
+    public AjaxResult getCompanyReport(String dateType)
     {
         //获取当前企业的编号
         LoginUser userInfo = tokenService.getLoginUser();
         SysUser use = userInfo.getSysUser();
-        Map<String,String> map = new HashMap<>();
         //获取企业
         String companyId = use.getCompanyId();
         //获取企业类型
@@ -334,142 +313,54 @@ public class ReportCompanyController extends BaseController {
         if(!COMPANYTYPE_TERRACE.equals(companyType)){
             return AjaxResult.success();
         }
+        //默认当年
+        String  year = DateUtils.getDate().substring(0,4);
         //月份集合
-        List<String> dateList = getMonth();
+        List<String> dateList = new ArrayList<>();
         if(DATE_WEEK.equals(dateType)){
             //周
-
-        }else if(DATE_MONTH.equals(dateType)){
-            //月
-
-        }else if(DATE_QUARTER.equals(dateType)){
-            //季度
-
-        }else if(DATE_HALF.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<>();
+        //核心企业数量
+        List<String> coreData = new ArrayList<>();
         for (String date : dateList) {
-            //数量
-            String num = "0";
-            if(TYPE_REGISTER.equals(type)){
-                //平台注册
-                num =  reportCompanyService.getRegisterNum(map);
-            }else if(TYPE_COMPANY.equals(type)){
-                //入驻企业
-                num =  reportCompanyService.getCompanyNum(map);
-            }else if(TYPE_COMPANY_SUPPLIER.equals(type)){
-                map.put("type","02");
-                //入住供应商
-                num =  reportCompanyService.getCompanyNum(map);
-            }else if(TYPE_FINANCE_SUPPLIER.equals(type)){
-                //融资供应商
-                num =  reportCompanyService.getFinanceSupplier(map);
-            }else if(TYPE_COMPANY_CORE.equals(type)){
-                map.put("type","01");
-                //入住核心企业
-                num =  reportCompanyService.getCompanyNum(map);
-            }else if(TYPE_FINANCE_CORE.equals(type)){
-                //签立业务核心企业
-                num =  reportCompanyService.getFinanceCore(map);
-            }
-            data.add(num);
-        }
-        //开立额度数据对象
-        Map dataMap = new HashMap();
-        dataMap.put("name","数量");
-        dataMap.put("data",data);
-        dataList.add(dataMap);
-        Map result = new HashMap();
-        result.put("dataList",dataList);
-        result.put("dateList",dateList);
-        return AjaxResult.success(result);
-    }
-
-    /**
-     * 业务数据统计 -- 柱状图
-     * @param type          数据类型
-     * @param dateType      时间维度类型
-     * @param dates         时间范围
-     * @param companyId     资方
-     * @param productId     融资产品
-     * @return
-     */
-    @GetMapping("/getFinanceReport")
-    public AjaxResult getFinanceReport(String type,String dateType,List dates,String companyId,String productId)
-    {
-        //获取当前企业的编号
-        LoginUser userInfo = tokenService.getLoginUser();
-        SysUser use = userInfo.getSysUser();
-        Map<String,String> map = new HashMap<>();
-        //资方
-        map.put("managementCompanyId",companyId);
-        //融资产品
-        map.put("productId",productId);
-        //获取企业类型
-        String companyType = use.getCompanyType();
-        //平台
-        if(!COMPANYTYPE_TERRACE.equals(companyType)){
-            return AjaxResult.success();
-        }
-        //月份集合
-        List<String> dateList = getMonth();
-        if(DATE_WEEK.equals(dateType)){
-            //周
-
-        }else if(DATE_MONTH.equals(dateType)){
-            //月
-
-        }else if(DATE_QUARTER.equals(dateType)){
-            //季度
-
-        }else if(DATE_HALF.equals(dateType)){
-            //半年
-
-        }else if(DATE_YEAR.equals(dateType)){
-            //年
+            if(DATE_YEAR.equals(dateType)){
 
-        }
-        //数据集合
-        List<Map> dataList = new ArrayList<>();
-        //数量集合
-        List<String> data = new ArrayList<>();
-        for (String date : dateList) {
-            //数量
-            String num = "0";
-            if(TYPE_CREDIT_AMOUNT.equals(type)){
-                //授信额度
-                num =  reportCreditService.getCreditLineAll(map);
-            }else if(TYPE_PRODUCT_NUM.equals(type)){
-                //融资产品数量
-                num =  reportCompanyService.getFinanceProductNum(map);
-            }else if(TYPE_LOAN_NUM.equals(type)){
-                //融资开立数量
-                num =  reportCompanyService.getFinanceRecordNum(map);
-            }else if(TYPE_LOAN_AMOUNT.equals(type)){
-                //融资开立金额
-                num =  reportCreditService.financeRecordMonth(map);
-            }else if(TYPE_FINANCE_NUM.equals(type)){
-                //融信融资次数
-                num =  reportCompanyService.getFinanceNum(map);
-            }else if(TYPE_FINANCE_AMOUNT.equals(type)){
-                //融信融资金额
-                num =  reportCreditService.getFinancedBalance(map);
+                date = date.replaceAll("月","");
+                //年
+                date = year.concat("-").concat(CommonUtil.compare(date, "10") < 0 ? "0".concat(date) : date).concat("-31");
             }
+            Map map = new HashMap<>();
+            //入住供应商
+            map.put("type","02");
+            map.put("date",date);
+            String num = reportCompanyService.getCompanyNum(map);
+            Map coreMap = new HashMap<>();
+            //入住供应商
+            coreMap.put("type","01");
+            coreMap.put("date",date);
+            //入住核心企业
+            String coreNum = reportCompanyService.getCompanyNum(coreMap);
             data.add(num);
+            coreData.add(coreNum);
         }
-        //开立额度数据对象
+        //供应商数据对象
         Map dataMap = new HashMap();
-        dataMap.put("name","数量");
+        dataMap.put("name","供应商");
         dataMap.put("data",data);
         dataList.add(dataMap);
+        //核心企业数据对象
+        Map coreMap = new HashMap();
+        coreMap.put("name","核心企业");
+        coreMap.put("data",coreData);
+        dataList.add(coreMap);
         Map result = new HashMap();
         result.put("dataList",dataList);
         result.put("dateList",dateList);
@@ -484,7 +375,8 @@ public class ReportCompanyController 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;
     }

+ 83 - 24
sc-service/src/main/java/com/huyi/service/common/report/controller/ReportCreditController.java

@@ -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;
     }

+ 27 - 27
sc-service/src/main/java/com/huyi/service/conmany/controller/OwnCompanyManageController.java

@@ -212,25 +212,25 @@ public class OwnCompanyManageController extends BaseController
             throw new Exception("统一信用代码格式错误");
         }
         //联系人
-        String scyLegal = CommonUtil.objToString(map.get("scyLegal"));
-        if(CommonUtil.isEmpty(scyLegal)){
+        String nickName = CommonUtil.objToString(map.get("nickName"));
+        if(CommonUtil.isEmpty(nickName)){
             throw new Exception("联系人不能为空");
         }
-        if(scyLegal.length() > 30){
+        if(nickName.length() > 30){
             throw new Exception("联系人长度不能超过30字;请检查是否正确");
         }
         //联系电话
-        String scyPhone = CommonUtil.objToString(map.get("scyPhone"));
-        if(CommonUtil.isEmpty(scyPhone)){
+        String userName = CommonUtil.objToString(map.get("userName"));
+        if(CommonUtil.isEmpty(userName)){
             throw new Exception("联系电话不能为空");
         }
-        if(CommonUtil.isNotEmpty(scyPhone)) {
-            if(scyPhone.length() > 11){
+        if(CommonUtil.isNotEmpty(userName)) {
+            if(userName.length() > 11){
                 throw new Exception("手机号不能超过11位");
             }
             String checkPhone = "^1[3|4|5|6|7|8|9][0-9]\\d{8}$";
             Pattern regePhone = Pattern.compile(checkPhone);
-            Matcher matcherPhone = regePhone.matcher(scyPhone);
+            Matcher matcherPhone = regePhone.matcher(userName);
             boolean isMatPhone = matcherPhone.matches();
             if (!isMatPhone) {
                 throw new Exception("手机格式不正确");
@@ -274,15 +274,15 @@ public class OwnCompanyManageController extends BaseController
         iSysCompanyService.createSysCompany(sysCompany);
 
         LambdaQueryWrapper<SysUser> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-        lambdaQueryWrapper.eq(SysUser::getUserName, scyPhone);
+        lambdaQueryWrapper.eq(SysUser::getUserName, userName);
         List<SysUser> users = iSysUserService.findSysUsers(lambdaQueryWrapper);
         SysUser createUser = null;
         // 用户没有注册
         if (users.size() == 0) {
             String password = configService.selectConfigByKey("sys.user.initPassword");
             SysUser sysUser = new SysUser();
-            sysUser.setNickName(scyLegal);
-            sysUser.setUserName(scyPhone);
+            sysUser.setNickName(nickName);
+            sysUser.setUserName(userName);
             sysUser.setPassword(SecurityUtils.encryptPassword(password));
             iSysUserService.createSysUser(sysUser);
             createUser = iSysUserService.findSysUsers(lambdaQueryWrapper).get(0);
@@ -344,22 +344,22 @@ public class OwnCompanyManageController extends BaseController
 
 
         // flowable数据
-//        Map<String, Object> flowableRes = flowableService.addFlowableGroup(scyId, sysCompany.getScyName());
-//        if (!"200".equals(flowableRes.get("code"))) {
-//            throw new Exception("审批数据新增失败!");
-//        }
-//        flowableRes = flowableService.addFlowableGroup(alternateNumber, dept.getDeptName());
-//        if (!"200".equals(flowableRes.get("code"))) {
-//            throw new Exception("审批数据新增失败!");
-//        }
-//        flowableRes = flowableService.addFlowableUser(String.valueOf(createUser.getUserId()), createUser.getNickName(), scyId);
-//        if (!"200".equals(flowableRes.get("code"))) {
-//            throw new Exception("审批数据新增失败!");
-//        }
-//        flowableRes = flowableService.addFlowableUser(String.valueOf(createUser.getUserId()), createUser.getNickName(), alternateNumber);
-//        if (!"200".equals(flowableRes.get("code"))) {
-//            throw new Exception("审批数据新增失败!");
-//        }
+        Map<String, Object> flowableRes = flowableService.addFlowableGroup(scyId, sysCompany.getScyName());
+        if (!"200".equals(flowableRes.get("code"))) {
+            throw new Exception("审批数据新增失败!");
+        }
+        flowableRes = flowableService.addFlowableGroup(alternateNumber, dept.getDeptName());
+        if (!"200".equals(flowableRes.get("code"))) {
+            throw new Exception("审批数据新增失败!");
+        }
+        flowableRes = flowableService.addFlowableUser(String.valueOf(createUser.getUserId()), createUser.getNickName(), scyId);
+        if (!"200".equals(flowableRes.get("code"))) {
+            throw new Exception("审批数据新增失败!");
+        }
+        flowableRes = flowableService.addFlowableUser(String.valueOf(createUser.getUserId()), createUser.getNickName(), alternateNumber);
+        if (!"200".equals(flowableRes.get("code"))) {
+            throw new Exception("审批数据新增失败!");
+        }
 
         return R.ok();
     }

+ 15 - 7
sc-service/src/main/java/com/huyi/service/credit/controller/CreditHandleController.java

@@ -164,7 +164,8 @@ public class CreditHandleController extends BaseController {
                 //签收日期
                 financeInf.setZfiSignDate(createTime);
             }
-            //TODo 调用审批流
+            approvalService.coreConfirmationApproval(map);
+
         }else if("01".equals(flag)){//拒绝
             //已失效
             //TODo 给融资方经办人添加失效消息
@@ -293,7 +294,12 @@ public class CreditHandleController extends BaseController {
             financeInf.setZfiStatus("03");
         }
         financeInfService.updateById(financeInf);
-        //TODo 调用签收审批流
+        //通过
+        if("00".equals(flag)){
+            // 调用签收审批流
+            approvalService.addSignApproval(map);
+        }
+
         return AjaxResult.success();
     }
 
@@ -434,15 +440,17 @@ public class CreditHandleController extends BaseController {
         String coreStatus = financeInf.getZfiCoreStatus();
         //获取融资方审批状态
         String supplierStatus = financeInf.getZfiSupplierStatus();
+        //平台审批状态
+        String zfiPlatformStatus = financeInf.getZfiPlatformStatus();
         //节点
         String code = "";
         //供应商申请
         if("0".equals(createType)){
             if("00".equals(status) && "01".equals(coreStatus)){
-                //开立确权
+                //确权
                 code = "02";
             }
-            if("01".equals(status) && "01".equals(supplierStatus)){
+            if("01".equals(status) && "01".equals(supplierStatus) && "01".equals(zfiPlatformStatus)){
                 //签收
                 code = "00";
             }
@@ -450,10 +458,10 @@ public class CreditHandleController extends BaseController {
         //核心开立
         if("1".equals(createType)){
             if(CommonUtil.isEmpty(status) && "01".equals(coreStatus)){
-                //开立确权
+                //开立
                 code = "02";
             }
-            if("01".equals(status) && "01".equals(supplierStatus)){
+            if("01".equals(status) && "01".equals(supplierStatus) && "01".equals(zfiPlatformStatus)){
                 //签收
                 code = "00";
             }
@@ -461,7 +469,7 @@ public class CreditHandleController extends BaseController {
 
         //供应商开立
         if("2".equals(createType)){
-            if(CommonUtil.isEmpty(status) && "01".equals(supplierStatus)){
+            if(CommonUtil.isEmpty(status) && "01".equals(supplierStatus) && "01".equals(zfiPlatformStatus)){
                 //融资开立
                 code = "03";
             }

+ 0 - 1
sc-service/src/main/java/com/huyi/service/credit/controller/OwnCreditController.java

@@ -767,7 +767,6 @@ public class OwnCreditController extends BaseController {
         //插入数据
         financeInfService.createZcFinanceInf(inf);
         //核心开立
-        //TODO  申请融信  调用陈浩融资申请审批流   融信开立  调用陈浩的融信开立审批流
         if("1".equals(type)){
             map.put("zfiId",id);
             map.put("zfiCoreId",companyId);

+ 7 - 5
sc-service/src/main/java/com/huyi/service/credit/controller/OwnMessageController.java

@@ -252,15 +252,17 @@ public class OwnMessageController extends BaseController {
         String coreStatus = financeInf.getZfiCoreStatus();
         //获取融资方审批状态
         String supplierStatus = financeInf.getZfiSupplierStatus();
+        //平台审批状态
+        String zfiPlatformStatus = financeInf.getZfiPlatformStatus();
         //节点
         String code = "";
         //供应商申请
         if("0".equals(createType)){
             if("00".equals(status) && "01".equals(coreStatus)){
-                //开立确权
+                //确权
                 code = "02";
             }
-            if("01".equals(status) && "01".equals(supplierStatus)){
+            if("01".equals(status) && "01".equals(supplierStatus) && "01".equals(zfiPlatformStatus)){
                 //签收
                 code = "00";
             }
@@ -268,10 +270,10 @@ public class OwnMessageController extends BaseController {
         //核心开立
         if("1".equals(createType)){
             if(CommonUtil.isEmpty(status) && "01".equals(coreStatus)){
-                //开立确权
+                //开立
                 code = "02";
             }
-            if("01".equals(status) && "01".equals(supplierStatus)){
+            if("01".equals(status) && "01".equals(supplierStatus) && "01".equals(zfiPlatformStatus)){
                 //签收
                 code = "00";
             }
@@ -279,7 +281,7 @@ public class OwnMessageController extends BaseController {
 
         //供应商开立
         if("2".equals(createType)){
-            if(CommonUtil.isEmpty(status) && "01".equals(supplierStatus)){
+            if(CommonUtil.isEmpty(status) && "01".equals(supplierStatus) && "01".equals(zfiPlatformStatus)){
                 //融资开立
                 code = "03";
             }

+ 3 - 0
sc-service/src/main/resources/mapper/common/ReportCompanyMapper.xml

@@ -26,6 +26,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="type != null  and type != ''">
             AND scy_type = #{type}
         </if>
+        <if test="date != null  and date != ''">
+            AND DATE_FORMAT(create_time, '%Y-%m-%d') &lt;= #{date}
+        </if>
     </select>
 
     <!--已融资供应商数量-->

+ 15 - 3
sc-service/src/main/resources/mapper/common/ReportCreditMapper.xml

@@ -231,6 +231,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="managementCompanyId != null  and managementCompanyId != ''">
             AND zfp_management_id = #{managementCompanyId}
         </if>
+        <if test="startDate != null  and startDate != ''">
+            AND zfi_expire_date BETWEEN #{startDate} AND #{endDate}
+        </if>
+        <if test="zfpType != null  and zfpType != ''">
+            AND zfp_type = #{zfpType}
+        </if>
 
     </select>
 
@@ -256,8 +262,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="paramMap.coreCompanyId != null  and paramMap.coreCompanyId != ''">
             AND zfi_core_id = #{paramMap.coreCompanyId}
         </if>
-        <if test="zfpType != null  and zfpType != ''">
-            AND zfp_type = #{zfpType}
+        <if test="paramMap.zfpType != null  and paramMap.zfpType != ''">
+            AND zfp_type = #{paramMap.zfpType}
         </if>
         GROUP BY zfp_management_id
     </select>
@@ -285,6 +291,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="paramMap.coreCompanyId != null  and paramMap.coreCompanyId != ''">
             AND zfi_core_id = #{paramMap.coreCompanyId}
         </if>
+        <if test="paramMap.zfpType != null  and paramMap.zfpType != ''">
+            AND zfp_type = #{paramMap.zfpType}
+        </if>
         GROUP BY zfp_management_id
     </select>
 
@@ -312,7 +321,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND zfr_apply_status = #{applyStatus}
         </if>
         <if test="month != null  and month != ''">
-            AND DATE_FORMAT(zfi_sign_date, '%Y-%c') = #{month}
+            AND DATE_FORMAT(zfi_sign_date, '%Y-%m') = #{month}
+        </if>
+        <if test="returnMonth != null  and returnMonth != ''">
+            AND DATE_FORMAT(zfr_pay_date, '%Y-%m') = #{returnMonth}
         </if>
         <if test="returnDate != null  and returnDate != ''">
             AND DATE_FORMAT(zfr_pay_date, '%Y-%m-%d') = #{returnDate}

+ 1 - 1
sc-service/src/main/resources/mapper/credit/OwnCreditMapper.xml

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             ON s.scy_id = f.zfi_core_id
             LEFT JOIN zc_finance_product p
             ON p.zfp_id = f.zfi_product_id
-            WHERE f.zfi_status != '99'
+            WHERE (f.zfi_status != '99' or f.zfi_status is null)
 
         <if test="paramMap.companyType != null  and paramMap.zfiId != '' and paramMap.companyId != null  and paramMap.companyId != ''">
             <!--核心企业 开立方是自己的-->