1.还车短信、短信日志

2.收费方式增加运营区和运营商选择
This commit is contained in:
邱贞招 2024-07-24 15:32:01 +08:00
parent 3ee987ce14
commit 46dac8bc57
19 changed files with 629 additions and 47 deletions

View File

@ -1,20 +1,32 @@
package com.ruoyi.web.controller.app;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.AsArticleClassify;
import com.ruoyi.common.core.domain.entity.AsUser;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.CommonUtil;
import com.ruoyi.common.utils.SendAliSmsUtil;
import com.ruoyi.common.utils.SendSmsVo;
import com.ruoyi.common.utils.map.GeoUtils;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.mapper.AsUserMapper;
import com.ruoyi.system.service.*;
import com.wechat.pay.java.service.payments.model.Transaction;
import com.wechat.pay.java.service.refund.model.Refund;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
@ -50,6 +62,21 @@ public class AppController extends BaseController
@Autowired
private IAsArticleClassifyService asArticleClassifyService;
@Resource
private AsUserMapper asUserMapper;
@Value("${aliyun.accessKeyId}")
private String accessKeyId;
@Value("${aliyun.accessKeySecret}")
private String accessKeySecret;
@Value("${aliyun.signName}")
private String signName;
@Value("${aliyun.templateCode}")
private String templateCode;
/**
* 根据查询文章分类列表
@ -398,5 +425,34 @@ public class AppController extends BaseController
}
return AjaxResult.success();
}
@GetMapping("/sendMsg")
public AjaxResult getUserInfo(String orderNo)
{
EtOrder order = etOrderService.selectEtOrderByOrderNo(orderNo);
/** 发送一个短信给运营商*/
SysDept sysDept = wxPayService.getDeptObjByAreaId(order.getAreaId());
logger.info("【微信支付回调】还车拍照审核,获取到运营商:【{}】", JSON.toJSON(sysDept));
if(ObjectUtil.isNull(sysDept.getAppUserId())){
throw new ServiceException("该运营商【"+sysDept.getDeptName()+"】未绑定微信用户");
}
AsUser asUser1 = asUserMapper.selectUserById(sysDept.getAppUserId());
JSONObject jsonObject = new JSONObject();
jsonObject.put("name",order.getPayFee());
String phone = asUser1.getPhonenumber();
SendSmsVo sendSmsVo = new SendSmsVo();
sendSmsVo.setMobile(phone);
sendSmsVo.setTemplateCode(templateCode);
sendSmsVo.setParam(jsonObject.toJSONString());
sendSmsVo.setSignName(signName);
SendSmsResponse response = null;
logger.info("【微信支付回调】向阿里云发送短信,请求,----------【{}】", JSON.toJSONString(sendSmsVo));
try {
response = SendAliSmsUtil.sendVerifyCode(accessKeyId,accessKeySecret,sendSmsVo);
} catch (ClientException e) {
e.printStackTrace();
}
logger.info("【微信支付回调】发送阿里云短信成功,返回----------【{}】",JSON.toJSONString(response));
return AjaxResult.success();
}
}

View File

@ -104,6 +104,9 @@ public class AppVerifyController extends BaseController
@Autowired
private IEtWithdrawService etWithdrawService;
@Autowired
private IWxPayService wxPayService;
/**
* 故障上报
@ -879,26 +882,13 @@ public class AppVerifyController extends BaseController
}
/**
* 根据token获取运营商信息
* 获取运营商信息
*/
@GetMapping("/getDept")
public AjaxResult getDept()
public AjaxResult getDept(Long areaId)
{
AsUser asUser = getLoginUser().getAsUser();
AsUser asUser1 = asUserService.selectUserById(asUser.getUserId());
logger.info("获取到当前app登录用户【{}】", JSON.toJSON(asUser1));
if(ObjectUtil.isNull(asUser1.getSysUserId())){
throw new RuntimeException("用户【"+asUser1.getUserName()+"】未绑定系统用户");
}
SysUser sysUser = userService.selectUserById(asUser1.getSysUserId());
Long deptId;
SysDept sysDept = null;
if(!sysUser.isAdmin()){
deptId = sysUser.getDeptId();
sysDept = deptService.selectDeptById(deptId);
logger.info("根据token获取运营商信息【{}】", JSON.toJSON(sysDept));
return success(sysDept);
}
logger.info("【获取运营商信息】获取到areaId【{}】", areaId);
SysDept sysDept = wxPayService.getDeptObjByAreaId(areaId);
return success(sysDept);
}

View File

@ -0,0 +1,104 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.EtMsgLog;
import com.ruoyi.system.service.IEtMsgLogService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 短信日志Controller
*
* @author qiuzhenzhen
* @date 2024-07-24
*/
@RestController
@RequestMapping("/system/msgLog")
public class EtMsgLogController extends BaseController
{
@Autowired
private IEtMsgLogService etMsgLogService;
/**
* 查询短信日志列表
*/
@PreAuthorize("@ss.hasPermi('system:msgLog:list')")
@GetMapping("/list")
public TableDataInfo list(EtMsgLog etMsgLog)
{
startPage();
List<EtMsgLog> list = etMsgLogService.selectEtMsgLogList(etMsgLog);
return getDataTable(list);
}
/**
* 导出短信日志列表
*/
@PreAuthorize("@ss.hasPermi('system:msgLog:export')")
@Log(title = "短信日志", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EtMsgLog etMsgLog)
{
List<EtMsgLog> list = etMsgLogService.selectEtMsgLogList(etMsgLog);
ExcelUtil<EtMsgLog> util = new ExcelUtil<EtMsgLog>(EtMsgLog.class);
util.exportExcel(response, list, "短信日志数据");
}
/**
* 获取短信日志详细信息
*/
@PreAuthorize("@ss.hasPermi('system:msgLog:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(etMsgLogService.selectEtMsgLogById(id));
}
/**
* 新增短信日志
*/
@PreAuthorize("@ss.hasPermi('system:msgLog:add')")
@Log(title = "短信日志", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EtMsgLog etMsgLog)
{
return toAjax(etMsgLogService.insertEtMsgLog(etMsgLog));
}
/**
* 修改短信日志
*/
@PreAuthorize("@ss.hasPermi('system:msgLog:edit')")
@Log(title = "短信日志", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EtMsgLog etMsgLog)
{
return toAjax(etMsgLogService.updateEtMsgLog(etMsgLog));
}
/**
* 删除短信日志
*/
@PreAuthorize("@ss.hasPermi('system:msgLog:remove')")
@Log(title = "短信日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(etMsgLogService.deleteEtMsgLogByIds(ids));
}
}

View File

@ -142,7 +142,7 @@ aliyun:
accessKeySecret: eQJsruUAvFfJblHZJ50QyiALCSZeRK
signName: 创享电动车
# 验证码模版id
templateCode: SMS_465344261
templateCode: SMS_470225045
# 七牛云配置
qiniu:
# 七牛云key

View File

@ -45,6 +45,11 @@ public class ServiceConstants {
*/
public static final String ORDER_TYPE_VEHICLE_DAMAGE = "7";
/**
* 订单类型: 8-短信扣费
*/
public static final String ORDER_TYPE_MSG = "8";
/**----------------------------订单类型end----------------------------*/
/**----------------------------支付场景start----------------------------*/
/** 支付场景: 1-骑行支付,2-取消预约支付,3-套餐支付,4-押金支付 */
@ -145,6 +150,11 @@ public class ServiceConstants {
*/
public static final String PAY_TYPE_YJ = "yj";
/**
* 支付方式: ye-余额抵扣
*/
public static final String PAY_TYPE_YE = "yj";
/**----------------------------支付类型end----------------------------*/
/**----------------------------车辆状态start----------------------------*/

View File

@ -34,6 +34,11 @@ public class EtFeeRule extends BaseEntity
@TableField(exist = false)
private EtOperatingArea area;
/** 运营区名称 */
@Excel(name = "运营区名称")
@TableField(exist = false)
private String areaName;
/** 运营商 */
@Excel(name = "运营商")
private String deptName;

View File

@ -0,0 +1,40 @@
package com.ruoyi.system.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 短信日志对象 et_msg_log
*
* @author qiuzhenzhen
* @date 2024-07-24
*/
@Data
public class EtMsgLog extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 短信类型 */
@Excel(name = "短信类型")
private String type;
/** 模版code */
private String templateCode;
/** 短信签名 */
@Excel(name = "短信签名")
private String signName;
/** 内容 */
@Excel(name = "内容")
private String content;
/** 发送手机号 */
@Excel(name = "发送手机号")
private String phone;
}

View File

@ -119,6 +119,14 @@ public interface AsDeviceMapper extends BaseMapper<AsDevice>
*/
public int oneClickOffline(Long[] deviceIds);
/**
* 一键入仓
*
* @param deviceIds 需要一键入仓的设备主键集合
* @return 结果
*/
public int oneClickWarehousing(Long[] deviceIds);
/**
* 有订单车辆

View File

@ -17,4 +17,13 @@ public interface EtAreaRuleMapper extends BaseMapper<EtAreaRule>
* @return 结果
*/
public int deleteAreaRuleByAreaId(Long areaId);
/**
* 通过用ruleId删除区域与收费方式关联
*
* @param ruleId 运营区id
* @return 结果
*/
public int deleteAreaRuleByRuleId(Long ruleId);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.EtMsgLog;
/**
* 短信日志Mapper接口
*
* @author qiuzhenzhen
* @date 2024-07-24
*/
public interface EtMsgLogMapper
{
/**
* 查询短信日志
*
* @param id 短信日志主键
* @return 短信日志
*/
public EtMsgLog selectEtMsgLogById(Long id);
/**
* 查询短信日志列表
*
* @param etMsgLog 短信日志
* @return 短信日志集合
*/
public List<EtMsgLog> selectEtMsgLogList(EtMsgLog etMsgLog);
/**
* 新增短信日志
*
* @param etMsgLog 短信日志
* @return 结果
*/
public int insertEtMsgLog(EtMsgLog etMsgLog);
/**
* 修改短信日志
*
* @param etMsgLog 短信日志
* @return 结果
*/
public int updateEtMsgLog(EtMsgLog etMsgLog);
/**
* 删除短信日志
*
* @param id 短信日志主键
* @return 结果
*/
public int deleteEtMsgLogById(Long id);
/**
* 批量删除短信日志
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteEtMsgLogByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.EtMsgLog;
/**
* 短信日志Service接口
*
* @author qiuzhenzhen
* @date 2024-07-24
*/
public interface IEtMsgLogService
{
/**
* 查询短信日志
*
* @param id 短信日志主键
* @return 短信日志
*/
public EtMsgLog selectEtMsgLogById(Long id);
/**
* 查询短信日志列表
*
* @param etMsgLog 短信日志
* @return 短信日志集合
*/
public List<EtMsgLog> selectEtMsgLogList(EtMsgLog etMsgLog);
/**
* 新增短信日志
*
* @param etMsgLog 短信日志
* @return 结果
*/
public int insertEtMsgLog(EtMsgLog etMsgLog);
/**
* 修改短信日志
*
* @param etMsgLog 短信日志
* @return 结果
*/
public int updateEtMsgLog(EtMsgLog etMsgLog);
/**
* 批量删除短信日志
*
* @param ids 需要删除的短信日志主键集合
* @return 结果
*/
public int deleteEtMsgLogByIds(Long[] ids);
/**
* 删除短信日志信息
*
* @param id 短信日志主键
* @return 结果
*/
public int deleteEtMsgLogById(Long id);
}

View File

@ -471,7 +471,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
throw new ServiceException("车辆【"+device.getSn()+"】为‘废弃’状态不能入仓");
}
}
return asDeviceMapper.oneClickOffline(deviceIds);
return asDeviceMapper.oneClickWarehousing(deviceIds);
}
/**

View File

@ -136,6 +136,9 @@ public class CallbackServiceImpl implements CallbackService {
@Value("${aliyun.templateCode}")
private String templateCode;
@Resource
private EtMsgLogMapper etMsgLogMapper;
// @Value("${et.handlingCharge}")
// private String handlingCharge;
@ -197,31 +200,11 @@ public class CallbackServiceImpl implements CallbackService {
logger.info("【微信支付回调】还车-----需要-----拍照审核");
order.setStatus(ServiceConstants.ORDER_STATUS_TO_BE_AUDIT);//如果还车需要拍照审核状态为待审核
BigDecimal amount = order.getPayFee();
// 异步处理
scheduledExecutorService.schedule(() -> {
/** 发送一个短信给运营商*/
SysDept sysDept = wxPayService.getDeptObjByAreaId(order.getAreaId());
logger.info("【微信支付回调】还车拍照审核,获取到运营商:【{}】",JSON.toJSON(sysDept));
AsUser asUser1 = asUserMapper.selectUserById(sysDept.getAppUserId());
JSONObject jsonObject = new JSONObject();
jsonObject.put("amount",amount);
String phone = asUser1.getPhonenumber();
SendSmsVo sendSmsVo = new SendSmsVo();
sendSmsVo.setMobile(phone);
sendSmsVo.setTemplateCode(templateCode);
sendSmsVo.setParam(jsonObject.toJSONString());
sendSmsVo.setSignName(signName);
SendSmsResponse response = null;
logger.info("【微信支付回调】向阿里云发送短信,请求,----------【{}】", JSON.toJSONString(sendSmsVo));
try {
response = SendAliSmsUtil.sendVerifyCode(accessKeyId,accessKeySecret,sendSmsVo);
} catch (ClientException e) {
e.printStackTrace();
}
logger.info("【微信支付回调】发送阿里云短信成功,返回----------【{}】",JSON.toJSONString(response));
}, 0 , TimeUnit.HOURS);
// 异步处理短信
if("1".equals(area.getMsgSwitch())){
asynchronousMsg(order, amount);
}
}else{
logger.info("【微信支付回调】还车-----不需要-----拍照审核");
order.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END);
@ -294,6 +277,54 @@ public class CallbackServiceImpl implements CallbackService {
}
}
private void asynchronousMsg(EtOrder order, BigDecimal amount) {
scheduledExecutorService.schedule(() -> {
/** 发送一个短信给运营商*/
SysDept sysDept = wxPayService.getDeptObjByAreaId(order.getAreaId());
logger.info("【微信支付回调】还车拍照审核,获取到运营商:【{}】",JSON.toJSON(sysDept));
if(ObjectUtil.isNull(sysDept.getAppUserId())){
throw new ServiceException("该运营商【"+sysDept.getDeptName()+"】未绑定微信用户");
}
AsUser asUser1 = asUserMapper.selectUserById(sysDept.getAppUserId());
JSONObject jsonObject = new JSONObject();
jsonObject.put("name", amount);
String phone = asUser1.getPhonenumber();
SendSmsVo sendSmsVo = new SendSmsVo();
sendSmsVo.setMobile(phone);
sendSmsVo.setTemplateCode(templateCode);
sendSmsVo.setParam(jsonObject.toJSONString());
sendSmsVo.setSignName(signName);
SendSmsResponse response = null;
logger.info("【微信支付回调】向阿里云发送短信,请求,----------【{}】", JSON.toJSONString(sendSmsVo));
try {
response = SendAliSmsUtil.sendVerifyCode(accessKeyId,accessKeySecret,sendSmsVo);
} catch (ClientException e) {
e.printStackTrace();
}
logger.info("【微信支付回调】发送阿里云短信成功,返回----------【{}】",JSON.toJSONString(response));
//记录资金流水
order.setPayFee(new BigDecimal(0.1));
callbackService.capitalFlowRecords(order,ServiceConstants.FLOW_TYPE_DISBURSE,
ServiceConstants.ORDER_TYPE_MSG,ServiceConstants.OWNER_TYPE_OPERATOR,null,ServiceConstants.PAY_TYPE_YE);
// 短信日志
EtMsgLog etMsgLog = new EtMsgLog();
etMsgLog.setPhone(phone);
etMsgLog.setContent("您名下有一笔租车订单已归还,订单金额:"+ amount +"元。");
etMsgLog.setType("1");
etMsgLog.setSignName(signName);
etMsgLog.setTemplateCode(templateCode);
int i = etMsgLogMapper.insertEtMsgLog(etMsgLog);
if(i>0){
logger.info("【微信支付回调】短信日志记录成功");
}else{
logger.info("【微信支付回调】短信日志记录失败");
}
}, 0 , TimeUnit.HOURS);
}
private void asynchronousSaveCallbackLog(EtCallbackLog etCallbackLog) {
//开异步线程保存回调参数
scheduledExecutorService.schedule(() -> {

View File

@ -8,6 +8,9 @@ import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.domain.EtAreaRule;
import com.ruoyi.system.domain.EtOperatingArea;
import com.ruoyi.system.mapper.EtAreaRuleMapper;
import com.ruoyi.system.service.IEtOperatingAreaService;
import com.ruoyi.system.service.IWxPayService;
import org.springframework.beans.factory.annotation.Autowired;
@ -16,6 +19,8 @@ import com.ruoyi.system.mapper.EtFeeRuleMapper;
import com.ruoyi.system.domain.EtFeeRule;
import com.ruoyi.system.service.IEtFeeRuleService;
import javax.annotation.Resource;
/**
* 收费方式Service业务层处理
*
@ -25,7 +30,7 @@ import com.ruoyi.system.service.IEtFeeRuleService;
@Service
public class EtFeeRuleServiceImpl implements IEtFeeRuleService
{
@Autowired
@Resource
private EtFeeRuleMapper etFeeRuleMapper;
@Autowired
@ -34,6 +39,9 @@ public class EtFeeRuleServiceImpl implements IEtFeeRuleService
@Autowired
private IWxPayService wxPayService;
@Resource
private EtAreaRuleMapper etAreaRuleMapper;
/**
* 查询收费方式
*
@ -44,7 +52,11 @@ public class EtFeeRuleServiceImpl implements IEtFeeRuleService
public EtFeeRule selectEtFeeRuleByRuleId(Long ruleId)
{
EtFeeRule etFeeRule = etFeeRuleMapper.selectEtFeeRuleByRuleId(ruleId);
etFeeRule.setArea(etOperatingAreaService.selectEtOperatingAreaByAreaId(etFeeRule.getAreaId()));
EtOperatingArea area = etOperatingAreaService.selectEtOperatingAreaByAreaId(etFeeRule.getAreaId());
if(ObjectUtil.isNotNull(area)){
etFeeRule.setArea(area);
etFeeRule.setAreaId(area.getAreaId());
}
return etFeeRule;
}
@ -105,7 +117,11 @@ public class EtFeeRuleServiceImpl implements IEtFeeRuleService
}
etFeeRule.setCreateTime(DateUtils.getNowDate());
etFeeRule.setStatus("0");
return etFeeRuleMapper.insertEtFeeRule(etFeeRule);
int i = etFeeRuleMapper.insertEtFeeRule(etFeeRule);
if(ObjectUtil.isNotNull(etFeeRule.getAreaId())){
etAreaRuleMapper.insert(EtAreaRule.builder().areaId(etFeeRule.getAreaId()).ruleId(etFeeRule.getRuleId()).build());
}
return i;
}
/**
@ -117,6 +133,10 @@ public class EtFeeRuleServiceImpl implements IEtFeeRuleService
@Override
public int updateEtFeeRule(EtFeeRule etFeeRule)
{
int i = etAreaRuleMapper.deleteAreaRuleByRuleId(etFeeRule.getRuleId());
if(ObjectUtil.isNotNull(etFeeRule.getAreaId())){
etAreaRuleMapper.insert(EtAreaRule.builder().areaId(etFeeRule.getAreaId()).ruleId(etFeeRule.getRuleId()).build());
}
return etFeeRuleMapper.updateEtFeeRule(etFeeRule);
}

View File

@ -0,0 +1,95 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.EtMsgLogMapper;
import com.ruoyi.system.domain.EtMsgLog;
import com.ruoyi.system.service.IEtMsgLogService;
/**
* 短信日志Service业务层处理
*
* @author qiuzhenzhen
* @date 2024-07-24
*/
@Service
public class EtMsgLogServiceImpl implements IEtMsgLogService
{
@Autowired
private EtMsgLogMapper etMsgLogMapper;
/**
* 查询短信日志
*
* @param id 短信日志主键
* @return 短信日志
*/
@Override
public EtMsgLog selectEtMsgLogById(Long id)
{
return etMsgLogMapper.selectEtMsgLogById(id);
}
/**
* 查询短信日志列表
*
* @param etMsgLog 短信日志
* @return 短信日志
*/
@Override
public List<EtMsgLog> selectEtMsgLogList(EtMsgLog etMsgLog)
{
return etMsgLogMapper.selectEtMsgLogList(etMsgLog);
}
/**
* 新增短信日志
*
* @param etMsgLog 短信日志
* @return 结果
*/
@Override
public int insertEtMsgLog(EtMsgLog etMsgLog)
{
etMsgLog.setCreateTime(DateUtils.getNowDate());
return etMsgLogMapper.insertEtMsgLog(etMsgLog);
}
/**
* 修改短信日志
*
* @param etMsgLog 短信日志
* @return 结果
*/
@Override
public int updateEtMsgLog(EtMsgLog etMsgLog)
{
return etMsgLogMapper.updateEtMsgLog(etMsgLog);
}
/**
* 批量删除短信日志
*
* @param ids 需要删除的短信日志主键
* @return 结果
*/
@Override
public int deleteEtMsgLogByIds(Long[] ids)
{
return etMsgLogMapper.deleteEtMsgLogByIds(ids);
}
/**
* 删除短信日志信息
*
* @param id 短信日志主键
* @return 结果
*/
@Override
public int deleteEtMsgLogById(Long id)
{
return etMsgLogMapper.deleteEtMsgLogById(id);
}
}

View File

@ -355,4 +355,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{deviceId}
</foreach>
</delete>
<delete id="oneClickWarehousing" parameterType="String">
update et_device d set d.status = '0' where device_id in
<foreach item="deviceId" collection="array" open="(" separator="," close=")">
#{deviceId}
</foreach>
</delete>
</mapper>

View File

@ -7,4 +7,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteAreaRuleByAreaId">
delete from et_area_rule where area_id=#{areaId}
</delete>
<delete id="deleteAreaRuleByRuleId">
delete from et_area_rule where rule_id=#{ruleId}
</delete>
</mapper>

View File

@ -36,17 +36,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectEtFeeRuleList" parameterType="EtFeeRule" resultMap="EtFeeRuleResult">
select r.rule_id, r.dept_id, d.dept_name, r.`name`, r.`explain`,
select r.rule_id, r.dept_id, d.dept_name, r.`name`, r.`explain`,ar.`area_id`,a.area_name areaName,
r.status, r.auto_refund_deposit, r.order_exceed_minutes, r.order_exceed_warn,
r.free_ride_time, r.rental_unit, r.riding_rule, r.riding_rule_json, r.charging_cycle, r.charging_cycle_value,
r.capped_amount, r.instructions, r.create_by, r.create_time from et_fee_rule r
left join sys_dept d on d.dept_id = r.dept_id
left join et_area_rule ar on ar.rule_id = r.rule_id
left join et_operating_area a on a.area_id = ar.area_id
where r.is_deleted = 0
<if test="name != null and name != ''"> and r.`name` like concat('%', #{name}, '%')</if>
<if test="status != null and status != ''"> and r.status = #{status}</if>
<if test="deptId != null "> and r.dept_id = #{deptId}</if>
<!-- 数据范围过滤 -->
${params.dataScope}
order by r.create_time desc
</select>
<select id="selectEtFeeRuleByRuleId" parameterType="Long" resultMap="EtFeeRuleResult">

View File

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.EtMsgLogMapper">
<resultMap type="EtMsgLog" id="EtMsgLogResult">
<result property="id" column="id" />
<result property="type" column="type" />
<result property="templateCode" column="templateCode" />
<result property="signName" column="signName" />
<result property="content" column="content" />
<result property="createTime" column="create_time" />
<result property="phone" column="phone" />
</resultMap>
<sql id="selectEtMsgLogVo">
select id, type, templateCode, signName, content, create_time, phone from et_msg_log
</sql>
<select id="selectEtMsgLogList" parameterType="EtMsgLog" resultMap="EtMsgLogResult">
<include refid="selectEtMsgLogVo"/>
<where>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
</where>
</select>
<select id="selectEtMsgLogById" parameterType="Long" resultMap="EtMsgLogResult">
<include refid="selectEtMsgLogVo"/>
where id = #{id}
</select>
<insert id="insertEtMsgLog" parameterType="EtMsgLog" useGeneratedKeys="true" keyProperty="id">
insert into et_msg_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="type != null">type,</if>
<if test="templateCode != null">templateCode,</if>
<if test="signName != null">signName,</if>
<if test="content != null">content,</if>
<if test="createTime != null">create_time,</if>
<if test="phone != null">phone,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null">#{type},</if>
<if test="templateCode != null">#{templateCode},</if>
<if test="signName != null">#{signName},</if>
<if test="content != null">#{content},</if>
<if test="createTime != null">#{createTime},</if>
<if test="phone != null">#{phone},</if>
</trim>
</insert>
<update id="updateEtMsgLog" parameterType="EtMsgLog">
update et_msg_log
<trim prefix="SET" suffixOverrides=",">
<if test="type != null">type = #{type},</if>
<if test="templateCode != null">templateCode = #{templateCode},</if>
<if test="signName != null">signName = #{signName},</if>
<if test="content != null">content = #{content},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="phone != null">phone = #{phone},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEtMsgLogById" parameterType="Long">
delete from et_msg_log where id = #{id}
</delete>
<delete id="deleteEtMsgLogByIds" parameterType="String">
delete from et_msg_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>