wangpengfei 1 year ago
parent
commit
26e93a0cff
  1. 10
      src/main/java/com/yxt/yythmall/api/lpkgoods/LpkGoodsDetailsVo.java
  2. 4
      src/main/java/com/yxt/yythmall/biz/lpkgoods/LpkGoodsMapper.xml
  3. 6
      src/main/java/com/yxt/yythmall/biz/lpkgoods/LpkGoodsRest.java
  4. 16
      src/main/java/com/yxt/yythmall/biz/lpkgoods/LpkGoodsService.java
  5. 15
      src/main/java/com/yxt/yythmall/biz/transferrecords/TransferRecordsService.java
  6. 11
      src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java

10
src/main/java/com/yxt/yythmall/api/lpkgoods/LpkGoodsDetailsVo.java

@ -1,5 +1,6 @@
package com.yxt.yythmall.api.lpkgoods;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yxt.common.core.vo.Vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -39,4 +40,13 @@ public class LpkGoodsDetailsVo implements Vo {
@ApiModelProperty("阶梯价格")
private String stepPrice;
private String periodValidity;
private Integer qssl;
/**
* 订购协议
*/
private String dgxy;
private String qdxy;
private String goodsNumber;
private String mefenPrice;
}

4
src/main/java/com/yxt/yythmall/biz/lpkgoods/LpkGoodsMapper.xml

@ -56,7 +56,9 @@
appContent,
specificationUnit,
number,
isAppletGrounding
isAppletGrounding,
brandId,
categoryId
from lpk_goods
where sid = #{sid}
</select>

6
src/main/java/com/yxt/yythmall/biz/lpkgoods/LpkGoodsRest.java

@ -57,9 +57,9 @@ public class LpkGoodsRest {
}
@ApiOperation("商品详情")
@GetMapping("/goodsDetails/{sid}")
public ResultBean<LpkGoodsDetailsVo> goodsDetails(@PathVariable("sid") String sid) {
return lpkGoodsService.goodsDetails(sid);
@GetMapping("/goodsDetails/{sid}/{customerSid}")
public ResultBean<LpkGoodsDetailsVo> goodsDetails(@PathVariable("sid") String sid,@PathVariable("customerSid")String customerSid) {
return lpkGoodsService.goodsDetails(sid,customerSid);
}
@ApiOperation("小程序商品上下架")
@GetMapping("/appletGrounding/{sid}/{state}")

16
src/main/java/com/yxt/yythmall/biz/lpkgoods/LpkGoodsService.java

@ -1,5 +1,6 @@
package com.yxt.yythmall.biz.lpkgoods;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime;
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.lpkgiftcard.LpkGiftCardQuery;
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.ShoppingCartVo;
import com.yxt.yythmall.biz.enterprisecertification.EnterpriseCertificationService;
@ -133,7 +135,7 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
return rb.success().setData(vo);
}
public ResultBean<LpkGoodsDetailsVo> goodsDetails(String sid) {
public ResultBean<LpkGoodsDetailsVo> goodsDetails(String sid,String customerSid) {
ResultBean rb = ResultBean.fireFail();
LpkGoodsDetailsVo vo = new LpkGoodsDetailsVo();
LpkGoodsVo lpkGoods = baseMapper.getGoodsDetails(sid);
@ -145,6 +147,18 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
}
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);
}

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

@ -38,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
/**
* @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());
}
}
if(StringUtils.isNotBlank(vo.getTransferCode())){
vo.setTransferCode(addSpaces(vo.getTransferCode()));
}
// vo.setGoodsVo(goodsVo);
}
PagerVo<TransferRecordsVo> p = PagerUtil.pageToVo(pagging, null);
@ -154,4 +158,15 @@ public class TransferRecordsService extends MybatisBaseService<TransferRecordsMa
}
return num;
}
/**
* 单号每四位加空格
* @param newCode
* @return
*/
public static String addSpaces(String code) {
String newCode = Pattern.compile("(.{4})").matcher(code).replaceAll("$1 ");
return newCode;
}
}

11
src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java

@ -33,6 +33,7 @@ import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.util.*;
import java.util.regex.Pattern;
/**
* @author wangpengfei
@ -342,6 +343,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
vo.setGoodss(vo.getGoodss() + " " + lpkGoods.getName() + ":" + goods1.getNum() + lpkGoods.getUnitName());
}
}
vo.setReserveCode(addSpaces(vo.getReserveCode()));
vo.setGoodsVo(goodsVo);
}
@ -883,4 +885,13 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
});
return listRes;
}
/**
* 单号每四位加空格
* @param newCode
* @return
*/
public static String addSpaces(String code) {
String newCode = Pattern.compile("(.{4})").matcher(code).replaceAll("$1 ");
return newCode;
}
}

Loading…
Cancel
Save