1/30
This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
package com.yxt.yythmall.api.appletnotice;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2023/12/8 9:10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AppletNotice {
|
||||||
|
private String id;
|
||||||
|
private String sid= UUID.randomUUID().toString();
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date createTime;
|
||||||
|
private String remarks;
|
||||||
|
private String isEnable;
|
||||||
|
private String title;
|
||||||
|
private String content;
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
private Date startDate;
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
|
||||||
|
private Date endDate;
|
||||||
|
private String sort;
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
|
||||||
|
private Date releaseTime;//发布时间
|
||||||
|
private String publisher;//发布人
|
||||||
|
private String isShow;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.yxt.yythmall.api.appletnotice;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.yxt.common.core.dto.Dto;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2023/12/8 9:11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AppletNoticeDto implements Dto {
|
||||||
|
private String id;
|
||||||
|
private String sid;
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date createTime;
|
||||||
|
private String remarks;
|
||||||
|
private String isEnable;
|
||||||
|
private String title;//标题
|
||||||
|
private String content;//内容
|
||||||
|
|
||||||
|
private String startDate;//开始时间
|
||||||
|
|
||||||
|
private String endDate;//结束时间
|
||||||
|
private String sort;//排序
|
||||||
|
|
||||||
|
private String releaseTime;//发布时间
|
||||||
|
private String publisher;//发布人
|
||||||
|
private String isShow;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.yxt.yythmall.api.appletnotice;
|
||||||
|
|
||||||
|
import com.yxt.common.core.query.Query;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2023/12/8 9:11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AppletNoticeQuery implements Query {
|
||||||
|
private String startDate; //开始时间
|
||||||
|
private String endDate; //结束时间
|
||||||
|
private String countNumber; //总数
|
||||||
|
private String name;
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.yxt.yythmall.api.appletnotice;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.yxt.common.core.vo.Vo;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2023/12/8 9:11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AppletNoticeVo implements Vo {
|
||||||
|
private String id;
|
||||||
|
private String sid;
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date createTime;
|
||||||
|
private String remarks;
|
||||||
|
private String isEnable;
|
||||||
|
private String title;//标题
|
||||||
|
private String content;//内容
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
private Date startDate;//开始时间
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
private Date endDate;//结束时间
|
||||||
|
private String sort;//排序
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
private Date releaseTime;//发布时间
|
||||||
|
private String publisher;//发布人
|
||||||
|
private String isShow;
|
||||||
|
}
|
||||||
@@ -44,7 +44,7 @@ public class LpkCustomer {
|
|||||||
@ApiModelProperty("所在区域名称")
|
@ApiModelProperty("所在区域名称")
|
||||||
private String regionName;
|
private String regionName;
|
||||||
private String isNewUser;//是否新人 0 否 1 是
|
private String isNewUser;//是否新人 0 否 1 是
|
||||||
private String isPurchase;//是否购买过 0 否 1 是
|
private String isPurchase;//是否购买过 0 是 1否
|
||||||
|
|
||||||
@ApiModelProperty("客户绑定的支行sid")
|
@ApiModelProperty("客户绑定的支行sid")
|
||||||
private String customerBankSid;
|
private String customerBankSid;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public class VegeCellarReserveOrderVo implements Vo {
|
|||||||
private String userPhone; //用户电话
|
private String userPhone; //用户电话
|
||||||
private String store; //门店
|
private String store; //门店
|
||||||
private String storeSid; //门店
|
private String storeSid; //门店
|
||||||
|
private String storeName; //门店
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd ",timezone="GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd ",timezone="GMT+8")
|
||||||
private Date reserveDate; //预约时间
|
private Date reserveDate; //预约时间
|
||||||
private String bagName; //礼包
|
private String bagName; //礼包
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.yxt.yythmall.biz.appletnotice;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.yxt.yythmall.api.appletnotice.AppletNotice;
|
||||||
|
import com.yxt.yythmall.api.appletnotice.AppletNoticeVo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2023/11/23 10:36
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AppletNoticeMapper extends BaseMapper<AppletNotice> {
|
||||||
|
|
||||||
|
IPage<AppletNoticeVo> pageList(IPage<AppletNotice> page, @Param(Constants.WRAPPER) QueryWrapper<AppletNotice> qw);
|
||||||
|
|
||||||
|
List<AppletNoticeVo> getNotices (@Param("now") String now);
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.yxt.yythmall.biz.appletnotice.AppletNoticeMapper">
|
||||||
|
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||||
|
<!-- ${ew.customSqlSegment} -->
|
||||||
|
|
||||||
|
<select id="pageList" resultType="com.yxt.yythmall.api.appletnotice.AppletNoticeVo">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
from applet_notice
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="getNotices" resultType="com.yxt.yythmall.api.appletnotice.AppletNoticeVo">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
from applet_notice
|
||||||
|
<where>
|
||||||
|
isShow !=2
|
||||||
|
and date_format (startDate,'%Y-%m-%d') >= date_format(#{now},'%Y-%m-%d')
|
||||||
|
and date_format (endDate,'%Y-%m-%d') <= date_format(#{now},'%Y-%m-%d')
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.yxt.yythmall.biz.appletnotice;
|
||||||
|
|
||||||
|
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.appletnotice.AppletNoticeDto;
|
||||||
|
import com.yxt.yythmall.api.appletnotice.AppletNoticeQuery;
|
||||||
|
import com.yxt.yythmall.api.appletnotice.AppletNoticeVo;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2023/11/23 10:35
|
||||||
|
*/
|
||||||
|
@Api(tags = "公告记录表")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("appletnotice")
|
||||||
|
public class AppletNoticeRest {
|
||||||
|
@Autowired
|
||||||
|
AppletNoticeService NoticeService;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("分页列表")
|
||||||
|
@PostMapping("/pageList")
|
||||||
|
public ResultBean<PagerVo<AppletNoticeVo>> pageList(@RequestBody PagerQuery<AppletNoticeQuery> pq){
|
||||||
|
return NoticeService.pageList(pq);
|
||||||
|
}
|
||||||
|
@ApiOperation("修改或保存")
|
||||||
|
@PostMapping("/saveOrUpdate")
|
||||||
|
public ResultBean saveOrUpdate(@RequestBody AppletNoticeDto dto){
|
||||||
|
return NoticeService.saveOrUpdate(dto);
|
||||||
|
}
|
||||||
|
@ApiOperation("初始化")
|
||||||
|
@GetMapping("/noticeInit/{sid}")
|
||||||
|
public ResultBean noticeInit(@PathVariable("sid")String sid){
|
||||||
|
return NoticeService.noticeInit(sid);
|
||||||
|
}
|
||||||
|
@ApiOperation("是否显示")
|
||||||
|
@GetMapping("/isDisplayed/{sid}/{state}")
|
||||||
|
public ResultBean isDisplayed(@PathVariable("sid")String sid,@PathVariable("state")String state){
|
||||||
|
return NoticeService.isDisplayed(sid,state);
|
||||||
|
}
|
||||||
|
@ApiOperation("是否显示")
|
||||||
|
@GetMapping("/getNotice")
|
||||||
|
public ResultBean getNotice(){
|
||||||
|
return NoticeService.getNotice();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package com.yxt.yythmall.biz.appletnotice;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.yxt.common.base.service.MybatisBaseService;
|
||||||
|
import com.yxt.common.base.utils.PagerUtil;
|
||||||
|
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.appletnotice.AppletNotice;
|
||||||
|
import com.yxt.yythmall.api.appletnotice.AppletNoticeDto;
|
||||||
|
import com.yxt.yythmall.api.appletnotice.AppletNoticeQuery;
|
||||||
|
import com.yxt.yythmall.api.appletnotice.AppletNoticeVo;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2023/11/23 10:36
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AppletNoticeService extends MybatisBaseService<AppletNoticeMapper, AppletNotice> {
|
||||||
|
|
||||||
|
public ResultBean<PagerVo<AppletNoticeVo>> pageList(PagerQuery<AppletNoticeQuery> pq) {
|
||||||
|
ResultBean rb = new ResultBean();
|
||||||
|
AppletNoticeQuery query = pq.getParams();
|
||||||
|
|
||||||
|
|
||||||
|
IPage<AppletNotice> page = PagerUtil.queryToPage(pq);
|
||||||
|
QueryWrapper<AppletNotice> qw = new QueryWrapper<>();
|
||||||
|
if (StringUtils.isNotBlank(query.getCountNumber())) {
|
||||||
|
qw.like("title", query.getName());
|
||||||
|
}
|
||||||
|
IPage<AppletNoticeVo> pagging = baseMapper.pageList(page, qw);
|
||||||
|
PagerVo<AppletNoticeVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
|
return rb.success().setData(p);
|
||||||
|
}
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public ResultBean saveOrUpdate(AppletNoticeDto dto) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
if (StringUtils.isNotBlank(dto.getSid())) {
|
||||||
|
AppletNotice notice = fetchBySid(dto.getSid());
|
||||||
|
BeanUtil.copyProperties(dto, notice, "id", "sid");
|
||||||
|
notice.setCreateTime(new DateTime());
|
||||||
|
baseMapper.updateById(notice);
|
||||||
|
} else {
|
||||||
|
AppletNotice notice = new AppletNotice();
|
||||||
|
BeanUtil.copyProperties(dto, notice, "id", "sid");
|
||||||
|
notice.setCreateTime(new DateTime());
|
||||||
|
baseMapper.insert(notice);
|
||||||
|
}
|
||||||
|
return rb.success().setData("成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean noticeInit(String sid) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
AppletNotice entity = fetchBySid(sid);
|
||||||
|
return rb.success().setData(entity);
|
||||||
|
}
|
||||||
|
public ResultBean isDisplayed(String sid,String state) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
AppletNotice entity = fetchBySid(sid);
|
||||||
|
entity.setIsShow(state);
|
||||||
|
baseMapper.updateById(entity);
|
||||||
|
return rb.success().setData("成功");
|
||||||
|
}
|
||||||
|
public ResultBean getNotice() {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
List<AppletNoticeVo> noticeVos= baseMapper.getNotices(sdf.format(new Date()));
|
||||||
|
return rb.success().setData(noticeVos);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -101,7 +101,21 @@ public class CustomerStoreService extends MybatisBaseService<CustomerStoreMapper
|
|||||||
String nextYear = DateUtil.offsetMonth(new Date(), 12).toString();
|
String nextYear = DateUtil.offsetMonth(new Date(), 12).toString();
|
||||||
int y = DateUtil.year(DateUtil.parse(nextYear));
|
int y = DateUtil.year(DateUtil.parse(nextYear));
|
||||||
weekMap.add(String.valueOf(y) + "-01-01");
|
weekMap.add(String.valueOf(y) + "-01-01");
|
||||||
weekMap=weekMap.stream().filter(e->!e.equals("2024-01-28")).collect(Collectors.toList());
|
|
||||||
|
weekMap.add(String.valueOf(y) + "-02-05");
|
||||||
|
weekMap.add(String.valueOf(y) + "-02-06");
|
||||||
|
weekMap.add(String.valueOf(y) + "-02-07");
|
||||||
|
weekMap.add(String.valueOf(y) + "-02-08");
|
||||||
|
weekMap.add(String.valueOf(y) + "-02-09");
|
||||||
|
|
||||||
|
weekMap.add(String.valueOf(y) + "-02-12");
|
||||||
|
weekMap.add(String.valueOf(y) + "-02-13");
|
||||||
|
weekMap.add(String.valueOf(y) + "-02-14");
|
||||||
|
weekMap.add(String.valueOf(y) + "-02-15");
|
||||||
|
weekMap.add(String.valueOf(y) + "-02-16");
|
||||||
|
|
||||||
|
|
||||||
|
weekMap=weekMap.stream().filter(e->!e.equals("2024-02-04")).collect(Collectors.toList());
|
||||||
Object[] array = weekMap.stream().sorted().toArray();
|
Object[] array = weekMap.stream().sorted().toArray();
|
||||||
return rb.success().setData(array);
|
return rb.success().setData(array);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -253,9 +253,12 @@
|
|||||||
when 1001000 then '百姓菜窖'
|
when 1001000 then '百姓菜窖'
|
||||||
when 1001020 then '精品菜窖'
|
when 1001020 then '精品菜窖'
|
||||||
when 1001045 then '企业菜窖'
|
when 1001045 then '企业菜窖'
|
||||||
end affiliationValue
|
end affiliationValue,
|
||||||
|
s.name as storeName,
|
||||||
|
s.address as address
|
||||||
FROM
|
FROM
|
||||||
vege_cellar_reserve_order AS o
|
vege_cellar_reserve_order AS o
|
||||||
|
left join lpk_store s on s.sid=o.storeSid
|
||||||
<where>
|
<where>
|
||||||
o.customerSid=#{query.customerSid} and state=#{query.state}
|
o.customerSid=#{query.customerSid} and state=#{query.state}
|
||||||
</where>
|
</where>
|
||||||
|
|||||||
@@ -48,9 +48,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("参数不全");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,10 +93,11 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
|
|||||||
LpkCustomer customer=lpkCustomerService.getOne(new QueryWrapper<LpkCustomer>().eq("sid",ordOrder.getUserSid()));
|
LpkCustomer customer=lpkCustomerService.getOne(new QueryWrapper<LpkCustomer>().eq("sid",ordOrder.getUserSid()));
|
||||||
if(n!=null){
|
if(n!=null){
|
||||||
aa(n.getGiftBagSid(),n.getRecommendSid());
|
aa(n.getGiftBagSid(),n.getRecommendSid());
|
||||||
customer.setIsNewUser("0");
|
|
||||||
n.setState("2");
|
n.setState("2");
|
||||||
newcomerRecoRecordService.updateById(n);
|
newcomerRecoRecordService.updateById(n);
|
||||||
}
|
}
|
||||||
|
customer.setIsNewUser("0");
|
||||||
customer.setIsPurchase("0");
|
customer.setIsPurchase("0");
|
||||||
lpkCustomerService.updateById(customer);
|
lpkCustomerService.updateById(customer);
|
||||||
ordOrder.setPayStatus(4);
|
ordOrder.setPayStatus(4);
|
||||||
|
|||||||
Reference in New Issue
Block a user