云片短信
This commit is contained in:
parent
7657bfd6aa
commit
46d41a305d
|
@ -154,7 +154,7 @@ public class AppController extends BaseController
|
|||
if(rlAgent!=null){
|
||||
return success(modelService.selectEModelListByAgentId(rlAgent.getAgentId()));
|
||||
}
|
||||
return error("代理商不存在");
|
||||
return error("代理商不存在:城市id:"+cityId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,6 +16,7 @@ import com.ruoyi.common.enums.BusinessType;
|
|||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.ServiceUtil;
|
||||
import com.ruoyi.framework.web.service.SysLoginService;
|
||||
import com.ruoyi.system.domain.agent.RlAgentQuery;
|
||||
import com.ruoyi.system.domain.agent.RlAgentVO;
|
||||
import com.ruoyi.system.domain.changeBalance.RlChangeBalance;
|
||||
import com.ruoyi.system.domain.changeBalance.RlChangeBalanceQuery;
|
||||
|
@ -249,7 +250,7 @@ public class AppAdminController extends BaseController
|
|||
authorityVerify();
|
||||
order.setMerchantId(getUserId());
|
||||
logger.info("订单列表请求:order=【"+JSON.toJSONString(order)+"】");
|
||||
List<RlOrderVO> rlOrderVOS = orderService.selectRlOrderList(order);
|
||||
List<RlOrderVO> rlOrderVOS = orderService.selectRlOrderListNoIsolate(order);
|
||||
return success(rlOrderVOS);
|
||||
}
|
||||
|
||||
|
@ -357,6 +358,7 @@ public class AppAdminController extends BaseController
|
|||
* 查询配送工单列表 送达时间
|
||||
*/
|
||||
@GetMapping("/deliveryOrderList")
|
||||
@PreAuthorize("@ss.hasPermi('system:deliveryOrder:list')")
|
||||
public AjaxResult list(RlDeliveryOrderQuery rlDeliveryOrder)
|
||||
{
|
||||
if(ObjectUtil.isNull(rlDeliveryOrder.getStatusList()) || rlDeliveryOrder.getStatusList().length == 0){
|
||||
|
@ -439,4 +441,34 @@ public class AppAdminController extends BaseController
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有代理商列表
|
||||
*/
|
||||
@GetMapping(value = "/getAllAgentList")
|
||||
public AjaxResult getAllAgentList()
|
||||
{
|
||||
logger.info("获取所有代理商列表");
|
||||
List<RlAgentVO> rlAgentVOS = rlAgentService.selectRlAgentListNoIsolate(new RlAgentQuery());
|
||||
return success(rlAgentVOS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定代理商
|
||||
*/
|
||||
@PostMapping(value = "/bandAgent")
|
||||
public AjaxResult bandAgent(Long agentId)
|
||||
{
|
||||
Long userId = getUserId();
|
||||
logger.info("绑定代理商,agentId="+agentId+",userId="+userId);
|
||||
if(agentId == null){
|
||||
throw new ServiceException("代理商id不能为空");
|
||||
}
|
||||
RlUserExt rlUserExt = new RlUserExt();
|
||||
rlUserExt.setUserId(userId);
|
||||
rlUserExt.setAgentId(agentId);
|
||||
int result = rlUserExtService.updateRlUserExt(rlUserExt);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.agent.RlAgent;
|
||||
import com.ruoyi.system.domain.agent.RlAgentQuery;
|
||||
import com.ruoyi.system.domain.agent.RlAgentVO;
|
||||
import com.ruoyi.system.service.IRlAgentService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
@ -34,7 +35,7 @@ public class RlAgentController extends BaseController
|
|||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:agent:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RlAgent rlAgent)
|
||||
public TableDataInfo list(RlAgentQuery rlAgent)
|
||||
{
|
||||
startPage();
|
||||
List<RlAgentVO> list = rlAgentService.selectRlAgentList(rlAgent);
|
||||
|
@ -47,7 +48,7 @@ public class RlAgentController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('system:agent:export')")
|
||||
@Log(title = "代理商", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RlAgent rlAgent)
|
||||
public void export(HttpServletResponse response, RlAgentQuery rlAgent)
|
||||
{
|
||||
List<RlAgentVO> list = rlAgentService.selectRlAgentList(rlAgent);
|
||||
ExcelUtil<RlAgentVO> util = new ExcelUtil<RlAgentVO>(RlAgentVO.class);
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.deliveryOrderOper.RlDeliveryOrderOper;
|
||||
import com.ruoyi.system.domain.deliveryOrderOper.RlDeliveryOrderOperVO;
|
||||
import com.ruoyi.system.service.IRlDeliveryOrderOperService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
@ -40,6 +41,18 @@ public class RlDeliveryOrderOperController extends BaseController
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据工单id查履历
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:deliveryOrderOper:list')")
|
||||
@GetMapping("/listByDeliveryId")
|
||||
public AjaxResult listByOrderId(Long deliveryId)
|
||||
{
|
||||
logger.info("根据工单id查履历:【deliveryId="+deliveryId+"】");
|
||||
List<RlDeliveryOrderOperVO> list = rlDeliveryOrderOperService.selectRlDeliveryOrderOperListByOrderId(deliveryId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出配送单履历列表
|
||||
*/
|
||||
|
|
|
@ -206,6 +206,10 @@ et:
|
|||
appcode: 32b6c6445b1a42ed862dd4202392c47d
|
||||
repairAdmin: wx
|
||||
operateAdmin: root
|
||||
domain: https://zc.chuangtewl.com
|
||||
|
||||
# 用于测试获取token的admin的密码
|
||||
password: admin123
|
||||
|
||||
yp:
|
||||
apikey: 69d42dc4f806b9cbd5de48459353602f
|
||||
|
|
|
@ -863,6 +863,20 @@ public class ServiceConstants {
|
|||
|
||||
/**----------------------------小程序类型end----------------------------*/
|
||||
|
||||
/**----------------------------是否发送过短信提醒start----------------------------*/
|
||||
|
||||
/**
|
||||
* 小程序类型: 0-未发送过
|
||||
*/
|
||||
public static final String IS_SEND_MSG_NO = "0";
|
||||
|
||||
/**
|
||||
* 小程序类型: 1-已发送过
|
||||
*/
|
||||
public static final String IS_SEND_MSG_YES = "1";
|
||||
|
||||
/**----------------------------是否发送过短信提醒end----------------------------*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
package com.ruoyi.common.utils;
|
||||
|
||||
import com.ruoyi.common.utils.http.HttpUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class YPMsgUtils {
|
||||
private static final Logger log = LoggerFactory.getLogger(YPMsgUtils.class);
|
||||
|
||||
public static final String apikey = SpringUtils.getRequiredProperty("yp.apikey");
|
||||
|
||||
/**
|
||||
* 发送下单短信
|
||||
*/
|
||||
public static void sendPlaceOrderMsg(String orderNo , String sendPhone, String orderPhone) {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("apikey", apikey);
|
||||
params.put("text", "【小兜出行】您有新的订单已成功下单!订单号为:"+orderNo+",手机号为:["+orderPhone+"],请及时配送。");
|
||||
params.put("mobile", sendPhone);
|
||||
String s = HttpUtils.sendPost("https://sms.yunpian.com/v2/sms/single_send.json", params);
|
||||
log.info("【下单短信】发送短信结果:"+s);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送即将到期提醒
|
||||
* 是否发送过短信
|
||||
*/
|
||||
public static void expirationReminderMsg(String orderNo , String sendPhone, String time) {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("apikey", "69d42dc4f806b9cbd5de48459353602f");
|
||||
params.put("text", "您好!您的租赁订单:["+orderNo+"]即将到期,到期时间为:["+time+"]。\n" +
|
||||
"如需续租请及时处理,若有其他疑问,请联系我们的客服。感谢您的支持与信任!");
|
||||
params.put("mobile", sendPhone);
|
||||
String s = HttpUtils.sendPost("https://sms.yunpian.com/v2/sms/single_send.json", params);
|
||||
log.info("【到期提醒】发送短信结果:"+s);
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// expirationReminderMsg("123456789","18650502300","2024-11-05");
|
||||
// }
|
||||
}
|
|
@ -5,12 +5,12 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.net.ConnectException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.net.ssl.HostnameVerifier;
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import javax.net.ssl.SSLContext;
|
||||
|
@ -192,6 +192,79 @@ public class HttpUtils
|
|||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 向指定 URL 发送 POST 方法的请求
|
||||
*
|
||||
* @param url 发送请求的 URL
|
||||
* @param params 请求参数,使用 Map<String, String> 类型
|
||||
* @return 所代表远程资源的响应结果
|
||||
*/
|
||||
public static String sendPost(String url, Map<String, String> params) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
// 使用 try-with-resources 自动关闭流
|
||||
try {
|
||||
log.info("sendPost - {}", url);
|
||||
|
||||
// 将 params Map 转换为 URL 编码的参数字符串
|
||||
StringBuilder paramString = new StringBuilder();
|
||||
Set<Map.Entry<String, String>> entrySet = params.entrySet();
|
||||
Iterator<Map.Entry<String, String>> iterator = entrySet.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<String, String> entry = iterator.next();
|
||||
String key = entry.getKey();
|
||||
String value = entry.getValue();
|
||||
paramString.append(URLEncoder.encode(key, StandardCharsets.UTF_8.name()));
|
||||
paramString.append("=");
|
||||
paramString.append(URLEncoder.encode(value, StandardCharsets.UTF_8.name()));
|
||||
if (iterator.hasNext()) {
|
||||
paramString.append("&");
|
||||
}
|
||||
}
|
||||
|
||||
// 打印请求参数
|
||||
log.info("Request params: {}", paramString.toString());
|
||||
|
||||
// 发送请求
|
||||
URL realUrl = new URL(url);
|
||||
HttpURLConnection conn = (HttpURLConnection) realUrl.openConnection();
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setRequestProperty("accept", "*/*");
|
||||
conn.setRequestProperty("connection", "Keep-Alive");
|
||||
conn.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
|
||||
conn.setRequestProperty("Accept-Charset", "utf-8");
|
||||
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||
conn.setDoOutput(true);
|
||||
conn.setDoInput(true);
|
||||
conn.setConnectTimeout(5000); // 设置连接超时
|
||||
conn.setReadTimeout(5000); // 设置读取超时
|
||||
|
||||
// 发送参数
|
||||
try (PrintWriter out = new PrintWriter(conn.getOutputStream())) {
|
||||
out.print(paramString.toString());
|
||||
out.flush();
|
||||
}
|
||||
|
||||
// 读取响应
|
||||
try (BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8))) {
|
||||
String line;
|
||||
while ((line = in.readLine()) != null) {
|
||||
result.append(line);
|
||||
}
|
||||
}
|
||||
log.info("recv - {}", result);
|
||||
|
||||
} catch (ConnectException e) {
|
||||
log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ", params=" + params);
|
||||
} catch (SocketTimeoutException e) {
|
||||
log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ", params=" + params);
|
||||
} catch (IOException e) {
|
||||
log.error("调用HttpUtils.sendPost IOException, url=" + url + ", params=" + params);
|
||||
} catch (Exception e) {
|
||||
log.error("调用HttpUtils.sendPost Exception, url=" + url + ", params=" + params);
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取请求中的原始body
|
||||
* @param request 请求
|
||||
|
|
|
@ -133,6 +133,7 @@ public class SecurityConfig
|
|||
"/register",
|
||||
"/captchaImage",
|
||||
"/appCaptcha",
|
||||
"/appAdmin/appCodeLogin",
|
||||
"/appCodeLogin",
|
||||
"/app/**",
|
||||
// "/appVerify/**",
|
||||
|
|
|
@ -82,7 +82,7 @@ public class UserDetailsServiceImpl implements UserDetailsService
|
|||
return loginUser;
|
||||
}
|
||||
verifyUser(username, user);
|
||||
if(!Constants.USER_TYPE_TEST.equals(userType)){
|
||||
if(!(Constants.USER_TYPE_TEST.equals(userType) || Constants.USER_TYPE_APP.equals(userType))){
|
||||
passwordService.validate(user);
|
||||
}
|
||||
return createLoginUser(user);
|
||||
|
|
|
@ -64,4 +64,8 @@ public class RlAgent extends BaseEntity
|
|||
/** 服务费比例 */
|
||||
@Excel(name = "服务费比例")
|
||||
private BigDecimal serviceFeeProportion;
|
||||
|
||||
/** 分账比例 */
|
||||
@Excel(name = "分账比例")
|
||||
private BigDecimal dividendProportion;
|
||||
}
|
||||
|
|
|
@ -5,4 +5,7 @@ import lombok.Data;
|
|||
@Data
|
||||
public class RlAgentQuery extends RlAgent{
|
||||
|
||||
/** 城市名称*/
|
||||
private String cityName;
|
||||
|
||||
}
|
||||
|
|
|
@ -22,10 +22,6 @@ public class RlOperatingArea extends BaseEntity
|
|||
@Excel(name = "区域名称")
|
||||
private String areaName;
|
||||
|
||||
/** 边界值 */
|
||||
@Excel(name = "边界值")
|
||||
private String boundary;
|
||||
|
||||
/** 边界值(高德地图) */
|
||||
@Excel(name = "边界值", readConverterExp = "高=德地图")
|
||||
private String boundaryStr;
|
||||
|
|
|
@ -43,7 +43,7 @@ public class RlDeliveryOrderOper extends BaseEntity
|
|||
private String operName;
|
||||
|
||||
/** 操作时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date operTime;
|
||||
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
package com.ruoyi.system.domain.deliveryOrderOper;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RlDeliveryOrderOperVO extends RlDeliveryOrderOper{
|
||||
|
||||
/** 订单号 */
|
||||
@Excel(name = "订单号")
|
||||
private String orderNo;
|
||||
|
||||
/** 代理商名称 */
|
||||
@Excel(name = "代理商名称")
|
||||
private String agentName;
|
||||
}
|
||||
|
|
|
@ -156,4 +156,9 @@ public class RlDevice extends BaseEntityPlus implements Serializable {
|
|||
@Excel(name = "代理商")
|
||||
private Long agentId;
|
||||
|
||||
/** 运营区id */
|
||||
@Excel(name = "运营区id")
|
||||
private Long areaId;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -16,262 +16,397 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||
* @date 2024-09-19
|
||||
*/
|
||||
@Data
|
||||
public class RlOrder extends BaseEntity
|
||||
{
|
||||
public class RlOrder extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 订单id */
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/** 订单号 */
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
@Excel(name = "订单号")
|
||||
private String orderNo;
|
||||
|
||||
/** 微信商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号 */
|
||||
/**
|
||||
* 微信商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号
|
||||
*/
|
||||
@Excel(name = "微信商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号")
|
||||
private String outTradeNo;
|
||||
|
||||
/** 用户ID */
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Excel(name = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 用户名 */
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Excel(name = "用户名")
|
||||
private String userName;
|
||||
|
||||
/** 真实姓名 */
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
@Excel(name = "真实姓名")
|
||||
private String realName;
|
||||
|
||||
/** 手机号 */
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Excel(name = "手机号")
|
||||
private String phone;
|
||||
|
||||
/** 计费规则id */
|
||||
/**
|
||||
* 计费规则id
|
||||
*/
|
||||
@Excel(name = "计费规则id")
|
||||
private Long ruleId;
|
||||
|
||||
/** 设备mac */
|
||||
/**
|
||||
* 设备mac
|
||||
*/
|
||||
@Excel(name = "设备mac")
|
||||
private String deviceMac;
|
||||
|
||||
/** sn码 */
|
||||
/**
|
||||
* sn码
|
||||
*/
|
||||
@Excel(name = "sn码")
|
||||
private String sn;
|
||||
|
||||
@Excel(name = "车型id")
|
||||
private Long modelId;
|
||||
|
||||
/** 车型 */
|
||||
/**
|
||||
* 车型
|
||||
*/
|
||||
@Excel(name = "车型")
|
||||
private String model;
|
||||
|
||||
/** 支付时间 */
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date payTime;
|
||||
|
||||
/** 支付方式 */
|
||||
/**
|
||||
* 支付方式
|
||||
*/
|
||||
@Excel(name = "支付方式")
|
||||
private String payType;
|
||||
|
||||
/** 支付状态 */
|
||||
/**
|
||||
* 支付状态
|
||||
*/
|
||||
@Excel(name = "支付状态")
|
||||
private String paid;
|
||||
|
||||
/** 类型 */
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Excel(name = "类型")
|
||||
private String type;
|
||||
|
||||
/** 订单总金额(元) */
|
||||
/**
|
||||
* 订单总金额(元)
|
||||
*/
|
||||
@Excel(name = "订单总金额", readConverterExp = "元")
|
||||
private BigDecimal totalFee;
|
||||
|
||||
/** 实际支付金额 */
|
||||
/**
|
||||
* 实际支付金额
|
||||
*/
|
||||
@Excel(name = "实际支付金额")
|
||||
private BigDecimal payFee;
|
||||
|
||||
/** 逾期费 */
|
||||
/**
|
||||
* 逾期费
|
||||
*/
|
||||
@Excel(name = "逾期费")
|
||||
private BigDecimal overdueFee;
|
||||
|
||||
/** 调度费 */
|
||||
/**
|
||||
* 调度费
|
||||
*/
|
||||
@Excel(name = "调度费")
|
||||
private BigDecimal dispatchFee;
|
||||
|
||||
/** 配送费 */
|
||||
/**
|
||||
* 配送费
|
||||
*/
|
||||
@Excel(name = "配送费")
|
||||
private BigDecimal deliveryFee;
|
||||
|
||||
/** 租赁费 */
|
||||
/**
|
||||
* 租赁费
|
||||
*/
|
||||
@Excel(name = "租赁费")
|
||||
private BigDecimal leaseFee;
|
||||
|
||||
/** 押金 */
|
||||
/**
|
||||
* 押金
|
||||
*/
|
||||
@Excel(name = "押金")
|
||||
private BigDecimal deposit;
|
||||
|
||||
/** 备注 */
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注")
|
||||
private String mark;
|
||||
|
||||
/** 订单时长 */
|
||||
/**
|
||||
* 订单时长
|
||||
*/
|
||||
@Excel(name = "订单时长")
|
||||
private Integer duration;
|
||||
|
||||
/** 状态 */
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Excel(name = "状态")
|
||||
private String status;
|
||||
|
||||
/** 是否逾期 */
|
||||
/**
|
||||
* 是否逾期
|
||||
*/
|
||||
@Excel(name = "是否逾期")
|
||||
private Boolean isOverdue;
|
||||
|
||||
/** 还车时间 */
|
||||
/**
|
||||
* 还车时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "还车时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date returnTime;
|
||||
|
||||
/** 是否押金抵扣 */
|
||||
/**
|
||||
* 是否押金抵扣
|
||||
*/
|
||||
@Excel(name = "是否押金抵扣")
|
||||
private String depositDeduction;
|
||||
|
||||
/** 押金订单号,押金抵扣时,记录是哪个押金订单 */
|
||||
/**
|
||||
* 押金订单号,押金抵扣时,记录是哪个押金订单
|
||||
*/
|
||||
private String depositOrderNo;
|
||||
|
||||
/** 扣除金额 */
|
||||
/**
|
||||
* 扣除金额
|
||||
*/
|
||||
@Excel(name = "扣除金额")
|
||||
private BigDecimal deductionAmount;
|
||||
|
||||
/** 使用过的sn */
|
||||
/**
|
||||
* 使用过的sn
|
||||
*/
|
||||
private String usedSn;
|
||||
|
||||
/** 换车原因 */
|
||||
/**
|
||||
* 换车原因
|
||||
*/
|
||||
private String changeReason;
|
||||
|
||||
/** 还车结算___小时后自动退押金 */
|
||||
/**
|
||||
* 还车结算___小时后自动退押金
|
||||
*/
|
||||
@Excel(name = "还车结算___小时后自动退押金")
|
||||
private Integer autoRefundDeposit;
|
||||
|
||||
/** 租赁单位 */
|
||||
/**
|
||||
* 租赁单位
|
||||
*/
|
||||
@Excel(name = "租赁单位")
|
||||
private String rentalUnit;
|
||||
|
||||
/** 手续费 */
|
||||
/**
|
||||
* 手续费
|
||||
*/
|
||||
@Excel(name = "手续费")
|
||||
private BigDecimal handlingCharge;
|
||||
|
||||
/** 服务费 */
|
||||
/**
|
||||
* 服务费
|
||||
*/
|
||||
@Excel(name = "服务费")
|
||||
private BigDecimal platformServiceFee;
|
||||
|
||||
/** 运营商分账 */
|
||||
/**
|
||||
* 运营商分账
|
||||
*/
|
||||
@Excel(name = "运营商分账")
|
||||
private BigDecimal operatorDividend;
|
||||
|
||||
/** 支付渠道id */
|
||||
/**
|
||||
* 支付渠道id
|
||||
*/
|
||||
@Excel(name = "支付渠道id")
|
||||
private Long payChannel;
|
||||
|
||||
/** 配送方式 */
|
||||
/**
|
||||
* 配送方式
|
||||
*/
|
||||
@Excel(name = "配送方式")
|
||||
private Integer deliveryMethod;
|
||||
|
||||
/** 取车时间 */
|
||||
/**
|
||||
* 取车时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "取车时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date pickupTime;
|
||||
|
||||
/** 代理商id */
|
||||
/**
|
||||
* 代理商id
|
||||
*/
|
||||
@Excel(name = "代理商id")
|
||||
private Long agentId;
|
||||
|
||||
/** 店铺id */
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@Excel(name = "店铺id")
|
||||
private Long storeId;
|
||||
|
||||
/** 店铺名称 */
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
@Excel(name = "店铺名称")
|
||||
private String storeName;
|
||||
|
||||
/** 商户id */
|
||||
/**
|
||||
* 商户id
|
||||
*/
|
||||
@Excel(name = "商户id")
|
||||
private Long merchantId;
|
||||
|
||||
/** 取车城市 */
|
||||
/**
|
||||
* 取车城市
|
||||
*/
|
||||
@Excel(name = "取车城市")
|
||||
private String pickupCity;
|
||||
|
||||
/** 取车地点 */
|
||||
/**
|
||||
* 取车地点
|
||||
*/
|
||||
@Excel(name = "取车地点")
|
||||
private String pickupLoc;
|
||||
|
||||
/** 取车经度 */
|
||||
/**
|
||||
* 取车经度
|
||||
*/
|
||||
@Excel(name = "取车经度")
|
||||
private String pickupLon;
|
||||
|
||||
/** 取车纬度 */
|
||||
/**
|
||||
* 取车纬度
|
||||
*/
|
||||
@Excel(name = "取车纬度")
|
||||
private String pickupLat;
|
||||
|
||||
/** 到期时间 */
|
||||
/**
|
||||
* 到期时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "到期时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date expiryTime;
|
||||
|
||||
/** 原订单号 订单类型为续租时需要 */
|
||||
/**
|
||||
* 原订单号 订单类型为续租时需要
|
||||
*/
|
||||
private String originalOrderNo;
|
||||
|
||||
/** 数量 */
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@Excel(name = "数量")
|
||||
private Integer num;
|
||||
|
||||
/** 售价 */
|
||||
/**
|
||||
* 售价
|
||||
*/
|
||||
@Excel(name = "售价")
|
||||
private BigDecimal price;
|
||||
|
||||
/** 说明 */
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
@Excel(name = "说明")
|
||||
private String explain;
|
||||
|
||||
/** 骑行价格说明 */
|
||||
/**
|
||||
* 骑行价格说明
|
||||
*/
|
||||
@Excel(name = "骑行价格说明")
|
||||
private String instructions;
|
||||
|
||||
/** 超出单位 */
|
||||
/**
|
||||
* 超出单位
|
||||
*/
|
||||
@Excel(name = "超出单位")
|
||||
private String outUnit;
|
||||
|
||||
/** 超出价格 */
|
||||
/**
|
||||
* 超出价格
|
||||
*/
|
||||
@Excel(name = "超出价格")
|
||||
private BigDecimal outPrice;
|
||||
|
||||
/** 还车类型:type:1-正常还车;2-辅助还车 */
|
||||
/**
|
||||
* 还车类型:type:1-正常还车;2-辅助还车
|
||||
*/
|
||||
private String returnType;
|
||||
|
||||
/** 还车方式:1-自行前往门店;2-上门取车 */
|
||||
/**
|
||||
* 还车方式:1-自行前往门店;2-上门取车
|
||||
*/
|
||||
private String returnMethod;
|
||||
|
||||
/** 还车地址*/
|
||||
/**
|
||||
* 还车地址
|
||||
*/
|
||||
private String returnAddress;
|
||||
|
||||
/** 还车经度*/
|
||||
/**
|
||||
* 还车经度
|
||||
*/
|
||||
private String returnLon;
|
||||
|
||||
/** 还车纬度*/
|
||||
/**
|
||||
* 还车纬度
|
||||
*/
|
||||
private String returnLat;
|
||||
|
||||
/** 还车店铺id*/
|
||||
/**
|
||||
* 还车店铺id
|
||||
*/
|
||||
private Long returnStoreId;
|
||||
|
||||
/** 还车店铺名称*/
|
||||
/**
|
||||
* 还车店铺名称
|
||||
*/
|
||||
private String returnStoreName;
|
||||
|
||||
/** 系统自动取消时间*/
|
||||
/**
|
||||
* 系统自动取消时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date autoCancelTime;
|
||||
|
||||
/** 成本 */
|
||||
/**
|
||||
* 成本
|
||||
*/
|
||||
private BigDecimal cost;
|
||||
|
||||
/**
|
||||
* 是否已发送过短信提醒
|
||||
*/
|
||||
@Excel(name = "是否已发送过短信提醒")
|
||||
private Boolean isSendMsg;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.system.domain.agent.RlAgent;
|
||||
import com.ruoyi.system.domain.agent.RlAgentQuery;
|
||||
import com.ruoyi.system.domain.agent.RlAgentVO;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -43,7 +44,7 @@ public interface RlAgentMapper
|
|||
* @param rlAgent 代理商
|
||||
* @return 代理商集合
|
||||
*/
|
||||
public List<RlAgentVO> selectRlAgentList(RlAgent rlAgent);
|
||||
public List<RlAgentVO> selectRlAgentList(RlAgentQuery rlAgent);
|
||||
|
||||
/**
|
||||
* 新增代理商
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.system.domain.deliveryOrderOper.RlDeliveryOrderOper;
|
||||
import com.ruoyi.system.domain.deliveryOrderOper.RlDeliveryOrderOperVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -59,4 +60,12 @@ public interface RlDeliveryOrderOperMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteRlDeliveryOrderOperByOperIds(Long[] operIds);
|
||||
|
||||
/**
|
||||
* 根据工单id查履历
|
||||
*
|
||||
* @param deliveryId 工单id
|
||||
* @return 配送单履历集合
|
||||
*/
|
||||
List<RlDeliveryOrderOperVO> selectRlDeliveryOrderOperListByOrderId(Long deliveryId);
|
||||
}
|
||||
|
|
|
@ -69,4 +69,12 @@ public interface RlOperatingAreaMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteRlOperatingAreaByAreaIds(Long[] areaIds);
|
||||
|
||||
/**
|
||||
* 根据代理商id查询运营区id
|
||||
*
|
||||
* @param agentId 代理商id
|
||||
* @return 结果
|
||||
*/
|
||||
Long selectAreaIdByAgentId(Long agentId);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.system.domain.agent.RlAgent;
|
||||
import com.ruoyi.system.domain.agent.RlAgentQuery;
|
||||
import com.ruoyi.system.domain.agent.RlAgentVO;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -43,7 +44,15 @@ public interface IRlAgentService
|
|||
* @param rlAgent 代理商
|
||||
* @return 代理商集合
|
||||
*/
|
||||
public List<RlAgentVO> selectRlAgentList(RlAgent rlAgent);
|
||||
public List<RlAgentVO> selectRlAgentList(RlAgentQuery rlAgent);
|
||||
|
||||
/**
|
||||
* 查询代理商列表
|
||||
*
|
||||
* @param rlAgent 代理商
|
||||
* @return 代理商集合
|
||||
*/
|
||||
public List<RlAgentVO> selectRlAgentListNoIsolate(RlAgentQuery rlAgent);
|
||||
|
||||
/**
|
||||
* 新增代理商
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.system.service;
|
|||
import com.ruoyi.common.constant.ServiceConstants;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.system.domain.deliveryOrderOper.RlDeliveryOrderOper;
|
||||
import com.ruoyi.system.domain.deliveryOrderOper.RlDeliveryOrderOperVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -30,6 +31,14 @@ public interface IRlDeliveryOrderOperService
|
|||
*/
|
||||
public List<RlDeliveryOrderOper> selectRlDeliveryOrderOperList(RlDeliveryOrderOper rlDeliveryOrderOper);
|
||||
|
||||
/**
|
||||
* 根据工单id查履历
|
||||
*
|
||||
* @param orderId 工单id
|
||||
* @return 配送单履历集合
|
||||
*/
|
||||
public List<RlDeliveryOrderOperVO> selectRlDeliveryOrderOperListByOrderId(Long orderId);
|
||||
|
||||
/**
|
||||
* 新增配送单履历
|
||||
*
|
||||
|
|
|
@ -37,6 +37,14 @@ public interface IRlDeliveryOrderService
|
|||
*/
|
||||
public List<RlDeliveryOrderVO> selectRlDeliveryOrderList(RlDeliveryOrder rlDeliveryOrder);
|
||||
|
||||
/**
|
||||
* 查询配送工单列表
|
||||
*
|
||||
* @param rlDeliveryOrder 配送工单
|
||||
* @return 配送工单集合
|
||||
*/
|
||||
public List<RlDeliveryOrderVO> selectRlDeliveryOrderListNoIsolate(RlDeliveryOrder rlDeliveryOrder);
|
||||
|
||||
/**
|
||||
* 新增配送工单
|
||||
*
|
||||
|
|
|
@ -67,4 +67,12 @@ public interface IRlOperatingAreaService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteRlOperatingAreaByAreaId(Long areaId);
|
||||
|
||||
/**
|
||||
* 根据代理商id查询运营区id
|
||||
*
|
||||
* @param agentId 代理商id
|
||||
* @return 结果
|
||||
*/
|
||||
Long selectAreaIdByAgentId(Long agentId);
|
||||
}
|
||||
|
|
|
@ -304,6 +304,7 @@ public class CallbackServiceImpl implements CallbackService {
|
|||
etCallbackLog.setBody(JSON.toJSONString(refundNotification));
|
||||
if (Status.SUCCESS.equals(refundNotification.getRefundStatus())) {
|
||||
// 退款成功后 改变 etRefundService
|
||||
// 如果outRefundNo没有值,说明是押金退款,直接新增退款记录, 还是在还车时新建退款记录?
|
||||
String outRefundNo = refundNotification.getOutRefundNo();
|
||||
RlRefund rlRefund = new RlRefund();
|
||||
rlRefund.setRefundNo(outRefundNo);
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl;
|
|||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.system.domain.agent.RlAgent;
|
||||
import com.ruoyi.system.domain.agent.RlAgentQuery;
|
||||
import com.ruoyi.system.domain.agent.RlAgentVO;
|
||||
import com.ruoyi.system.domain.area.RlOperatingAreaVO;
|
||||
import com.ruoyi.system.domain.cancelRule.RlCancelRule;
|
||||
|
@ -44,7 +45,7 @@ public class RlAgentServiceImpl implements IRlAgentService
|
|||
{
|
||||
RlAgentVO rlAgentVO = rlAgentMapper.selectRlAgentByAgentId(agentId);
|
||||
if(ObjectUtil.isNull(rlAgentVO)){
|
||||
throw new RuntimeException("代理商不存在");
|
||||
throw new RuntimeException("代理商不存在:"+agentId);
|
||||
}
|
||||
getAgentInfo(rlAgentVO);
|
||||
return rlAgentVO;
|
||||
|
@ -72,7 +73,7 @@ public class RlAgentServiceImpl implements IRlAgentService
|
|||
{
|
||||
RlAgentVO rlAgentVO = rlAgentMapper.selectRlAgentByCityId(cityId);
|
||||
if(ObjectUtil.isNull(rlAgentVO)){
|
||||
throw new RuntimeException("代理商不存在");
|
||||
throw new RuntimeException("代理商不存在:城市id:"+cityId);
|
||||
}
|
||||
getAgentInfo(rlAgentVO);
|
||||
return rlAgentVO;
|
||||
|
@ -96,7 +97,19 @@ public class RlAgentServiceImpl implements IRlAgentService
|
|||
*/
|
||||
@Override
|
||||
@DataScope(agentAlias = "a")
|
||||
public List<RlAgentVO> selectRlAgentList(RlAgent rlAgent)
|
||||
public List<RlAgentVO> selectRlAgentList(RlAgentQuery rlAgent)
|
||||
{
|
||||
return rlAgentMapper.selectRlAgentList(rlAgent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理商列表
|
||||
*
|
||||
* @param rlAgent 代理商
|
||||
* @return 代理商
|
||||
*/
|
||||
@Override
|
||||
public List<RlAgentVO> selectRlAgentListNoIsolate(RlAgentQuery rlAgent)
|
||||
{
|
||||
return rlAgentMapper.selectRlAgentList(rlAgent);
|
||||
}
|
||||
|
|
|
@ -2,14 +2,18 @@ package com.ruoyi.system.service.impl;
|
|||
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.ServiceConstants;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.system.domain.deliveryOrderOper.RlDeliveryOrderOper;
|
||||
import com.ruoyi.system.domain.deliveryOrderOper.RlDeliveryOrderOperVO;
|
||||
import com.ruoyi.system.mapper.RlDeliveryOrderOperMapper;
|
||||
import com.ruoyi.system.service.IRlDeliveryOrderOperService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.rmi.server.ServerCloneException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -50,6 +54,20 @@ public class RlDeliveryOrderOperServiceImpl implements IRlDeliveryOrderOperServi
|
|||
return rlDeliveryOrderOperMapper.selectRlDeliveryOrderOperList(rlDeliveryOrderOper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据工单id查履历
|
||||
*
|
||||
* @param deliveryId 工单id
|
||||
* @return 配送单履历集合
|
||||
*/
|
||||
@Override
|
||||
public List<RlDeliveryOrderOperVO> selectRlDeliveryOrderOperListByOrderId(Long deliveryId) {
|
||||
if (deliveryId == null) {
|
||||
throw new ServiceException("工单id为空");
|
||||
}
|
||||
return rlDeliveryOrderOperMapper.selectRlDeliveryOrderOperListByOrderId(deliveryId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增配送单履历
|
||||
*
|
||||
|
|
|
@ -81,12 +81,24 @@ public class RlDeliveryOrderServiceImpl implements IRlDeliveryOrderService
|
|||
* @return 配送工单
|
||||
*/
|
||||
@Override
|
||||
@DataScope(agentAlias = "a",userAlias = "u")
|
||||
@DataScope(userAlias = "u",onlyUser = "1")
|
||||
public List<RlDeliveryOrderVO> selectRlDeliveryOrderList(RlDeliveryOrder rlDeliveryOrder)
|
||||
{
|
||||
return rlDeliveryOrderMapper.selectRlDeliveryOrderList(rlDeliveryOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配送工单列表
|
||||
*
|
||||
* @param rlDeliveryOrder 配送工单
|
||||
* @return 配送工单
|
||||
*/
|
||||
@Override
|
||||
public List<RlDeliveryOrderVO> selectRlDeliveryOrderListNoIsolate(RlDeliveryOrder rlDeliveryOrder)
|
||||
{
|
||||
return rlDeliveryOrderMapper.selectRlDeliveryOrderList(rlDeliveryOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增配送工单
|
||||
*
|
||||
|
|
|
@ -85,6 +85,9 @@ public class RlDeviceServiceImpl extends ServiceImpl<RlDeviceMapper, RlDevice> i
|
|||
|
||||
@Autowired
|
||||
private ISysConfigService sysConfigService;
|
||||
|
||||
@Resource
|
||||
private IRlOperatingAreaService areaService;
|
||||
//
|
||||
// @Autowired
|
||||
// private IEtFeeRuleService etFeeRuleService;
|
||||
|
@ -143,6 +146,8 @@ public class RlDeviceServiceImpl extends ServiceImpl<RlDeviceMapper, RlDevice> i
|
|||
@Value(value = "${iot.deviceUrl}")
|
||||
private String deviceUrl;
|
||||
|
||||
@Value(value = "${et.domain}")
|
||||
private String domain;
|
||||
/**
|
||||
* 查询设备
|
||||
*
|
||||
|
@ -272,41 +277,14 @@ public class RlDeviceServiceImpl extends ServiceImpl<RlDeviceMapper, RlDevice> i
|
|||
asDevice.setStatus(null);
|
||||
}
|
||||
List<RlDeviceVO> asDevices = deviceMapper.selectDeviceListWithIsolate(asDevice);
|
||||
// for (EDevice asDevice1:asDevices){
|
||||
// Long areaId = asDevice1.getAreaId();
|
||||
// if (ObjectUtil.isNotNull(areaId) && areaId!=0){
|
||||
// EtOperatingArea etOperatingArea = etOperatingAreaService.selectEtOperatingAreaByAreaId(areaId);
|
||||
// asDevice1.setAreaName(etOperatingArea.getAreaName());
|
||||
// }
|
||||
// Long modelId = asDevice1.getModelId();
|
||||
// if (ObjectUtil.isNotNull(modelId)){
|
||||
// EtModel model = etModelService.selectEtModelByModelId(modelId);
|
||||
// if(ObjectUtil.isNotNull(model)){
|
||||
// asDevice1.setModel(model.getModel());
|
||||
// }
|
||||
// }
|
||||
// String status = asDevice1.getStatus();
|
||||
// if(ObjectUtil.isNotNull(status)){
|
||||
// String typeName = sysDictDataService.selectDictLabel("as_device_status", status);
|
||||
// asDevice1.setStatusStr(typeName);
|
||||
// if(status.equals(ServiceConstants.VEHICLE_STATUS_NOT_BAND) && ObjectUtil.isNotNull(asDevice1.getAreaId())){
|
||||
// asDevice1.setStatus(ServiceConstants.VEHICLE_STATUS_NOT_LISTING);
|
||||
// int i = eDeviceMapper.updateAsDevice(asDevice1);
|
||||
// }
|
||||
// }
|
||||
// if(ObjectUtil.isNull(asDevice1.getAreaId())){
|
||||
// asDevice1.setStatus(ServiceConstants.VEHICLE_STATUS_NOT_BAND);
|
||||
// int i = eDeviceMapper.updateAsDevice(asDevice1);
|
||||
// }
|
||||
// if(ObjectUtil.isNotNull(areaId) && areaId!=0){
|
||||
// SysDept sysDept = wxPayService.getDeptObjByAreaId(areaId);
|
||||
// //https://dianche.chuantewulian.cn?sn=https://dche.ccttiot.com?sn=3000900
|
||||
// asDevice1.setQrText(sysDept.getDomain()+"?sn="+asDevice1.getSn());
|
||||
// asDevice1.setDeptName(sysDept.getDeptName());
|
||||
// }else{
|
||||
// asDevice1.setQrText("");
|
||||
// }
|
||||
// }
|
||||
for (RlDeviceVO device:asDevices){
|
||||
if(ObjectUtil.isNotNull(device)){
|
||||
//https://zc.chuangtewl.com?sn=3000060
|
||||
device.setQrText(domain+"?sn="+device.getSn());
|
||||
}else{
|
||||
device.setQrText("");
|
||||
}
|
||||
}
|
||||
return asDevices;
|
||||
}
|
||||
|
||||
|
@ -331,6 +309,7 @@ public class RlDeviceServiceImpl extends ServiceImpl<RlDeviceMapper, RlDevice> i
|
|||
if(ObjectUtil.isNotNull(storeVo)){
|
||||
asDevice.setMerchantId(storeVo.getMerchantId());
|
||||
asDevice.setAgentId(storeVo.getAgentId());
|
||||
asDevice.setAreaId(areaService.selectAreaIdByAgentId(storeVo.getAgentId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1351,7 +1330,8 @@ public class RlDeviceServiceImpl extends ServiceImpl<RlDeviceMapper, RlDevice> i
|
|||
if(!ServiceConstants.ORDER_STATUS_IN_USE.equals(order.getStatus())){
|
||||
throw new ServiceException("该订单状态非使用中");
|
||||
}
|
||||
if(StrUtil.isBlank(orderQuery.getReturnLon()) || StrUtil.isBlank(orderQuery.getReturnLat())){
|
||||
if(ServiceConstants.RETURN_METHOD_TO_STORE.equals(orderQuery.getReturnMethod()) &&
|
||||
(StrUtil.isBlank(orderQuery.getReturnLon()) || StrUtil.isBlank(orderQuery.getReturnLat()))){
|
||||
throw new ServiceException("手机经纬度不能为空");
|
||||
}
|
||||
RlOrder updateOrder = new RlOrder();
|
||||
|
@ -1366,19 +1346,18 @@ public class RlDeviceServiceImpl extends ServiceImpl<RlDeviceMapper, RlDevice> i
|
|||
RlDevice device = deviceMapper.selectDeviceBySn(order.getSn());
|
||||
RlDevice updateDevice = new RlDevice();
|
||||
updateDevice.setDeviceId(device.getDeviceId());
|
||||
if(ServiceConstants.RETURN_TYPE_NORMAL.equals(orderQuery.getReturnType())){
|
||||
/** 2. 车辆远程关锁*/
|
||||
if(ServiceConstants.RETURN_TYPE_NORMAL.equals(orderQuery.getReturnType()) && ServiceConstants.RETURN_METHOD_TO_STORE.equals(orderQuery.getReturnMethod())){
|
||||
/** 2.判断是否在店铺附近 先根据手机定位判断,再跟进车辆定位判断,如果两个都不在,则提示不在附近*/
|
||||
boolean nearStore = isNearStore(orderQuery, device);
|
||||
if(!nearStore){
|
||||
throw new ServiceException("不在店铺附近,请前往店铺还车");
|
||||
}
|
||||
/** 2.1 车辆远程关锁*/
|
||||
ResponseVo responseVo = sendCommandWithResp(device.getMac(), token, IotConstants.COMMAND_CLOSE + IotConstants.COMMAND_FREQUENCY_3600, "还车关锁",orderNo);
|
||||
if(responseVo.getCode()!=0){
|
||||
log.info("【还车关锁】远程关锁失败");
|
||||
throw new ServiceException("远程关锁失败");
|
||||
}
|
||||
|
||||
/** 2.1.判断是否在店铺附近 先根据手机定位判断,再跟进车辆定位判断,如果两个都不在,则提示不在附近*/
|
||||
boolean nearStore = isNearStore(orderQuery, device);
|
||||
if(!nearStore){
|
||||
throw new ServiceException("不在店铺附近,请前往店铺还车");
|
||||
}
|
||||
}else{
|
||||
ResponseVo responseVo = sendCommandWithResp(device.getMac(), token, IotConstants.COMMAND_CLOSE + IotConstants.COMMAND_FREQUENCY_3600, "辅助还车关锁",orderNo);
|
||||
if(responseVo.getCode()!=0){
|
||||
|
|
|
@ -142,6 +142,7 @@ public class RlDividendDetailServiceImpl implements IRlDividendDetailService
|
|||
public int calculationDividend(RlOrder originalOrder,String userType) {
|
||||
RlUserExt rlUserExt;
|
||||
RlUser rlUser ;
|
||||
RlDividendDetail rlDividendDetail = new RlDividendDetail();
|
||||
if(userType.equals(ServiceConstants.USER_TYPE_MERCHANT)){
|
||||
rlUserExt = userExtService.selectRlUserExtByUserId(originalOrder.getMerchantId());
|
||||
rlUser = userService.selectUserById(rlUserExt.getUserId());
|
||||
|
@ -149,15 +150,14 @@ public class RlDividendDetailServiceImpl implements IRlDividendDetailService
|
|||
RlAgentVO rlAgentVO = agentService.selectRlAgentByAgentId(originalOrder.getAgentId());
|
||||
rlUserExt = userExtService.selectRlUserExtByUserId(rlAgentVO.getUserid());
|
||||
rlUser = userService.selectUserById(rlUserExt.getUserId());
|
||||
rlDividendDetail.setDividendProportion(rlAgentVO.getDividendProportion());
|
||||
}else{
|
||||
throw new ServiceException("用户类型有误");
|
||||
}
|
||||
RlDividendDetail rlDividendDetail = new RlDividendDetail();
|
||||
rlDividendDetail.setAgentId(originalOrder.getAgentId());
|
||||
rlDividendDetail.setPartnerId(rlUserExt.getUserId());
|
||||
rlDividendDetail.setOrderNo(originalOrder.getOrderNo());
|
||||
rlDividendDetail.setTotalAmount(originalOrder.getPayFee());
|
||||
rlDividendDetail.setDividendProportion(rlUserExt.getDividendProportion());
|
||||
rlDividendDetail.setCreateTime(DateUtils.getNowDate());
|
||||
rlDividendDetail.setPartnerName(rlUser.getUserName());
|
||||
rlDividendDetail.setPartnerPhone(rlUser.getPhonenumber());
|
||||
|
@ -172,7 +172,7 @@ public class RlDividendDetailServiceImpl implements IRlDividendDetailService
|
|||
|
||||
/**
|
||||
* 计算分账金额
|
||||
* @param rlDividendDetails
|
||||
* @param rlDividendDetails 分账明细
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
|
@ -184,6 +184,9 @@ public class RlDividendDetailServiceImpl implements IRlDividendDetailService
|
|||
if(ObjectUtil.isNull(rlUserExt)){
|
||||
throw new ServiceException("用户【"+dividendDetail.getPartnerName()+"】不存在");
|
||||
}
|
||||
if(rlUserExt.getDividendProportion().compareTo(BigDecimal.ZERO)==0 || ObjectUtil.isNull(rlUserExt.getDividendProportion())){
|
||||
throw new ServiceException("用户【"+dividendDetail.getPartnerName()+"】分账比例不能为空");
|
||||
}
|
||||
// 保留两位小数点
|
||||
BigDecimal dividendAmount = rlUserExt.getDividendProportion().multiply(totalDividendAmount)
|
||||
.setScale(2, RoundingMode.HALF_UP);
|
||||
|
|
|
@ -109,4 +109,15 @@ public class RlOperatingAreaServiceImpl implements IRlOperatingAreaService
|
|||
{
|
||||
return rlOperatingAreaMapper.deleteRlOperatingAreaByAreaId(areaId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据代理商id查询运营区id
|
||||
*
|
||||
* @param agentId 代理商id
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Long selectAreaIdByAgentId(Long agentId) {
|
||||
return rlOperatingAreaMapper.selectAreaIdByAgentId(agentId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,19 +2,24 @@ package com.ruoyi.system.service.impl;
|
|||
|
||||
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.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.constant.HttpStatus;
|
||||
import com.ruoyi.common.constant.ServiceConstants;
|
||||
import com.ruoyi.common.core.domain.entity.RlUser;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.*;
|
||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||
import com.ruoyi.common.utils.http.HttpUtils;
|
||||
import com.ruoyi.common.utils.map.GeoUtils;
|
||||
import com.ruoyi.common.utils.uuid.IdUtils;
|
||||
import com.ruoyi.common.utils.wx.vo.PrepayResponseVO;
|
||||
import com.ruoyi.system.domain.RlFunction;
|
||||
import com.ruoyi.system.domain.RlMsgLog;
|
||||
import com.ruoyi.system.domain.accessory.RlAccessoryVO;
|
||||
import com.ruoyi.system.domain.agent.RlAgent;
|
||||
import com.ruoyi.system.domain.agent.RlAgentVO;
|
||||
|
@ -43,6 +48,7 @@ import org.jetbrains.annotations.NotNull;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
@ -54,6 +60,8 @@ import java.time.LocalDate;
|
|||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 订单Service业务层处理
|
||||
|
@ -127,6 +135,24 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
@Autowired
|
||||
private IRlDeliveryOrderService deliveryOrderService;
|
||||
|
||||
@Autowired
|
||||
private ScheduledExecutorService scheduledExecutorService;
|
||||
|
||||
@Autowired
|
||||
private IRlMsgLogService msgLogService;
|
||||
|
||||
@Value("${aliyun.accessKeyId}")
|
||||
private String accessKeyId;
|
||||
|
||||
@Value("${aliyun.accessKeySecret}")
|
||||
private String accessKeySecret;
|
||||
|
||||
@Value("${aliyun.signName}")
|
||||
private String signName;
|
||||
|
||||
@Value("${aliyun.templateCode3}")
|
||||
private String templateCode3;
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
|
@ -388,6 +414,9 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
order.setAutoCancelTime(DateUtils.getTimeAfterXMinutes(order.getCreateTime(),Integer.parseInt(configByKey)));
|
||||
|
||||
StoreVo storeVo = storeService.selectSmStoreById(order.getStoreId());
|
||||
if(ObjectUtil.isNull(storeVo)){
|
||||
throw new ServiceException("【下单】根据storeId【"+order.getStoreId()+"】门店不存在");
|
||||
}
|
||||
if(ObjectUtil.isNotNull(storeVo)){
|
||||
order.setMerchantId(storeVo.getMerchantId());
|
||||
order.setReturnAddress(storeVo.getAddress());
|
||||
|
@ -406,31 +435,103 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
if(ObjectUtil.isNull(rlAgentVO)){
|
||||
throw new ServiceException("根据agentId【"+order.getAgentId()+"】代理商不存在");
|
||||
}
|
||||
if(ObjectUtil.isNull(rlAgentVO.getServiceFeeProportion())){
|
||||
throw new ServiceException("代理商【"+rlAgentVO.getName()+"】的平台服务费未配置");
|
||||
}
|
||||
BigDecimal serviceFee = rlAgentVO.getServiceFeeProportion()
|
||||
.multiply(order.getPayFee())
|
||||
.setScale(2, RoundingMode.HALF_UP);// 服务费 = 48 * 0.05 = 2.4
|
||||
order.setPlatformServiceFee(serviceFee);
|
||||
logger.info("计算出平台服务费:{}",serviceFee);
|
||||
/** 记录分成比例,状态为未出账 */
|
||||
int i1 = dividendDetailService.calculationDividend(order,ServiceConstants.USER_TYPE_MERCHANT);
|
||||
if (i1 < 1) {
|
||||
throw new RuntimeException("记录商户分成失败");
|
||||
}
|
||||
int i2 = dividendDetailService.calculationDividend(order,ServiceConstants.USER_TYPE_AGENT);
|
||||
if (i2 < 1) {
|
||||
throw new RuntimeException("记录代理商分成失败");
|
||||
}
|
||||
int i = orderMapper.insertRlOrder(order);
|
||||
if (i < 1) {
|
||||
throw new RuntimeException("下单失败");
|
||||
}
|
||||
PrepayWithRequestPaymentResponse response = wxPayService.prepayWithRequestPayment(order);
|
||||
|
||||
PrepayResponseVO responseVO = new PrepayResponseVO();
|
||||
responseVO.setResponse(response);
|
||||
responseVO.setOrderNo(orderNo);
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
logger.info("=================【下单】==================");
|
||||
/** 商户分成 */
|
||||
int i1 = dividendDetailService.calculationDividend(order,ServiceConstants.USER_TYPE_MERCHANT);
|
||||
if (i1 < 1) {
|
||||
throw new RuntimeException("记录商户分成失败");
|
||||
}
|
||||
/** 代理商分成 */
|
||||
int i2 = dividendDetailService.calculationDividend(order,ServiceConstants.USER_TYPE_AGENT);
|
||||
if (i2 < 1) {
|
||||
throw new RuntimeException("记录代理商分成失败");
|
||||
}
|
||||
/** 保存订单*/
|
||||
int i = orderMapper.insertRlOrder(order);
|
||||
if (i < 1) {
|
||||
throw new RuntimeException("下单失败");
|
||||
}
|
||||
/** 支付参数 */
|
||||
PrepayWithRequestPaymentResponse response = wxPayService.prepayWithRequestPayment(order);
|
||||
responseVO.setResponse(response);
|
||||
responseVO.setOrderNo(orderNo);
|
||||
|
||||
/** 发短信给代理商*/
|
||||
YPMsgUtils.sendPlaceOrderMsg(orderNo,rlAgentVO.getPhone(),order.getPhone());
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
if(!execute)throw new ServiceException("【下单】失败");
|
||||
return responseVO;
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// sendPlaceOrderMsg(IdUtils.getOrderNo("zl"),"18650502300","18650502300");
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
|
||||
/** 发送通知给代理商 */
|
||||
private void sendCreateOrderMsg(String phone, RlOrderQuery order) {
|
||||
scheduledExecutorService.schedule(() -> {
|
||||
/** 提现申请发送一个短信给审核人*/
|
||||
/**
|
||||
* 单条短信发送,智能匹配短信模板
|
||||
*
|
||||
* @param apikey成功注册后登录云片官网,进入后台可查看
|
||||
* @param text需要使用已审核通过的模板或者默认模板
|
||||
* @param mobile接收的手机号,仅支持单号码发送
|
||||
* @return json格式字符串
|
||||
*/
|
||||
|
||||
// public static String singleSend(String apikey, String text, String mobile) {
|
||||
|
||||
// return post("https://sms.yunpian.com/v2/sms/single_send.json", params);
|
||||
// }
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// jsonObject.put("name", order.getOrderNo());
|
||||
//
|
||||
// SendSmsVo sendSmsVo = new SendSmsVo();
|
||||
// sendSmsVo.setMobile(phone);
|
||||
// sendSmsVo.setTemplateCode(templateCode3);
|
||||
// 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));
|
||||
|
||||
// 短信日志
|
||||
RlMsgLog etMsgLog = new RlMsgLog();
|
||||
etMsgLog.setPhone(phone);
|
||||
etMsgLog.setContent("用户【"+phone+"】,发起押金提现申请,请尽快审核!");
|
||||
etMsgLog.setType("2");
|
||||
etMsgLog.setSignName(signName);
|
||||
etMsgLog.setTemplateCode(templateCode3);
|
||||
int i = msgLogService.insertEtMsgLog(etMsgLog);
|
||||
if(i>0){
|
||||
logger.info("【下单】短信日志记录成功");
|
||||
}else{
|
||||
logger.info("【下单】短信日志记录失败");
|
||||
}
|
||||
}, 0 , TimeUnit.HOURS);
|
||||
}
|
||||
|
||||
private void onceMoreCalculatePrice(RlOrderQuery order) {
|
||||
PriceVO priceVO = calculatePrice(order);
|
||||
order.setDeposit(priceVO.getDeposit());
|
||||
|
@ -566,27 +667,32 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
if(Integer.parseInt(order.getStatus()) >= Integer.parseInt(ServiceConstants.ORDER_STATUS_IN_DELIVERY)){
|
||||
throw new RuntimeException("订单已配送或已使用,不能取消");
|
||||
}
|
||||
if(ServiceConstants.ORDER_PAY_STATUS_PAID.equals(order.getPaid())){
|
||||
// 如果订单已支付则发起退款
|
||||
RlOrderQuery rlOrderQuery = new RlOrderQuery();
|
||||
BeanUtils.copyBeanProp(rlOrderQuery,order);
|
||||
int refund = refund(rlOrderQuery);
|
||||
if(refund <= 0){
|
||||
throw new RuntimeException("【订单取消】退款失败");
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
logger.info("=================【订单取消】==================");
|
||||
if(ServiceConstants.ORDER_PAY_STATUS_PAID.equals(order.getPaid())){
|
||||
// 如果订单已支付则发起退款
|
||||
RlOrderQuery rlOrderQuery = new RlOrderQuery();
|
||||
BeanUtils.copyBeanProp(rlOrderQuery,order);
|
||||
int refund = refund(rlOrderQuery);
|
||||
if(refund <= 0){
|
||||
throw new RuntimeException("【订单取消】退款失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
RlOrder rlOrder = new RlOrder();
|
||||
rlOrder.setOrderNo(orderNo);
|
||||
rlOrder.setStatus(ServiceConstants.ORDER_STATUS_CANCE);
|
||||
int i = orderMapper.updateRlOrderByOrderNo(rlOrder);
|
||||
if(i>0){
|
||||
/** 记录订单履历 */
|
||||
if(!orderOperService.recordOrderHistory(orderNo,ServiceConstants.ORDER_OPERATION_USER_CANCEL,
|
||||
order.getStatus(),rlOrder.getStatus(),order.getPayFee(),order.getPayFee(),order.getUserId(),order.getPhone(),"取消订单")){
|
||||
throw new ServiceException("【订单履历-支付】更新订单信息失败");
|
||||
RlOrder rlOrder = new RlOrder();
|
||||
rlOrder.setOrderNo(orderNo);
|
||||
rlOrder.setStatus(ServiceConstants.ORDER_STATUS_CANCE);
|
||||
int i = orderMapper.updateRlOrderByOrderNo(rlOrder);
|
||||
if(i>0){
|
||||
/** 记录订单履历 */
|
||||
if(!orderOperService.recordOrderHistory(orderNo,ServiceConstants.ORDER_OPERATION_USER_CANCEL,
|
||||
order.getStatus(),rlOrder.getStatus(),order.getPayFee(),order.getPayFee(),order.getUserId(),order.getPhone(),"取消订单")){
|
||||
throw new ServiceException("【订单履历-取消订单】更新订单信息失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
if(!execute)throw new ServiceException("订单取消失败");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -638,17 +744,31 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
order.getStatus(),order.getStatus(),order.getPayFee(),order.getPayFee(),order.getUserId(),order.getPhone(),"已退款:-"+remainingDeposit+"元")){
|
||||
throw new ServiceException("【记录订单履历失败】");
|
||||
}
|
||||
if(remainingDeposit.compareTo(BigDecimal.ZERO) > 0){
|
||||
/** 4.执行退还剩余押金操作*/
|
||||
/** 5.新增一条退款记录*/
|
||||
String outRefundNo = saveDepositRefundObj(order, remainingDeposit);
|
||||
logger.info("【商家还车】退还剩余押金:"+remainingDeposit);
|
||||
wxPayService.refund(order, "审核后退押金",remainingDeposit,outRefundNo);
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
if(!execute)throw new ServiceException("商家还车失败");
|
||||
if(remainingDeposit.compareTo(BigDecimal.ZERO) > 0){
|
||||
/** 4.执行退还剩余押金操作*/
|
||||
logger.info("【商家还车】退还剩余押金:"+remainingDeposit);
|
||||
wxPayService.refund(order, "审核后退押金",remainingDeposit,order.getOutTradeNo());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String saveDepositRefundObj(RlOrderVO rlOrderVO, BigDecimal refundAmount) {
|
||||
String outRefundNo = IdUtils.getOrderNo("ref");
|
||||
RlRefund refund1= createRefund("押金退款", rlOrderVO.getUserId(), rlOrderVO.getOrderNo(), refundAmount, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, outRefundNo,ServiceConstants.REFUND_TYPE_DEPOSIT);
|
||||
int refundResult = refundService.insertEtRefund(refund1);
|
||||
if(refundResult>0){
|
||||
logger.info("保存退款对象成功");
|
||||
}
|
||||
logger.info("总押金:【{}】,退款金额:【{}】", rlOrderVO.getDeposit(), refundAmount);
|
||||
return outRefundNo;
|
||||
}
|
||||
|
||||
private void updateOrderStatus(String orderNo) {
|
||||
RlOrder updateOrder = new RlOrder();
|
||||
updateOrder.setOrderNo(orderNo);
|
||||
|
@ -704,10 +824,14 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
if(ObjectUtil.isNotNull(leaseFee) && !leaseFee.equals(BigDecimal.ZERO)){
|
||||
refundAmount = refundAmount.add(leaseFee);
|
||||
}
|
||||
BigDecimal deposit = etOrder.getDeposit();
|
||||
if(ObjectUtil.isNotNull(deposit) && !deposit.equals(BigDecimal.ZERO)){
|
||||
refundAmount = refundAmount.add(deposit);
|
||||
}
|
||||
if(refundAmount.compareTo(BigDecimal.ZERO) == 0){
|
||||
throw new ServiceException("总退款金额不能为0");
|
||||
}
|
||||
BigDecimal refundPercentage = refundAmount.divide(rlOrderVO.getPayFee()).setScale(2, RoundingMode.HALF_UP);
|
||||
BigDecimal refundPercentage = refundAmount.divide(rlOrderVO.getPayFee(), 2, RoundingMode.HALF_UP);
|
||||
BigDecimal finalRefundAmount = refundAmount;
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
/** 3. 根据分成列表,遍历用户,新增账变 */
|
||||
|
@ -716,7 +840,7 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
String outRefundNo = saveRefundObj(rlOrderVO, finalRefundAmount, dispatchFee, deliveryFee, leaseFee);
|
||||
if(!orderOperService.recordOrderHistory(rlOrderVO.getOrderNo(),ServiceConstants.ORDER_OPERATION_REFUND,
|
||||
rlOrderVO.getStatus(),rlOrderVO.getStatus(),rlOrderVO.getPayFee(),rlOrderVO.getPayFee(),rlOrderVO.getUserId(),rlOrderVO.getPhone(),"已退款: "+finalRefundAmount+"元")){
|
||||
throw new ServiceException("【改价】更新订单信息失败");
|
||||
throw new ServiceException("【退款】更新订单信息失败");
|
||||
}
|
||||
/** 5. 发起退款 */
|
||||
wxPayService.refund(rlOrderVO, "商家退款金额", finalRefundAmount,outRefundNo);
|
||||
|
@ -911,10 +1035,10 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
@NotNull
|
||||
private IndexAdminVo getIndexAdminVoByAgentId(String startTime, String endTime, DateTimeFormatter formatter, Long agentId,Long merchantId) {
|
||||
// 校验输入时间格式并判断时间区间是否超过15天
|
||||
if (StrUtil.isNotBlank(startTime) && StrUtil.isNotBlank(endTime)) {
|
||||
if (StrUtil.isBlank(startTime) && StrUtil.isBlank(endTime)) {
|
||||
// 获取今日订单数量和收入
|
||||
startTime = DateUtils.getYYYY_MM_DD(DateUtils.getNowDate()) + " " + Constants.DATE_FORMAT_START_PEREND;
|
||||
endTime = DateUtils.getYYYY_MM_DD(DateUtils.getNowDate()) + " " + Constants.DATE_FORMAT_END_PEREND;
|
||||
startTime = DateUtils.getYYYY_MM_DD(DateUtils.getNowDate());
|
||||
endTime = DateUtils.getYYYY_MM_DD(DateUtils.getNowDate());
|
||||
}
|
||||
// 使用LocalDate统一日期处理
|
||||
LocalDate startDate = LocalDate.parse(startTime, formatter);
|
||||
|
@ -998,7 +1122,7 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
BigDecimal deliveryFee = BigDecimal.ZERO;
|
||||
RlAgent agent = agentService.selectRlAgentByAgentId(orderQuery.getAgentId());
|
||||
if(agent == null){
|
||||
throw new ServiceException("代理商不存在");
|
||||
throw new ServiceException("代理商不存在:"+orderQuery.getAgentId());
|
||||
}
|
||||
if(orderQuery.getDeliveryMethod().equals(ServiceConstants.DELIVERY_METHOD_CHARGE_DELIVERY_CAR)){
|
||||
deliveryFee = agent.getDeliveryFee();
|
||||
|
|
|
@ -233,7 +233,10 @@ public class RlUserServiceImpl implements IRlUserService{
|
|||
/** 可提现金额 等于余额-今日订单金额 */
|
||||
BigDecimal balance = users.getBalance();
|
||||
BigDecimal todayOrderAmount = rlUserMapper.selectTodayOrderAmount(userId);
|
||||
users.setWithdrawableAmount(balance.subtract(todayOrderAmount));
|
||||
BigDecimal withdrawableAmount = balance.subtract(todayOrderAmount);
|
||||
if(withdrawableAmount.compareTo(BigDecimal.ZERO) >0){
|
||||
users.setWithdrawableAmount(withdrawableAmount);
|
||||
}
|
||||
return users;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,12 +2,14 @@ package com.ruoyi.system.task;
|
|||
|
||||
import com.ruoyi.common.constant.ServiceConstants;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.YPMsgUtils;
|
||||
import com.ruoyi.system.domain.order.RlOrder;
|
||||
import com.ruoyi.system.domain.order.RlOrderQuery;
|
||||
import com.ruoyi.system.domain.order.RlOrderVO;
|
||||
import com.ruoyi.system.service.IRlOrderOperService;
|
||||
import com.ruoyi.system.service.IRlOrderService;
|
||||
import com.ruoyi.system.service.IWxPayService;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -28,15 +30,15 @@ import java.util.List;
|
|||
public class RlTask {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IWxPayService wxPayService;
|
||||
|
||||
@Resource
|
||||
private IRlOrderService orderService;
|
||||
|
||||
@Autowired
|
||||
private IRlOrderOperService orderOperService;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -52,7 +54,7 @@ public class RlTask {
|
|||
|
||||
/**
|
||||
* 到过期时间后改变订单状态
|
||||
* 处理过期订单
|
||||
* 处理超时未支付订单
|
||||
*/
|
||||
public void handleExpiredOrder(){
|
||||
log.info("-------------------【定时任务】处理过期订单---开始----------------");
|
||||
|
@ -87,12 +89,36 @@ public class RlTask {
|
|||
rlOrderQuery.setStatus(ServiceConstants.ORDER_STATUS_IN_USE);
|
||||
List<RlOrderVO> rlOrderVOS = orderService.selectAllRlOrderList(rlOrderQuery);
|
||||
for (RlOrderVO orderVO:rlOrderVOS) {
|
||||
// 判断订单是否已过期,如果过期了,则标记为已过期
|
||||
if (orderVO.getExpiryTime().before(new Date())) {
|
||||
RlOrder rlOrder = new RlOrder();
|
||||
rlOrder.setOrderId(orderVO.getOrderId());
|
||||
rlOrder.setIsOverdue(true);
|
||||
orderService.updateRlOrder(rlOrder);
|
||||
if(!orderVO.getIsOverdue()){
|
||||
// 判断订单是否已过期,如果过期了,则标记为已过期
|
||||
if (orderVO.getExpiryTime().before(new Date())) {
|
||||
RlOrder rlOrder = new RlOrder();
|
||||
rlOrder.setOrderId(orderVO.getOrderId());
|
||||
rlOrder.setIsOverdue(true);
|
||||
orderService.updateRlOrder(rlOrder);
|
||||
}else {
|
||||
// 设定提前提醒的分钟数
|
||||
String s = configService.selectConfigByKey("rl.reminder.minutes");
|
||||
if(s==null|| s.equals("")){
|
||||
throw new ServiceException("【获取配置信息】rl.reminder.minutes未配置");
|
||||
}
|
||||
int reminderMinutes = Integer.parseInt(s); // 例如,提前10分钟提醒
|
||||
// 计算距离过期时间还有多少分钟
|
||||
long diffInMillis = orderVO.getExpiryTime().getTime() - new Date().getTime();
|
||||
long diffInMinutes = diffInMillis / (60 * 1000); // 毫秒转分钟
|
||||
|
||||
if (diffInMinutes <= reminderMinutes && !orderVO.getIsSendMsg()) {
|
||||
log.info("【定时任务】订单【{}】即将过期,距离过期还有{}分钟", orderVO.getOrderNo(), diffInMinutes);
|
||||
YPMsgUtils.expirationReminderMsg(orderVO.getOrderNo(),orderVO.getPhone(),DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderVO.getExpiryTime()));
|
||||
RlOrder rlOrder = new RlOrder();
|
||||
rlOrder.setOrderId(orderVO.getOrderId());
|
||||
rlOrder.setIsSendMsg(true);
|
||||
int i = orderService.updateRlOrder(rlOrder);
|
||||
if(i>0){
|
||||
log.info("【定时任务】订单【{}】标记已发送短信", orderVO.getOrderNo());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("-------------------【定时任务】超时标记---结束----------------");
|
||||
|
|
|
@ -8,12 +8,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<sql id="selectRlAgentVo">
|
||||
select a.agent_id, a.name, a.service_phone, a.dispatch_fee, a.delivery_fee, a.city_id, a.contact,
|
||||
a.phone, a.userid, a.pay_channel, a.is_free_car,c.name,a.service_fee_proportion cityName
|
||||
a.phone, a.userid, a.pay_channel, a.is_free_car,c.name,a.service_fee_proportion, a.dividend_proportion, c.name cityName
|
||||
from rl_agent a
|
||||
left join rl_city c on c.city_id = a.city_id
|
||||
</sql>
|
||||
|
||||
<select id="selectRlAgentList" parameterType="RlAgent" resultMap="RlAgentResult">
|
||||
<select id="selectRlAgentList" parameterType="RlAgentQuery" resultMap="RlAgentResult">
|
||||
<include refid="selectRlAgentVo"/>
|
||||
where 1=1
|
||||
<if test="name != null and name != ''"> and a.name like concat('%', #{name}, '%')</if>
|
||||
|
@ -21,8 +21,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="dispatchFee != null "> and a.dispatch_fee = #{dispatchFee}</if>
|
||||
<if test="deliveryFee != null "> and a.delivery_fee = #{deliveryFee}</if>
|
||||
<if test="cityId != null "> and a.city_id = #{cityId}</if>
|
||||
<if test="cityName != null "> and c.name = #{cityName}</if>
|
||||
<if test="contact != null and contact != ''"> and a.contact = #{contact}</if>
|
||||
<if test="phone != null and phone != ''"> and a.phone = #{phone}</if>
|
||||
<if test="phone != null and phone != ''"> and a.phone like concat('%', #{phone}, '%')</if>
|
||||
<if test="userid != null "> and a.userid = #{userid}</if>
|
||||
${params.dataScope}
|
||||
order by a.agent_id desc
|
||||
|
@ -57,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="payChannel != null">pay_channel,</if>
|
||||
<if test="isFreeCar != null">is_free_car,</if>
|
||||
<if test="serviceFeeProportion != null">service_fee_proportion,</if>
|
||||
<if test="dividendProportion != null">dividend_proportion,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
|
@ -70,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="payChannel != null">#{payChannel},</if>
|
||||
<if test="isFreeCar != null">#{isFreeCar},</if>
|
||||
<if test="serviceFeeProportion != null">#{serviceFeeProportion},</if>
|
||||
<if test="dividendProportion != null">#{dividendProportion},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -87,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="payChannel != null">pay_channel = #{payChannel},</if>
|
||||
<if test="isFreeCar != null">is_free_car = #{isFreeCar},</if>
|
||||
<if test="serviceFeeProportion != null">service_fee_proportion = #{serviceFeeProportion},</if>
|
||||
<if test="dividendProportion != null">dividend_proportion = #{dividendProportion},</if>
|
||||
</trim>
|
||||
where agent_id = #{agentId}
|
||||
</update>
|
||||
|
|
|
@ -14,7 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join rl_order o on o.order_no = do.order_no
|
||||
left join rl_store s on s.store_id = do.store_id
|
||||
left join rl_agent a on a.agent_id = do.agent_id
|
||||
left join rl_user u on u.user_id = o.merchant_id
|
||||
left join rl_user u on u.user_id = do.deliveryman_id
|
||||
</sql>
|
||||
|
||||
<select id="selectRlDeliveryOrderList" parameterType="RlDeliveryOrderVO" resultMap="RlDeliveryOrderResult">
|
||||
|
|
|
@ -4,10 +4,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.RlDeliveryOrderOperMapper">
|
||||
|
||||
<resultMap type="RlDeliveryOrderOper" id="RlDeliveryOrderOperResult" autoMapping="true" />
|
||||
<resultMap type="RlDeliveryOrderOperVO" id="RlDeliveryOrderOperResult" autoMapping="true" />
|
||||
|
||||
<sql id="selectRlDeliveryOrderOperVo">
|
||||
select doo.oper_id, doo.delivery_id, doo.type, doo.oper_userid, doo.oper_phone, doo.oper_name, doo.oper_time from rl_delivery_order_oper doo
|
||||
select doo.oper_id, doo.delivery_id, doo.type, doo.oper_userid, doo.oper_phone, doo.oper_name, doo.oper_time, do.order_no, a.name as agentName, u.user_name
|
||||
from rl_delivery_order_oper doo
|
||||
left join rl_delivery_order do on do.delivery_id = doo.delivery_id
|
||||
left join rl_order o on o.order_no = do.order_no
|
||||
left join rl_agent a on a.agent_id = do.agent_id
|
||||
|
@ -33,6 +34,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where oper_id = #{operId}
|
||||
</select>
|
||||
|
||||
<select id="selectRlDeliveryOrderOperListByOrderId"
|
||||
resultMap="RlDeliveryOrderOperResult">
|
||||
select doo.oper_id, doo.delivery_id, doo.type, doo.oper_userid, doo.oper_phone, doo.oper_name, doo.oper_time, do.order_no, a.name as agentName, u.user_name
|
||||
from rl_delivery_order_oper doo
|
||||
left join rl_delivery_order do on do.delivery_id = doo.delivery_id
|
||||
left join rl_order o on o.order_no = do.order_no
|
||||
left join rl_agent a on a.agent_id = do.agent_id
|
||||
left join rl_user u on u.user_id = o.merchant_id
|
||||
where do.delivery_id = #{deliveryId}
|
||||
</select>
|
||||
|
||||
<insert id="insertRlDeliveryOrderOper" parameterType="RlDeliveryOrderOper" useGeneratedKeys="true" keyProperty="operId">
|
||||
insert into rl_delivery_order_oper
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
@ -9,7 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<sql id="selectDeviceVo">
|
||||
select device_id, picture, device_name, mac, sn, model_id, hardware_version_id, vehicle_num, activation_time,
|
||||
online_status, create_by, create_time, update_by, update_time, last_time, last_location_time, gps, remark,
|
||||
status, lock_status, location, remaining_power, voltage, qrcode, longitude, latitude, store_id from rl_device
|
||||
status, lock_status, location, remaining_power, voltage, qrcode, longitude, latitude, store_id,is_admin_unlocking,
|
||||
agent_id, merchant_id, area_id from rl_device
|
||||
</sql>
|
||||
|
||||
<select id="selectDeviceList" parameterType="RlDeviceQuery" resultMap="DeviceResult">
|
||||
|
@ -50,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
de.activation_time, de.online_status, de.create_by, de.create_time, de.update_by,m.model,
|
||||
de.update_time, de.last_time, de.last_location_time, de.gps, de.remark, de.status, de.lock_status, de.location,
|
||||
de.remaining_power, de.voltage, de.version, de.qrcode, de.longitude, de.latitude, de.signal_strength, de.satellites, de.quality,
|
||||
de.is_admin_unlocking, de.store_id from rl_device de
|
||||
de.is_admin_unlocking, de.store_id, de.agent_id, de.merchant_id, de.area_id from rl_device de
|
||||
left join rl_hardware_version hv on hv.id = de.hardware_version_id
|
||||
left join rl_model m on m.model_id = de.model_id
|
||||
left join rl_user u on u.user_id = de.merchant_id
|
||||
|
@ -156,6 +157,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="longitude != null">longitude,</if>
|
||||
<if test="latitude != null">latitude,</if>
|
||||
<if test="storeId != null">store_id,</if>
|
||||
<if test="agentId != null">agent_id,</if>
|
||||
<if test="merchantId != null">merchant_id,</if>
|
||||
<if test="areaId != null">area_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="picture != null">#{picture},</if>
|
||||
|
@ -185,6 +189,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="longitude != null">#{longitude},</if>
|
||||
<if test="latitude != null">#{latitude},</if>
|
||||
<if test="storeId != null">#{storeId},</if>
|
||||
<if test="agentId != null">#{agentId},</if>
|
||||
<if test="merchantId != null">#{merchantId},</if>
|
||||
<if test="areaId != null">#{areaId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -218,6 +225,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="longitude != null">longitude = #{longitude},</if>
|
||||
<if test="latitude != null">latitude = #{latitude},</if>
|
||||
<if test="storeId != null">store_id = #{storeId},</if>
|
||||
<if test="agentId != null">agent_id = #{agentId},</if>
|
||||
<if test="merchantId != null">merchant_id = #{merchantId}</if>
|
||||
<if test="areaId != null">area_id = #{areaId},</if>
|
||||
</trim>
|
||||
where device_id = #{deviceId}
|
||||
</update>
|
||||
|
@ -252,6 +262,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="longitude != null">longitude = #{longitude},</if>
|
||||
<if test="latitude != null">latitude = #{latitude},</if>
|
||||
store_id = #{storeId},
|
||||
<if test="agentId != null">agent_id = #{agentId},</if>
|
||||
<if test="merchantId != null">merchant_id = #{merchantId}</if>
|
||||
<if test="areaId != null">area_id = #{areaId},</if>
|
||||
</trim>
|
||||
where device_id = #{deviceId}
|
||||
</update>
|
||||
|
@ -285,6 +298,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="longitude != null">longitude = #{longitude},</if>
|
||||
<if test="latitude != null">latitude = #{latitude},</if>
|
||||
<if test="storeId != null">store_id = #{storeId},</if>
|
||||
<if test="agentId != null">agent_id = #{agentId},</if>
|
||||
<if test="merchantId != null">merchant_id = #{merchantId}</if>
|
||||
<if test="areaId != null">area_id = #{areaId},</if>
|
||||
</trim>
|
||||
where sn = #{sn}
|
||||
</update>
|
||||
|
|
|
@ -69,8 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN rl_fee_rule fr2 ON fr2.rule_id = mr2.rule_id
|
||||
WHERE mr2.model_id = m.model_id )
|
||||
GROUP BY
|
||||
m.model_id;
|
||||
|
||||
m.model_id
|
||||
</select>
|
||||
|
||||
<select id="getModelListByMerchantId" resultType="com.ruoyi.system.domain.model.RlModelVO">
|
||||
|
|
|
@ -7,7 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<resultMap type="RlOperatingAreaVO" id="RlOperatingAreaResult" autoMapping="true" />
|
||||
|
||||
<sql id="selectRlOperatingAreaVo">
|
||||
select oa.area_id, oa.area_name, oa.boundary, oa.boundary_str, oa.longitude, oa.latitude, oa.create_by, oa.create_time, oa.status, oa.area_time, oa.area_out_outage,
|
||||
select oa.area_id, oa.area_name, oa.boundary_str, oa.longitude, oa.latitude, oa.create_by, oa.create_time, oa.status, oa.area_time, oa.area_out_outage,
|
||||
oa.area_out_dispatch, oa.agreement, oa.area_time_start, oa.area_time_end from rl_operating_area oa
|
||||
left join rl_agent a on oa.agent_id = a.agent_id
|
||||
</sql>
|
||||
|
@ -16,7 +16,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectRlOperatingAreaVo"/>
|
||||
where 1=1
|
||||
<if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
|
||||
<if test="boundary != null and boundary != ''"> and boundary = #{boundary}</if>
|
||||
<if test="boundaryStr != null and boundaryStr != ''"> and boundary_str = #{boundaryStr}</if>
|
||||
<if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
|
||||
<if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
|
||||
|
@ -41,11 +40,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where oa.agent_id = #{agentId}
|
||||
</select>
|
||||
|
||||
<select id="selectAreaIdByAgentId" resultType="java.lang.Long">
|
||||
select area_id from rl_operating_area where agent_id = #{agentId}
|
||||
</select>
|
||||
|
||||
<insert id="insertRlOperatingArea" parameterType="RlOperatingArea" useGeneratedKeys="true" keyProperty="areaId">
|
||||
insert into rl_operating_area
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="areaName != null">area_name,</if>
|
||||
<if test="boundary != null">boundary,</if>
|
||||
<if test="boundaryStr != null">boundary_str,</if>
|
||||
<if test="longitude != null">longitude,</if>
|
||||
<if test="latitude != null">latitude,</if>
|
||||
|
@ -61,7 +63,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="areaName != null">#{areaName},</if>
|
||||
<if test="boundary != null">#{boundary},</if>
|
||||
<if test="boundaryStr != null">#{boundaryStr},</if>
|
||||
<if test="longitude != null">#{longitude},</if>
|
||||
<if test="latitude != null">#{latitude},</if>
|
||||
|
@ -81,7 +82,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update rl_operating_area
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="areaName != null">area_name = #{areaName},</if>
|
||||
<if test="boundary != null">boundary = #{boundary},</if>
|
||||
<if test="boundaryStr != null">boundary_str = #{boundaryStr},</if>
|
||||
<if test="longitude != null">longitude = #{longitude},</if>
|
||||
<if test="latitude != null">latitude = #{latitude},</if>
|
||||
|
|
|
@ -11,7 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
lease_fee, mark, duration, status, create_time, return_time, deposit_deduction, deposit_order_no, deduction_amount, used_sn, change_reason,
|
||||
auto_refund_deposit, rental_unit, handling_charge, platform_service_fee, operator_dividend, pay_channel, delivery_method, pickup_time,
|
||||
agent_id, store_id, store_name, merchant_id, pickup_city, pickup_loc, pickup_lon, pickup_lat, model_id, model, expiry_time, original_order_no, num, price, `explain`,
|
||||
instructions, out_unit, out_price,return_type,return_method,return_address,auto_cancel_time,cost, is_overdue from rl_order
|
||||
instructions, out_unit, out_price,return_type,return_method,return_address,auto_cancel_time,cost, is_overdue,is_send_msg from rl_order
|
||||
</sql>
|
||||
|
||||
<sql id="selectRlOrderDetail">
|
||||
|
@ -86,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
o.merchant_id,
|
||||
o.cost,
|
||||
o.is_overdue,
|
||||
o.is_send_msg,
|
||||
CONCAT(
|
||||
CASE
|
||||
WHEN r.rental_unit = 'hours' THEN '时租'
|
||||
|
@ -444,6 +445,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="autoCancelTime != null">auto_cancel_time = #{autoCancelTime},</if>
|
||||
<if test="isOverdue != null">is_overdue = #{isOverdue},</if>
|
||||
<if test="cost != null">cost = #{cost},</if>
|
||||
<if test="isSendMsg != null">is_send_msg = #{isSendMsg},</if>
|
||||
</trim>
|
||||
where order_id = #{orderId}
|
||||
</update>
|
||||
|
@ -515,6 +517,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="autoCancelTime != null">auto_cancel_time = #{autoCancelTime},</if>
|
||||
<if test="isOverdue != null">is_overdue = #{isOverdue},</if>
|
||||
<if test="cost != null">cost = #{cost},</if>
|
||||
<if test="isSendmsg != null">is_send_msg = #{isSendmsg},</if>
|
||||
</trim>
|
||||
where order_no = #{orderNo}
|
||||
</update>
|
||||
|
|
|
@ -222,7 +222,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE
|
||||
DATE(create_time) = CURDATE()
|
||||
AND owner_id = #{ownerId}
|
||||
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="RlUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
|
|
Loading…
Reference in New Issue
Block a user