diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcSmsServiceImpl.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcSmsServiceImpl.java index 38563c46..c4a99c13 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcSmsServiceImpl.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcSmsServiceImpl.java @@ -77,7 +77,9 @@ public class XhpcSmsServiceImpl implements IXhpcSmsService{ } String req = HttpUtils.postFormData(URL, null, assembleSmsReq(phone,content)); JSONObject json = JSONObject.parseObject(req); - xhpcSms.setCode(random); + if(!"".equals(random) && random !=null){ + xhpcSms.setCode(random); + } xhpcSms.setPhone(phone); xhpcSms.setContent(content); xhpcSms.setCreateTime(new Date()); @@ -103,7 +105,6 @@ public class XhpcSmsServiceImpl implements IXhpcSmsService{ } } - private static HashMap assembleSmsReq(String phone, String content) { HashMap params = new HashMap<>(); params.put("account", ACCOUNT); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcRealTimeOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcRealTimeOrderController.java index 33b0f73f..2b658c7c 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcRealTimeOrderController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcRealTimeOrderController.java @@ -1,14 +1,12 @@ package com.xhpc.order.controller; import com.xhpc.common.core.web.controller.BaseController; +import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; import com.xhpc.order.service.IXhpcRealTimeOrderService; import io.swagger.annotations.Api; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Map; @@ -33,19 +31,27 @@ public class XhpcRealTimeOrderController extends BaseController { * @param transactionNumber 订单编号 * @param source 用户类型 0C端用户 1流量用户 * @param chargingStationName 电站名称 - * @param name 运营商\流量方 + * @param terminalName 终端名称 + * @param operatorId 运营商 * @param startTime 订单开始时间 * @param endTime 订单结束时间 * @return */ @GetMapping("/list") - public TableDataInfo list(String phone,String transactionNumber,Integer source,String chargingStationName,String name,String startTime,String endTime) + public TableDataInfo list(String phone,String transactionNumber,Integer source,String chargingStationName,String terminalName,Long operatorId,String startTime,String endTime) { startPage(); - List> list = xhpcRealTimeOrderService.list(phone, transactionNumber, source, chargingStationName, name, startTime, endTime); + List> list = xhpcRealTimeOrderService.list(phone, transactionNumber, source, chargingStationName,terminalName, operatorId, startTime, endTime); return getDataTable(list); } - + /** + * 实时订单详情 + */ + @GetMapping("/message") + public AjaxResult message(@RequestParam Long realTimeOrderId) + { + return null; + } } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcRealTimeOrderMapper.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcRealTimeOrderMapper.java index a5ecc52f..11e89edd 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcRealTimeOrderMapper.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcRealTimeOrderMapper.java @@ -2,6 +2,7 @@ package com.xhpc.order.mapper; import com.xhpc.order.domain.XhpcChargeOrderSoc; import com.xhpc.order.domain.XhpcRealTimeOrder; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -34,11 +35,12 @@ public interface XhpcRealTimeOrderMapper { * @param transactionNumber 订单编号 * @param source 用户类型 0C端用户 1流量用户 * @param chargingStationName 电站名称 - * @param type 1 运营商 2流量方 - * @param id 运营商或流量方 id + * @param terminalName 终端名称 + * @param operatorId 运营商 * @param startTime 订单开始时间 * @param endTime 订单结束时间 + * @param type 0 都没有 1 phone 有 2 用户类型有 3 都有 * @return */ - List> list(String phone, String transactionNumber, Integer source, String chargingStationName, String type,Long id, String startTime, String endTime); + List> list(@Param("phone") String phone,@Param("transactionNumber") String transactionNumber,@Param("source") Integer source,@Param("chargingStationName") String chargingStationName,@Param("terminalName")String terminalName,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcRealTimeOrderService.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcRealTimeOrderService.java index f5ef7baa..86d5c62b 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcRealTimeOrderService.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcRealTimeOrderService.java @@ -19,16 +19,17 @@ public interface IXhpcRealTimeOrderService { /** * 实时订单接口 - * @param phone - * @param transactionNumber - * @param source - * @param chargingStationName - * @param name - * @param startTime - * @param endTime + * @param phone 用户账号 + * @param transactionNumber 订单编号 + * @param source 用户类型 0C端用户 1流量用户 + * @param chargingStationName 电站名称 + * @param terminalName 终端名称 + * @param operatorId 运营商 + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 * @return */ - List> list(String phone,String transactionNumber,Integer source,String chargingStationName,String name,String startTime,String endTime); + List> list(String phone,String transactionNumber,Integer source,String chargingStationName,String terminalName,Long operatorId,String startTime,String endTime); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java index 6b58971b..fa15c710 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java @@ -1,6 +1,7 @@ package com.xhpc.order.service.impl; import com.xhpc.common.redis.service.RedisService; +import com.xhpc.order.mapper.XhpcRealTimeOrderMapper; import com.xhpc.order.service.IXhpcRealTimeOrderService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -17,6 +18,9 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService { @Autowired private RedisService redisService; + @Autowired + private XhpcRealTimeOrderMapper xhpcRealTimeOrderMapper; + /** * 添加实时数据 @@ -42,18 +46,18 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService { } @Override - public List> list(String phone, String transactionNumber, Integer source, String chargingStationName, String name, String startTime, String endTime) { - - //当name不为空时,解析 - if(!"".equals(name) && name !=null){ + public List> list(String phone, String transactionNumber, Integer source, String chargingStationName, String terminalName, Long operatorId, String startTime, String endTime) { + Integer type =0; + if(!"".equals(phone) && phone!=null && !"".equals(source) && source !=null){ + type =3; + }else if (!"".equals(phone) && phone!=null){ + type =1; + }else{ + type =2; } - - - - - - return null; + return xhpcRealTimeOrderMapper.list(phone,transactionNumber,source,chargingStationName,terminalName,operatorId,startTime,endTime,type); } + } diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml index bd83e97b..87377fbc 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml @@ -201,6 +201,69 @@ \ No newline at end of file