From 14531257947436b5d462b6f264c73ceac071161c Mon Sep 17 00:00:00 2001 From: "2265829957@qq.com" <2265829957@qq.com> Date: Wed, 26 Mar 2025 11:10:57 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=91=E5=90=8D=E5=8D=95=E5=92=8C=E5=B0=8F?= =?UTF-8?q?=E4=BA=8E250=E7=94=B5=E5=8E=8B=E5=81=9C=E6=AD=A2=E5=85=85?= =?UTF-8?q?=E7=94=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CDConnectorChargeStatusInfoTask.java | 2 +- ...NotificationEquipmentV2GPowerInfoTask.java | 2 +- .../NotificationCancelOrderTask.java | 2 +- .../NotificationChargeOrderInfoTask.java | 2 +- .../NotificationEquipChargeStatusTask.java | 2 +- .../NotificationStartChargeResultTask.java | 2 +- .../NotificationStationStatusTask.java | 2 +- .../NotificationStopChargeResultTask.java | 2 +- .../xhpc/auth/controller/TokenController.java | 4 +- .../resources/mapper/system/SysRoleMapper.xml | 2 +- .../resources/mapper/system/SysUserMapper.xml | 2 +- sql/ry_config_20210531.sql | 14 +-- .../XhpcClearingHistoryOrderMapper.java | 2 + .../impl/XhpcClearingCheckoutServiceImpl.java | 19 ++- .../XhpcClearingHistoryOrderServiceImpl.java | 26 ++-- .../mapper/XhpcClearingHistoryOrderMapper.xml | 57 +++++++++ .../xhpc/order/domain/XhpcHistoryOrder.java | 12 ++ .../controller/XhpcFileController.java | 4 +- .../general/service/XhpcSmsServiceImpl.java | 4 +- .../com/xhpc/general/util/sms/SmsUtil.java | 4 +- .../order/api/XhpcPileOrderController.java | 10 ++ .../controller/XhpcStatisticsController.java | 17 +++ .../mapper/XhpcStatisticsServiceMapper.java | 4 + .../order/service/IXhpcStatisticsService.java | 8 ++ .../impl/XhpcChargeOrderServiceImpl.java | 48 ++++--- .../impl/XhpcRealTimeOrderServiceImpl.java | 8 ++ .../impl/XhpcStatisticsServiceImpl.java | 76 +++++++++++ .../mapper/XhpcChargeOrderMapper.xml | 2 +- .../resources/mapper/XhpcStatisticsMapper.xml | 46 +++++++ .../controller/WxPaymentController.java | 11 +- .../mapper/XhpcRefundAuditMapper.xml | 2 +- .../mapper/XhpcRefundOriginalOrderMapper.xml | 14 +-- .../pp/controller/ChargingController.java | 9 +- .../pp/mapper/XhpcDeviceMessageMapper.java | 3 +- .../java/com/xhpc/pp/server/HBCheckTask.java | 51 +++++--- .../mapper/XhpcDeviceMessageMapper.xml | 18 +++ .../user/domain/AllInvoiceOrdersResponse.java | 10 ++ .../xhpc/user/domain/SpecificInvoiceWrap.java | 10 ++ .../com/xhpc/user/domain/XhpcCustomers.java | 2 +- .../user/mapper/XhpcHistoryOrderMapper.java | 6 + .../java/com/xhpc/user/pojo/XhpcInvoice.java | 13 ++ .../service/impl/XhpcInvoiceServiceImpl.java | 119 +++++++++++++++++- .../src/main/resources/bootstrap.yml | 6 +- .../resources/mapper/XhpcCommonMapper.xml | 14 +-- .../resources/mapper/XhpcCustomersMapper.xml | 8 ++ .../mapper/XhpcHistoryOrderMapper.xml | 56 ++++++++- .../resources/mapper/XhpcInvoiceMapper.xml | 103 ++++++++++----- .../resources/mapper/XhpcOperatorMapper.xml | 2 +- .../main/resources/mapper/XhpcUserMapper.xml | 2 +- .../mapper/XhpcUserVehicleMapper.xml | 5 +- 50 files changed, 706 insertions(+), 143 deletions(-) diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDConnectorChargeStatusInfoTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDConnectorChargeStatusInfoTask.java index f64efc40..c3a96174 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDConnectorChargeStatusInfoTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDConnectorChargeStatusInfoTask.java @@ -44,7 +44,7 @@ public class CDConnectorChargeStatusInfoTask extends CoreDispatcher { * 设备充电中状态变化推送(我们平台推送成都市平台) --已推送 * 实时数据没40秒 */ - //@Scheduled(fixedDelay = 1000 * 40) + // @Scheduled(fixedDelay = 1000 * 40) public void run() throws Exception{ List longList =new ArrayList<>(); diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationEquipmentV2GPowerInfoTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationEquipmentV2GPowerInfoTask.java index 7ad74987..9ada265a 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationEquipmentV2GPowerInfoTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationEquipmentV2GPowerInfoTask.java @@ -46,7 +46,7 @@ public class CDNotificationEquipmentV2GPowerInfoTask extends CoreDispatcher { private final Logger logger = LoggerFactory.getLogger(CDNotificationEquipmentV2GPowerInfoTask.class); //9099开放定时任务 9009不开放 - //@Scheduled(cron = "0 0/1 * * * ? ") + //@Scheduled(cron = "0 0/1 * * * ? ") public void run() throws IOException { //不参与合作的电站 List xhpcStationInternetBlacklist =xhpcStationInternetBlacklistRepo.findByInternetUserId(6L); diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationCancelOrderTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationCancelOrderTask.java index ab2a8dbc..01274b17 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationCancelOrderTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationCancelOrderTask.java @@ -32,7 +32,7 @@ public class NotificationCancelOrderTask extends CoreDispatcher { //推送不开放(evcs 放开) //9009开放定时任务 9099不开放 - @Scheduled(fixedRate = 1000 * 15) + //@Scheduled(fixedRate = 1000 * 15) public void run() throws JsonProcessingException { //Getting the orders, which need to be notified. diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java index 9e1cbb02..335760ec 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java @@ -40,7 +40,7 @@ public class NotificationChargeOrderInfoTask extends CoreDispatcher { private final Logger logger = LoggerFactory.getLogger(NotificationChargeOrderInfoTask.class); //推送不开放(evcs 放开) //9009开放定时任务 9099不开放 - @Scheduled(fixedRate = 1000 * 15) + //@Scheduled(fixedRate = 1000 * 15) public void run() throws JsonProcessingException { Collection orderKeys = REDIS.keys("order:*"); diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationEquipChargeStatusTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationEquipChargeStatusTask.java index f2b68678..1fbb9ed3 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationEquipChargeStatusTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationEquipChargeStatusTask.java @@ -50,7 +50,7 @@ public class NotificationEquipChargeStatusTask extends CoreDispatcher { */ //推送不开放 //9009开放定时任务 9099不开放 - @Scheduled(fixedRate = 1000 * 30) + //@Scheduled(fixedRate = 1000 * 30) public void run() throws IOException { List authSecretTokenOutList = authSecretTokenRepository.findBySecretTokenType(SECRET_TOKEN_TYPE_OUT); diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStartChargeResultTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStartChargeResultTask.java index 8d2e4818..ebc952ea 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStartChargeResultTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStartChargeResultTask.java @@ -35,7 +35,7 @@ public class NotificationStartChargeResultTask extends CoreDispatcher { */ //(evcs 放开 30 秒, 测试平台开放 15秒) //9009开放定时任务 9099不开放 - @Scheduled(fixedRate = 1000 * 15) + //@Scheduled(fixedRate = 1000 * 15) public void run() throws IOException { //Getting the charge orders which from 3rd. diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStationStatusTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStationStatusTask.java index 17ec2527..37cd0ad9 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStationStatusTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStationStatusTask.java @@ -51,7 +51,7 @@ public class NotificationStationStatusTask extends CoreDispatcher { //推送不开放(evcs 放开) //9009开放定时任务 9099不开放 - @Scheduled(fixedRate = 1000 * 45) + //@Scheduled(fixedRate = 1000 * 45) protected void run() throws IOException { Collection stationTerminalKeys = REDIS.keys("stationTerminalStatus:*"); diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStopChargeResultTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStopChargeResultTask.java index d5801638..f17b6bbc 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStopChargeResultTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStopChargeResultTask.java @@ -28,7 +28,7 @@ public class NotificationStopChargeResultTask extends CoreDispatcher { //(evcs 放开) //9009开放定时任务 9099不开放 - @Scheduled(fixedRate = 1000 * 3) + //@Scheduled(fixedRate = 1000 * 3) public void run() throws Exception { notifyService(); diff --git a/ruoyi-auth/src/main/java/com/xhpc/auth/controller/TokenController.java b/ruoyi-auth/src/main/java/com/xhpc/auth/controller/TokenController.java index 33ada4d2..28f64f1f 100644 --- a/ruoyi-auth/src/main/java/com/xhpc/auth/controller/TokenController.java +++ b/ruoyi-auth/src/main/java/com/xhpc/auth/controller/TokenController.java @@ -48,8 +48,8 @@ public class TokenController extends BaseController public static final String ACCOUNT ="scxhkj"; public static final String PASSWD ="6A9628548C4CBECCE80A2479CD77679F"; public static final String PRODUCTLD ="20191130000001"; - public static final String accessKeyId = "LTAI5t7vcQMfZPEZQkEdrAjx"; - public static final String accessKeySecret = "K7ZstCZoAjvJsBCe0CipodINETuPyi"; + public static final String accessKeyId = "LTAI5tHxc8hrG6cT5nDtEkiV"; + public static final String accessKeySecret = "5kFEaIFE7eeODxKQwD5mvTRF48MK6w"; /** * 平台管理员登陆 * @param form diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml index 35bb74ec..e8fea45e 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml @@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and date_format(r.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') - order by r.role_sort + order by r.create_time desc - where u.user_name = #{userName} and u.tenant_id =#{tenantId} + where u.user_name = #{userName} and u.tenant_id =#{tenantId} and u.del_flag =0 + select history_order_id historyOrderId from xhpc_history_order where charge_order_id=#{chargeOrderId} limit 1 + + + diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java index 6b688be4..6ac99a89 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java @@ -493,21 +493,20 @@ public class WxPaymentController { } String key = "user:" + xhpcRechargeOrder.getUserId() + userType + ".order"; + Map cacheMap = redisService.getCacheMap(key); //判断用户是否在充电中 String serialMumberA = xhpcUserAccountStatementMapper.getUserHistotyChargeOrderSuncha(xhpcRechargeOrder.getUserId(),source,tenantId,1); if(!"".equals(serialMumberA) && serialMumberA !=null){ //充电中 - Map mapA = new HashMap<>(); - map.put("aBalance", aBalance); - redisService.setCacheMap(key,mapA); + cacheMap.put("aBalance", aBalance.multiply(new BigDecimal(100))); + redisService.setCacheMap(key,cacheMap); postRefreshBalance(aBalance, serialMumberA); } String serialMumberB = xhpcUserAccountStatementMapper.getUserHistotyChargeOrderSuncha(xhpcRechargeOrder.getUserId(),source,tenantId,2); if(!"".equals(serialMumberB) && serialMumberB !=null){ //充电中 - Map mapA = new HashMap<>(); - map.put("bBalance", bBalance); - redisService.setCacheMap(key,mapA); + cacheMap.put("bBalance", bBalance.multiply(new BigDecimal(100))); + redisService.setCacheMap(key,cacheMap); postRefreshBalance(bBalance, serialMumberB); } diff --git a/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundAuditMapper.xml b/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundAuditMapper.xml index 8d5be9be..3e69cdfc 100644 --- a/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundAuditMapper.xml +++ b/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundAuditMapper.xml @@ -149,7 +149,7 @@ xau.tenant_id tenantId, xau.soc_protect socProtect, ten.status tenantStatus, - (select vehicle_name as vehicleName from xhpc_user_vehicle where app_user_id = xau.app_internet_user_id and source=1 and del_flag=0 and vin_blacklist !=1 order by type,create_time desc LIMIT 1) as vehicleName, + (select vehicle_name as vehicleName from xhpc_user_vehicle where app_user_id = xau.app_internet_user_id and source=1 and del_flag=0 and vin_blacklist !=1 order by type desc,create_time desc LIMIT 1) as vehicleName, xau.create_time as createTime from xhpc_app_internet_user xau left join xhpc_tenant ten on ten.tenant_id = xau.tenant_id and ten.is_deleted =0 diff --git a/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundOriginalOrderMapper.xml b/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundOriginalOrderMapper.xml index a7e455c3..41c20af6 100644 --- a/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundOriginalOrderMapper.xml +++ b/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundOriginalOrderMapper.xml @@ -326,12 +326,12 @@ @@ -361,7 +361,7 @@ update_by updateBy, remark remark, tenant_id tenantId, - refund_fee refundFee, + IFNULL(sum(refund_fee),0) refundFee, refund_status refundStatus from xhpc_recharge_order xro where xro.user_id =#{userId} and xro.source=#{source} and refund_status !=2 and create_time < #{createTime} diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java index 4df4cab6..7417efc7 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java @@ -554,8 +554,8 @@ public class ChargingController { // Integer F03 = HexUtils.reverseHexInt("03"); // System.out.println("F03 转化成="+F03); // -// Integer D3C0F = HexUtils.reverseHexInt("3C0F"); -// System.out.println("3C0F 转化成="+D3C0F); + Integer D3C0F = HexUtils.reverseHexInt("385A"); + System.out.println("3C0F 转化成="+D3C0F); // // Integer f4C1D = HexUtils.reverseHexInt("4C1D"); // System.out.println("f4C1D 转化成="+f4C1D); @@ -598,9 +598,10 @@ public class ChargingController { // // System.out.println("-111-变为--:" + s1); - String ascii = HexUtils.toAscii("4C465A3733464C34374E44303032343535"); +// String ascii = HexUtils.toAscii("828dcc2624042615"); +// System.out.println("ascii :"+ascii); + - System.out.println("ascii :"+ascii); } } diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/mapper/XhpcDeviceMessageMapper.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/mapper/XhpcDeviceMessageMapper.java index d1877073..1284f133 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/mapper/XhpcDeviceMessageMapper.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/mapper/XhpcDeviceMessageMapper.java @@ -14,7 +14,8 @@ public interface XhpcDeviceMessageMapper { int insertByDomain(XhpcDeviceMessage xhpcDeviceMessage); - + //桩离线统计 + int insertChargingPileStatus(@Param("serialNumber") String serialNumber,@Param("pileSerialNumber") String pileSerialNumber,@Param("stationId")String stationId,@Param("statusName")String statusName); void deleteByLastThreeMonth(String expireDate); XhpcChargingPile getXhpcChargingPile(@Param("pileNo") String pileNo); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/HBCheckTask.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/HBCheckTask.java index 92d8bd77..ccaa9839 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/HBCheckTask.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/HBCheckTask.java @@ -25,7 +25,7 @@ public class HBCheckTask { XhpcDeviceMessageMapper deviceMessageMapper; //每5分钟执行一次 - //@Scheduled(cron = "0 0/5 * * * ?") + @Scheduled(cron = "0 0/10 * * * ?") protected void run() { String svcSrvKey = "svcSrvGuns:".concat(getLocalIPAndPort()); @@ -37,22 +37,33 @@ public class HBCheckTask { hbtime = hbtime == null ? 0 : hbtime; if ((now - hbtime) > 75000) { String pileId = StrUtil.sub(gunkey.substring(gunkey.lastIndexOf(":") + 1), 0, -2); -// System.out.println("================充电桩心跳掉线==========pileId========"+pileId); -// System.out.println("================充电桩心跳掉线==========pileId========"+pileId); -// if (!DISCONNECTED.equals(cacheGun.get("status"))) { -// cacheGun.put("statusInt", OFF_LINE); -// cacheGun.put("status", DISCONNECTED); -// REDIS.setCacheMap(gunkey, cacheGun); -// -// XhpcDeviceMessage deviceMessage = new XhpcDeviceMessage(); -// deviceMessage.setType(StationDeviceEnum.PILE.getCode()); -// -// String pileId = StrUtil.sub(gunkey.substring(gunkey.lastIndexOf(":") + 1), 0, -2); -// deviceMessage.setSerialNumber(pileId); -// deviceMessage.setStatus(0); -// deviceMessage.setRemark("充电桩心跳掉线"); -// deviceMessageMapper.insertByDomain(deviceMessage); -// } + if (DISCONNECTED.equals(cacheGun.get("status"))) { + cacheGun.put("statusInt", OFF_LINE); + cacheGun.put("status", DISCONNECTED); + REDIS.setCacheMap(gunkey, cacheGun); + XhpcDeviceMessage deviceMessage = new XhpcDeviceMessage(); + deviceMessage.setType(StationDeviceEnum.PILE.getCode()); + //String pileId = StrUtil.sub(gunkey.substring(gunkey.lastIndexOf(":") + 1), 0, -2); + deviceMessage.setSerialNumber(pileId); + deviceMessage.setStatus(0); + deviceMessage.setRemark("充电桩心跳掉线"); + deviceMessageMapper.insertByDomain(deviceMessage); + try{ + String pkey = "pile:".concat(pileId); + Map cachePile = REDIS.getCacheMap(pkey); + String stationId = cachePile.get("stationId").toString(); + System.out.println("================gunkey===="+gunkey+"======pileId========"+pileId+"========stationId==="+stationId); + if(1==Integer.parseInt(gunkey.substring(gunkey.length() - 1))){ + deviceMessageMapper.insertChargingPileStatus(gunkey.substring(gunkey.lastIndexOf(":") + 1),pileId,stationId,"A枪"); + }else{ + deviceMessageMapper.insertChargingPileStatus(gunkey.substring(gunkey.lastIndexOf(":") + 1),pileId,stationId,"B枪"); + } + + }catch (Exception e){ + e.printStackTrace(); + } + + } } } } @@ -61,8 +72,12 @@ public class HBCheckTask { long time = new Date().getTime(); + String st = "gun:8083600040000102"; - System.out.println("time "); + String substring = st.substring(st.length() - 1); + + + System.out.println("substring "+substring); } diff --git a/xhpc-modules/xhpc-power-pile/src/main/resources/mapper/XhpcDeviceMessageMapper.xml b/xhpc-modules/xhpc-power-pile/src/main/resources/mapper/XhpcDeviceMessageMapper.xml index 33192667..9e158c3e 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/resources/mapper/XhpcDeviceMessageMapper.xml +++ b/xhpc-modules/xhpc-power-pile/src/main/resources/mapper/XhpcDeviceMessageMapper.xml @@ -86,6 +86,24 @@ ) + + insert into xhpc_charging_pile_status( + serial_number, + pile_serial_number, + station_id, + status_name, + create_time, + update_time + )values( + #{serialNumber}, + #{pileSerialNumber}, + #{stationId}, + #{statusName}, + sysdate(), + sysdate() + ) + + delete from xhpc_message where create_time #{expireDate}; diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/AllInvoiceOrdersResponse.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/AllInvoiceOrdersResponse.java index 58299a97..0df93aef 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/AllInvoiceOrdersResponse.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/AllInvoiceOrdersResponse.java @@ -93,6 +93,16 @@ public class AllInvoiceOrdersResponse { */ @JsonProperty("drawer") private String drawer; + /** + * 订单所属运营商 + */ + @JsonProperty("orderOperatorName") + private String orderOperatorName; + /** + * 开票运营商 + */ + @JsonProperty("invoiceOperatorName") + private String invoiceOperatorName; } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/SpecificInvoiceWrap.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/SpecificInvoiceWrap.java index ef191c91..1db4aef0 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/SpecificInvoiceWrap.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/SpecificInvoiceWrap.java @@ -138,6 +138,16 @@ public class SpecificInvoiceWrap { */ @JsonProperty("drawer") private String drawer; + /** + * 订单所属运营商 + */ + @JsonProperty("orderOperatorName") + private String orderOperatorName; + /** + * 开票运营商 + */ + @JsonProperty("invoiceOperatorName") + private String invoiceOperatorName; /** * 该发票所包含的历史订单的开始时间-结束时间 */ diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcCustomers.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcCustomers.java index 6b6b55f9..6a60f54c 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcCustomers.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcCustomers.java @@ -34,7 +34,7 @@ public class XhpcCustomers extends BaseEntity { * 服务费优惠比例 */ private Double servicePreferential; - + private Integer minLimit; /** * 联系人 */ diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcHistoryOrderMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcHistoryOrderMapper.java index f9d3233d..38a3e95e 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcHistoryOrderMapper.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcHistoryOrderMapper.java @@ -51,4 +51,10 @@ public interface XhpcHistoryOrderMapper { */ List findById(List historyOrderIds); + + List> countOperatorOnHistoryOrderIds(@Param("historyOrderIds")List historyOrderIds); + + List> findHistoryOrderIds(@Param("historyOrderIds")List historyOrderIds,@Param("operatorId")Long operatorId); + + } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/pojo/XhpcInvoice.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/pojo/XhpcInvoice.java index 34232ee9..bdd36fc7 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/pojo/XhpcInvoice.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/pojo/XhpcInvoice.java @@ -164,6 +164,19 @@ public class XhpcInvoice implements Serializable { //0增值税普通发票 1增值税专用发票 private Integer invoiceStatus; + /** + * 充电订单运营商id + */ + private Long orderOperatorId; + /** + * 开票运营商id + */ + private Long invoiceOperatorId; + + private String orderOperatorName; + + private String invoiceOperatorName; + private static final long serialVersionUID = 1L; } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcInvoiceServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcInvoiceServiceImpl.java index c2888824..e0b19ff0 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcInvoiceServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcInvoiceServiceImpl.java @@ -97,6 +97,8 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { itemsDTO.setCreatorType(xhpcInvoice.getCreatorType()); itemsDTO.setInvoiceMoney(xhpcInvoice.getInvoiceMoney()); itemsDTO.setStatus(xhpcInvoice.getStatus()); + itemsDTO.setOrderOperatorName(xhpcInvoice.getOrderOperatorName()); + itemsDTO.setInvoiceOperatorName(xhpcInvoice.getInvoiceOperatorName()); itemsDTO.setCreateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getCreateTime())); if (xhpcInvoice.getInvoicingTime() != null) { itemsDTO.setInvoicingTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getInvoicingTime())); @@ -229,6 +231,8 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { InvoiceTitleResponse invoiceTitleResponse = new InvoiceTitleResponse(); //如果没有记录,则返回空包装类 if (xhpcInvoiceList.size() == 0) { + ArrayList dataDTOList = new ArrayList<>(); + invoiceTitleResponse.setData(dataDTOList); return invoiceTitleResponse; } ArrayList dataDTOList = new ArrayList<>(); @@ -560,11 +564,8 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { * @date 2021/12/28 14:33 * @since version-1.0 */ - @Override @Transactional(rollbackFor = Exception.class) - public void saveInvoiceInfo(SaveInvoiceInfoRequest saveInvoiceInfoRequest) throws Exception { - - //System.out.println("<<<<<<<<<<111<<<<<<<<发票>>>>>>>>>>111>>>>>>>>"+saveInvoiceInfoRequest.toString()); + public void saveInvoiceInfoYu(SaveInvoiceInfoRequest saveInvoiceInfoRequest) throws Exception { //判断传入的历史订单是否被其他发票包含 List historyOrderIds = saveInvoiceInfoRequest.getHistoryOrderIds(); List lockOrderList = xhpcInvoiceMapHistoryOrderMapper.getLockedOnesByHistoryOrderId(historyOrderIds); @@ -643,6 +644,116 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { } + + + /** + * 将用户申请的发票信息,保存到数据库中 + * + * @param saveInvoiceInfoRequest 发票信息 + * @throws Exception 传入发票金额参数与内部该发票所包含的所有订单金额参数不一致出现,出现此异常 + * @author WH + * @date 2021/12/28 14:33 + * @since version-1.0 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void saveInvoiceInfo(SaveInvoiceInfoRequest saveInvoiceInfoRequest) throws Exception { + //判断传入的历史订单是否被其他发票包含 + List historyOrderIds = saveInvoiceInfoRequest.getHistoryOrderIds(); + List lockOrderList = xhpcInvoiceMapHistoryOrderMapper.getLockedOnesByHistoryOrderId(historyOrderIds); + if (lockOrderList.size() > 0) { + throw new Exception("该历史订单已被其他发票包含"); + } + + List> operatorIdList = xhpcHistoryOrderMapper.countOperatorOnHistoryOrderIds(historyOrderIds); + //该变量是用来计算内部存储的历史订单金额是否与传入的一致 + double totalActPrice = 0; + for (int i = 0; i stringObjectMap = operatorIdList.get(i); + Long operatorId = Long.valueOf(stringObjectMap.get("operatorId").toString()); + + //将该发票记录放入数据库生成发票记录,除了所包含的历史订单的总电费,总服务费 + XhpcInvoice xhpcInvoice = new XhpcInvoice(); + xhpcInvoice.setReceiveEmail(saveInvoiceInfoRequest.getReceiveEmail()); + xhpcInvoice.setTitleType(saveInvoiceInfoRequest.getTitleType()); + xhpcInvoice.setTitleContent(saveInvoiceInfoRequest.getTitleContent()); + xhpcInvoice.setDutyNumber(saveInvoiceInfoRequest.getDutyNumber()); + xhpcInvoice.setInvoiceContent(saveInvoiceInfoRequest.getInvoiceContent()); + xhpcInvoice.setFirmAddress(saveInvoiceInfoRequest.getFirmAddress()); + xhpcInvoice.setFirmPhone(saveInvoiceInfoRequest.getFirmPhone()); + xhpcInvoice.setFirmBank(saveInvoiceInfoRequest.getFirmBank()); + xhpcInvoice.setFirmBankAccount(saveInvoiceInfoRequest.getFirmBankAccount()); + xhpcInvoice.setIsShowDate(saveInvoiceInfoRequest.getIsShowDate()); + xhpcInvoice.setUserNotes(saveInvoiceInfoRequest.getUserNotes()); + xhpcInvoice.setCreatorId(saveInvoiceInfoRequest.getCreatorId()); + xhpcInvoice.setCreatorType(saveInvoiceInfoRequest.getCreatorType()); + xhpcInvoice.setCreator(saveInvoiceInfoRequest.getCreator()); + xhpcInvoice.setCreateTime(DateUtils.parseDate(saveInvoiceInfoRequest.getCreateTime())); + xhpcInvoice.setStatus(0); + xhpcInvoice.setInvoiceMoney(new BigDecimal(1)); + xhpcInvoice.setInvoiceStatus(saveInvoiceInfoRequest.getInvoiceStatus()); + + xhpcInvoiceMapper.insertSelectiveAndReturnId(xhpcInvoice); + //获取所插入的发票id + Long invoiceId = xhpcInvoice.getInvoiceId(); + //存储该发票所包含的所有历史订单总电量 + double totalPowerPrice = 0; + //存储该发票所包含的所有历史订单总服务费 + double totalServicePrice = 0; + //建立订单与发票之间的关联 + List> xhpcHistoryOrderList = xhpcHistoryOrderMapper.findHistoryOrderIds(historyOrderIds, operatorId); + + for (int j = 0; j map = xhpcHistoryOrderList.get(j); + + XhpcInvoiceMapHistoryOrder xhpcInvoiceMapHistoryOrder = new XhpcInvoiceMapHistoryOrder(); + xhpcInvoiceMapHistoryOrder.setInvoiceId(invoiceId); + xhpcInvoiceMapHistoryOrder.setHistoryOrderId(Long.valueOf(map.get("historyOrderId").toString())); + xhpcInvoiceMapHistoryOrder.setHistoryUserId(Long.valueOf(map.get("userId").toString())); + xhpcInvoiceMapHistoryOrder.setHistoryUserType(Long.valueOf(map.get("source").toString())); + xhpcInvoiceMapHistoryOrder.setHistorySerialNumber(map.get("serialNumber").toString()); + xhpcInvoiceMapHistoryOrder.setPowerPriceTotal(new BigDecimal(map.get("powerPriceTotal").toString())); + xhpcInvoiceMapHistoryOrder.setServicePriceTotal(BigDecimal.valueOf(new BigDecimal(map.get("servicePriceTotal").toString()).doubleValue() - new BigDecimal(map.get("promotionDiscount").toString()).doubleValue())); + xhpcInvoiceMapHistoryOrder.setPromotionDiscount(new BigDecimal(map.get("promotionDiscount").toString())); + xhpcInvoiceMapHistoryOrder.setHistoryActPrice(new BigDecimal(map.get("actPrice").toString())); + xhpcInvoiceMapHistoryOrder.setCreateTime(cn.hutool.core.date.DateUtil.parse(map.get("createTime").toString())); + xhpcInvoiceMapHistoryOrder.setChargingMode(map.get("chargingMode").toString()); + xhpcInvoiceMapHistoryOrder.setChargingStationId(Long.valueOf(map.get("chargingStationId").toString())); + xhpcInvoiceMapHistoryOrder.setTerminalId(Long.valueOf(map.get("terminalId").toString())); + xhpcInvoiceMapHistoryOrder.setLockFlag(InvoiceMapHistoryOrderStatusConst.LOCK); + xhpcInvoiceMapHistoryOrderMapper.insertSelective(xhpcInvoiceMapHistoryOrder); + totalPowerPrice += new BigDecimal(map.get("powerPriceTotal").toString()).doubleValue(); + totalServicePrice += (new BigDecimal(map.get("servicePriceTotal").toString()).doubleValue() - new BigDecimal(map.get("promotionDiscount").toString()).doubleValue()); + totalActPrice += new BigDecimal(map.get("actPrice").toString()).doubleValue(); + + } + xhpcInvoice.setInvoiceOrderEletricTotalMoney(BigDecimal.valueOf(totalPowerPrice)); + xhpcInvoice.setInvoiceOrderServiceTotalMoney(BigDecimal.valueOf(totalServicePrice)); + xhpcInvoice.setInvoiceMoney(BigDecimal.valueOf(totalPowerPrice).add(BigDecimal.valueOf(totalServicePrice))); + xhpcInvoice.setOrderOperatorId(operatorId); + xhpcInvoice.setInvoiceOperatorId(operatorId); + xhpcInvoiceMapper.updateElectricAndServiceById(xhpcInvoice); + } + + BigDecimal bigDecimal = saveInvoiceInfoRequest.getInvoiceMoney().setScale(2, BigDecimal.ROUND_HALF_UP); + BigDecimal bigDecimal2 = new BigDecimal(totalActPrice).setScale(2, BigDecimal.ROUND_HALF_UP); + if (!bigDecimal2.equals(bigDecimal)) { + throw new Exception("传入的发票金额与实际包含的历史订单总金额参数不匹配"); + } + + try { + LoginUser loginUser = tokenService.getLoginUser(); + getCreatorRead(saveInvoiceInfoRequest.getCreatorId(),saveInvoiceInfoRequest.getCreatorType(),loginUser.getTenantId()); + }catch (Exception e){ + + } + + } + + + + /** * 查询指定用户没有查看的已开的发票的数量,即该用户有几个未读发票 * diff --git a/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml index 17176ef0..69f51a0e 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml @@ -48,11 +48,11 @@ oss: name: qiniu tenant-mode: true endpoint: oss-accelerate.aliyuncs.com - access-key: LTAI5t7vcQMfZPEZQkEdrAjx - secret-key: K7ZstCZoAjvJsBCe0CipodINETuPyi + access-key: LTAI5tHxc8hrG6cT5nDtEkiV + secret-key: 5kFEaIFE7eeODxKQwD5mvTRF48MK6w bucket-name: xhpc-bucket1 #文件路径 file: aliyunPath: invoicePdf/ - serverStoreDisposableFileLocation: /www/wwwroot/scxhua.cn/disposableFiles/ \ No newline at end of file + serverStoreDisposableFileLocation: /www/wwwroot/scxhua.cn/disposableFiles/ diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml index d7c696d7..3dd7b99b 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml @@ -31,8 +31,8 @@ xau.suncha_switch as sunchaSwitch, xau.a_balance as aBalance, xau.b_balance as bBalance, - (select vin_spec_code as vinSpecCode from xhpc_user_vehicle where app_user_id = xau.app_user_id and source=0 and del_flag=0 and vin_blacklist !=1 order by type,create_time desc LIMIT 1) as vinSpecCode, - (select vehicle_name as vehicleName from xhpc_user_vehicle where app_user_id = xau.app_user_id and source=0 and del_flag=0 and vin_blacklist !=1 order by type,create_time desc LIMIT 1) as vehicleName, + (select vin_spec_code as vinSpecCode from xhpc_user_vehicle where app_user_id = xau.app_user_id and source=0 and del_flag=0 and vin_blacklist !=1 order by type desc,create_time desc LIMIT 1) as vinSpecCode, + (select vehicle_name as vehicleName from xhpc_user_vehicle where app_user_id = xau.app_user_id and source=0 and del_flag=0 and vin_blacklist !=1 order by type desc,create_time desc LIMIT 1) as vehicleName, xau.create_time as createTime from xhpc_app_user xau left join xhpc_tenant ten on ten.tenant_id = xau.tenant_id and ten.is_deleted =0 @@ -73,8 +73,8 @@ xcp.suncha_switch as sunchaSwitch, xcp.a_balance as aBalance, xcp.b_balance as bBalance, - (select vin_spec_code as vinSpecCode from xhpc_user_vehicle where app_user_id = xcp.community_personnel_id and source=2 and del_flag=0 and vin_blacklist !=1 order by type,create_time desc LIMIT 1) as vinSpecCode, - (select vehicle_name as vehicleName from xhpc_user_vehicle where app_user_id = xcp.community_personnel_id and source=2 and del_flag=0 and vin_blacklist !=1 order by type,create_time desc LIMIT 1) as vehicleName, + (select vin_spec_code as vinSpecCode from xhpc_user_vehicle where app_user_id = xcp.community_personnel_id and source=2 and del_flag=0 and vin_blacklist !=1 order by type desc,create_time desc LIMIT 1) as vinSpecCode, + (select vehicle_name as vehicleName from xhpc_user_vehicle where app_user_id = xcp.community_personnel_id and source=2 and del_flag=0 and vin_blacklist !=1 order by type desc,create_time desc LIMIT 1) as vehicleName, (select count(charging_station_id) from xhpc_mechanism where community_id=mechanism_id and source=0 and charging_station_id in (select charging_station_id from xhpc_terminal where 1=1 and del_flag=0 and serial_number=#{serialNumber})) as number, @@ -117,8 +117,8 @@ xcp.suncha_switch as sunchaSwitch, xcp.a_balance as aBalance, xcp.b_balance as bBalance, - (select vin_spec_code as vinSpecCode from xhpc_user_vehicle where app_user_id = xcp.customers_personnel_id and source=3 and del_flag=0 and vin_blacklist !=1 order by type,create_time desc LIMIT 1) as vinSpecCode, - (select vehicle_name as vehicleName from xhpc_user_vehicle where app_user_id = xcp.customers_personnel_id and source=3 and del_flag=0 and vin_blacklist !=1 order by type,create_time desc LIMIT 1) as vehicleName, + (select vin_spec_code as vinSpecCode from xhpc_user_vehicle where app_user_id = xcp.customers_personnel_id and source=3 and del_flag=0 and vin_blacklist !=1 order by type desc,create_time desc LIMIT 1) as vinSpecCode, + (select vehicle_name as vehicleName from xhpc_user_vehicle where app_user_id = xcp.customers_personnel_id and source=3 and del_flag=0 and vin_blacklist !=1 order by type desc,create_time desc LIMIT 1) as vehicleName, (select count(charging_station_id) from xhpc_mechanism where customers_id=mechanism_id and source=1 and charging_station_id in (select charging_station_id from xhpc_terminal where 1=1 and del_flag=0 and serial_number=#{serialNumber})) as number, @@ -160,7 +160,7 @@ xau.tenant_id tenantId, xau.soc_protect socProtect, ten.status tenantStatus, - (select vehicle_name as vehicleName from xhpc_user_vehicle where app_user_id = xau.app_internet_user_id and source=1 and del_flag=0 and vin_blacklist !=1 order by type,create_time desc LIMIT 1) as vehicleName, + (select vehicle_name as vehicleName from xhpc_user_vehicle where app_user_id = xau.app_internet_user_id and source=1 and del_flag=0 and vin_blacklist !=1 order by type desc,create_time desc LIMIT 1) as vehicleName, xau.create_time as createTime from xhpc_app_internet_user xau left join xhpc_tenant ten on ten.tenant_id = xau.tenant_id and ten.is_deleted =0 diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCustomersMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCustomersMapper.xml index bdbc525a..1773a580 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCustomersMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCustomersMapper.xml @@ -77,6 +77,9 @@ service_preferential, + + min_limit, + contact_name, @@ -130,6 +133,9 @@ #{servicePreferential}, + + #{minLimit}, + #{contactName}, @@ -180,6 +186,7 @@ name = #{name}, service_preferential = #{servicePreferential}, + min_limit = #{minLimit}, contact_name = #{contactName}, contact_phone = #{contactPhone}, address = #{address}, @@ -209,6 +216,7 @@ co.customers_id as customersId, co.name as name, co.service_preferential as servicePreferential, + co.min_limit as minLimit, co.contact_name as contactName, co.contact_phone as contactPhone, co.address as address, diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcHistoryOrderMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcHistoryOrderMapper.xml index 4a8226d9..99bb58e7 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcHistoryOrderMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcHistoryOrderMapper.xml @@ -59,8 +59,7 @@ - history_order_id - , + history_order_id, charging_station_id, charge_order_id, user_id, @@ -168,4 +167,57 @@ + + + + + diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcInvoiceMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcInvoiceMapper.xml index 113e9a26..a2f718ab 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcInvoiceMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcInvoiceMapper.xml @@ -32,6 +32,8 @@ + + @@ -68,60 +70,98 @@ `del_flag` - select - - from xhpc_invoice - where invoice_id = #{invoiceId,jdbcType=BIGINT} and del_flag is null; + xi.`invoice_id` as invoiceId, + xi.invoice_type as invoiceType, + xi.`receive_email` as receiveEmail, + xi.`title_type` as titleType, + xi.`title_content` as titleContent, + xi.`duty_number` as dutyNumber, + xi.`invoice_content` as invoiceContent, + xi.`invoice_money` as invoiceMoney, + xi.`invoice_order_eletric_total_money` as invoiceOrderEletricTotalMoney, + xi.`invoice_order_service_total_money` as invoiceOrderServiceTotalMoney, + xi.`firm_address` as firmAddress, + xi.`firm_phone` as firmPhone, + xi.`firm_bank` as firmBank, + xi.`firm_bank_account` as firmBankAccount, + xi.`is_show_date` as isShowDate, + xi.`user_notes` as userNotes, + xi.`creator_id` as creatorId, + xi.`creator_type` as creatorType, + xi.`creator` as creator, + xi.`create_time` as createTime, + xi.`status` as status, + xi.`invoicing_time` as invoicingTime, + xi.`drawer` as drawer, + xi.`finance_notes` as financeNotes, + xi.`electric_invoice_url` as electricInvoiceUrl, + xi.`updator` as updator, + xi.`update_time` as updateTime, + xi.`is_read` as isRead, + xi.tenant_id as tenantId, + xi.invoice_status as invoiceStatus, + xi.`del_flag` as delFlag, + xo.name as orderOperatorName, + xop.name as invoiceOperatorName + from xhpc_invoice as xi + left join xhpc_operator xo on xo.operator_id = xi.order_operator_id + left join xhpc_operator xop on xop.operator_id = xi.invoice_operator_id + where xi.invoice_id = #{invoiceId,jdbcType=BIGINT} and xi.del_flag is null; - SELECT - invoice_id, - invoice_type, - tenant_id, - creator, - creator_type, - invoice_money, - status, - create_time, - invoicing_time, - drawer, - invoice_status + xi.invoice_id as invoiceId, + xi.invoice_type as invoiceType, + xi.tenant_id as tenantId, + xi.creator AS creator, + xi.creator_type AS creatorType, + xi.invoice_money AS invoiceMoney, + xi.status AS status, + xi.create_time AS createtime, + xi.invoicing_time as invoicingTime, + xi.drawer AS drawer, + xi.invoice_status AS invoiceStatus, + xo.name as orderOperatorName, + xop.name as invoiceOperatorName FROM - xhpc_invoice + xhpc_invoice as xi + left join xhpc_operator xo on xo.operator_id = xi.order_operator_id + left join xhpc_operator xop on xop.operator_id = xi.invoice_operator_id - del_flag IS NULL + xi.del_flag IS NULL - and creator like concat('%', #{creator}, '%') + and xi.creator like concat('%', #{creator}, '%') - and creator_type = #{creatorType} + and xi.creator_type = #{creatorType} - and invoice_type = #{invoiceType} + and xi.invoice_type = #{invoiceType} - and tenant_id = #{tenantId} + and xi.tenant_id = #{tenantId} - and status = #{status} + and xi.status = #{status} - and create_time >= #{startCreatorTime} + and xi.create_time >= #{startCreatorTime} - and create_time <= #{endCreatorTime} + and xi.create_time <= #{endCreatorTime} - and invoicing_time >= #{startInvoicingTime} + and xi.invoicing_time >= #{startInvoicingTime} - and invoicing_time <= #{endInvoicingTime} + and xi.invoicing_time <= #{endInvoicingTime} ORDER BY - STATUS ASC, - create_time DESC + xi.STATUS ASC, + xi.create_time DESC LIMIT #{currentPage},#{items} - select count(1) from sys_user where user_name = #{userName} + select count(1) from sys_user where user_name = #{userName} and del_flag =0 and user_id=#{userId} diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcUserVehicleMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcUserVehicleMapper.xml index 15609d93..eb1995c1 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcUserVehicleMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcUserVehicleMapper.xml @@ -73,6 +73,7 @@ and xuv.tenant_id=#{tenantId} + order by xuv.type desc,xuv.create_time desc @@ -172,7 +173,7 @@ and type =#{type} - order by create_time desc limit 1 + order by tyep desc,create_time desc limit 1