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;
import cn.iocoder.yudao.module.order.enums.OrderApprovalTypeEnum;
import cn.iocoder.yudao.module.order.vo.approval.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -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()));
if (orderApprovalDO != null && StringUtils.isNotEmpty(orderApprovalDO.getDetails())) {
List<OrderSpecialBatchApplyVO> orderSpecialBatchApplyVOList = JSON.parseArray(orderApprovalDO.getDetails(), OrderSpecialBatchApplyVO.class);
if (CollectionUtil.isNotEmpty(orderSpecialBatchApplyVOList)) {
for (OrderSpecialBatchApplyVO orderSpecialBatchApplyVO : orderSpecialBatchApplyVOList) {
OrderSpecialBatchApplyVO orderSpecialBatchApplyVO = JSONObject.parseObject(orderApprovalDO.getDetails(), OrderSpecialBatchApplyVO.class);
List<OrderSpecialBatchApplyOrderItemDetailVO> batchApplyOrderItemDetailVOList = orderSpecialBatchApplyVO.getBatchApplyOrderItemDetailVOList();
if (CollectionUtil.isNotEmpty(batchApplyOrderItemDetailVOList)) {
if (batchApplyOrderItemDetailVOList.stream().anyMatch(t -> Objects.equals(t.getOrderItemId(), orderItemId))) {
return orderApprovalDO;
}
}
}
}
}
return null;
}
}
......@@ -423,6 +423,7 @@ public class OrderController {
@PutMapping("/special/apply")
@ApiOperation("特价申请")
@Idempotent(timeout = 10)
// @PreAuthorize("@ss.hasPermission('ecw:order:update')")
public CommonResult<Boolean> specialApplyOrder(@Valid @RequestBody OrderSpecialApplyVO specialApplyVO) {
orderService.specialApplyOrder(specialApplyVO);
......@@ -431,6 +432,7 @@ public class OrderController {
@PutMapping("/special/apply/batch")
@ApiOperation("特价申请-批量特价")
@Idempotent(timeout = 10)
// @PreAuthorize("@ss.hasPermission('ecw:order:update')")
public CommonResult<Boolean> specialBatchApplyOrder(@Valid @RequestBody OrderSpecialBatchApplyVO 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