Commit a3f2ddc4 by 吕明尚

修改会员日计算

parent bf247784
...@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RestController;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.common.enums.YesNoEnum;
import share.system.domain.Activity; import share.system.domain.Activity;
import share.system.domain.vo.ActivityDto; import share.system.domain.vo.ActivityDto;
import share.system.domain.vo.ActivityVo; import share.system.domain.vo.ActivityVo;
...@@ -41,6 +42,7 @@ public class ActivityController extends BaseController { ...@@ -41,6 +42,7 @@ public class ActivityController extends BaseController {
@GetMapping("/query") @GetMapping("/query")
public AjaxResult query(ActivityDto dto) { public AjaxResult query(ActivityDto dto) {
dto.setIsOpen(Long.valueOf(YesNoEnum.yes.getIndex()));
Map<Date, List<ActivityVo>> map = activityService.queryList(dto); Map<Date, List<ActivityVo>> map = activityService.queryList(dto);
return success(map); return success(map);
} }
......
...@@ -2568,6 +2568,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -2568,6 +2568,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
queryWrapper.eq(SOrder::getConsumerId, user.getId()); queryWrapper.eq(SOrder::getConsumerId, user.getId());
queryWrapper.in(SOrder::getStatus, OrderStatusEnum.getValidOrderStatus()); queryWrapper.in(SOrder::getStatus, OrderStatusEnum.getValidOrderStatus());
queryWrapper.eq(SOrder::getPayStatus, YesNoEnum.yes.getIndex()); queryWrapper.eq(SOrder::getPayStatus, YesNoEnum.yes.getIndex());
queryWrapper.gt(SOrder::getDiscountRatio, new BigDecimal(50));
// queryWrapper.ne(SOrder::getPayPrice, new BigDecimal(0)); // queryWrapper.ne(SOrder::getPayPrice, new BigDecimal(0));
//预约结束时间大于等于今天的年月日 //预约结束时间大于等于今天的年月日
queryWrapper.ge(SOrder::getPreEndDate, DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, new Date()))); queryWrapper.ge(SOrder::getPreEndDate, DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, new Date())));
...@@ -2588,7 +2589,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -2588,7 +2589,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
boolean match = executionTime.isMatch(ZonedDateTime.ofInstant(item.getPreStartDate().toInstant(), ZoneId.systemDefault())); boolean match = executionTime.isMatch(ZonedDateTime.ofInstant(item.getPreStartDate().toInstant(), ZoneId.systemDefault()));
boolean match1 = executionTime.isMatch(ZonedDateTime.ofInstant(item.getPreEndDate().toInstant(), ZoneId.systemDefault())); boolean match1 = executionTime.isMatch(ZonedDateTime.ofInstant(item.getPreEndDate().toInstant(), ZoneId.systemDefault()));
if (match && match1 if (match && match1
// && (item.getPayPrice().compareTo(item.getTotalPrice().multiply(activity.getDiscountRatio()).divide(new BigDecimal(100)))) > 0 && item.getDuration().compareTo(BigDecimal.ZERO) == 0
&& (item.getPayPrice().add(item.getBalance())).divide(item.getTotalPrice()).multiply(new BigDecimal(100)).compareTo(activity.getDiscountRatio()) == 0
) { ) {
i.getAndIncrement(); i.getAndIncrement();
} }
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<select id="selectActivityList" parameterType="Activity" resultMap="ActivityResult"> <select id="selectActivityList" parameterType="Activity" resultMap="ActivityResult">
<include refid="selectActivityVo"/> <include refid="selectActivityVo"/>
where is_open = 1 and is_delete = 0 where is_delete = 0
<if test="activityName != null and activityName != ''">and activity_name like concat('%', #{activityName}, <if test="activityName != null and activityName != ''">and activity_name like concat('%', #{activityName},
'%') '%')
</if> </if>
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
<if test="storeIds != null and storeIds != ''">and store_ids = #{storeIds}</if> <if test="storeIds != null and storeIds != ''">and store_ids = #{storeIds}</if>
<if test="labelId != null ">and label_id = #{labelId}</if> <if test="labelId != null ">and label_id = #{labelId}</if>
<if test="packId != null ">and pack_id = #{packId}</if> <if test="packId != null ">and pack_id = #{packId}</if>
<if test="isOpen != null or isOpen==0">and is_open = #{isOpen}</if>
<if test="cronExpression != null and cronExpression != ''">and cron_expression = #{cronExpression}</if> <if test="cronExpression != null and cronExpression != ''">and cron_expression = #{cronExpression}</if>
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment