diff --git a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcActivityTemplateMapper.xml b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcActivityTemplateMapper.xml index 57d30d51..40266422 100644 --- a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcActivityTemplateMapper.xml +++ b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcActivityTemplateMapper.xml @@ -18,11 +18,12 @@ + activity_template_id, template_name, discount_type, discount_rate, start_time, end_time, discount_count, mini_display, background_url, `status`, del_flag, tenant_id, create_by, - create_time, update_by, update_time + create_time, update_by, update_time,applet_activity_name diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java index d126230d..ba30f64d 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java @@ -765,8 +765,6 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc //检查是否有用户登录 LoginUser loginUser = tokenService.getLoginUser(); - - List stringList = new ArrayList<>(); if (serviceFacilities != null && serviceFacilities != "") { String[] split = serviceFacilities.split(","); @@ -780,7 +778,6 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc BigDecimal serviceFee =new BigDecimal(map.get("serviceFee").toString()); BigDecimal powerFee =new BigDecimal(map.get("powerFee").toString()); - if(loginUser !=null){ //判断是否享受活动 Map objectMap = activityDiscountTime(loginUser.getUserid(), new Date(), loginUser.getUserType(), Long.valueOf(map.get("chargingStationId").toString()), loginUser.getTenantId()); @@ -804,9 +801,12 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc }else{ map.put("appletActivityName", ""); } + map.put("activityState", 1); + }else{ + map.put("activityState", 0); } }else{ - logger.info("==========loginUser========是空"); + map.put("activityState", 0); } //桩(空闲和使用从redis获取) Map map1 =new HashMap<>(); @@ -881,7 +881,17 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc map.put("activityPowerFee", powerFee); map.put("activityMoney", serviceFee.add(powerFee)); } + if(objectMap.get("appletActivityName") !=null && !"".equals(objectMap.get("appletActivityName").toString())){ + map.put("appletActivityName", objectMap.get("appletActivityName").toString()); + }else{ + map.put("appletActivityName", ""); + } + map.put("activityState", 1); + }else{ + map.put("activityState", 0); } + }else{ + map.put("activityState", 0); } map.putAll(xhpcRateTime); } @@ -914,7 +924,12 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc map.put("activityPowerFee", powerFee); map.put("activityMoney", serviceFee.add(powerFee)); } + map.put("activityState", 1); + }else{ + map.put("activityState", 0); } + }else{ + map.put("activityState", 0); } } return list; diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java index f3c8356c..8f43ac98 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java @@ -157,7 +157,10 @@ public class XhpcTerminalServiceImpl extends BaseService implements IXhpcTermina }else{ map.put("appletActivityName", ""); } + map.put("activityState", 1); } + }else{ + map.put("activityState", 0); } map.putAll(xhpcRateTime); } diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml index d6d60590..16536b07 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml @@ -297,50 +297,18 @@ cs.service_facilities as serviceFacilities, (select count(terminal_id) from xhpc_terminal where status=0 and del_flag =0 and charging_station_id=cs.charging_station_id) as common, - (select GROUP_CONCAT(serial_number) from xhpc_terminal where status=0 and del_flag =0 and - charging_station_id=cs.charging_station_id) as serialNumbers, - (select (ra.service_fee) as serviceFee - from xhpc_rate as ra - where ra.status = 0 - and ra.del_flag = 0 - and ra.rate_id = ( - select rate_id from xhpc_rate_time - where charging_station_id = cs.charging_station_id - and cs.rate_model_id = rate_model_id - and start_time <= #{date} - and replace(end_time, '00:00:00', '24:00:00') >= #{date} - and status = 0 - and del_flag = 0)) serviceFee, - (select (ra.power_fee) as powerFee - from xhpc_rate as ra - where ra.status = 0 - and ra.del_flag = 0 - and ra.rate_id = ( - select rate_id from xhpc_rate_time - where charging_station_id = cs.charging_station_id - and cs.rate_model_id = rate_model_id - and start_time <= #{date} - and replace(end_time, '00:00:00', '24:00:00') >= #{date} - and status = 0 - and del_flag = 0)) powerFee, - (select (ra.power_fee+ra.service_fee) as serviceFee - from xhpc_rate as ra - where ra.status = 0 - and ra.del_flag = 0 - and ra.rate_id = ( - select rate_id from xhpc_rate_time - where charging_station_id = cs.charging_station_id - and cs.rate_model_id = rate_model_id - and start_time <= #{date} - and replace(end_time, '00:00:00', '24:00:00') >= #{date} - and status = 0 - and del_flag = 0)) money, + ra.service_fee as serviceFee, + ra.power_fee as powerFee, + (ra.power_fee+ra.service_fee) as money, (select GROUP_CONCAT(dict_value) from xhpc_dict_biz where FIND_IN_SET(dict_key,cs.service_facilities ) and code = 'service_facilities' and parent_id > 0 and del_flag = 0) as serviceFacilitiesName, ROUND(ACOS(SIN((#{latitude} * 3.141593) / 180 ) *SIN((cs.latitude * 3.141593) / 180 ) + COS((#{latitude} * 3.141593) / 180 ) * COS((cs.latitude * 3.141593) / 180 ) * COS((#{longitude} * 3.141593) / 180 - (cs.longitude * 3.141593) / 180 ) ) * 6370.9968,2)AS distance from xhpc_charging_station as cs + left JOIN xhpc_rate_time as xrt on xrt.charging_station_id =cs.charging_station_id and cs.rate_model_id = xrt.rate_model_id and xrt.start_time <= #{date} and replace(xrt.end_time, '00:00:00', '24:00:00') >= #{date} and xrt.status = 0 and xrt.del_flag = 0 + LEFT JOIN xhpc_rate as ra on ra.rate_id =xrt.rate_id + where cs.del_flag =0 and cs.status =0 and FIND_IN_SET(#{clientVisible},cs.client_visible)>0 @@ -379,7 +347,6 @@ and del_flag = 0 and status = 0 limit 1) as type, (select count(terminal_id) from xhpc_terminal where status=0 and del_flag =0 and charging_station_id=#{chargingStationId}) as common, - (select GROUP_CONCAT(serial_number) from xhpc_terminal where status=0 and del_flag =0 and charging_station_id=charging_station_id) as serialNumbers, (select GROUP_CONCAT(dict_value) from xhpc_dict_biz where FIND_IN_SET(dict_key,service_facilities ) and code= 'service_facilities' and parent_id > 0 and del_flag = 0) as serviceFacilitiesName, name as name, reminder_instructions as reminderInstructions, diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java index e967ba4b..a1c2621c 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java @@ -219,7 +219,7 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU } String captcha = redisService.getCacheObject("pvToken:" + phone); if(null ==captcha || "".equals(captcha)){ - return R.fail(HttpStatus.ERROR_STATUS, "验证码错误"); + return R.fail(HttpStatus.ERROR_STATUS, "验证码错误!"); } if (!code.equalsIgnoreCase(captcha)) { return R.fail(HttpStatus.ERROR_STATUS, "验证码错误");