no message
This commit is contained in:
parent
37b6b1287b
commit
9bbd62e9e9
@ -72,8 +72,8 @@ export default {
|
|||||||
// let remainingTransactionVolume = estimatedTransactionVolume - prepaidAmount;
|
// let remainingTransactionVolume = estimatedTransactionVolume - prepaidAmount;
|
||||||
let remainingTransactionVolume = estimatedTransactionVolume - this.payMoney;
|
let remainingTransactionVolume = estimatedTransactionVolume - this.payMoney;
|
||||||
|
|
||||||
this.form.estimatedTransactionVolume = estimatedTransactionVolume;
|
this.form.estimatedTransactionVolume = estimatedTransactionVolume/10000;
|
||||||
this.form.remainingTransactionVolume = remainingTransactionVolume;
|
this.form.remainingTransactionVolume = remainingTransactionVolume/10000;
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -146,7 +146,7 @@
|
|||||||
<!-- <!– 添加其他选项 –>-->
|
<!-- <!– 添加其他选项 –>-->
|
||||||
<!-- </el-select>-->
|
<!-- </el-select>-->
|
||||||
<el-input v-model="condition.value" placeholder="请输入数值" style="width: 200px;margin-right: 10px">
|
<el-input v-model="condition.value" placeholder="请输入数值" style="width: 200px;margin-right: 10px">
|
||||||
<template slot="append">{{ condition.field === '剩余交易量' || condition.field === '系统服务有效期' ? '万元' : '天' }}</template>
|
<template slot="append">{{ condition.field === '剩余交易量' || condition.field === '系统服务费统计' ? '万元' : '天' }}</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-button @click="removeCondition(index)" type="danger" icon="el-icon-delete" circle></el-button>
|
<el-button @click="removeCondition(index)" type="danger" icon="el-icon-delete" circle></el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -367,6 +367,9 @@ export default {
|
|||||||
});
|
});
|
||||||
return
|
return
|
||||||
}else {
|
}else {
|
||||||
|
if (!this.form.conditions) {
|
||||||
|
this.form.conditions = []
|
||||||
|
}
|
||||||
this.form.conditions.push({ field: '', operator: '', value: '' });
|
this.form.conditions.push({ field: '', operator: '', value: '' });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -102,7 +102,7 @@ public class DeptTransactionInfoServiceImpl implements DeptTransactionInfoServic
|
|||||||
public DeptTransactionInfo insert(DeptTransactionInfo deptTransactionInfo) {
|
public DeptTransactionInfo insert(DeptTransactionInfo deptTransactionInfo) {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
deptTransactionInfo.setCreateName(nowAccountInfo.getRealName());
|
deptTransactionInfo.setCreateName(nowAccountInfo.getRealName());
|
||||||
deptTransactionInfo.setDeptId(nowAccountInfo.getDeptId());
|
// deptTransactionInfo.setDeptId(nowAccountInfo.getDeptId());
|
||||||
|
|
||||||
// 查询当前是否有进行中的数据,没有则更新状态
|
// 查询当前是否有进行中的数据,没有则更新状态
|
||||||
DeptTransactionInfo deptTransactionInfo1 = this.deptTransactionInfoMapper.queryByDeptId(nowAccountInfo.getDeptId());
|
DeptTransactionInfo deptTransactionInfo1 = this.deptTransactionInfoMapper.queryByDeptId(nowAccountInfo.getDeptId());
|
||||||
|
@ -77,9 +77,9 @@ template_status,create_by,update_by,update_time,create_time,create_name,conditio
|
|||||||
|
|
||||||
<!--新增所有列-->
|
<!--新增所有列-->
|
||||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||||
insert into sys_notify(notification_name,notification_type,template_content,recipient_roles,template_status,conditions,create_name,conditions)
|
insert into sys_notify(notification_name,notification_type,template_content,recipient_roles,template_status,conditions,create_name)
|
||||||
values (#{notificationName},#{notificationType},#{templateContent},#{recipientRoles},#{templateStatus},#{conditions},#{createName},
|
values (#{notificationName},#{notificationType},#{templateContent},#{recipientRoles},#{templateStatus},#{conditions},#{createName}
|
||||||
#{conditions})
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.alibaba.fastjson.TypeReference;
|
import com.alibaba.fastjson.TypeReference;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -39,6 +40,7 @@ import com.fuint.common.dto.AccountInfo;
|
|||||||
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
@ -108,9 +110,10 @@ public class SysNotifyServiceImpl extends ServiceImpl<SysNotifyMapper, SysNotif
|
|||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
// sysNotify.setStoreId(nowAccountInfo.getStoreId());
|
// sysNotify.setStoreId(nowAccountInfo.getStoreId());
|
||||||
sysNotify.setCreateName(nowAccountInfo.getRealName());
|
sysNotify.setCreateName(nowAccountInfo.getRealName());
|
||||||
sendNotify();
|
|
||||||
|
|
||||||
this.sysNotifyMapper.insert(sysNotify);
|
this.sysNotifyMapper.insert(sysNotify);
|
||||||
|
sendNotify();
|
||||||
|
|
||||||
return sysNotify;
|
return sysNotify;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,24 +151,39 @@ public class SysNotifyServiceImpl extends ServiceImpl<SysNotifyMapper, SysNotif
|
|||||||
// 通知自动发送
|
// 通知自动发送
|
||||||
public void sendNotify() {
|
public void sendNotify() {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
List<SysNotify> sysNotifies = this.sysNotifyMapper.selectList(new QueryWrapper<>());
|
// 获取全部通知数据
|
||||||
|
LambdaQueryWrapper<SysNotify> objectQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
objectQueryWrapper.eq(SysNotify::getTemplateStatus, true);
|
||||||
|
|
||||||
|
List<SysNotify> sysNotifies = this.sysNotifyMapper.selectList(objectQueryWrapper);
|
||||||
for (SysNotify notify : sysNotifies) {
|
for (SysNotify notify : sysNotifies) {
|
||||||
String recipientRoles = notify.getRecipientRoles();
|
String recipientRoles = notify.getRecipientRoles();
|
||||||
String[] array = recipientRoles.split("[\\[\\], ]");
|
// String[] array = recipientRoles.split("[\"\\\\[|\\\\]\", \"\"]");
|
||||||
|
String str = recipientRoles.replaceAll("\\[|\\]", ""); // 移除字符串中的中括号
|
||||||
|
String[] array = str.split(","); // 使用逗号分割字符串
|
||||||
List<Map<String, Object>> conditionsList = JSON.parseObject(notify.getConditions(), new TypeReference<List<Map<String, Object>>>() {});
|
List<Map<String, Object>> conditionsList = JSON.parseObject(notify.getConditions(), new TypeReference<List<Map<String, Object>>>() {});
|
||||||
// 判断通知类型
|
// 判断通知类型
|
||||||
Map<String , Object> map = new HashMap<>();
|
Map<String , Object> map = new HashMap<>();
|
||||||
for (Map<String, Object> stringObjectMap : conditionsList) {
|
for (Map<String, Object> stringObjectMap : conditionsList) {
|
||||||
if (ObjectUtil.isNotEmpty(stringObjectMap.get("系统到期日期")) && "".equals(stringObjectMap.get("field"))){
|
if (ObjectUtil.isNotEmpty(stringObjectMap.get("field")) && "系统到期日期".equals(stringObjectMap.get("field"))){
|
||||||
map.put("5",stringObjectMap.get("value"));
|
map.put("5",stringObjectMap.get("value"));
|
||||||
}
|
}
|
||||||
if (ObjectUtil.isNotEmpty(stringObjectMap.get("剩余交易流量")) && "".equals(stringObjectMap.get("field"))){
|
if (ObjectUtil.isNotEmpty(stringObjectMap.get("field")) && "剩余交易量".equals(stringObjectMap.get("field"))){
|
||||||
map.put("3",stringObjectMap.get("value"));
|
map.put("3",stringObjectMap.get("value"));
|
||||||
}
|
}
|
||||||
if (ObjectUtil.isNotEmpty(stringObjectMap.get("系统服务费统计")) && "".equals(stringObjectMap.get("field"))){
|
if (ObjectUtil.isNotEmpty(stringObjectMap.get("field")) && "系统服务费统计".equals(stringObjectMap.get("field"))){
|
||||||
map.put("4",stringObjectMap.get("value"));
|
map.put("4",stringObjectMap.get("value"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (ObjectUtil.isNotEmpty(stringObjectMap.get("系统到期日期")) && "".equals(stringObjectMap.get("field"))){
|
||||||
|
// map.put("5",stringObjectMap.get("value"));
|
||||||
|
// }
|
||||||
|
// if (ObjectUtil.isNotEmpty(stringObjectMap.get("剩余交易流量")) && "".equals(stringObjectMap.get("field"))){
|
||||||
|
// map.put("3",stringObjectMap.get("value"));
|
||||||
|
// }
|
||||||
|
// if (ObjectUtil.isNotEmpty(stringObjectMap.get("系统服务费统计")) && "".equals(stringObjectMap.get("field"))){
|
||||||
|
// map.put("4",stringObjectMap.get("value"));
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
// 根据dutyId查询员工id
|
// 根据dutyId查询员工id
|
||||||
List<TAccount> accountByRolsIds = tAccountMapper.getAccountByRolsIds(Arrays.asList(array));
|
List<TAccount> accountByRolsIds = tAccountMapper.getAccountByRolsIds(Arrays.asList(array));
|
||||||
@ -179,13 +197,14 @@ public class SysNotifyServiceImpl extends ServiceImpl<SysNotifyMapper, SysNotif
|
|||||||
sysNotify1.setDeptId(notify.getDeptId());
|
sysNotify1.setDeptId(notify.getDeptId());
|
||||||
sysNotify1.setSendType("");
|
sysNotify1.setSendType("");
|
||||||
// 根据id查员工以及dept
|
// 根据id查员工以及dept
|
||||||
TAccount accountByRolId = tAccountMapper.getAccountByRolsId(accountByRolsId.getRoleIds());
|
// TAccount accountByRolId = tAccountMapper.getAccountByRolsId(accountByRolsId.getRoleIds());
|
||||||
if ("5".equals(accountByRolId.getTurnoverType()) && ObjectUtil.isNotEmpty(map.get("5"))) {
|
// 根据类型判断
|
||||||
|
if (5 == accountByRolsId.getTurnoverType() && ObjectUtil.isNotEmpty(map.get("5"))) {
|
||||||
// 拿到时间
|
// 拿到时间
|
||||||
DeptPriceInfo deptPriceInfo = deptPriceInfoMapper.queryByDeptId(accountByRolId.getDeptId());
|
DeptPriceInfo deptPriceInfo = deptPriceInfoMapper.queryByDeptId(accountByRolsId.getDeptId());
|
||||||
if (ObjectUtil.isNotEmpty(deptPriceInfo)) {
|
if (ObjectUtil.isNotEmpty(deptPriceInfo)) {
|
||||||
// 剩余提醒时间
|
// 剩余提醒时间
|
||||||
Integer days= Integer.parseInt(map.get("5").toString());
|
Integer days = Integer.parseInt(map.get("5").toString());
|
||||||
// 过期时间
|
// 过期时间
|
||||||
Date systemValidityPeriodEnd = deptPriceInfo.getSystemValidityPeriodEnd();
|
Date systemValidityPeriodEnd = deptPriceInfo.getSystemValidityPeriodEnd();
|
||||||
// 获取当前时间减去days天判断还剩几天过期 //已过期的不判断
|
// 获取当前时间减去days天判断还剩几天过期 //已过期的不判断
|
||||||
@ -198,51 +217,59 @@ public class SysNotifyServiceImpl extends ServiceImpl<SysNotifyMapper, SysNotif
|
|||||||
if (currentDate.isBefore(notificationDate) && currentDate.isBefore(expiryDate)) {
|
if (currentDate.isBefore(notificationDate) && currentDate.isBefore(expiryDate)) {
|
||||||
// 计算剩余天数
|
// 计算剩余天数
|
||||||
Long daysBetween = ChronoUnit.DAYS.between(currentDate, expiryDate);
|
Long daysBetween = ChronoUnit.DAYS.between(currentDate, expiryDate);
|
||||||
// 发送通知
|
if (days>daysBetween){
|
||||||
String templateContent = sysNotify1.getTemplateContent();
|
// 发送通知
|
||||||
templateContent.replace("{系统到期日期}",daysBetween.toString());
|
String templateContent = sysNotify1.getTemplateContent();
|
||||||
|
String replace = templateContent.replace("{系统到期日期}", "到期时间" + expiryDate.toString() + ",还剩" + daysBetween.toString() + "天");
|
||||||
// sendNotification(notify,accountByRolId);
|
// sendNotification(notify,accountByRolId);
|
||||||
sysNotify1.setSendType(sysNotify1.getSendType()+"1");
|
sysNotify1.setTemplateContent(replace);
|
||||||
sysNotify1.setTemplateContent(templateContent);
|
sysNotify1.setSendType(sysNotify1.getSendType() + "1");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ("3".equals(accountByRolId.getTurnoverType()) && ObjectUtil.isNotEmpty(map.get("3"))) {
|
if (3 == accountByRolsId.getTurnoverType() && ObjectUtil.isNotEmpty(map.get("3"))) {
|
||||||
DeptTransactionInfo deptTransactionInfo = deptTransactionInfoMapper.queryByDeptId(accountByRolId.getDeptId());
|
DeptTransactionInfo deptTransactionInfo = deptTransactionInfoMapper.queryByDeptId(accountByRolsId.getDeptId());
|
||||||
if (ObjectUtil.isNotEmpty(deptTransactionInfo)) {
|
if (ObjectUtil.isNotEmpty(deptTransactionInfo)) {
|
||||||
Double remainingTransactionVolume = deptTransactionInfo.getRemainingTransactionVolume();
|
Double remainingTransactionVolume = deptTransactionInfo.getRemainingTransactionVolume();
|
||||||
if (Double.parseDouble(map.get("4").toString())-remainingTransactionVolume > 0) {
|
BigDecimal bigDecimal = new BigDecimal(map.get("3").toString()).multiply(new BigDecimal("10000"));
|
||||||
|
|
||||||
|
if (Double.parseDouble(bigDecimal.toString())-remainingTransactionVolume > 0) {
|
||||||
// sendNotification(notify,accountByRolId);
|
// sendNotification(notify,accountByRolId);
|
||||||
String templateContent = sysNotify1.getTemplateContent();
|
String templateContent = sysNotify1.getTemplateContent();
|
||||||
|
|
||||||
templateContent.replace("{剩余交易流量}",remainingTransactionVolume.toString());
|
String replace = templateContent.replace("{剩余交易量}", remainingTransactionVolume.toString());
|
||||||
|
|
||||||
sysNotify1.setSendType(sysNotify1.getSendType()+"2");
|
sysNotify1.setSendType(sysNotify1.getSendType()+"2");
|
||||||
sysNotify1.setTemplateContent(templateContent);
|
sysNotify1.setTemplateContent(replace);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ("4".equals(accountByRolId.getTurnoverType()) && ObjectUtil.isNotEmpty(map.get("4"))) {
|
if (4== accountByRolsId.getTurnoverType() && ObjectUtil.isNotEmpty(map.get("4"))) {
|
||||||
DeptServiceFeeInfo deptServiceFeeInfo = deptServiceFeeInfoMapper.queryByDeptId(accountByRolId.getDeptId());
|
DeptServiceFeeInfo deptServiceFeeInfo = deptServiceFeeInfoMapper.queryByDeptId(accountByRolsId.getDeptId());
|
||||||
if (ObjectUtil.isNotEmpty(deptServiceFeeInfo)) {
|
if (ObjectUtil.isNotEmpty(deptServiceFeeInfo)) {
|
||||||
Double serviceFeeLimit = deptServiceFeeInfo.getServiceFeeLimit();
|
Double serviceFeeLimit = deptServiceFeeInfo.getServiceFeeLimit();
|
||||||
if (Double.parseDouble(map.get("4").toString())-serviceFeeLimit > 0) {
|
BigDecimal bigDecimal = new BigDecimal(map.get("4").toString()).multiply(new BigDecimal("10000"));
|
||||||
|
|
||||||
|
if (Double.parseDouble(bigDecimal.toString())-serviceFeeLimit > 0) {
|
||||||
// sendNotification(notify,accountByRolId);
|
// sendNotification(notify,accountByRolId);
|
||||||
sysNotify1.setSendType(sysNotify1.getSendType()+"3");
|
sysNotify1.setSendType(sysNotify1.getSendType()+"3");
|
||||||
String templateContent = sysNotify1.getTemplateContent();
|
String templateContent = sysNotify1.getTemplateContent();
|
||||||
templateContent.replace("{系统服务费统计}",serviceFeeLimit.toString());
|
String replace = templateContent.replace("{系统服务费统计}", serviceFeeLimit.toString());
|
||||||
sysNotify1.setTemplateContent(templateContent);
|
sysNotify1.setTemplateContent(replace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!"".equals(sysNotify1.getSendType())) {
|
||||||
|
sendNotification(sysNotify1);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
map = new HashMap<>();
|
map = new HashMap<>();
|
||||||
// 发送通知
|
// 发送通知
|
||||||
sendNotification(sysNotify1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,8 +62,12 @@
|
|||||||
|
|
||||||
</select>
|
</select>
|
||||||
<select id="getAccountByRolsIds" resultType="com.fuint.repository.model.TAccount">
|
<select id="getAccountByRolsIds" resultType="com.fuint.repository.model.TAccount">
|
||||||
select * from t_account
|
select * ,
|
||||||
where role_ids in
|
td.turnover_type turnoverType
|
||||||
|
from t_account ta
|
||||||
|
left join sys_dept td on ta.dept_id = td.dept_id
|
||||||
|
|
||||||
|
where role_ids in
|
||||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
@ -96,6 +100,7 @@
|
|||||||
from t_account ta left join sys_dept td on ta.dept_id = td.dept_id
|
from t_account ta left join sys_dept td on ta.dept_id = td.dept_id
|
||||||
where role_ids = #{rolsId}
|
where role_ids = #{rolsId}
|
||||||
group by ta.dept_id
|
group by ta.dept_id
|
||||||
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
<select id="getByRoleId" resultType="com.fuint.repository.model.TAccount">
|
<select id="getByRoleId" resultType="com.fuint.repository.model.TAccount">
|
||||||
SELECT
|
SELECT
|
||||||
|
Loading…
Reference in New Issue
Block a user