9.18
This commit is contained in:
parent
5011b93f9d
commit
fc589e7f83
@ -51,7 +51,7 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 短信模板列表 -->
|
||||
<div style="height: 100vh;overflow: auto;width: 100%">
|
||||
<div style="height: 72vh;overflow: auto;width: 100%">
|
||||
<el-table :data="tableData" border width="500%" :header-cell-style="{'text-align':'center'}">
|
||||
<el-table-column type="index" label="序号"></el-table-column>
|
||||
<el-table-column prop="messageId" label="短信模板ID" width="100">
|
||||
@ -69,9 +69,9 @@
|
||||
<span>{{ scope.row.content }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="roleIds" label="接收角色">
|
||||
<el-table-column prop="roleName" label="接收角色">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.roleIds }}</span>
|
||||
<span>{{ scope.row.roleName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="短信模板状态" align="center" prop="status">
|
||||
@ -396,7 +396,7 @@
|
||||
<!-- 接收角色 -->
|
||||
<el-form-item label="接收角色" :required="true">
|
||||
<el-select v-model="form.roleIds" multiple placeholder="请选择角色" style="width: 100%">
|
||||
<el-option v-for="item in dutyList1" :label="item.dutyName" :value="item.dutyId"></el-option>
|
||||
<el-option v-for="item in dutyList1" :label="item.dutyName" :value="item.dutyId+''"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
@ -411,23 +411,46 @@
|
||||
|
||||
<!-- 发送条件 -->
|
||||
<el-form-item label="发送条件" style="margin-bottom: 10px" :required="true">
|
||||
<div v-for="(condition, index) in form.conditions" :key="index" class="condition-group"
|
||||
style="margin-bottom: 10px">
|
||||
<el-select v-model="condition.field" placeholder="请选择条件" style="width: 150px;margin-right: 10px"
|
||||
@change="changeField(index)">
|
||||
<el-option label="商品库存量" value="商品库存量"></el-option>
|
||||
<el-option label="剩余可挂账额度" value="剩余可挂账额度"></el-option>
|
||||
<el-option label="车队总余额" value="车队总余额"></el-option>
|
||||
<!-- <div v-for="(condition, index) in form.conditions" :key="index" class="condition-group"-->
|
||||
<!-- style="margin-bottom: 10px">-->
|
||||
<!-- <el-select v-model="condition.field" placeholder="请选择条件" style="width: 150px;margin-right: 10px"-->
|
||||
<!-- @change="changeField(index)">-->
|
||||
<!-- <el-option label="商品库存量" value="商品库存量"></el-option>-->
|
||||
<!-- <el-option label="剩余可挂账额度" value="剩余可挂账额度"></el-option>-->
|
||||
<!-- <el-option label="车队总余额" value="车队总余额"></el-option>-->
|
||||
<!-- <!– 添加其他选项 –>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- <el-select v-model="condition.operator" placeholder="请选择" style="width: 100px;margin-right: 10px">-->
|
||||
<!-- <el-option label="大于" value="大于"></el-option>-->
|
||||
<!-- <el-option label="等于" value="等于"></el-option>-->
|
||||
<!-- <el-option label="小于" value="小于"></el-option>-->
|
||||
<!-- <!– 添加其他选项 –>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- <el-input v-model="condition.value" placeholder="请输入" style="width: 200px;margin-right: 10px">-->
|
||||
<!-- <template slot="append">{{ condition.field != '商品库存量' ? '元' : '件' }}</template>-->
|
||||
<!-- </el-input>-->
|
||||
<!-- </div>-->
|
||||
<div class="condition-group" style="margin-bottom: 10px">
|
||||
<el-select v-model="form.sendCondition" placeholder="请选择条件" style="width: 150px;margin-right: 10px">
|
||||
<el-option label="商品库存量" value="0"></el-option>
|
||||
<el-option label="剩余可挂账额度" value="1"></el-option>
|
||||
<el-option label="车队总余额" value="2"></el-option>
|
||||
<!-- 添加其他选项 -->
|
||||
</el-select>
|
||||
<el-select v-model="condition.operator" placeholder="请选择" style="width: 100px;margin-right: 10px">
|
||||
<el-select v-model="form.meetCondition" placeholder="请选择" style="width: 100px;margin-right: 10px">
|
||||
<el-option label="大于" value="大于"></el-option>
|
||||
<el-option label="等于" value="等于"></el-option>
|
||||
<el-option label="小于" value="小于"></el-option>
|
||||
<!-- 添加其他选项 -->
|
||||
</el-select>
|
||||
<el-input v-model="condition.value" placeholder="请输入" style="width: 200px;margin-right: 10px">
|
||||
<template slot="append">{{ condition.field != '商品库存量' ? '元' : '件' }}</template>
|
||||
<el-input v-model="form.fleetAmount" v-if="form.sendCondition==2" placeholder="请输入车队的总余额" style="width: 200px;margin-right: 10px">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<el-input v-model="form.creditAmount" v-if="form.sendCondition==1" placeholder="请输入剩余可挂账额度" style="width: 200px;margin-right: 10px">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<el-input v-model="form.goodsStock" v-else placeholder="请输入商品库存" style="width: 200px;margin-right: 10px">
|
||||
<template slot="append">件</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
@ -584,7 +607,7 @@ export default {
|
||||
],
|
||||
// tableData: [],
|
||||
form: {
|
||||
conditions: []
|
||||
conditions: [{field:'',operator:"",value:""}]
|
||||
},
|
||||
deptListSelect: [],
|
||||
systemPositionList: [{
|
||||
@ -706,8 +729,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
// 计算短信条数
|
||||
countNum(){
|
||||
if (this.form3.amount && this.form3.unitPrice){
|
||||
countNum() {
|
||||
if (this.form3.amount && this.form3.unitPrice) {
|
||||
this.form3.messageNum = (this.form3.amount / this.form3.unitPrice).toFixed(0)
|
||||
}
|
||||
},
|
||||
@ -767,7 +790,7 @@ export default {
|
||||
// 充值
|
||||
recharge(data) {
|
||||
this.form3 = {
|
||||
deptId : data.deptId
|
||||
deptId: data.deptId
|
||||
}
|
||||
this.open3 = true;
|
||||
this.title = "充值"
|
||||
@ -1063,8 +1086,8 @@ export default {
|
||||
current: 1,
|
||||
size: 10,
|
||||
deviceName: '',
|
||||
},
|
||||
this.getList()
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
handleAdd(e) {
|
||||
this.clean()
|
||||
@ -1075,7 +1098,13 @@ export default {
|
||||
this.clean()
|
||||
this.open = true;
|
||||
this.title = "修改短信"
|
||||
console.log("1078", e)
|
||||
this.form = e
|
||||
if (e.roleIds) this.form.roleIds = e.roleIds.split(",")
|
||||
// getOneApi(e.id).then(res => {
|
||||
// this.form = res.data
|
||||
// if (res.data.roleIds) this.form.roleIds = res.data.roleIds.split(",")
|
||||
// })
|
||||
},
|
||||
del(e) {
|
||||
this.$confirm('此操作将永久删除该短信, 是否继续?', '提示', {
|
||||
@ -1111,7 +1140,7 @@ export default {
|
||||
bannerStatus: false, // Banner状态
|
||||
note: '', // 备注
|
||||
createByName: '', //
|
||||
conditions: []
|
||||
conditions: [{field:'',operator:"",value:""}]
|
||||
};
|
||||
this.selectedDat = undefined;
|
||||
},
|
||||
|
@ -254,7 +254,7 @@
|
||||
label="使用状态"
|
||||
width="100">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.isUse==1">正在使用</span>
|
||||
<span v-if="scope.row.ruleIsUse==1">正在使用</span>
|
||||
<span v-else>未使用</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -283,7 +283,7 @@
|
||||
width="100"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<div style="color: #fe8c4a;cursor: pointer" v-hasPermi="['Merchant:edit']" v-if="scope.row.isUse!=1" @click="editMerchant(scope.row)">修改</div>
|
||||
<div style="color: #fe8c4a;cursor: pointer" v-hasPermi="['Merchant:edit']" v-if="scope.row.ruleIsUse!=1" @click="editMerchant(scope.row)">修改</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -541,7 +541,7 @@
|
||||
<i class="el-icon-delete" style="font-size: 28px;margin-left: 15px" @click="deleteDoxlist(index)"></i>
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<div slot="footer" class="dialog-footer" v-if="Ruletitle != '查看商户信息'">
|
||||
<el-button @click="addRule = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitAddRule">确 定</el-button>
|
||||
</div>
|
||||
|
@ -49,7 +49,7 @@
|
||||
label="使用状态"
|
||||
width="100">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.isUse==1">正在使用</span>
|
||||
<span v-if="scope.row.ruleIsUse==1">正在使用</span>
|
||||
<span v-else>未使用</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -78,7 +78,7 @@
|
||||
width="100"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<div style="color: #fe8c4a;cursor: pointer" v-hasPermi="['Merchant:edit']" v-if="scope.row.isUse!=1" @click="editMerchant(scope.row)">修改</div>
|
||||
<div style="color: #fe8c4a;cursor: pointer" v-hasPermi="['Merchant:edit']" v-if="scope.row.ruleIsUse!=1" @click="editMerchant(scope.row)">修改</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -192,9 +192,10 @@
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<div style="display: flex;justify-content: center;width: 100%">
|
||||
<div style="color: #fe8c4a;cursor: pointer;margin: 0 10px" v-hasPermi="['payment:edit']" @click="editRule(scope.row)">修改</div>
|
||||
<div style="color: #fe8c4a;cursor: pointer;margin: 0 10px" v-hasPermi="['payment:delete']" @click="deleteRule(scope.row)">删除</div>
|
||||
<div style="color: #fe8c4a;cursor: pointer;margin: 0 10px" @click="EnableRule(scope.row)">启用</div>
|
||||
<div style="color: #fe8c4a;cursor: pointer;margin: 0 10px" v-hasPermi="['payment:edit']" v-if="scope.row.status!= 'qy'" @click="editRule(scope.row)">修改</div>
|
||||
<div style="color: #fe8c4a;cursor: pointer;margin: 0 10px" v-hasPermi="['payment:delete']" v-if="scope.row.status!= 'qy'" @click="deleteRule(scope.row)">删除</div>
|
||||
<div style="color: #fe8c4a;cursor: pointer;margin: 0 10px" v-if="scope.row.status!= 'qy'" @click="EnableRule(scope.row)">启用</div>
|
||||
<div style="color: #fe8c4a;cursor: pointer;margin: 0 10px" v-if="scope.row.status!= 'jy'" @click="editRule(scope.row,2)">查看</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
@ -335,7 +336,7 @@
|
||||
<i class="el-icon-delete" style="font-size: 28px;margin-left: 15px" @click="deleteDoxlist(index)"></i>
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<div slot="footer" class="dialog-footer" v-if="Ruletitle != '查看商户信息'">
|
||||
<el-button @click="addRule = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitAddRule">确 定</el-button>
|
||||
</div>
|
||||
|
@ -61,6 +61,10 @@ public class MerchantConfig extends BaseEntity implements Serializable {
|
||||
* 是否使用当前账户收款:0不使用,1使用
|
||||
*/
|
||||
private String isUse;
|
||||
/**
|
||||
* 规则正在使用:0不使用,1使用
|
||||
*/
|
||||
private String ruleIsUse;
|
||||
/**
|
||||
* 是否开启规则:0不开启,1开启
|
||||
*/
|
||||
|
@ -140,4 +140,10 @@ public interface MerchantConfigService extends IService<MerchantConfig> {
|
||||
IPage<MerchantConfigVo> selectListPage(Page page, MerchantConfigVo merchantConfig);
|
||||
|
||||
MerchantConfigVo selectInfo(Integer id);
|
||||
|
||||
/**
|
||||
* 修改商户使用状态
|
||||
* @param ruleId
|
||||
*/
|
||||
void updateRuleIsUse(Integer ruleId,Integer storeId);
|
||||
}
|
||||
|
@ -84,4 +84,11 @@ public interface OilConfigService extends IService<OilConfig> {
|
||||
List<OilConfigVo> selectListByRuleConfigId(Integer ruleId);
|
||||
|
||||
void deleteOilConfigByRuleId(Integer ruleId);
|
||||
|
||||
/**
|
||||
* 根据支付规则配置id查询商户配置信息ids
|
||||
* @param ruleId
|
||||
* @return
|
||||
*/
|
||||
List<Integer> selectMerchIdsByRuleId(Integer ruleId);
|
||||
}
|
||||
|
@ -322,5 +322,27 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
|
||||
return baseMapper.selectInfo(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRuleIsUse(Integer ruleId,Integer storeId) {
|
||||
List<Integer> merchIds = oilConfigService.selectMerchIdsByRuleId(ruleId);
|
||||
// 修改规则使用状态
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
List<MerchantConfig> list = baseMapper.selectList(queryWrapper);
|
||||
for (MerchantConfig merchantConfig : list) {
|
||||
boolean flag = false;
|
||||
for (Integer merchId : merchIds) {
|
||||
if (merchId.equals(merchantConfig.getId())) flag = true;
|
||||
}
|
||||
if (!flag){
|
||||
merchantConfig.setRuleIsUse("0");
|
||||
}else {
|
||||
merchantConfig.setRuleIsUse("1");
|
||||
}
|
||||
baseMapper.updateById(merchantConfig);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -284,4 +284,11 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
|
||||
queryWrapper.eq("rule_config_id",ruleId);
|
||||
baseMapper.delete(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> selectMerchIdsByRuleId(Integer ruleId) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("merch_config_id").eq("rule_config_id",ruleId);
|
||||
return listObjs(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
@ -88,6 +88,7 @@ public class PaymentRuleConfigServiceImpl extends ServiceImpl<PaymentRuleConfigM
|
||||
ruleConfig.setDeptId(Math.toIntExact(nowAccountInfo.getDeptId()));
|
||||
}
|
||||
int row = baseMapper.insert(ruleConfig);
|
||||
merchantConfigService.updateRuleIsUse(ruleConfig.getId(),ruleConfig.getStoreId());
|
||||
paymentRuleConfig = selectRuleByRuleName(ruleConfig.getRuleName(), ruleConfig.getStoreId());
|
||||
if (ObjectUtil.isNotEmpty(paymentRuleConfig)) {
|
||||
if (ObjectUtil.isNotEmpty(ruleConfig.getRuleList())){
|
||||
@ -107,6 +108,7 @@ public class PaymentRuleConfigServiceImpl extends ServiceImpl<PaymentRuleConfigM
|
||||
return 0;
|
||||
}
|
||||
int row = baseMapper.updateById(ruleConfig);
|
||||
merchantConfigService.updateRuleIsUse(ruleConfig.getId(),ruleConfig.getStoreId());
|
||||
oilConfigService.deleteOilConfigByRuleId(ruleConfig.getId());
|
||||
if (ObjectUtil.isNotEmpty(ruleConfig.getRuleList())){
|
||||
for (OilConfigVo oilConfig : ruleConfig.getRuleList()) {
|
||||
@ -137,7 +139,7 @@ public class PaymentRuleConfigServiceImpl extends ServiceImpl<PaymentRuleConfigM
|
||||
}
|
||||
int i = 1;
|
||||
if (ruleConfig.getStatus().equals("jy")){
|
||||
// 将其他使用的账户关掉
|
||||
// 将其他使用的账户关掉
|
||||
merchantConfigService.updateMerchOrter(ruleConfig.getStoreId());
|
||||
}
|
||||
if (ruleConfig.getStatus().equals("qy") && ruleConfig.getRuleType().equals("1")){
|
||||
@ -147,15 +149,31 @@ public class PaymentRuleConfigServiceImpl extends ServiceImpl<PaymentRuleConfigM
|
||||
return 0;
|
||||
}
|
||||
ruleConfig.setHandEnable("1");
|
||||
merchantConfigService.updateRuleIsUse(ruleConfig.getId(),ruleConfig.getStoreId());
|
||||
return baseMapper.updateById(ruleConfig);
|
||||
}else {
|
||||
this.changeHandEnable(ruleConfig.getStoreId());
|
||||
if (ruleConfig.getStatus().equals("qy")){
|
||||
ruleConfig.setStatus("jy");
|
||||
}
|
||||
ruleConfig.setHandEnable("1");
|
||||
return baseMapper.updateById(ruleConfig);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将所有手动启用关掉
|
||||
*/
|
||||
private void changeHandEnable(Integer storeId){
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id", storeId);
|
||||
List<PaymentRuleConfig> list = baseMapper.selectList(queryWrapper);
|
||||
for (PaymentRuleConfig paymentRuleConfig : list) {
|
||||
paymentRuleConfig.setHandEnable("0");
|
||||
baseMapper.updateById(paymentRuleConfig);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PaymentRuleConfig selectInfoByStoreId(Integer storeId) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
@ -181,9 +199,10 @@ public class PaymentRuleConfigServiceImpl extends ServiceImpl<PaymentRuleConfigM
|
||||
PaymentRuleConfig paymentRuleConfig1 = baseMapper.selectOne(queryWrapper1);
|
||||
for (PaymentRuleConfig paymentRuleConfig : list) {
|
||||
if (ObjectUtil.isNotEmpty(paymentRuleConfig.getStartTime()) && paymentRuleConfig.getStartTime().before(new Date())
|
||||
&& ObjectUtil.isNotEmpty(paymentRuleConfig1)
|
||||
&& ObjectUtil.isNotEmpty(paymentRuleConfig1.getUpdateTime())
|
||||
&& paymentRuleConfig.getStartTime().before(paymentRuleConfig1.getUpdateTime())) {
|
||||
&& ObjectUtil.isNotEmpty(paymentRuleConfig1)) {
|
||||
// && ObjectUtil.isNotEmpty(paymentRuleConfig1.getUpdateTime())
|
||||
// && !Objects.equals(paymentRuleConfig.getId(), paymentRuleConfig1.getId())
|
||||
// && paymentRuleConfig.getStartTime().before(paymentRuleConfig1.getUpdateTime())) {
|
||||
int i = 1;
|
||||
if (paymentRuleConfig.getRuleType().equals("1")){
|
||||
i = oilConfigService.judgmentProportion1(paymentRuleConfig.getStoreId(), paymentRuleConfig.getId());
|
||||
@ -198,6 +217,7 @@ public class PaymentRuleConfigServiceImpl extends ServiceImpl<PaymentRuleConfigM
|
||||
}
|
||||
paymentRuleConfig.setStatus("qy");
|
||||
baseMapper.updateById(paymentRuleConfig);
|
||||
merchantConfigService.updateRuleIsUse(paymentRuleConfig.getId(),paymentRuleConfig.getStoreId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.fuint.business.setting.controller;
|
||||
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -47,10 +46,11 @@ public class MessageTemplateController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private DutyService dutyService;
|
||||
|
||||
/**
|
||||
* 分页查询所有数据
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param page 分页对象
|
||||
* @param messageTemplate 查询实体
|
||||
* @return 所有数据
|
||||
*/
|
||||
@ -59,21 +59,21 @@ public class MessageTemplateController extends BaseController {
|
||||
//获取当前登录用户
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
LambdaQueryWrapper<MessageTemplate> queryWrapper =new LambdaQueryWrapper<>();
|
||||
if (!StringUtils.isEmpty(messageTemplate.getName())){
|
||||
queryWrapper.like(MessageTemplate::getName,messageTemplate.getName());
|
||||
LambdaQueryWrapper<MessageTemplate> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (!StringUtils.isEmpty(messageTemplate.getName())) {
|
||||
queryWrapper.like(MessageTemplate::getName, messageTemplate.getName());
|
||||
}
|
||||
if (!StringUtils.isEmpty(messageTemplate.getStatus())){
|
||||
queryWrapper.eq(MessageTemplate::getStatus,messageTemplate.getStatus());
|
||||
if (!StringUtils.isEmpty(messageTemplate.getStatus())) {
|
||||
queryWrapper.eq(MessageTemplate::getStatus, messageTemplate.getStatus());
|
||||
}
|
||||
queryWrapper.eq(MessageTemplate::getStoreId,nowAccountInfo.getStoreId());
|
||||
if (messageTemplate.getRoeleList() != null && messageTemplate.getRoeleList().size() > 0 ) {
|
||||
queryWrapper.eq(MessageTemplate::getStoreId, nowAccountInfo.getStoreId());
|
||||
if (messageTemplate.getRoeleList() != null && messageTemplate.getRoeleList().size() > 0) {
|
||||
queryWrapper.like(MessageTemplate::getRoleIds, messageTemplate.getRoeleList().get(0));
|
||||
}
|
||||
queryWrapper.orderByDesc(MessageTemplate::getCreateTime);
|
||||
IPage<MessageTemplate> page1 = this.messageTemplateService.page(page,queryWrapper);
|
||||
IPage<MessageTemplate> page1 = this.messageTemplateService.page(page, queryWrapper);
|
||||
for (MessageTemplate record : page1.getRecords()) {
|
||||
List<Integer> deptIdList =new ArrayList<>();
|
||||
List<Integer> deptIdList = new ArrayList<>();
|
||||
for (String s : record.getDeptIds().split(",")) {
|
||||
deptIdList.add(Integer.parseInt(s));
|
||||
}
|
||||
@ -82,11 +82,11 @@ public class MessageTemplateController extends BaseController {
|
||||
if (record.getRoleIds() != null && !record.getRoleIds().equals("")) {
|
||||
String roleById = "";
|
||||
for (String s : record.getRoleIds().split(",")) {
|
||||
roleById += dutyService.getRoleById(Long.parseLong(s)).getDutyName();
|
||||
roleById += dutyService.getRoleById(Long.parseLong(s)).getDutyName() + ",";
|
||||
}
|
||||
record.setRoleIds(roleById);
|
||||
}
|
||||
record.setRoleName(roleById);
|
||||
}
|
||||
}
|
||||
return getSuccessResult(page1);
|
||||
}
|
||||
|
||||
@ -111,33 +111,33 @@ public class MessageTemplateController extends BaseController {
|
||||
public ResponseObject insert(@RequestBody MessageTemplate messageTemplate) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
messageTemplate.setCreateName(nowAccountInfo.getRealName());
|
||||
SysLog sysLog =new SysLog();
|
||||
SysLog sysLog = new SysLog();
|
||||
sysLog.setSystemName("1");
|
||||
sysLog.setMoudle("短信模版");
|
||||
sysLog.setContent("新增了模版名称为"+messageTemplate.getName()+"的数据");
|
||||
sysLog.setContent("新增了模版名称为" + messageTemplate.getName() + "的数据");
|
||||
sysLogService.saveVo(sysLog);
|
||||
String tempName = "";
|
||||
String tempId = "";
|
||||
for (Integer deptId : messageTemplate.getDeptIdList()) {
|
||||
SysDept dept = deptService.getById(deptId);
|
||||
tempName+=dept.getDeptName()+",";
|
||||
tempId+=dept.getDeptId()+",";
|
||||
tempName += dept.getDeptName() + ",";
|
||||
tempId += dept.getDeptId() + ",";
|
||||
|
||||
}
|
||||
String roleIds = "";
|
||||
for (Integer integer : messageTemplate.getRoeleList()) {
|
||||
roleIds += integer + ",";
|
||||
}
|
||||
messageTemplate.setRoleIds(roleIds);
|
||||
messageTemplate.setDeptNames(tempName.substring(0,tempName.length()-1));
|
||||
messageTemplate.setDeptIds(tempId.substring(0,tempId.length()-1));
|
||||
// String roleIds = "";
|
||||
// for (Integer integer : messageTemplate.getRoeleList()) {
|
||||
// roleIds += integer + ",";
|
||||
// }
|
||||
// messageTemplate.setRoleIds(roleIds);
|
||||
messageTemplate.setDeptNames(tempName.substring(0, tempName.length() - 1));
|
||||
messageTemplate.setDeptIds(tempId.substring(0, tempId.length() - 1));
|
||||
messageTemplate.setStoreId(nowAccountInfo.getStoreId());
|
||||
|
||||
// 校验添加时名称是否存在
|
||||
int nameList = messageTemplateService.selectMessagesName(messageTemplate.getName());
|
||||
|
||||
if (nameList == 1) {
|
||||
return getFailureResult(201,"模版名称已存在");
|
||||
return getFailureResult(201, "模版名称已存在");
|
||||
}
|
||||
return getSuccessResult(this.messageTemplateService.save(messageTemplate));
|
||||
}
|
||||
@ -150,21 +150,21 @@ public class MessageTemplateController extends BaseController {
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseObject update(@RequestBody MessageTemplate messageTemplate) {
|
||||
SysLog sysLog =new SysLog();
|
||||
SysLog sysLog = new SysLog();
|
||||
sysLog.setSystemName("1");
|
||||
sysLog.setMoudle("短信模版");
|
||||
sysLog.setContent("更新了模版名称为"+messageTemplate.getName()+"的数据");
|
||||
sysLog.setContent("更新了模版名称为" + messageTemplate.getName() + "的数据");
|
||||
sysLogService.saveVo(sysLog);
|
||||
String tempName = "";
|
||||
String tempId = "";
|
||||
for (Integer deptId : messageTemplate.getDeptIdList()) {
|
||||
SysDept dept = deptService.getById(deptId);
|
||||
tempName+=dept.getDeptName()+",";
|
||||
tempId+=dept.getDeptId()+",";
|
||||
tempName += dept.getDeptName() + ",";
|
||||
tempId += dept.getDeptId() + ",";
|
||||
|
||||
}
|
||||
messageTemplate.setDeptNames(tempName.substring(0,tempName.length()-1));
|
||||
messageTemplate.setDeptIds(tempId.substring(0,tempId.length()-1));
|
||||
messageTemplate.setDeptNames(tempName.substring(0, tempName.length() - 1));
|
||||
messageTemplate.setDeptIds(tempId.substring(0, tempId.length() - 1));
|
||||
// // 校验添加时名称是否存在
|
||||
// int nameList = this.getNameList(messageTemplate.getName());
|
||||
// if (nameList == 1) {
|
||||
@ -183,10 +183,10 @@ public class MessageTemplateController extends BaseController {
|
||||
public ResponseObject delete(@RequestParam("idList") List<Long> idList) {
|
||||
for (Long aLong : idList) {
|
||||
MessageTemplate messageTemplate = messageTemplateService.getById(aLong);
|
||||
SysLog sysLog =new SysLog();
|
||||
SysLog sysLog = new SysLog();
|
||||
sysLog.setSystemName("1");
|
||||
sysLog.setMoudle("短信模版");
|
||||
sysLog.setContent("删除了模版名称为"+messageTemplate.getName()+"的数据");
|
||||
sysLog.setContent("删除了模版名称为" + messageTemplate.getName() + "的数据");
|
||||
sysLogService.saveVo(sysLog);
|
||||
}
|
||||
return getSuccessResult(this.messageTemplateService.removeByIds(idList));
|
||||
@ -194,12 +194,13 @@ public class MessageTemplateController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询消息模板名称是否存在
|
||||
*
|
||||
* @param name 模板名称
|
||||
* @return 1 , 0
|
||||
*/
|
||||
@GetMapping("/getMessageTemplate")
|
||||
public ResponseObject getMessageTemplate(String name){
|
||||
return getSuccessResult( messageTemplateService.selectMessagesName(name));
|
||||
public ResponseObject getMessageTemplate(String name) {
|
||||
return getSuccessResult(messageTemplateService.selectMessagesName(name));
|
||||
}
|
||||
|
||||
private int getNameList(String name) {
|
||||
|
@ -33,6 +33,16 @@ public class MessageTemplate extends Model<MessageTemplate> {
|
||||
private String roleIds;
|
||||
//状态0停用1启用
|
||||
private String status;
|
||||
//发送条件:0商品库存数量;1剩余可挂账额度;2车队总余额
|
||||
private String sendCondition;
|
||||
//满足条件:大于、等于、小于
|
||||
private String meetCondition;
|
||||
//商品库存
|
||||
private Integer goodsStock;
|
||||
//剩余可挂账额度
|
||||
private Double creditAmount;
|
||||
//车队总余额
|
||||
private Double fleetAmount;
|
||||
//创建者名称
|
||||
private String createName;
|
||||
//创建时间
|
||||
@ -54,5 +64,9 @@ public class MessageTemplate extends Model<MessageTemplate> {
|
||||
@TableField(exist = false)
|
||||
private List<Integer> roeleList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String roleName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user