2-29
This commit is contained in:
@@ -2,6 +2,7 @@ package com.yxt.yythmall.api.transferrecords;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import com.yxt.yythmall.api.transferrecordsgoodsdetails.TransferRecordsGoodsDetailsVo;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.OrderGoodsVo;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -29,4 +30,5 @@ public class TransferRecordsVo implements Vo {
|
||||
private String remarks;
|
||||
private String fxNick;
|
||||
private String lqNick;
|
||||
private List<TransferRecordsGoodsDetailsVo> list;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,11 @@ public class TransferRecordsGoodsDetailsVo implements Vo {
|
||||
private String goodsSid;
|
||||
private String goodsName;
|
||||
private String goodsNumber;
|
||||
private String goodsContent;
|
||||
private String goodsPicUrl;
|
||||
private String goodsFs;
|
||||
private String goodsJs;
|
||||
private String price;
|
||||
private String serialNumber;
|
||||
private String linker;
|
||||
private String linkPhone;
|
||||
|
||||
@@ -297,6 +297,8 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
});
|
||||
if(l.size()==0){
|
||||
giftBagGoodss.forEach(d->{
|
||||
d.setPrice(removeZeros(d.getPrice()));
|
||||
d.setJPrice(removeZeros(d.getJPrice()));
|
||||
// d.setIconUrl(fileUploadComponent.getUrlPrefix()+d.getIconUrl());
|
||||
d.setMefenPrice(removeZeros(String.valueOf((DoubleUtils.mul(Double.valueOf(d.getPrice()), Double.valueOf(d.getWeight()))))));
|
||||
|
||||
@@ -304,6 +306,8 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
}else{
|
||||
l.forEach(s->{
|
||||
giftBagGoodss.forEach(d->{
|
||||
d.setPrice(removeZeros(d.getPrice()));
|
||||
d.setJPrice(removeZeros(d.getJPrice()));
|
||||
if(s.getGoodsSid().equals(d.getGoodsSid())){
|
||||
d.setGoodsNumber(s.getGoodsNumber());
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ 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.config.component.FileUploadComponent;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
@@ -20,6 +21,7 @@ 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.transferrecordsgoodsdetails.TransferRecordsGoodsDetailsVo;
|
||||
import com.yxt.yythmall.api.vegecallerreservedetails.VegeCellarReserveDetails;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.OrderGoodsVo;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrder;
|
||||
@@ -43,7 +45,8 @@ import java.util.List;
|
||||
*/
|
||||
@Service
|
||||
public class TransferRecordsService extends MybatisBaseService<TransferRecordsMapper, TransferRecords> {
|
||||
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
TransferRecordsGoodsDetailsService transferRecordsGoodsDetailsService;
|
||||
@Autowired
|
||||
@@ -76,14 +79,25 @@ public class TransferRecordsService extends MybatisBaseService<TransferRecordsMa
|
||||
if(null==transferRecords){
|
||||
return rb.setMsg("没有找到对应的转赠单号");
|
||||
}
|
||||
TransferRecordsVo transferRecordsVo=new TransferRecordsVo();
|
||||
BeanUtil.copyProperties(transferRecords,transferRecordsVo);
|
||||
List<TransferRecordsGoodsDetails> list=transferRecordsGoodsDetailsService.list(new QueryWrapper<TransferRecordsGoodsDetails>().eq("orderSid",transferRecords.getSid()));
|
||||
List<TransferRecordsGoodsDetailsVo> vos=new ArrayList<>();
|
||||
for (TransferRecordsGoodsDetails transferRecordsGoodsDetails : list) {
|
||||
TransferRecordsGoodsDetailsVo vo=new TransferRecordsGoodsDetailsVo();
|
||||
LpkGoods k=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",transferRecordsGoodsDetails.getGoodsSid()));
|
||||
transferRecordsGoodsDetails.setGoodsName(k.getName());
|
||||
transferRecordsGoodsDetails.setRemarks(DoubleUtils.removeZeros(String.valueOf(transferRecordsGoodsDetails.getGoodsNumber()))+"份");
|
||||
// transferRecordsGoodsDetails.setRemarks(DoubleUtils.removeZeros(String.valueOf(transferRecordsGoodsDetails.getGoodsNumber()))+"份");
|
||||
BeanUtil.copyProperties(transferRecordsGoodsDetails,vo);
|
||||
vo.setGoodsContent(k.getContent());
|
||||
vo.setGoodsFs("共"+DoubleUtils.removeZeros(String.valueOf(transferRecordsGoodsDetails.getGoodsNumber()))+"份");
|
||||
vo.setGoodsJs("合计"+DoubleUtils.removeZeros(String.valueOf(transferRecordsGoodsDetails.getGoodsNumber()*Double.valueOf(k.getWeight())))+"斤");
|
||||
vo.setPrice(Double.valueOf(k.getPrice())*Double.valueOf(k.getWeight())+"元/斤");
|
||||
vo.setGoodsPicUrl(fileUploadComponent.getUrlPrefix()+k.getPicUrl());
|
||||
vos.add(vo);
|
||||
}
|
||||
|
||||
return rb.success().setData(list);
|
||||
transferRecordsVo.setList(vos);
|
||||
return rb.success().setData(transferRecordsVo);
|
||||
}
|
||||
|
||||
public ResultBean transferRecordsList(PagerQuery<TransferRecordsQuery> pq) {
|
||||
|
||||
Reference in New Issue
Block a user