调整列表名称展示 订单新增运营商搜索条件
This commit is contained in:
parent
b52496609a
commit
16952f2a9f
@ -0,0 +1,30 @@
|
||||
package com.evotech.hd.common.core.Dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Options
|
||||
*
|
||||
* @author andy.shi
|
||||
* @ClassName:Options
|
||||
* @date: 2026年02月14日 9:54
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@Schema(name = "下拉菜单参数")
|
||||
public class Options {
|
||||
|
||||
@Schema(description = "下拉菜单的label")
|
||||
String label;
|
||||
@Schema(description = "下拉菜单的value")
|
||||
String value;
|
||||
|
||||
public Options() {
|
||||
}
|
||||
|
||||
public Options(String label, String value) {
|
||||
this.label = label;
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
@ -27,6 +27,11 @@ public class BatteryStation extends BaseEntity implements Serializable {
|
||||
@Schema(description = "归属运营商ID", requiredMode = RequiredMode.REQUIRED)
|
||||
@NotBlank(message = "无关联运营商信息")
|
||||
private String proxyId;
|
||||
@Schema(description = "运营商名称", requiredMode = RequiredMode.REQUIRED)
|
||||
@TableField(exist = false)
|
||||
private String poname;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "站点名称", requiredMode = RequiredMode.REQUIRED)
|
||||
@NotBlank(message = "站点名称不能为空")
|
||||
|
||||
@ -1,15 +1,13 @@
|
||||
package com.evotech.hd.common.core.entity.cloud.request;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.evotech.hd.common.core.entity.BasePageRequest;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
@ -55,6 +53,9 @@ public class PageListSwapOrderRequest extends BasePageRequest {
|
||||
@Schema(description = "公司编码")
|
||||
private String ccode;
|
||||
|
||||
@Schema(description = "运营商code")
|
||||
private String proCode;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
package com.evotech.hd.cloud.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.evotech.hd.cloud.entity.MessageMqtt;
|
||||
import com.evotech.hd.cloud.entity.request.PageListMessageMqttRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zrb
|
||||
@ -9,4 +14,5 @@ import com.evotech.hd.cloud.entity.MessageMqtt;
|
||||
*/
|
||||
public interface MessageMqttDao extends BaseMapper<MessageMqtt> {
|
||||
|
||||
List<MessageMqtt> pageList(Page<MessageMqtt> page, @Param("param") PageListMessageMqttRequest plmmr);
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.evotech.hd.cloud.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@ -30,6 +31,11 @@ public class MessageMqtt implements Serializable {
|
||||
@Schema(description = "换电站")
|
||||
private String stationCode;
|
||||
|
||||
@Schema(description = "换电站名称")
|
||||
@TableField(exist = false)
|
||||
private String stationName;
|
||||
|
||||
|
||||
@Schema(description = "传送方向")
|
||||
private String direction;
|
||||
|
||||
|
||||
@ -346,7 +346,7 @@ public class BatteryStationServiceImpl implements BatteryStationService {
|
||||
|
||||
@Override
|
||||
public List<BatteryStation> deviceList(String proxyCode) {
|
||||
return batteryStationDao.selectList(new LambdaQueryWrapper<BatteryStation>().eq(BatteryStation::getProxyId, proxyCode).select(BatteryStation::getPkId, BatteryStation::getName, BatteryStation::getStoreId, BatteryStation::getOrgCode));
|
||||
return batteryStationDao.selectList(new LambdaQueryWrapper<BatteryStation>().eq(BatteryStation::getProxyId, proxyCode).select(BatteryStation::getPkId, BatteryStation::getName, BatteryStation::getCode, BatteryStation::getStoreId, BatteryStation::getOrgCode));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.evotech.hd.cloud.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.evotech.hd.cloud.dao.MessageMqttDao;
|
||||
import com.evotech.hd.cloud.entity.MessageMqtt;
|
||||
@ -14,7 +13,6 @@ import com.evotech.hd.common.core.utils.Collections;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@ -30,12 +28,18 @@ public class MessageMqttServiceImpl implements MessageMqttService {
|
||||
@Override
|
||||
public Result<Page<MessageMqtt>> list(PageListMessageMqttRequest plmmr) {
|
||||
Page<MessageMqtt> page = new Page<MessageMqtt>(plmmr.getPageNo(), plmmr.getPageSize());
|
||||
page = messageMqttDao.selectPage(page, new QueryWrapper<MessageMqtt>()
|
||||
.eq(StringUtils.hasText(plmmr.getStationCode()), "station_code", plmmr.getStationCode())
|
||||
.eq(StringUtils.hasText(plmmr.getDirection()), "direction", plmmr.getDirection())
|
||||
.eq(StringUtils.hasText(plmmr.getType()), "type", plmmr.getType())
|
||||
.eq(StringUtils.hasText(plmmr.getMessageFunction()), "message_function", plmmr.getMessageFunction())
|
||||
.orderByDesc("pk_id"));
|
||||
List<MessageMqtt> list = messageMqttDao.pageList(page, plmmr);
|
||||
|
||||
|
||||
|
||||
// page = messageMqttDao.selectPage(page, new QueryWrapper<MessageMqtt>()
|
||||
// .eq(StringUtils.hasText(plmmr.getStationCode()), "station_code", plmmr.getStationCode())
|
||||
// .eq(StringUtils.hasText(plmmr.getDirection()), "direction", plmmr.getDirection())
|
||||
// .eq(StringUtils.hasText(plmmr.getType()), "type", plmmr.getType())
|
||||
// .eq(StringUtils.hasText(plmmr.getMessageFunction()), "message_function", plmmr.getMessageFunction())
|
||||
// .orderByDesc("pk_id"));
|
||||
page.setRecords(list);
|
||||
|
||||
if (page.getRecords().isEmpty()) {
|
||||
return new Result<Page<MessageMqtt>>().error(CodeMsg.DATABASE_RESULT_NULL);
|
||||
}
|
||||
|
||||
@ -103,6 +103,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
|
||||
@Autowired
|
||||
private BatteryStationDcService batteryStationDcService;
|
||||
@Autowired
|
||||
private BatteryStationService batteryStationService;
|
||||
@Autowired
|
||||
private OrderSwapBatteryStepService orderSwapBatteryStepService;
|
||||
@Autowired
|
||||
private OrderDetailService orderDetailService;
|
||||
@ -117,6 +119,15 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
|
||||
|
||||
@Override
|
||||
public Result<Page<OrderListVo>> pageList(PageListSwapOrderRequest plsor) {
|
||||
List<String> stationCodeList = Collections.emptyList();
|
||||
if(StringUtils.isNotEmpty(plsor.getProCode())){
|
||||
List<BatteryStation> list = batteryStationService.deviceList(plsor.getProCode());
|
||||
if(Collections.isNotEmpty(list)){
|
||||
for (BatteryStation station : list){
|
||||
stationCodeList.add(station.getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Page<Order> page = getBaseMapper().selectPage(new Page<Order>(plsor.getPageNo(), plsor.getPageSize()), new LambdaQueryWrapper<Order>()
|
||||
.eq(StringUtils.isNotEmpty(plsor.getOrderNo()), Order::getOrderNo, plsor.getOrderNo())
|
||||
@ -127,6 +138,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
|
||||
.eq(StringUtils.isNotEmpty(plsor.getTradeNo()), Order::getTradeNo, plsor.getTradeNo())
|
||||
.eq(StringUtils.isNotEmpty(plsor.getStatus()), Order::getStatus, plsor.getStatus())
|
||||
.eq(StringUtils.isNotEmpty(plsor.getUserId()), Order::getPreWechatId, plsor.getUserId())
|
||||
.in(Collections.isNotEmpty(stationCodeList), Order::getStationCode, stationCodeList)
|
||||
.ne(Order::getDelFlag, 1)
|
||||
.orderByDesc(Order::getOrderTime));
|
||||
|
||||
|
||||
@ -61,11 +61,13 @@
|
||||
|
||||
<select id="listStation" resultMap="BaseResultMap">
|
||||
select
|
||||
a.*
|
||||
a.*,
|
||||
po.poname
|
||||
From
|
||||
yt_t_battery_station a
|
||||
left join hd_resource.yt_t_proxy_operater po on po.pocode = a.proxy_id
|
||||
where
|
||||
del_flag = 0
|
||||
a.del_flag = 0
|
||||
<if test="plbsr.proxyId != null and plbsr.proxyId != '' ">
|
||||
and a.proxy_id = #{plbsr.proxyId}
|
||||
</if>
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.evotech.hd.cloud.dao.MessageMqttDao">
|
||||
|
||||
|
||||
<select id="pageList">
|
||||
select
|
||||
m.*,
|
||||
s.name as stationName
|
||||
From
|
||||
yt_t_message_mqtt m
|
||||
LEFT JOIN yt_t_battery_station s ON s.code= m.station_code
|
||||
<where>
|
||||
<if test="param.stationCode != null and param.stationCode != '' ">
|
||||
and m.station_code = #{param.stationCode}
|
||||
</if>
|
||||
<if test="param.direction != null and param.direction != '' ">
|
||||
and m.direction = #{param.direction}
|
||||
</if>
|
||||
<if test="param.type != null and param.type != '' ">
|
||||
and m.type = #{param.type}
|
||||
</if>
|
||||
<if test="param.messageFunction != null and param.messageFunction != '' ">
|
||||
and m.message_function = #{param.messageFunction}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
order by m.pk_id desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -179,6 +179,9 @@
|
||||
from hd_cloud_manage.yt_t_order o
|
||||
left join hd_cloud_manage.yt_t_order_detail od on od.order_id = o.pk_id
|
||||
left join hd_cloud_manage.yt_t_order_swap_battery_pre osbp on osbp.pk_id = o.order_pre_id
|
||||
<if test="proCode!= null and proCode!= ''">
|
||||
left join hd_cloud_manage.yt_t_battery_station bs on bs.station_code = o.station_code
|
||||
</if>
|
||||
where o.del_flag != 1
|
||||
<if test="orderNo!= null and orderNo!= ''">
|
||||
and o.order_no=#{orderNo}
|
||||
@ -204,6 +207,9 @@
|
||||
<if test="userId!= null and userId!= ''">
|
||||
and o.user_id=#{userId}
|
||||
</if>
|
||||
<if test="proCode!= null and proCode!= ''">
|
||||
and bs.proxy_id = #{proCode}
|
||||
</if>
|
||||
order by order_time desc
|
||||
</select>
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.evotech.hd.resource.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.evotech.hd.common.core.Dto.Options;
|
||||
import com.evotech.hd.common.core.Dto.Result;
|
||||
import com.evotech.hd.common.core.entity.resource.ProxyOperater;
|
||||
import com.evotech.hd.resource.entity.request.PageListProxyOperaterRequest;
|
||||
@ -64,7 +65,11 @@ public class ProxyOperaterController {
|
||||
return proxyOperaterService.basicInfo(proxyCode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "下拉菜单选项")
|
||||
@GetMapping("/option/list")
|
||||
@ApiOperationSupport(order = 5)
|
||||
public Result<List<Options>> optionList() {
|
||||
return proxyOperaterService.optionsList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.evotech.hd.resource.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.evotech.hd.common.core.Dto.Options;
|
||||
import com.evotech.hd.common.core.Dto.Result;
|
||||
import com.evotech.hd.common.core.entity.resource.ProxyOperater;
|
||||
import com.evotech.hd.resource.entity.request.PageListProxyOperaterRequest;
|
||||
@ -20,4 +21,6 @@ public interface ProxyOperaterService {
|
||||
public Result<List<ProxyOperater>> deviceList();
|
||||
|
||||
Result<ProxyOperater> basicInfo(String proxyCode);
|
||||
|
||||
public Result<List<Options>> optionsList();
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.evotech.hd.resource.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.evotech.hd.common.core.Dto.Options;
|
||||
import com.evotech.hd.common.core.Dto.Result;
|
||||
import com.evotech.hd.common.core.dao.resource.ProxyOperaterDao;
|
||||
import com.evotech.hd.common.core.entity.resource.ProxyOperater;
|
||||
@ -16,6 +17,7 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class ProxyOperaterServiceImpl implements ProxyOperaterService {
|
||||
@ -80,4 +82,11 @@ public class ProxyOperaterServiceImpl implements ProxyOperaterService {
|
||||
return new Result<ProxyOperater>().success(proxyOperaterDao.selectOne(new LambdaQueryWrapper<ProxyOperater>().eq(ProxyOperater::getPocode, proxyCode).select(ProxyOperater::getPkId, ProxyOperater::getPoname,ProxyOperater::getPocode), false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<Options>> optionsList() {
|
||||
return new Result<List<Options>>().success(proxyOperaterDao.selectList(new LambdaQueryWrapper<ProxyOperater>().select(ProxyOperater::getPoname, ProxyOperater::getPocode).eq(ProxyOperater::getDelFlag, 0)).stream().map(data->{
|
||||
return new Options(data.getPoname(), data.getPocode());
|
||||
}).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user