|
|
@ -24,11 +24,13 @@ import com.yxt.yythmall.api.ordorderdetails.OrdOrderDetailVo; |
|
|
|
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.api.vegetablecellar.VegetableCellar; |
|
|
|
import com.yxt.yythmall.biz.appletgiftbag.AppletGiftBagService; |
|
|
|
import com.yxt.yythmall.biz.lpkcustomer.LpkCustomerService; |
|
|
|
import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService; |
|
|
|
import com.yxt.yythmall.biz.ordorderdetails.OrdOrderDetailService; |
|
|
|
import com.yxt.yythmall.biz.shoppingcart.ShoppingCartService; |
|
|
|
import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
@ -65,6 +67,8 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder |
|
|
|
OrdOrderDetailService ordOrderDetailService; |
|
|
|
@Autowired |
|
|
|
private FileUploadComponent fileUploadComponent; |
|
|
|
@Autowired |
|
|
|
VegetableCellarService vegetableCellarService; |
|
|
|
@Value("${weixin.miniprogram.appid:wx4724e3a3c27f36b5}") |
|
|
|
String appId; |
|
|
|
@Value("${weixin.miniprogram.secret:971fd3b8aa7b08ce3e8a5f3e502b1a8d}") |
|
|
@ -613,7 +617,21 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder |
|
|
|
baseMapper.updateById(order); |
|
|
|
return rb.success().setData(order); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean refundBusiness(String mainSid) { |
|
|
|
ResultBean rb = new ResultBean().fail(); |
|
|
|
OrdOrder order=baseMapper.selectOne(new QueryWrapper<OrdOrder>().eq("mainSid",mainSid)); |
|
|
|
List<OrdOrderDetail> detailList=ordOrderDetailService.list(new QueryWrapper<OrdOrderDetail>().eq("orderSid",order.getSid())); |
|
|
|
for(OrdOrderDetail detail:detailList){ |
|
|
|
LpkGoods cl=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",detail.getGoodsSid())); |
|
|
|
VegetableCellar vegetableCellar=vegetableCellarService.getOne(new QueryWrapper<VegetableCellar>().eq("customerSid",order.getUserSid()) |
|
|
|
.eq("goodsSid",detail.getGoodsSid()).eq("affiliation",cl.getBrandId())); |
|
|
|
if(vegetableCellar.getGoodsNumber().equals(String.valueOf(detail.getPartNumber()))){ |
|
|
|
vegetableCellar.setGoodsNumber(String.valueOf(Double.valueOf(vegetableCellar.getGoodsNumber())-Double.valueOf(detail.getPartNumber()))); |
|
|
|
vegetableCellarService.updateById(vegetableCellar); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 去除多余.0 |
|
|
|