Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -18,4 +18,5 @@ public class TransferRecordsQuery implements Query {
|
||||
private String bankSid;
|
||||
private String bankName;
|
||||
private String serialNumber;
|
||||
private String state;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.yxt.yythmall.api.vegereplenish;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Fan
|
||||
* @description
|
||||
* @date 2024/1/21 10:49
|
||||
*/
|
||||
|
||||
@ApiModel(value = "绑卡记录", description = "绑卡记录")
|
||||
@TableName("vege_replenish")
|
||||
@Data
|
||||
public class VegeReplenish {
|
||||
|
||||
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 customerSid;//客户sid
|
||||
private String cardCode;//卡编码,个人卡、企业卡是卡编码,转赠记录的是转赠编码
|
||||
private String cardtype;//0 个人卡 1 企业卡 2 转赠的
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.yxt.yythmall.api.vegereplenishdetail;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Fan
|
||||
* @description
|
||||
* @date 2024/1/21 10:49
|
||||
*/
|
||||
|
||||
@ApiModel(value = "绑卡记录商品信息", description = "绑卡记录商品信息")
|
||||
@TableName("vege_replenish_detail")
|
||||
@Data
|
||||
public class VegeReplenishDetail {
|
||||
|
||||
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;//订单SID
|
||||
private String goodsSid;//商品Sid
|
||||
private String goodsName;//商品名称
|
||||
private Integer goodsNumber;//商品数量
|
||||
|
||||
}
|
||||
@@ -42,6 +42,7 @@ import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService;
|
||||
import com.yxt.yythmall.biz.lpkreserveorder.LpkReserveOrderService;
|
||||
import com.yxt.yythmall.biz.lpkreserveordergoods.LpkReserveOrderGoodsService;
|
||||
import com.yxt.yythmall.biz.lpkstore.LpkStoreService;
|
||||
import com.yxt.yythmall.biz.vegereplenish.VegeReplenishService;
|
||||
import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService;
|
||||
import com.yxt.yythmall.utils.StyleUtils;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
@@ -93,6 +94,8 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
@Autowired
|
||||
private VegetableCellarService vegetableCellarService;
|
||||
@Autowired
|
||||
private VegeReplenishService vegeReplenishService;
|
||||
@Autowired
|
||||
private HttpServletResponse response;
|
||||
@Value("${image.url.prefix:http://127.0.0.1:8080/upload/}")
|
||||
private String urlPrefix;
|
||||
@@ -100,7 +103,6 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
String qrUrl;
|
||||
|
||||
|
||||
|
||||
public ResultBean bindCard(EmpCardDto bindCardDto) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
EmpCard lpkGiftCard = baseMapper.selectOne(new QueryWrapper<EmpCard>().eq("code", bindCardDto.getCode())
|
||||
@@ -121,6 +123,7 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
baseMapper.updateById(lpkGiftCard);
|
||||
return rb.success().setMsg("绑定成功");
|
||||
}
|
||||
|
||||
public ResultBean bindCardA(BindCardDto bindCardDto) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
EmpCard lpkGiftCard = baseMapper.selectOne(new QueryWrapper<EmpCard>().eq("code", bindCardDto.getCode())
|
||||
@@ -144,6 +147,7 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
dto.setCustomerSid(dto.getCustomerSid());
|
||||
dto.setVos(k);
|
||||
vegetableCellarService.save1Goods(dto);
|
||||
vegeReplenishService.saveBindRecord(bindCardDto, "1");
|
||||
return rb.success().setMsg("绑定成功");
|
||||
}
|
||||
|
||||
@@ -164,6 +168,7 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
}
|
||||
return rb.success().setMsg("绑定成功");
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean generateCard(EmpCardDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
@@ -231,6 +236,7 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
empCardBuildRecordService.updateById(cardBuildRecord);
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public ResultBean<PagerVo<EmpCardVo>> cardList(PagerQuery<EmpCardQuery> pq) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
EmpCardQuery query = pq.getParams();
|
||||
@@ -250,6 +256,7 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
PagerVo<EmpCardVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
|
||||
public ResultBean<PagerVo<EmpCardVo>> recordDetails(PagerQuery<EmpCardQuery> pq) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
EmpCardQuery query = pq.getParams();
|
||||
@@ -270,6 +277,7 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
PagerVo<EmpCardVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
|
||||
public void exportExcel(LpkGiftCardListQuery query) {
|
||||
|
||||
// String finUrl = "https://supervise.yxtsoft.com/lpkapi?qy=";
|
||||
@@ -307,11 +315,13 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
ExportExcelUtils.export(fileNameURL, exportList, EmpCardExport.class, response);
|
||||
|
||||
}
|
||||
|
||||
public ResultBean<Integer> cardGrantCount(String recordSid) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
Integer i = baseMapper.cardGrantCount(recordSid);
|
||||
return rb.success().setData(i);
|
||||
}
|
||||
|
||||
public ResultBean getEmpCardByCustomerSid(PagerQuery<EmpCardQuery> pq) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
EmpCardQuery query = pq.getParams();
|
||||
@@ -330,6 +340,7 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
|
||||
public ResultBean<List<LpkGifGoodsVo>> getEmpCardsBySid(String sid) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
EmpAppletNewVo vo = baseMapper.getEmpCardsBySid(sid);
|
||||
@@ -371,6 +382,7 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
});
|
||||
return rb.success().setData(list1);
|
||||
}
|
||||
|
||||
public ResultBean<EmpAppletVo> getEmpCardBySid(String sid) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
EmpAppletVo vo = baseMapper.getEmpCardBySid(sid);
|
||||
@@ -468,6 +480,7 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
vo.setOrderCardVoList(empReserveOrderCardVos);
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
|
||||
public ResultBean changState(String cardSid, String state) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
EmpCard card = baseMapper.selectOne(new QueryWrapper<EmpCard>().eq("sid", cardSid));
|
||||
@@ -476,6 +489,7 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
baseMapper.updateById(card);
|
||||
return rb.success().setData("成功");
|
||||
}
|
||||
|
||||
public ResultBean<EmpCardVo> getBagGoods(String sid, String goodsSid) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
EmpCardVo card = baseMapper.getBagGoods(sid, goodsSid);
|
||||
@@ -527,6 +541,7 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ResultBean cardStatisticsList(PagerQuery<EmpCardQuery> pq) {
|
||||
ResultBean rb = new ResultBean();
|
||||
EmpCardQuery query = pq.getParams();
|
||||
@@ -588,6 +603,7 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
|
||||
/**
|
||||
* 是否转赠
|
||||
*
|
||||
* @param sid
|
||||
* @return
|
||||
*/
|
||||
@@ -634,4 +650,9 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
// System.out.println(a);
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
|
||||
public EmpCard selectOneByCodeAndCodeKey(String code, String codeKey) {
|
||||
return baseMapper.selectOne(new QueryWrapper<EmpCard>().eq("code", code)
|
||||
.eq("codeKey", codeKey));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ import com.yxt.yythmall.biz.lpkreserveordergoods.LpkReserveOrderGoodsService;
|
||||
import com.yxt.yythmall.biz.lpkstore.LpkStoreService;
|
||||
import com.yxt.yythmall.biz.ordorder.OrdOrderService;
|
||||
import com.yxt.yythmall.biz.ordorderdetails.OrdOrderDetailService;
|
||||
import com.yxt.yythmall.biz.vegereplenish.VegeReplenishService;
|
||||
import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -101,7 +102,8 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
OrdOrderDetailService ordOrderDetailsService;
|
||||
@Autowired
|
||||
VegetableCellarService vegetableCellarService;
|
||||
|
||||
@Autowired
|
||||
VegeReplenishService vegeReplenishService;
|
||||
|
||||
public ResultBean bindCard(BindCardDto bindCardDto) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
@@ -127,6 +129,7 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
dto.setCustomerSid(dto.getCustomerSid());
|
||||
dto.setVos(k);
|
||||
vegetableCellarService.save1Goods(dto);
|
||||
vegeReplenishService.saveBindRecord(bindCardDto,"2");
|
||||
return rb.success().setMsg("绑定成功");
|
||||
}
|
||||
|
||||
@@ -239,6 +242,7 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
});
|
||||
return rb.success().setData(list1);
|
||||
}
|
||||
|
||||
public ResultBean<EmpGiftAppletVo> getGifCardBySid(String sid) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
EmpGiftAppletVo vo = baseMapper.getGifCardBySid(sid);
|
||||
@@ -330,11 +334,13 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
}
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
|
||||
public ResultBean<List<EmpCardGiftVo>> recordList(String empCardSid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<EmpCardGiftVo> pagging = baseMapper.recordList(empCardSid);
|
||||
return rb.success().setData(pagging);
|
||||
}
|
||||
|
||||
public ResultBean shareEmpCard(String sid) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
EmpCardGift empCardGift = baseMapper.selectOne(new QueryWrapper<EmpCardGift>().eq("sid", sid));
|
||||
@@ -342,6 +348,7 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
baseMapper.updateById(empCardGift);
|
||||
return rb.success().setMsg("成功");
|
||||
}
|
||||
|
||||
//
|
||||
// public ResultBean getReservationBySid(String sid) {
|
||||
// ResultBean rb = new ResultBean().fail();
|
||||
@@ -740,8 +747,10 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
// cardTransfer(dto.getEmpCardSid());
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否转赠
|
||||
*
|
||||
* @param sid
|
||||
* @return
|
||||
*/
|
||||
@@ -753,10 +762,12 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
baseMapper.updateById(card);
|
||||
return rb.success().setData("成功");
|
||||
}
|
||||
|
||||
public ResultBean<EmpCardGiftVo> getEmpCardGoods(String empCardSid, String goodsSid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
return rb.success().setData(baseMapper.getEmpCardGoods(empCardSid, goodsSid));
|
||||
}
|
||||
|
||||
//
|
||||
// public ResultBean<PagerVo<EmpCardGiftListVo>> cardList(PagerQuery<EmpCardGiftListQuery> pq) {
|
||||
// ResultBean rb = ResultBean.fireFail();
|
||||
@@ -903,6 +914,7 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
baseMapper.updateById(card);
|
||||
return rb.success().setData("成功");
|
||||
}
|
||||
|
||||
//
|
||||
// public void exportExcel(EmpCardGiftListQuery query) {
|
||||
//
|
||||
@@ -1111,6 +1123,7 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
vo.setReserveDate(vo.getStart());
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean generateTopEmpCard(String mainSid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
@@ -1164,8 +1177,12 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public EmpCardGift selectOneByCodeAndCodeKey(String code, String codeKey) {
|
||||
return baseMapper.selectOne(new QueryWrapper<EmpCardGift>().eq("code", code)
|
||||
.eq("codeKey", codeKey));
|
||||
}
|
||||
///
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -33,4 +33,6 @@ public interface EmpCardGiftGoodsMapper extends BaseMapper<EmpCardGiftGoods> {
|
||||
"WHERE\n" +
|
||||
"\tg.sid =#{sid}")
|
||||
List<LpkGifGoodsVo> getGoodsByGiftSid(String sid);
|
||||
|
||||
List<EmpCardGiftGoodsVo> getGoodsDetailsByEmpCardGiftSid(@Param("empCardGiftSid") String empCardGiftSid);
|
||||
}
|
||||
|
||||
@@ -5,15 +5,21 @@
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
<select id="getGoodsByEmpCardGiftSid" resultType="com.yxt.yythmall.api.empcardgiftgoods.EmpCardGiftGoodsVo">
|
||||
select gg.*, goods.name as name, goods.unitName as unitName, goods.picUrl as picUrl
|
||||
from emp_card_gift_goods gg left join lpk_goods goods on gg.goodsSid=goods.sid
|
||||
from emp_card_gift_goods gg
|
||||
left join lpk_goods goods on gg.goodsSid = goods.sid
|
||||
where gg.empCardGiftSid = #{empCardGiftSid}
|
||||
</select>
|
||||
<select id="recordListGoods" resultType="com.yxt.yythmall.api.empcardgiftgoods.EmpCardGiftGoodsVo">
|
||||
SELECT
|
||||
sum(goodsNumber) as goodsNumber
|
||||
FROM
|
||||
emp_card_gift card
|
||||
SELECT sum(goodsNumber) as goodsNumber
|
||||
FROM emp_card_gift card
|
||||
LEFT JOIN emp_card_gift_goods goods ON goods.empCardGiftSid = card.sid
|
||||
where card.empCardSid =#{empCardSid} and goods.goodsSid =#{goodsSid}
|
||||
where card.empCardSid = #{empCardSid}
|
||||
and goods.goodsSid = #{goodsSid}
|
||||
</select>
|
||||
<select id="getGoodsDetailsByEmpCardGiftSid"
|
||||
resultType="com.yxt.yythmall.api.empcardgiftgoods.EmpCardGiftGoodsVo">
|
||||
select gg.*
|
||||
from emp_card_gift_goods gg
|
||||
where gg.empCardGiftSid = #{empCardGiftSid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -47,4 +47,9 @@ public class EmpCardGiftGoodsService extends MybatisBaseService<EmpCardGiftGoods
|
||||
List<LpkGifGoodsVo> list= baseMapper.getGoodsByGiftSid(sid);
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
public ResultBean<List<EmpCardGiftGoodsVo>> getGoodsDetailsByEmpCardGiftSid(String empCardGiftSid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<EmpCardGiftGoodsVo> list= baseMapper.getGoodsDetailsByEmpCardGiftSid(empCardGiftSid);
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ 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.lpkgiftbag.LpkGiftBagDto;
|
||||
import com.yxt.yythmall.api.lpkgiftbag.LpkGiftBagInitVo;
|
||||
import com.yxt.yythmall.api.lpkgiftbag.LpkGiftBagQuery;
|
||||
import com.yxt.yythmall.api.lpkgiftbag.LpkGiftBagVo;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -39,7 +40,7 @@ public class LpkGiftBagRest {
|
||||
|
||||
@ApiOperation("礼包初始化")
|
||||
@GetMapping("/giftBagInit/{sid}")
|
||||
public ResultBean giftBagInit(@PathVariable String sid) {
|
||||
public ResultBean<LpkGiftBagInitVo> giftBagInit(@PathVariable String sid) {
|
||||
return lpkGiftBagService.giftBagInit(sid);
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ public class LpkGiftBagService extends MybatisBaseService<LpkGiftBagMapper, LpkG
|
||||
return rb.success().setData(sid);
|
||||
}
|
||||
|
||||
public ResultBean giftBagInit(String sid) {
|
||||
public ResultBean<LpkGiftBagInitVo> giftBagInit(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
LpkGiftBagInitVo vo = new LpkGiftBagInitVo();
|
||||
LpkGiftBag entity = fetchBySid(sid);
|
||||
|
||||
@@ -64,6 +64,7 @@ import com.yxt.yythmall.biz.lpkreserveorder.LpkReserveOrderService;
|
||||
import com.yxt.yythmall.biz.lpkreserveordergoods.LpkReserveOrderGoodsService;
|
||||
import com.yxt.yythmall.biz.lpkstore.LpkStoreService;
|
||||
import com.yxt.yythmall.biz.shoppingcart.ShoppingCartService;
|
||||
import com.yxt.yythmall.biz.vegereplenish.VegeReplenishService;
|
||||
import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService;
|
||||
import com.yxt.yythmall.utils.StyleUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
@@ -127,6 +128,8 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
EmpCardService empCardService;
|
||||
@Autowired
|
||||
ShoppingCartService shoppingCartService;
|
||||
@Autowired
|
||||
private VegeReplenishService vegeReplenishService;
|
||||
|
||||
public ResultBean bindCard(BindCardDto bindCardDto) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
@@ -163,6 +166,7 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
;
|
||||
System.out.println(a.substring(0, 2));
|
||||
}
|
||||
|
||||
public ResultBean bindAllCard(BindCardDto bindCardDto) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
|
||||
@@ -203,8 +207,10 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
dto.setCustomerSid(dto.getCustomerSid());
|
||||
dto.setVos(k);
|
||||
vegetableCellarService.save1Goods(dto);
|
||||
vegeReplenishService.saveBindRecord(bindCardDto, "0");
|
||||
return rb.success().setMsg("绑定成功");
|
||||
}
|
||||
|
||||
public ResultBean getGifCardByCustomerSid(PagerQuery<LpkGiftCardQuery> pq) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
LpkGiftCardQuery query = pq.getParams();
|
||||
@@ -221,6 +227,7 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
|
||||
public ResultBean getGifCardsByCustomerSid(PagerQuery<LpkGiftCardQuery> pq) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
LpkGiftCardQuery query = pq.getParams();
|
||||
@@ -253,6 +260,7 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
|
||||
public ResultBean<List<LpkGifGoodsVo>> getGifCardsBySid(String sid) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
AppletNewVo vo = baseMapper.getGifCardsBySid(sid);
|
||||
@@ -296,6 +304,7 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
});
|
||||
return rb.success().setData(list1);
|
||||
}
|
||||
|
||||
public ResultBean<AppletVo> getGifCardBySid(String sid) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
AppletVo vo = baseMapper.getGifCardBySid(sid);
|
||||
@@ -1614,6 +1623,7 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ResultBean cardStatisticsList(PagerQuery<LpkReserveOrderQuery> pq) {
|
||||
ResultBean rb = new ResultBean();
|
||||
LpkReserveOrderQuery query = pq.getParams();
|
||||
@@ -1645,6 +1655,7 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
|
||||
/**
|
||||
* 是否转赠
|
||||
*
|
||||
* @param sid
|
||||
* @return
|
||||
*/
|
||||
@@ -1656,8 +1667,10 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
baseMapper.updateById(card);
|
||||
return rb.success().setData("成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 共享家庭卡详情
|
||||
*
|
||||
* @param sid
|
||||
* @return
|
||||
*/
|
||||
@@ -1693,6 +1706,7 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
vo.setShareRecordList(v);
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
|
||||
public ResultBean cardShareGoodsDetail(String sid) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
CardShareDetailVo vo = new CardShareDetailVo();
|
||||
@@ -1744,6 +1758,11 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
|
||||
public LpkGiftCard selectOneByCodeAndCodeKey(String code, String codeKey) {
|
||||
return baseMapper.selectOne(new QueryWrapper<LpkGiftCard>().eq("code", code)
|
||||
.eq("codeKey", codeKey));
|
||||
}
|
||||
|
||||
// public ResultBean getGoodsByTypeSid(LpkGiftCardQuery query) {
|
||||
// ResultBean rb=new ResultBean().fail();
|
||||
// List<GiftBagGoodss> giftBagGoodss=lpkGoodsService.getAllGoodsApplets(query).getData();
|
||||
|
||||
@@ -33,4 +33,5 @@ public interface TransferRecordsMapper extends BaseMapper<TransferRecords> {
|
||||
List<TransferRecords> selByOrderSids(String orderSid);
|
||||
|
||||
IPage<TransferRecordsVo> orderListByUserSid(IPage<TransferRecords> page, @Param("query") TransferRecordsQuery query);
|
||||
IPage<TransferRecordsVo> orderListByUserSid1(IPage<TransferRecords> page, @Param("query") TransferRecordsQuery query);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
transfer_records
|
||||
WHERE
|
||||
customerSid=#{query.customerSid}
|
||||
UNION
|
||||
|
||||
|
||||
</select>
|
||||
<select id="orderListByUserSid1" resultType="com.yxt.yythmall.api.transferrecords.TransferRecordsVo">
|
||||
SELECT
|
||||
sid,
|
||||
'领取' as type,
|
||||
@@ -37,5 +40,4 @@
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -4,6 +4,7 @@ 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.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
@@ -71,8 +72,13 @@ public class TransferRecordsService extends MybatisBaseService<TransferRecordsMa
|
||||
QueryWrapper<VegeCellarReserveOrder> qw = new QueryWrapper<>();
|
||||
qw.eq("o.customerSid", query.getCustomerSid());
|
||||
IPage<TransferRecords> page = PagerUtil.queryToPage(pq);
|
||||
IPage<TransferRecordsVo> pagging =new Page<>();
|
||||
if(query.getState().equals("1")){
|
||||
pagging = baseMapper.orderListByUserSid(page, query);
|
||||
}else{
|
||||
pagging = baseMapper.orderListByUserSid1(page, query);
|
||||
}
|
||||
|
||||
IPage<TransferRecordsVo> pagging = baseMapper.orderListByUserSid(page, query);
|
||||
List<OrderGoodsVo> goodsVo = new ArrayList<>();
|
||||
for(TransferRecordsVo vo:pagging.getRecords()){
|
||||
List<TransferRecordsGoodsDetails> goods =transferRecordsGoodsDetailsService.selByOrderSids(vo.getSid());
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.yxt.yythmall.biz.vegereplenish;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.yythmall.api.vegecallerreservedetails.VegeCellarReserveDetails;
|
||||
import com.yxt.yythmall.api.vegereplenish.VegeReplenish;
|
||||
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 VegeReplenishMapper extends BaseMapper<VegeReplenish> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?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.vegereplenish.VegeReplenishMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.yxt.yythmall.biz.vegereplenish;
|
||||
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.BindCardDto;
|
||||
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("vegereplenish")
|
||||
public class VegeReplenishRest {
|
||||
@Autowired
|
||||
VegeReplenishService vegeReplenishService;
|
||||
|
||||
@ApiOperation("保存")
|
||||
@PostMapping("/saveBindRecord")
|
||||
public ResultBean<String> saveBindRecord(@RequestBody BindCardDto dto, @RequestParam("type") String type) {
|
||||
return vegeReplenishService.saveBindRecord(dto,type);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.yxt.yythmall.biz.vegereplenish;
|
||||
|
||||
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.empcard.EmpCard;
|
||||
import com.yxt.yythmall.api.empcardgift.EmpCardGift;
|
||||
import com.yxt.yythmall.api.empcardgiftgoods.EmpCardGiftGoodsVo;
|
||||
import com.yxt.yythmall.api.lpkgiftbag.GiftBagGoods;
|
||||
import com.yxt.yythmall.api.lpkgiftbag.LpkGiftBagInitVo;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.BindCardDto;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.GoodsVo;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.LpkGiftCard;
|
||||
import com.yxt.yythmall.api.lpkgoods.LpkGoods;
|
||||
import com.yxt.yythmall.api.vegecallerreservedetails.VegeCellarReserveDetails;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderDto;
|
||||
import com.yxt.yythmall.api.vegereplenish.VegeReplenish;
|
||||
import com.yxt.yythmall.api.vegereplenishdetail.VegeReplenishDetail;
|
||||
import com.yxt.yythmall.api.vegetablecellar.VegetableCellar;
|
||||
import com.yxt.yythmall.biz.customerstore.CustomerStoreService;
|
||||
import com.yxt.yythmall.biz.empcard.EmpCardService;
|
||||
import com.yxt.yythmall.biz.empcardgift.EmpCardGiftService;
|
||||
import com.yxt.yythmall.biz.empcardgiftgoods.EmpCardGiftGoodsService;
|
||||
import com.yxt.yythmall.biz.lpkgiftbag.LpkGiftBagService;
|
||||
import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardService;
|
||||
import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService;
|
||||
import com.yxt.yythmall.biz.vegereplenishdetail.VegeReplenishDetailService;
|
||||
import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService;
|
||||
import com.yxt.yythmall.mallplus.biz.util.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:36
|
||||
*/
|
||||
@Service
|
||||
public class VegeReplenishService extends MybatisBaseService<VegeReplenishMapper, VegeReplenish> {
|
||||
|
||||
@Autowired
|
||||
private VegeReplenishDetailService vegeReplenishDetailService;
|
||||
@Autowired
|
||||
private LpkGiftCardService lpkGiftCardService;
|
||||
@Autowired
|
||||
private LpkGiftBagService lpkGiftBagService;
|
||||
@Autowired
|
||||
private EmpCardService empCardService;
|
||||
@Autowired
|
||||
private EmpCardGiftService empCardGiftService;
|
||||
@Autowired
|
||||
private EmpCardGiftGoodsService empCardGiftGoodsService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean<String> saveBindRecord(BindCardDto dto, String type) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
VegeReplenish entity = new VegeReplenish();
|
||||
if (StringUtils.isNotBlank(dto.getCustomerSid())) {
|
||||
entity.setCustomerSid(dto.getCustomerSid());
|
||||
}
|
||||
if (StringUtils.isNotBlank(dto.getCode())) {
|
||||
entity.setCardCode(dto.getCode());
|
||||
}
|
||||
entity.setCreateTime(new DateTime());
|
||||
entity.setCardtype(type);
|
||||
baseMapper.insert(entity);
|
||||
if (type.equals("0")) {
|
||||
//个人卡
|
||||
LpkGiftCard card = lpkGiftCardService.selectOneByCodeAndCodeKey(dto.getCode(), dto.getCodeKey());
|
||||
if (null != card) {
|
||||
LpkGiftBagInitVo giftBagInitVo = lpkGiftBagService.giftBagInit(card.getGiftbagSid()).getData();
|
||||
if (null != giftBagInitVo) {
|
||||
List<GiftBagGoods> goods = giftBagInitVo.getGoods();
|
||||
if (!goods.isEmpty()) {
|
||||
goods.stream().forEach(g -> {
|
||||
VegeReplenishDetail detail = new VegeReplenishDetail();
|
||||
detail.setGoodsSid(g.getGoodsSid());
|
||||
detail.setGoodsNumber(Integer.parseInt(g.getGoodsNumber()));
|
||||
detail.setOrderSid(entity.getSid());
|
||||
detail.setCreateTime(new DateTime());
|
||||
vegeReplenishDetailService.insert(detail);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (type.equals("1")) {
|
||||
//企业卡
|
||||
EmpCard card = empCardService.selectOneByCodeAndCodeKey(dto.getCode(), dto.getCodeKey());
|
||||
if (null != card) {
|
||||
LpkGiftBagInitVo giftBagInitVo = lpkGiftBagService.giftBagInit(card.getGiftbagSid()).getData();
|
||||
if (null != giftBagInitVo) {
|
||||
List<GiftBagGoods> goods = giftBagInitVo.getGoods();
|
||||
if (!goods.isEmpty()) {
|
||||
goods.stream().forEach(g -> {
|
||||
VegeReplenishDetail detail = new VegeReplenishDetail();
|
||||
detail.setGoodsSid(g.getGoodsSid());
|
||||
detail.setGoodsNumber(Integer.parseInt(g.getGoodsNumber()));
|
||||
detail.setOrderSid(entity.getSid());
|
||||
detail.setCreateTime(new DateTime());
|
||||
vegeReplenishDetailService.insert(detail);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (type.equals("2")) {
|
||||
//转赠卡
|
||||
EmpCardGift card = empCardGiftService.selectOneByCodeAndCodeKey(dto.getCode(), dto.getCodeKey());
|
||||
if (null != card) {
|
||||
List<EmpCardGiftGoodsVo> goods = empCardGiftGoodsService.getGoodsDetailsByEmpCardGiftSid(card.getSid()).getData();
|
||||
if (!goods.isEmpty()) {
|
||||
goods.stream().forEach(g -> {
|
||||
VegeReplenishDetail detail = new VegeReplenishDetail();
|
||||
detail.setGoodsSid(g.getGoodsSid());
|
||||
detail.setGoodsNumber(g.getGoodsNumber());
|
||||
detail.setOrderSid(entity.getSid());
|
||||
detail.setCreateTime(new DateTime());
|
||||
vegeReplenishDetailService.insert(detail);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.yxt.yythmall.biz.vegereplenishdetail;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.yythmall.api.vegereplenish.VegeReplenish;
|
||||
import com.yxt.yythmall.api.vegereplenishdetail.VegeReplenishDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:36
|
||||
*/
|
||||
@Mapper
|
||||
public interface VegeReplenishDetailMapper extends BaseMapper<VegeReplenishDetail> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?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.vegereplenishdetail.VegeReplenishDetailMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.yxt.yythmall.biz.vegereplenishdetail;
|
||||
|
||||
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("vegereplenishdetail")
|
||||
public class VegeReplenishDetailRest {
|
||||
@Autowired
|
||||
VegeReplenishDetailService vegeReplenishDetailService;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.yxt.yythmall.biz.vegereplenishdetail;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.yythmall.api.vegereplenish.VegeReplenish;
|
||||
import com.yxt.yythmall.api.vegereplenishdetail.VegeReplenishDetail;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:36
|
||||
*/
|
||||
@Service
|
||||
public class VegeReplenishDetailService extends MybatisBaseService<VegeReplenishDetailMapper, VegeReplenishDetail> {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user