buyer-api/src/main/java/cn/lili/controller/order/OrderComplaintBuyerController.java
@@ -5,6 +5,7 @@ import cn.lili.common.security.AuthUser; import cn.lili.common.security.OperationalJudgment; import cn.lili.common.security.context.UserContext; import cn.lili.common.utils.StringUtils; import cn.lili.common.vo.PageVO; import cn.lili.common.vo.ResultMessage; import cn.lili.modules.order.order.entity.dos.OrderComplaint; @@ -15,6 +16,7 @@ import cn.lili.modules.order.order.entity.vo.OrderComplaintVO; import cn.lili.modules.order.order.service.OrderComplaintCommunicationService; import cn.lili.modules.order.order.service.OrderComplaintService; import cn.lili.utils.COSUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -24,6 +26,8 @@ import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.util.ArrayList; import java.util.List; import java.util.Objects; /** @@ -49,12 +53,35 @@ @Autowired private OrderComplaintCommunicationService orderComplaintCommunicationService; @Autowired private COSUtil cosUtil; @ApiOperation(value = "通过id获取") @ApiImplicitParam(name = "id", value = "投诉单ID", required = true, paramType = "path") @GetMapping(value = "/{id}") public ResultMessage<OrderComplaintVO> get(@PathVariable String id) { OrderComplaintVO orderComplaintVO = OperationalJudgment.judgment(orderComplaintService.getOrderComplainById(id)); String images = orderComplaintVO.getImages(); String[] split = images.split(","); List<String> img = new ArrayList<>(); for (String s : split) { if (StringUtils.isNotBlank(s)&&!s.contains("http")) { img.add(cosUtil.getPreviewUrl(s)); }else if (StringUtils.isNotBlank(s)) { img.add(s); } } List<String> img2 = new ArrayList<>(); String[] orderComplaintImages = orderComplaintVO.getOrderComplaintImages(); for (String s : orderComplaintImages) { if (StringUtils.isNotBlank(s)&&!s.contains("http")) { img2.add(cosUtil.getPreviewUrl(s)); }else if (StringUtils.isNotBlank(s)) { img2.add(s); } } orderComplaintVO.setOrderComplaintImages(img2.toArray(new String[img.size()])); orderComplaintVO.setImages(String.join(",", img)); return ResultUtil.data(orderComplaintVO); } @@ -63,7 +90,14 @@ public ResultMessage<IPage<OrderComplaint>> get(OrderComplaintSearchParams searchParams, PageVO pageVO) { AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser()); searchParams.setMemberId(currentUser.getId()); return ResultUtil.data(orderComplaintService.getOrderComplainByPage(searchParams, pageVO)); IPage<OrderComplaint> orderComplainByPage = orderComplaintService.getOrderComplainByPage(searchParams, pageVO); for (OrderComplaint record : orderComplainByPage.getRecords()) { String goodsImage = record.getGoodsImage(); if (StringUtils.isNotBlank(goodsImage)&&!goodsImage.contains("http")) { record.setGoodsImage(cosUtil.getPreviewUrl(goodsImage)); } } return ResultUtil.data(orderComplainByPage); } framework/src/main/java/cn/lili/modules/lmk/domain/vo/StoreCouponClaimRecordVO.java
@@ -105,6 +105,11 @@ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date claimTime; @ApiModelProperty("订单状态") private String orderStatus; public static StoreCouponClaimRecordVO getVoByEntity(@NonNull StoreCouponClaimRecord entity, StoreCouponClaimRecordVO vo) { if(vo == null) { vo = new StoreCouponClaimRecordVO(); framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponClaimRecordServiceImpl.java
@@ -266,7 +266,7 @@ Row header = sheet.createRow(0); String[] headers = { "会员名称", "优惠券名称", "发布店铺", "面额/折扣", "获取方式", "会员优惠券状态", "优惠券类型", "获取方式", "会员优惠券状态", "优惠券类型","订单状态", "使用起始时间", "截止时间","领取时间" }; for (int i = 0; i < headers.length; i++) { @@ -355,9 +355,33 @@ } row.createCell(6).setCellValue(couponTypeDesc); //7.订单状态 String orderStatusType = dto.getOrderStatus(); System.out.println(orderStatusType); String orderStatusDesc; if ("UNPAID".equals(orderStatusType)) { orderStatusDesc = "未付款"; } else if ("PAID".equals(orderStatusType)) { orderStatusDesc = "已付款"; }else if ("UNDELIVERED".equals(orderStatusType)) { orderStatusDesc = "待发货"; }else if ("DELIVERED".equals(orderStatusType)) { orderStatusDesc = "已发货"; }else if ("COMPLETED".equals(orderStatusType)) { orderStatusDesc = "已完成"; }else if ("STAY_PICKED_UP".equals(orderStatusType)) { orderStatusDesc = "待自提"; }else if ("TAKE".equals(orderStatusType)) { orderStatusDesc = "待核验"; }else if ("CANCELLED".equals(orderStatusType)) { orderStatusDesc = "已关闭"; }else { orderStatusDesc ="未知"; } Cell orderStatus = row.createCell(7); orderStatus.setCellValue(orderStatusDesc); // 10. 使用起始时间(处理null,格式化时间) Cell startTimeCell = row.createCell(7); Cell startTimeCell = row.createCell(8); if (Objects.nonNull(dto.getStartTime())) { startTimeCell.setCellValue(DateUtil.formatDateTime(dto.getStartTime())); } else { @@ -365,13 +389,13 @@ } // 11. 截止时间(同上) Cell endTimeCell = row.createCell(8); Cell endTimeCell = row.createCell(9); if (Objects.nonNull(dto.getEndTime())) { endTimeCell.setCellValue(DateUtil.formatDateTime(dto.getEndTime())); } else { endTimeCell.setCellValue(""); } Cell claimTimeCell = row.createCell(9); Cell claimTimeCell = row.createCell(10); if (Objects.nonNull(dto.getClaimTime())) { endTimeCell.setCellValue(DateUtil.formatDateTime(dto.getClaimTime())); } else { framework/src/main/java/cn/lili/modules/order/order/entity/dto/StoreCouponClaimRecordDTO.java
@@ -98,4 +98,6 @@ @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date claimTime; private String orderStatus; } framework/src/main/resources/mapper/lmk/StoreCouponClaimRecordMapper.xml
@@ -53,6 +53,8 @@ <result column="user_id" property="userId"/> <result column="coupon_name" property="couponName"/> <result column="claimTime" property="claimTime"/> <result column="order_status" property="orderStatus"/> </resultMap> <select id="getPage" resultMap="BaseResultMapByManager"> @@ -75,14 +77,18 @@ lsccr.user_id, lsccr.coupon_name, lsccr.create_time AS claimTime, lsccr.coupon_id lsccr.coupon_id, lo.order_status FROM lmk_store_coupon_claim_record lsccr INNER JOIN li_member_coupon lmc ON lmc.id = lsccr.member_coupon_id LEFT JOIN li_order lo ON lo.use_platform_member_coupon_id = lmc.id AND lo.delete_flag = 0 WHERE lmc.delete_flag = 0 AND lsccr.delete_flag = 0 AND lmc.member_id = lsccr.user_id <!-- 1. 会员名称模糊查询(关联li_member_coupon表) --> <if test="query.memberName != null and query.memberName != ''"> AND lmc.member_name LIKE CONCAT('%', #{query.memberName}, '%') @@ -131,15 +137,19 @@ lsccr.user_id, lsccr.coupon_name, lsccr.create_time AS claimTime, lsccr.coupon_id lsccr.coupon_id, lo.order_status FROM lmk_store_coupon_claim_record lsccr INNER JOIN li_member_coupon lmc ON lmc.id = lsccr.member_coupon_id LEFT JOIN li_order lo ON lo.use_platform_member_coupon_id = lmc.id AND lo.delete_flag = 0 WHERE lmc.delete_flag = 0 AND lsccr.delete_flag = 0 AND lmc.member_id = lsccr.user_id <!-- 1. 会员名称模糊查询(关联li_member_coupon表) --> <if test="query.memberName != null and query.memberName != ''"> AND lmc.member_name LIKE CONCAT('%', #{query.memberName}, '%') seller-api/src/main/java/cn/lili/controller/order/OrderComplaintStoreController.java
@@ -5,6 +5,7 @@ import cn.lili.common.security.AuthUser; import cn.lili.common.security.OperationalJudgment; import cn.lili.common.security.context.UserContext; import cn.lili.common.utils.StringUtils; import cn.lili.common.vo.PageVO; import cn.lili.common.vo.ResultMessage; import cn.lili.modules.order.order.entity.dos.OrderComplaint; @@ -12,6 +13,7 @@ import cn.lili.modules.order.order.entity.vo.*; import cn.lili.modules.order.order.service.OrderComplaintCommunicationService; import cn.lili.modules.order.order.service.OrderComplaintService; import cn.lili.utils.COSUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -20,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.List; import java.util.Objects; /** @@ -45,11 +49,38 @@ @Autowired private OrderComplaintCommunicationService orderComplaintCommunicationService; @Autowired private COSUtil cosUtil; @ApiOperation(value = "通过id获取") @ApiImplicitParam(name = "id", value = "投诉单ID", required = true, paramType = "path") @GetMapping(value = "/{id}") public ResultMessage<OrderComplaintVO> get(@PathVariable String id) { return ResultUtil.data(OperationalJudgment.judgment(orderComplaintService.getOrderComplainById(id))); OrderComplaintVO orderComplainById = OperationalJudgment.judgment(orderComplaintService.getOrderComplainById(id)); String goodsImage = orderComplainById.getGoodsImage(); if (StringUtils.isNotBlank(goodsImage)&&!goodsImage.contains("http")) { orderComplainById.setGoodsImage(cosUtil.getPreviewUrl(goodsImage)); } String[] orderComplaintImages = orderComplainById.getOrderComplaintImages(); List<String> orderComplaintImagesList = new ArrayList<>(); for (String orderComplaintImage : orderComplaintImages) { if (StringUtils.isNotBlank(orderComplaintImage)&&!orderComplaintImage.contains("http")) { orderComplaintImagesList.add(cosUtil.getPreviewUrl(orderComplaintImage)); } } String images = orderComplainById.getImages(); String[] split = images.split(","); ArrayList<String> imgs = new ArrayList<>(); for (String s : split) { if (StringUtils.isNotBlank(s)) { if (StringUtils.isNotBlank(s)&&!s.contains("http")) { imgs.add(cosUtil.getPreviewUrl(s)); } } } String join = String.join(",", imgs); orderComplainById.setImages(join); orderComplainById.setOrderComplaintImages(orderComplaintImagesList.toArray(new String[0])); return ResultUtil.data(orderComplainById); } @ApiOperation(value = "分页获取")