Commit 75ecd16f by zhouhaibao

[+]订单模块修改

1 parent fa69bc24
...@@ -37,6 +37,14 @@ public class ChargingOrder { ...@@ -37,6 +37,14 @@ public class ChargingOrder {
@Schema(description = "枪号") @Schema(description = "枪号")
private Integer spearId; private Integer spearId;
/**
* 充电桩编码
*/
@Column(name = "pile_Id")
@Schema(description = "充电桩编码")
private String pileId;
/** /**
* accountid * accountid
*/ */
...@@ -125,6 +133,38 @@ public class ChargingOrder { ...@@ -125,6 +133,38 @@ public class ChargingOrder {
@Transient @Transient
private ChargingOrderMonitorinfo chargingOrderMonitorinfo; private ChargingOrderMonitorinfo chargingOrderMonitorinfo;
@Transient
@Schema(description = "桩名称")
private String stationName;
public String getPileId() {
return pileId;
}
@Transient
@Schema(description = "枪名称")
private String gunName;
public void setPileId(String pileId) {
this.pileId = pileId;
}
public String getStationName() {
return stationName;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public String getGunName() {
return gunName;
}
public void setGunName(String gunName) {
this.gunName = gunName;
}
public void setChargingOrderDetailList( public void setChargingOrderDetailList(
List<ChargingOrderDetail> chargingOrderDetailList) { List<ChargingOrderDetail> chargingOrderDetailList) {
this.chargingOrderDetailList = chargingOrderDetailList; this.chargingOrderDetailList = chargingOrderDetailList;
......
...@@ -20,6 +20,8 @@ import com.github.pagehelper.PageHelper; ...@@ -20,6 +20,8 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.glsx.plat.core.web.Result; import com.glsx.plat.core.web.Result;
import com.glsx.plat.exception.BusinessException; import com.glsx.plat.exception.BusinessException;
import com.glsx.plat.redis.service.GainIdService;
import java.util.Date;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -48,6 +50,9 @@ public class OrderService { ...@@ -48,6 +50,9 @@ public class OrderService {
@Autowired @Autowired
private ChargingGunService gunService; private ChargingGunService gunService;
@Autowired
private GainIdService gainIdService;
/** /**
* 创建待支付的订单(手动启动,刷卡|vin码启动) * 创建待支付的订单(手动启动,刷卡|vin码启动)
* *
...@@ -57,7 +62,7 @@ public class OrderService { ...@@ -57,7 +62,7 @@ public class OrderService {
// 1.判断用户是否存在未支付的订单 // 1.判断用户是否存在未支付的订单
// 2.创建订单号,交易流水号 // 2.创建订单号,交易流水号
String orderCode = "32010200000000111511161555350263"; String orderCode = gainIdService.globalUniqueId("320102000000");
// 3.启动充电桩 // 3.启动充电桩
StartBo startBo = new StartBo(); StartBo startBo = new StartBo();
startBo.setTransactionSerialNumber(orderCode); startBo.setTransactionSerialNumber(orderCode);
...@@ -110,6 +115,8 @@ public class OrderService { ...@@ -110,6 +115,8 @@ public class OrderService {
ChargingOrder chargingOrder = new ChargingOrder(); ChargingOrder chargingOrder = new ChargingOrder();
BeanUtils.copyProperties(orderCreateBO, chargingOrder); BeanUtils.copyProperties(orderCreateBO, chargingOrder);
chargingOrder.setOrderCode(orderCode); chargingOrder.setOrderCode(orderCode);
chargingOrder.setSpearId(orderCreateBO.getGunNumber());
chargingOrder.setCreatedTime(new Date());
chargingOrder.setOrderStatus((byte) 1); chargingOrder.setOrderStatus((byte) 1);
chargingOrderMapper.insert(chargingOrder); chargingOrderMapper.insert(chargingOrder);
} }
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
<result column="end_type" jdbcType="TINYINT" property="endType"/> <result column="end_type" jdbcType="TINYINT" property="endType"/>
<result column="total_degrees" jdbcType="REAL" property="totalDegrees"/> <result column="total_degrees" jdbcType="REAL" property="totalDegrees"/>
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/> <result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
<result column="stationName" jdbcType="VARCHAR" property="stationName"/>
<result column="gunName" jdbcType="VARCHAR" property="gunName"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!-- <!--
...@@ -32,19 +34,25 @@ ...@@ -32,19 +34,25 @@
<select id="selectList" resultMap="BaseResultMap"> <select id="selectList" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> t1.*,t3.name as stationName,t4.name as gunName
from charging_order from charging_order t1
left join charging_pile t2 on t1.pile_id=t2.pile_id
left join charging_station t3 on t3.id=t2.station_id
left join charging_gun t4 on (t1.pile_id=t4.pile_id and t1.spear_id=t4.gun_number)
<where> <where>
<if test="orderSearch.orderStatus != null"> <if test="orderSearch.orderStatus != null">
and order_status=#{orderSearch.orderStatus} and t1.order_status=#{orderSearch.orderStatus}
</if> </if>
</where> </where>
</select> </select>
<select id="findByOrderCode" resultMap="BaseResultMap"> <select id="findByOrderCode" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> t1.*,t3.name as stationName,t4.name as gunName
from charging_order from charging_order t1
left join charging_pile t2 on t1.pile_id=t2.pile_id
left join charging_station t3 on t3.id=t2.station_id
left join charging_gun t4 on (t1.pile_id=t4.pile_id and t1.spear_id=t4.gun_number)
where order_code=#{orderCode} where order_code=#{orderCode}
</select> </select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id" />
<result column="voltage" jdbcType="DOUBLE" property="voltage" /> <result column="voltage" jdbcType="DOUBLE" property="voltage" />
<result column="current" jdbcType="DOUBLE" property="current" /> <result column="current" jdbcType="DOUBLE" property="current" />
<result column="acc_time" jdbcType="TIMESTAMP" property="accTime" /> <result column="acc_time" jdbcType="INTEGER" property="accTime" />
<result column="degrees" jdbcType="DOUBLE" property="degrees" /> <result column="degrees" jdbcType="DOUBLE" property="degrees" />
<result column="charged_amount" jdbcType="DOUBLE" property="chargedAmount" /> <result column="charged_amount" jdbcType="DOUBLE" property="chargedAmount" />
<result column="order_code" jdbcType="VARCHAR" property="orderCode" /> <result column="order_code" jdbcType="VARCHAR" property="orderCode" />
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!