Commit 77675798 by huluobin

Merge branch 'master' into branch

parents d0a633ac 28d9d5bf
......@@ -23,7 +23,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
......@@ -103,29 +102,32 @@ public class CouponCustomerRelevanceServiceImpl extends ServiceImpl<CouponCustom
}
@Override
public IPage<CouponCustomerRelevance> selectMyCoupon(Integer customerId, Integer pageNum, Integer pageSize, Integer state, Boolean containRemoveCoupon) {
public IPage<CouponCustomerRelevance> selectMyCoupon(Integer customerId,
Integer pageNum,
Integer pageSize,
Integer state,
Boolean containRemoveCoupon) {
IPage<CouponCustomerRelevance> page = new Page<>(pageNum, pageSize);
page = couponCustomerRelevanceMapper.selectPage(page, new LambdaQueryWrapper<CouponCustomerRelevance>().eq(CouponCustomerRelevance::getCustomerId, customerId));
page = couponCustomerRelevanceMapper.selectPage(page, new LambdaQueryWrapper<CouponCustomerRelevance>()
.eq(CouponCustomerRelevance::getCustomerId, customerId)
.eq(CouponCustomerRelevance::getState, state));
this.joinCouponCustomerRelevanceMapper(page.getRecords());
long nowTime = new Date().getTime();
for (int i = 0; i < page.getRecords().size(); i++) {
if (containRemoveCoupon != null && !containRemoveCoupon && page.getRecords().get(i).getCouponId().equals(66)) {
page.getRecords().remove(i);
i--;
continue;
}
CouponCustomerRelevance couponCustomerRelevance = page.getRecords().get(i);
if (nowTime > couponCustomerRelevance.getValidEndTime().getTime() && couponCustomerRelevance.getState() == 1) {
/*校验是否可用*/
List<CouponCustomerRelevance> records = page.getRecords()
.stream()
.peek(couponCustomerRelevance -> {
if (couponCustomerRelevance.getState() == 1 && !couponCustomerRelevance.isValid()) {
couponCustomerRelevance.setState(3);
couponCustomerRelevanceMapper.updateById(couponCustomerRelevance);
}
if (state != null && state != 0 && couponCustomerRelevance.getState() != null && !couponCustomerRelevance.getState().equals(state)) {
page.getRecords().remove(i);
i--;
}
}
})
.filter(couponCustomerRelevance -> couponCustomerRelevance.getState().equals(state))
.collect(Collectors.toList());
page.setRecords(records);
return page;
}
......
......@@ -286,14 +286,12 @@ public class MarketServiceImpl implements MarketService {
.eq(CouponCustomerRelevance::getState, 1)
.eq(CouponCustomerRelevance::getSourceType, 1));
//订单使用的次卡
List<TimesCardUsedRecord> timesCardUsedRecordList = timesCardUsedRecordService
.list(new LambdaQueryWrapper<TimesCardUsedRecord>()
.eq(TimesCardUsedRecord::getOrderId, orderId)
.eq(TimesCardUsedRecord::getStatus, 1));
//查询订单聚合
OrderManage orderManage = orderManageMapper.selectById(orderId);
List<OrderServe> orderServeList = orderServeMapper.selectList(new LambdaQueryWrapper<OrderServe>().eq(OrderServe::getOrderId, orderId));
......
......@@ -4,12 +4,11 @@
<select id="listUserForAllNotQuit" resultType="com.gogirl.domain.store.store.StoreUser">
select
*
from store_user
where status = 1
SELECT t1.* from store_user t1
LEFT JOIN staff_store_authority t2 on t1.id =t2.user_id
where t1.`status` = 1
<if test="departmentId != null">
and department_id = #{departmentId}
and t2.store_id = #{departmentId}
</if>
</select>
</mapper>
\ No newline at end of file
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