diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/CarCouponRecordController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/CarCouponRecordController.java new file mode 100644 index 000000000..30862e2ed --- /dev/null +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/CarCouponRecordController.java @@ -0,0 +1,98 @@ +package com.jsowell.web.controller.pile; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.jsowell.common.annotation.Log; +import com.jsowell.common.core.controller.BaseController; +import com.jsowell.common.core.domain.AjaxResult; +import com.jsowell.common.enums.BusinessType; +import com.jsowell.pile.domain.CarCouponRecord; +import com.jsowell.pile.service.CarCouponRecordService; +import com.jsowell.common.util.poi.ExcelUtil; +import com.jsowell.common.core.page.TableDataInfo; + +/** + * 车辆绑定优惠券记录Controller + * + * @author jsowell + * @date 2024-10-14 + */ +@RestController +@RequestMapping("/pile/couponRecord") +public class CarCouponRecordController extends BaseController { + @Autowired + private CarCouponRecordService carCouponRecordService; + + /** + * 查询车辆绑定优惠券记录列表 + */ + @PreAuthorize("@ss.hasPermi('pile:couponRecord:list')") + @GetMapping("/list") + public TableDataInfo list(CarCouponRecord carCouponRecord) { + startPage(); + List list = carCouponRecordService.selectCarCouponRecordList(carCouponRecord); + return getDataTable(list); + } + + /** + * 导出车辆绑定优惠券记录列表 + */ + @PreAuthorize("@ss.hasPermi('pile:couponRecord:export')") + @Log(title = "车辆绑定优惠券记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, CarCouponRecord carCouponRecord) { + List list = carCouponRecordService.selectCarCouponRecordList(carCouponRecord); + ExcelUtil util = new ExcelUtil(CarCouponRecord.class); + util.exportExcel(response, list, "车辆绑定优惠券记录数据"); + } + + /** + * 获取车辆绑定优惠券记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('pile:couponRecord:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(carCouponRecordService.selectCarCouponRecordById(id)); + } + + /** + * 新增车辆绑定优惠券记录 + */ + @PreAuthorize("@ss.hasPermi('pile:couponRecord:add')") + @Log(title = "车辆绑定优惠券记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CarCouponRecord carCouponRecord) { + return toAjax(carCouponRecordService.insertCarCouponRecord(carCouponRecord)); + } + + /** + * 修改车辆绑定优惠券记录 + */ + @PreAuthorize("@ss.hasPermi('pile:couponRecord:edit')") + @Log(title = "车辆绑定优惠券记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CarCouponRecord carCouponRecord) { + return toAjax(carCouponRecordService.updateCarCouponRecord(carCouponRecord)); + } + + /** + * 删除车辆绑定优惠券记录 + */ + @PreAuthorize("@ss.hasPermi('pile:couponRecord:remove')") + @Log(title = "车辆绑定优惠券记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(carCouponRecordService.deleteCarCouponRecordByIds(ids)); + } +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/CarCouponRecord.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/CarCouponRecord.java new file mode 100644 index 000000000..867c5bb4a --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/CarCouponRecord.java @@ -0,0 +1,126 @@ +package com.jsowell.pile.domain; + +import com.jsowell.common.annotation.Excel; +import com.jsowell.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 车辆绑定优惠券记录对象 car_coupon_record + * + * @author jsowell + * @date 2024-10-14 + */ +public class CarCouponRecord extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private Long id; + + /** + * 订单编号 + */ + @Excel(name = "订单编号") + private String orderCode; + + /** + * 站点id + */ + @Excel(name = "站点id") + private Long stationId; + + /** + * 车牌号码 + */ + @Excel(name = "车牌号码") + private String plateNumber; + + /** + * 绑定优惠券返回码 + */ + @Excel(name = "绑定优惠券返回码") + private String returnCode; + + /** + * 返回信息 + */ + @Excel(name = "返回信息") + private String returnMsg; + + /** + * 删除标识(0-否;1-是) + */ + private String delFlag; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setOrderCode(String orderCode) { + this.orderCode = orderCode; + } + + public String getOrderCode() { + return orderCode; + } + + public void setStationId(Long stationId) { + this.stationId = stationId; + } + + public Long getStationId() { + return stationId; + } + + public void setPlateNumber(String plateNumber) { + this.plateNumber = plateNumber; + } + + public String getPlateNumber() { + return plateNumber; + } + + public void setReturnCode(String returnCode) { + this.returnCode = returnCode; + } + + public String getReturnCode() { + return returnCode; + } + + public void setReturnMsg(String returnMsg) { + this.returnMsg = returnMsg; + } + + public String getReturnMsg() { + return returnMsg; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDelFlag() { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.JSON_STYLE) + .append("id", getId()) + .append("orderCode", getOrderCode()) + .append("stationId", getStationId()) + .append("plateNumber", getPlateNumber()) + .append("returnCode", getReturnCode()) + .append("returnMsg", getReturnMsg()) + .append("createTime", getCreateTime()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/CarCouponRecordMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/CarCouponRecordMapper.java new file mode 100644 index 000000000..214b0d501 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/CarCouponRecordMapper.java @@ -0,0 +1,63 @@ +package com.jsowell.pile.mapper; + +import java.util.List; + +import com.jsowell.pile.domain.CarCouponRecord; +import org.springframework.stereotype.Repository; + +/** + * 车辆绑定优惠券记录Mapper接口 + * + * @author jsowell + * @date 2024-10-14 + */ +@Repository +public interface CarCouponRecordMapper { + /** + * 查询车辆绑定优惠券记录 + * + * @param id 车辆绑定优惠券记录主键 + * @return 车辆绑定优惠券记录 + */ + public CarCouponRecord selectCarCouponRecordById(Long id); + + /** + * 查询车辆绑定优惠券记录列表 + * + * @param carCouponRecord 车辆绑定优惠券记录 + * @return 车辆绑定优惠券记录集合 + */ + public List selectCarCouponRecordList(CarCouponRecord carCouponRecord); + + /** + * 新增车辆绑定优惠券记录 + * + * @param carCouponRecord 车辆绑定优惠券记录 + * @return 结果 + */ + public int insertCarCouponRecord(CarCouponRecord carCouponRecord); + + /** + * 修改车辆绑定优惠券记录 + * + * @param carCouponRecord 车辆绑定优惠券记录 + * @return 结果 + */ + public int updateCarCouponRecord(CarCouponRecord carCouponRecord); + + /** + * 删除车辆绑定优惠券记录 + * + * @param id 车辆绑定优惠券记录主键 + * @return 结果 + */ + public int deleteCarCouponRecordById(Long id); + + /** + * 批量删除车辆绑定优惠券记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteCarCouponRecordByIds(Long[] ids); +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/CarCouponRecordService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/CarCouponRecordService.java new file mode 100644 index 000000000..11140dd84 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/CarCouponRecordService.java @@ -0,0 +1,61 @@ +package com.jsowell.pile.service; + +import java.util.List; + +import com.jsowell.pile.domain.CarCouponRecord; + +/** + * 车辆绑定优惠券记录Service接口 + * + * @author jsowell + * @date 2024-10-14 + */ +public interface CarCouponRecordService { + /** + * 查询车辆绑定优惠券记录 + * + * @param id 车辆绑定优惠券记录主键 + * @return 车辆绑定优惠券记录 + */ + public CarCouponRecord selectCarCouponRecordById(Long id); + + /** + * 查询车辆绑定优惠券记录列表 + * + * @param carCouponRecord 车辆绑定优惠券记录 + * @return 车辆绑定优惠券记录集合 + */ + public List selectCarCouponRecordList(CarCouponRecord carCouponRecord); + + /** + * 新增车辆绑定优惠券记录 + * + * @param carCouponRecord 车辆绑定优惠券记录 + * @return 结果 + */ + public int insertCarCouponRecord(CarCouponRecord carCouponRecord); + + /** + * 修改车辆绑定优惠券记录 + * + * @param carCouponRecord 车辆绑定优惠券记录 + * @return 结果 + */ + public int updateCarCouponRecord(CarCouponRecord carCouponRecord); + + /** + * 批量删除车辆绑定优惠券记录 + * + * @param ids 需要删除的车辆绑定优惠券记录主键集合 + * @return 结果 + */ + public int deleteCarCouponRecordByIds(Long[] ids); + + /** + * 删除车辆绑定优惠券记录信息 + * + * @param id 车辆绑定优惠券记录主键 + * @return 结果 + */ + public int deleteCarCouponRecordById(Long id); +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/CarCouponRecordServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/CarCouponRecordServiceImpl.java new file mode 100644 index 000000000..c7c80985f --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/CarCouponRecordServiceImpl.java @@ -0,0 +1,89 @@ +package com.jsowell.pile.service.impl; + +import java.util.List; + +import com.jsowell.common.util.DateUtils; +import com.jsowell.pile.service.CarCouponRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.jsowell.pile.mapper.CarCouponRecordMapper; +import com.jsowell.pile.domain.CarCouponRecord; + +/** + * 车辆绑定优惠券记录Service业务层处理 + * + * @author jsowell + * @date 2024-10-14 + */ +@Service +public class CarCouponRecordServiceImpl implements CarCouponRecordService { + @Autowired + private CarCouponRecordMapper carCouponRecordMapper; + + /** + * 查询车辆绑定优惠券记录 + * + * @param id 车辆绑定优惠券记录主键 + * @return 车辆绑定优惠券记录 + */ + @Override + public CarCouponRecord selectCarCouponRecordById(Long id) { + return carCouponRecordMapper.selectCarCouponRecordById(id); + } + + /** + * 查询车辆绑定优惠券记录列表 + * + * @param carCouponRecord 车辆绑定优惠券记录 + * @return 车辆绑定优惠券记录 + */ + @Override + public List selectCarCouponRecordList(CarCouponRecord carCouponRecord) { + return carCouponRecordMapper.selectCarCouponRecordList(carCouponRecord); + } + + /** + * 新增车辆绑定优惠券记录 + * + * @param carCouponRecord 车辆绑定优惠券记录 + * @return 结果 + */ + @Override + public int insertCarCouponRecord(CarCouponRecord carCouponRecord) { + carCouponRecord.setCreateTime(DateUtils.getNowDate()); + return carCouponRecordMapper.insertCarCouponRecord(carCouponRecord); + } + + /** + * 修改车辆绑定优惠券记录 + * + * @param carCouponRecord 车辆绑定优惠券记录 + * @return 结果 + */ + @Override + public int updateCarCouponRecord(CarCouponRecord carCouponRecord) { + return carCouponRecordMapper.updateCarCouponRecord(carCouponRecord); + } + + /** + * 批量删除车辆绑定优惠券记录 + * + * @param ids 需要删除的车辆绑定优惠券记录主键 + * @return 结果 + */ + @Override + public int deleteCarCouponRecordByIds(Long[] ids) { + return carCouponRecordMapper.deleteCarCouponRecordByIds(ids); + } + + /** + * 删除车辆绑定优惠券记录信息 + * + * @param id 车辆绑定优惠券记录主键 + * @return 结果 + */ + @Override + public int deleteCarCouponRecordById(Long id) { + return carCouponRecordMapper.deleteCarCouponRecordById(id); + } +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java index 649119a70..fffbf0bfc 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java @@ -4096,9 +4096,14 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService { vo.setEndSOC(orderVO.getEndSoc()); vo.setChargeTime(orderVO.getChargingTime()); vo.setChargeDegree(orderVO.getChargingDegree()); + vo.setSettleAmount(orderVO.getSettleAmount()); + vo.setPayMode(orderVO.getPayMode()); + vo.setMemberId(orderVO.getMemberId()); + return vo; } + @Override public List queryOrdersByPileConnectorCodeAndStatus(String pileConnectorCode, String orderStatus, String payStatus) { return orderBasicInfoMapper.queryOrdersByPileConnectorCodeAndStatus(pileConnectorCode, orderStatus, payStatus); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java index defbec06c..52d5eda9f 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java @@ -978,8 +978,8 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService { detailVO.setStartSOC(startSoc); detailVO.setEndSOC(endSoc); - detailVO.setChargeDegree(realTimeMonitorData.getChargingDegree()); - detailVO.setTimeRemaining(realTimeMonitorData.getTimeRemaining()); + detailVO.setChargeDegree(realTimeMonitorData.getChargingDegree()); // 充电度数 + detailVO.setTimeRemaining(realTimeMonitorData.getTimeRemaining()); // 剩余时长 } else if (StringUtils.equals(PileConnectorDataBaseStatusEnum.FAULT.getValue(), status)) { // 故障 // 查询故障原因 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/business/BusinessOrderDetailInfoVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/business/BusinessOrderDetailInfoVO.java index 9903d49b5..00e46aba4 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/business/BusinessOrderDetailInfoVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/business/BusinessOrderDetailInfoVO.java @@ -175,4 +175,14 @@ public class BusinessOrderDetailInfoVO { */ private String createTime; + /** + * 支付方式 + */ + private String payMode; + + /** + * 会员id + */ + private String memberId; + } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/OrderVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/OrderVO.java index 6cc2c8b3e..0b2bd1f6e 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/OrderVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/OrderVO.java @@ -146,4 +146,9 @@ public class OrderVO { * 订单创建时间 */ private String createTime; + + /** + * 会员id + */ + private String memberId; } diff --git a/jsowell-pile/src/main/resources/mapper/pile/CarCouponRecordMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/CarCouponRecordMapper.xml new file mode 100644 index 000000000..67bc1fb8e --- /dev/null +++ b/jsowell-pile/src/main/resources/mapper/pile/CarCouponRecordMapper.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + select id, order_code, station_id, plate_number, return_code, return_msg, create_time, del_flag from car_coupon_record + + + + + + + + insert into car_coupon_record + + order_code, + station_id, + plate_number, + return_code, + return_msg, + create_time, + del_flag, + + + #{orderCode}, + #{stationId}, + #{plateNumber}, + #{returnCode}, + #{returnMsg}, + #{createTime}, + #{delFlag}, + + + + + update car_coupon_record + + order_code = #{orderCode}, + station_id = #{stationId}, + plate_number = #{plateNumber}, + return_code = #{returnCode}, + return_msg = #{returnMsg}, + create_time = #{createTime}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from car_coupon_record where id = #{id} + + + + delete from car_coupon_record where id in + + #{id} + + + \ No newline at end of file diff --git a/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml index 6a4021cfd..23950ed16 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml @@ -2846,6 +2846,7 @@ t1.order_status AS orderStatus, t1.station_id AS stationId, t1.pile_sn AS pileSn, + t1.member_id as memberId, t1.connector_code AS connectorCode, t1.pile_connector_code AS pileConnectorCode, t1.pay_mode AS payMode,