1. 调整
This commit is contained in:
parent
e84d807428
commit
f927f269da
electripper-admin/src/main/java/com/ruoyi/web/controller/system
electripper-common/src/main/java/com/ruoyi/common/utils
electripper-system/src/main
java/com/ruoyi/system
resources/mapper/system
|
@ -44,7 +44,7 @@ public class EtOrderController extends BaseController
|
|||
public TableDataInfo list(EtOrder etOrder)
|
||||
{
|
||||
startPage();
|
||||
List<EtOrder> list = etOrderService.selectEtOrderList(etOrder);
|
||||
List<EtOrder> list = etOrderService.selectEtOrderListWithIsolate(etOrder);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ public class EtOrderController extends BaseController
|
|||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EtOrder etOrder)
|
||||
{
|
||||
List<EtOrder> list = etOrderService.selectEtOrderList(etOrder);
|
||||
List<EtOrder> list = etOrderService.selectEtOrderListWithIsolate(etOrder);
|
||||
ExcelUtil<EtOrder> util = new ExcelUtil<EtOrder>(EtOrder.class);
|
||||
util.exportExcel(response, list, "订单数据");
|
||||
}
|
||||
|
|
|
@ -139,6 +139,9 @@ public class CommonUtil {
|
|||
BigDecimal full = new BigDecimal(fullVoltage).subtract(new BigDecimal(lowVoltage));
|
||||
BigDecimal divide = full.subtract(current).divide(full,2, RoundingMode.HALF_UP);//当前电量百分百
|
||||
BigDecimal multiply = divide.multiply(new BigDecimal(100));
|
||||
if(multiply.compareTo(new BigDecimal(100)) > 0){
|
||||
multiply = new BigDecimal(100);
|
||||
}
|
||||
// log.info("当前电量百分百:{}%",multiply);
|
||||
return multiply.intValue();
|
||||
}
|
||||
|
|
|
@ -32,6 +32,10 @@ public class EtRefund extends BaseEntity
|
|||
@Excel(name = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 用户 */
|
||||
@Excel(name = "用户")
|
||||
private String userName;
|
||||
|
||||
/** 退款金额 */
|
||||
@Excel(name = "退款金额")
|
||||
private BigDecimal amount;
|
||||
|
|
|
@ -60,6 +60,14 @@ public interface IEtOrderService
|
|||
*/
|
||||
public List<EtOrder> selectEtOrderList(EtOrder etOrder);
|
||||
|
||||
/**
|
||||
* 查询订单列表(带数据隔离)
|
||||
*
|
||||
* @param etOrder 订单
|
||||
* @return 订单集合
|
||||
*/
|
||||
public List<EtOrder> selectEtOrderListWithIsolate(EtOrder etOrder);
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
|
|
|
@ -251,6 +251,8 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
//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("");
|
||||
}
|
||||
}
|
||||
return asDevices;
|
||||
|
|
|
@ -187,20 +187,40 @@ public class EtOrderServiceImpl implements IEtOrderService
|
|||
|
||||
/**
|
||||
* 查询订单列表
|
||||
* 车型
|
||||
* 品牌商
|
||||
* 运营商
|
||||
* 满电电压 Full voltage
|
||||
* 亏电电压 Low voltage
|
||||
* 满电续航 full_endurance
|
||||
* 低电量提醒 Low battery reminder
|
||||
* 已投放区域
|
||||
* @param etOrder 订单
|
||||
* @return 订单 已结束
|
||||
*/
|
||||
@Override
|
||||
public List<EtOrder> selectEtOrderList(EtOrder etOrder)
|
||||
{
|
||||
String[] statusList = etOrder.getStatusList();
|
||||
if(ObjectUtil.isNotNull(statusList) && toBePaid(statusList)){
|
||||
etOrder.setPaid("0");
|
||||
}
|
||||
if((ObjectUtil.isNotNull(statusList) && ended(statusList)) || ServiceConstants.ORDER_TYPE_DEPOSIT.equals(etOrder.getType()) ){
|
||||
etOrder.setPaid("1");
|
||||
}
|
||||
List<EtOrder> etOrders = etOrderMapper.selectEtOrderList(etOrder);
|
||||
//如果查询押金则增加退款记录
|
||||
if(ServiceConstants.ORDER_TYPE_DEPOSIT.equals(etOrder.getType())){
|
||||
etOrders.forEach(etOrder1 -> {
|
||||
EtRefund refund = etRefundService.selectEtRefundByOrderNo(etOrder1.getOrderNo());
|
||||
if(ObjectUtil.isNotNull(refund)){
|
||||
etOrder1.setEtRefund(refund);
|
||||
}
|
||||
});
|
||||
}
|
||||
return etOrders;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
* @param etOrder 订单
|
||||
* @return 订单 已结束
|
||||
*/
|
||||
@Override
|
||||
@DataScope(deptAlias = "d")
|
||||
public List<EtOrder> selectEtOrderList(EtOrder etOrder)
|
||||
public List<EtOrder> selectEtOrderListWithIsolate(EtOrder etOrder)
|
||||
{
|
||||
String[] statusList = etOrder.getStatusList();
|
||||
if(ObjectUtil.isNotNull(statusList) && toBePaid(statusList)){
|
||||
|
|
|
@ -26,9 +26,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</sql>
|
||||
|
||||
<select id="selectEtRefundList" parameterType="EtRefund" resultMap="EtRefundResult">
|
||||
select r.id, r.refund_no, r.order_no, r.user_id, r.amount, r.dispatch_fee, r.manage_fee,
|
||||
select r.id, r.refund_no, r.order_no, r.user_id, u.user_name userName, r.amount, r.dispatch_fee, r.manage_fee,
|
||||
r.riding_fee, r.appointment_fee, r.type, r.reason, r.create_time, r.item_desc,r.refund_result from et_refund r
|
||||
INNER JOIN et_order o on o.order_no = r.order_no
|
||||
left join et_user u on u.user_id = r.user_id
|
||||
LEFT JOIN et_operating_area oa ON o.area_id = oa.area_id
|
||||
LEFT join et_area_dept ad on ad.area_id = oa.area_id
|
||||
LEFT join sys_dept d on d.dept_id = ad.dept_id
|
||||
|
@ -40,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="itemDesc != null and itemDesc != ''"> and r.item_desc like concat('%', #{itemDesc}, '%')</if>
|
||||
<if test="refundResult != null "> and r.refund_result = #{refundResult}</if>
|
||||
<if test="type != null "> and r.type = #{type}</if>
|
||||
<if test="userName != null and userName != ''"> and u.user_name like concat('%', #{userName}, '%')</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by o.create_time desc
|
||||
|
|
Loading…
Reference in New Issue
Block a user