3/5
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.yxt.yythmall.api.lpkgoods;
|
package com.yxt.yythmall.api.lpkgoods;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.yxt.common.core.vo.Vo;
|
import com.yxt.common.core.vo.Vo;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -39,4 +40,13 @@ public class LpkGoodsDetailsVo implements Vo {
|
|||||||
@ApiModelProperty("阶梯价格")
|
@ApiModelProperty("阶梯价格")
|
||||||
private String stepPrice;
|
private String stepPrice;
|
||||||
private String periodValidity;
|
private String periodValidity;
|
||||||
|
private Integer qssl;
|
||||||
|
/**
|
||||||
|
* 订购协议
|
||||||
|
*/
|
||||||
|
private String dgxy;
|
||||||
|
|
||||||
|
private String qdxy;
|
||||||
|
private String goodsNumber;
|
||||||
|
private String mefenPrice;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,9 @@
|
|||||||
appContent,
|
appContent,
|
||||||
specificationUnit,
|
specificationUnit,
|
||||||
number,
|
number,
|
||||||
isAppletGrounding
|
isAppletGrounding,
|
||||||
|
brandId,
|
||||||
|
categoryId
|
||||||
from lpk_goods
|
from lpk_goods
|
||||||
where sid = #{sid}
|
where sid = #{sid}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -57,9 +57,9 @@ public class LpkGoodsRest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("商品详情")
|
@ApiOperation("商品详情")
|
||||||
@GetMapping("/goodsDetails/{sid}")
|
@GetMapping("/goodsDetails/{sid}/{customerSid}")
|
||||||
public ResultBean<LpkGoodsDetailsVo> goodsDetails(@PathVariable("sid") String sid) {
|
public ResultBean<LpkGoodsDetailsVo> goodsDetails(@PathVariable("sid") String sid,@PathVariable("customerSid")String customerSid) {
|
||||||
return lpkGoodsService.goodsDetails(sid);
|
return lpkGoodsService.goodsDetails(sid,customerSid);
|
||||||
}
|
}
|
||||||
@ApiOperation("小程序商品上下架")
|
@ApiOperation("小程序商品上下架")
|
||||||
@GetMapping("/appletGrounding/{sid}/{state}")
|
@GetMapping("/appletGrounding/{sid}/{state}")
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.yxt.yythmall.biz.lpkgoods;
|
package com.yxt.yythmall.biz.lpkgoods;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
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 cn.hutool.core.date.DateUnit;
|
import cn.hutool.core.date.DateUnit;
|
||||||
@@ -19,6 +20,7 @@ import com.yxt.yythmall.api.enterprisecertification.EnterpriseCertificationVo;
|
|||||||
import com.yxt.yythmall.api.lpkcustomer.LpkCustomer;
|
import com.yxt.yythmall.api.lpkcustomer.LpkCustomer;
|
||||||
import com.yxt.yythmall.api.lpkgiftcard.LpkGiftCardQuery;
|
import com.yxt.yythmall.api.lpkgiftcard.LpkGiftCardQuery;
|
||||||
import com.yxt.yythmall.api.lpkgoods.*;
|
import com.yxt.yythmall.api.lpkgoods.*;
|
||||||
|
import com.yxt.yythmall.api.shoppingcart.ShoppingCart;
|
||||||
import com.yxt.yythmall.api.shoppingcart.ShoppingCartQuery;
|
import com.yxt.yythmall.api.shoppingcart.ShoppingCartQuery;
|
||||||
import com.yxt.yythmall.api.shoppingcart.ShoppingCartVo;
|
import com.yxt.yythmall.api.shoppingcart.ShoppingCartVo;
|
||||||
import com.yxt.yythmall.biz.enterprisecertification.EnterpriseCertificationService;
|
import com.yxt.yythmall.biz.enterprisecertification.EnterpriseCertificationService;
|
||||||
@@ -133,7 +135,7 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
|||||||
return rb.success().setData(vo);
|
return rb.success().setData(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultBean<LpkGoodsDetailsVo> goodsDetails(String sid) {
|
public ResultBean<LpkGoodsDetailsVo> goodsDetails(String sid,String customerSid) {
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
LpkGoodsDetailsVo vo = new LpkGoodsDetailsVo();
|
LpkGoodsDetailsVo vo = new LpkGoodsDetailsVo();
|
||||||
LpkGoodsVo lpkGoods = baseMapper.getGoodsDetails(sid);
|
LpkGoodsVo lpkGoods = baseMapper.getGoodsDetails(sid);
|
||||||
@@ -145,6 +147,18 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
|||||||
}
|
}
|
||||||
vo.setCreateTime(sdf.format(lpkGoods.getCreateTime()));
|
vo.setCreateTime(sdf.format(lpkGoods.getCreateTime()));
|
||||||
}
|
}
|
||||||
|
vo.setBrandId(lpkGoods.getBrandId());
|
||||||
|
LpkCustomer lpkCustomer =lpkCustomerService.getOne(new QueryWrapper<LpkCustomer>().eq("sid",customerSid));
|
||||||
|
PmsBrand pmsBrand= IPmsBrandService.getById(lpkGoods.getBrandId());
|
||||||
|
ShoppingCart shoppingCart=shoppingCartService.getOne(new QueryWrapper<ShoppingCart>().eq("customerSid",lpkCustomer.getSid())
|
||||||
|
.eq("goodsSid",lpkGoods.getSid()).eq("affiliation",lpkGoods.getBrandId()));
|
||||||
|
vo.setPrice(removeZeros(lpkGoods.getPrice()));
|
||||||
|
vo.setDgxy(pmsBrand.getDgxy());
|
||||||
|
vo.setQdxy(pmsBrand.getQdxy());
|
||||||
|
vo.setQssl(pmsBrand.getQssl());
|
||||||
|
vo.setCategoryId(lpkGoods.getCategoryId());
|
||||||
|
vo.setGoodsNumber(shoppingCart.getGoodsNumber());
|
||||||
|
vo.setMefenPrice(removeZeros(String.valueOf(Double.valueOf(lpkGoods.getWeight())*Double.valueOf(lpkGoods.getPrice()))));
|
||||||
return rb.success().setData(vo);
|
return rb.success().setData(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wangpengfei
|
* @author wangpengfei
|
||||||
@@ -135,6 +136,9 @@ public class TransferRecordsService extends MybatisBaseService<TransferRecordsMa
|
|||||||
vo.setGoodss(vo.getGoodss()+" "+lpkGoods.getName()+":"+removeZeros(String.valueOf(goods1.getGoodsNumber()))+lpkGoods.getUnitName());
|
vo.setGoodss(vo.getGoodss()+" "+lpkGoods.getName()+":"+removeZeros(String.valueOf(goods1.getGoodsNumber()))+lpkGoods.getUnitName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(StringUtils.isNotBlank(vo.getTransferCode())){
|
||||||
|
vo.setTransferCode(addSpaces(vo.getTransferCode()));
|
||||||
|
}
|
||||||
// vo.setGoodsVo(goodsVo);
|
// vo.setGoodsVo(goodsVo);
|
||||||
}
|
}
|
||||||
PagerVo<TransferRecordsVo> p = PagerUtil.pageToVo(pagging, null);
|
PagerVo<TransferRecordsVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
@@ -154,4 +158,15 @@ public class TransferRecordsService extends MybatisBaseService<TransferRecordsMa
|
|||||||
}
|
}
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单号每四位加空格
|
||||||
|
* @param newCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String addSpaces(String code) {
|
||||||
|
String newCode = Pattern.compile("(.{4})").matcher(code).replaceAll("$1 ");
|
||||||
|
return newCode;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import java.time.LocalDateTime;
|
|||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wangpengfei
|
* @author wangpengfei
|
||||||
@@ -342,6 +343,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
|
|||||||
vo.setGoodss(vo.getGoodss() + " " + lpkGoods.getName() + ":" + goods1.getNum() + lpkGoods.getUnitName());
|
vo.setGoodss(vo.getGoodss() + " " + lpkGoods.getName() + ":" + goods1.getNum() + lpkGoods.getUnitName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
vo.setReserveCode(addSpaces(vo.getReserveCode()));
|
||||||
vo.setGoodsVo(goodsVo);
|
vo.setGoodsVo(goodsVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -883,4 +885,13 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
|
|||||||
});
|
});
|
||||||
return listRes;
|
return listRes;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 单号每四位加空格
|
||||||
|
* @param newCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String addSpaces(String code) {
|
||||||
|
String newCode = Pattern.compile("(.{4})").matcher(code).replaceAll("$1 ");
|
||||||
|
return newCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user