11/23
This commit is contained in:
@@ -5,6 +5,7 @@ import com.yxt.yyth.api.lpkstore.StoreSelect;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,9 +27,27 @@ public class AppletVo {
|
|||||||
private String time;
|
private String time;
|
||||||
private String name="卡号:";
|
private String name="卡号:";
|
||||||
private String pName;
|
private String pName;
|
||||||
|
private String start;
|
||||||
|
private String end;
|
||||||
private List<GoodsVo> goodsVos;
|
private List<GoodsVo> goodsVos;
|
||||||
private List<StoreSelect> select;
|
private List<StoreSelect> select;
|
||||||
|
|
||||||
|
|
||||||
|
public String getStart() {
|
||||||
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
start=sdf.format(DateUtil.offsetDay(new Date(),+2));
|
||||||
|
|
||||||
|
int i=DateUtil.parse(sdf.format(DateUtil.parse(start))).compareTo(DateUtil.parse(sdf.format(DateUtil.parse(dateEnd))));
|
||||||
|
if(String.valueOf(i).equals("-1")){
|
||||||
|
end=sdf.format(DateUtil.parse(dateEnd));
|
||||||
|
}else{
|
||||||
|
end=sdf.format(DateUtil.offsetDay(DateUtil.parse(dateEnd),2));
|
||||||
|
}
|
||||||
|
return start;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
name=name+code;
|
name=name+code;
|
||||||
return name;
|
return name;
|
||||||
|
|||||||
@@ -13,4 +13,6 @@ public class GoodsVo {
|
|||||||
private String pic;
|
private String pic;
|
||||||
private double num;
|
private double num;
|
||||||
private double lNum;
|
private double lNum;
|
||||||
|
private double select=0;
|
||||||
|
private String goodsSid;
|
||||||
}
|
}
|
||||||
|
|||||||
14
src/main/java/com/yxt/yyth/api/lpkreserveorder/Goods.java
Normal file
14
src/main/java/com/yxt/yyth/api/lpkreserveorder/Goods.java
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package com.yxt.yyth.api.lpkreserveorder;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2023/11/23 14:34
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Goods {
|
||||||
|
private double goodsNumber;//数量
|
||||||
|
private String goodsSid;//商品sid
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,8 +1,22 @@
|
|||||||
package com.yxt.yyth.api.lpkreserveorder;
|
package com.yxt.yyth.api.lpkreserveorder;
|
||||||
|
|
||||||
|
import com.yxt.common.core.dto.Dto;
|
||||||
|
import com.yxt.yyth.api.lpkgiftcard.GoodsVo;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wangpengfei
|
* @author wangpengfei
|
||||||
* @date 2023/11/23 10:29
|
* @date 2023/11/23 10:29
|
||||||
*/
|
*/
|
||||||
public class LpkReserveOrderDto {
|
@Data
|
||||||
|
public class LpkReserveOrderDto implements Dto {
|
||||||
|
private String cardSid;//礼包卡sid
|
||||||
|
private String sid;
|
||||||
|
private String value;
|
||||||
|
private String storeSid;//发放点
|
||||||
|
private String customerSid;//客户sid
|
||||||
|
private String reserveDate;//发放时间
|
||||||
|
private List<GoodsVo> goodsVos;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
package com.yxt.yyth.api.lpkreserveordergoods;
|
package com.yxt.yyth.api.lpkreserveordergoods;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wangpengfei
|
* @author wangpengfei
|
||||||
* @date 2023/11/23 10:29
|
* @date 2023/11/23 10:29
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
public class LpkReserveOrderGoodsDto {
|
public class LpkReserveOrderGoodsDto {
|
||||||
|
private String cardSid;
|
||||||
|
private String goodsSid;
|
||||||
|
private String goodsNumber;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import com.yxt.yyth.api.lpkgiftbag.LpkGiftBagVo;
|
|||||||
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 java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wangpengfei
|
* @author wangpengfei
|
||||||
* @date 2023/11/21 15:03
|
* @date 2023/11/21 15:03
|
||||||
@@ -20,4 +22,5 @@ public interface LpkGiftBagMapper extends BaseMapper<LpkGiftBag> {
|
|||||||
|
|
||||||
|
|
||||||
IPage<LpkGiftBagVo> giftBagListPage(IPage<LpkGiftBag> page, @Param(Constants.WRAPPER) QueryWrapper<LpkGiftBag> qw);
|
IPage<LpkGiftBagVo> giftBagListPage(IPage<LpkGiftBag> page, @Param(Constants.WRAPPER) QueryWrapper<LpkGiftBag> qw);
|
||||||
|
List<LpkGiftBagVo> giftBagList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,4 +18,9 @@
|
|||||||
${ew.sqlSegment}
|
${ew.sqlSegment}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="giftBagList" resultType="com.yxt.yyth.api.lpkgiftbag.LpkGiftBagVo">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
from lpk_giftbag
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -53,5 +53,9 @@ public class LpkGiftBagRest {
|
|||||||
public ResultBean deleteBag(@PathVariable("sid") String sid) {
|
public ResultBean deleteBag(@PathVariable("sid") String sid) {
|
||||||
return lpkGiftBagService.deleteBag(sid);
|
return lpkGiftBagService.deleteBag(sid);
|
||||||
}
|
}
|
||||||
|
@ApiOperation("礼包信息列表")
|
||||||
|
@GetMapping("/giftBagList")
|
||||||
|
public ResultBean giftBagList() {
|
||||||
|
return lpkGiftBagService.giftBagList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,4 +172,9 @@ public class LpkGiftBagService extends MybatisBaseService<LpkGiftBagMapper, LpkG
|
|||||||
}
|
}
|
||||||
return rb.success();
|
return rb.success();
|
||||||
}
|
}
|
||||||
|
public ResultBean giftBagList() {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
List<LpkGiftBagVo> pagging = baseMapper.giftBagList();
|
||||||
|
return rb.success().setData(pagging);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
GoodsVo goodsVo=new GoodsVo();
|
GoodsVo goodsVo=new GoodsVo();
|
||||||
goodsVo.setGoods(s.getGoodsName());
|
goodsVo.setGoods(s.getGoodsName());
|
||||||
goodsVo.setNum(s.getGoodsNumber());
|
goodsVo.setNum(s.getGoodsNumber());
|
||||||
|
goodsVo.setGoodsSid(s.getGoodsSid());
|
||||||
goodsVo.setPic(urlPrefix+s.getPicUrl());
|
goodsVo.setPic(urlPrefix+s.getPicUrl());
|
||||||
if(null!=goods){
|
if(null!=goods){
|
||||||
if(goods.getGoodsNumber()!=s.getGoodsNumber()){
|
if(goods.getGoodsNumber()!=s.getGoodsNumber()){
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
package com.yxt.yyth.biz.lpkreserveorder;
|
package com.yxt.yyth.biz.lpkreserveorder;
|
||||||
|
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderDto;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@@ -15,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
*/
|
*/
|
||||||
@Api(tags = "预约订单信息")
|
@Api(tags = "预约订单信息")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("lpksreservoorder")
|
@RequestMapping("/lpksreservoorder")
|
||||||
public class LpkReserveOrderRest {
|
public class LpkReserveOrderRest {
|
||||||
@Autowired
|
@Autowired
|
||||||
LpkReserveOrderService lpkReserveOrderService;
|
LpkReserveOrderService lpkReserveOrderService;
|
||||||
@@ -23,7 +25,7 @@ public class LpkReserveOrderRest {
|
|||||||
|
|
||||||
@ApiOperation("预约提交")
|
@ApiOperation("预约提交")
|
||||||
@PostMapping("/submission")
|
@PostMapping("/submission")
|
||||||
public ResultBean submission(){
|
public ResultBean submission(@RequestBody LpkReserveOrderDto dto){
|
||||||
return lpkReserveOrderService.submission();
|
return lpkReserveOrderService.submission(dto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
package com.yxt.yyth.biz.lpkreserveorder;
|
package com.yxt.yyth.biz.lpkreserveorder;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
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.yyth.api.lpkreserveorder.Goods;
|
||||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrder;
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrder;
|
||||||
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderDto;
|
||||||
|
import com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoodsDto;
|
||||||
|
import com.yxt.yyth.biz.lpkreserveordergoods.LpkReserveOrderGoodsService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wangpengfei
|
* @author wangpengfei
|
||||||
@@ -11,8 +18,16 @@ import org.springframework.stereotype.Service;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMapper, LpkReserveOrder> {
|
public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMapper, LpkReserveOrder> {
|
||||||
public ResultBean submission(){
|
@Autowired
|
||||||
|
LpkReserveOrderGoodsService lpkReserveOrderGoodsService;
|
||||||
|
public ResultBean submission( LpkReserveOrderDto dto){
|
||||||
ResultBean rb=new ResultBean();
|
ResultBean rb=new ResultBean();
|
||||||
return rb.success().setData("1");
|
LpkReserveOrder order=new LpkReserveOrder();
|
||||||
|
BeanUtil.copyProperties(dto, order, "id", "sid");
|
||||||
|
order.setStoreSid(dto.getValue());
|
||||||
|
baseMapper.insert(order);
|
||||||
|
|
||||||
|
lpkReserveOrderGoodsService.submissionDetail(dto);
|
||||||
|
return rb.success().setData("预约成功");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.yxt.yyth.biz.lpkreserveordergoods;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoods;
|
import com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoods;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wangpengfei
|
* @author wangpengfei
|
||||||
@@ -10,4 +12,6 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface LpkReserveOrderGoodsMapper extends BaseMapper<LpkReserveOrderGoods> {
|
public interface LpkReserveOrderGoodsMapper extends BaseMapper<LpkReserveOrderGoods> {
|
||||||
|
@Select("select sum(goodsNumber) as goodsNumber , goodsSid as goodsSid from lpk_reserve_order_goods where cardSid=#{cardSid} and goodsSid=#{goodsSid}")
|
||||||
|
LpkReserveOrderGoods getReserveByCardSid (@Param("cardSid")String cardSid,@Param("goodsSid") String goodsSid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.yxt.yyth.biz.lpkreserveordergoods;
|
package com.yxt.yyth.biz.lpkreserveordergoods;
|
||||||
|
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderDto;
|
||||||
|
import com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoodsDto;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -21,8 +23,8 @@ public class LpkReserveOrderGoodsRest {
|
|||||||
|
|
||||||
|
|
||||||
// @ApiOperation("预约提交")
|
// @ApiOperation("预约提交")
|
||||||
// @PostMapping("/getReserveByCardSid")
|
// @PostMapping("/submissionDetail")
|
||||||
// public ResultBean getReserveByCardSid(String sid){
|
// public ResultBean submissionDetail(LpkReserveOrderGoodsDto dto){
|
||||||
// return lpkReserveOrderGoodsService.getReserveByCardSid(sid);
|
// return lpkReserveOrderGoodsService.submissionDetail(dto);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
package com.yxt.yyth.biz.lpkreserveordergoods;
|
package com.yxt.yyth.biz.lpkreserveordergoods;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
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.yyth.api.lpkgiftcard.GoodsVo;
|
||||||
|
import com.yxt.yyth.api.lpkreserveorder.Goods;
|
||||||
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrder;
|
||||||
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderDto;
|
||||||
import com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoods;
|
import com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoods;
|
||||||
|
import com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoodsDto;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -16,7 +22,23 @@ import java.util.List;
|
|||||||
public class LpkReserveOrderGoodsService extends MybatisBaseService<LpkReserveOrderGoodsMapper, LpkReserveOrderGoods> {
|
public class LpkReserveOrderGoodsService extends MybatisBaseService<LpkReserveOrderGoodsMapper, LpkReserveOrderGoods> {
|
||||||
public ResultBean<LpkReserveOrderGoods> getReserveByCardSid(String carSid,String goodsSid){
|
public ResultBean<LpkReserveOrderGoods> getReserveByCardSid(String carSid,String goodsSid){
|
||||||
ResultBean rb=new ResultBean();
|
ResultBean rb=new ResultBean();
|
||||||
LpkReserveOrderGoods goods= baseMapper.selectOne(new QueryWrapper<LpkReserveOrderGoods>().eq("cardSid",carSid).eq("goodsSid",goodsSid));
|
LpkReserveOrderGoods goods= baseMapper.getReserveByCardSid(carSid,goodsSid);
|
||||||
return rb.success().setData(goods);
|
return rb.success().setData(goods);
|
||||||
}
|
}
|
||||||
|
public ResultBean submissionDetail(LpkReserveOrderDto dto){
|
||||||
|
ResultBean rb=new ResultBean();
|
||||||
|
LpkReserveOrderGoods goods=new LpkReserveOrderGoods();
|
||||||
|
BeanUtil.copyProperties(dto, goods, "id", "sid");
|
||||||
|
goods.setCardSid(dto.getSid());
|
||||||
|
for (GoodsVo goods1:dto.getGoodsVos()){
|
||||||
|
if(goods1.getSelect()!=0){
|
||||||
|
goods.setCardSid(dto.getCardSid());
|
||||||
|
goods.setGoodsSid(goods1.getGoodsSid());
|
||||||
|
goods.setGoodsNumber(goods1.getSelect());
|
||||||
|
baseMapper.insert(goods);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rb.success().setData("预约成功");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user