Browse Source

企业菜窖规则

master
wangpengfei 1 year ago
parent
commit
d762faf549
  1. 2
      src/main/java/com/yxt/yythmall/biz/appletnotice/AppletNoticeService.java
  2. 2
      src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreService.java
  3. 2
      src/main/java/com/yxt/yythmall/biz/shoppingcart/ShoppingCartService.java
  4. 54
      src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java

2
src/main/java/com/yxt/yythmall/biz/appletnotice/AppletNoticeService.java

@ -35,7 +35,7 @@ public class AppletNoticeService extends MybatisBaseService<AppletNoticeMapper,
IPage<AppletNotice> page = PagerUtil.queryToPage(pq);
QueryWrapper<AppletNotice> qw = new QueryWrapper<>();
if (StringUtils.isNotBlank(query.getCountNumber())) {
if (StringUtils.isNotBlank(query.getName())) {
qw.like("title", query.getName());
}
IPage<AppletNoticeVo> pagging = baseMapper.pageList(page, qw);

2
src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreService.java

@ -91,7 +91,7 @@ public class CustomerStoreService extends MybatisBaseService<CustomerStoreMapper
LocalDate sunday = now.with(DayOfWeek.SUNDAY);
do {
if (CollectionUtils.isEmpty(weekMap)) {
weekMap.add(saturday.toString());
weekMap.add(sunday.toString());
} else {
weekMap.add(sunday.toString());
}

2
src/main/java/com/yxt/yythmall/biz/shoppingcart/ShoppingCartService.java

@ -178,6 +178,8 @@ public class ShoppingCartService extends MybatisBaseService<ShoppingCartMapper,
}
}
return vo;
}else if(vo.getAffiliation().equals("1001020")){
return vo;
};
vo.setRemarks("已减免附加额");
if (weight <= 99) {

54
src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java

@ -12,11 +12,13 @@ import com.yxt.common.base.utils.StringUtils;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import com.yxt.yythmall.api.cannotreservedictionary.CannotReserveDictionary;
import com.yxt.yythmall.api.lpkgoods.LpkGoods;
import com.yxt.yythmall.api.lpkreserveorder.LpkReserveOrderQuery;
import com.yxt.yythmall.api.lpkstore.LpkStore;
import com.yxt.yythmall.api.vegecallerreservedetails.VegeCellarReserveDetails;
import com.yxt.yythmall.api.vegecallerreserveorder.*;
import com.yxt.yythmall.biz.cannotreservedictionary.CannotReserveDictionaryService;
import com.yxt.yythmall.biz.lpkgiftcard.generateRule.UniqueIdGenerator;
import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService;
import com.yxt.yythmall.biz.lpkstore.LpkStoreService;
@ -43,6 +45,8 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
@Autowired
private LpkGoodsService lpkGoodsService;
@Autowired
CannotReserveDictionaryService cannotReserveDictionaryService;
@Transactional(rollbackFor = Exception.class)
public ResultBean submission(VegeCellarReserveOrderDto dto) {
@ -69,48 +73,6 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
return rb;
}
public ResultBean addGoodsOrder(VegeCellarReserveOrderDto dto) {
ResultBean rb = new ResultBean().fail();
boolean b = isSatAndSun(dto.getReserveDate());
if (!b) {
return rb.setMsg("周六、周日不能预约提货");
}
VegeCellarReserveOrder order = new VegeCellarReserveOrder();
order = baseMapper.selectList(new QueryWrapper<VegeCellarReserveOrder>().eq("customerSid", dto.getCustomerSid())
.eq("affiliation", dto.getAffiliation()).eq("state", "0")).get(0);
if (order == null) {
BeanUtil.copyProperties(dto, order, "id", "sid");
order.setStoreSid(dto.getStoreSid());
// order.setCardSid(dto.getSid());
order.setCreateTime(new DateTime());
baseMapper.insert(order);
}
dto.setOrderSid(order.getSid());
vegeCellarReserveDetailsService.addDetail(dto);
return rb.success().setData("预约成功");
}
public ResultBean minusGoodsOrder(VegeCellarReserveOrderDto dto) {
ResultBean rb = new ResultBean().fail();
boolean b = isSatAndSun(dto.getReserveDate());
if (!b) {
return rb.setMsg("周六、周日不能预约提货");
}
VegeCellarReserveOrder order = new VegeCellarReserveOrder();
order = baseMapper.selectList(new QueryWrapper<VegeCellarReserveOrder>().eq("customerSid", dto.getCustomerSid())
.eq("affiliation", dto.getAffiliation()).eq("state", "0")).get(0);
if (order == null) {
BeanUtil.copyProperties(dto, order, "id", "sid");
order.setStoreSid(dto.getStoreSid());
// order.setCardSid(dto.getSid());
order.setCreateTime(new DateTime());
baseMapper.insert(order);
}
dto.setOrderSid(order.getSid());
vegeCellarReserveDetailsService.addDetail(dto);
return rb.success().setData("预约成功");
}
public boolean isSatAndSun(String date) {
DateTime dateTime = DateUtil.parse(date);
@ -123,7 +85,13 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
return true;
}
}
public boolean isSatAndSun1(String date) {
List<CannotReserveDictionary>l =cannotReserveDictionaryService.list(new QueryWrapper<CannotReserveDictionary>().eq("unavailableTime",date));
if (l.size()>0){
return false;
}
return true;
}
// @Test
// public void isSatAndSun(){
// String date="2023-12-11";

Loading…
Cancel
Save