小程序活动显示修改

This commit is contained in:
yuyang 2022-06-15 18:26:27 +08:00
parent 7f17f879a4
commit dda61f71b5
5 changed files with 31 additions and 45 deletions

View File

@ -18,11 +18,12 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="applet_activity_name" jdbcType="VARCHAR" property="appletActivityName" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
activity_template_id, template_name, discount_type, discount_rate, start_time, end_time, 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, 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
</sql> </sql>

View File

@ -765,8 +765,6 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc
//检查是否有用户登录 //检查是否有用户登录
LoginUser loginUser = tokenService.getLoginUser(); LoginUser loginUser = tokenService.getLoginUser();
List<String> stringList = new ArrayList<>(); List<String> stringList = new ArrayList<>();
if (serviceFacilities != null && serviceFacilities != "") { if (serviceFacilities != null && serviceFacilities != "") {
String[] split = serviceFacilities.split(","); String[] split = serviceFacilities.split(",");
@ -780,7 +778,6 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc
BigDecimal serviceFee =new BigDecimal(map.get("serviceFee").toString()); BigDecimal serviceFee =new BigDecimal(map.get("serviceFee").toString());
BigDecimal powerFee =new BigDecimal(map.get("powerFee").toString()); BigDecimal powerFee =new BigDecimal(map.get("powerFee").toString());
if(loginUser !=null){ if(loginUser !=null){
//判断是否享受活动 //判断是否享受活动
Map<String, Object> objectMap = activityDiscountTime(loginUser.getUserid(), new Date(), loginUser.getUserType(), Long.valueOf(map.get("chargingStationId").toString()), loginUser.getTenantId()); Map<String, Object> 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{ }else{
map.put("appletActivityName", ""); map.put("appletActivityName", "");
} }
map.put("activityState", 1);
}else{
map.put("activityState", 0);
} }
}else{ }else{
logger.info("==========loginUser========是空"); map.put("activityState", 0);
} }
//空闲和使用从redis获取 //空闲和使用从redis获取
Map<String, Object> map1 =new HashMap<>(); Map<String, Object> map1 =new HashMap<>();
@ -881,7 +881,17 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc
map.put("activityPowerFee", powerFee); map.put("activityPowerFee", powerFee);
map.put("activityMoney", serviceFee.add(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); map.putAll(xhpcRateTime);
} }
@ -914,7 +924,12 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc
map.put("activityPowerFee", powerFee); map.put("activityPowerFee", powerFee);
map.put("activityMoney", serviceFee.add(powerFee)); map.put("activityMoney", serviceFee.add(powerFee));
} }
map.put("activityState", 1);
}else{
map.put("activityState", 0);
} }
}else{
map.put("activityState", 0);
} }
} }
return list; return list;

View File

@ -157,7 +157,10 @@ public class XhpcTerminalServiceImpl extends BaseService implements IXhpcTermina
}else{ }else{
map.put("appletActivityName", ""); map.put("appletActivityName", "");
} }
map.put("activityState", 1);
} }
}else{
map.put("activityState", 0);
} }
map.putAll(xhpcRateTime); map.putAll(xhpcRateTime);
} }

View File

@ -297,50 +297,18 @@
cs.service_facilities as serviceFacilities, cs.service_facilities as serviceFacilities,
(select count(terminal_id) from xhpc_terminal where status=0 and del_flag =0 and (select count(terminal_id) from xhpc_terminal where status=0 and del_flag =0 and
charging_station_id=cs.charging_station_id) as common, 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 ra.service_fee as serviceFee,
charging_station_id=cs.charging_station_id) as serialNumbers, ra.power_fee as powerFee,
(select (ra.service_fee) as serviceFee (ra.power_fee+ra.service_fee) as money,
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 &lt;= #{date}
and replace(end_time, '00:00:00', '24:00:00') &gt;= #{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 &lt;= #{date}
and replace(end_time, '00:00:00', '24:00:00') &gt;= #{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 &lt;= #{date}
and replace(end_time, '00:00:00', '24:00:00') &gt;= #{date}
and status = 0
and del_flag = 0)) money,
(select GROUP_CONCAT(dict_value) from xhpc_dict_biz where FIND_IN_SET(dict_key,cs.service_facilities ) and code (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, = '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 ) + 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((#{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 COS((#{longitude} * 3.141593) / 180 - (cs.longitude * 3.141593) / 180 ) ) * 6370.9968,2)AS distance
from xhpc_charging_station as cs 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 &lt;= #{date} and replace(xrt.end_time, '00:00:00', '24:00:00') &gt;= #{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 where cs.del_flag =0 and cs.status =0
and FIND_IN_SET(#{clientVisible},cs.client_visible)>0 and FIND_IN_SET(#{clientVisible},cs.client_visible)>0
<if test="name !=null and name !=''"> <if test="name !=null and name !=''">
@ -379,7 +347,6 @@
and del_flag = 0 and del_flag = 0
and status = 0 limit 1) as type, 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 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, (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, name as name,
reminder_instructions as reminderInstructions, reminder_instructions as reminderInstructions,

View File

@ -219,7 +219,7 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
} }
String captcha = redisService.getCacheObject("pvToken:" + phone); String captcha = redisService.getCacheObject("pvToken:" + phone);
if(null ==captcha || "".equals(captcha)){ if(null ==captcha || "".equals(captcha)){
return R.fail(HttpStatus.ERROR_STATUS, "验证码错误"); return R.fail(HttpStatus.ERROR_STATUS, "验证码错误!");
} }
if (!code.equalsIgnoreCase(captcha)) { if (!code.equalsIgnoreCase(captcha)) {
return R.fail(HttpStatus.ERROR_STATUS, "验证码错误"); return R.fail(HttpStatus.ERROR_STATUS, "验证码错误");