|
@@ -8,6 +8,7 @@ import com.huyi.service.common.financeLog.FinanceLog;
|
|
|
import com.huyi.service.constant.FileConstants;
|
|
|
import com.huyi.service.credit.service.OwnCreditService;
|
|
|
import com.huyi.service.util.DocumentConstant;
|
|
|
+import com.huyi.service.util.FlowableService;
|
|
|
import com.keao.tianhu.core.util.AmtUtil;
|
|
|
import com.tianhu.common.core.cfca.AxqCommonUtil;
|
|
|
import com.tianhu.common.core.cfca.CfcaUtil;
|
|
@@ -109,6 +110,10 @@ public class OwnMessageController extends BaseController {
|
|
|
//往来账款服务类
|
|
|
@Autowired
|
|
|
private IZcBillInfService billInfService;
|
|
|
+ @Autowired
|
|
|
+ private FlowableService flowableService;
|
|
|
+ @Autowired
|
|
|
+ private ISysUserService iSysUserService;
|
|
|
|
|
|
/**
|
|
|
* 发送短信
|
|
@@ -690,6 +695,13 @@ public class OwnMessageController extends BaseController {
|
|
|
if(coreHanderList.size() > 0){
|
|
|
coreHandler = CommonUtil.objToString(coreHanderList.get(0).getSucrUserId());
|
|
|
}
|
|
|
+
|
|
|
+ //发起人Id
|
|
|
+ Long createId = Long.valueOf(financeInf.getCreateBy());
|
|
|
+ //根据发起人Id获取发送人姓名
|
|
|
+ com.huyi.service.base.entity.SysUser sysUser = iSysUserService.getById(createId);
|
|
|
+ //姓名
|
|
|
+ String userName = sysUser.getNickName();
|
|
|
//核心开立
|
|
|
if("1".equals(createType)){
|
|
|
//核心企业
|
|
@@ -763,6 +775,41 @@ public class OwnMessageController extends BaseController {
|
|
|
finance.setZfiId(zfiId);
|
|
|
//待签收
|
|
|
finance.setZfiStatus("01");
|
|
|
+ //查询融资方有没有开启签收审批
|
|
|
+ Map<String,Object> pp = new HashMap<>();
|
|
|
+ //menuId
|
|
|
+ pp.put("menuId","1000000005");
|
|
|
+ pp.put("companyId",zfiSupplierId);
|
|
|
+ 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>> openList = (List<Map<String, Object>>) mmp.get("data");
|
|
|
+ //未开启流程审批
|
|
|
+ if(openList.size() < 1){
|
|
|
+ //融资企业通过
|
|
|
+ finance.setZfiSupplierStatus("01");
|
|
|
+ String tittle = "【融资企业签收】由【"+openName+"】发起的融信编号为【"+ financeInf.getZfiNumber()+"】的资料待签署";
|
|
|
+ remoteSystemService.sendNotice(companyId,zfiId,tittle,"00","","03","0",financeInf.getCreateBy(),"", "01", "/credit/signFor/"+zfiId);
|
|
|
+ //签收待办改为已办
|
|
|
+ LambdaQueryWrapper<SysNotice> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(SysNotice::getTableId,zfiId);
|
|
|
+ queryWrapper.eq(SysNotice::getType,"00");
|
|
|
+ queryWrapper.eq(SysNotice::getWorkType,"04");
|
|
|
+ queryWrapper.eq(SysNotice::getStatus,"0");
|
|
|
+ SysNotice notice = new SysNotice();
|
|
|
+ notice.setStatus("1");
|
|
|
+ sysNoticeService.update(notice,queryWrapper);
|
|
|
+ }else{
|
|
|
+ //给融资企业经办人生成签收待办
|
|
|
+ String title = "【融资签收】"+openName+"的【"+zfiNumber+"】,融信金额【"+AmtUtil.moneyFormat(zfiAmount)+"】,(大写:"+zfiAmountBig+"),融信待签收";
|
|
|
+ remoteSystemService.sendNotice(zfiSupplierId,zfiId,title,"00","","04","0",supplierHandler,"", "01", "/credit/signFor/"+zfiId);
|
|
|
+
|
|
|
+ /**融信操作日志*/
|
|
|
+ financeLog.addFinanceLog(zfiId, "融信确权【通过】,融信提交于《"+receiverName+"》签收", user.getUserId(), FinanceLog.STATUS_TWO);
|
|
|
+ financeLog.addFinanceLog(zfiId, "《"+receiverName+"》待签收", user.getUserId(), FinanceLog.STATUS_TWO);
|
|
|
+ }
|
|
|
//修改时间
|
|
|
finance.setUpdateTime(DateUtils.getNowDate());
|
|
|
//修改人
|
|
@@ -774,13 +821,7 @@ public class OwnMessageController extends BaseController {
|
|
|
if(num != 1){
|
|
|
throw new Exception("盖章异常");
|
|
|
}
|
|
|
- //给融资企业经办人生成签收待办
|
|
|
- String title = "【融资签收】"+openName+"的【"+zfiNumber+"】,融信金额【"+AmtUtil.moneyFormat(zfiAmount)+"】,(大写:"+zfiAmountBig+"),融信待签收";
|
|
|
- remoteSystemService.sendNotice(zfiSupplierId,zfiId,title,"00","","04","0",supplierHandler,"", "01", "/credit/signFor/"+zfiId);
|
|
|
|
|
|
- /**融信操作日志*/
|
|
|
- financeLog.addFinanceLog(zfiId, "融信确权【通过】,融信提交于《"+receiverName+"》签收", user.getUserId(), FinanceLog.STATUS_TWO);
|
|
|
- financeLog.addFinanceLog(zfiId, "《"+receiverName+"》待签收", user.getUserId(), FinanceLog.STATUS_TWO);
|
|
|
|
|
|
}else if("02".equals(companyType)){
|
|
|
//融资企业
|
|
@@ -870,14 +911,47 @@ public class OwnMessageController extends BaseController {
|
|
|
finance.setZfiId(zfiId);
|
|
|
//待确权
|
|
|
finance.setZfiStatus("00");
|
|
|
+ //查询核心企业有无开启确权审批
|
|
|
+ Map<String,Object> pp = new HashMap<>();
|
|
|
+ //menuId
|
|
|
+ pp.put("menuId","1000000007");
|
|
|
+ pp.put("companyId",zfiCoreId);
|
|
|
+ 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>> openList = (List<Map<String, Object>>) mmp.get("data");
|
|
|
+ //没有开启确权审批
|
|
|
+ if(openList.size() < 1){
|
|
|
+ //核心审批通过
|
|
|
+ finance.setZfiCoreStatus("01");
|
|
|
+ remoteSystemService.sendNotice(zfiCoreId, zfiId,
|
|
|
+ "确权审批融信编号为" + zfiNumber + "的资料待盖章,审批发起人为" + userName,
|
|
|
+ "00",null,"03","0", coreHandler,null, "01", "/credit/confirmationAudit/" + zfiId);
|
|
|
+ //TODO 经办人发送最终消息通知
|
|
|
+ remoteSystemService.sendNotice(zfiCoreId, zfiId,
|
|
|
+ "确权审批融信编号为" + zfiNumber + "的资料审批已通过",
|
|
|
+ "01","01",null,"0", coreHandler, null, null, null);
|
|
|
+ //确权待办改为已办
|
|
|
+ LambdaQueryWrapper<SysNotice> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(SysNotice::getTableId,zfiId);
|
|
|
+ queryWrapper.eq(SysNotice::getType,"00");
|
|
|
+ queryWrapper.eq(SysNotice::getWorkType,"02");
|
|
|
+ queryWrapper.eq(SysNotice::getStatus,"0");
|
|
|
+ SysNotice notice = new SysNotice();
|
|
|
+ notice.setStatus("1");
|
|
|
+ sysNoticeService.update(notice,queryWrapper);
|
|
|
+ }else{
|
|
|
+ //给核心企业经办人生成一条确权待办
|
|
|
+ String title = "【融信待确权】由"+receiverName+"提交的融信【"+zfiNumber+"】,融信金额【"+AmtUtil.moneyFormat(zfiAmount)+"】,(大写:"+zfiAmountBig+"),融信待确权";
|
|
|
+ remoteSystemService.sendNotice(zfiCoreId,zfiId,title,"00","","02","0",coreHandler,"", "01", "/credit/confirmationAudit/"+zfiId);
|
|
|
+ }
|
|
|
//修改时间
|
|
|
finance.setUpdateTime(DateUtils.getNowDate());
|
|
|
//修改人
|
|
|
finance.setUpdateBy(userId);
|
|
|
financeInfService.updateById(finance);
|
|
|
- //给核心企业经办人生成一条确权待办
|
|
|
- String title = "【融信待确权】由"+receiverName+"提交的融信【"+zfiNumber+"】,融信金额【"+AmtUtil.moneyFormat(zfiAmount)+"】,(大写:"+zfiAmountBig+"),融信待确权";
|
|
|
- remoteSystemService.sendNotice(zfiCoreId,zfiId,title,"00","","02","0",coreHandler,"", "01", "/credit/confirmationAudit/"+zfiId);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -885,11 +959,7 @@ public class OwnMessageController extends BaseController {
|
|
|
LambdaQueryWrapper<SysNotice> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(SysNotice::getTableId,zfiId);
|
|
|
queryWrapper.eq(SysNotice::getType,"00");
|
|
|
- List<String> typeList = new ArrayList<>();
|
|
|
- typeList.add("02");
|
|
|
- typeList.add("03");
|
|
|
- typeList.add("04");
|
|
|
- queryWrapper.in(SysNotice::getWorkType,typeList);
|
|
|
+ queryWrapper.eq(SysNotice::getWorkType,"03");
|
|
|
queryWrapper.eq(SysNotice::getStatus,"0");
|
|
|
SysNotice notice = new SysNotice();
|
|
|
notice.setStatus("1");
|