This commit is contained in:
2024-01-08 11:50:36 +08:00
parent c3c68ee97e
commit 059483aefe
7 changed files with 25 additions and 3 deletions

View File

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

View File

@@ -28,4 +28,6 @@ public class LpkGoodsDetailsVo implements Vo {
private String appContent;
private String specificationUnit;
private double number;
private String content;
private String weight;
}

View File

@@ -24,5 +24,6 @@ public class LpkGoodsDto implements Dto {
private String specificationUnit;
private double number;
private String content;
private String weight;
private String useTo;
}

View File

@@ -231,9 +231,9 @@ public class AppletGiftBagService extends MybatisBaseService<AppletGiftBagMapper
appletGiftBagVo.setName(s.getName());
return rb.success().setData(appletGiftBagVo);
}
public String aa(double a){
public static String aa(double a){
BigDecimal d=new BigDecimal(a);
double c= d.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
String c= d.setScale(2,BigDecimal.ROUND_HALF_UP).toString();
return String.valueOf(c);
}

View File

@@ -74,7 +74,8 @@
content as remark,
weight
from lpk_goods
where isAppletGrounding=1
where isAppletGrounding=1 and useTo=1
order by createTime desc
</select>
</mapper>

View File

@@ -68,6 +68,11 @@ public class LpkGoodsRest {
public ResultBean<LpkGoodsDetailsVo> appletGrounding(@PathVariable("sid") String sid,@PathVariable("state") String state) {
return lpkGoodsService.appletGrounding(sid,state);
}
@ApiOperation("小程序商品是否自选")
@GetMapping("/appletUseTo/{sid}/{state}")
public ResultBean<LpkGoodsDetailsVo> appletUseTo(@PathVariable("sid") String sid,@PathVariable("state") String state) {
return lpkGoodsService.appletUseTo(sid,state);
}
@ApiOperation("商品信息")
@GetMapping("/getAllGiftBag")
public ResultBean getAllGiftBag() {

View File

@@ -152,6 +152,18 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
}
return rb.success();
}
public ResultBean appletUseTo(String sid,String state) {
ResultBean rb = ResultBean.fireFail();
LpkGoods lpkGoods = fetchBySid(sid);
if (null != lpkGoods) {
lpkGoods.setUseTo(state);
baseMapper.updateById(lpkGoods);
}else{
return rb;
}
return rb.success();
}
public ResultBean<List<GiftBagGoods>> getAllGoodsApplet() {
ResultBean rb = ResultBean.fireFail();
List<GiftBagGoods> list=baseMapper.getAllGoodsApplet();