springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/CommunityApi.java
@@ -2,6 +2,7 @@ import javax.annotation.Resource; import com.panzhihua.common.model.vos.grid.EventGridCommunityAdminVO; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -93,6 +94,11 @@ pageComActDTO.setAreaCode(this.getAreaCode()); return communityService.pageCommunity(pageComActDTO); } @ApiOperation(value = "查询所有社区列表", response = EventGridCommunityAdminVO.class) @GetMapping("/community/list") public R getCommunityLists() { return communityService.getCommunityLists(); } @ApiOperation(value = "所在地地址下拉列表", response = ComMngStructAreaDistrictVO.class) @PostMapping("listarea") springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/constants/Constants.java
@@ -261,4 +261,9 @@ * 天府通办解密私钥 * */ public static final String PRIVATE_KEY="MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAJJuFUH/4m9H5hCCzxtd9BxpjWlG9gbejqiJpV0XJKaU1V7xDBJasswxPY7Zc15RoxWClPoKPwKrbWKm49dgBJebJq5xd4sLCSbboxRkKxpRiJHMZ4LJjYa5h9Ei9RyfoUzqGHqH4UrDy3m3IwPiP19cIBqoU50shyQf92ZpcGZhAgMBAAECgYEAiadU8pODoUs82x6tZbPALQmJN4PO+wwznfqv6sA74yGdKECAMazz0oMjtGt1SiCCqFD2jcweCftvvELZg3mvNg1V0vRQRD1ZCA8HDp8DXm20d11K3+RX39tR4KgyyM3HsSEhkUDujMxKIpYjyiB5iEtV7Ja9bZ2fROszq+mUIqUCQQDQQf6vWRMLBqfnDcU77vuDGOhXbjkF2ytLxLW3fbKaW3GWvC3n93zPM+mcvWSXgkl448+jFjpMktm1Vn+w+YX3AkEAs/+bbRbod6AcVbLu8C5E44qDRoRpu+LF7Cphp8tlSAIRjm2yGP5acMWGRUtH9MF2QJYPF0PgDzdmUSVqWnCAZwJBALnSuRri4wAKn1SmT+ALfLZcSiyBODZGeppv2ijw6qWahH8YR+ncRaxoyMFHqPMbmM1akJIXqktbGREaLnPOIb8CQQCdJycJaL3Qa98xR4dr9cm5rF6PO96g5w6M8jfO6ztjUkMHymh7f99wpFRlvaN2Y06edyV315ARWPohEPy5N44zAkBlLuDHLm1TkTTAfdlL5r2OcdjpaJYloTdn05Mp3+J+w1zTX8k6Mz8lFZtLUcoMeTfQ9rm/+u2KwxS8NljtSZWH"; /** * 花城小程序appid */ public static final String HC_APP_ID = "wx118de8a734d269f0"; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/ComShopFlowerGoodsVO.java
@@ -135,7 +135,15 @@ /** * 浏览量 */ @ApiModelProperty("浏览量") private Integer viewNum; /** * 评价数量 */ @ApiModelProperty("评价数量") private Integer evaluateNum; /** * 商品规格列表 @@ -147,3 +155,5 @@ @NotEmpty(groups = {AddGroup.class}, message = "商品分类不能为空") private List<Long> categoryIds; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/ComShopFlowerOrderPageVO.java
@@ -129,4 +129,7 @@ @ApiModelProperty(value = "送达时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date serviceTime; @ApiModelProperty(value = "是否可退款按钮显示 1.可退款 2.不可退款") private Integer refundable = 1; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/user/AreaVOStr.java
New file @@ -0,0 +1,22 @@ package com.panzhihua.common.model.vos.user; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; import java.util.List; @Data @ApiModel public class AreaVOStr implements Serializable { @ApiModelProperty("区县名") private String name; @ApiModelProperty("区县code") private String id; @ApiModelProperty("下属街道列表") private List<StreetVOStr> childList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/user/StreetVOStr.java
New file @@ -0,0 +1,20 @@ package com.panzhihua.common.model.vos.user; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data @ApiModel public class StreetVOStr { @ApiModelProperty("街道id") private String id; @ApiModelProperty("街道名") private String name; @ApiModelProperty("下属社区列表") private List<CommunityVO> childList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/user/SysUserVO.java
@@ -60,6 +60,9 @@ private Integer isPartymember; private String imageUrl; @ApiModelProperty(value = "微信小程序唯一标识") private String openid; /** * 用户类型(用户类型 1 小程序 2 运营平台 3 社区平台 5 商家后台 6 网格综治APP 7 网格综治后台 8大屏 9城管后台 10一键报警app) springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/WxUtil.java
@@ -738,6 +738,7 @@ paras.add(new TemplateParam("thing2", "您有一个订单已发货")); paras.add(new TemplateParam("thing3", logisticsCompany)); paras.add(new TemplateParam("character_string4",logisticsNo)); paras.add(new TemplateParam("character_string5",orderNo)); paras.add(new TemplateParam("time6",deliverTime)); subscribeDTO.setTemplateParamList(paras); try { springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopFlowerEvaluateDAO.java
@@ -47,4 +47,6 @@ * @return */ BigDecimal statisticsScore(@Param("storeId") Long storeId); Integer selectCountByGoodsId(@Param("goodsId") Long goodsId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopFlowerOrderDAO.java
@@ -69,7 +69,7 @@ List<ComShopOrderStoreIdCountVO> selectCountByStoreId(@Param("storeId") Long storeId, @Param("deliveryType") Integer deliveryType); List<ComShopOrderStoreIdCountVO> selectSumAmountByStoreId(@Param("storeId") Long storeId); List<ComShopOrderStoreIdNumVO> selectSumAmountByStoreId(@Param("storeId") Long storeId); /** * 获取商家总营业额 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopFlowerRefundOrderDAO.java
@@ -35,4 +35,6 @@ List<ComShopOrderCountVO> selectCountGroupStatus(@Param("storeId") Long storeId); int updateCancel(@Param("id") Long id, @Param("status") Integer status); int selectCountRefundNowByOrderId(@Param("orderId") Long orderId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComShopFlowerGoodsDO.java
@@ -49,6 +49,7 @@ /** * 商品展示图 */ @TableField(updateStrategy = FieldStrategy.IGNORED) private String images; /** springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComShopFlowerRefundOrderDO.java
@@ -54,7 +54,7 @@ private String refundOrderNo; /** * 订单状态(1.处理中 2.退款成功 3.退款失败 4.已取消 5.退款中) * 订单状态(9.处理中 10.退款成功 11.退款失败 12.已取消 13.退款中) */ @TableField(value = "status") private Integer status; springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerGoodsServiceImpl.java
@@ -1,6 +1,8 @@ package com.panzhihua.service_community.service.impl; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -26,6 +28,7 @@ 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; @@ -196,13 +199,13 @@ List<ComShopFlowerGoodsAttrVO> goodsAttrList = new ArrayList<>(); List<ComShopFlowerGoodsAttrDO> goodsAttrDOS = shopFlowerGoodsAttrDAO.selectList(new QueryWrapper<ComShopFlowerGoodsAttrDO>().eq("goods_id", goodsId)); List<String> images = new ArrayList<>(); // List<String> images = new ArrayList<>(); int stock = 0; for (ComShopFlowerGoodsAttrDO attrDO : goodsAttrDOS) { ComShopFlowerGoodsAttrVO goodsAttrVO = new ComShopFlowerGoodsAttrVO(); BeanUtils.copyProperties(attrDO, goodsAttrVO); String attrPic = attrDO.getAttrPic(); images.add(attrPic); // images.add(attrPic); goodsAttrList.add(goodsAttrVO); stock = stock +attrDO.getStock(); } @@ -210,17 +213,20 @@ ConvenientMerchantDO convenientMerchantDO = convenientMerchantDAO.selectById(goodsDO.getStoreId()); ConvenientMerchantVO convenientMerchantVO = new ConvenientMerchantVO(); BeanUtils.copyProperties(convenientMerchantDO, convenientMerchantVO); BigDecimal score = comShopFlowerEvaluateDAO.statisticsScore(convenientMerchantDO.getId()); convenientMerchantVO.setScore(null == score ? BigDecimal.ZERO : NumberUtil.round(score, 1)); // 设置值 ComShopFlowerGoodsVO shopGoods = new ComShopFlowerGoodsVO(); BeanUtils.copyProperties(goodsDO, shopGoods); shopGoods.setGoodsAttrList(goodsAttrList); shopGoods.setConvenientMerchantVO(convenientMerchantVO); shopGoods.setImages(StringUtils.join(images,",")); // shopGoods.setImages(StringUtils.join(images,",")); Integer orderNum = comShopFlowerOrderGoodsDAO.selectCount(new LambdaQueryWrapper<ComShopFlowerOrderGoodsDO>().eq(ComShopFlowerOrderGoodsDO::getGoodsId, goodsId)); shopGoods.setOrderNum(orderNum); List<ComShopFlowerEvaluateVO> comShopFlowerEvaluateVOList = comShopFlowerEvaluateDAO.selectListLimit(goodsId); shopGoods.setShopFlowerEvaluateVOList(comShopFlowerEvaluateVOList); Integer evaluateNum = comShopFlowerEvaluateDAO.selectCountByGoodsId(goodsId); shopGoods.setEvaluateNum(evaluateNum); List<Long> categoryIds = convenientGoodsCategoryDAO.selectCategoryIdsForGoods(goodsId); shopGoods.setCategoryIds(categoryIds); @@ -257,7 +263,7 @@ .delete(new LambdaQueryWrapper<ComShopFlowerGoodsAttrDO>().eq(ComShopFlowerGoodsAttrDO::getGoodsId, id)); ComShopFlowerGoodsAttrDO comShopFlowerGoodsAttrDO = new ComShopFlowerGoodsAttrDO(); comShopFlowerGoodsAttrDO.setGoodsId(id); comShopFlowerGoodsAttrDO.setStoreId(addShopFlowerGoodsVO.getStoreId()); comShopFlowerGoodsAttrDO.setStoreId(shopGoodsDO.getStoreId()); comShopFlowerGoodsAttrDO.setGoodsName(addShopFlowerGoodsVO.getName()); comShopFlowerGoodsAttrDO.setGoodsAttrName("默认"); comShopFlowerGoodsAttrDO.setAttrPic(addShopFlowerGoodsVO.getGoodsPic()); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerOrderDeliveryServiceImpl.java
@@ -1,10 +1,12 @@ package com.panzhihua.service_community.service.impl; import cn.binarywang.wx.miniapp.api.WxMaService; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.constants.Constants; import com.panzhihua.common.model.dtos.shop.ComShopFlowerOrderDeliveryDTO; import com.panzhihua.common.model.dtos.shop.PageComFlowerOrderDeliveryDTO; import com.panzhihua.common.model.dtos.shop.PageComFlowerOrderListDTO; @@ -13,15 +15,21 @@ import com.panzhihua.common.model.vos.community.convenient.ConvenientElevatingPointVO; import com.panzhihua.common.model.vos.shop.ComShopFlowerOrderDeliveryVO; import com.panzhihua.common.model.vos.shop.ComShopFlowerOrderPageVO; import com.panzhihua.common.model.vos.user.SysUserVO; import com.panzhihua.common.service.user.UserService; import com.panzhihua.common.utlis.OrderNoUtils; import com.panzhihua.common.utlis.WxUtil; import com.panzhihua.service_community.dao.ComShopFlowerOrderDAO; import com.panzhihua.service_community.dao.ComShopFlowerOrderDeliveryDAO; import com.panzhihua.service_community.dao.ConvenientElevatingPointDAO; import com.panzhihua.service_community.entity.SysUser; import com.panzhihua.service_community.model.dos.ComShopFlowerOrderDO; import com.panzhihua.service_community.model.dos.ComShopFlowerOrderDeliveryDO; import com.panzhihua.service_community.model.dos.ConvenientElevatingPointDO; import com.panzhihua.service_community.service.ComShopFlowerOrderDeliveryService; import com.panzhihua.service_community.util.WxMaConfiguration; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.error.WxErrorException; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -30,6 +38,7 @@ import java.util.Date; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; import static java.util.Objects.nonNull; @@ -47,7 +56,10 @@ private ComShopFlowerOrderDAO comShopFlowerOrderDAO; @Resource private ConvenientElevatingPointDAO convenientElevatingPointDAO; @Resource private WxMaConfiguration wxMaConfiguration; @Resource private UserService userService; @Override @Transactional(rollbackFor = Exception.class) @@ -66,9 +78,27 @@ List<Long> orderIds = comShopFlowerOrderDeliveryDTO.getOrderIds(); if (CollUtil.isNotEmpty(orderIds)){ comShopFlowerOrderDAO.updateOrder(orderIds,deliveryId,comShopFlowerOrderDeliveryDO.getDeliveryNo(), ComShopFlowerOrderDO.status.psz,comShopFlowerOrderDeliveryDO.getDeliveryTime()); //订单配送通知 WxMaService maService = wxMaConfiguration.getMaService(Constants.HC_APP_ID); List<ComShopFlowerOrderDO> comShopFlowerOrderDOS = comShopFlowerOrderDAO.selectList(new LambdaQueryWrapper<ComShopFlowerOrderDO>().in(ComShopFlowerOrderDO::getId, orderIds)); for (ComShopFlowerOrderDO comShopFlowerOrderDO : comShopFlowerOrderDOS) { Long userId = comShopFlowerOrderDO.getUserId(); R userOpenId = userService.getUserOpenId(userId); if (R.isOk(userOpenId)) { String openid = userOpenId.getData().toString(); try { WxUtil.sendStartShipping(openid,maService.getAccessToken(),comShopFlowerOrderDO.getOrderNo()); } catch (WxErrorException e) { e.printStackTrace(); } } } } } return R.ok(); return R.ok(comShopFlowerOrderDeliveryDO.getId()); } @Override @@ -87,6 +117,21 @@ int update = this.baseMapper.updateById(comShopFlowerOrderDeliveryDO); if (update > 0){ comShopFlowerOrderDAO.updateOrderStatus(comShopFlowerOrderDeliveryDO.getId(),comShopFlowerOrderDeliveryDO.getServiceTime(),ComShopFlowerOrderDO.status.dsh); WxMaService maService = wxMaConfiguration.getMaService(Constants.HC_APP_ID); List<ComShopFlowerOrderDO> comShopFlowerOrderDOS = comShopFlowerOrderDAO.selectList(new LambdaQueryWrapper<ComShopFlowerOrderDO>().eq(ComShopFlowerOrderDO::getDeliveryId, id)); for (ComShopFlowerOrderDO comShopFlowerOrderDO : comShopFlowerOrderDOS) { Long userId = comShopFlowerOrderDO.getUserId(); R userOpenId = userService.getUserOpenId(userId); if (R.isOk(userOpenId)) { String openid = userOpenId.getData().toString(); try { WxUtil.sendService(openid,maService.getAccessToken(),comShopFlowerOrderDeliveryDO.getPointName()); } catch (WxErrorException e) { e.printStackTrace(); } } } } return R.ok(); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerOrderServiceImpl.java
@@ -1,26 +1,32 @@ package com.panzhihua.service_community.service.impl; import cn.binarywang.wx.miniapp.api.WxMaService; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.constants.Constants; import com.panzhihua.common.model.dtos.shop.*; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.convenient.ConvenientElevatingPointVO; import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; import com.panzhihua.common.model.vos.shop.*; import com.panzhihua.common.utlis.DateUtils; import com.panzhihua.common.utlis.OrderNoUtils; import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.common.utlis.WxPayUtils; import com.panzhihua.common.model.vos.user.SysUserVO; import com.panzhihua.common.service.user.UserService; import com.panzhihua.common.utlis.*; import com.panzhihua.common.utlis.wx.WXPayUtil; import com.panzhihua.service_community.dao.*; import com.panzhihua.service_community.model.dos.*; import com.panzhihua.service_community.service.ComShopFlowerOrderService; import com.panzhihua.service_community.util.WxMaConfiguration; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.error.WxErrorException; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -71,6 +77,10 @@ private ComShopFlowerRefundOrderDAO comShopFlowerRefundOrderDAO; @Resource private ComShopFlowerOrderDeliveryDAO comShopFlowerOrderDeliveryDAO; @Resource private WxMaConfiguration wxMaConfiguration; @Resource private UserService userService; @Value("${hcMin.app.isTest}") @@ -377,6 +387,24 @@ orderVo.setComShopFlowerEvaluateVO(comShopFlowerEvaluateVO); } } //判断是否可以退款 订单是否已超过15天 是否已有退款订单 int count = comShopFlowerRefundOrderDAO.selectCountRefundNowByOrderId(orderVo.getOrderId()); if (count > 0){ orderVo.setRefundable(2); }else { if (null == orderVo.getReceivingTime()){ orderVo.setRefundable(2); }else { //收货时间往前推15天和当前时间做比较 Date date = DateUtils.addDay(orderVo.getReceivingTime(), 15); if(date.before(new Date())){ orderVo.setRefundable(2); } } } }); } return R.ok(orderPageVOIPage); @@ -399,7 +427,7 @@ //查询自提点信息 ConvenientElevatingPointDO convenientElevatingPointDO = convenientElevatingPointDAO.selectOne(new LambdaQueryWrapper<ConvenientElevatingPointDO>().eq(ConvenientElevatingPointDO::getWechatAccount, phone)); if (isNull(convenientElevatingPointDO)) { return R.fail("自提点不存在"); return R.ok("订单不在该自提点"); } Long pointDOId = convenientElevatingPointDO.getId(); shopOrderDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ComShopFlowerOrderDO>().eq(ComShopFlowerOrderDO::getId, orderId).eq(ComShopFlowerOrderDO::getPointId, pointDOId)); @@ -451,7 +479,10 @@ orderGoodsVOS.add(orderGoodsVO); sbr.append(orderGoods.getGoodsName()).append(" "); }); orderVO.setGoodsAttrPic(orderGoodsDOList.get(0).getGoodsAttrPic()); orderVO.setGoodsAttrName(orderGoodsDOList.get(0).getGoodsAttrName()); } orderVO.setOrderGoodsVOList(orderGoodsVOS); orderVO.setGoodsName(sbr.toString()); @@ -693,6 +724,17 @@ if (inserted != 1) { log.error("订单发货日志保存错误"); } //发货通知 WxMaService maService = wxMaConfiguration.getMaService(Constants.HC_APP_ID); R userOpenId = userService.getUserOpenId(comShopOrderDO.getUserId()); if (R.isOk(userOpenId)) { String openid = userOpenId.getData().toString(); try { WxUtil.sendDeliverGoodsNotice(openid,maService.getAccessToken(),orderShipDTO.getLogisticsCompany(),orderShipDTO.getLogisticsNo(),comShopOrderDO.getOrderNo(), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm")); } catch (WxErrorException e) { e.printStackTrace(); } } return R.ok("发货成功"); } return R.fail("发货失败!"); @@ -833,6 +875,9 @@ List<ComShopFlowerOrderGoodsDO> orderGoodsList = comShopFlowerOrderGoodsDAO.selectList(new QueryWrapper<ComShopFlowerOrderGoodsDO>().lambda() .eq(ComShopFlowerOrderGoodsDO::getOrderNo, shopOrderDO.getOrderNo())); ConvenientMerchantDO storeDO = convenientMerchantDAO.selectById(shopOrderDO.getStoreId()); if (!orderGoodsList.isEmpty()) { int goodsNub = 0; for (ComShopFlowerOrderGoodsDO orderGood : orderGoodsList) { @@ -855,7 +900,6 @@ } // 更新店铺销量以及销售额 ConvenientMerchantDO storeDO = convenientMerchantDAO.selectById(shopOrderDO.getStoreId()); if (storeDO != null) { storeDO.setSale(storeDO.getSale() + goodsNub); storeDO.setSaleVolume(storeDO.getSaleVolume().add(shopOrderDO.getTotalAmount())); @@ -885,6 +929,21 @@ orderPayDO.setOrderId(shopOrderDO.getId()); orderPayDO.setPayType(ComShopFlowerOrderPayDO.payType.zf); comShopFlowerOrderPayDAO.insert(orderPayDO); if (nonNull(storeDO)){ WxMaService maService = wxMaConfiguration.getMaService(Constants.HC_APP_ID); R sysUserVOR = userService.getSysUserVOByPhone(storeDO.getMobilePhone()); if (R.isOk(sysUserVOR)) { SysUserVO sysUserVO = JSONObject.parseObject(JSONObject.toJSONString(sysUserVOR.getData()), SysUserVO.class); try { WxUtil.sendNewOrderNotice(sysUserVO.getOpenid(),maService.getAccessToken(),shopOrderDO.getOrderNo(), shopOrderDO.getDeliveryType()==1?"拼单订单":"快递订单",orderGoodsList.get(0).getGoodsName(), shopOrderDO.getTotalAmount().toString(),DateUtil.format(shopOrderDO.getCreateAt(),"yyyy-MM-dd HH:mm")); } catch (WxErrorException e) { e.printStackTrace(); } } } } /** @@ -951,8 +1010,8 @@ Map<String, Integer> retMap = new HashMap<>(); int amountTotal = 0; for (int i = 0; i < statusStr.length; i++) { if (collect.containsKey(i)) { Integer amount = collect.get(i); if (collect.containsKey(i+1)) { Integer amount = collect.get(i+1); amountTotal = amountTotal + amount; retMap.put(statusStr[i], amount); } else { @@ -990,8 +1049,8 @@ R r1 = this.selectCountByDeliveryType(ComShopFlowerOrderDO.deliveryType.express, userId); retMap.put("kdddStatus", r1.getData()); //营业额 List<ComShopOrderStoreIdCountVO> comShopOrderStoreIdCountVOS3 = this.baseMapper.selectSumAmountByStoreId(storeId); Map<String, Integer> yyeMap = comShopOrderStoreIdCountVOS3.stream().collect(Collectors.toMap(ComShopOrderStoreIdCountVO::getCountName, ComShopOrderStoreIdCountVO::getCountNum)); List<ComShopOrderStoreIdNumVO> comShopOrderStoreIdCountVOS3 = this.baseMapper.selectSumAmountByStoreId(storeId); Map<String, BigDecimal> yyeMap = comShopOrderStoreIdCountVOS3.stream().collect(Collectors.toMap(ComShopOrderStoreIdNumVO::getCountName, ComShopOrderStoreIdNumVO::getCountNum)); retMap.put("yye", yyeMap); //在售商品 Integer countSale = comShopFlowerGoodsDAO.selectCountSaleByStoreId(storeId); @@ -999,7 +1058,6 @@ //退款申请 Integer refundOrder = comShopFlowerRefundOrderDAO.selectCountByStoreId(storeId); retMap.put("refundOrder", refundOrder); return R.ok(retMap); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerRefundOrderServiceImpl.java
@@ -1,10 +1,14 @@ package com.panzhihua.service_community.service.impl; import cn.binarywang.wx.miniapp.api.WxMaService; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSONObject; 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.constants.Constants; import com.panzhihua.common.model.dtos.shop.ComShopFlowerRefundOrderDTO; import com.panzhihua.common.model.dtos.shop.ComShopOrderQueryDTO; import com.panzhihua.common.model.dtos.shop.PageComOrderRefundDTO; @@ -13,13 +17,18 @@ 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.model.vos.user.SysUserVO; import com.panzhihua.common.service.user.UserService; import com.panzhihua.common.utlis.OrderNoUtils; import com.panzhihua.common.utlis.WxPayUtils; import com.panzhihua.common.utlis.WxUtil; import com.panzhihua.common.utlis.wx.WXPayUtil; import com.panzhihua.service_community.dao.*; import com.panzhihua.service_community.model.dos.*; import com.panzhihua.service_community.service.ComShopFlowerRefundOrderService; import com.panzhihua.service_community.util.WxMaConfiguration; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.error.WxErrorException; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -62,11 +71,14 @@ private ComShopFlowerOrderGoodsDAO comShopFlowerOrderGoodsDAO; @Resource private ComShopFlowerGoodsDAO comShopFlowerGoodsDAO; @Resource private ComShopFlowerGoodsAttrDAO comShopFlowerGoodsAttrDAO; @Resource private ConvenientMerchantDAO convenientMerchantDAO; @Resource private WxMaConfiguration wxMaConfiguration; @Resource private UserService userService; @Override @@ -80,6 +92,18 @@ comShopFlowerRefundOrderDO.setStatus(ComShopFlowerRefundOrderDO.status.clz); comShopFlowerRefundOrderDO.setDeleteStatus(ComShopFlowerRefundOrderDO.deleteStatus.no); this.baseMapper.insert(comShopFlowerRefundOrderDO); //商家接受退款信息 ConvenientMerchantVO convenientMerchantVO = convenientMerchantDAO.selectMerchantById(comShopFlowerRefundOrderDTO.getStoreId()); WxMaService maService = wxMaConfiguration.getMaService(Constants.HC_APP_ID); R sysUserVOR = userService.getSysUserVOByPhone(convenientMerchantVO.getMobilePhone()); if (R.isOk(sysUserVOR)) { SysUserVO sysUserVO = JSONObject.parseObject(JSONObject.toJSONString(sysUserVOR.getData()), SysUserVO.class); try { WxUtil.sendNewRefundOrderNotice(sysUserVO.getOpenid(),maService.getAccessToken(),refundOrderNo,comShopFlowerRefundOrderDO.getRefundAmount().toString(),DateUtil.format(comShopFlowerRefundOrderDO.getRefundTime(),"yyyy-MM-dd HH:mm")); } catch (WxErrorException e) { e.printStackTrace(); } } return R.ok(); } @@ -101,7 +125,7 @@ orderGoodsVO.setNum(orderGoods.getAmount()); orderGoodsVO.setGoodsPic(orderGoods.getGoodsAttrPic()); orderGoodsVO.setPrice(orderGoods.getGoodsAttrPrice()); orderGoodsVO.setGoodsAttr(orderGoods.getGoodsAttrName()); orderGoodsVOS.add(orderGoodsVO); sbr.append(orderGoods.getGoodsName()).append(" "); }); @@ -128,7 +152,8 @@ if (Objects.isNull(comShopFlowerRefundOrderDO)) { return R.fail("不存在该退款订单"); } } ComShopFlowerOrderDO comShopFlowerOrderDO = comShopFlowerOrderDAO.selectById(comShopFlowerRefundOrderDO.getOrderId()); if (ComShopFlowerRefundOrderDO.handleResult.agree.equals(comShopFlowerRefundOrderDTO.getHandleResult())) { //处理退款事宜 comShopFlowerRefundOrderDO.setRefundTime(new Date()); @@ -137,7 +162,6 @@ //微信处理退款 try { String refundNo = WXPayUtil.generateNonceStr(); ComShopFlowerOrderDO comShopFlowerOrderDO = comShopFlowerOrderDAO.selectById(comShopFlowerRefundOrderDO.getOrderId()); String refundStr = WxPayUtils.refund(appid, mchId, comShopFlowerOrderDO.getOrderNo(), comShopFlowerRefundOrderDO.getPayAmount(), comShopFlowerRefundOrderDO.getPayAmount(), refundNo, isTest); log.info("退款请求接口返回参数:{}" , refundStr); @@ -167,13 +191,18 @@ //更新订单状态 comShopFlowerOrderDO.setStatus(ComShopFlowerOrderDO.status.ytk); comShopFlowerOrderDAO.updateById(comShopFlowerOrderDO); //退款成功发送消息 sendRefundNotice(comShopFlowerRefundOrderDO, comShopFlowerOrderDO,"同意退款"); }else { //退款失败 comShopFlowerRefundOrderDO.setStatus(ComShopFlowerRefundOrderDO.status.tksb); comShopFlowerRefundOrderDO.setRemark(comShopFlowerRefundOrderDO.getRemark() + "_"+return_msg); comShopFlowerRefundOrderDO.setRemark(comShopFlowerRefundOrderDO.getRemark() + "_退款失败"); // 添加订单支付记录表 orderPayDO.setPayStatus(ComShopFlowerOrderPayDO.payStatus.no); orderPayDO.setRefundStatus(ComShopFlowerOrderPayDO.refundStatus.tksb); //退款失败发送消息 sendRefundNotice(comShopFlowerRefundOrderDO, comShopFlowerOrderDO,"退款失败"); } comShopFlowerOrderPayDAO.insert(orderPayDO); } @@ -186,11 +215,26 @@ comShopFlowerRefundOrderDO.setHandleTime(new Date()); comShopFlowerRefundOrderDO.setStatus(ComShopFlowerRefundOrderDO.status.tksb); comShopFlowerRefundOrderDO.setHandleResult(ComShopFlowerRefundOrderDO.handleResult.refuse); //拒绝退款发送消息 sendRefundNotice(comShopFlowerRefundOrderDO, comShopFlowerOrderDO,"拒绝退款"); } this.baseMapper.updateById(comShopFlowerRefundOrderDO); return R.ok(); } private void sendRefundNotice(ComShopFlowerRefundOrderDO comShopFlowerRefundOrderDO, ComShopFlowerOrderDO comShopFlowerOrderDO,String msg) { WxMaService maService = wxMaConfiguration.getMaService(Constants.HC_APP_ID); R userOpenId = userService.getUserOpenId(comShopFlowerOrderDO.getUserId()); if (R.isOk(userOpenId)) { String openid = userOpenId.getData().toString(); try { WxUtil.sendRefundNotice(openid,maService.getAccessToken(),comShopFlowerRefundOrderDO.getRefundOrderNo(),comShopFlowerRefundOrderDO.getRefundAmount().toString(),msg); } catch (WxErrorException e) { e.printStackTrace(); } } } @Override public R selectCountGroupStatus(Long storeId){ String[] statusStr = {"clz","tkcg","tksb","yqx","tkz"}; springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComShopFlowerEvaluateDAO.xml
@@ -44,6 +44,8 @@ <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 </select> <select id="selectCountByGoodsId" resultType="java.lang.Integer"> SELECT count(1) FROM com_shop_flower_evaluate e WHERE e.goods_id = #{goodsId} </select> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComShopFlowerOrderDAO.xml
@@ -44,8 +44,8 @@ <select id="pageOrderList" resultType="com.panzhihua.common.model.vos.shop.ComShopFlowerOrderPageVO"> 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 cso.delete_status = 1 orderTotal,pay_amount,delivery_type,remark,create_at, logistics_company, logistics_no,receiving_time from com_shop_flower_order as cso where cso.delete_status = 1 and cso.`status` != 0 <if test="comOrderListDTO.userId != null"> and cso.user_id = #{comOrderListDTO.userId} </if> @@ -82,7 +82,7 @@ LEFT JOIN com_shop_flower_user_address uad ON sr.receiver_id = uad.id LEFT JOIN com_convenient_merchants ss ON sr.store_id = ss.id LEFT JOIN com_convenient_elevating_point ccep on ccep.id = sr.point_id WHERE sr.delete_status = 1 WHERE sr.delete_status = 1 and sr.`status` != 0 <if test='pageComShopOrderSearchDTO.userId != null'> AND sr.user_id = #{pageComShopOrderSearchDTO.userId} </if> @@ -166,7 +166,7 @@ com_shop_flower_order o LEFT JOIN com_shop_flower_order_goods g ON o.id = g.order_id LEFT JOIN com_shop_flower_user_address a ON a.id = o.receiver_id WHERE 1=1 WHERE 1=1 and o.`status` != 0 <if test="comOrderListDTO.deliveryType != null"> and o.delivery_type = #{comOrderListDTO.deliveryType} </if> @@ -176,6 +176,10 @@ <if test="comOrderListDTO.deliveryId != null"> and o.delivery_id = #{comOrderListDTO.deliveryId} </if> <if test="comOrderListDTO.status != null"> and o.status = #{comOrderListDTO.status} </if> order by o.create_at desc </select> <select id="pageOrderByDeliveryNo" resultType="com.panzhihua.common.model.vos.shop.ComShopFlowerOrderStoreListVO"> @@ -201,23 +205,23 @@ com_shop_flower_order o LEFT JOIN com_shop_flower_order_goods g ON o.id = g.order_id LEFT JOIN com_shop_flower_user_address a ON a.id = o.receiver_id WHERE 1=1 and o.delivery_type = 1 WHERE 1=1 and o.delivery_type = 1 and o.`status` != 0 <if test="comOrderListDTO.storeId != null"> and o.store_id = #{comOrderListDTO.storeId} </if> <if test="comOrderListDTO.deliveryId != null"> and o.delivery_id = #{comOrderListDTO.deliveryId} </if> order by o.create_at desc </select> <select id="selectCountByDeliveryType" resultType="com.panzhihua.common.model.vos.shop.ComShopOrderCountVO"> SELECT count(1) amount , `status` FROM com_shop_flower_order WHERE delivery_type = #{deliveryType} and store_id = #{storeId} GROUP BY `status` SELECT count(1) amount , `status` FROM com_shop_flower_order WHERE delivery_type = #{deliveryType} and store_id = #{storeId} and `status` != 0 GROUP BY `status` </select> <select id="selectCountByStoreId" resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdCountVO"> SELECT count(1) as count_num,'dayCount' as count_name FROM com_shop_flower_order WHERE TO_DAYS(create_at)=TO_DAYS(NOW()) SELECT count(1) as count_num,'dayCount' as count_name FROM com_shop_flower_order WHERE TO_DAYS(create_at)=TO_DAYS(NOW()) and `status` != 0 <if test="storeId != null"> and store_id = #{storeId} </if> @@ -225,7 +229,7 @@ and delivery_type = #{deliveryType} </if> union all SELECT count(1) as count_num,'monthCount' as count_name FROM com_shop_flower_order WHERE DATE_FORMAT(create_at,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m') SELECT count(1) as count_num,'monthCount' as count_name FROM com_shop_flower_order WHERE DATE_FORMAT(create_at,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m') and `status` != 0 <if test="storeId != null"> and store_id = #{storeId} </if> @@ -233,7 +237,7 @@ and delivery_type = #{deliveryType} </if> union all SELECT count(1) as count_num,'yearCount' as count_name FROM com_shop_flower_order where YEAR(create_at) =YEAR(NOW()) SELECT count(1) as count_num,'yearCount' as count_name FROM com_shop_flower_order where YEAR(create_at) =YEAR(NOW()) and `status` != 0 <if test="storeId != null"> and store_id = #{storeId} </if> @@ -241,8 +245,8 @@ and delivery_type = #{deliveryType} </if> union all SELECT count(1) as count_num,'allCount' as count_name FROM com_shop_flower_order WHERE 1=1 <if test="storeId != null"> SELECT count(1) as count_num,'allCount' as count_name FROM com_shop_flower_order WHERE `status` != 0 <if test="storeId != null"> and store_id = #{storeId} </if> <if test="deliveryType != null"> @@ -250,24 +254,24 @@ </if> </select> <select id="selectSumAmountByStoreId" resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdCountVO"> SELECT IFNULL(sum(pay_amount),0) as count_num,'dayAmount' as count_name FROM com_shop_flower_order WHERE TO_DAYS(create_at)=TO_DAYS(NOW()) and `status` not in (6,7) <if test="storeId != null"> resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdNumVO"> SELECT IFNULL(sum(pay_amount),0) as count_num,'dayAmount' as count_name FROM com_shop_flower_order WHERE TO_DAYS(create_at)=TO_DAYS(NOW()) and `status` not in (6,7) and `status` != 0 <if test="storeId != null"> and store_id = #{storeId} </if> union all SELECT IFNULL(sum(pay_amount),0) as count_num,'monthAmount' as count_name FROM com_shop_flower_order WHERE DATE_FORMAT(create_at,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m') and `status` not in (6,7) <if test="storeId != null"> SELECT IFNULL(sum(pay_amount),0) as count_num,'monthAmount' as count_name FROM com_shop_flower_order WHERE DATE_FORMAT(create_at,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m') and `status` not in (6,7) and `status` != 0 <if test="storeId != null"> and store_id = #{storeId} </if> union all SELECT IFNULL(sum(pay_amount),0) as count_num,'yearAmount' as count_name FROM com_shop_flower_order where YEAR(create_at) =YEAR(NOW()) and `status` not in (6,7) <if test="storeId != null"> SELECT IFNULL(sum(pay_amount),0) as count_num,'yearAmount' as count_name FROM com_shop_flower_order where YEAR(create_at) =YEAR(NOW()) and `status` not in (6,7) and `status` != 0 <if test="storeId != null"> and store_id = #{storeId} </if> union all SELECT IFNULL(sum(pay_amount),0) as count_num,'allAmount' as count_name FROM com_shop_flower_order WHERE `status` not in (6,7) <if test="storeId != null"> SELECT IFNULL(sum(pay_amount),0) as count_num,'allAmount' as count_name FROM com_shop_flower_order WHERE `status` not in (6,7) and `status` != 0 <if test="storeId != null"> and store_id = #{storeId} </if> </select> @@ -279,17 +283,17 @@ </select> <select id="selectSumOrderAndAmountByStoreId" resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdNumVO"> SELECT count(1) count_num ,'pddd' as count_name FROM `com_shop_flower_order` WHERE delivery_type =1 and delete_status = 1 and pay_status = 2 and store_id = #{storeId} SELECT count(1) count_num ,'pddd' as count_name FROM `com_shop_flower_order` WHERE delivery_type =1 and delete_status = 1 and pay_status = 2 and store_id = #{storeId} and `status` != 0 union all SELECT count(1) count_num ,'kddd' as count_name FROM `com_shop_flower_order` WHERE delivery_type =2 and delete_status = 1 and pay_status = 2 and store_id = #{storeId} SELECT count(1) count_num ,'kddd' as count_name FROM `com_shop_flower_order` WHERE delivery_type =2 and delete_status = 1 and pay_status = 2 and store_id = #{storeId} and `status` != 0 union all SELECT count(1) count_num ,'tkdd' as count_name FROM `com_shop_flower_order` WHERE delete_status = 1 and pay_status = 2 and `status` in (6,7) and store_id = #{storeId} SELECT count(1) count_num ,'tkdd' as count_name FROM `com_shop_flower_order` WHERE delete_status = 1 and pay_status = 2 and `status` in (6,7) and store_id = #{storeId} and `status` != 0 union all SELECT IFNULL(sum(pay_amount),0) count_num ,'yysr' as count_name FROM `com_shop_flower_order` WHERE `status` not in (6,7) and store_id = #{storeId} SELECT IFNULL(sum(pay_amount),0) count_num ,'yysr' as count_name FROM `com_shop_flower_order` WHERE `status` not in (6,7) and store_id = #{storeId} and `status` != 0 union all SELECT IFNULL(sum(pay_amount),0) count_num ,'tkje' as count_name FROM `com_shop_flower_order` WHERE `status` in (6,7) and store_id = #{storeId} SELECT IFNULL(sum(pay_amount),0) count_num ,'tkje' as count_name FROM `com_shop_flower_order` WHERE `status` in (6,7) and store_id = #{storeId} and `status` != 0 union all SELECT IFNULL(sum(pay_amount),0) count_num ,'ktxje' as count_name FROM `com_shop_flower_order` WHERE `status` in (4,5) and create_at <= date_sub(now(), INTERVAL 15 DAY) and store_id = #{storeId} SELECT IFNULL(sum(pay_amount),0) count_num ,'ktxje' as count_name FROM `com_shop_flower_order` WHERE `status` in (4,5) and create_at <= date_sub(now(), INTERVAL 15 DAY) and store_id = #{storeId} and `status` != 0 </select> @@ -297,25 +301,25 @@ resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdCountVO"> SELECT count(1) count_num, date_format(create_at,'%Y-%m-%d') as count_name FROM com_shop_flower_order WHERE date_format(create_at,'%Y-%m-%d') >= date_format(date_sub(now(), INTERVAL #{days} DAY),'%Y-%m-%d') and store_id = #{storeId} and store_id = #{storeId} and `status` != 0 GROUP BY count_name </select> <select id="selectCountOrderMonthByStoreId" resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdCountVO"> SELECT count(1) count_num, date_format(create_at,'%Y-%m') as count_name FROM com_shop_flower_order WHERE date_format(create_at,'%Y-%m') >= date_format(now(),'%Y-01') and store_id = #{storeId} GROUP BY count_name WHERE date_format(create_at,'%Y-%m') >= date_format(now(),'%Y-01') and store_id = #{storeId} and `status` != 0 GROUP BY count_name </select> <select id="selectOrderSumPayDayByStoreId" resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdNumVO"> SELECT IFNULL(sum(pay_amount),0) count_num, date_format(create_at,'%Y-%m-%d') as count_name FROM com_shop_flower_order WHERE date_format(create_at,'%Y-%m-%d') >= date_format(date_sub(now(), INTERVAL #{days} DAY),'%Y-%m-%d') and store_id = #{storeId} and `status` not in (6,7) and store_id = #{storeId} and `status` not in (6,7) and `status` != 0 GROUP BY count_name </select> <select id="selectOrderSumMonthByStoreId" resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdNumVO"> SELECT IFNULL(sum(pay_amount),0) count_num, date_format(create_at,'%Y-%m') as count_name FROM com_shop_flower_order WHERE date_format(create_at,'%Y-%m') >= date_format(now(),'%Y-01') and store_id = #{storeId} and `status` not in (6,7) GROUP BY count_name WHERE date_format(create_at,'%Y-%m') >= date_format(now(),'%Y-01') and store_id = #{storeId} and `status` not in (6,7) and `status` != 0 GROUP BY count_name </select> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComShopFlowerOrderGoodsDAO.xml
@@ -28,6 +28,6 @@ goods_name, create_at </sql> <select id="selectSumAmount" resultType="java.lang.Integer"> SELECT sum(amount) FROM `com_shop_flower_order_goods` WHERE store_id = #{storeId} SELECT sum(g.amount) FROM `com_shop_flower_order_goods` g LEFT JOIN com_shop_flower_order o ON o.id = g.order_id WHERE g.store_id = #{storeId} and o.`status` != 0 </select> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComShopFlowerRefundOrderDAO.xml
@@ -44,6 +44,7 @@ <if test="pageComOrderRefundDTO.backstageUserId != null"> and cm.user_id = #{pageComOrderRefundDTO.backstageUserId} </if> order by ro.create_at desc </select> <select id="selectCountByStoreId" resultType="java.lang.Integer"> select count(1) from com_shop_flower_refund_order where 1=1 @@ -63,4 +64,7 @@ <update id="updateCancel"> update com_shop_flower_refund_order set `status` = #{status},cancel_time = NOW() where id = #{id} </update> <select id="selectCountRefundNowByOrderId" resultType="int"> SELECT count(1) FROM com_shop_flower_refund_order WHERE order_id = #{orderId} and `status` in (9,10,13) and delete_status = 1 </select> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java
@@ -383,6 +383,8 @@ List<StreetVOS> selectStreetByAreaCode(Integer code); List<StreetVOStr> selectStreetByAreaCodeStr(Integer code); List<StreetVO> selectStreetsByAreaCode(Integer code); ComActAcidCheckRecordVO selectComActAcidCheckRecordById(Long id); springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -886,6 +886,14 @@ if (sysUserDO.getBindingCheckUnitId() != null) { loginUserInfoVO.setBackstageType(4); } //判断是否是商家账号 Long storeId = userDao.selectStoreIdIdByUserId(sysUserDO.getUserId()); if (null != storeId){ loginUserInfoVO.setBackstageUserId(sysUserDO.getUserId()); loginUserInfoVO.setBackstageType(5); loginUserInfoVO.setStoreIdId(storeId); } return R.ok(loginUserInfoVO); } @@ -3768,16 +3776,16 @@ @Override public R getAllCommunityList() { List<Integer> areaList = areaCodeList(); List<AreaVOS> areaVOList = new ArrayList<>(); List<AreaVOStr> areaVOList = new ArrayList<>(); for (Integer code : areaList) { AreaVOS areaVO = new AreaVOS(); areaVO.setId(code); AreaVOStr areaVO = new AreaVOStr(); areaVO.setId(code+""); areaVO.setName(areaCodeToName(code.longValue())); List<StreetVOS> streetVOS = userDao.selectStreetByAreaCode(code); Iterator<StreetVOS> iterator = streetVOS.listIterator(); List<StreetVOStr> streetVOS = userDao.selectStreetByAreaCodeStr(code); Iterator<StreetVOStr> iterator = streetVOS.listIterator(); while (iterator.hasNext()) { StreetVOS vo = iterator.next(); List<CommunityVO> communityVOS = userDao.selectCommunityByStreetId(vo.getId(), 3); StreetVOStr vo = iterator.next(); List<CommunityVO> communityVOS = userDao.selectCommunityByStreetId(Long.parseLong(vo.getId()), 3); vo.setChildList(communityVOS); } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysUserDOMapper.xml
@@ -117,5 +117,8 @@ <select id="selectStoreIdIdByUserId" resultType="java.lang.Long"> select id from com_convenient_merchants where user_id = #{userId} and is_del = 0 </select> <select id="selectStreetByAreaCodeStr" resultType="com.panzhihua.common.model.vos.user.StreetVOStr"> select street_id as id,name as name from com_street where area_code=#{code} and app_id ='wx118de8a734d269f0' </select> </mapper>