1/19
This commit is contained in:
@@ -27,6 +27,7 @@ public class AppletGiftBagVo implements Vo {
|
||||
private String isRecommend;//是否推荐 1 推荐 0 默认
|
||||
private String remarks;
|
||||
private String count;//
|
||||
private String goodsSid;
|
||||
private List<GiftBagGoods> giftBagGoods;
|
||||
private List<recommendRecord> recordList;
|
||||
|
||||
|
||||
@@ -43,4 +43,6 @@ public class LpkCustomer {
|
||||
private String regionCode;
|
||||
@ApiModelProperty("所在区域名称")
|
||||
private String regionName;
|
||||
private String isNewUser;//是否新人 0 否 1 是
|
||||
private String isPurchase;//是否购买过 0 否 1 是
|
||||
}
|
||||
|
||||
@@ -15,4 +15,6 @@ public class LpkGiftCardQuery implements Query {
|
||||
private String name;
|
||||
private String sid;
|
||||
private String affiliation;
|
||||
private String brandId;
|
||||
private String categoryId;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.yxt.yythmall.api.lpkgoods;
|
||||
|
||||
import com.yxt.yythmall.mallplus.mbg.pms.entity.brand.BrandVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2024/1/15 15:06
|
||||
@@ -10,5 +13,8 @@ import lombok.Data;
|
||||
public class GoodsTypeVo {
|
||||
private String name;
|
||||
private String sid;
|
||||
private String id;
|
||||
private String count;
|
||||
private List<GoodsTypeVo> typeVos;
|
||||
private List<BrandVo> brandVos;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.yxt.yythmall.api.newcomerrecorecord;
|
||||
|
||||
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 NewcomerRecoRecord {
|
||||
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 recommendSid;
|
||||
private String recommendedSid;
|
||||
private String giftBagSid;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date assistanceDate;
|
||||
private String giftName;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.yxt.yythmall.api.newcomerrecorecord;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.dto.Dto;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/8 9:11
|
||||
*/
|
||||
@Data
|
||||
public class NewcomerRecoRecordDto 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 recommendSid;//推荐人
|
||||
private String recommendedSid;//被推荐人
|
||||
private String giftBagSid;//礼包sid
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date assistanceDate;//助力时间
|
||||
private String state;
|
||||
private String giftName;//礼包名
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.yxt.yythmall.api.newcomerrecorecord;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/8 9:11
|
||||
*/
|
||||
@Data
|
||||
public class NewcomerRecoRecordQuery implements Query {
|
||||
private String startDate; //开始时间
|
||||
private String endDate; //结束时间
|
||||
private String countNumber; //总数
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yxt.yythmall.api.newcomerrecorecord;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/8 9:11
|
||||
*/
|
||||
@Data
|
||||
public class NewcomerRecoRecordVo 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 recommendSid;
|
||||
private String recommendedSid;
|
||||
private String giftBagSid;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date assistanceDate;
|
||||
private String giftName;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.yxt.yythmall.api.transferrecords;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:29
|
||||
*/
|
||||
@Data
|
||||
public class TransferRecords {
|
||||
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 customerSid;//客户sid
|
||||
private String transferCode;//转赠code
|
||||
private String affiliation;//所属菜窖
|
||||
private String state;//
|
||||
private String recipientSid;//领取人
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.yxt.yythmall.api.transferrecords;
|
||||
|
||||
import com.yxt.common.core.dto.Dto;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.GoodsVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:29
|
||||
*/
|
||||
@Data
|
||||
public class TransferRecordsDto implements Dto {
|
||||
private String customerSid;//客户sid
|
||||
private String transferCode;//转赠code
|
||||
private String affiliation;//所属菜窖
|
||||
private String state;//
|
||||
private String recipientSid;//领取人
|
||||
private String orderSid;
|
||||
private List<GoodsVo> goodsVos;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.yxt.yythmall.api.transferrecords;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:30
|
||||
*/
|
||||
@Data
|
||||
public class TransferRecordsQuery implements Query {
|
||||
private String userName; //用户名
|
||||
private String store; // 门店
|
||||
private String startDate; //预约开始日期
|
||||
private String endDate; // 预约结束日期
|
||||
private String userSid;
|
||||
private String storeSid;
|
||||
private String bankSid;
|
||||
private String bankName;
|
||||
private String serialNumber;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.yxt.yythmall.api.transferrecords;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.OrderGoodsVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Fan
|
||||
* @description
|
||||
* @date 2023/11/27 15:11
|
||||
*/
|
||||
@Data
|
||||
public class TransferRecordsVo implements Vo {
|
||||
private String customerSid;//客户sid
|
||||
private String transferCode;//转赠code
|
||||
private String affiliation;//所属菜窖
|
||||
private String state;//
|
||||
private String recipientSid;//领取人
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yxt.yythmall.api.transferrecordsgoodsdetails;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:29
|
||||
*/
|
||||
@Data
|
||||
public class TransferRecordsGoodsDetails {
|
||||
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 orderSid;
|
||||
private String goodsSid;
|
||||
private double goodsNumber;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.yxt.yythmall.api.transferrecordsgoodsdetails;
|
||||
|
||||
import com.yxt.common.core.dto.Dto;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.GoodsVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:29
|
||||
*/
|
||||
@Data
|
||||
public class TransferRecordsGoodsDetailsDto implements Dto {
|
||||
private String orderSid;
|
||||
private String goodsSid;
|
||||
private String goodsNumber;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.yxt.yythmall.api.transferrecordsgoodsdetails;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:30
|
||||
*/
|
||||
@Data
|
||||
public class TransferRecordsGoodsDetailsQuery implements Query {
|
||||
private String userName; //用户名
|
||||
private String store; // 门店
|
||||
private String startDate; //预约开始日期
|
||||
private String endDate; // 预约结束日期
|
||||
private String userSid;
|
||||
private String storeSid;
|
||||
private String bankSid;
|
||||
private String bankName;
|
||||
private String serialNumber;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.yxt.yythmall.api.transferrecordsgoodsdetails;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.OrderGoodsVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Fan
|
||||
* @description
|
||||
* @date 2023/11/27 15:11
|
||||
*/
|
||||
@Data
|
||||
public class TransferRecordsGoodsDetailsVo implements Vo {
|
||||
private String sid; //预约订单sid
|
||||
private String userName; //用户名
|
||||
private String userPhone; //用户电话
|
||||
private String store; //门店
|
||||
private String storeSid; //门店
|
||||
@JsonFormat(pattern = "yyyy-MM-dd ",timezone="GMT+8")
|
||||
private Date reserveDate; //预约时间
|
||||
private String bagName; //礼包
|
||||
private String code; //卡号
|
||||
private String goodsInfo;
|
||||
private List<OrderGoodsVo> goodsVo = new ArrayList<>();
|
||||
private List<String> goods=new ArrayList<>();
|
||||
private String bankName;
|
||||
private String goodsSid;
|
||||
private String goodsName;
|
||||
private String goodsNumber;
|
||||
private String serialNumber;
|
||||
private String linker;
|
||||
private String linkPhone;
|
||||
private String address;
|
||||
private String cardType;
|
||||
}
|
||||
@@ -25,4 +25,5 @@ public class VegetableCellarDto implements Dto {
|
||||
private String goodsNumber;
|
||||
private String totalNumber;
|
||||
private List<vegeVo> vos;
|
||||
private String transferSid;//转赠sid
|
||||
}
|
||||
|
||||
@@ -22,5 +22,6 @@ public interface AppletGiftBagMapper extends BaseMapper<AppletGiftBag> {
|
||||
IPage<AppletGiftBagVo> giftBagListPage(IPage<AppletGiftBag> page, @Param(Constants.WRAPPER) QueryWrapper<AppletGiftBag> qw);
|
||||
List<AppletGiftBagVo> giftBagList();
|
||||
|
||||
List<AppletGiftBagVo> giftBagGoodsList();
|
||||
int saveBags(@Param("bags") List<AppletGiftBag> bags);
|
||||
}
|
||||
|
||||
@@ -35,4 +35,10 @@
|
||||
where isGrounding=1
|
||||
order by isRecommend desc,createTime desc
|
||||
</select>
|
||||
<select id="giftBagGoodsList" resultType="com.yxt.yythmall.api.appletgiftbag.AppletGiftBagVo">
|
||||
select
|
||||
a.sid as sid ,s.sid as goodsSid,s.goodsNumber as count
|
||||
from applet_giftbag a left join applet_giftbag_goods s on s.giftbagSid=a.sid
|
||||
where a.sid=#{sid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -101,6 +101,8 @@ public class LpkCustomerService extends MybatisBaseService<LpkCustomerMapper, Lp
|
||||
newCustomer.setWxMpOpenid(openid);
|
||||
// newCustomer.setUnionId(unionid);
|
||||
newCustomer.setCreateTime(new Date());
|
||||
newCustomer.setIsPurchase("1");
|
||||
newCustomer.setIsNewUser("1");
|
||||
newCustomer.setPhoto("headImage.png");
|
||||
LpkCustomer lpkCustomer1 = baseMapper.selectOwn();
|
||||
newCustomer.setNick("小主000"+ (Integer.valueOf(lpkCustomer1.getId()).intValue() +1));
|
||||
|
||||
@@ -180,11 +180,11 @@ public class LpkGiftCardRest {
|
||||
return lpkGiftCardService.cardShareGoodsDetail(sid);
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有的类型")
|
||||
@GetMapping("/getAllGoodsType/{type}")
|
||||
public ResultBean getAllType(@PathVariable("type") String type ) {
|
||||
return lpkGiftCardService.getAllType(type);
|
||||
}
|
||||
// @ApiOperation("获取所有的类型")
|
||||
// @GetMapping("/getAllGoodsType/{type}")
|
||||
// public ResultBean getAllType(@PathVariable("type") String type ) {
|
||||
// return lpkGiftCardService.getAllType(type);
|
||||
// }
|
||||
@ApiOperation("根据类型查询商品")
|
||||
@PostMapping("/getGoodsByType")
|
||||
public ResultBean getGoodsByType(@RequestBody LpkGiftCardQuery query) {
|
||||
|
||||
@@ -1730,76 +1730,7 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
vo.setGoodsVos(goods);
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
public ResultBean getAllType(String type) {
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
GoodsTypeVo vo=new GoodsTypeVo();
|
||||
GoodsTypeVo vo1=new GoodsTypeVo();
|
||||
GoodsTypeVo vo2=new GoodsTypeVo();
|
||||
GoodsTypeVo vo3=new GoodsTypeVo();
|
||||
GoodsTypeVo vo4=new GoodsTypeVo();
|
||||
GoodsTypeVo vo5=new GoodsTypeVo();
|
||||
GoodsTypeVo vo6=new GoodsTypeVo();
|
||||
GoodsTypeVo vo7=new GoodsTypeVo();
|
||||
GoodsTypeVo vo8=new GoodsTypeVo();
|
||||
GoodsTypeVo vo9=new GoodsTypeVo();
|
||||
GoodsTypeVo vo10=new GoodsTypeVo();
|
||||
GoodsTypeVo vo11=new GoodsTypeVo();
|
||||
GoodsTypeVo vo12=new GoodsTypeVo();
|
||||
GoodsTypeVo vo13=new GoodsTypeVo();
|
||||
GoodsTypeVo vo14=new GoodsTypeVo();
|
||||
GoodsTypeVo vo15=new GoodsTypeVo();
|
||||
vo.setSid("0");
|
||||
vo.setName("全部分类");
|
||||
vo1.setSid("1");
|
||||
vo1.setName("叶菜/花菜");
|
||||
vo2.setSid("2");
|
||||
vo2.setName("土豆/根茎");
|
||||
vo3.setSid("3");
|
||||
vo3.setName("西红柿/茄瓜");
|
||||
vo4.setSid("4");
|
||||
vo4.setName("柑橘橙柚");
|
||||
vo5.setSid("5");
|
||||
vo5.setName("苹果梨蕉");
|
||||
vo6.setSid("6");
|
||||
vo6.setName("苹果梨蕉1");
|
||||
vo7.setSid("7");
|
||||
vo7.setName("苹果梨蕉2");
|
||||
vo8.setSid("8");
|
||||
vo8.setName("苹果梨蕉3");
|
||||
vo9.setSid("8");
|
||||
vo9.setName("苹果梨蕉3");
|
||||
vo10.setSid("8");
|
||||
vo10.setName("苹果梨蕉3");
|
||||
|
||||
vo11.setSid("8");
|
||||
vo11.setName("苹果梨蕉3");
|
||||
vo12.setSid("8");
|
||||
vo12.setName("苹果梨蕉3");
|
||||
vo13.setSid("8");
|
||||
vo13.setName("苹果梨蕉3");
|
||||
vo14.setSid("8");
|
||||
vo14.setName("苹果梨蕉3");
|
||||
vo15.setSid("8");
|
||||
vo15.setName("苹果梨蕉3");
|
||||
List<GoodsTypeVo> list=new ArrayList<>();
|
||||
list.add(vo);
|
||||
list.add(vo1);
|
||||
list.add(vo2);
|
||||
list.add(vo3);
|
||||
list.add(vo4);
|
||||
list.add(vo5);
|
||||
list.add(vo6);
|
||||
list.add(vo7);
|
||||
list.add(vo8);
|
||||
list.add(vo9);
|
||||
list.add(vo10);
|
||||
list.add(vo11);
|
||||
list.add(vo12);
|
||||
list.add(vo13);
|
||||
list.add(vo14);
|
||||
list.add(vo15);
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
public ResultBean getGoodsByTypeSid(LpkGiftCardQuery query) {
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
List<GiftBagGoodss> giftBagGoodss=lpkGoodsService.getAllGoodsApplets(query).getData();
|
||||
|
||||
@@ -113,12 +113,18 @@
|
||||
weight
|
||||
from lpk_goods
|
||||
where isAppletGrounding=1 and useTo=1
|
||||
<if test="query.brandId!=null and query.brandId!=''">
|
||||
and brandId =#{query.brandId}
|
||||
</if>
|
||||
<if test="query.categoryId!=null and query.categoryId!=''">
|
||||
and categoryId=#{query.categoryId}
|
||||
</if>
|
||||
<if test="query.name!=null and query.name!=''">
|
||||
name like #{query.name}
|
||||
</if>
|
||||
order by createTime desc
|
||||
</select>
|
||||
<select id="getType" resultType="com.yxt.yythmall.api.lpkgoods.GoodsTypeVo">
|
||||
select name , id as sid from pms_product_category where parent_id=0
|
||||
select name , id as id from pms_product_category where parent_id=0
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -91,6 +91,11 @@ public class LpkGoodsRest {
|
||||
public ResultBean getAllType() {
|
||||
return lpkGoodsService.getAllType();
|
||||
}
|
||||
@ApiOperation("获取所有的商品类型和品牌")
|
||||
@GetMapping("/getGoodsTypeAndBrand")
|
||||
public ResultBean getGoodsTypeAndBrand() {
|
||||
return lpkGoodsService.getGoodsTypeAndBrand();
|
||||
}
|
||||
@ApiOperation("根据类型查询商品")
|
||||
@PostMapping("/getGoodsByType")
|
||||
public ResultBean getGoodsByType(@RequestBody LpkGiftCardQuery query) {
|
||||
|
||||
@@ -19,6 +19,8 @@ import com.yxt.yythmall.api.lpkgoods.*;
|
||||
import com.yxt.yythmall.api.shoppingcart.ShoppingCartQuery;
|
||||
import com.yxt.yythmall.api.shoppingcart.ShoppingCartVo;
|
||||
import com.yxt.yythmall.biz.shoppingcart.ShoppingCartService;
|
||||
import com.yxt.yythmall.mallplus.biz.pms.service.IPmsBrandService;
|
||||
import com.yxt.yythmall.mallplus.mbg.pms.entity.brand.BrandVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -45,6 +47,8 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
ShoppingCartService shoppingCartService;
|
||||
@Autowired
|
||||
private com.yxt.yythmall.mallplus.biz.pms.service.IPmsBrandService IPmsBrandService;
|
||||
|
||||
|
||||
public ResultBean<PagerVo<LpkGoodsVo>> goodsListPage(PagerQuery<LpkGoodsQuery> pq) {
|
||||
@@ -251,11 +255,21 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
List<GoodsTypeVo> list=baseMapper.getType();
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
public ResultBean<List<GoodsTypeVo>> getGoodsTypeAndBrand() {
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
GoodsTypeVo vo=new GoodsTypeVo();
|
||||
List<GoodsTypeVo> list=baseMapper.getType();
|
||||
vo.setTypeVos(list);
|
||||
List<BrandVo> list1= IPmsBrandService.getList().getData();
|
||||
vo.setBrandVos(list1);
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
|
||||
public ResultBean getGoodsByTypeSid(LpkGiftCardQuery query) {
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
List<GiftBagGoodss> giftBagGoodss=baseMapper.getAllGoodsApplets(query);
|
||||
ShoppingCartQuery query1=new ShoppingCartQuery();
|
||||
query1.setAffiliation(query.getAffiliation());query1.setCustomerSid(query.getCustomerSid());
|
||||
query1.setAffiliation(query.getBrandId());query1.setCustomerSid(query.getCustomerSid());
|
||||
List<ShoppingCartVo> l=shoppingCartService.shoppingCartList(query1).getData();
|
||||
l.forEach(s->{
|
||||
giftBagGoodss.forEach(d->{
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.yxt.yythmall.biz.newcomerrecorecord;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.yythmall.api.newcomerrecorecord.NewcomerRecoRecord;
|
||||
import com.yxt.yythmall.api.newcomerrecorecord.NewcomerRecoRecordVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:36
|
||||
*/
|
||||
@Mapper
|
||||
public interface NewcomerRecoRecordMapper extends BaseMapper<NewcomerRecoRecord> {
|
||||
@Select("select sum(goodsNumber) as goodsNumber , goodsSid as goodsSid from lpk_reserve_order_goods where cardSid=#{cardSid} and goodsSid=#{goodsSid}")
|
||||
NewcomerRecoRecord getReserveByCardSid(@Param("cardSid") String cardSid, @Param("goodsSid") String goodsSid);
|
||||
|
||||
NewcomerRecoRecord selByOrderSidAndGoodSid(@Param("orderSid") String orderSid, @Param("goodsSid") String goodsSid);
|
||||
|
||||
@Select("select * from lpk_reserve_order_goods where orderSid=#{orderSid}")
|
||||
List<NewcomerRecoRecord> selByOrderSid(String orderSid);
|
||||
|
||||
List<NewcomerRecoRecord> selInOrderSid(@Param("orderSids") List<String> orderSids);
|
||||
@Select("select *,goodsNumber as num from lpk_reserve_order_goods where orderSid=#{orderSid}")
|
||||
List<NewcomerRecoRecord> selByOrderSids(String orderSid);
|
||||
@Select("select * from newcomer_reco_record r where customerSid =#{customerSid} limit 5")
|
||||
List<NewcomerRecoRecordVo> recordList(@Param("customerSid")String customerSid);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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.newcomerrecorecord.NewcomerRecoRecordMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
<select id="storeListPage" resultType="com.yxt.yythmall.api.lpkstore.LpkStoreVo">
|
||||
select
|
||||
sid,
|
||||
date_format(createTime, '%Y-%m-%d') as createTime,
|
||||
code,
|
||||
`name`,
|
||||
address,
|
||||
phone,
|
||||
businessHours
|
||||
from lpk_store
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="selByOrderSidAndGoodSid"
|
||||
resultType="com.yxt.yythmall.api.lpkreserveordergoods.LpkReserveOrderGoods">
|
||||
select *
|
||||
from lpk_reserve_order_goods
|
||||
where orderSid = #{orderSid}
|
||||
and goodsSid = #{goodsSid}
|
||||
</select>
|
||||
<select id="selInOrderSid" resultType="com.yxt.yythmall.api.lpkreserveordergoods.LpkReserveOrderGoods">
|
||||
select s.sid,s.createTime,s.remarks,s.cardSid,s.goodsSid,s.orderSid,sum(s.goodsNumber) as goodsNumber
|
||||
from lpk_reserve_order_goods s
|
||||
where orderSid in
|
||||
<foreach collection="orderSids" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
GROUP BY s.goodsSid
|
||||
</select>
|
||||
<select id="recordList" resultType="com.yxt.yythmall.api.newcomerrecorecord.NewcomerRecoRecordVo">
|
||||
select
|
||||
from newcomer_reco_record s
|
||||
left join lpk_customer d on d.sid=s.recommendSid
|
||||
left join lpk_customer c on c.sid=s.recommendedSid
|
||||
where orderSid in
|
||||
|
||||
GROUP BY s.goodsSid
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.yxt.yythmall.biz.newcomerrecorecord;
|
||||
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.yythmall.api.newcomerrecorecord.NewcomerRecoRecordDto;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:35
|
||||
*/
|
||||
@Api(tags = "预约订单信息")
|
||||
@RestController
|
||||
@RequestMapping("newcomerrecorecord")
|
||||
public class NewcomerRecoRecordRest {
|
||||
@Autowired
|
||||
NewcomerRecoRecordService newcomerRecoRecordService;
|
||||
|
||||
|
||||
@ApiOperation("推荐新人用户")
|
||||
@PostMapping("/recommendNewUsers")
|
||||
public ResultBean recommendNewUsers(NewcomerRecoRecordDto dto){
|
||||
return newcomerRecoRecordService.recommendNewUsers(dto);
|
||||
}
|
||||
@ApiOperation("新人助力")
|
||||
@PostMapping("/recommendedAssistance")
|
||||
public ResultBean recommendedAssistance(NewcomerRecoRecordDto dto){
|
||||
return newcomerRecoRecordService.recommendedAssistance(dto);
|
||||
}
|
||||
@ApiOperation("新人助力")
|
||||
@PostMapping("/recordList/{customerSid}")
|
||||
public ResultBean recordList(@PathVariable("customerSid") String customerSid){
|
||||
return newcomerRecoRecordService.recordList(customerSid);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.yxt.yythmall.biz.newcomerrecorecord;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.yythmall.api.appletgiftbaggoods.AppletGiftBagGoods;
|
||||
import com.yxt.yythmall.api.empcardgiftgoods.EmpCardGiftGoodsVo;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.AppletVo;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.GoodsVo;
|
||||
import com.yxt.yythmall.api.newcomerrecorecord.NewcomerRecoRecord;
|
||||
import com.yxt.yythmall.api.newcomerrecorecord.NewcomerRecoRecordDto;
|
||||
import com.yxt.yythmall.api.newcomerrecorecord.NewcomerRecoRecordVo;
|
||||
import com.yxt.yythmall.biz.appletgiftbag.AppletGiftBagService;
|
||||
import com.yxt.yythmall.biz.appletgiftbaggoods.AppletGiftBagGoodsService;
|
||||
import com.yxt.yythmall.biz.empcardgiftgoods.EmpCardGiftGoodsService;
|
||||
import com.yxt.yythmall.biz.lpkcustomer.LpkCustomerService;
|
||||
import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardService;
|
||||
import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:36
|
||||
*/
|
||||
@Service
|
||||
public class NewcomerRecoRecordService extends MybatisBaseService<NewcomerRecoRecordMapper, NewcomerRecoRecord> {
|
||||
@Autowired
|
||||
AppletGiftBagGoodsService appletGiftBagGoodsService;
|
||||
@Autowired
|
||||
EmpCardGiftGoodsService empCardGiftGoodsService;
|
||||
@Autowired
|
||||
LpkCustomerService lpkCustomerService;
|
||||
@Autowired
|
||||
VegetableCellarService vegetableCellarService;
|
||||
public ResultBean<NewcomerRecoRecord> getReserveByCardSid(String carSid, String goodsSid) {
|
||||
ResultBean rb = new ResultBean();
|
||||
NewcomerRecoRecord goods = baseMapper.getReserveByCardSid(carSid, goodsSid);
|
||||
return rb.success().setData(goods);
|
||||
}
|
||||
|
||||
public ResultBean recommendNewUsers(NewcomerRecoRecordDto dto) {
|
||||
ResultBean rb = new ResultBean();
|
||||
NewcomerRecoRecord newcomerRecoRecord = new NewcomerRecoRecord();
|
||||
|
||||
BeanUtil.copyProperties(dto, newcomerRecoRecord, "id", "sid");
|
||||
newcomerRecoRecord.setCreateTime(new Date());
|
||||
baseMapper.insert(newcomerRecoRecord);
|
||||
return rb.success().setData("推荐成功");
|
||||
}
|
||||
public ResultBean recommendedAssistance(NewcomerRecoRecordDto dto) {
|
||||
ResultBean rb = new ResultBean();
|
||||
NewcomerRecoRecord newcomerRecoRecord = baseMapper.selectOne(new QueryWrapper<NewcomerRecoRecord>().eq("sid",dto.getSid()));
|
||||
newcomerRecoRecord.setRecommendedSid(dto.getRecommendedSid());
|
||||
newcomerRecoRecord.setAssistanceDate(new Date());
|
||||
baseMapper.updateById(newcomerRecoRecord);
|
||||
List<AppletGiftBagGoods>list=appletGiftBagGoodsService.list(new QueryWrapper<AppletGiftBagGoods>().eq("giftbagSid",dto.getGiftBagSid()));
|
||||
// vegetableCellarService.receiveTransferGoods()
|
||||
return rb.success().setData("助力成功");
|
||||
}
|
||||
public ResultBean recordList(String customerSid) {
|
||||
ResultBean rb = new ResultBean();
|
||||
|
||||
List<NewcomerRecoRecordVo> vos=baseMapper.recordList(customerSid);
|
||||
|
||||
// vos.forEach(s->{
|
||||
// s.
|
||||
// });
|
||||
return rb.success().setData("助力成功");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yxt.yythmall.biz.transferrecords;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.yythmall.api.transferrecords.TransferRecords;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:36
|
||||
*/
|
||||
@Mapper
|
||||
public interface TransferRecordsMapper extends BaseMapper<TransferRecords> {
|
||||
@Select("select sum(goodsNumber) as goodsNumber , goodsSid as goodsSid from lpk_reserve_order_goods where cardSid=#{cardSid} and goodsSid=#{goodsSid}")
|
||||
TransferRecords getReserveByCardSid(@Param("cardSid") String cardSid, @Param("goodsSid") String goodsSid);
|
||||
|
||||
TransferRecords selByOrderSidAndGoodSid(@Param("orderSid") String orderSid, @Param("goodsSid") String goodsSid);
|
||||
|
||||
@Select("select * from lpk_reserve_order_goods where orderSid=#{orderSid}")
|
||||
List<TransferRecords> selByOrderSid(String orderSid);
|
||||
|
||||
List<TransferRecords> selInOrderSid(@Param("orderSids") List<String> orderSids);
|
||||
@Select("select *,goodsNumber as num from lpk_reserve_order_goods where orderSid=#{orderSid}")
|
||||
List<TransferRecords> selByOrderSids(String orderSid);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?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.transferrecords.TransferRecordsMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
<select id="storeListPage" resultType="com.yxt.yythmall.api.lpkstore.LpkStoreVo">
|
||||
select
|
||||
sid,
|
||||
date_format(createTime, '%Y-%m-%d') as createTime,
|
||||
code,
|
||||
`name`,
|
||||
address,
|
||||
phone,
|
||||
businessHours
|
||||
from lpk_store
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yxt.yythmall.biz.transferrecords;
|
||||
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.yythmall.api.transferrecords.TransferRecordsDto;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderDto;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.RestController;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:35
|
||||
*/
|
||||
@Api(tags = "预约订单信息")
|
||||
@RestController
|
||||
@RequestMapping("transferrecords")
|
||||
public class TransferRecordsRest {
|
||||
@Autowired
|
||||
TransferRecordsService TransferRecordsService;
|
||||
|
||||
@ApiOperation("转赠蔬菜")
|
||||
@PostMapping("/submission")
|
||||
public ResultBean submission(@RequestBody TransferRecordsDto dto) {
|
||||
return TransferRecordsService.submission(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.yxt.yythmall.biz.transferrecords;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.yythmall.api.customerstore.CustomerStoreDto;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.GoodsVo;
|
||||
import com.yxt.yythmall.api.transferrecords.TransferRecords;
|
||||
import com.yxt.yythmall.api.transferrecords.TransferRecordsDto;
|
||||
|
||||
import com.yxt.yythmall.api.vegetablecellar.VegetableCellar;
|
||||
import com.yxt.yythmall.biz.customerstore.CustomerStoreService;
|
||||
import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardService;
|
||||
import com.yxt.yythmall.biz.lpkgiftcard.generateRule.UniqueIdGenerator;
|
||||
import com.yxt.yythmall.biz.transferrecordsgoodsdetails.TransferRecordsGoodsDetailsService;
|
||||
import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:36
|
||||
*/
|
||||
@Service
|
||||
public class TransferRecordsService extends MybatisBaseService<TransferRecordsMapper, TransferRecords> {
|
||||
@Autowired
|
||||
LpkGiftCardService lpkGiftCardService;
|
||||
@Autowired
|
||||
TransferRecordsGoodsDetailsService transferRecordsGoodsDetailsService;
|
||||
@Autowired
|
||||
CustomerStoreService customerStoreService;
|
||||
|
||||
|
||||
public ResultBean submission(TransferRecordsDto dto) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
TransferRecords order = new TransferRecords();
|
||||
BeanUtil.copyProperties(dto, order, "id", "sid");
|
||||
|
||||
order.setCreateTime(new DateTime());
|
||||
String uuid = UniqueIdGenerator.generateUniqueID();
|
||||
order.setTransferCode(uuid);
|
||||
baseMapper.insert(order);
|
||||
dto.setOrderSid(order.getSid());
|
||||
transferRecordsGoodsDetailsService.submissionDetail(dto);
|
||||
return rb.success().setData("转赠成功");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yxt.yythmall.biz.transferrecordsgoodsdetails;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.yythmall.api.transferrecordsgoodsdetails.TransferRecordsGoodsDetails;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:36
|
||||
*/
|
||||
@Mapper
|
||||
public interface TransferRecordsGoodsDetailsMapper extends BaseMapper<TransferRecordsGoodsDetails> {
|
||||
@Select("select sum(goodsNumber) as goodsNumber , goodsSid as goodsSid from lpk_reserve_order_goods where cardSid=#{cardSid} and goodsSid=#{goodsSid}")
|
||||
TransferRecordsGoodsDetails getReserveByCardSid(@Param("cardSid") String cardSid, @Param("goodsSid") String goodsSid);
|
||||
|
||||
TransferRecordsGoodsDetails selByOrderSidAndGoodSid(@Param("orderSid") String orderSid, @Param("goodsSid") String goodsSid);
|
||||
|
||||
@Select("select * from lpk_reserve_order_goods where orderSid=#{orderSid}")
|
||||
List<TransferRecordsGoodsDetails> selByOrderSid(String orderSid);
|
||||
|
||||
List<TransferRecordsGoodsDetails> selInOrderSid(@Param("orderSids") List<String> orderSids);
|
||||
@Select("select *,goodsNumber as num from lpk_reserve_order_goods where orderSid=#{orderSid}")
|
||||
List<TransferRecordsGoodsDetails> selByOrderSids(String orderSid);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?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.transferrecordsgoodsdetails.TransferRecordsGoodsDetailsMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
<select id="storeListPage" resultType="com.yxt.yythmall.api.lpkstore.LpkStoreVo">
|
||||
select
|
||||
sid,
|
||||
date_format(createTime, '%Y-%m-%d') as createTime,
|
||||
code,
|
||||
`name`,
|
||||
address,
|
||||
phone,
|
||||
businessHours
|
||||
from lpk_store
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="selByOrderSidAndGoodSid"
|
||||
resultType="com.yxt.yythmall.api.lpkreserveordergoods.LpkReserveOrderGoods">
|
||||
select *
|
||||
from lpk_reserve_order_goods
|
||||
where orderSid = #{orderSid}
|
||||
and goodsSid = #{goodsSid}
|
||||
</select>
|
||||
<select id="selInOrderSid" resultType="com.yxt.yythmall.api.lpkreserveordergoods.LpkReserveOrderGoods">
|
||||
select s.sid,s.createTime,s.remarks,s.cardSid,s.goodsSid,s.orderSid,sum(s.goodsNumber) as goodsNumber
|
||||
from lpk_reserve_order_goods s
|
||||
where orderSid in
|
||||
<foreach collection="orderSids" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
GROUP BY s.goodsSid
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.yxt.yythmall.biz.transferrecordsgoodsdetails;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:35
|
||||
*/
|
||||
@Api(tags = "预约订单信息")
|
||||
@RestController
|
||||
@RequestMapping("TransferRecordsGoodsDetailsRest")
|
||||
public class TransferRecordsGoodsDetailsRest {
|
||||
@Autowired
|
||||
TransferRecordsGoodsDetailsService vegeCellarReserveOrderService;
|
||||
|
||||
|
||||
// @ApiOperation("预约提交")
|
||||
// @PostMapping("/submissionDetail")
|
||||
// public ResultBean submissionDetail(VegeCellarReserveOrderDto dto){
|
||||
// return VegeCellarReserveOrderService.submissionDetail(dto);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.yxt.yythmall.biz.transferrecordsgoodsdetails;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.yythmall.api.customerstore.CustomerStoreDto;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.GoodsVo;
|
||||
import com.yxt.yythmall.api.transferrecords.TransferRecordsDto;
|
||||
import com.yxt.yythmall.api.transferrecordsgoodsdetails.TransferRecordsGoodsDetails;
|
||||
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderDto;
|
||||
import com.yxt.yythmall.api.vegetablecellar.VegetableCellar;
|
||||
import com.yxt.yythmall.biz.customerstore.CustomerStoreService;
|
||||
import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardService;
|
||||
import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:36
|
||||
*/
|
||||
@Service
|
||||
public class TransferRecordsGoodsDetailsService extends MybatisBaseService<TransferRecordsGoodsDetailsMapper, TransferRecordsGoodsDetails> {
|
||||
@Autowired
|
||||
LpkGiftCardService lpkGiftCardService;
|
||||
@Autowired
|
||||
VegetableCellarService vegetableCellarService;
|
||||
@Autowired
|
||||
CustomerStoreService customerStoreService;
|
||||
|
||||
|
||||
public ResultBean<TransferRecordsGoodsDetails> getReserveByCardSid(String carSid, String goodsSid) {
|
||||
ResultBean rb = new ResultBean();
|
||||
TransferRecordsGoodsDetails goods = baseMapper.getReserveByCardSid(carSid, goodsSid);
|
||||
return rb.success().setData(goods);
|
||||
}
|
||||
|
||||
public ResultBean submissionDetail(TransferRecordsDto dto) {
|
||||
ResultBean rb = new ResultBean();
|
||||
TransferRecordsGoodsDetails goods = new TransferRecordsGoodsDetails();
|
||||
BeanUtil.copyProperties(dto, goods, "id", "sid");
|
||||
// goods.setCardSid(dto.getSid());
|
||||
for (GoodsVo goods1 : dto.getGoodsVos()) {
|
||||
if (goods1.getSelect() != 0) {
|
||||
// goods.setCardSid(dto.getSid());
|
||||
goods.setGoodsSid(goods1.getGoodsSid());
|
||||
goods.setGoodsNumber(goods1.getSelect());
|
||||
goods.setCreateTime(new DateTime());
|
||||
baseMapper.insert(goods);
|
||||
VegetableCellar vegetableCellar= vegetableCellarService.list(new QueryWrapper<VegetableCellar>().eq("customerSid",dto.getCustomerSid())
|
||||
.eq("goodsSid",goods1.getGoodsSid()).eq("affiliation",dto.getAffiliation())).get(0);
|
||||
double d=Double.valueOf(vegetableCellar.getGoodsNumber());
|
||||
double c=Double.valueOf(goods1.getSelect());
|
||||
if(Double.compare(d,c)==0){
|
||||
vegetableCellarService.deleteBySid(vegetableCellar.getSid());
|
||||
}else{
|
||||
vegetableCellar.setGoodsNumber(String.valueOf((int)(Double.valueOf(vegetableCellar.getGoodsNumber())-Double.valueOf(goods1.getSelect()))));
|
||||
vegetableCellarService.updateById(vegetableCellar);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rb.success().setData("转赠成功");
|
||||
}
|
||||
|
||||
public TransferRecordsGoodsDetails selByOrderSidAndGoodSid(String orderSid, String goodsSid) {
|
||||
return baseMapper.selByOrderSidAndGoodSid(orderSid,goodsSid);
|
||||
}
|
||||
public List<TransferRecordsGoodsDetails> selByOrderSid(String orderSid) {
|
||||
return baseMapper.selByOrderSid(orderSid);
|
||||
}
|
||||
public List<TransferRecordsGoodsDetails> selInOrderSid(List<String> orderSids) {
|
||||
return baseMapper.selInOrderSid(orderSids);
|
||||
}
|
||||
public List<TransferRecordsGoodsDetails> selByOrderSids(String orderSid) {
|
||||
return baseMapper.selByOrderSids(orderSid);
|
||||
}
|
||||
}
|
||||
@@ -31,4 +31,9 @@ public class VegetableCellarRest {
|
||||
public ResultBean saveGoods(@RequestBody VegetableCellarDto dto) {
|
||||
return VegetableCellarService.saveGoods(dto);
|
||||
}
|
||||
@ApiOperation("领取转赠商品")
|
||||
@PostMapping("/receiveTransferGoods")
|
||||
public ResultBean receiveTransferGoods(@RequestBody VegetableCellarDto dto) {
|
||||
return VegetableCellarService.receiveTransferGoods(dto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,11 +11,15 @@ import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yythmall.api.ordorder.OrdOrder;
|
||||
import com.yxt.yythmall.api.ordorderdetails.OrdOrderDetail;
|
||||
import com.yxt.yythmall.api.shoppingcart.ShoppingCart;
|
||||
import com.yxt.yythmall.api.transferrecords.TransferRecords;
|
||||
import com.yxt.yythmall.api.transferrecordsgoodsdetails.TransferRecordsGoodsDetails;
|
||||
import com.yxt.yythmall.api.vegetablecellar.*;
|
||||
import com.yxt.yythmall.biz.empcard.EmpCardService;
|
||||
import com.yxt.yythmall.biz.ordorder.OrdOrderService;
|
||||
import com.yxt.yythmall.biz.ordorderdetails.OrdOrderDetailService;
|
||||
import com.yxt.yythmall.biz.shoppingcart.ShoppingCartService;
|
||||
import com.yxt.yythmall.biz.transferrecords.TransferRecordsService;
|
||||
import com.yxt.yythmall.biz.transferrecordsgoodsdetails.TransferRecordsGoodsDetailsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -34,6 +38,10 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
|
||||
OrdOrderDetailService ordOrderDetailService;
|
||||
@Autowired
|
||||
ShoppingCartService shoppingCartService;
|
||||
@Autowired
|
||||
TransferRecordsService transferRecordsService;
|
||||
@Autowired
|
||||
TransferRecordsGoodsDetailsService transferRecordsGoodsDetailsService;
|
||||
public ResultBean addGoods(String mainSid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
OrdOrder ordOrder=ordOrderService.getOne(new QueryWrapper<OrdOrder>().eq("mainSid",mainSid));
|
||||
@@ -79,4 +87,32 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
|
||||
}
|
||||
return rb.success().setMsg("成功");
|
||||
}
|
||||
public ResultBean receiveTransferGoods(VegetableCellarDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
TransferRecords transferRecords=transferRecordsService.getOne(new QueryWrapper<TransferRecords>().eq("sid",dto.getTransferSid()).eq("state","0"));
|
||||
if(transferRecords==null){
|
||||
return rb.setMsg("已经被领取");
|
||||
}
|
||||
List<TransferRecordsGoodsDetails>list=transferRecordsGoodsDetailsService.list(new QueryWrapper<TransferRecordsGoodsDetails>().eq("orderSid",dto.getTransferSid()));
|
||||
for(TransferRecordsGoodsDetails detail:list){
|
||||
VegetableCellar vegetableCellar=baseMapper.selectOne(new QueryWrapper<VegetableCellar>().eq("customerSid",dto.getCustomerSid())
|
||||
.eq("goodsSid",detail.getGoodsSid()).eq("affiliation",transferRecords.getAffiliation()));
|
||||
if(vegetableCellar==null){
|
||||
VegetableCellar vegetable=new VegetableCellar();
|
||||
vegetable.setAffiliation(transferRecords.getAffiliation());
|
||||
vegetable.setGoodsSid(detail.getGoodsSid());
|
||||
vegetable.setGoodsNumber(String.valueOf((int)detail.getGoodsNumber()));
|
||||
vegetable.setCustomerSid(dto.getCustomerSid());
|
||||
baseMapper.insert(vegetable);
|
||||
}else{
|
||||
vegetableCellar.setGoodsNumber(String.valueOf((int) (Double.valueOf(vegetableCellar.getGoodsNumber())+Double.valueOf(detail.getGoodsNumber()))));
|
||||
baseMapper.updateById(vegetableCellar);
|
||||
}
|
||||
transferRecords.setState("1");
|
||||
transferRecords.setRecipientSid(dto.getCustomerSid());
|
||||
transferRecordsService.updateById(transferRecords);
|
||||
}
|
||||
return rb.success().setMsg("成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -63,8 +63,12 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
||||
//2024-01-17
|
||||
.excludePathPatterns("/lpkgiftcard/getAllGoodsType/**")
|
||||
.excludePathPatterns("/lpkgoods/getAllGoodsType/**")
|
||||
.excludePathPatterns("/transferrecords/submission")
|
||||
.excludePathPatterns("/vegetablecellar/receiveTransferGoods")
|
||||
.excludePathPatterns("/customerstore/isSaturAndSun")
|
||||
.excludePathPatterns("/lpkgiftcard/getGoodsByType/**")
|
||||
.excludePathPatterns("/lpkgoods/getGoodsTypeAndBrand")
|
||||
.excludePathPatterns("/lpkgoods/getGoodsByType")
|
||||
.excludePathPatterns("/shoppingcart/addShoppingCart")
|
||||
.excludePathPatterns("/shoppingcart/getGoodsWeight")
|
||||
.excludePathPatterns("/shoppingcart/shoppingCartList")
|
||||
|
||||
Reference in New Issue
Block a user