|
@@ -1,15 +1,19 @@
|
|
|
-package com.huyi.task.taskMan.controller;
|
|
|
+package com.huyi.task.taskMan.schedule;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.huyi.task.base.entity.SysCompany;
|
|
|
import com.huyi.task.base.entity.SysUser;
|
|
|
+import com.huyi.task.base.entity.SysUserCompanyRel;
|
|
|
import com.huyi.task.base.service.ISysCompanyService;
|
|
|
+import com.huyi.task.base.service.ISysUserCompanyRelService;
|
|
|
import com.huyi.task.base.service.ISysUserService;
|
|
|
import com.huyi.task.taskMan.service.IOwnTaskManService;
|
|
|
-import com.keao.tianhu.core.util.AmtUtil;
|
|
|
import com.tianhu.common.core.utils.CommonUtil;
|
|
|
+import com.tianhu.common.core.utils.ConvertUpMoneyUtil;
|
|
|
import com.tianhu.common.core.utils.DateUtils;
|
|
|
import com.tianhu.common.redis.common.RedisUtils;
|
|
|
+import com.tianhu.system.api.RemoteConfigService;
|
|
|
import com.tianhu.system.api.RemoteSystemService;
|
|
|
import lombok.SneakyThrows;
|
|
|
import org.slf4j.Logger;
|
|
@@ -26,8 +30,8 @@ import java.util.Map;
|
|
|
|
|
|
@Configuration //1.主要用于标记配置类,兼备Component的效果。
|
|
|
@EnableScheduling // 2.开启定时任务
|
|
|
-public class TimedTaskController {
|
|
|
- private static final Logger log = LoggerFactory.getLogger(TimedTaskController.class);
|
|
|
+public class TimedTask {
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(TimedTask.class);
|
|
|
|
|
|
@Autowired
|
|
|
private IOwnTaskManService ownTaskManService;
|
|
@@ -37,6 +41,10 @@ public class TimedTaskController {
|
|
|
private ISysCompanyService sysCompanyService;
|
|
|
@Autowired
|
|
|
private ISysUserService sysUserService;
|
|
|
+ @Autowired
|
|
|
+ private RemoteConfigService configService;
|
|
|
+ @Autowired
|
|
|
+ private ISysUserCompanyRelService sysUserCompanyRelService;
|
|
|
|
|
|
/**
|
|
|
* 还款提醒跑批
|
|
@@ -78,11 +86,11 @@ public class TimedTaskController {
|
|
|
String number = CommonUtil.objToString(res.get("zfiNumber"));
|
|
|
if("2".equals(createType)){
|
|
|
//到期前30天发送消息
|
|
|
- String title = "【到期还款】您开立给【"+companyName+"】的一笔【"+amount+"】(大写:"+ AmtUtil.convert(amount)+")的融信【"+number+"】,将于【"+repaymentDate+"】还款,请尽快处理;";
|
|
|
+ String title = "【到期还款】您开立给【"+companyName+"】的一笔【"+amount+"】(大写:"+ ConvertUpMoneyUtil.toChinese(amount)+")的融信【"+number+"】,将于【"+repaymentDate+"】还款,请尽快处理;";
|
|
|
remoteSystemService.sendNotice(companyId, zfrId,title,"01","06","","0",user,"","","");
|
|
|
}else{
|
|
|
//到期前30天发送消息
|
|
|
- String title = "【到期还款】您开立给【"+companyName+"】的一笔【"+amount+"】(大写:"+AmtUtil.convert(amount)+")的融信【"+number+"】,将于【"+repaymentDate+"】还款,请尽快处理;";
|
|
|
+ String title = "【到期还款】您开立给【"+companyName+"】的一笔【"+amount+"】(大写:"+ConvertUpMoneyUtil.toChinese(amount)+")的融信【"+number+"】,将于【"+repaymentDate+"】还款,请尽快处理;";
|
|
|
remoteSystemService.sendNotice(coreCompany, zfrId,title,"01","06","","0",handler,"","","");
|
|
|
}
|
|
|
}
|
|
@@ -114,13 +122,13 @@ public class TimedTaskController {
|
|
|
String coreCompany = CommonUtil.objToString(res.get("coreCompany"));
|
|
|
//到期前7天生成待办
|
|
|
if("2".equals(createType)){
|
|
|
- //到期前7天发送消息
|
|
|
- String title = "【还款待办】您签发的融信【"+number+"】将于【"+repaymentDate+"】还款,还款金额【"+amount+"】(大写:"+AmtUtil.convert(amount)+"),请尽快处理;";
|
|
|
- remoteSystemService.sendNotice(companyId, zfrId,title,"00","","06","0",user,"","","");
|
|
|
+ //到期前7天生成待办
|
|
|
+ String title = "【还款待办】您签发的融信【"+number+"】将于【"+repaymentDate+"】还款,还款金额【"+amount+"】(大写:"+ ConvertUpMoneyUtil.toChinese(amount)+"),请尽快处理;";
|
|
|
+ remoteSystemService.sendNotice(companyId, zfrId,title,"00","","06","0",user,"","00","");
|
|
|
}else{
|
|
|
- //到期前7天发送消息
|
|
|
- String title = "【还款待办】您签发的融信【"+number+"】将于【"+repaymentDate+"】还款,还款金额【"+amount+"】(大写:"+AmtUtil.convert(amount)+"),请尽快处理;";
|
|
|
- remoteSystemService.sendNotice(coreCompany, zfrId,title,"00","","06","0",handler,"","","");
|
|
|
+ //到期前7天生成待办
|
|
|
+ String title = "【还款待办】您签发的融信【"+number+"】将于【"+repaymentDate+"】还款,还款金额【"+amount+"】(大写:"+ConvertUpMoneyUtil.toChinese(amount)+"),请尽快处理;";
|
|
|
+ remoteSystemService.sendNotice(coreCompany, zfrId,title,"00","","06","0",handler,"","00","");
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -177,13 +185,32 @@ public class TimedTaskController {
|
|
|
for(Map res :list){
|
|
|
//主键
|
|
|
String zfrId = CommonUtil.objToString(res.get("zfrId"));
|
|
|
- //经办人Id
|
|
|
- String user = CommonUtil.objToString(res.get("userId"));
|
|
|
- List userList = new ArrayList();
|
|
|
- userList.add(user);
|
|
|
+ //融信编号
|
|
|
+ String number = CommonUtil.objToString(res.get("zfiNumber"));
|
|
|
+ //还款金额
|
|
|
+ String amount = CommonUtil.objToString(res.get("loanAmount"));
|
|
|
+ //还款时间
|
|
|
+ String repaymentDate = CommonUtil.objToString(res.get("zfrRepaymentDate"));
|
|
|
+ //核心企业Id
|
|
|
+ String coreId = CommonUtil.objToString(res.get("zfiCoreId"));
|
|
|
+ SysCompany sysCompany = sysCompanyService.getById(coreId);
|
|
|
+ //核心企业名称
|
|
|
+ String coreName = sysCompany.getScyName();
|
|
|
+ //平台部门Id
|
|
|
+ String deptId = configService.selectConfigByKey("platform_dept").getMsg();
|
|
|
+ //平台部门所含人员
|
|
|
+ String user = "";
|
|
|
+ LambdaQueryWrapper<SysUserCompanyRel> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(SysUserCompanyRel::getSucrDeptId,deptId);
|
|
|
+ queryWrapper.eq(SysUserCompanyRel::getSucrCompanyId,"000000");
|
|
|
+ List<SysUserCompanyRel> userList = sysUserCompanyRelService.findSysUserCompanyRels(queryWrapper);
|
|
|
+ for (SysUserCompanyRel sysUser:userList) {
|
|
|
+ user += CommonUtil.objToString(sysUser.getSucrUserId())+",";
|
|
|
+ }
|
|
|
//到期前3天平台内部待办 参数: 企业,表主键,标题,类型(00:待办 01:消息),消息类型(00:费用提醒01:发票寄出02:到期还款)
|
|
|
//待办类型(00:待审批01:链属企业申请02:融信失效03:还款),是否发送短信(0:不发1:发),收到信息用户集合,短信模板
|
|
|
- remoteSystemService.sendNotice("000000", zfrId,"","00","","07","0",user,"","","");
|
|
|
+ String title = "【还款待办】【"+coreName+"】融信【"+number+"】融信金额【"+amount+"】(大写:"+ConvertUpMoneyUtil.toChinese(amount)+")将于【"+repaymentDate+"】还款,请相关人员跟进!";
|
|
|
+ remoteSystemService.sendNotice("000000", zfrId,title,"00","","07","0",user,"","00",null);
|
|
|
}
|
|
|
}
|
|
|
}
|