活动增加小程序-列表-活动名称

This commit is contained in:
yuyang 2022-06-14 10:44:35 +08:00
parent f042dcb76c
commit 3d7d2bfde3
6 changed files with 31 additions and 5 deletions

View File

@ -91,5 +91,10 @@ public class XhpcActivityTemplateDomain implements Serializable {
*/ */
private Date updateTime; private Date updateTime;
/**
* 小程序-列表-活动名称
*/
private String appletActivityName;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -79,13 +79,13 @@
start_time, end_time, discount_count, start_time, end_time, discount_count,
mini_display, background_url, `status`, mini_display, background_url, `status`,
del_flag, tenant_id, create_by, del_flag, tenant_id, create_by,
create_time, update_by, update_time create_time, update_by, update_time,applet_activity_name
) )
values (#{templateName,jdbcType=VARCHAR}, #{discountType,jdbcType=SMALLINT}, #{discountRate,jdbcType=DECIMAL}, values (#{templateName,jdbcType=VARCHAR}, #{discountType,jdbcType=SMALLINT}, #{discountRate,jdbcType=DECIMAL},
#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{discountCount,jdbcType=SMALLINT}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{discountCount,jdbcType=SMALLINT},
#{miniDisplay,jdbcType=SMALLINT}, #{backgroundUrl,jdbcType=VARCHAR}, #{status,jdbcType=SMALLINT}, #{miniDisplay,jdbcType=SMALLINT}, #{backgroundUrl,jdbcType=VARCHAR}, #{status,jdbcType=SMALLINT},
0, #{tenantId,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, 0, #{tenantId,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
sysdate(), #{updateBy,jdbcType=VARCHAR}, sysdate() sysdate(), #{updateBy,jdbcType=VARCHAR}, sysdate(),#{appletActivityName,jdbcType=VARCHAR}
) )
</insert> </insert>
@ -103,7 +103,8 @@
`status` = #{status,jdbcType=SMALLINT}, `status` = #{status,jdbcType=SMALLINT},
tenant_id = #{tenantId,jdbcType=VARCHAR}, tenant_id = #{tenantId,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR},
update_time = sysdate() update_time = sysdate(),
applet_activity_name=#{appletActivityName,jdbcType=VARCHAR}
where activity_template_id = #{activityTemplateId} where activity_template_id = #{activityTemplateId}
</update> </update>

View File

@ -114,7 +114,10 @@ public class XhpcActivityDiscountDto implements Serializable {
*/ */
private BigDecimal discountRate; private BigDecimal discountRate;
/**
* 小程序-列表-活动名称
*/
private String appletActivityName;

View File

@ -799,6 +799,11 @@ 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", "");
}
} }
}else{ }else{
logger.info("==========loginUser========是空"); logger.info("==========loginUser========是空");
@ -1408,6 +1413,7 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc
//折扣电费服务费 //折扣电费服务费
BigDecimal totalDiscountRate =new BigDecimal(0); BigDecimal totalDiscountRate =new BigDecimal(0);
int totalDiscountType = 0; int totalDiscountType = 0;
String appletActivityName ="";
for (int i = 0; i < activityDiscountTime.size(); i++) { for (int i = 0; i < activityDiscountTime.size(); i++) {
XhpcActivityDiscountDto activity = activityDiscountTime.get(i); XhpcActivityDiscountDto activity = activityDiscountTime.get(i);
BigDecimal discountRate = activity.getDiscountRate(); BigDecimal discountRate = activity.getDiscountRate();
@ -1416,29 +1422,35 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc
if(totalDiscountType==0){ if(totalDiscountType==0){
totalDiscountRate =discountRate; totalDiscountRate =discountRate;
totalDiscountType = 1; totalDiscountType = 1;
appletActivityName = activity.getAppletActivityName();
}else if(totalDiscountType==1 || totalDiscountType==3){ }else if(totalDiscountType==1 || totalDiscountType==3){
if(totalDiscountRate.compareTo(discountRate)<0){ if(totalDiscountRate.compareTo(discountRate)<0){
totalDiscountRate =discountRate; totalDiscountRate =discountRate;
totalDiscountType=1; totalDiscountType=1;
appletActivityName = activity.getAppletActivityName();
} }
}else{ }else{
if(totalDiscountRate.compareTo(discountRate.multiply(new BigDecimal(2)))<0){ if(totalDiscountRate.compareTo(discountRate.multiply(new BigDecimal(2)))<0){
totalDiscountRate =discountRate; totalDiscountRate =discountRate;
totalDiscountType = 1; totalDiscountType = 1;
appletActivityName = activity.getAppletActivityName();
} }
} }
}else if(discountType.equals(2)){ }else if(discountType.equals(2)){
if(totalDiscountType==0){ if(totalDiscountType==0){
totalDiscountRate =discountRate; totalDiscountRate =discountRate;
totalDiscountType = 2; totalDiscountType = 2;
appletActivityName = activity.getAppletActivityName();
}else if(totalDiscountType==1 || totalDiscountType==3){ }else if(totalDiscountType==1 || totalDiscountType==3){
if(totalDiscountRate.multiply(new BigDecimal(2)).compareTo(discountRate)<0){ if(totalDiscountRate.multiply(new BigDecimal(2)).compareTo(discountRate)<0){
totalDiscountRate =discountRate; totalDiscountRate =discountRate;
totalDiscountType = 2; totalDiscountType = 2;
appletActivityName = activity.getAppletActivityName();
} }
}else { }else {
if(totalDiscountRate.compareTo(discountRate)<0){ if(totalDiscountRate.compareTo(discountRate)<0){
totalDiscountRate =discountRate; totalDiscountRate =discountRate;
appletActivityName = activity.getAppletActivityName();
} }
} }
}else{ }else{
@ -1446,19 +1458,23 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc
if(totalDiscountType==0){ if(totalDiscountType==0){
totalDiscountRate =discountRate; totalDiscountRate =discountRate;
totalDiscountType = 3; totalDiscountType = 3;
appletActivityName = activity.getAppletActivityName();
}else if(totalDiscountType==1 || totalDiscountType==3){ }else if(totalDiscountType==1 || totalDiscountType==3){
if(totalDiscountRate.compareTo(discountRate)<0){ if(totalDiscountRate.compareTo(discountRate)<0){
totalDiscountRate =discountRate; totalDiscountRate =discountRate;
totalDiscountType = 3; totalDiscountType = 3;
appletActivityName = activity.getAppletActivityName();
} }
}else{ }else{
if(totalDiscountRate.multiply(new BigDecimal(2)).compareTo(discountRate)<0){ if(totalDiscountRate.multiply(new BigDecimal(2)).compareTo(discountRate)<0){
totalDiscountRate =discountRate; totalDiscountRate =discountRate;
totalDiscountType = 3; totalDiscountType = 3;
appletActivityName = activity.getAppletActivityName();
} }
} }
} }
} }
map.put("appletActivityName",appletActivityName);
map.put("state","1"); map.put("state","1");
map.put("totalDiscountRate",totalDiscountRate); map.put("totalDiscountRate",totalDiscountRate);
map.put("totalDiscountType",totalDiscountType+""); map.put("totalDiscountType",totalDiscountType+"");

View File

@ -983,6 +983,7 @@
xad.check_by as checkBy, xad.check_by as checkBy,
xad.check_time as checkTime, xad.check_time as checkTime,
xat.discount_type discountType, xat.discount_type discountType,
xad.applet_activity_name appletActivityName,
xat.discount_rate discountRate xat.discount_rate discountRate
from xhpc_activity_discount as xad from xhpc_activity_discount as xad
join xhpc_activity_template as xat on xat.activity_template_id = xad.template_id and xat.del_flag =0 and xat.status=1 join xhpc_activity_template as xat on xat.activity_template_id = xad.template_id and xat.del_flag =0 and xat.status=1

View File

@ -251,7 +251,7 @@
LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = 'refund_order_status' and sdd.dict_value = xro.`status` LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = 'refund_order_status' and sdd.dict_value = xro.`status`
LEFT JOIN sys_dict_data sdds on sdds.`dict_type` = 'refund_examine_status' and sdds.dict_value = LEFT JOIN sys_dict_data sdds on sdds.`dict_type` = 'refund_examine_status' and sdds.dict_value =
xro.examine_status xro.examine_status
where xro.del_flag = 0 where xro.del_flag = 0 and xro.examine_status=1 and xro.status =1
<if test="phone != null and phone != ''"> <if test="phone != null and phone != ''">
and xau.phone like concat('%', #{phone}, '%') and xau.phone like concat('%', #{phone}, '%')
</if> </if>