Commit 364edcbe authored by 332784038@qq.com's avatar 332784038@qq.com

Merge branch 'master-special' into dev

parents 9f7337c6 e18e4476
...@@ -20,6 +20,7 @@ import cn.iocoder.yudao.module.order.enums.ErrorCodeConstants; ...@@ -20,6 +20,7 @@ import cn.iocoder.yudao.module.order.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.order.enums.OrderApprovalTypeEnum; import cn.iocoder.yudao.module.order.enums.OrderApprovalTypeEnum;
import cn.iocoder.yudao.module.order.vo.approval.*; import cn.iocoder.yudao.module.order.vo.approval.*;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -181,20 +182,14 @@ public class OrderApprovalServiceImpl extends AbstractService<OrderApprovalMappe ...@@ -181,20 +182,14 @@ public class OrderApprovalServiceImpl extends AbstractService<OrderApprovalMappe
OrderApprovalDO orderApprovalDO = approvalMapper.selectProcessingApproval(orderId, Arrays.asList(OrderApprovalTypeEnum.DISCOUNT_APPLY_BATCH.getValue(), OrderApprovalTypeEnum.ADMIN_DISCOUNT_BATCH.getValue())); OrderApprovalDO orderApprovalDO = approvalMapper.selectProcessingApproval(orderId, Arrays.asList(OrderApprovalTypeEnum.DISCOUNT_APPLY_BATCH.getValue(), OrderApprovalTypeEnum.ADMIN_DISCOUNT_BATCH.getValue()));
if (orderApprovalDO != null && StringUtils.isNotEmpty(orderApprovalDO.getDetails())) { if (orderApprovalDO != null && StringUtils.isNotEmpty(orderApprovalDO.getDetails())) {
List<OrderSpecialBatchApplyVO> orderSpecialBatchApplyVOList = JSON.parseArray(orderApprovalDO.getDetails(), OrderSpecialBatchApplyVO.class); OrderSpecialBatchApplyVO orderSpecialBatchApplyVO = JSONObject.parseObject(orderApprovalDO.getDetails(), OrderSpecialBatchApplyVO.class);
if (CollectionUtil.isNotEmpty(orderSpecialBatchApplyVOList)) {
for (OrderSpecialBatchApplyVO orderSpecialBatchApplyVO : orderSpecialBatchApplyVOList) {
List<OrderSpecialBatchApplyOrderItemDetailVO> batchApplyOrderItemDetailVOList = orderSpecialBatchApplyVO.getBatchApplyOrderItemDetailVOList(); List<OrderSpecialBatchApplyOrderItemDetailVO> batchApplyOrderItemDetailVOList = orderSpecialBatchApplyVO.getBatchApplyOrderItemDetailVOList();
if (CollectionUtil.isNotEmpty(batchApplyOrderItemDetailVOList)) { if (CollectionUtil.isNotEmpty(batchApplyOrderItemDetailVOList)) {
if (batchApplyOrderItemDetailVOList.stream().anyMatch(t -> Objects.equals(t.getOrderItemId(), orderItemId))) { if (batchApplyOrderItemDetailVOList.stream().anyMatch(t -> Objects.equals(t.getOrderItemId(), orderItemId))) {
return orderApprovalDO; return orderApprovalDO;
} }
} }
}
} }
}
return null; return null;
} }
} }
...@@ -423,6 +423,7 @@ public class OrderController { ...@@ -423,6 +423,7 @@ public class OrderController {
@PutMapping("/special/apply") @PutMapping("/special/apply")
@ApiOperation("特价申请") @ApiOperation("特价申请")
@Idempotent(timeout = 10)
// @PreAuthorize("@ss.hasPermission('ecw:order:update')") // @PreAuthorize("@ss.hasPermission('ecw:order:update')")
public CommonResult<Boolean> specialApplyOrder(@Valid @RequestBody OrderSpecialApplyVO specialApplyVO) { public CommonResult<Boolean> specialApplyOrder(@Valid @RequestBody OrderSpecialApplyVO specialApplyVO) {
orderService.specialApplyOrder(specialApplyVO); orderService.specialApplyOrder(specialApplyVO);
...@@ -431,6 +432,7 @@ public class OrderController { ...@@ -431,6 +432,7 @@ public class OrderController {
@PutMapping("/special/apply/batch") @PutMapping("/special/apply/batch")
@ApiOperation("特价申请-批量特价") @ApiOperation("特价申请-批量特价")
@Idempotent(timeout = 10)
// @PreAuthorize("@ss.hasPermission('ecw:order:update')") // @PreAuthorize("@ss.hasPermission('ecw:order:update')")
public CommonResult<Boolean> specialBatchApplyOrder(@Valid @RequestBody OrderSpecialBatchApplyVO orderSpecialBatchApplyVO) { public CommonResult<Boolean> specialBatchApplyOrder(@Valid @RequestBody OrderSpecialBatchApplyVO orderSpecialBatchApplyVO) {
orderService.specialBatchApplyOrder(orderSpecialBatchApplyVO); orderService.specialBatchApplyOrder(orderSpecialBatchApplyVO);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment