This commit is contained in:
2024-01-08 10:36:55 +08:00
parent 39aa737a87
commit 506204f99c
10 changed files with 21 additions and 8 deletions

View File

@@ -31,4 +31,5 @@ public class AppletGiftBag {
private String iconUrl;
private String isGrounding;
private String isRecommend;
private String preferentialPrice;
}

View File

@@ -25,6 +25,7 @@ public class AppletGiftBagDto implements Dto {
private String iconUrl;
private String isGrounding;
private String isRecommend;
private String preferentialPrice;
//商品sid
private List<GiftBagGoods> goods = new ArrayList<>();
}

View File

@@ -33,5 +33,6 @@ public class LpkGoods {
private String specificationUnit;
private String number;
private String isAppletGrounding;
private String content;
private String useTo;
}

View File

@@ -23,4 +23,6 @@ public class LpkGoodsDto implements Dto {
private String appContent;
private String specificationUnit;
private double number;
private String content;
private String useTo;
}

View File

@@ -33,5 +33,7 @@ public class LpkGoodsVo implements Vo {
private String specificationUnit;
private double number;
private String isAppletGrounding; //1 上架 2 下架
private String content;
private String useTo;
}

View File

@@ -23,7 +23,7 @@
isEnable,
isGrounding,
isRecommend
from lpk_giftbag
from applet_giftbag
<where>
${ew.sqlSegment}
</where>
@@ -33,5 +33,6 @@
*
from applet_giftbag
where isGrounding=1
order by isRecommend desc,createTime desc
</select>
</mapper>

View File

@@ -92,7 +92,7 @@ public class AppletGiftBagService extends MybatisBaseService<AppletGiftBagMapper
AppletGiftBagGoods.setGoodsSid(goods.getGoodsSid());
AppletGiftBagGoods.setGiftbagSid(AppletGiftBag.getSid());
AppletGiftBagGoods.setGoodsNumber(goods.getGoodsNumber());
AppletGiftBagGoods.setPrice(0);
AppletGiftBagGoods.setPrice(Double.valueOf(goods.getPrice()));
appletGiftBagGoodsService.insert(AppletGiftBagGoods);
}
}
@@ -115,6 +115,7 @@ public class AppletGiftBagService extends MybatisBaseService<AppletGiftBagMapper
AppletGiftBagGoods.setGoodsSid(goods.getGoodsSid());
AppletGiftBagGoods.setGiftbagSid(AppletGiftBag.getSid());
AppletGiftBagGoods.setGoodsNumber(goods.getGoodsNumber());
AppletGiftBagGoods.setPrice(Double.valueOf(goods.getPrice()));
appletGiftBagGoodsService.insert(AppletGiftBagGoods);
}
}
@@ -153,6 +154,9 @@ public class AppletGiftBagService extends MybatisBaseService<AppletGiftBagMapper
if (StringUtils.isNotBlank(lpkGoods.getName())) {
bagGoods.setName(lpkGoods.getName());
}
if (StringUtils.isNotBlank(lpkGoods.getPicUrl())) {
bagGoods.setIconUrl(lpkGoods.getPicUrl());
}
if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
bagGoods.setUnitName(lpkGoods.getUnitName());
}
@@ -218,7 +222,7 @@ public class AppletGiftBagService extends MybatisBaseService<AppletGiftBagMapper
i=i+Double.valueOf(goods.getPrice())*Double.valueOf(goods.getGoodsNumber());
goods.setIconUrl(fileUploadComponent.getUrlPrefix() +goods.getIconUrl());
goods.setTotalValue(String.valueOf(decimalFormat.format(Double.valueOf(goods.getGoodsNumber())*Double.valueOf(goods.getPrice()))));
goods.setJPrice(String.valueOf(decimalFormat.format(Double.valueOf(goods.getPrice())/Double.valueOf(goods.getWeight()))));
goods.setJPrice(String.valueOf(decimalFormat.format(Double.valueOf(goods.getPrice())*Double.valueOf(goods.getWeight()))));
}
appletGiftBagVo.setPrice(decimalFormat.format(i));
appletGiftBagVo.setGoods(goodsList);

View File

@@ -11,7 +11,7 @@
</delete>
<select id="getRecordsByBagSid" resultType="com.yxt.yyth.api.appletgiftbaggoods.AppletGiftBagGoods">
select *
from lpk_giftbag_goods
from applet_giftbag_goods
WHERE giftbagSid = #{sid}
</select>
<insert id="saveBagGoods" parameterType="java.util.List">

View File

@@ -17,7 +17,8 @@
picUrl,
specificationUnit,
number,
isAppletGrounding
isAppletGrounding,
useTo
from lpk_goods
<where>
${ew.sqlSegment}

View File

@@ -159,7 +159,7 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
list.forEach(s->{
s.setIconUrl(fileUploadComponent.getUrlPrefix() +s.getIconUrl());
s.setTotalValue(decimalFormat.format(0));
s.setJPrice(String.valueOf(decimalFormat.format(Double.valueOf(s.getPrice())/Double.valueOf(s.getWeight()))));
s.setJPrice(String.valueOf(decimalFormat.format(Double.valueOf(s.getPrice())*Double.valueOf(s.getWeight()))));
});
return rb.success().setData(list);
}