Browse Source

fixed 售后订单后台相关操作问题

fushengqian 1 year ago
parent
commit
a975d3ed28

+ 22 - 9
fuint-application/src/main/java/com/fuint/common/service/impl/RefundServiceImpl.java

@@ -330,7 +330,7 @@ public class RefundServiceImpl extends ServiceImpl<MtRefundMapper, MtRefund> imp
     }
     }
 
 
     /**
     /**
-     * 修改订单
+     * 修改售后订单
      *
      *
      * @param  refundDto
      * @param  refundDto
      * @throws BusinessCheckException
      * @throws BusinessCheckException
@@ -340,23 +340,34 @@ public class RefundServiceImpl extends ServiceImpl<MtRefundMapper, MtRefund> imp
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     @OperationServiceLog(description = "更新售后订单")
     @OperationServiceLog(description = "更新售后订单")
     public MtRefund updateRefund(RefundDto refundDto) throws BusinessCheckException {
     public MtRefund updateRefund(RefundDto refundDto) throws BusinessCheckException {
-        MtRefund refund = mtRefundMapper.selectById(refundDto.getId());
-        if (refund == null) {
+        MtRefund mtRefund = mtRefundMapper.selectById(refundDto.getId());
+        if (mtRefund == null) {
             throw new BusinessCheckException("该售后订单状态异常");
             throw new BusinessCheckException("该售后订单状态异常");
         }
         }
 
 
-        refund.setId(refundDto.getId());
-        refund.setUpdateTime(new Date());
+        // 已同意的不能再设置为已拒绝
+        if (mtRefund.getStatus().equals(RefundStatusEnum.APPROVED.getKey()) && refundDto.getStatus().equals(RefundStatusEnum.REJECT.getKey())) {
+            throw new BusinessCheckException("该售后订单已同意,不能再改成已拒绝");
+        }
+
+        mtRefund.setId(refundDto.getId());
+        mtRefund.setUpdateTime(new Date());
 
 
         if (null != refundDto.getOperator()) {
         if (null != refundDto.getOperator()) {
-            refund.setOperator(refundDto.getOperator());
+            mtRefund.setOperator(refundDto.getOperator());
         }
         }
         if (null != refundDto.getStatus()) {
         if (null != refundDto.getStatus()) {
-            refund.setStatus(refundDto.getStatus());
+            mtRefund.setStatus(refundDto.getStatus());
+        }
+        if (null != refundDto.getRemark()) {
+            mtRefund.setRemark(refundDto.getRemark());
+        }
+        if (null != refundDto.getRejectReason()) {
+            mtRefund.setRejectReason(refundDto.getRejectReason());
         }
         }
 
 
-        mtRefundMapper.updateById(refund);
-        return refund;
+        mtRefundMapper.updateById(mtRefund);
+        return mtRefund;
     }
     }
 
 
     /**
     /**
@@ -368,6 +379,7 @@ public class RefundServiceImpl extends ServiceImpl<MtRefundMapper, MtRefund> imp
      * */
      * */
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
+    @OperationServiceLog(description = "同意售后订单")
     public MtRefund agreeRefund(RefundDto refundDto) throws BusinessCheckException {
     public MtRefund agreeRefund(RefundDto refundDto) throws BusinessCheckException {
         MtRefund refund = mtRefundMapper.selectById(refundDto.getId());
         MtRefund refund = mtRefundMapper.selectById(refundDto.getId());
         if (null == refund) {
         if (null == refund) {
@@ -529,6 +541,7 @@ public class RefundServiceImpl extends ServiceImpl<MtRefundMapper, MtRefund> imp
      * */
      * */
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
+    @OperationServiceLog(description = "发起退款")
     public Boolean doRefund(Integer orderId, String refundAmount, String remark, AccountInfo accountInfo) throws BusinessCheckException {
     public Boolean doRefund(Integer orderId, String refundAmount, String remark, AccountInfo accountInfo) throws BusinessCheckException {
         UserOrderDto orderInfo = orderService.getOrderById(orderId);
         UserOrderDto orderInfo = orderService.getOrderById(orderId);
         if (orderInfo == null) {
         if (orderInfo == null) {

+ 2 - 1
fuint-application/src/main/java/com/fuint/common/service/impl/StockServiceImpl.java

@@ -98,6 +98,7 @@ public class StockServiceImpl extends ServiceImpl<MtStockMapper, MtStock> implem
      */
      */
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
+    @OperationServiceLog(description = "新增库存管理记录")
     public ResponseObject addStock(MtStock stockParam, List<LinkedHashMap> goodsList) throws BusinessCheckException {
     public ResponseObject addStock(MtStock stockParam, List<LinkedHashMap> goodsList) throws BusinessCheckException {
         MtStock mtStock = new MtStock();
         MtStock mtStock = new MtStock();
         mtStock.setMerchantId(stockParam.getMerchantId());
         mtStock.setMerchantId(stockParam.getMerchantId());
@@ -175,7 +176,7 @@ public class StockServiceImpl extends ServiceImpl<MtStockMapper, MtStock> implem
      * @return
      * @return
      */
      */
     @Override
     @Override
-    @OperationServiceLog(description = "删除商品分类")
+    @OperationServiceLog(description = "删除库存管理记录")
     public void delete(Integer id, String operator) throws BusinessCheckException {
     public void delete(Integer id, String operator) throws BusinessCheckException {
         MtStock mtStock = mtStockMapper.selectById(id);
         MtStock mtStock = mtStockMapper.selectById(id);
         if (mtStock == null) {
         if (mtStock == null) {

+ 0 - 5
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendRefundController.java

@@ -66,7 +66,6 @@ public class BackendRefundController extends BaseController {
      * @param request HttpServletRequest对象
      * @param request HttpServletRequest对象
      * @return
      * @return
      */
      */
-    @ApiOperation(value = "退款列表查询")
     @RequestMapping(value = "/list", method = RequestMethod.GET)
     @RequestMapping(value = "/list", method = RequestMethod.GET)
     @CrossOrigin
     @CrossOrigin
     @PreAuthorize("@pms.hasPermission('refund:index')")
     @PreAuthorize("@pms.hasPermission('refund:index')")
@@ -166,7 +165,6 @@ public class BackendRefundController extends BaseController {
      * @param request HttpServletRequest对象
      * @param request HttpServletRequest对象
      * @return
      * @return
      * */
      * */
-    @ApiOperation(value = "查询退款详情")
     @RequestMapping(value = "/info/{refundId}", method = RequestMethod.GET)
     @RequestMapping(value = "/info/{refundId}", method = RequestMethod.GET)
     @CrossOrigin
     @CrossOrigin
     @PreAuthorize("@pms.hasPermission('refund:index')")
     @PreAuthorize("@pms.hasPermission('refund:index')")
@@ -192,9 +190,7 @@ public class BackendRefundController extends BaseController {
 
 
     /**
     /**
      * 保存售后订单
      * 保存售后订单
-     * @return
      */
      */
-    @ApiOperation(value = "保存售后订单")
     @RequestMapping(value = "save", method = RequestMethod.POST)
     @RequestMapping(value = "save", method = RequestMethod.POST)
     @CrossOrigin
     @CrossOrigin
     @PreAuthorize("@pms.hasPermission('refund:edit')")
     @PreAuthorize("@pms.hasPermission('refund:edit')")
@@ -232,7 +228,6 @@ public class BackendRefundController extends BaseController {
      * 发起退款
      * 发起退款
      * @return
      * @return
      */
      */
-    @ApiOperation(value = "发起退款")
     @RequestMapping(value = "doRefund", method = RequestMethod.POST)
     @RequestMapping(value = "doRefund", method = RequestMethod.POST)
     @CrossOrigin
     @CrossOrigin
     @PreAuthorize("@pms.hasPermission('refund:edit')")
     @PreAuthorize("@pms.hasPermission('refund:edit')")