1/31
This commit is contained in:
@@ -8,6 +8,7 @@ import com.yxt.yythmall.api.cannotreservedictionary.CannotReserveDictionary;
|
|||||||
import com.yxt.yythmall.api.cannotreservedictionary.CannotReserveDictionaryVo;
|
import com.yxt.yythmall.api.cannotreservedictionary.CannotReserveDictionaryVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -21,4 +22,8 @@ public interface CannotReserveDictionaryMapper extends BaseMapper<CannotReserveD
|
|||||||
IPage<CannotReserveDictionaryVo> pageList(IPage<CannotReserveDictionary> page, @Param(Constants.WRAPPER) QueryWrapper<CannotReserveDictionary> qw);
|
IPage<CannotReserveDictionaryVo> pageList(IPage<CannotReserveDictionary> page, @Param(Constants.WRAPPER) QueryWrapper<CannotReserveDictionary> qw);
|
||||||
|
|
||||||
List<CannotReserveDictionaryVo> getNotices (@Param("now") String now);
|
List<CannotReserveDictionaryVo> getNotices (@Param("now") String now);
|
||||||
|
|
||||||
|
@Select("select unavailableTime from cannot_reserve_dictionary")
|
||||||
|
List<String> getAllTime ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,5 +71,9 @@ public class CannotReserveDictionaryService extends MybatisBaseService<CannotRes
|
|||||||
List<CannotReserveDictionaryVo> noticeVos= baseMapper.getNotices(sdf.format(new Date()));
|
List<CannotReserveDictionaryVo> noticeVos= baseMapper.getNotices(sdf.format(new Date()));
|
||||||
return rb.success().setData(noticeVos);
|
return rb.success().setData(noticeVos);
|
||||||
}
|
}
|
||||||
|
public ResultBean<List<String>> getAllTime() {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
List<String> noticeVos= baseMapper.getAllTime();
|
||||||
|
return rb.success().setData(noticeVos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,4 +31,5 @@ public class CustomerStoreRest {
|
|||||||
public ResultBean isSaturAndSun() {
|
public ResultBean isSaturAndSun() {
|
||||||
return customerStoreService.isSaturAndSun();
|
return customerStoreService.isSaturAndSun();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.yxt.common.base.service.MybatisBaseService;
|
import com.yxt.common.base.service.MybatisBaseService;
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
|
import com.yxt.yythmall.api.cannotreservedictionary.CannotReserveDictionary;
|
||||||
import com.yxt.yythmall.api.customerstore.CustomerStore;
|
import com.yxt.yythmall.api.customerstore.CustomerStore;
|
||||||
import com.yxt.yythmall.api.customerstore.CustomerStoreDto;
|
import com.yxt.yythmall.api.customerstore.CustomerStoreDto;
|
||||||
import com.yxt.yythmall.api.customerstore.CustomerStoreVo;
|
import com.yxt.yythmall.api.customerstore.CustomerStoreVo;
|
||||||
@@ -14,6 +15,7 @@ import com.yxt.yythmall.api.lpkstore.LpkStore;
|
|||||||
import com.yxt.yythmall.api.lpkstore.LpkStoreQuery;
|
import com.yxt.yythmall.api.lpkstore.LpkStoreQuery;
|
||||||
import com.yxt.yythmall.api.lpkstore.LpkStoreVo;
|
import com.yxt.yythmall.api.lpkstore.LpkStoreVo;
|
||||||
import com.yxt.yythmall.api.lpkstore.StoreSelect;
|
import com.yxt.yythmall.api.lpkstore.StoreSelect;
|
||||||
|
import com.yxt.yythmall.biz.cannotreservedictionary.CannotReserveDictionaryService;
|
||||||
import com.yxt.yythmall.biz.lpkstore.LpkStoreService;
|
import com.yxt.yythmall.biz.lpkstore.LpkStoreService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -21,6 +23,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.*;
|
import java.time.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -33,6 +36,8 @@ import java.util.stream.Collectors;
|
|||||||
public class CustomerStoreService extends MybatisBaseService<CustomerStoreMapper, CustomerStore> {
|
public class CustomerStoreService extends MybatisBaseService<CustomerStoreMapper, CustomerStore> {
|
||||||
@Autowired
|
@Autowired
|
||||||
LpkStoreService lpkStoreService;
|
LpkStoreService lpkStoreService;
|
||||||
|
@Autowired
|
||||||
|
CannotReserveDictionaryService cannotReserveDictionaryService;
|
||||||
public ResultBean<CustomerStoreVo> getStoreBySid(String customerSid) {
|
public ResultBean<CustomerStoreVo> getStoreBySid(String customerSid) {
|
||||||
ResultBean rb=new ResultBean().fail();
|
ResultBean rb=new ResultBean().fail();
|
||||||
|
|
||||||
@@ -66,57 +71,63 @@ public class CustomerStoreService extends MybatisBaseService<CustomerStoreMapper
|
|||||||
return rb.success().setMsg("成功");
|
return rb.success().setMsg("成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public ResultBean<Object> isSaturAndSun() {
|
||||||
|
// ResultBean rb = new ResultBean().fail();
|
||||||
|
//
|
||||||
|
// Date date =new Date();
|
||||||
|
// SimpleDateFormat sdf1 =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
// String nowDate =sdf1.format(date);
|
||||||
|
// String endDate= sdf1.format(DateUtil.offsetMonth(date,12));
|
||||||
|
// LocalDate now = DateUtil.parse(nowDate).toSqlDate().toLocalDate();
|
||||||
|
// LocalDate endD = DateUtil.parse(endDate).toSqlDate().toLocalDate();
|
||||||
|
// List<String> weekMap = new ArrayList<>();
|
||||||
|
// // 第一个星期六
|
||||||
|
// LocalDate saturday = now.with(DayOfWeek.SATURDAY);
|
||||||
|
// do {
|
||||||
|
// if (CollectionUtils.isEmpty(weekMap)) {
|
||||||
|
// weekMap.add(saturday.toString());
|
||||||
|
// } else {
|
||||||
|
// weekMap.add(saturday.toString());
|
||||||
|
// }
|
||||||
|
// // 迭代一个星期
|
||||||
|
// saturday = saturday.plus(Period.ofDays(7));
|
||||||
|
// } while (saturday.compareTo(endD) < 1);
|
||||||
|
// // 第一个星期天
|
||||||
|
// LocalDate sunday = now.with(DayOfWeek.SUNDAY);
|
||||||
|
// do {
|
||||||
|
// if (CollectionUtils.isEmpty(weekMap)) {
|
||||||
|
// weekMap.add(sunday.toString());
|
||||||
|
// } else {
|
||||||
|
// weekMap.add(sunday.toString());
|
||||||
|
// }
|
||||||
|
// // 迭代一个星期
|
||||||
|
// sunday = sunday.plus(Period.ofDays(7));
|
||||||
|
// } while (sunday.compareTo(endD) < 1);
|
||||||
|
// String nextYear = DateUtil.offsetMonth(new Date(), 12).toString();
|
||||||
|
// int y = DateUtil.year(DateUtil.parse(nextYear));
|
||||||
|
// weekMap.add(String.valueOf(y) + "-01-01");
|
||||||
|
//
|
||||||
|
// weekMap.add("2024-02-05");
|
||||||
|
// weekMap.add("2024-02-06");
|
||||||
|
// weekMap.add("2024-02-07");
|
||||||
|
// weekMap.add("2024-02-08");
|
||||||
|
// weekMap.add("2024-02-09");
|
||||||
|
//
|
||||||
|
// weekMap.add("2024-02-12");
|
||||||
|
// weekMap.add("2024-02-13");
|
||||||
|
// weekMap.add("2024-02-14");
|
||||||
|
// weekMap.add("2024-02-15");
|
||||||
|
// weekMap.add("2024-02-16");
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// weekMap=weekMap.stream().filter(e->!e.equals("2024-02-04")).collect(Collectors.toList());
|
||||||
|
// Object[] array = weekMap.stream().sorted().toArray();
|
||||||
|
// return rb.success().setData(array);
|
||||||
|
// }
|
||||||
public ResultBean<Object> isSaturAndSun() {
|
public ResultBean<Object> isSaturAndSun() {
|
||||||
ResultBean rb = new ResultBean().fail();
|
ResultBean rb = new ResultBean().fail();
|
||||||
|
List<String> s=cannotReserveDictionaryService.getAllTime().getData();
|
||||||
Date date =new Date();
|
Object[] array = s.stream().sorted().toArray();
|
||||||
SimpleDateFormat sdf1 =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
String nowDate =sdf1.format(date);
|
|
||||||
String endDate= sdf1.format(DateUtil.offsetMonth(date,12));
|
|
||||||
LocalDate now = DateUtil.parse(nowDate).toSqlDate().toLocalDate();
|
|
||||||
LocalDate endD = DateUtil.parse(endDate).toSqlDate().toLocalDate();
|
|
||||||
List<String> weekMap = new ArrayList<>();
|
|
||||||
// 第一个星期六
|
|
||||||
LocalDate saturday = now.with(DayOfWeek.SATURDAY);
|
|
||||||
do {
|
|
||||||
if (CollectionUtils.isEmpty(weekMap)) {
|
|
||||||
weekMap.add(saturday.toString());
|
|
||||||
} else {
|
|
||||||
weekMap.add(saturday.toString());
|
|
||||||
}
|
|
||||||
// 迭代一个星期
|
|
||||||
saturday = saturday.plus(Period.ofDays(7));
|
|
||||||
} while (saturday.compareTo(endD) < 1);
|
|
||||||
// 第一个星期天
|
|
||||||
LocalDate sunday = now.with(DayOfWeek.SUNDAY);
|
|
||||||
do {
|
|
||||||
if (CollectionUtils.isEmpty(weekMap)) {
|
|
||||||
weekMap.add(sunday.toString());
|
|
||||||
} else {
|
|
||||||
weekMap.add(sunday.toString());
|
|
||||||
}
|
|
||||||
// 迭代一个星期
|
|
||||||
sunday = sunday.plus(Period.ofDays(7));
|
|
||||||
} while (sunday.compareTo(endD) < 1);
|
|
||||||
String nextYear = DateUtil.offsetMonth(new Date(), 12).toString();
|
|
||||||
int y = DateUtil.year(DateUtil.parse(nextYear));
|
|
||||||
weekMap.add(String.valueOf(y) + "-01-01");
|
|
||||||
|
|
||||||
weekMap.add("2024-02-05");
|
|
||||||
weekMap.add("2024-02-06");
|
|
||||||
weekMap.add("2024-02-07");
|
|
||||||
weekMap.add("2024-02-08");
|
|
||||||
weekMap.add("2024-02-09");
|
|
||||||
|
|
||||||
weekMap.add("2024-02-12");
|
|
||||||
weekMap.add("2024-02-13");
|
|
||||||
weekMap.add("2024-02-14");
|
|
||||||
weekMap.add("2024-02-15");
|
|
||||||
weekMap.add("2024-02-16");
|
|
||||||
|
|
||||||
|
|
||||||
weekMap=weekMap.stream().filter(e->!e.equals("2024-02-04")).collect(Collectors.toList());
|
|
||||||
Object[] array = weekMap.stream().sorted().toArray();
|
|
||||||
return rb.success().setData(array);
|
return rb.success().setData(array);
|
||||||
}
|
}
|
||||||
public CustomerStoreVo getStart(CustomerStoreVo vo) {
|
public CustomerStoreVo getStart(CustomerStoreVo vo) {
|
||||||
|
|||||||
@@ -81,6 +81,9 @@ public class NewcomerRecoRecordService extends MybatisBaseService<NewcomerRecoRe
|
|||||||
return rb.setMsg("您不是新人");
|
return rb.setMsg("您不是新人");
|
||||||
}
|
}
|
||||||
NewcomerRecoRecord newcomerRecoRecord = baseMapper.selectOne(new QueryWrapper<NewcomerRecoRecord>().eq("sid",dto.getOrderSid()));
|
NewcomerRecoRecord newcomerRecoRecord = baseMapper.selectOne(new QueryWrapper<NewcomerRecoRecord>().eq("sid",dto.getOrderSid()));
|
||||||
|
if(null==newcomerRecoRecord){
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
newcomerRecoRecord.setRecommendedSid(dto.getCustomerSid());
|
newcomerRecoRecord.setRecommendedSid(dto.getCustomerSid());
|
||||||
newcomerRecoRecord.setAssistanceDate(new Date());
|
newcomerRecoRecord.setAssistanceDate(new Date());
|
||||||
List<RecommendNewUserBagDetails>list=recommendNewUserBagDetailsService.list(new QueryWrapper<RecommendNewUserBagDetails>().eq("giftbagSid",newcomerRecoRecord.getGiftBagSid()));
|
List<RecommendNewUserBagDetails>list=recommendNewUserBagDetailsService.list(new QueryWrapper<RecommendNewUserBagDetails>().eq("giftbagSid",newcomerRecoRecord.getGiftBagSid()));
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
|
|||||||
public ResultBean submission(VegeCellarReserveOrderDto dto) {
|
public ResultBean submission(VegeCellarReserveOrderDto dto) {
|
||||||
ResultBean rb = new ResultBean().fail();
|
ResultBean rb = new ResultBean().fail();
|
||||||
boolean b = isSatAndSun(dto.getReserveDate());
|
boolean b = isSatAndSun(dto.getReserveDate());
|
||||||
// if (!b) {
|
if (!b) {
|
||||||
// return rb.setMsg("周六、周日不能预约提货");
|
return rb.setMsg("周六、周日不能预约提货");
|
||||||
// }
|
}
|
||||||
if (StringUtils.isBlank(dto.getCustomerSid())) {
|
if (StringUtils.isBlank(dto.getCustomerSid())) {
|
||||||
return rb.setMsg("参数不全");
|
return rb.setMsg("参数不全");
|
||||||
}
|
}
|
||||||
@@ -74,19 +74,19 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isSatAndSun(String date) {
|
// public boolean isSatAndSun(String date) {
|
||||||
DateTime dateTime = DateUtil.parse(date);
|
// DateTime dateTime = DateUtil.parse(date);
|
||||||
; // 获取当前时间
|
// ; // 获取当前时间
|
||||||
int dayOfWeek = dateTime.dayOfWeekEnum().getValue();// 获取星期几(1-7)
|
// int dayOfWeek = dateTime.dayOfWeekEnum().getValue();// 获取星期几(1-7)
|
||||||
System.out.println(dayOfWeek);
|
// System.out.println(dayOfWeek);
|
||||||
if (dayOfWeek == 1 || dayOfWeek == 7) {
|
// if (dayOfWeek == 1 || dayOfWeek == 7) {
|
||||||
return false;
|
// return false;
|
||||||
} else {
|
// } else {
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
public boolean isSatAndSun1(String date) {
|
public boolean isSatAndSun(String date) {
|
||||||
List<CannotReserveDictionary> l = cannotReserveDictionaryService.list(new QueryWrapper<CannotReserveDictionary>().eq("unavailableTime", date));
|
List<CannotReserveDictionary> l = cannotReserveDictionaryService.list(new QueryWrapper<CannotReserveDictionary>().eq("unavailableTime", date));
|
||||||
if (l.size() > 0) {
|
if (l.size() > 0) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
|||||||
.excludePathPatterns("/appletgiftbag/recommendRecord/**")
|
.excludePathPatterns("/appletgiftbag/recommendRecord/**")
|
||||||
//2024-01-17
|
//2024-01-17
|
||||||
.excludePathPatterns("/lpkgiftcard/getAllGoodsType/**")
|
.excludePathPatterns("/lpkgiftcard/getAllGoodsType/**")
|
||||||
|
.excludePathPatterns("/appletnotice/getNotice")
|
||||||
.excludePathPatterns("/lpkgoods/getAllGoodsType/**")
|
.excludePathPatterns("/lpkgoods/getAllGoodsType/**")
|
||||||
.excludePathPatterns("/transferrecords/submission")
|
.excludePathPatterns("/transferrecords/submission")
|
||||||
.excludePathPatterns("/vegetablecellar/receiveTransferGoods")
|
.excludePathPatterns("/vegetablecellar/receiveTransferGoods")
|
||||||
|
|||||||
Reference in New Issue
Block a user