联调
This commit is contained in:
parent
b46a7b875e
commit
79ed366be9
|
@ -252,6 +252,9 @@ public class AppVerifyController extends BaseController
|
|||
public AjaxResult deviceUnlock(String sn,String orderNo,String isBluetooth,String lon,String lat)
|
||||
{
|
||||
logger.info("【临时解锁请求参数】:{},订单号:{},是否蓝牙控制:{}", sn,orderNo,isBluetooth);
|
||||
if(StrUtil.isBlank(orderNo)){
|
||||
throw new ServiceException("订单号为空");
|
||||
}
|
||||
Boolean i =deviceService.unlock(sn,orderNo,isBluetooth,lon,lat);
|
||||
return success(i);
|
||||
}
|
||||
|
@ -585,8 +588,8 @@ public class AppVerifyController extends BaseController
|
|||
if(StrUtil.isBlank(sn)){
|
||||
throw new ServiceException("【根据sn查询正在进行中的订单】sn不能为空");
|
||||
}
|
||||
List<RlOrderVO> orders = orderService.getInProgressOrder(sn);
|
||||
return success(orders);
|
||||
RlOrderVO order = orderService.getInProgressOrder(sn);
|
||||
return success(order);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.web.controller.appAgent;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.constant.ServiceConstants;
|
||||
|
@ -124,7 +125,25 @@ public class AppAgentController extends BaseController
|
|||
public AjaxResult add(@RequestBody RlModelQuery model)
|
||||
{
|
||||
authorityVerify();
|
||||
return toAjax(modelService.insertEModel(model));
|
||||
addVerify(model);
|
||||
if(model.getModelId() == null){
|
||||
return toAjax(modelService.insertEModel(model));
|
||||
}else{
|
||||
return toAjax(modelService.updateEModel(model));
|
||||
}
|
||||
}
|
||||
|
||||
private void addVerify(RlModelQuery model) {
|
||||
if(model.getAgentId() == null){
|
||||
RlUserExt rlUserExt = rlUserExtService.selectRlUserExtByUserId(getUserId());
|
||||
model.setAgentId(rlUserExt.getAgentId());
|
||||
}
|
||||
if(StrUtil.isBlank(model.getModel())){
|
||||
throw new ServiceException("车型名称不能为空");
|
||||
}
|
||||
if(model.getDeposit() == null){
|
||||
throw new ServiceException("押金不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -147,7 +166,7 @@ public class AppAgentController extends BaseController
|
|||
{
|
||||
authorityVerify();
|
||||
for (Long modelId:modelIds) {
|
||||
RlModel model = new RlModel();
|
||||
RlModelQuery model = new RlModelQuery();
|
||||
model.setModelId(modelId);
|
||||
model.setDelFlag("2");
|
||||
modelService.updateEModel(model);
|
||||
|
|
|
@ -21,6 +21,7 @@ import com.ruoyi.system.domain.changeBalance.RlChangeBalance;
|
|||
import com.ruoyi.system.domain.changeBalance.RlChangeBalanceQuery;
|
||||
import com.ruoyi.system.domain.channelWithdraw.ChannelWithdrawQuery;
|
||||
import com.ruoyi.system.domain.channelWithdraw.ChannelWithdrawVO;
|
||||
import com.ruoyi.system.domain.deliveryOrder.RlDeliveryOrderQuery;
|
||||
import com.ruoyi.system.domain.deliveryOrder.RlDeliveryOrderVO;
|
||||
import com.ruoyi.system.domain.device.RlDeviceQuery;
|
||||
import com.ruoyi.system.domain.device.RlDeviceVO;
|
||||
|
@ -353,7 +354,7 @@ public class AppAdminController extends BaseController
|
|||
* 查询配送工单列表 送达时间
|
||||
*/
|
||||
@GetMapping("/deliveryOrderList")
|
||||
public AjaxResult list(RlDeliveryOrderVO rlDeliveryOrder)
|
||||
public AjaxResult list(RlDeliveryOrderQuery rlDeliveryOrder)
|
||||
{
|
||||
if(ObjectUtil.isNull(rlDeliveryOrder.getStatusList()) || rlDeliveryOrder.getStatusList().length == 0){
|
||||
rlDeliveryOrder.setStatusList(null);
|
||||
|
|
|
@ -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.RlAgentVO;
|
||||
import com.ruoyi.system.service.IRlAgentService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -36,7 +37,7 @@ public class RlAgentController extends BaseController
|
|||
public TableDataInfo list(RlAgent rlAgent)
|
||||
{
|
||||
startPage();
|
||||
List<RlAgent> list = rlAgentService.selectRlAgentList(rlAgent);
|
||||
List<RlAgentVO> list = rlAgentService.selectRlAgentList(rlAgent);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
@ -48,8 +49,8 @@ public class RlAgentController extends BaseController
|
|||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RlAgent rlAgent)
|
||||
{
|
||||
List<RlAgent> list = rlAgentService.selectRlAgentList(rlAgent);
|
||||
ExcelUtil<RlAgent> util = new ExcelUtil<RlAgent>(RlAgent.class);
|
||||
List<RlAgentVO> list = rlAgentService.selectRlAgentList(rlAgent);
|
||||
ExcelUtil<RlAgentVO> util = new ExcelUtil<RlAgentVO>(RlAgentVO.class);
|
||||
util.exportExcel(response, list, "代理商数据");
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.web.controller.rl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
@ -7,6 +8,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.deliveryOrder.RlDeliveryOrder;
|
||||
import com.ruoyi.system.domain.deliveryOrder.RlDeliveryOrderQuery;
|
||||
import com.ruoyi.system.domain.deliveryOrder.RlDeliveryOrderVO;
|
||||
import com.ruoyi.system.service.IRlDeliveryOrderService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -34,8 +36,11 @@ public class RlDeliveryOrderController extends BaseController
|
|||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:deliveryOrder:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RlDeliveryOrder rlDeliveryOrder)
|
||||
public TableDataInfo list(RlDeliveryOrderQuery rlDeliveryOrder)
|
||||
{
|
||||
if(ObjectUtil.isNull(rlDeliveryOrder.getStatusList()) || rlDeliveryOrder.getStatusList().length == 0){
|
||||
rlDeliveryOrder.setStatusList(null);
|
||||
}
|
||||
startPage();
|
||||
List<RlDeliveryOrderVO> list = rlDeliveryOrderService.selectRlDeliveryOrderList(rlDeliveryOrder);
|
||||
return getDataTable(list);
|
||||
|
|
|
@ -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.dividendDetail.RlDividendDetail;
|
||||
import com.ruoyi.system.domain.dividendDetail.RlDividendDetailVO;
|
||||
import com.ruoyi.system.service.IRlDividendDetailService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
@ -37,7 +38,7 @@ public class RlDividendDetailController extends BaseController
|
|||
public TableDataInfo list(RlDividendDetail rlDividendDetail)
|
||||
{
|
||||
startPage();
|
||||
List<RlDividendDetail> list = rlDividendDetailService.selectRlDividendDetailList(rlDividendDetail);
|
||||
List<RlDividendDetailVO> list = rlDividendDetailService.selectRlDividendDetailList(rlDividendDetail);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
@ -49,8 +50,8 @@ public class RlDividendDetailController extends BaseController
|
|||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RlDividendDetail rlDividendDetail)
|
||||
{
|
||||
List<RlDividendDetail> list = rlDividendDetailService.selectRlDividendDetailList(rlDividendDetail);
|
||||
ExcelUtil<RlDividendDetail> util = new ExcelUtil<RlDividendDetail>(RlDividendDetail.class);
|
||||
List<RlDividendDetailVO> list = rlDividendDetailService.selectRlDividendDetailList(rlDividendDetail);
|
||||
ExcelUtil<RlDividendDetailVO> util = new ExcelUtil<RlDividendDetailVO>(RlDividendDetailVO.class);
|
||||
util.exportExcel(response, list, "分账明细数据");
|
||||
}
|
||||
|
||||
|
|
|
@ -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.model.RlModel;
|
||||
import com.ruoyi.system.domain.model.RlModelQuery;
|
||||
import com.ruoyi.system.service.IRlModelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
@ -69,7 +70,7 @@ public class RlModelController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('system:model:add')")
|
||||
@Log(title = "车辆型号", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RlModel rlModel)
|
||||
public AjaxResult add(@RequestBody RlModelQuery rlModel)
|
||||
{
|
||||
return toAjax(eModelService.insertEModel(rlModel));
|
||||
}
|
||||
|
@ -80,7 +81,7 @@ public class RlModelController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('system:model:edit')")
|
||||
@Log(title = "车辆型号", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RlModel etModel)
|
||||
public AjaxResult edit(@RequestBody RlModelQuery etModel)
|
||||
{
|
||||
return toAjax(eModelService.updateEModel(etModel));
|
||||
}
|
||||
|
|
|
@ -14,4 +14,7 @@ public class RlAgentVO extends RlAgent{
|
|||
private String longitude;
|
||||
|
||||
private String latitude;
|
||||
|
||||
/** 城市名称 */
|
||||
private String cityName;
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
package com.ruoyi.system.domain.deliveryOrder;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DeliveryOrderQuery extends RlDeliveryOrder{
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.ruoyi.system.domain.deliveryOrder;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RlDeliveryOrderQuery extends RlDeliveryOrder{
|
||||
|
||||
/** 状态列表 */
|
||||
private String[] statusList;
|
||||
|
||||
/** 关键字: 手机号或订单号 */
|
||||
private String keywords;
|
||||
}
|
|
@ -1,17 +1,12 @@
|
|||
package com.ruoyi.system.domain.deliveryOrder;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class RlDeliveryOrderVO extends RlDeliveryOrder{
|
||||
/** 状态列表 */
|
||||
private String[] statusList;
|
||||
|
||||
/** 关键字: 手机号或订单号 */
|
||||
private String keywords;
|
||||
|
||||
/** 店铺定位经度 */
|
||||
private BigDecimal lng;
|
||||
|
||||
|
@ -29,4 +24,7 @@ public class RlDeliveryOrderVO extends RlDeliveryOrder{
|
|||
|
||||
/** 车型 */
|
||||
private String model;
|
||||
|
||||
/** 代理商 */
|
||||
private String agentName;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
package com.ruoyi.system.domain.dividendDetail;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RlDividendDetailVO extends RlDividendDetail{
|
||||
|
||||
/** 代理名称 */
|
||||
private String agentName;
|
||||
|
||||
}
|
||||
|
|
|
@ -5,4 +5,7 @@ import lombok.Data;
|
|||
@Data
|
||||
public class RlModelQuery extends RlModel{
|
||||
|
||||
/** 配件列表 */
|
||||
private Long[] accessoryIds;
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.ruoyi.system.domain.order;
|
|||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.system.domain.RlFunction;
|
||||
import com.ruoyi.system.domain.accessory.RlAccessoryVO;
|
||||
import com.ruoyi.system.domain.dividendDetail.RlDividendDetail;
|
||||
import com.ruoyi.system.domain.dividendDetail.RlDividendDetailVO;
|
||||
import com.ruoyi.system.domain.orderOper.RlOrderOper;
|
||||
import com.ruoyi.system.domain.rule.RlFeeRule;
|
||||
import lombok.Data;
|
||||
|
@ -49,7 +49,7 @@ public class RlOrderVO extends RlOrder{
|
|||
private List<RlOrderOper> orderOpers;
|
||||
|
||||
/** 分账明细 */
|
||||
private List<RlDividendDetail> rlDividendDetails;
|
||||
private List<RlDividendDetailVO> rlDividendDetails;
|
||||
|
||||
/** 可退款金额 */
|
||||
private BigDecimal refundableTotalAmount;
|
||||
|
|
|
@ -35,7 +35,7 @@ public interface RlAgentMapper
|
|||
* @param rlAgent 代理商
|
||||
* @return 代理商集合
|
||||
*/
|
||||
public List<RlAgent> selectRlAgentList(RlAgent rlAgent);
|
||||
public List<RlAgentVO> selectRlAgentList(RlAgent rlAgent);
|
||||
|
||||
/**
|
||||
* 新增代理商
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.system.domain.dividendDetail.RlDividendDetail;
|
||||
import com.ruoyi.system.domain.dividendDetail.RlDividendDetailVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -26,7 +27,7 @@ public interface RlDividendDetailMapper
|
|||
* @param rlDividendDetail 分账明细
|
||||
* @return 分账明细集合
|
||||
*/
|
||||
public List<RlDividendDetail> selectRlDividendDetailList(RlDividendDetail rlDividendDetail);
|
||||
public List<RlDividendDetailVO> selectRlDividendDetailList(RlDividendDetail rlDividendDetail);
|
||||
|
||||
/**
|
||||
* 新增分账明细
|
||||
|
|
|
@ -35,7 +35,7 @@ public interface IRlAgentService
|
|||
* @param rlAgent 代理商
|
||||
* @return 代理商集合
|
||||
*/
|
||||
public List<RlAgent> selectRlAgentList(RlAgent rlAgent);
|
||||
public List<RlAgentVO> selectRlAgentList(RlAgent rlAgent);
|
||||
|
||||
/**
|
||||
* 新增代理商
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.system.domain.dividendDetail.RlDividendDetail;
|
||||
import com.ruoyi.system.domain.dividendDetail.RlDividendDetailVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -26,7 +27,7 @@ public interface IRlDividendDetailService
|
|||
* @param rlDividendDetail 分账明细
|
||||
* @return 分账明细集合
|
||||
*/
|
||||
public List<RlDividendDetail> selectRlDividendDetailList(RlDividendDetail rlDividendDetail);
|
||||
public List<RlDividendDetailVO> selectRlDividendDetailList(RlDividendDetail rlDividendDetail);
|
||||
|
||||
/**
|
||||
* 新增分账明细
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.ruoyi.system.service;
|
|||
|
||||
import com.ruoyi.system.domain.RlFunction;
|
||||
import com.ruoyi.system.domain.model.RlModel;
|
||||
import com.ruoyi.system.domain.model.RlModelQuery;
|
||||
import com.ruoyi.system.domain.model.RlModelVO;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -61,7 +62,7 @@ public interface IRlModelService
|
|||
* @param etModel 车辆型号
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEModel(RlModel etModel);
|
||||
public int insertEModel(RlModelQuery etModel);
|
||||
|
||||
/**
|
||||
* 修改车辆型号
|
||||
|
@ -69,7 +70,7 @@ public interface IRlModelService
|
|||
* @param etModel 车辆型号
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEModel(RlModel etModel);
|
||||
public int updateEModel(RlModelQuery etModel);
|
||||
|
||||
/**
|
||||
* 批量删除车辆型号
|
||||
|
|
|
@ -174,7 +174,7 @@ public interface IRlOrderService
|
|||
/**
|
||||
* 根据sn查询正在进行中的订单
|
||||
*/
|
||||
List<RlOrderVO> getInProgressOrder(String sn);
|
||||
RlOrderVO getInProgressOrder(String sn);
|
||||
|
||||
|
||||
void validate(RlOrderQuery orderQuery);
|
||||
|
|
|
@ -5,20 +5,17 @@ import com.alibaba.fastjson2.JSON;
|
|||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.constant.ServiceConstants;
|
||||
import com.ruoyi.common.core.domain.entity.RlUser;
|
||||
import com.ruoyi.common.core.domain.entity.RlUserVO;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.pay.wx.domain.NotifyEventType;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.http.HttpUtils;
|
||||
import com.ruoyi.system.domain.EtCallbackLog;
|
||||
import com.ruoyi.system.domain.changeBalance.RlChangeBalance;
|
||||
import com.ruoyi.system.domain.channel.ChannelVO;
|
||||
import com.ruoyi.system.domain.deliveryOrder.RlDeliveryOrder;
|
||||
import com.ruoyi.system.domain.dividendDetail.RlDividendDetail;
|
||||
import com.ruoyi.system.domain.order.RlOrder;
|
||||
import com.ruoyi.system.domain.refund.RlRefund;
|
||||
import com.ruoyi.system.domain.userExt.RlUserExt;
|
||||
import com.ruoyi.system.domain.vo.RlUserQuery;
|
||||
import com.ruoyi.system.mapper.EtCallbackLogMapper;
|
||||
import com.ruoyi.system.service.*;
|
||||
import com.wechat.pay.java.core.RSAAutoCertificateConfig;
|
||||
|
@ -40,8 +37,6 @@ import javax.annotation.Resource;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -87,6 +82,9 @@ public class CallbackServiceImpl implements CallbackService {
|
|||
@Resource
|
||||
private IRlUserExtService userExtService;
|
||||
|
||||
@Resource
|
||||
private IRlAgentService agentService;
|
||||
|
||||
|
||||
/**
|
||||
* 微信支付回调
|
||||
|
@ -127,6 +125,9 @@ public class CallbackServiceImpl implements CallbackService {
|
|||
public void businessHandle(String outTradeNo,String payType) {
|
||||
// 充值成功后的业务处理 原订单
|
||||
RlOrder originalOrder = orderService.selectRlOrderByOutTradeNo(outTradeNo);
|
||||
if(originalOrder.getPaid().equals(ServiceConstants.ORDER_PAY_STATUS_PAID)){
|
||||
return;
|
||||
}
|
||||
RlOrder updateOrder = new RlOrder();
|
||||
updateOrder.setOrderId(originalOrder.getOrderId());
|
||||
logger.info("【微信支付回调】订单信息 : " + JSON.toJSONString(originalOrder));
|
||||
|
@ -136,9 +137,15 @@ public class CallbackServiceImpl implements CallbackService {
|
|||
logger.info("【微信支付回调】租赁订单支付");
|
||||
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
/** 生成账变记录*/
|
||||
changeBalanceService.generateChanggeBalance(originalOrder.getOrderNo(), outTradeNo, ServiceConstants.FLOW_TYPE_INCOME,
|
||||
ServiceConstants.RIDE_ORDER, originalOrder.getPayFee(), originalOrder.getUserId(), originalOrder.getUserName(), originalOrder.getPhone());
|
||||
/** 获取到代理商 生成账变记录 为什么要账变?*/
|
||||
// RlAgentVO rlAgentVO = agentService.selectRlAgentByAgentId(originalOrder.getAgentId());
|
||||
// RlUser user = userService.selectUserById(rlAgentVO.getUserid());
|
||||
// if(ObjectUtil.isNull(user)){
|
||||
// logger.info("【微信支付回调】代理商【{}】没有绑定用户",rlAgentVO.getName());
|
||||
// throw new ServiceException("【微信支付回调】代理商【{}】没有绑定用户");
|
||||
// }
|
||||
// changeBalanceService.generateChanggeBalance(originalOrder.getOrderNo(), outTradeNo, ServiceConstants.FLOW_TYPE_INCOME,
|
||||
// ServiceConstants.RIDE_ORDER, originalOrder.getPayFee(), user.getUserId(), user.getUserName(), user.getPhonenumber());
|
||||
updateOrder.setPaid("1");
|
||||
updateOrder.setPayTime(DateUtils.getNowDate());
|
||||
updateOrder.setPayType(payType);
|
||||
|
|
|
@ -87,7 +87,7 @@ public class RlAgentServiceImpl implements IRlAgentService
|
|||
* @return 代理商
|
||||
*/
|
||||
@Override
|
||||
public List<RlAgent> selectRlAgentList(RlAgent rlAgent)
|
||||
public List<RlAgentVO> selectRlAgentList(RlAgent rlAgent)
|
||||
{
|
||||
return rlAgentMapper.selectRlAgentList(rlAgent);
|
||||
}
|
||||
|
|
|
@ -1293,6 +1293,7 @@ public class RlDeviceServiceImpl extends ServiceImpl<RlDeviceMapper, RlDevice> i
|
|||
}
|
||||
RlDevice asDevice = deviceMapper.selectDeviceBySn(sn);
|
||||
RlDevice updateDevice = new RlDevice();
|
||||
updateDevice.setDeviceId(asDevice.getDeviceId());
|
||||
/** 1.获取token*/
|
||||
String token = Token.getToken();
|
||||
String finalSn = sn;
|
||||
|
@ -1348,6 +1349,9 @@ 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())){
|
||||
throw new ServiceException("手机经纬度不能为空");
|
||||
}
|
||||
RlOrder updateOrder = new RlOrder();
|
||||
/** 1. 记录还车时间*/
|
||||
updateOrder.setOrderId(order.getOrderId());
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl;
|
|||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.system.domain.dividendDetail.RlDividendDetail;
|
||||
import com.ruoyi.system.domain.dividendDetail.RlDividendDetailVO;
|
||||
import com.ruoyi.system.mapper.RlDividendDetailMapper;
|
||||
import com.ruoyi.system.service.IRlDividendDetailService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -40,7 +41,7 @@ public class RlDividendDetailServiceImpl implements IRlDividendDetailService
|
|||
* @return 分账明细
|
||||
*/
|
||||
@Override
|
||||
public List<RlDividendDetail> selectRlDividendDetailList(RlDividendDetail rlDividendDetail)
|
||||
public List<RlDividendDetailVO> selectRlDividendDetailList(RlDividendDetail rlDividendDetail)
|
||||
{
|
||||
return rlDividendDetailMapper.selectRlDividendDetailList(rlDividendDetail);
|
||||
}
|
||||
|
|
|
@ -7,13 +7,12 @@ import com.ruoyi.system.domain.RlFunction;
|
|||
import com.ruoyi.system.domain.accessory.RlAccessoryVO;
|
||||
import com.ruoyi.system.domain.device.RlDevice;
|
||||
import com.ruoyi.system.domain.model.RlModel;
|
||||
import com.ruoyi.system.domain.model.RlModelQuery;
|
||||
import com.ruoyi.system.domain.model.RlModelVO;
|
||||
import com.ruoyi.system.domain.modelAccessory.RlModelAccessory;
|
||||
import com.ruoyi.system.domain.store.StoreVo;
|
||||
import com.ruoyi.system.mapper.RlModelMapper;
|
||||
import com.ruoyi.system.service.IRlAccessoryService;
|
||||
import com.ruoyi.system.service.IRlDeviceService;
|
||||
import com.ruoyi.system.service.IRlFunctionService;
|
||||
import com.ruoyi.system.service.IRlModelService;
|
||||
import com.ruoyi.system.service.*;
|
||||
import com.ruoyi.system.service.store.RlStoreService;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -50,6 +49,9 @@ public class RlModelServiceImpl implements IRlModelService
|
|||
@Autowired
|
||||
private RlStoreService storeService;
|
||||
|
||||
@Autowired
|
||||
private IRlModelAccessoryService modelAccessoryService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -156,17 +158,31 @@ public class RlModelServiceImpl implements IRlModelService
|
|||
/**
|
||||
* 新增车辆型号
|
||||
*
|
||||
* @param etModel 车辆型号
|
||||
* @param modelQuery 车辆型号
|
||||
* @return 结果
|
||||
*/
|
||||
@SneakyThrows
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertEModel(RlModel etModel)
|
||||
public int insertEModel(RlModelQuery modelQuery)
|
||||
{
|
||||
etModel.setCreateTime(DateUtils.getNowDate());
|
||||
int i = rlModelMapper.insertEModel(etModel);
|
||||
return i;
|
||||
modelQuery.setCreateTime(DateUtils.getNowDate());
|
||||
int i = rlModelMapper.insertEModel(modelQuery);
|
||||
if(i == 0){
|
||||
throw new Exception("新增失败");
|
||||
}
|
||||
Long[] accessoryIds = modelQuery.getAccessoryIds();
|
||||
if(ObjectUtil.isNotNull(accessoryIds) && accessoryIds.length>0){
|
||||
log.info("【新增车辆型号】");
|
||||
for (Long accessoryId:accessoryIds) {
|
||||
RlModelAccessory modelAccessory = new RlModelAccessory();
|
||||
modelAccessory.setAccessoryId(accessoryId);
|
||||
modelAccessory.setModelId(modelQuery.getModelId());
|
||||
modelAccessoryService.insertRlModelAccessory(modelAccessory);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -178,11 +194,28 @@ public class RlModelServiceImpl implements IRlModelService
|
|||
@SneakyThrows
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateEModel(RlModel etModel)
|
||||
public int updateEModel(RlModelQuery etModel)
|
||||
{
|
||||
etModel.setUpdateTime(DateUtils.getNowDate());
|
||||
int i = rlModelMapper.updateEModel(etModel);
|
||||
return i;
|
||||
if(i == 0){
|
||||
throw new Exception("修改车辆型号失败");
|
||||
}
|
||||
Long[] accessoryIds = etModel.getAccessoryIds();
|
||||
if(ObjectUtil.isNotNull(accessoryIds) && accessoryIds.length>0){
|
||||
log.info("【修改车辆型号,删除车型配件关联成功】");
|
||||
int i1 = modelAccessoryService.deleteRlModelAccessoryByModelId(etModel.getModelId());
|
||||
if(i1 > 0){
|
||||
for (Long accessoryId:accessoryIds) {
|
||||
RlModelAccessory modelAccessory = new RlModelAccessory();
|
||||
modelAccessory.setAccessoryId(accessoryId);
|
||||
modelAccessory.setModelId(etModel.getModelId());
|
||||
modelAccessoryService.insertRlModelAccessory(modelAccessory);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,6 +17,7 @@ import com.ruoyi.system.domain.accessory.RlAccessoryVO;
|
|||
import com.ruoyi.system.domain.agent.RlAgent;
|
||||
import com.ruoyi.system.domain.device.RlDevice;
|
||||
import com.ruoyi.system.domain.dividendDetail.RlDividendDetail;
|
||||
import com.ruoyi.system.domain.dividendDetail.RlDividendDetailVO;
|
||||
import com.ruoyi.system.domain.model.RlModelVO;
|
||||
import com.ruoyi.system.domain.order.RlOrder;
|
||||
import com.ruoyi.system.domain.order.RlOrderQuery;
|
||||
|
@ -89,7 +90,7 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
private RlStoreService storeService;
|
||||
|
||||
@Resource
|
||||
private IRlUserService eUserService;
|
||||
private IRlUserService userService;
|
||||
|
||||
@Autowired
|
||||
private TransactionTemplate transactionTemplate;
|
||||
|
@ -109,6 +110,9 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
@Autowired
|
||||
private IRlOrderOperService orderOperService;
|
||||
|
||||
@Autowired
|
||||
private IRlChangeBalanceService changeBalanceService;
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
|
@ -184,7 +188,7 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
/** 收益明细*/
|
||||
RlDividendDetail rlDividendDetail = new RlDividendDetail();
|
||||
rlDividendDetail.setOrderNo(orderNo);
|
||||
List<RlDividendDetail> rlDividendDetails = rlDividendDetailService.selectRlDividendDetailList(rlDividendDetail);
|
||||
List<RlDividendDetailVO> rlDividendDetails = rlDividendDetailService.selectRlDividendDetailList(rlDividendDetail);
|
||||
order.setRlDividendDetails(rlDividendDetails);
|
||||
|
||||
/** 显示可退款金额 根据订单号查询可退款金额 refundableAmount*/
|
||||
|
@ -340,7 +344,7 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
order.setPaid(ServiceConstants.ORDER_PAY_STATUS_NON_PAYMENT);
|
||||
order.setType(type);
|
||||
order.setUserId(userId);
|
||||
RlUser rlUser = eUserService.selectUserById(userId);
|
||||
RlUser rlUser = userService.selectUserById(userId);
|
||||
if(ObjectUtil.isNotNull(rlUser)){
|
||||
order.setUserName(rlUser.getUserName());
|
||||
order.setPhone(rlUser.getPhonenumber());
|
||||
|
@ -358,6 +362,10 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
onceMoreCalculatePrice(order);
|
||||
|
||||
order.setStatus(ServiceConstants.ORDER_STATUS_TO_BE_PAID);
|
||||
RlModelVO rlModelVO = modelService.selectEModelByModelId(order.getModelId());
|
||||
if(ObjectUtil.isNotNull(rlModelVO)){
|
||||
order.setModel(rlModelVO.getModel());
|
||||
}
|
||||
int i = orderMapper.insertRlOrder(order);
|
||||
if (i < 1) {
|
||||
throw new RuntimeException("下单失败");
|
||||
|
@ -416,6 +424,10 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
if(StrUtil.isNotBlank(order.getSn())){
|
||||
throw new RuntimeException("该订单已绑定车辆:"+order.getSn());
|
||||
}
|
||||
RlOrderVO order1 = getInProgressOrder(sn);
|
||||
if(ObjectUtil.isNotNull(order1)){
|
||||
throw new RuntimeException("该车辆【"+sn+"】有进行中的订单:");
|
||||
}
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
logger.info("=================【扫码绑定车辆】==================");
|
||||
RlOrder rlOrder = new RlOrder();
|
||||
|
@ -572,17 +584,8 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
//根据订单号查询订单信息
|
||||
/** 1. 校验 */
|
||||
RlOrderVO rlOrderVO = orderMapper.selectRlOrderByOrderNo(etOrder.getOrderNo());
|
||||
if(ObjectUtil.isNull(rlOrderVO)){
|
||||
throw new ServiceException("订单不存在");
|
||||
}
|
||||
if(!ServiceConstants.ORDER_STATUS_ORDER_END.equals(rlOrderVO.getStatus())){
|
||||
throw new ServiceException("退款失败,订单未结束");
|
||||
}
|
||||
if(ServiceConstants.ORDER_PAY_STATUS_NON_PAYMENT.equals(rlOrderVO.getPaid())){
|
||||
throw new ServiceException("订单未支付,不能退款");
|
||||
}
|
||||
|
||||
/** 1.退款*/
|
||||
refundVerify(rlOrderVO);
|
||||
/** 2.计算出退款的比例 保留两位小数点 比如退款金额为5元, 订单金额为32元 退款比例 = 5/32 = 0.16 (四舍五入)由系统来平账*/
|
||||
//退款金额 调度费(商家取车) 配送费(送车上门) 租赁费
|
||||
BigDecimal refundAmount = new BigDecimal("0");
|
||||
BigDecimal dispatchFee = etOrder.getDispatchFee();
|
||||
|
@ -600,32 +603,67 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
if(refundAmount.compareTo(BigDecimal.ZERO) == 0){
|
||||
throw new ServiceException("总退款金额不能为0");
|
||||
}
|
||||
/** 3.计算出退款的比例 */
|
||||
BigDecimal divide = refundAmount.divide(rlOrderVO.getPayFee());
|
||||
/** 4. 遍历用户,新增账变 */
|
||||
Long agentId = rlOrderVO.getAgentId();
|
||||
BigDecimal refundPercentage = refundAmount.divide(rlOrderVO.getPayFee()).setScale(2, RoundingMode.HALF_UP);
|
||||
BigDecimal finalRefundAmount = refundAmount;
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
/** 3. 根据分成列表,遍历用户,新增账变 */
|
||||
refundDividendHandle(rlOrderVO, refundPercentage);
|
||||
/** 4.记录退款表 创建退款对象*/
|
||||
String outRefundNo = saveRefundObj(rlOrderVO, finalRefundAmount, dispatchFee, deliveryFee, leaseFee);
|
||||
/** 5. 发起退款 */
|
||||
wxPayService.refund(rlOrderVO, "商家退款金额", finalRefundAmount,outRefundNo);
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
if(!execute)throw new ServiceException("【订单退款】失败");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** todo 2. 每个用户都要余额不足判断 */
|
||||
RlUserExt rlUserExt = userExtService.selectRlUserExtByUserId(SecurityUtils.getUserId());
|
||||
BigDecimal subtract = rlUserExt.getBalance().subtract(etOrder.getTotalFee());
|
||||
if(subtract.compareTo(BigDecimal.ZERO) <= 0){
|
||||
throw new ServiceException("余额不足,不能退款");
|
||||
}
|
||||
|
||||
// 新增账变
|
||||
// etOrder1.setPayFee(refundAmount);
|
||||
// callbackService.capitalFlowRecords(etOrder1,ServiceConstants.FLOW_TYPE_DISBURSE,ServiceConstants.ORDER_TYPE_RIDING_REFUND,ServiceConstants.OWNER_TYPE_OPERATOR,null,ServiceConstants.PAY_TYPE_WX);
|
||||
@NotNull
|
||||
private String saveRefundObj(RlOrderVO rlOrderVO, BigDecimal refundAmount, BigDecimal dispatchFee, BigDecimal deliveryFee, BigDecimal leaseFee) {
|
||||
String outRefundNo = IdUtils.getOrderNo("ref");
|
||||
/** 2.记录退款表 创建退款对象*/
|
||||
RlRefund refund1= createRefund("商家退款金额",rlOrderVO.getUserId(),rlOrderVO.getOrderNo(), refundAmount, dispatchFee, deliveryFee, leaseFee, outRefundNo,ServiceConstants.REFUND_TYPE_SYSTEM);
|
||||
int i = refundService.insertEtRefund(refund1);
|
||||
if(i>0){
|
||||
RlRefund refund1= createRefund("商家退款金额", rlOrderVO.getUserId(), rlOrderVO.getOrderNo(), refundAmount, dispatchFee, deliveryFee, leaseFee, outRefundNo,ServiceConstants.REFUND_TYPE_SYSTEM);
|
||||
int refundResult = refundService.insertEtRefund(refund1);
|
||||
if(refundResult>0){
|
||||
logger.info("保存退款对象成功");
|
||||
}
|
||||
logger.info("总金额:【{}】,退款金额:【{}】", rlOrderVO.getTotalFee(), refundAmount);
|
||||
/** 6. 发起退款 */
|
||||
wxPayService.refund(rlOrderVO, "商家退款金额", refundAmount,outRefundNo);
|
||||
return 1;
|
||||
return outRefundNo;
|
||||
}
|
||||
|
||||
private void refundDividendHandle(RlOrderVO rlOrderVO, BigDecimal refundPercentage) {
|
||||
RlDividendDetail rlDividendDetail = new RlDividendDetail();
|
||||
rlDividendDetail.setOrderNo(rlOrderVO.getOrderNo());
|
||||
List<RlDividendDetailVO> dividendDetails = rlDividendDetailService.selectRlDividendDetailList(rlDividendDetail);
|
||||
for(RlDividendDetail detail:dividendDetails){
|
||||
/** 4.1 余额不足判断 */
|
||||
RlUserExt rlUserExt = userExtService.selectRlUserExtByUserId(detail.getPartnerId());
|
||||
RlUser user = userService.selectUserById(rlUserExt.getUserId());
|
||||
// 计算出这个用户将要退款的金额
|
||||
BigDecimal userRefundAmount = detail.getDividendAmount().multiply(refundPercentage);//用户退款金额 = 0.16 * 5元 = 0.8元 如果这个值小于余额则提示 余额不足
|
||||
BigDecimal subtract = rlUserExt.getBalance().subtract(userRefundAmount);
|
||||
if(subtract.compareTo(BigDecimal.ZERO) <= 0){
|
||||
throw new ServiceException("用户【"+user.getPhonenumber()+"】余额不足,不能退款");
|
||||
}
|
||||
/** 4.2 新增账变 */
|
||||
int i = changeBalanceService.generateChanggeBalance(rlOrderVO.getOrderNo(), rlOrderVO.getOutTradeNo(), ServiceConstants.FLOW_TYPE_DISBURSE,
|
||||
ServiceConstants.ORDER_REFUND, userRefundAmount, rlUserExt.getUserId(), user.getUserName(), user.getPhonenumber());
|
||||
if(i<=0)throw new ServiceException("用户【"+user.getPhonenumber()+"】新增账变失败");
|
||||
/** todo 4.3 分成比例? */
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/** 退款校验*/
|
||||
private void refundVerify(RlOrderVO rlOrderVO) {
|
||||
if(ObjectUtil.isNull(rlOrderVO)){
|
||||
throw new ServiceException("订单不存在");
|
||||
}
|
||||
if(!ServiceConstants.ORDER_STATUS_ORDER_END.equals(rlOrderVO.getStatus())){
|
||||
throw new ServiceException("退款失败,订单未结束");
|
||||
}
|
||||
if(ServiceConstants.ORDER_PAY_STATUS_NON_PAYMENT.equals(rlOrderVO.getPaid())){
|
||||
throw new ServiceException("订单未支付,不能退款");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -670,7 +708,7 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
BigDecimal deposit = deposit(order.getModelId(), priceVO);
|
||||
totalFee = totalFee.add(deposit);
|
||||
// 配送费
|
||||
BigDecimal deliveryFee = deliveryFee(order.getAgentId(), priceVO);
|
||||
BigDecimal deliveryFee = deliveryFee(order, priceVO);
|
||||
totalFee = totalFee.add(deliveryFee);
|
||||
}
|
||||
// 租金
|
||||
|
@ -714,10 +752,13 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
* 根据sn查询正在进行中的订单
|
||||
*/
|
||||
@Override
|
||||
public List<RlOrderVO> getInProgressOrder(String sn) {
|
||||
public RlOrderVO getInProgressOrder(String sn) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<RlOrderVO> orders = orderMapper.getInProgressOrder(sn,userId);
|
||||
return orders;
|
||||
if(ObjectUtil.isNotNull(orders.size()) && orders.size() > 0){
|
||||
return orders.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -771,13 +812,13 @@ public class RlOrderServiceImpl implements IRlOrderService
|
|||
return deposit;
|
||||
}
|
||||
|
||||
private BigDecimal deliveryFee(Long agentId, PriceVO priceVO) {
|
||||
private BigDecimal deliveryFee(RlOrderQuery orderQuery, PriceVO priceVO) {
|
||||
BigDecimal deliveryFee = BigDecimal.ZERO;
|
||||
RlAgent agent = agentService.selectRlAgentByAgentId(agentId);
|
||||
RlAgent agent = agentService.selectRlAgentByAgentId(orderQuery.getAgentId());
|
||||
if(agent == null){
|
||||
throw new ServiceException("代理商不存在");
|
||||
}
|
||||
if(!agent.getIsFreeCar()){
|
||||
if(orderQuery.getDeliveryMethod().equals(ServiceConstants.DELIVERY_METHOD_CHARGE_DELIVERY_CAR)){
|
||||
deliveryFee = agent.getDeliveryFee();
|
||||
priceVO.setDeliveryFee(deliveryFee);
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
a.accessory_id
|
||||
</select>
|
||||
|
||||
<select id="selectRlDeviceAccessoryByDeviceId" parameterType="Long" resultMap="RlAccessoryResult">
|
||||
|
|
|
@ -7,31 +7,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<resultMap type="RlAgentVO" id="RlAgentResult" autoMapping="true" />
|
||||
|
||||
<sql id="selectRlAgentVo">
|
||||
select agent_id, name, service_phone, dispatch_fee, delivery_fee, city_id, contact, phone, userid, pay_channel, is_free_car from rl_agent
|
||||
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 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">
|
||||
<include refid="selectRlAgentVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="servicePhone != null and servicePhone != ''"> and service_phone = #{servicePhone}</if>
|
||||
<if test="dispatchFee != null "> and dispatch_fee = #{dispatchFee}</if>
|
||||
<if test="deliveryFee != null "> and delivery_fee = #{deliveryFee}</if>
|
||||
<if test="cityId != null "> and city_id = #{cityId}</if>
|
||||
<if test="contact != null and contact != ''"> and contact = #{contact}</if>
|
||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="userid != null "> and userid = #{userid}</if>
|
||||
<if test="name != null and name != ''"> and a.name like concat('%', #{name}, '%')</if>
|
||||
<if test="servicePhone != null and servicePhone != ''"> and a.service_phone = #{servicePhone}</if>
|
||||
<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="contact != null and contact != ''"> and a.contact = #{contact}</if>
|
||||
<if test="phone != null and phone != ''"> and a.phone = #{phone}</if>
|
||||
<if test="userid != null "> and a.userid = #{userid}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRlAgentByAgentId" parameterType="Long" resultMap="RlAgentResult">
|
||||
<include refid="selectRlAgentVo"/>
|
||||
where agent_id = #{agentId}
|
||||
where a.agent_id = #{agentId}
|
||||
</select>
|
||||
|
||||
<select id="selectRlAgentByCityId" parameterType="Long" resultMap="RlAgentResult">
|
||||
<include refid="selectRlAgentVo"/>
|
||||
where city_id = #{cityId}
|
||||
where a.city_id = #{cityId}
|
||||
</select>
|
||||
|
||||
<insert id="insertRlAgent" parameterType="RlAgent" useGeneratedKeys="true" keyProperty="agentId">
|
||||
|
|
|
@ -7,12 +7,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<resultMap type="RlDeliveryOrderVO" id="RlDeliveryOrderResult" autoMapping="true" />
|
||||
|
||||
<sql id="selectRlDeliveryOrderVo">
|
||||
select do.delivery_id, do.order_no, do.agent_id, do.deliveryman_id, do.deliveryman_type,
|
||||
select do.delivery_id, do.order_no, do.agent_id, a.name agentName, do.deliveryman_id, do.deliveryman_type,
|
||||
do.deliveryman, do.deliveryman_phone, do.status, do.create_time,s.lng,s.lat,s.address,
|
||||
do.store_id, do.store_name, do.delivery_address, do.delivery_lon, do.delivery_lat ,do.delivery_time,
|
||||
o.order_id, o.type, o.status, o.phone, o.real_name, o.model, o.pay_time from rl_delivery_order do
|
||||
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
|
||||
</sql>
|
||||
|
||||
<select id="selectRlDeliveryOrderList" parameterType="RlDeliveryOrderVO" resultMap="RlDeliveryOrderResult">
|
||||
|
@ -58,6 +59,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deliverymanPhone != null">deliveryman_phone,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="storeId != null">store_id,</if>
|
||||
<if test="storeName != null">store_name,</if>
|
||||
<if test="deliveryAddress != null">delivery_address,</if>
|
||||
<if test="deliveryLon != null">delivery_lon,</if>
|
||||
<if test="deliveryLat != null">delivery_lat,</if>
|
||||
<if test="deliveryTime != null">delivery_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderNo != null">#{orderNo},</if>
|
||||
|
@ -68,6 +75,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deliverymanPhone != null">#{deliverymanPhone},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="storeId != null">#{storeId},</if>
|
||||
<if test="storeName != null">#{storeName},</if>
|
||||
<if test="deliveryAddress != null">#{deliveryAddress},</if>
|
||||
<if test="deliveryLon != null">#{deliveryLon},</if>
|
||||
<if test="deliveryLat != null">#{deliveryLat},</if>
|
||||
<if test="deliveryTime != null">#{deliveryTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -82,6 +95,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deliverymanPhone != null">deliveryman_phone = #{deliverymanPhone},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="storeId != null">store_id = #{storeId},</if>
|
||||
<if test="storeName != null">store_name = #{storeName},</if>
|
||||
<if test="deliveryAddress != null">delivery_address = #{deliveryAddress},</if>
|
||||
<if test="deliveryLon != null">delivery_lon = #{deliveryLon},</if>
|
||||
<if test="deliveryLat != null">delivery_lat = #{deliveryLat},</if>
|
||||
<if test="deliveryTime != null">delivery_time = #{deliveryTime},</if>
|
||||
</trim>
|
||||
where delivery_id = #{deliveryId}
|
||||
</update>
|
||||
|
|
|
@ -4,25 +4,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.RlDividendDetailMapper">
|
||||
|
||||
<resultMap type="RlDividendDetail" id="RlDividendDetailResult" autoMapping="true" />
|
||||
<resultMap type="RlDividendDetailVO" id="RlDividendDetailResult" autoMapping="true" />
|
||||
|
||||
<sql id="selectRlDividendDetailVo">
|
||||
select id, agent_id, partner_id, partner_name, partner_phone, partner_type, order_no, total_amount, dividend_amount, dividend_proportion, create_time from rl_dividend_detail
|
||||
select dd.id, dd.agent_id, a.name agentName, dd.partner_id, dd.partner_name, dd.partner_phone, dd.partner_type, dd.order_no,
|
||||
dd.total_amount, dd.dividend_amount, dd.dividend_proportion, dd.create_time from rl_dividend_detail dd
|
||||
left join rl_agent a on a.agent_id = dd.agent_id
|
||||
</sql>
|
||||
|
||||
<select id="selectRlDividendDetailList" parameterType="RlDividendDetail" resultMap="RlDividendDetailResult">
|
||||
<include refid="selectRlDividendDetailVo"/>
|
||||
<where>
|
||||
<if test="agentId != null "> and agent_id = #{agentId}</if>
|
||||
<if test="partnerId != null "> and partner_id = #{partnerId}</if>
|
||||
<if test="partnerName != null "> and partner_name = #{partnerName}</if>
|
||||
<if test="partnerPhone != null "> and partner_phone = #{partnerPhone}</if>
|
||||
<if test="partnerType != null "> and partner_type = #{partnerType}</if>
|
||||
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
|
||||
<if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
|
||||
<if test="dividendAmount != null "> and dividend_amount = #{dividendAmount}</if>
|
||||
<if test="dividendProportion != null "> and dividend_proportion = #{dividendProportion}</if>
|
||||
|
||||
<if test="agentId != null "> and dd.agent_id = #{agentId}</if>
|
||||
<if test="partnerId != null "> and dd.partner_id = #{partnerId}</if>
|
||||
<if test="partnerName != null "> and dd.partner_name = #{partnerName}</if>
|
||||
<if test="partnerPhone != null "> and dd.partner_phone = #{partnerPhone}</if>
|
||||
<if test="partnerType != null "> and dd.partner_type = #{partnerType}</if>
|
||||
<if test="orderNo != null and orderNo != ''"> and dd.order_no = #{orderNo}</if>
|
||||
<if test="totalAmount != null "> and dd.total_amount = #{totalAmount}</if>
|
||||
<if test="dividendAmount != null "> and dd.dividend_amount = #{dividendAmount}</if>
|
||||
<if test="dividendProportion != null "> and dd.dividend_proportion = #{dividendProportion}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
|
@ -214,6 +214,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getInProgressOrder" resultType="com.ruoyi.system.domain.order.RlOrderVO">
|
||||
<include refid="selectRlOrderDetail"/>
|
||||
where o.sn = #{sn} and o.status = 4 and o.user_id = #{userId}
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<insert id="insertRlOrder" parameterType="RlOrder" useGeneratedKeys="true" keyProperty="orderId">
|
||||
|
@ -260,8 +261,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deliveryMethod != null">delivery_method,</if>
|
||||
<if test="pickupTime != null">pickup_time,</if>
|
||||
<if test="agentId != null">agent_id,</if>
|
||||
<if test="storeId != null">,</if>
|
||||
<if test="storeName != null">,</if>
|
||||
<if test="storeId != null">store_id,</if>
|
||||
<if test="storeName != null">store_name,</if>
|
||||
<if test="merchantId != null">merchant_id,</if>
|
||||
<if test="pickupCity != null">pickup_city,</if>
|
||||
<if test="pickupLoc != null">pickup_loc,</if>
|
||||
|
@ -326,6 +327,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="pickupTime != null">#{pickupTime},</if>
|
||||
<if test="agentId != null">#{agentId},</if>
|
||||
<if test="storeId != null">#{storeId},</if>
|
||||
<if test="storeName != null">#{storeName},</if>
|
||||
<if test="merchantId != null">#{merchantId},</if>
|
||||
<if test="pickupCity != null">#{pickupCity},</if>
|
||||
<if test="pickupLoc != null">#{pickupLoc},</if>
|
||||
|
|
Loading…
Reference in New Issue
Block a user