Browse Source

1/21

master
wangpengfei 1 year ago
parent
commit
9c770d82b5
  1. 2
      src/main/java/com/yxt/yythmall/api/transferrecords/TransferRecordsDto.java
  2. 2
      src/main/java/com/yxt/yythmall/api/transferrecords/TransferRecordsQuery.java
  3. 6
      src/main/java/com/yxt/yythmall/api/transferrecords/TransferRecordsVo.java
  4. 2
      src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrder.java
  5. 1
      src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderDto.java
  6. 8
      src/main/java/com/yxt/yythmall/biz/transferrecords/TransferRecordsMapper.java
  7. 42
      src/main/java/com/yxt/yythmall/biz/transferrecords/TransferRecordsMapper.xml
  8. 14
      src/main/java/com/yxt/yythmall/biz/transferrecords/TransferRecordsRest.java
  9. 48
      src/main/java/com/yxt/yythmall/biz/transferrecords/TransferRecordsService.java
  10. 2
      src/main/java/com/yxt/yythmall/biz/transferrecordsgoodsdetails/TransferRecordsGoodsDetailsMapper.java
  11. 11
      src/main/java/com/yxt/yythmall/biz/transferrecordsgoodsdetails/TransferRecordsGoodsDetailsService.java
  12. 2
      src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsService.java
  13. 16
      src/main/java/com/yxt/yythmall/biz/vegetablecellar/VegetableCellarService.java
  14. 2
      src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java

2
src/main/java/com/yxt/yythmall/api/transferrecords/TransferRecordsDto.java

@ -18,6 +18,6 @@ public class TransferRecordsDto implements Dto {
private String state;// private String state;//
private String recipientSid;//领取人 private String recipientSid;//领取人
private String orderSid; private String orderSid;
private List<GoodsVo> goodsVos; private List<GoodsVo> vos;
} }

2
src/main/java/com/yxt/yythmall/api/transferrecords/TransferRecordsQuery.java

@ -13,7 +13,7 @@ public class TransferRecordsQuery implements Query {
private String store; // 门店 private String store; // 门店
private String startDate; //预约开始日期 private String startDate; //预约开始日期
private String endDate; // 预约结束日期 private String endDate; // 预约结束日期
private String userSid; private String customerSid;
private String storeSid; private String storeSid;
private String bankSid; private String bankSid;
private String bankName; private String bankName;

6
src/main/java/com/yxt/yythmall/api/transferrecords/TransferRecordsVo.java

@ -16,9 +16,15 @@ import java.util.List;
*/ */
@Data @Data
public class TransferRecordsVo implements Vo { public class TransferRecordsVo implements Vo {
private String sid;
private String customerSid;//客户sid private String customerSid;//客户sid
private String transferCode;//转赠code private String transferCode;//转赠code
private String affiliation;//所属菜窖 private String affiliation;//所属菜窖
private String state;// private String state;//
private String stateValue;//
private String type;
private String recipientSid;//领取人 private String recipientSid;//领取人
private String goodss;
private String createTime;
private String remarks;
} }

2
src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrder.java

@ -18,7 +18,7 @@ public class VegeCellarReserveOrder {
private Date createTime; private Date createTime;
private String remarks; private String remarks;
private String isEnable; private String isEnable;
private String affiliation;
private String customerSid; private String customerSid;
private String reserveDate; private String reserveDate;
private String storeSid; private String storeSid;

1
src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderDto.java

@ -20,6 +20,7 @@ public class VegeCellarReserveOrderDto implements Dto {
private String userPhone; private String userPhone;
private String userAddress; private String userAddress;
private String affiliation; private String affiliation;
private String brandId;
private List<GoodsVo> goodsVos; private List<GoodsVo> goodsVos;
private String goodsSid; private String goodsSid;
private double select; private double select;

8
src/main/java/com/yxt/yythmall/biz/transferrecords/TransferRecordsMapper.java

@ -1,7 +1,13 @@
package com.yxt.yythmall.biz.transferrecords; package com.yxt.yythmall.biz.transferrecords;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yxt.yythmall.api.transferrecords.TransferRecords; import com.yxt.yythmall.api.transferrecords.TransferRecords;
import com.yxt.yythmall.api.transferrecords.TransferRecordsQuery;
import com.yxt.yythmall.api.transferrecords.TransferRecordsVo;
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrder;
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderQuery;
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderVo;
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 org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
@ -25,4 +31,6 @@ public interface TransferRecordsMapper extends BaseMapper<TransferRecords> {
List<TransferRecords> selInOrderSid(@Param("orderSids") List<String> orderSids); List<TransferRecords> selInOrderSid(@Param("orderSids") List<String> orderSids);
@Select("select *,goodsNumber as num from lpk_reserve_order_goods where orderSid=#{orderSid}") @Select("select *,goodsNumber as num from lpk_reserve_order_goods where orderSid=#{orderSid}")
List<TransferRecords> selByOrderSids(String orderSid); List<TransferRecords> selByOrderSids(String orderSid);
IPage<TransferRecordsVo> orderListByUserSid(IPage<TransferRecords> page, @Param("query") TransferRecordsQuery query);
} }

42
src/main/java/com/yxt/yythmall/biz/transferrecords/TransferRecordsMapper.xml

@ -4,19 +4,37 @@
<!-- <where> ${ew.sqlSegment} </where>--> <!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} --> <!-- ${ew.customSqlSegment} -->
<select id="storeListPage" resultType="com.yxt.yythmall.api.lpkstore.LpkStoreVo"> <select id="orderListByUserSid" resultType="com.yxt.yythmall.api.transferrecords.TransferRecordsVo">
select SELECT
sid , sid ,
date_format(createTime, '%Y-%m-%d') as createTime, '转赠' as type,
code, transferCode,
`name`, createTime ,
address, remarks,
phone, case state
businessHours when 1 then '已分享'
from lpk_store when 2 then '已领取'
<where> end stateValue
${ew.sqlSegment} FROM
</where> transfer_records
WHERE
customerSid=#{query.customerSid}
UNION
SELECT
sid,
'领取' as type,
transferCode,
createTime ,
remarks,
case state
when 1 then '已分享'
when 2 then '已领取'
end stateValue
FROM
transfer_records
WHERE
recipientSid =#{query.customerSid}
</select> </select>

14
src/main/java/com/yxt/yythmall/biz/transferrecords/TransferRecordsRest.java

@ -1,15 +1,16 @@
package com.yxt.yythmall.biz.transferrecords; package com.yxt.yythmall.biz.transferrecords;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import com.yxt.yythmall.api.transferrecords.TransferRecordsDto; import com.yxt.yythmall.api.transferrecords.TransferRecordsDto;
import com.yxt.yythmall.api.transferrecords.TransferRecordsQuery;
import com.yxt.yythmall.api.transferrecords.TransferRecordsVo;
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderDto; import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderDto;
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;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* @author wangpengfei * @author wangpengfei
@ -27,4 +28,9 @@ public class TransferRecordsRest {
public ResultBean submission(@RequestBody TransferRecordsDto dto) { public ResultBean submission(@RequestBody TransferRecordsDto dto) {
return TransferRecordsService.submission(dto); return TransferRecordsService.submission(dto);
} }
@ApiOperation("转赠记录表")
@PostMapping("/transferRecordsList")
public ResultBean<PagerVo<TransferRecordsVo>> transferRecordsList(@RequestBody PagerQuery<TransferRecordsQuery> pq) {
return TransferRecordsService.transferRecordsList(pq);
}
} }

48
src/main/java/com/yxt/yythmall/biz/transferrecords/TransferRecordsService.java

@ -3,22 +3,37 @@ package com.yxt.yythmall.biz.transferrecords;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.service.MybatisBaseService;
import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.base.utils.StringUtils;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.result.ResultBean;
import com.yxt.yythmall.api.customerstore.CustomerStoreDto; import com.yxt.yythmall.api.customerstore.CustomerStoreDto;
import com.yxt.yythmall.api.lpkgiftcard.GoodsVo; import com.yxt.yythmall.api.lpkgiftcard.GoodsVo;
import com.yxt.yythmall.api.lpkgoods.LpkGoods;
import com.yxt.yythmall.api.transferrecords.TransferRecords; import com.yxt.yythmall.api.transferrecords.TransferRecords;
import com.yxt.yythmall.api.transferrecords.TransferRecordsDto; import com.yxt.yythmall.api.transferrecords.TransferRecordsDto;
import com.yxt.yythmall.api.transferrecords.TransferRecordsQuery;
import com.yxt.yythmall.api.transferrecords.TransferRecordsVo;
import com.yxt.yythmall.api.transferrecordsgoodsdetails.TransferRecordsGoodsDetails;
import com.yxt.yythmall.api.vegecallerreservedetails.VegeCellarReserveDetails;
import com.yxt.yythmall.api.vegecallerreserveorder.OrderGoodsVo;
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrder;
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderQuery;
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderVo;
import com.yxt.yythmall.api.vegetablecellar.VegetableCellar; import com.yxt.yythmall.api.vegetablecellar.VegetableCellar;
import com.yxt.yythmall.biz.customerstore.CustomerStoreService; import com.yxt.yythmall.biz.customerstore.CustomerStoreService;
import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardService; import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardService;
import com.yxt.yythmall.biz.lpkgiftcard.generateRule.UniqueIdGenerator; import com.yxt.yythmall.biz.lpkgiftcard.generateRule.UniqueIdGenerator;
import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService;
import com.yxt.yythmall.biz.transferrecordsgoodsdetails.TransferRecordsGoodsDetailsService; import com.yxt.yythmall.biz.transferrecordsgoodsdetails.TransferRecordsGoodsDetailsService;
import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService; import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -33,6 +48,8 @@ public class TransferRecordsService extends MybatisBaseService<TransferRecordsMa
TransferRecordsGoodsDetailsService transferRecordsGoodsDetailsService; TransferRecordsGoodsDetailsService transferRecordsGoodsDetailsService;
@Autowired @Autowired
CustomerStoreService customerStoreService; CustomerStoreService customerStoreService;
@Autowired
LpkGoodsService lpkGoodsService;
public ResultBean submission(TransferRecordsDto dto) { public ResultBean submission(TransferRecordsDto dto) {
@ -46,6 +63,35 @@ public class TransferRecordsService extends MybatisBaseService<TransferRecordsMa
baseMapper.insert(order); baseMapper.insert(order);
dto.setOrderSid(order.getSid()); dto.setOrderSid(order.getSid());
transferRecordsGoodsDetailsService.submissionDetail(dto); transferRecordsGoodsDetailsService.submissionDetail(dto);
return rb.success().setData("转赠成功"); return rb.success().setData(order);
}
public ResultBean transferRecordsList(PagerQuery<TransferRecordsQuery> pq) {
ResultBean rb = new ResultBean().fail();
TransferRecordsQuery query = pq.getParams();
QueryWrapper<VegeCellarReserveOrder> qw = new QueryWrapper<>();
qw.eq("o.customerSid", query.getCustomerSid());
IPage<TransferRecords> page = PagerUtil.queryToPage(pq);
IPage<TransferRecordsVo> pagging = baseMapper.orderListByUserSid(page, query);
List<OrderGoodsVo> goodsVo = new ArrayList<>();
for(TransferRecordsVo vo:pagging.getRecords()){
List<TransferRecordsGoodsDetails> goods =transferRecordsGoodsDetailsService.selByOrderSids(vo.getSid());
for(TransferRecordsGoodsDetails goods1:goods){
LpkGoods lpkGoods=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",goods1.getGoodsSid()));
// OrderGoodsVo orderGoodsVo=new OrderGoodsVo();
// orderGoodsVo.setGoodName(lpkGoods.getName());
// orderGoodsVo.setNum(Integer.parseInt(goods1.getNum()));
// orderGoodsVo.setUnitName(lpkGoods.getUnitName());
// goodsVo.add(orderGoodsVo);
if(StringUtils.isBlank(vo.getGoodss())){
vo.setGoodss(lpkGoods.getName()+":"+goods1.getGoodsNumber()+lpkGoods.getUnitName());
}else{
vo.setGoodss(vo.getGoodss()+" "+lpkGoods.getName()+":"+goods1.getGoodsNumber()+lpkGoods.getUnitName());
} }
} }
// vo.setGoodsVo(goodsVo);
}
return rb.success().setData(1);
}
}

2
src/main/java/com/yxt/yythmall/biz/transferrecordsgoodsdetails/TransferRecordsGoodsDetailsMapper.java

@ -23,6 +23,6 @@ public interface TransferRecordsGoodsDetailsMapper extends BaseMapper<TransferRe
List<TransferRecordsGoodsDetails> selByOrderSid(String orderSid); List<TransferRecordsGoodsDetails> selByOrderSid(String orderSid);
List<TransferRecordsGoodsDetails> selInOrderSid(@Param("orderSids") List<String> orderSids); List<TransferRecordsGoodsDetails> selInOrderSid(@Param("orderSids") List<String> orderSids);
@Select("select *,goodsNumber as num from lpk_reserve_order_goods where orderSid=#{orderSid}") @Select("select *,goodsNumber as goodsNumber from lpk_reserve_order_goods where orderSid=#{orderSid}")
List<TransferRecordsGoodsDetails> selByOrderSids(String orderSid); List<TransferRecordsGoodsDetails> selByOrderSids(String orderSid);
} }

11
src/main/java/com/yxt/yythmall/biz/transferrecordsgoodsdetails/TransferRecordsGoodsDetailsService.java

@ -7,13 +7,16 @@ import com.yxt.common.base.service.MybatisBaseService;
import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.result.ResultBean;
import com.yxt.yythmall.api.customerstore.CustomerStoreDto; import com.yxt.yythmall.api.customerstore.CustomerStoreDto;
import com.yxt.yythmall.api.lpkgiftcard.GoodsVo; import com.yxt.yythmall.api.lpkgiftcard.GoodsVo;
import com.yxt.yythmall.api.lpkgoods.LpkGoods;
import com.yxt.yythmall.api.transferrecords.TransferRecordsDto; import com.yxt.yythmall.api.transferrecords.TransferRecordsDto;
import com.yxt.yythmall.api.transferrecordsgoodsdetails.TransferRecordsGoodsDetails; import com.yxt.yythmall.api.transferrecordsgoodsdetails.TransferRecordsGoodsDetails;
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderDto; import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderDto;
import com.yxt.yythmall.api.vegetablecellar.VegetableCellar; import com.yxt.yythmall.api.vegetablecellar.VegetableCellar;
import com.yxt.yythmall.api.vegetablecellar.vegeVo;
import com.yxt.yythmall.biz.customerstore.CustomerStoreService; import com.yxt.yythmall.biz.customerstore.CustomerStoreService;
import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardService; import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardService;
import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService;
import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService; import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -32,7 +35,8 @@ public class TransferRecordsGoodsDetailsService extends MybatisBaseService<Trans
VegetableCellarService vegetableCellarService; VegetableCellarService vegetableCellarService;
@Autowired @Autowired
CustomerStoreService customerStoreService; CustomerStoreService customerStoreService;
@Autowired
LpkGoodsService lpkGoodsService;
public ResultBean<TransferRecordsGoodsDetails> getReserveByCardSid(String carSid, String goodsSid) { public ResultBean<TransferRecordsGoodsDetails> getReserveByCardSid(String carSid, String goodsSid) {
ResultBean rb = new ResultBean(); ResultBean rb = new ResultBean();
@ -45,15 +49,16 @@ public class TransferRecordsGoodsDetailsService extends MybatisBaseService<Trans
TransferRecordsGoodsDetails goods = new TransferRecordsGoodsDetails(); TransferRecordsGoodsDetails goods = new TransferRecordsGoodsDetails();
BeanUtil.copyProperties(dto, goods, "id", "sid"); BeanUtil.copyProperties(dto, goods, "id", "sid");
// goods.setCardSid(dto.getSid()); // goods.setCardSid(dto.getSid());
for (GoodsVo goods1 : dto.getGoodsVos()) { for (GoodsVo goods1 : dto.getVos()) {
if (goods1.getSelect() != 0) { if (goods1.getSelect() != 0) {
// goods.setCardSid(dto.getSid()); // goods.setCardSid(dto.getSid());
goods.setGoodsSid(goods1.getGoodsSid()); goods.setGoodsSid(goods1.getGoodsSid());
goods.setGoodsNumber(goods1.getSelect()); goods.setGoodsNumber(goods1.getSelect());
goods.setCreateTime(new DateTime()); goods.setCreateTime(new DateTime());
baseMapper.insert(goods); baseMapper.insert(goods);
LpkGoods l= lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",goods1.getGoodsSid()));
VegetableCellar vegetableCellar= vegetableCellarService.list(new QueryWrapper<VegetableCellar>().eq("customerSid",dto.getCustomerSid()) VegetableCellar vegetableCellar= vegetableCellarService.list(new QueryWrapper<VegetableCellar>().eq("customerSid",dto.getCustomerSid())
.eq("goodsSid",goods1.getGoodsSid()).eq("affiliation",dto.getAffiliation())).get(0); .eq("goodsSid",goods1.getGoodsSid()).eq("affiliation",l.getBrandId())).get(0);
double d=Double.valueOf(vegetableCellar.getGoodsNumber()); double d=Double.valueOf(vegetableCellar.getGoodsNumber());
double c=Double.valueOf(goods1.getSelect()); double c=Double.valueOf(goods1.getSelect());
if(Double.compare(d,c)==0){ if(Double.compare(d,c)==0){

2
src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsService.java

@ -60,7 +60,7 @@ public class VegeCellarReserveDetailsService extends MybatisBaseService<VegeCell
goods.setCreateTime(new DateTime()); goods.setCreateTime(new DateTime());
baseMapper.insert(goods); baseMapper.insert(goods);
VegetableCellar vegetableCellar= vegetableCellarService.list(new QueryWrapper<VegetableCellar>().eq("customerSid",dto.getCustomerSid()) VegetableCellar vegetableCellar= vegetableCellarService.list(new QueryWrapper<VegetableCellar>().eq("customerSid",dto.getCustomerSid())
.eq("goodsSid",goods1.getGoodsSid()).eq("affiliation",dto.getAffiliation())).get(0); .eq("goodsSid",goods1.getGoodsSid()).eq("affiliation",goods2.getBrandId())).get(0);
double d=Double.valueOf(vegetableCellar.getGoodsNumber()); double d=Double.valueOf(vegetableCellar.getGoodsNumber());
double c=Double.valueOf(goods1.getSelect()); double c=Double.valueOf(goods1.getSelect());
if(c>d){ if(c>d){

16
src/main/java/com/yxt/yythmall/biz/vegetablecellar/VegetableCellarService.java

@ -8,6 +8,7 @@ import com.yxt.common.base.utils.StringUtils;
import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo; import com.yxt.common.core.vo.PagerVo;
import com.yxt.yythmall.api.lpkgoods.LpkGoods;
import com.yxt.yythmall.api.ordorder.OrdOrder; import com.yxt.yythmall.api.ordorder.OrdOrder;
import com.yxt.yythmall.api.ordorderdetails.OrdOrderDetail; import com.yxt.yythmall.api.ordorderdetails.OrdOrderDetail;
import com.yxt.yythmall.api.shoppingcart.ShoppingCart; import com.yxt.yythmall.api.shoppingcart.ShoppingCart;
@ -15,6 +16,7 @@ import com.yxt.yythmall.api.transferrecords.TransferRecords;
import com.yxt.yythmall.api.transferrecordsgoodsdetails.TransferRecordsGoodsDetails; import com.yxt.yythmall.api.transferrecordsgoodsdetails.TransferRecordsGoodsDetails;
import com.yxt.yythmall.api.vegetablecellar.*; import com.yxt.yythmall.api.vegetablecellar.*;
import com.yxt.yythmall.biz.empcard.EmpCardService; import com.yxt.yythmall.biz.empcard.EmpCardService;
import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService;
import com.yxt.yythmall.biz.ordorder.OrdOrderService; import com.yxt.yythmall.biz.ordorder.OrdOrderService;
import com.yxt.yythmall.biz.ordorderdetails.OrdOrderDetailService; import com.yxt.yythmall.biz.ordorderdetails.OrdOrderDetailService;
import com.yxt.yythmall.biz.shoppingcart.ShoppingCartService; import com.yxt.yythmall.biz.shoppingcart.ShoppingCartService;
@ -42,6 +44,8 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
TransferRecordsService transferRecordsService; TransferRecordsService transferRecordsService;
@Autowired @Autowired
TransferRecordsGoodsDetailsService transferRecordsGoodsDetailsService; TransferRecordsGoodsDetailsService transferRecordsGoodsDetailsService;
@Autowired
LpkGoodsService lpkGoodsService;
public ResultBean addGoods(String mainSid) { public ResultBean addGoods(String mainSid) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
OrdOrder ordOrder=ordOrderService.getOne(new QueryWrapper<OrdOrder>().eq("mainSid",mainSid)); OrdOrder ordOrder=ordOrderService.getOne(new QueryWrapper<OrdOrder>().eq("mainSid",mainSid));
@ -65,12 +69,15 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
} }
public ResultBean saveGoods(VegetableCellarDto dto) { public ResultBean saveGoods(VegetableCellarDto dto) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
for(vegeVo detail:dto.getVos()){
List<ShoppingCart> carts=shoppingCartService.list(new QueryWrapper<ShoppingCart>().eq("customerSid",dto.getCustomerSid()).eq("affiliation",dto.getBrandId()));
for(ShoppingCart detail:carts){
VegetableCellar vegetableCellar=baseMapper.selectOne(new QueryWrapper<VegetableCellar>().eq("customerSid",dto.getCustomerSid()) VegetableCellar vegetableCellar=baseMapper.selectOne(new QueryWrapper<VegetableCellar>().eq("customerSid",dto.getCustomerSid())
.eq("goodsSid",detail.getGoodsSid()).eq("affiliation",dto.getBrandId())); .eq("goodsSid",detail.getGoodsSid()).eq("affiliation",dto.getBrandId()));
LpkGoods cl=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",detail.getGoodsSid()));
if(vegetableCellar==null){ if(vegetableCellar==null){
VegetableCellar vegetable=new VegetableCellar(); VegetableCellar vegetable=new VegetableCellar();
vegetable.setAffiliation(dto.getBrandId()); vegetable.setAffiliation(String.valueOf(cl.getBrandId()));
vegetable.setGoodsSid(detail.getGoodsSid()); vegetable.setGoodsSid(detail.getGoodsSid());
vegetable.setGoodsNumber(detail.getGoodsNumber()); vegetable.setGoodsNumber(detail.getGoodsNumber());
vegetable.setCustomerSid(dto.getCustomerSid()); vegetable.setCustomerSid(dto.getCustomerSid());
@ -112,11 +119,12 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
} }
List<TransferRecordsGoodsDetails>list=transferRecordsGoodsDetailsService.list(new QueryWrapper<TransferRecordsGoodsDetails>().eq("orderSid",dto.getTransferSid())); List<TransferRecordsGoodsDetails>list=transferRecordsGoodsDetailsService.list(new QueryWrapper<TransferRecordsGoodsDetails>().eq("orderSid",dto.getTransferSid()));
for(TransferRecordsGoodsDetails detail:list){ for(TransferRecordsGoodsDetails detail:list){
LpkGoods cl=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",detail.getGoodsSid()));
VegetableCellar vegetableCellar=baseMapper.selectOne(new QueryWrapper<VegetableCellar>().eq("customerSid",dto.getCustomerSid()) VegetableCellar vegetableCellar=baseMapper.selectOne(new QueryWrapper<VegetableCellar>().eq("customerSid",dto.getCustomerSid())
.eq("goodsSid",detail.getGoodsSid()).eq("affiliation",transferRecords.getAffiliation())); .eq("goodsSid",detail.getGoodsSid()).eq("affiliation",transferRecords.getAffiliation()));
if(vegetableCellar==null){ if(vegetableCellar==null){
VegetableCellar vegetable=new VegetableCellar(); VegetableCellar vegetable=new VegetableCellar();
vegetable.setAffiliation(transferRecords.getAffiliation()); vegetable.setAffiliation(String.valueOf(cl.getBrandId()));
vegetable.setGoodsSid(detail.getGoodsSid()); vegetable.setGoodsSid(detail.getGoodsSid());
vegetable.setGoodsNumber(String.valueOf((int)detail.getGoodsNumber())); vegetable.setGoodsNumber(String.valueOf((int)detail.getGoodsNumber()));
vegetable.setCustomerSid(dto.getCustomerSid()); vegetable.setCustomerSid(dto.getCustomerSid());
@ -125,7 +133,7 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
vegetableCellar.setGoodsNumber(String.valueOf((int) (Double.valueOf(vegetableCellar.getGoodsNumber())+Double.valueOf(detail.getGoodsNumber())))); vegetableCellar.setGoodsNumber(String.valueOf((int) (Double.valueOf(vegetableCellar.getGoodsNumber())+Double.valueOf(detail.getGoodsNumber()))));
baseMapper.updateById(vegetableCellar); baseMapper.updateById(vegetableCellar);
} }
transferRecords.setState("1"); transferRecords.setState("2");
transferRecords.setRecipientSid(dto.getCustomerSid()); transferRecords.setRecipientSid(dto.getCustomerSid());
transferRecordsService.updateById(transferRecords); transferRecordsService.updateById(transferRecords);
} }

2
src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java

@ -45,6 +45,8 @@ public class SaTokenConfigure implements WebMvcConfigurer {
.excludePathPatterns("/lpksreservoorder/orderDetails/**") .excludePathPatterns("/lpksreservoorder/orderDetails/**")
.excludePathPatterns("/lpkgoods/goodsDetails/**") .excludePathPatterns("/lpkgoods/goodsDetails/**")
.excludePathPatterns("/lpkstore/getAllStoreByQuery") .excludePathPatterns("/lpkstore/getAllStoreByQuery")
.excludePathPatterns("/vegetablecellar/receiveTransferGoods")
.excludePathPatterns("/transferrecords/submission")
.excludePathPatterns("/lpkgiftcard/getCardByBank") .excludePathPatterns("/lpkgiftcard/getCardByBank")
.excludePathPatterns("/empcard/getEmpCard") .excludePathPatterns("/empcard/getEmpCard")
.excludePathPatterns("/empcardgift/shareEmpCard/**") .excludePathPatterns("/empcardgift/shareEmpCard/**")

Loading…
Cancel
Save