小程序礼包
This commit is contained in:
@@ -22,6 +22,7 @@ public class AppletGiftBagInitVo implements Vo {
|
|||||||
private String price;
|
private String price;
|
||||||
private String iconUrl;
|
private String iconUrl;
|
||||||
private String isRecommend;
|
private String isRecommend;
|
||||||
|
private String preferentialPrice;
|
||||||
//商品sid
|
//商品sid
|
||||||
private List<GiftBagGoods> goods = new ArrayList<>();
|
private List<GiftBagGoods> goods = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.yxt.yyth.api.appletgiftbag;
|
package com.yxt.yyth.api.appletgiftbag;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import com.yxt.common.base.utils.StringUtils;
|
import com.yxt.common.base.utils.StringUtils;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -32,4 +33,44 @@ public class GiftBagGoods {
|
|||||||
DecimalFormat decimalFormat = new DecimalFormat("#0.00");
|
DecimalFormat decimalFormat = new DecimalFormat("#0.00");
|
||||||
return decimalFormat.format(Double.valueOf(jPrice));
|
return decimalFormat.format(Double.valueOf(jPrice));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMefenPrice() {
|
||||||
|
double dj = 0.0;
|
||||||
|
try {
|
||||||
|
dj = Double.parseDouble(price);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
int js = 1;
|
||||||
|
try {
|
||||||
|
js = Integer.parseInt(weight);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
double mfjg = dj * js;
|
||||||
|
return NumberUtil.decimalFormatMoney(mfjg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubtotal() {
|
||||||
|
double dj = 0.0;
|
||||||
|
try {
|
||||||
|
dj = Double.parseDouble(price);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
int js = 1;
|
||||||
|
try {
|
||||||
|
js = Integer.parseInt(weight);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
int fs = 1;
|
||||||
|
try {
|
||||||
|
fs = Integer.parseInt(goodsNumber);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
double mfjg = dj * js * fs;
|
||||||
|
return NumberUtil.decimalFormatMoney(mfjg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,5 +35,6 @@ public class LpkGoodsVo implements Vo {
|
|||||||
private String isAppletGrounding; //1 上架 2 下架
|
private String isAppletGrounding; //1 上架 2 下架
|
||||||
private String content;
|
private String content;
|
||||||
private String useTo;
|
private String useTo;
|
||||||
|
private String weight;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,6 +163,8 @@ public class AppletGiftBagService extends MybatisBaseService<AppletGiftBagMapper
|
|||||||
if (StringUtils.isNotBlank(lpkGoods.getPrice())) {
|
if (StringUtils.isNotBlank(lpkGoods.getPrice())) {
|
||||||
bagGoods.setPrice(lpkGoods.getPrice());
|
bagGoods.setPrice(lpkGoods.getPrice());
|
||||||
}
|
}
|
||||||
|
bagGoods.setWeight(lpkGoods.getWeight());
|
||||||
|
bagGoods.setSpecificationUnit(lpkGoods.getSpecificationUnit());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
goods.add(bagGoods);
|
goods.add(bagGoods);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<delete id="deleteGoodsByBagSid">
|
<delete id="deleteGoodsByBagSid">
|
||||||
DELETE
|
DELETE
|
||||||
FROM lpk_giftbag_goods
|
FROM applet_giftbag_goods
|
||||||
WHERE giftbagSid = #{sid}
|
WHERE giftbagSid = #{sid}
|
||||||
</delete>
|
</delete>
|
||||||
<select id="getRecordsByBagSid" resultType="com.yxt.yyth.api.appletgiftbaggoods.AppletGiftBagGoods">
|
<select id="getRecordsByBagSid" resultType="com.yxt.yyth.api.appletgiftbaggoods.AppletGiftBagGoods">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
WHERE giftbagSid = #{sid}
|
WHERE giftbagSid = #{sid}
|
||||||
</select>
|
</select>
|
||||||
<insert id="saveBagGoods" parameterType="java.util.List">
|
<insert id="saveBagGoods" parameterType="java.util.List">
|
||||||
insert into lpk_giftbag_goods(sid,createTime,giftbagSid,goodsSid,goodsNumber)
|
insert into applet_giftbag_goods(sid,createTime,giftbagSid,goodsSid,goodsNumber)
|
||||||
values
|
values
|
||||||
<foreach collection="bagGoods" item="item" index="index" separator=",">
|
<foreach collection="bagGoods" item="item" index="index" separator=",">
|
||||||
(#{item.sid},#{item.createTime},#{item.giftbagSid},#{item.goodsSid},#{item.goodsNumber})
|
(#{item.sid},#{item.createTime},#{item.giftbagSid},#{item.goodsSid},#{item.goodsNumber})
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
date_format(createTime, '%Y-%m-%d') as createTime,
|
date_format(createTime, '%Y-%m-%d') as createTime,
|
||||||
code,
|
code,
|
||||||
barcode,
|
barcode,
|
||||||
|
`weight`,
|
||||||
`name`,
|
`name`,
|
||||||
unitName,
|
unitName,
|
||||||
typeCode,
|
typeCode,
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
date_format(createTime, '%Y-%m-%d') as createTime,
|
date_format(createTime, '%Y-%m-%d') as createTime,
|
||||||
code,
|
code,
|
||||||
barcode,
|
barcode,
|
||||||
|
`weight`,
|
||||||
`name`,
|
`name`,
|
||||||
unitName,
|
unitName,
|
||||||
typeCode,
|
typeCode,
|
||||||
@@ -44,6 +46,7 @@
|
|||||||
date_format(createTime, '%Y-%m-%d') as createTime,
|
date_format(createTime, '%Y-%m-%d') as createTime,
|
||||||
code,
|
code,
|
||||||
barcode,
|
barcode,
|
||||||
|
`weight`,
|
||||||
`name`,
|
`name`,
|
||||||
unitName,
|
unitName,
|
||||||
typeCode,
|
typeCode,
|
||||||
|
|||||||
Reference in New Issue
Block a user