退货单

This commit is contained in:
liux 2025-07-11 11:21:46 +08:00
parent 59be7d17fa
commit ba3489dc8c
2 changed files with 67 additions and 49 deletions

View File

@ -6,11 +6,13 @@ import javax.validation.Valid;
import com.bonus.canteen.core.ims.dto.*; import com.bonus.canteen.core.ims.dto.*;
import com.bonus.canteen.core.ims.vo.*; import com.bonus.canteen.core.ims.vo.*;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.log.enums.OperaType; import com.bonus.common.log.enums.OperaType;
//import com.bonus.canteen.core.ims.common.annotation.PreventRepeatSubmit; //import com.bonus.canteen.core.ims.common.annotation.PreventRepeatSubmit;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
@ -56,6 +58,7 @@ public class RefundGoodsController extends BaseController {
@PostMapping({"/save"}) @PostMapping({"/save"})
@ApiOperation("新增退货单") @ApiOperation("新增退货单")
@Transactional
public AjaxResult addRefundGoods(@RequestBody RefundGoodsAddDTO content) { public AjaxResult addRefundGoods(@RequestBody RefundGoodsAddDTO content) {
RefundGoodsAddVO drpRefundGoodsAddVO = refundGoodsService.addRefundGoodsOrder(content); RefundGoodsAddVO drpRefundGoodsAddVO = refundGoodsService.addRefundGoodsOrder(content);
return success(drpRefundGoodsAddVO); return success(drpRefundGoodsAddVO);
@ -63,9 +66,14 @@ public class RefundGoodsController extends BaseController {
@PostMapping({"/commit"}) @PostMapping({"/commit"})
@ApiOperation("新增退货单") @ApiOperation("新增退货单")
@Transactional
public AjaxResult commitRefundGoods(@RequestBody RefundGoodsCommitDTO content) { public AjaxResult commitRefundGoods(@RequestBody RefundGoodsCommitDTO content) {
try{
RefundGoodsAddVO drpRefundGoodsAddVO = refundGoodsService.commitRefundGoodsOrder(content); RefundGoodsAddVO drpRefundGoodsAddVO = refundGoodsService.commitRefundGoodsOrder(content);
return success(drpRefundGoodsAddVO); return success(drpRefundGoodsAddVO);
}catch (Exception e) {
throw new ServiceException(e.getMessage());
}
} }

View File

@ -85,6 +85,8 @@ public class RefundGoodsServiceImpl implements IRefundGoodsService {
@Override @Override
public RefundGoodsAddVO addRefundGoodsOrder(RefundGoodsAddDTO content) { public RefundGoodsAddVO addRefundGoodsOrder(RefundGoodsAddDTO content) {
try{
RefundGoods drpRefundGoods = new RefundGoods(); RefundGoods drpRefundGoods = new RefundGoods();
BeanUtil.copyProperties(content, drpRefundGoods, new String[0]); BeanUtil.copyProperties(content, drpRefundGoods, new String[0]);
Long refundGoodsId = content.getRefundGoodsId(); Long refundGoodsId = content.getRefundGoodsId();
@ -119,11 +121,15 @@ public class RefundGoodsServiceImpl implements IRefundGoodsService {
this.RefundGoodsDetailMapper.insertRefundGoodsDetail(drpRefundGoodsDetail); this.RefundGoodsDetailMapper.insertRefundGoodsDetail(drpRefundGoodsDetail);
} }
return (new RefundGoodsAddVO()).setRefundGoodsId(drpRefundGoods.getRefundGoodsId()); return (new RefundGoodsAddVO()).setRefundGoodsId(drpRefundGoods.getRefundGoodsId());
}catch (Exception e) {
throw new ServiceException(e.getMessage());
}
} }
@Override @Override
public RefundGoodsAddVO commitRefundGoodsOrder(RefundGoodsCommitDTO content) { public RefundGoodsAddVO commitRefundGoodsOrder(RefundGoodsCommitDTO content) {
try{
RefundGoods drpRefundGoods = new RefundGoods(); RefundGoods drpRefundGoods = new RefundGoods();
BeanUtil.copyProperties(content, drpRefundGoods, new String[0]); BeanUtil.copyProperties(content, drpRefundGoods, new String[0]);
Long refundGoodsId = content.getRefundGoodsId(); Long refundGoodsId = content.getRefundGoodsId();
@ -171,7 +177,11 @@ public class RefundGoodsServiceImpl implements IRefundGoodsService {
} }
imsOutInventoryAdd.setImsOutInventoryDetailAddList(imsOutInventoryDetailAddList); imsOutInventoryAdd.setImsOutInventoryDetailAddList(imsOutInventoryDetailAddList);
drpOutInventoryService.insertImsOutInventory( imsOutInventoryAdd); drpOutInventoryService.insertImsOutInventory( imsOutInventoryAdd);
return (new RefundGoodsAddVO()).setRefundGoodsId(drpRefundGoods.getRefundGoodsId()); return (new RefundGoodsAddVO()).setRefundGoodsId(drpRefundGoods.getRefundGoodsId());
}catch (Exception e) {
throw new ServiceException(e.getMessage());
}
} }
@Override @Override