diff --git a/jsowell-admin/src/main/java/com/jsowell/service/AgentDevService.java b/jsowell-admin/src/main/java/com/jsowell/service/AgentDevService.java index 0544035cf..b44445943 100644 --- a/jsowell-admin/src/main/java/com/jsowell/service/AgentDevService.java +++ b/jsowell-admin/src/main/java/com/jsowell/service/AgentDevService.java @@ -116,11 +116,11 @@ public class AgentDevService { } String redisKey = CacheConstants.COMPONENT_VERIFY_TICKET + PLATFORM_APP_ID; // 查缓存,看是否已经过期 - String verifyTicket = redisCache.getCacheObject(redisKey); - if (verifyTicket != null) { - // 先删除旧缓存 - redisCache.deleteObject(redisKey); - } + // String verifyTicket = redisCache.getCacheObject(redisKey); + // if (verifyTicket != null) { + // // 先删除旧缓存 + // redisCache.deleteObject(redisKey); + // } // 存入Redis 过期时间: 官方12小时,但十分钟推送一次, 因此可设置 20 分钟过期 redisCache.setCacheObject(redisKey, componentVerifyTicket, 20, TimeUnit.MINUTES); String newVerifyTicket = redisCache.getCacheObject(redisKey); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderBasicInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderBasicInfoMapper.java index 237752026..fc317a4d3 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderBasicInfoMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderBasicInfoMapper.java @@ -159,6 +159,13 @@ public interface OrderBasicInfoMapper { */ List getIndexOrderInfo(@Param("dto") IndexQueryDTO dto); + /** + * 首页订单数据展示 V2 + * @param dto 首页信息查询dto + * @return + */ + List getIndexOrderInfoV2(@Param("dto") IndexQueryDTO dto); + /** * 获取超过15分钟的待支付状态订单 * @return @@ -225,4 +232,11 @@ public interface OrderBasicInfoMapper { * @return */ List queryOrderList(@Param("orderCodeList") List orderCodeList); + + /** + * 获取首页订单详情 + * @param orderCodeList + * @return + */ + IndexOrderInfoVO getIndexOrderDetail(@Param("list") List orderCodeList); } 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 770224b5d..575654382 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 @@ -1546,7 +1546,27 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService { } } dto.setStationIdList(stationIdList); - return orderBasicInfoMapper.getIndexOrderInfo(dto); + // return orderBasicInfoMapper.getIndexOrderInfo(dto); + List voList = orderBasicInfoMapper.getIndexOrderInfoV2(dto); + for (IndexOrderInfoVO indexOrderInfoVO : voList) { + String orderCodes = indexOrderInfoVO.getOrderCodes(); + // 获取到所有的订单号列表 + if (StringUtils.isBlank(orderCodes)) { + continue; + } + List orderCodeList = Arrays.asList(orderCodes.split(",")); + // 查询对应数据 + IndexOrderInfoVO detailInfo = orderBasicInfoMapper.getIndexOrderDetail(orderCodeList); + if (detailInfo == null) { + continue; + } + indexOrderInfoVO.setTotalSharpUsedElectricity(detailInfo.getTotalSharpUsedElectricity()); + indexOrderInfoVO.setTotalPeakUsedElectricity(detailInfo.getTotalPeakUsedElectricity()); + indexOrderInfoVO.setTotalFlatUsedElectricity(detailInfo.getTotalFlatUsedElectricity()); + indexOrderInfoVO.setTotalValleyUsedElectricity(detailInfo.getTotalValleyUsedElectricity()); + + } + return voList; } /** diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/IndexOrderInfoVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/IndexOrderInfoVO.java index 3b211ab7a..f5127e9ce 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/IndexOrderInfoVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/IndexOrderInfoVO.java @@ -15,6 +15,11 @@ public class IndexOrderInfoVO { */ private String date; + /** + * 订单号数组 + */ + private String orderCodes; + /** * 总用电量 */ diff --git a/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml index 8d4757998..f919ec412 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml @@ -40,7 +40,8 @@ - + @@ -156,49 +157,49 @@ del_flag - + SELECT t1.id as id, + t1.order_code as orderCode, + t1.transaction_code as transactionCode, + t1.order_status as orderStatus, + t1.member_id as memberId, + t2.nick_name as nickName, + t2.mobile_number as mobileNumber, + t1.station_id as stationId, + t3.station_name as stationName, + t1.pile_sn as pileSn, + t1.connector_code as connectorCode, + t1.logic_card as logicCard, + t1.vin_code as vinCode, + t1.start_mode as startMode, + t1.pay_mode as payMode, + t1.pay_status as payStatus, + t1.pay_amount as payAmount, + t1.pay_time as payTime, + t1.order_amount as orderAmount, + t1.virtual_amount as virtualAmount, + t1.settle_amount as settleAmount, + t1.start_soc as startSoc, + t1.end_soc as endSoc, + t1.charge_start_time as chargeStartTime, + t1.charge_end_time as chargeEndTime, + t1.create_time as createTime, + t4.total_used_electricity as chargingDegree, + t4.total_electricity_amount as totalElectricityAmount, + t4.total_service_amount as totalServiceAmount, + t5.payment_institutions as paymentInstitutions from order_basic_info t1 - left join member_basic_info t2 on t1.member_id = t2.member_id - join pile_station_info t3 on t1.station_id = t3.id - join order_detail t4 on t4.order_code = t1.order_code - left join member_transaction_record t5 on t5.order_code = t1.order_code and action_type = 'forward' + left join member_basic_info t2 on t1.member_id = t2.member_id + join pile_station_info t3 on t1.station_id = t3.id + join order_detail t4 on t4.order_code = t1.order_code + left join member_transaction_record t5 on t5.order_code = t1.order_code and action_type = 'forward' where t1.del_flag = '0' - and t1.pile_sn = #{pileSn,jdbcType=VARCHAR} + and t1.pile_sn = #{pileSn,jdbcType=VARCHAR} - and t1.connector_code = #{connectorCode,jdbcType=VARCHAR} + and t1.connector_code = #{connectorCode,jdbcType=VARCHAR} and t1.member_id = #{memberId,jdbcType=VARCHAR} @@ -234,12 +235,12 @@ and t1.merchant_id = #{merchantId,jdbcType=VARCHAR} - - - - - - + + + + + + and t3.dept_id in @@ -297,7 +298,8 @@ where a.id = #{id} - + insert into order_basic_info @@ -629,20 +631,30 @@ - insert into order_detail(id, order_code, total_used_electricity, total_order_amount, total_electricity_amount,total_service_amount, - sharp_price, sharp_used_electricity, sharp_electricity_price, sharp_service_price, sharp_amount, - peak_price, peak_used_electricity, peak_electricity_price, peak_service_price, peak_amount, - flat_price, flat_used_electricity, flat_electricity_price, flat_service_price, flat_amount, - valley_price, valley_used_electricity, valley_electricity_price, valley_service_price, valley_amount, - create_by,update_by) + insert into order_detail(id, order_code, total_used_electricity, total_order_amount, total_electricity_amount, + total_service_amount, + sharp_price, sharp_used_electricity, sharp_electricity_price, sharp_service_price, + sharp_amount, + peak_price, peak_used_electricity, peak_electricity_price, peak_service_price, + peak_amount, + flat_price, flat_used_electricity, flat_electricity_price, flat_service_price, + flat_amount, + valley_price, valley_used_electricity, valley_electricity_price, valley_service_price, + valley_amount, + create_by, update_by) values - (#{item.id}, #{item.orderCode}, #{item.totalUsedElectricity}, #{item.totalOrderAmount}, #{item.totalElectricityAmount}, #{item.totalServiceAmount}, - #{item.sharpPrice}, #{item.sharpUsedElectricity}, #{item.sharpElectricityPrice}, #{item.sharpServicePrice}, #{item.sharpAmount}, - #{item.peakPrice}, #{item.peakUsedElectricity}, #{item.peakElectricityPrice}, #{item.peakServicePrice}, #{item.peakAmount}, - #{item.flatPrice}, #{item.flatUsedElectricity}, #{item.flatElectricityPrice}, #{item.flatServicePrice}, #{item.flatAmount}, - #{item.valleyPrice}, #{item.valleyUsedElectricity}, #{item.valleyElectricityPrice}, #{item.valleyServicePrice}, #{item.valleyAmount}, - #{item.createBy}, #{item.updateBy}) + (#{item.id}, #{item.orderCode}, #{item.totalUsedElectricity}, #{item.totalOrderAmount}, + #{item.totalElectricityAmount}, #{item.totalServiceAmount}, + #{item.sharpPrice}, #{item.sharpUsedElectricity}, #{item.sharpElectricityPrice}, #{item.sharpServicePrice}, + #{item.sharpAmount}, + #{item.peakPrice}, #{item.peakUsedElectricity}, #{item.peakElectricityPrice}, #{item.peakServicePrice}, + #{item.peakAmount}, + #{item.flatPrice}, #{item.flatUsedElectricity}, #{item.flatElectricityPrice}, #{item.flatServicePrice}, + #{item.flatAmount}, + #{item.valleyPrice}, #{item.valleyUsedElectricity}, #{item.valleyElectricityPrice}, + #{item.valleyServicePrice}, #{item.valleyAmount}, + #{item.createBy}, #{item.updateBy}) @@ -753,7 +765,7 @@ from order_basic_info where del_flag = '0' - and transaction_code = #{transactionCode,jdbcType=VARCHAR} + and transaction_code = #{transactionCode,jdbcType=VARCHAR} @@ -773,33 +785,32 @@ from order_detail where del_flag = '0' - and order_code = #{orderCode,jdbcType=VARCHAR} + and order_code = #{orderCode,jdbcType=VARCHAR} - update order_basic_info set order_status = #{orderStatus,jdbcType=VARCHAR} + update order_basic_info + set order_status = #{orderStatus,jdbcType=VARCHAR} where del_flag = '0' - and order_code = #{orderCode,jdbcType=VARCHAR} + and order_code = #{orderCode,jdbcType=VARCHAR} - update order_basic_info set order_status = #{orderStatus,jdbcType=VARCHAR} + update order_basic_info + set order_status = #{orderStatus,jdbcType=VARCHAR} where del_flag = '0' - and id in - + and id in + #{orderId,jdbcType=VARCHAR} @@ -933,23 +941,20 @@ @@ -1023,22 +1023,22 @@ - - when id=#{item.id} then #{item.totalElectricityAmount} + + when id = #{item.id} then #{item.totalElectricityAmount} - - when id=#{item.id} then #{item.totalServiceAmount} + + when id = #{item.id} then #{item.totalServiceAmount} where - - id=#{i.id} + + id = #{i.id} @@ -1047,56 +1047,52 @@ from order_detail where del_flag = '0' - and order_code in + and order_code in #{item,jdbcType=VARCHAR} select - + from order_basic_info where del_flag = '0' - and order_code in + and order_code in #{item,jdbcType=VARCHAR} + + + + \ No newline at end of file