3/14
This commit is contained in:
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
|
||||
@Api(tags = "企业认证")
|
||||
@Api(tags = "开票审核记录")
|
||||
@RestController
|
||||
@RequestMapping("invoiceapprovalrecords")
|
||||
public class InvoiceApprovalRecordsRest {
|
||||
|
||||
@@ -65,4 +65,9 @@ public class OrdOrderRest {
|
||||
public ResultBean getPreOrder(@RequestBody OrdOrderQuery query) {
|
||||
return ordOrderService.getPreOrder(query);
|
||||
}
|
||||
@PostMapping("/refundBusiness")
|
||||
@ApiOperation(value = "退款业务")
|
||||
public ResultBean refundBusiness(@RequestBody String mainSid) {
|
||||
return ordOrderService.refundBusiness(mainSid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user