springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ShopFlowerApi.java
@@ -160,7 +160,7 @@ return communityService.orderCreateFlower(orderCreateDTO); } @ApiOperation(value = "分页查询订单列表", response = ComShopOrderPageVO.class) @ApiOperation(value = "分页查询订单列表", response = ComShopFlowerOrderPageVO.class) @PostMapping("pageOrderList") public R pageOrderList(@RequestBody PageComFlowerOrderListDTO comOrderListDTO) { LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); @@ -171,8 +171,8 @@ return communityService.pageOrderListFlower(comOrderListDTO); } @ApiOperation(value = "查询订单详情", response = ComShopOrderPageVO.class) @PostMapping("orderDetail") @ApiOperation(value = "查询订单详情", response = ComShopFlowerOrderPageVO.class) @GetMapping("orderDetail") @ApiImplicitParam(name = "orderId", value = "订单id", required = true) public R orderDetail(@RequestParam("orderId") Long orderId) { return communityService.orderDetailFlower(orderId); @@ -189,10 +189,10 @@ } @ApiOperation(value = "删除订单") @PostMapping("orderDelete") @DeleteMapping("orderDelete") @ApiImplicitParam(name = "orderId", value = "订单id", required = true) public R orderDelete(@RequestParam("orderId") Long orderId) { return communityService.orderDelete(orderId); return communityService.orderDeleteFlower(orderId); } @ApiOperation(value = "订单确认收货") @@ -247,6 +247,7 @@ return R.fail(501, "填写内容存在 " + result + " 违规信息"); } } comShopFlowerEvaluateDTO.setUserId(this.getUserId()); return communityService.saveEvaluate(comShopFlowerEvaluateDTO); } @@ -391,6 +392,7 @@ @PostMapping("createRefundOrder") @ApiOperation(value = "创建退款订单") public R createRefundOrder(@RequestBody ComShopFlowerRefundOrderDTO comShopFlowerRefundOrderDTO) { comShopFlowerRefundOrderDTO.setUserId(this.getUserId()); return communityService.createRefundOrder(comShopFlowerRefundOrderDTO); } @@ -403,7 +405,9 @@ @PostMapping("pageRefundOrder") @ApiOperation(value = "退款订单分页查询 用户", response = ComShopFlowerRefundOrderVO.class) public R pageRefundOrder(@RequestBody PageComOrderRefundDTO pageComOrderRefundDTO) { if (null == pageComOrderRefundDTO.getStoreId()){ pageComOrderRefundDTO.setUserId(this.getUserId()); } return communityService.pageRefundOrder(pageComOrderRefundDTO); } @@ -485,4 +489,27 @@ public R getQuota(@RequestParam("storeId") Long storeId){ return communityService.getQuota(storeId); } /** * 取消退款 * @param id * @return */ @ApiOperation(value = "取消退款") @GetMapping("refundOrderCancel") public R refundOrderCancel(@RequestParam("id") Long id){ return communityService.refundOrderCancel(id); } /** * 退款订单详情 * @param id * @return */ @ApiOperation(value = "退款订单详情",response = ComShopFlowerRefundOrderVO.class) @GetMapping("refundOrderDetail") public R refundOrderDetail(Long id){ return communityService.refundOrderDetail(id); } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/shop/ComShopOrderCreateDTO.java
@@ -1,5 +1,6 @@ package com.panzhihua.common.model.dtos.shop; import java.math.BigDecimal; import java.util.List; import io.swagger.annotations.ApiModel; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/shop/ComShopOrderCreateGoodsDTO.java
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; /** * @auther lyq * @create 2021-04-14 15:02:14 @@ -21,4 +23,7 @@ @ApiModelProperty(value = "购买数量") private Integer num; @ApiModelProperty(value = "价格") private BigDecimal price; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/shop/PageComOrderRefundDTO.java
@@ -18,7 +18,7 @@ @ApiModelProperty(value = "分页-每页记录数", example = "10") private Long pageSize = 10L; @ApiModelProperty(value = "订单状态(1.处理中 2.退款成功 3.退款失败 4.已取消 5.退款中)") @ApiModelProperty(value = "订单状态(9.处理中 10.退款成功 11.退款失败 12.已取消 13.退款中)") private Integer status; @ApiModelProperty(value = "店铺id") springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/ComShopFlowerEvaluateVO.java
@@ -65,4 +65,16 @@ */ @ApiModelProperty("评价图片") private String evaluatePic; /** * 用户昵称 */ @ApiModelProperty("用户昵称") private String nickName; /** * 用户头像 */ @ApiModelProperty("用户头像") private String imageUrl; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/ComShopFlowerOrderPageVO.java
@@ -103,4 +103,10 @@ @ApiModelProperty(value = "配送单号") private String deliveryNo; @ApiModelProperty(value = "退款时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date refundTime; @ApiModelProperty(value = "退款金额") private BigDecimal refundAmount; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/ComShopFlowerOrderStoreListVO.java
@@ -1,5 +1,6 @@ package com.panzhihua.common.model.vos.shop; import com.panzhihua.common.model.vos.community.convenient.ConvenientElevatingPointVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -58,5 +59,9 @@ @ApiModelProperty(value = "收货人详细地址") private String detailAddress; @ApiModelProperty(value = "自提点id") private Long pointId; @ApiModelProperty(value = "自提点信息") private ConvenientElevatingPointVO convenientElevatingPointVO; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/ComShopFlowerRefundOrderVO.java
@@ -1,10 +1,13 @@ package com.panzhihua.common.model.vos.shop; import com.fasterxml.jackson.annotation.JsonFormat; import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.util.Date; import java.util.List; /** * @ClassName: ComShopFlowerRefundOrderVO @@ -52,9 +55,9 @@ private String refundOrderNo; /** * 订单状态(1.处理中 2.退款成功 3.退款失败 4.已取消 5.退款中) * 订单状态(9.处理中 10.退款成功 11.退款失败 12.已取消 13.退款中) */ @ApiModelProperty("订单状态(1.处理中 2.退款成功 3.退款失败 4.已取消 5.退款中)") @ApiModelProperty("订单状态(9.处理中 10.退款成功 11.退款失败 12.已取消 13.退款中)") private Integer status; /** @@ -91,25 +94,36 @@ * 申请时间 */ @ApiModelProperty("申请时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createAt; /** * 修改时间 */ @ApiModelProperty("修改时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date updateAt; /** * 处理时间 */ @ApiModelProperty("处理时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date handleTime; /** * 退款时间 */ @ApiModelProperty("退款时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date refundTime; /** * 取消时间 */ @ApiModelProperty("取消时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date cancelTime; /** * 处理结果 @@ -122,4 +136,16 @@ */ @ApiModelProperty("商家备注") private String remark; @ApiModelProperty(value = "订单下店铺信息") private ConvenientMerchantVO convenientMerchantVO; @ApiModelProperty(value = "订单下商品信息") private List<ComShopFlowerOrderGoodsVO> orderGoodsVOList; /** * 商品名称 */ @ApiModelProperty("商品名称") private String goodsName; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/ComShopOrderSearchVO.java
@@ -44,7 +44,7 @@ @ApiModelProperty("微信交易单号") private String wxTardeNo; @ApiModelProperty("订单状态(1.待付款 2.代发货 3.待收货 4.待评价 5.已完成 6.已取消)") @ApiModelProperty(value = "订单状态(1.等待配送 2.配送中 3.待收货 4.待评价 5.已完成 6.已取消 7.已退款)") private Integer status; @ApiModelProperty("支付状态(1.未支付 2.已支付)") springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -10794,7 +10794,7 @@ * @param orderId 订单id * @return 订单详情 */ @PostMapping("/shopFlower/orderDetail") @GetMapping("/shopFlower/orderDetail") R orderDetailFlower(@RequestParam("orderId") Long orderId); /** @@ -10812,7 +10812,7 @@ * @param orderId 订单id * @return 删除结果 */ @PostMapping("/shopFlower/orderDelete") @DeleteMapping("/shopFlower/orderDelete") R orderDeleteFlower(@RequestParam("orderId") Long orderId); /** @@ -11048,4 +11048,21 @@ */ @GetMapping("/shopFlower/getQuota") R getQuota(@RequestParam("storeId") Long storeId); /** * 取消退款 * @param id * @return */ @GetMapping("/shopFlower/refundOrderCancel") R refundOrderCancel(@RequestParam("id") Long id); /** * 退款订单详情 * @param id * @return */ @GetMapping("/shopFlower/refundOrderDetail") R refundOrderDetail(@RequestParam("id") Long id); } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java
@@ -926,8 +926,10 @@ } public static void main(String[] args) throws Exception { List<String> beforeDays = getBeforeDays(15); System.out.println(beforeDays); // List<String> beforeDays = getBeforeDays(15); // System.out.println(beforeDays); List<String> yearMonths = getYearMonths(); System.out.println(yearMonths); } @@ -1181,4 +1183,24 @@ return dates; } /** * 获取当年所有月份 * * @return */ public static List<String> getYearMonths() { Calendar instance = Calendar.getInstance(); int year = instance.get(Calendar.YEAR); List<String> months = new ArrayList<>(); for (int i = 1; i <= 12; i++) { String result = String.valueOf(year); if (i < 10) { result = result + "-0" +i; } else { result = result + "-"+i; } months.add(result); } return months; } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/OrderNoUtils.java
@@ -21,6 +21,16 @@ + getRandomNumber(); } public static String NextOrderNoFlower(Long userId) { if (sn == 999) sn = 0; else sn++; DateFormat df = new SimpleDateFormat("MMddHHmmss"); return df.format(new Date()) + padRight(String.valueOf(userId), 3, '0') + getRandomNumber(); } public static String nextDeliveryNo() { if (sn == 999) sn = 0; springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ShopFlowerApi.java
@@ -123,17 +123,29 @@ } /** * 分页查询 * 商家后台 分页查询 * @param pageComOrderRefundDTO * @return */ @PostMapping("pageRefundOrder") @ApiOperation(value = "分页查询",response = ComShopFlowerRefundOrderVO.class) @ApiOperation(value = "商家后台-退款订单 分页查询",response = ComShopFlowerRefundOrderVO.class) public R pageRefundOrder(@RequestBody PageComOrderRefundDTO pageComOrderRefundDTO){ pageComOrderRefundDTO.setBackstageUserId(this.getUserId()); return communityService.pageRefundOrder(pageComOrderRefundDTO); } /** * 商家后台 分页查询 * @param refundId * @return */ @PostMapping("refundOrderDetail") @ApiOperation(value = "商家后台-退款订单 详情",response = ComShopFlowerRefundOrderVO.class) public R refundOrderDetail(@RequestParam("refundId") Long refundId){ return communityService.refundOrderDetail(refundId); } /** * 商家后台-退款申请统计 * @param storeId * @return springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ShopFlowerApi.java
@@ -197,7 +197,7 @@ * @param orderId 订单id * @return 订单详情 */ @PostMapping("orderDetail") @GetMapping("orderDetail") public R orderDetailFlower(@RequestParam("orderId") Long orderId) { return comShopFlowerOrderService.orderDetail(orderId); } @@ -219,7 +219,7 @@ * @param orderId 订单id * @return 删除结果 */ @PostMapping("orderDelete") @DeleteMapping("orderDelete") public R orderDeleteFlower(@RequestParam("orderId") Long orderId) { return comShopFlowerOrderService.orderDelete(orderId); } @@ -516,4 +516,46 @@ } /** * 商家后台经营数据统计-上 * @param storeId * @return */ @GetMapping("selectSumOrderAndAmountByStoreId") public R selectSumOrderAndAmountByStoreId(@RequestParam("storeId") Long storeId){ return comShopFlowerOrderService.selectSumOrderAndAmountByStoreId(storeId); } /** * 统计时间区域的订单量 15天 30天 一年 * @param storeId * @param type * @return */ @GetMapping("selectOrderLineChart") public R selectOrderLineChart(@RequestParam("storeId") Long storeId,@RequestParam("type") Integer type){ return comShopFlowerOrderService.selectOrderLineChart(storeId,type); } /** * 取消退款 * @param id * @return */ @GetMapping("refundOrderCancel") public R refundOrderCancel(@RequestParam("id") Long id){ return comShopFlowerRefundOrderService.orderCancel(id); } /** * 退款订单详情 * @param id * @return */ @GetMapping("refundOrderDetail") public R refundOrderDetail(@RequestParam("id") Long id){ return comShopFlowerRefundOrderService.refundOrderDetail(id); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopFlowerRefundOrderDAO.java
@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; /** @@ -22,6 +23,7 @@ public interface ComShopFlowerRefundOrderDAO extends BaseMapper<ComShopFlowerRefundOrderDO> { /** * 用户 分页查询退款订单 * * @param page * @param pageComOrderRefundDTO * @return @@ -32,4 +34,5 @@ List<ComShopOrderCountVO> selectCountGroupStatus(@Param("storeId") Long storeId); int updateCancel(@Param("id") Long id, @Param("status") Integer status); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComShopFlowerOrderDO.java
@@ -189,9 +189,8 @@ */ private String deliveryNo; /** * 订单状态(0.待付款 1.等待配送 2.配送中 3.待收货 4.待评价 5.已完成 6.已取消 7.已退款) * 订单状态(1.等待配送 2.配送中 3.待收货 4.待评价 5.已完成 6.已取消 7.已退款 8.待发货) */ public interface status { int dfk = 0; @@ -202,6 +201,7 @@ int ywc = 5; int yqx = 6; int ytk = 7; int dfh = 8; } /** springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComShopFlowerRefundOrderDO.java
@@ -114,6 +114,12 @@ private Date refundTime; /** * 取消时间 */ @TableField(value = "cancel_time") private Date cancelTime; /** * 处理结果(1.同意 2.拒绝) */ @TableField(value = "handle_result") @@ -126,14 +132,14 @@ private String remark; /** * 订单状态(1.处理中 2.退款成功 3.退款失败 4.已取消 5.退款中) * 订单状态(9.处理中 10.退款成功 11.退款失败 12.已取消 13.退款中) */ public interface status{ int clz = 1; int tkcg = 2; int tksb = 3; int yqx = 4; int kkz = 5; int clz = 9; int tkcg = 10; int tksb = 11; int yqx = 12; int tkz = 13; } /** springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComShopFlowerOrderService.java
@@ -88,24 +88,6 @@ R orderConfirm(Long orderId, String phone); /** * 统计用户订单数量 * * @param userId * 用户id * @return 统计结果 */ R orderStatistics(Long userId); /** * 商家资金的订单详情 * * @param id * 订单id * @return */ R capitalDetailByStore(Long id); /** * 订单发货 * * @param orderShipDTO @@ -132,41 +114,6 @@ */ R finishDeliverOrder(ComShopOrderDeliverDTO orderDeliverDTO); /** * 获取订单导出数据 * * @param comShopOrderExportDTO * 订单导出参数 * @return 订单数据 */ R shopOrderExportData(ComShopOrderExportDTO comShopOrderExportDTO); /** * 获取资金导出数据 * * @param comShopFundsExportDTO * 资金导出参数 * @return 资金数据 */ R shopOrderFundsExportData(ComShopFundsExportDTO comShopFundsExportDTO); /** * 获取用户资金信息 * * @param userId * 用户ID * @return 统计结果 */ R getFundsStat(Long userId); /** * 获取分页 资金订单数据 * * @param pageComShopFundsSearchDTO * 资金导出参数 * @return 资金订单数据 */ R pageShopFunds(PageComShopFundsSearchDTO pageComShopFundsSearchDTO); /** * 微信支付订单回调 @@ -219,4 +166,13 @@ * @return */ R selectSumOrderAndAmountByStoreId(Long storeId); /** * 统计时间区域的订单量 15天 30天 一年 * @param storeId * @param type * @return */ R selectOrderLineChart(Long storeId,Integer type); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComShopFlowerRefundOrderService.java
@@ -42,4 +42,19 @@ * @return */ R selectCountGroupStatus(Long storeId); /** * 取消退款 * @param id * @return */ R orderCancel(Long id); /** * 退款订单详情 * @param id * @return */ R refundOrderDetail(Long id); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerEvaluateServiceImpl.java
@@ -30,7 +30,7 @@ @Override public R saveEvaluate(ComShopFlowerEvaluateDTO comShopFlowerEvaluateDTO) { ComShopFlowerEvaluateDO comShopFlowerEvaluateDO = new ComShopFlowerEvaluateDO(); BeanUtils.copyProperties(comShopFlowerEvaluateDO,comShopFlowerEvaluateDTO); BeanUtils.copyProperties(comShopFlowerEvaluateDTO,comShopFlowerEvaluateDO); //评价时间 comShopFlowerEvaluateDO.setEvaluateTime(new Date()); this.baseMapper.insert(comShopFlowerEvaluateDO); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerOrderServiceImpl.java
@@ -217,7 +217,7 @@ // 店铺id Long storeId = 0L; // 生成订单号 String orderNo = OrderNoUtils.NextOrderNo(userId); String orderNo = OrderNoUtils.NextOrderNoFlower(userId); // 配送方式 Integer deliveryType = 1; // 订单总金额 @@ -255,7 +255,7 @@ return R.fail("该规格库存不足,无法下单"); } orderGoodsDO.setGoodsAttrId(goodsAttrDO.getId()); orderGoodsDO.setGoodsAttrPrice(goodsAttrDO.getPrice()); orderGoodsDO.setGoodsAttrPrice(createGoodsDTO.getPrice()); orderGoodsDO.setPrice(goodsAttrDO.getPrice()); orderGoodsDO.setCollatePrice(goodsAttrDO.getCollatePrice()); orderGoodsDO.setFreeShippingPrice(goodsAttrDO.getFreeShippingPrice()); @@ -263,13 +263,9 @@ orderGoodsDOList.add(orderGoodsDO); // 将商品金额计算到订单总金额 orderTotal = orderTotal .add(orderGoodsDO.getGoodsAttrPrice().multiply(BigDecimal.valueOf(orderGoodsDO.getAmount()))); .add(createGoodsDTO.getPrice().multiply(BigDecimal.valueOf(createGoodsDTO.getNum()))); } } // 如果是购物车提交,需要将购物车内商品移除 /*if (orderCreateDTO.getSubmitType().equals(ComShopOrderCreateDTO.submitType.cart)) { comShopCartDAO.deleteBatchIds(orderCreateDTO.getCartIds()); }*/ // 创建订单信息 ComShopFlowerOrderDO shopOrderDO = new ComShopFlowerOrderDO(); shopOrderDO.setOrderNo(orderNo); @@ -367,6 +363,13 @@ BeanUtils.copyProperties(convenientMerchantDO, shopStoreVO); } orderVo.setConvenientMerchantVO(shopStoreVO); //已完成、已退款才有评论 TODO // if (ComShopFlowerOrderDO.status.ywc == shopOrderDO.getStatus() || ComShopFlowerOrderDO.status.ytk == shopOrderDO.getStatus()) { ComShopFlowerEvaluateVO comShopFlowerEvaluateVO = comShopFlowerEvaluateDAO.selectByOrderNo(orderVo.getOrderNo()); if (nonNull(comShopFlowerEvaluateVO)) { orderVo.setComShopFlowerEvaluateVO(comShopFlowerEvaluateVO); } // } }); } return R.ok(orderPageVOIPage); @@ -389,7 +392,7 @@ } BeanUtils.copyProperties(shopOrderDO, orderVO); orderVO.setOrderTotal(shopOrderDO.getTotalAmount()); orderVO.setOrderId(orderId); ConvenientMerchantVO shopStoreVO = new ConvenientMerchantVO(); // 查询店铺信息 ConvenientMerchantDO shopStoreDO = convenientMerchantDAO.selectById(shopOrderDO.getStoreId()); @@ -459,14 +462,18 @@ BeanUtils.copyProperties(convenientElevatingPointDO, convenientElevatingPointVO); orderVO.setConvenientElevatingPointVO(convenientElevatingPointVO); } //已完成、已退款才有评论 if (ComShopFlowerOrderDO.status.ywc == shopOrderDO.getStatus() || ComShopFlowerOrderDO.status.ytk == shopOrderDO.getStatus()) { //已完成、已退款才有评论 TODO // if (ComShopFlowerOrderDO.status.ywc == shopOrderDO.getStatus() || ComShopFlowerOrderDO.status.ytk == shopOrderDO.getStatus()) { ComShopFlowerEvaluateVO comShopFlowerEvaluateVO = comShopFlowerEvaluateDAO.selectByOrderNo(shopOrderDO.getOrderNo()); if (nonNull(comShopFlowerEvaluateVO)) { orderVO.setComShopFlowerEvaluateVO(comShopFlowerEvaluateVO); } // } //设置退款金额 ComShopFlowerRefundOrderDO comShopFlowerRefundOrderDO = comShopFlowerRefundOrderDAO.selectOne(new LambdaQueryWrapper<ComShopFlowerRefundOrderDO>().eq(ComShopFlowerRefundOrderDO::getOrderId, shopOrderDO.getOrderNo())); if (nonNull(comShopFlowerRefundOrderDO)){ orderVO.setRefundAmount(comShopFlowerRefundOrderDO.getRefundAmount()); } return R.ok(orderVO); } @@ -617,40 +624,6 @@ } } /** * 统计用户订单数量 * * @param userId 用户id * @return 统计结果 */ @Override public R orderStatistics(Long userId) { /*OrderStatisticsVO orderStatisticsVO = new OrderStatisticsVO(); // 待付款订单数 Integer paymentNum = 0; // 待发货订单数 Integer deliverNum = 0; // 待收货订单数 Integer receivingNum = 0; List<ComShopOrderDO> shopOrderList = this.baseMapper.selectList(new QueryWrapper<ComShopOrderDO>() .eq("user_id", userId).eq("delete_status", ComShopOrderDO.deleteStatus.no)); if (!shopOrderList.isEmpty()) { for (ComShopOrderDO orderDO : shopOrderList) { if (orderDO.getStatus().equals(ComShopOrderDO.status.dfk)) { paymentNum++; } else if (orderDO.getStatus().equals(ComShopOrderDO.status.dfh)) { deliverNum++; } else if (orderDO.getStatus().equals(ComShopOrderDO.status.dsh)) { receivingNum++; } } } orderStatisticsVO.setPaymentNum(paymentNum); orderStatisticsVO.setDeliverNum(deliverNum); orderStatisticsVO.setReceivingNum(receivingNum); return R.ok(orderStatisticsVO);*/ return R.ok(); } /** * 订单发货 @@ -710,10 +683,7 @@ if (!(comShopOrderDO.getStatus() == 2) || !(comShopOrderDO.getDeliveryStatus() == 1)) { return R.fail("当前订单不能配送"); } /*ComShopStoreDO storeDO = comShopStoreDAO.selectById(comShopOrderDO.getStoreId()); if (storeDO.getDeliveryType() != 1) { return R.fail("该商家不支持通过商家配送"); }*/ comShopOrderDO.setDeliveryStatus(4); comShopOrderDO.setDeliveryType(1); comShopOrderDO.setStatus(3); @@ -755,7 +725,7 @@ return R.fail("订单还未发货"); } // comShopOrderDO.setStatus(4); comShopOrderDO.setDeliveryStatus(5); comShopOrderDO.setDeliveryStatus(2); int updated = comShopFlowerOrderDAO.updateById(comShopOrderDO); if (updated == 1) { // 创建订单操作记录 @@ -779,53 +749,6 @@ return R.fail("操作失败!"); } @Override public R shopOrderExportData(ComShopOrderExportDTO comShopOrderExportDTO) { // Page page = new Page(); // page.setSize(10000); // page.setCurrent(1); // IPage<ExcelShopOrderDTO> excelShopOrderDTO = comShopOrderDAO.selectOrderExport(page, comShopOrderExportDTO); return R.ok(); } @Override public R shopOrderFundsExportData(ComShopFundsExportDTO comShopFundsExportDTO) { // Page page = new Page(); // page.setSize(10000); // page.setCurrent(1); // IPage<ExcelShopFundsDTO> excelShopFundsDTO = comShopOrderDAO.selectFundsExport(page, comShopFundsExportDTO); return R.ok(null); } @Override public R getFundsStat(Long userId) { /* ComShopFundsVO comShopFundsVO = comShopOrderDAO.queryStatis(userId); if (comShopFundsVO == null) { comShopFundsVO = new ComShopFundsVO(); comShopFundsVO.setMonthTotal(new BigDecimal(0)); comShopFundsVO.setTodayTotal(new BigDecimal(0)); comShopFundsVO.setWeekTotal(new BigDecimal(0)); }*/ return R.ok(); } @Override public R pageShopFunds(PageComShopFundsSearchDTO pageComShopFundsSearchDTO) { /*Long pageNum = pageComShopFundsSearchDTO.getPageNum(); Long pageSize = pageComShopFundsSearchDTO.getPageSize(); Page page = new Page(); if (pageNum == null || 0 == pageNum.longValue()) { pageNum = 1l; } if (pageSize == null || 0 == pageSize.longValue()) { pageSize = 10l; } page.setCurrent(pageNum); page.setSize(pageSize); IPage<ComShopFundsOrderVO> comShopFundsOrderVOIPage = comShopOrderDAO.pageShopFunds(page, pageComShopFundsSearchDTO);*/ return R.ok(); } @Override public R pageShopOrder(PageComShopOrderSearchDTO pageComShopOrderSearchDTO) { @@ -844,15 +767,6 @@ IPage<ComShopOrderSearchVO> ipage = this.baseMapper.pageOrderBy(page, pageComShopOrderSearchDTO); return R.ok(ipage); } @Override public R capitalDetailByStore(Long id) { /*if (id == null) { R.fail("订单号不能为空!"); } CapitalDetailVO vo = this.baseMapper.capitalDetailByStore(id);*/ return R.ok(); } /** @@ -877,7 +791,12 @@ log.error("未查询到支付订单,订单回调失败,订单号:" + wxPayNotifyOrderDTO.getOrderTradeNo()); return; } if (ComShopFlowerOrderDO.deliveryType.store == shopOrderDO.getDeliveryType()){ shopOrderDO.setStatus(ComShopFlowerOrderDO.status.ddps); }else { shopOrderDO.setStatus(ComShopFlowerOrderDO.status.dfh); } shopOrderDO.setPayType(ComShopFlowerOrderDO.payType.wx); shopOrderDO.setPayStatus(ComShopFlowerOrderDO.payStatus.yes); shopOrderDO.setPayAmount(BigDecimal.valueOf(Double.valueOf(wxPayNotifyOrderDTO.getCashFee()) / 100)); @@ -983,8 +902,19 @@ Page page = new Page(pageComFlowerOrderListDTO.getPageNum(), pageComFlowerOrderListDTO.getPageSize()); IPage<ComShopFlowerOrderStoreListVO> ipage = this.baseMapper.pageOrderByStoreId(page, pageComFlowerOrderListDTO); return R.ok(ipage); IPage<ComShopFlowerOrderStoreListVO> orderPageVOIPage = this.baseMapper.pageOrderByStoreId(page, pageComFlowerOrderListDTO); if (!orderPageVOIPage.getRecords().isEmpty()) { orderPageVOIPage.getRecords().forEach(orderVo -> { if (null!=orderVo.getPointId()){ ConvenientElevatingPointDO convenientElevatingPointDO = convenientElevatingPointDAO.selectById(orderVo.getPointId()); ConvenientElevatingPointVO convenientElevatingPointVO = new ConvenientElevatingPointVO(); BeanUtils.copyProperties(convenientElevatingPointDO,convenientElevatingPointVO); orderVo.setConvenientElevatingPointVO(convenientElevatingPointVO); } }); } return R.ok(orderPageVOIPage); } @Override @@ -1052,6 +982,7 @@ /** * 获取商家的营业额和可结算金额 * * @param storeId * @return */ @@ -1078,7 +1009,6 @@ } public R selectOrderLineChart(Long storeId,Integer type){ if (1==type){ //近15天的订单量 int days = 15; @@ -1091,10 +1021,14 @@ //今年所有月份订单量 List<ComShopOrderStoreIdCountVO> comShopOrderStoreIdCountVOS = this.baseMapper.selectCountOrderMonthByStoreId(storeId); Map<String, Integer> retMap = comShopOrderStoreIdCountVOS.stream().collect(Collectors.toMap(ComShopOrderStoreIdCountVO::getCountName, ComShopOrderStoreIdCountVO::getCountNum)); List<String> yearMonths = DateUtils.getYearMonths(); for (String yearMonth : yearMonths) { if (!retMap.containsKey(yearMonth)) { retMap.put(yearMonth, 0); } return R.ok(); } return R.ok(retMap); } } private R getCountByStoreIdAndDays(Long storeId, int days) { @@ -1108,6 +1042,4 @@ } return R.ok(retMap); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerRefundOrderServiceImpl.java
@@ -1,32 +1,36 @@ package com.panzhihua.service_community.service.impl; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.common.model.dtos.shop.ComShopFlowerRefundOrderDTO; import com.panzhihua.common.model.dtos.shop.ComShopOrderQueryDTO; import com.panzhihua.common.model.dtos.shop.PageComOrderRefundDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; import com.panzhihua.common.model.vos.shop.ComShopFlowerOrderGoodsVO; import com.panzhihua.common.model.vos.shop.ComShopFlowerRefundOrderVO; import com.panzhihua.common.model.vos.shop.ComShopOrderCountVO; import com.panzhihua.common.utlis.OrderNoUtils; import com.panzhihua.common.utlis.WxPayUtils; import com.panzhihua.common.utlis.wx.WXPayUtil; import com.panzhihua.service_community.dao.ComShopFlowerOrderDAO; import com.panzhihua.service_community.dao.ComShopFlowerOrderPayDAO; import com.panzhihua.service_community.dao.ComShopFlowerRefundOrderDAO; import com.panzhihua.service_community.model.dos.ComShopFlowerOrderDO; import com.panzhihua.service_community.model.dos.ComShopFlowerOrderPayDO; import com.panzhihua.service_community.model.dos.ComShopFlowerRefundOrderDO; import com.panzhihua.service_community.dao.*; import com.panzhihua.service_community.model.dos.*; import com.panzhihua.service_community.service.ComShopFlowerRefundOrderService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.*; import java.util.stream.Collectors; import static java.util.Objects.isNull; import static java.util.Objects.nonNull; /** * @ClassName: ComShopFlowerRefundOrderServiceImpl @@ -54,6 +58,15 @@ private ComShopFlowerOrderDAO comShopFlowerOrderDAO; @Resource private ComShopFlowerOrderPayDAO comShopFlowerOrderPayDAO; @Resource private ComShopFlowerOrderGoodsDAO comShopFlowerOrderGoodsDAO; @Resource private ComShopFlowerGoodsDAO comShopFlowerGoodsDAO; @Resource private ComShopFlowerGoodsAttrDAO comShopFlowerGoodsAttrDAO; @Resource private ConvenientMerchantDAO convenientMerchantDAO; @Override @@ -61,7 +74,7 @@ ComShopFlowerRefundOrderDO comShopFlowerRefundOrderDO = new ComShopFlowerRefundOrderDO(); BeanUtils.copyProperties(comShopFlowerRefundOrderDTO, comShopFlowerRefundOrderDO); // 生成退款订单号 String refundOrderNo = OrderNoUtils.NextOrderNo(comShopFlowerRefundOrderDTO.getUserId()); String refundOrderNo = OrderNoUtils.NextOrderNoFlower(comShopFlowerRefundOrderDTO.getUserId()); comShopFlowerRefundOrderDO.setRefundOrderNo(refundOrderNo); comShopFlowerRefundOrderDO.setStatus(ComShopFlowerRefundOrderDO.status.clz); comShopFlowerRefundOrderDO.setDeleteStatus(ComShopFlowerRefundOrderDO.deleteStatus.no); @@ -73,6 +86,36 @@ public R pageRefundOrder(PageComOrderRefundDTO pageComOrderRefundDTO) { Page page = new Page<>(pageComOrderRefundDTO.getPageNum(), pageComOrderRefundDTO.getPageSize()); IPage<ComShopFlowerRefundOrderVO> pages = this.baseMapper.pageRefundOrder(page, pageComOrderRefundDTO); for (ComShopFlowerRefundOrderVO comShopFlowerRefundOrderVO : pages.getRecords()) { String orderNo = comShopFlowerRefundOrderVO.getOrderNo(); List<ComShopFlowerOrderGoodsVO> orderGoodsVOS = new ArrayList<>(); // 查询订单下商品信息 List<ComShopFlowerOrderGoodsDO> orderGoodsDOList = comShopFlowerOrderGoodsDAO .selectList(new QueryWrapper<ComShopFlowerOrderGoodsDO>().eq("order_no",orderNo)); StringBuilder sbr = new StringBuilder(); if (!orderGoodsDOList.isEmpty()) { orderGoodsDOList.forEach(orderGoods -> { ComShopFlowerOrderGoodsVO orderGoodsVO = new ComShopFlowerOrderGoodsVO(); BeanUtils.copyProperties(orderGoods, orderGoodsVO); orderGoodsVO.setNum(orderGoods.getAmount()); orderGoodsVO.setGoodsPic(orderGoods.getGoodsAttrPic()); orderGoodsVO.setPrice(orderGoods.getGoodsAttrPrice()); orderGoodsVOS.add(orderGoodsVO); sbr.append(orderGoods.getGoodsName()).append(" "); }); } comShopFlowerRefundOrderVO.setOrderGoodsVOList(orderGoodsVOS); comShopFlowerRefundOrderVO.setGoodsName(sbr.toString()); ConvenientMerchantVO shopStoreVO = new ConvenientMerchantVO(); // 查询店铺信息 ConvenientMerchantDO shopStoreDO = convenientMerchantDAO.selectById(comShopFlowerRefundOrderVO.getStoreId()); if (shopStoreDO != null) { BeanUtils.copyProperties(shopStoreDO, shopStoreVO); } comShopFlowerRefundOrderVO.setConvenientMerchantVO(shopStoreVO); } return R.ok(pages); } @@ -145,6 +188,7 @@ return R.ok(); } @Override public R selectCountGroupStatus(Long storeId){ String[] statusStr = {"clz","tkcg","tksb","yqx","tkz"}; List<ComShopOrderCountVO> comShopOrderCountVOS = this.baseMapper.selectCountGroupStatus(storeId); @@ -163,4 +207,72 @@ retMap.put("zdd",amountTotal); return R.ok(retMap); } /** * 根据订单id取消订单 * * @param \ * @return 取消结果 */ @Transactional(rollbackFor = Exception.class) @Override public R orderCancel(Long id) { this.baseMapper.updateCancel(id,ComShopFlowerRefundOrderDO.status.yqx); return R.ok(); } @Override public R refundOrderDetail(Long id){ ComShopFlowerRefundOrderDO comShopFlowerRefundOrderDO = this.baseMapper.selectById(id); if (isNull(comShopFlowerRefundOrderDO)){ return R.fail("未查询到该退款订单"); } ComShopFlowerRefundOrderVO comShopFlowerRefundOrderVO = new ComShopFlowerRefundOrderVO(); BeanUtils.copyProperties(comShopFlowerRefundOrderDO,comShopFlowerRefundOrderVO); String orderNo = comShopFlowerRefundOrderDO.getOrderNo(); List<ComShopFlowerOrderGoodsVO> orderGoodsVOS = new ArrayList<>(); // 查询订单下商品信息 List<ComShopFlowerOrderGoodsDO> orderGoodsDOList = comShopFlowerOrderGoodsDAO .selectList(new QueryWrapper<ComShopFlowerOrderGoodsDO>().eq("order_no",orderNo)); StringBuilder sbr = new StringBuilder(); if (!orderGoodsDOList.isEmpty()) { orderGoodsDOList.forEach(orderGoods -> { ComShopFlowerOrderGoodsVO orderGoodsVO = new ComShopFlowerOrderGoodsVO(); BeanUtils.copyProperties(orderGoods, orderGoodsVO); orderGoodsVO.setNum(orderGoods.getAmount()); orderGoodsVO.setGoodsPic(orderGoods.getGoodsAttrPic()); orderGoodsVO.setPrice(orderGoods.getGoodsAttrPrice()); // 查询商品信息判断商品状态 ComShopFlowerGoodsDO goodsDO = comShopFlowerGoodsDAO.selectById(orderGoods.getGoodsId()); if (goodsDO == null || goodsDO.getDeleteStatus().equals(ComShopFlowerGoodsDO.deleteStatus.yes) || goodsDO.getDeleteStatus().equals(ComShopFlowerGoodsDO.status.recovery)) { orderGoodsVO.setGoodsStatus(ComShopFlowerOrderGoodsVO.goodsStatus.ysc); } else if (goodsDO.getStatus().equals(ComShopFlowerGoodsDO.status.lower)) { orderGoodsVO.setGoodsStatus(ComShopFlowerOrderGoodsVO.goodsStatus.yxj); } else if (goodsDO.getStatus().equals(ComShopFlowerGoodsDO.status.sell)) { orderGoodsVO.setGoodsStatus(ComShopFlowerOrderGoodsVO.goodsStatus.csz); } // 根据商品规格id查询商品规格 ComShopFlowerGoodsAttrDO goodsAttrDO = comShopFlowerGoodsAttrDAO.selectById(orderGoods.getGoodsAttrId()); if (goodsAttrDO != null) { orderGoodsVO.setGoodsAttr(goodsAttrDO.getGoodsAttrName()); } orderGoodsVOS.add(orderGoodsVO); sbr.append(orderGoods.getGoodsName()).append(" "); }); } comShopFlowerRefundOrderVO.setOrderGoodsVOList(orderGoodsVOS); comShopFlowerRefundOrderVO.setGoodsName(sbr.toString()); ConvenientMerchantVO shopStoreVO = new ConvenientMerchantVO(); // 查询店铺信息 ConvenientMerchantDO shopStoreDO = convenientMerchantDAO.selectById(comShopFlowerRefundOrderDO.getStoreId()); if (shopStoreDO != null) { BeanUtils.copyProperties(shopStoreDO, shopStoreVO); } comShopFlowerRefundOrderVO.setConvenientMerchantVO(shopStoreVO); return R.ok(comShopFlowerRefundOrderVO); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java
@@ -1,25 +1,6 @@ package com.panzhihua.service_community.service.impl; import static java.util.Objects.isNull; import static java.util.Objects.nonNull; import static org.apache.commons.lang3.StringUtils.isNotBlank; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.stream.Collectors; import javax.annotation.Resource; import cn.hutool.core.util.NumberUtil; import com.panzhihua.common.utlis.Snowflake; import com.panzhihua.service_community.dao.*; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -27,32 +8,32 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.common.exceptions.ServiceException; import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; import com.panzhihua.common.model.dtos.community.convenient.DisableOrEnableConvenientMerchantDTO; import com.panzhihua.common.model.dtos.community.convenient.ExportMerchantDTO; import com.panzhihua.common.model.dtos.community.convenient.PageClassifyMerchantDTO; import com.panzhihua.common.model.dtos.community.convenient.PageConvenientMerchantDTO; import com.panzhihua.common.model.dtos.community.convenient.PagePopularMerchantDTO; import com.panzhihua.common.model.dtos.community.convenient.PageSearchDTO; import com.panzhihua.common.model.dtos.community.convenient.ResetPasswordConvenientMerchantDTO; import com.panzhihua.common.model.dtos.community.convenient.*; import com.panzhihua.common.model.dtos.grid.EventGridMemberPassResetDTO; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.convenient.ConvenientConsultationStatisticsVO; import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; import com.panzhihua.common.model.vos.community.convenient.ConvenientProductSpecificationVO; import com.panzhihua.common.model.vos.community.convenient.ConvenientProductVO; import com.panzhihua.common.model.vos.community.convenient.ConvenientViewStatisticsVO; import com.panzhihua.common.model.vos.community.convenient.ExportMerchantVO; import com.panzhihua.common.model.vos.community.convenient.*; import com.panzhihua.common.service.user.UserService; import com.panzhihua.service_community.model.dos.ComActDO; import com.panzhihua.service_community.model.dos.ConvenientConsultationStatisticsDO; import com.panzhihua.service_community.model.dos.ConvenientMerchantDO; import com.panzhihua.service_community.model.dos.ConvenientServiceCategoryDO; import com.panzhihua.service_community.model.dos.ConvenientViewStatisticsDO; import com.panzhihua.common.utlis.Snowflake; import com.panzhihua.service_community.dao.*; import com.panzhihua.service_community.model.dos.*; import com.panzhihua.service_community.service.ConvenientMerchantService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.stream.Collectors; import static java.util.Objects.isNull; import static java.util.Objects.nonNull; import static org.apache.commons.lang3.StringUtils.isNotBlank; /** * @title: ConvenientMerchantServiceImpl @@ -86,6 +67,12 @@ @Override @Transactional(rollbackFor = Exception.class) public R addMerchant(ConvenientMerchantDTO convenientMerchantDTO) { //校验微信手机号是否已使用 String mobilePhone = convenientMerchantDTO.getMobilePhone(); Integer count = this.baseMapper.selectCount(new LambdaQueryWrapper<ConvenientMerchantDO>().eq(ConvenientMerchantDO::getMobilePhone, mobilePhone)); if (count > 0) { R.fail("该微信手机号:" + mobilePhone + "已被使用!请更换"); } ConvenientMerchantDO convenientMerchantDO = new ConvenientMerchantDO(); BeanUtils.copyProperties(convenientMerchantDTO, convenientMerchantDO); if(convenientMerchantDTO.getCommunityId()==0){ @@ -96,8 +83,7 @@ }else{ convenientMerchantDO.setCommunityName("西区社区"); } } else { } else { ComActDO comActDO = comActDAO.selectById(convenientMerchantDTO.getCommunityId()); convenientMerchantDO.setCommunityName(comActDO.getName()); } @@ -132,17 +118,21 @@ @Transactional(rollbackFor = Exception.class) public R putMerchant(ConvenientMerchantDTO convenientMerchantDTO) { Long merchantId = convenientMerchantDTO.getId(); String mobilePhone = convenientMerchantDTO.getMobilePhone(); ConvenientMerchantDO merchantDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ConvenientMerchantDO>().eq(ConvenientMerchantDO::getMobilePhone, mobilePhone)); ConvenientMerchantDO convenientMerchantDO = this.baseMapper.selectById(merchantId); if (isNull(convenientMerchantDO)) { return R.fail("商家不存在"); } if (nonNull(merchantDO)&&!merchantDO.getId().equals(convenientMerchantDO.getId())) { R.fail("该微信手机号:" + mobilePhone + "已被使用!请更换"); } Long communityId = convenientMerchantDTO.getCommunityId(); if (nonNull(communityId)) { ComActDO comActDO = comActDAO.selectById(communityId); if(comActDO!=null){ convenientMerchantDO.setCommunityName(comActDO.getName()); } else { } else { convenientMerchantDO.setCommunityName("西区社区"); } } @@ -342,6 +332,7 @@ /** * 小程序获取商家详情 * * @param merchantId * @return */ @@ -442,6 +433,7 @@ /** * 定时任务每隔半小时将商家浏览量和咨询量总值计入指定商家数据中 * * @return */ @Override @@ -455,6 +447,7 @@ /** * check商家/店铺是否有效 * * @param userId * @return */ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComShopFlowerEvaluateDAO.xml
@@ -20,7 +20,8 @@ evaluate_pic, create_at </sql> <select id="pageEvaluate" resultType="com.panzhihua.common.model.vos.shop.ComShopFlowerEvaluateVO"> select * from com_shop_flower_evaluate where 1=1 select e.*,u.nick_name,u.image_url FROM com_shop_flower_evaluate e left join sys_user u on e.user_id = u.user_id where 1=1 <if test="pageComShopFlowerEvaluateDTO.goodsId != null"> and goods_id = #{pageComShopFlowerEvaluateDTO.goodsId} </if> @@ -35,10 +36,10 @@ </if> </select> <select id="selectListLimit" resultType="com.panzhihua.common.model.vos.shop.ComShopFlowerEvaluateVO"> SELECT * FROM com_shop_flower_evaluate WHERE goods_id = #{goodsId} ORDER BY create_at LIMIT 3 SELECT e.*,u.nick_name,u.image_url FROM com_shop_flower_evaluate e left join sys_user u on e.user_id = u.user_id WHERE e.goods_id = #{goodsId} ORDER BY create_at LIMIT 3 </select> <select id="selectByOrderNo" resultType="com.panzhihua.common.model.vos.shop.ComShopFlowerEvaluateVO"> SELECT * FROM com_shop_flower_evaluate WHERE order_no = #{orderNo} SELECT e.*,u.nick_name,u.image_url FROM com_shop_flower_evaluate e left join sys_user u on e.user_id = u.user_id WHERE e.order_no = #{orderNo} </select> <select id="statisticsScore" resultType="java.math.BigDecimal"> SELECT (sum(e.evaluate_type)/count(1)) AS pf FROM `com_shop_flower_evaluate` e LEFT JOIN com_shop_flower_goods g ON e.goods_id = g.id WHERE g.store_id = #{storeId} GROUP BY g.store_id springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComShopFlowerOrderDAO.xml
@@ -32,6 +32,7 @@ <result column="refund_time" jdbcType="TIMESTAMP" property="refundTime"/> <result column="delivery_id" jdbcType="TIMESTAMP" property="deliveryId"/> <result column="delivery_no" jdbcType="TIMESTAMP" property="deliveryNo"/> </resultMap> <sql id="Base_Column_List"> <!--@mbg.generated--> @@ -45,9 +46,11 @@ select id as orderId,order_no,store_id,`status`,pay_status,receiver_id,total_amount as orderTotal,pay_amount,delivery_type,remark,create_at from com_shop_flower_order as cso where 1=1 and cso.delete_status = 1 and cso.user_id = #{comOrderListDTO.userId} <if test='comOrderListDTO.status != null'>AND cso.status = #{comOrderListDTO.status} </if> order by create_at desc and cso.user_id = #{comOrderListDTO.userId} <if test='comOrderListDTO.status != null'> AND cso.status = #{comOrderListDTO.status} </if> order by create_at desc </select> <select id="pageOrderListNoDelivery" resultType="com.panzhihua.common.model.vos.shop.ComShopFlowerOrderPageVO"> @@ -149,7 +152,8 @@ a.province_name, a.city_name, a.district_name, a.detail_address a.detail_address, o.point_id FROM com_shop_flower_order o LEFT JOIN com_shop_flower_order_goods g ON o.id = g.order_id springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComShopFlowerRefundOrderDAO.xml
@@ -20,6 +20,7 @@ <result column="update_at" jdbcType="TIMESTAMP" property="updateAt" /> <result column="handle_time" jdbcType="TIMESTAMP" property="handleTime" /> <result column="refund_time" jdbcType="TIMESTAMP" property="refundTime" /> <result column="cancel_time" jdbcType="TIMESTAMP" property="cancelTime" /> <result column="handle_result" jdbcType="VARCHAR" property="handleResult" /> <result column="remark" jdbcType="VARCHAR" property="remark" /> </resultMap> @@ -27,7 +28,7 @@ <!--@mbg.generated--> id, store_id, user_id, order_no, order_id, refund_order_no, `status`, delete_status, pay_amount, refund_amount, refund_reason, refund_pic, create_at, update_at, handle_time, refund_time, handle_result, remark refund_time, handle_result, remark,cancel_time </sql> <select id="pageRefundOrder" resultType="com.panzhihua.common.model.vos.shop.ComShopFlowerRefundOrderVO"> select ro.* from com_shop_flower_refund_order ro left join com_convenient_merchants cm on ro.store_id = cm.id where 1=1 @@ -59,4 +60,7 @@ </if> GROUP BY `status` </select> <update id="updateCancel"> update com_shop_flower_refund_order set `status` = #{status},cancel_time = NOW() where id = #{id} </update> </mapper>