|
|
@@ -15,7 +15,6 @@ import com.tianhu.common.log.annotation.Log;
|
|
|
import com.tianhu.common.log.enums.BusinessType;
|
|
|
import com.tianhu.common.security.annotation.PreAuthorize;
|
|
|
import com.tianhu.common.security.service.TokenService;
|
|
|
-import com.tianhu.system.api.RemoteCommonService;
|
|
|
import com.tianhu.system.api.RemoteSystemService;
|
|
|
import com.tianhu.system.api.model.LoginUser;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -52,9 +51,6 @@ public class FlowableController extends BaseController
|
|
|
*/
|
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private RemoteCommonService remoteCommonService;
|
|
|
@Autowired
|
|
|
private ApprovalService approvalService;
|
|
|
@Autowired
|
|
|
@@ -68,6 +64,12 @@ public class FlowableController extends BaseController
|
|
|
@Autowired
|
|
|
private IZcFinanceProductService iZcFinanceProductService;
|
|
|
@Autowired
|
|
|
+ private ISysUserCompanyRelService sysUserCompanyRelService;
|
|
|
+ @Autowired
|
|
|
+ private ISysUserService sysUserService;
|
|
|
+ @Autowired
|
|
|
+ private ISysCompanyService sysCompanyService;
|
|
|
+ @Autowired
|
|
|
private ISysUserService iSysUserService;
|
|
|
@Autowired
|
|
|
private ISysUserCompanyRelService iSysUserCompanyRelService;
|
|
|
@@ -196,16 +198,31 @@ public class FlowableController extends BaseController
|
|
|
//审批通过
|
|
|
zcFinanceInf.setZfiSupplierStatus("01");
|
|
|
zcFinanceInfService.update(zcFinanceInf,lambdaQueryWrapper);
|
|
|
+ //查询发起人,融资企业Id
|
|
|
+ ZcFinanceInf financeInf = zcFinanceInfService.getById(zfiId);
|
|
|
+ //发起人Id
|
|
|
+ Long user = Long.valueOf(financeInf.getCreateBy());
|
|
|
+ //融资企业
|
|
|
+ String company = financeInf.getZfiSupplierId();
|
|
|
+ //融信编号
|
|
|
+ String number = financeInf.getZfiNumber();
|
|
|
+ //创建时间
|
|
|
+ String createTime = DateUtils.parseDateToStr("yyyy-mm-dd hh:MM:ss",financeInf.getCreateTime());;
|
|
|
+ //创建人名称
|
|
|
+ SysUser sysUser = sysUserService.getById(user);
|
|
|
+ String userName = sysUser.getNickName();
|
|
|
+ List list = new ArrayList();
|
|
|
+ list.add(user);
|
|
|
//TODO 发起人最终结果【通过】消息通知
|
|
|
+ String title = "【审批通过】由"+ userName +"于"+ createTime +"发起的:融信"+ number +"资料审核已通过,请进行下一步业务操作;";
|
|
|
+ remoteSystemService.sendNotice(company,zfiId,title,"01","01","","0",list,"");
|
|
|
//调用平台审批接口
|
|
|
- ZcFinanceInf inf = zcFinanceInfService.getById(zfiId);
|
|
|
Map map = new HashMap();
|
|
|
//实体类转map
|
|
|
- BeanMap beanMap = BeanMap.create(inf);
|
|
|
+ BeanMap beanMap = BeanMap.create(financeInf);
|
|
|
for (Object key : beanMap.keySet()) {
|
|
|
map.put(key + "", beanMap.get(key));
|
|
|
}
|
|
|
- map.put("zfiId",zfiId);
|
|
|
approvalService.addPlatformApproval(map);
|
|
|
}//融资企业融信开立审批通过
|
|
|
else if("1000000001".equals(menuId)){
|
|
|
@@ -245,14 +262,50 @@ public class FlowableController extends BaseController
|
|
|
//融资方审批状态(00:审批中, 01:审批通过, 02:审批拒绝, 03:暂存)
|
|
|
financeInf.setZfiSupplierStatus("01");
|
|
|
//融信状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资 06:平台退回)
|
|
|
- //TODO 不更改融信状态
|
|
|
- financeInf.setZfiStatus("02");
|
|
|
+// financeInf.setZfiStatus("02");
|
|
|
//签收日期
|
|
|
financeInf.setZfiSignDate(DateUtils.getNowDate());
|
|
|
zcFinanceInfService.updateById(financeInf);
|
|
|
//TODO 给融资企业经办人生成盖章待办
|
|
|
+ //融资企业Id
|
|
|
+ String company = inf.getZfiSupplierId();
|
|
|
+ //融资企业名称
|
|
|
+ SysCompany sysCompany = sysCompanyService.getById(company);
|
|
|
+ String companyName = sysCompany.getScyName();
|
|
|
+ //融信编码
|
|
|
+ String zfiNumber = inf.getZfiNumber();
|
|
|
+ //经办人
|
|
|
+ LambdaQueryWrapper<SysUserCompanyRel> queryWrapper = new LambdaQueryWrapper();
|
|
|
+ queryWrapper.eq(SysUserCompanyRel::getSucrCompanyId,company);
|
|
|
+ queryWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
|
|
|
+ List<SysUserCompanyRel> list = sysUserCompanyRelService.findSysUserCompanyRels(queryWrapper);
|
|
|
+ Long user = null;
|
|
|
+ if(list.size()>0){
|
|
|
+ user = list.get(0).getSucrUserId();
|
|
|
+ }
|
|
|
+ List userList = new ArrayList();
|
|
|
+ userList.add(user);
|
|
|
+ String title = "【合同签署】由【" + companyName +"】发起的融信【" + zfiNumber + "】资料待签署合同";
|
|
|
+ remoteSystemService.sendNotice(company,zfiId,"title","00","","03","1",userList,"");
|
|
|
}
|
|
|
//TODO 发起人最终结果【通过】消息通知
|
|
|
+ //查询发起人,融资企业Id
|
|
|
+ ZcFinanceInf financeInf = zcFinanceInfService.getById(zfiId);
|
|
|
+ //发起人Id
|
|
|
+ Long user = Long.valueOf(financeInf.getCreateBy());
|
|
|
+ //融资企业
|
|
|
+ String company = financeInf.getZfiSupplierId();
|
|
|
+ //融信编号
|
|
|
+ String number = financeInf.getZfiNumber();
|
|
|
+ //创建时间
|
|
|
+ String createTime = DateUtils.parseDateToStr("yyyy-mm-dd hh:MM:ss",financeInf.getCreateTime());;
|
|
|
+ //创建人名称
|
|
|
+ SysUser sysUser = sysUserService.getById(user);
|
|
|
+ String userName = sysUser.getNickName();
|
|
|
+ List list = new ArrayList();
|
|
|
+ list.add(user);
|
|
|
+ String title = "【审批通过】由"+ userName +"于"+ createTime +"发起的:融信"+ number +"资料审核已通过,请进行下一步业务操作;";
|
|
|
+ remoteSystemService.sendNotice(company,zfiId,title,"01","01","","0",list,"");
|
|
|
}//融资企业补充资料审批通过
|
|
|
else if("1000000003".equals(menuId)){
|
|
|
LambdaQueryWrapper<ZcFinanceInf> wrapper = new LambdaQueryWrapper<>();
|
|
|
@@ -423,6 +476,7 @@ public class FlowableController extends BaseController
|
|
|
else if("1000000002".equals(menuId)){
|
|
|
LambdaQueryWrapper<ZcFinanceInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
String [] arr = id.split("\\|");
|
|
|
+ String zfiId = arr[0];
|
|
|
lambdaQueryWrapper.eq(ZcFinanceInf::getZfiId,arr[0]);
|
|
|
//lambdaQueryWrapper.eq(WcContractInf::getCifCompanyId,arr[1]);
|
|
|
ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
@@ -430,32 +484,70 @@ public class FlowableController extends BaseController
|
|
|
|
|
|
if("delete".equals(state)){
|
|
|
zcFinanceInf.setZfiSupplierStatus("02");
|
|
|
- //TODO 删除
|
|
|
- }else if("recall".equals(state)){
|
|
|
- //撤回
|
|
|
- //更改为保存状态
|
|
|
- zcFinanceInf.setZfiSupplierStatus("03");
|
|
|
}
|
|
|
+// else if("recall".equals(state)){
|
|
|
+// //撤回
|
|
|
+// //更改为保存状态
|
|
|
+// zcFinanceInf.setZfiSupplierStatus("03");
|
|
|
+// }
|
|
|
zcFinanceInfService.update(zcFinanceInf,lambdaQueryWrapper);
|
|
|
//TODO 发起人最终结果【拒绝】消息通知
|
|
|
+ //查询发起人,融资企业Id
|
|
|
+ ZcFinanceInf financeInf = zcFinanceInfService.getById(zfiId);
|
|
|
+ //发起人Id
|
|
|
+ Long user = Long.valueOf(financeInf.getCreateBy());
|
|
|
+ //融资企业
|
|
|
+ String company = financeInf.getZfiSupplierId();
|
|
|
+ //融信编号
|
|
|
+ String number = financeInf.getZfiNumber();
|
|
|
+ //创建时间
|
|
|
+ String createTime = DateUtils.parseDateToStr("yyyy-mm-dd hh:MM:ss",financeInf.getCreateTime());;
|
|
|
+ //创建人名称
|
|
|
+ SysUser sysUser = sysUserService.getById(user);
|
|
|
+ String userName = sysUser.getNickName();
|
|
|
+ List list = new ArrayList();
|
|
|
+ list.add(user);
|
|
|
+ String title = "【审批拒绝】由"+ userName +"于"+ createTime +"发起的:融信"+ number +"审批被拒绝,拒绝的理由为:"+ reason;
|
|
|
+ remoteSystemService.sendNotice(company,zfiId,title,"01","01","","0",list,"");
|
|
|
//TODO 发起人生成待办
|
|
|
+ title = "【内部审批】融信【"+number+"】资料待审批,审批发起人【" + userName +"】";
|
|
|
+ remoteSystemService.sendNotice(company,zfiId,title,"00","","01","0",list,"");
|
|
|
}//融资企业融信开立拒绝
|
|
|
else if("1000000001".equals(menuId)){
|
|
|
LambdaQueryWrapper<ZcFinanceInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
String [] arr = id.split("\\|");
|
|
|
+ String zfiId = arr[0];
|
|
|
lambdaQueryWrapper.eq(ZcFinanceInf::getZfiId,arr[0]);
|
|
|
//lambdaQueryWrapper.eq(WcContractInf::getCifCompanyId,arr[1]);
|
|
|
ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
//审批拒绝
|
|
|
if("delete".equals(state)){
|
|
|
zcFinanceInf.setZfiSupplierStatus("02");
|
|
|
- }else if("recall".equals(state)){
|
|
|
- //撤回
|
|
|
- //更改为保存状态
|
|
|
- zcFinanceInf.setZfiSupplierStatus("03");
|
|
|
}
|
|
|
+// else if("recall".equals(state)){
|
|
|
+// //撤回
|
|
|
+// //更改为保存状态
|
|
|
+// zcFinanceInf.setZfiSupplierStatus("03");
|
|
|
+// }
|
|
|
zcFinanceInfService.update(zcFinanceInf,lambdaQueryWrapper);
|
|
|
//TODO 发起人最终结果【拒绝】消息通知
|
|
|
+ //查询发起人,融资企业Id
|
|
|
+ ZcFinanceInf financeInf = zcFinanceInfService.getById(zfiId);
|
|
|
+ //发起人Id
|
|
|
+ Long user = Long.valueOf(financeInf.getCreateBy());
|
|
|
+ //融资企业
|
|
|
+ String company = financeInf.getZfiSupplierId();
|
|
|
+ //融信编号
|
|
|
+ String number = financeInf.getZfiNumber();
|
|
|
+ //创建时间
|
|
|
+ String createTime = DateUtils.parseDateToStr("yyyy-mm-dd hh:MM:ss",financeInf.getCreateTime());;
|
|
|
+ //创建人名称
|
|
|
+ SysUser sysUser = sysUserService.getById(user);
|
|
|
+ String userName = sysUser.getNickName();
|
|
|
+ List list = new ArrayList();
|
|
|
+ list.add(user);
|
|
|
+ String title = "【审批拒绝】由"+ userName +"于"+ createTime +"发起的:融信"+ number +"审批被拒绝,拒绝的理由为:"+reason;
|
|
|
+ remoteSystemService.sendNotice(company,zfiId,title,"01","01","","0",list,"");
|
|
|
}//融资企业补充资料审批拒绝
|
|
|
else if("1000000003".equals(menuId)){
|
|
|
LambdaQueryWrapper<ZcFinanceInf> wrapper = new LambdaQueryWrapper<>();
|