Просмотр исходного кода

Accept Merge Request #46: (new-branch -> dev-minio)

Merge Request: 合并

Created By: @刘子麟
Accepted By: @刘子麟
URL: https://chuanghaikeji.coding.net/p/moxuanyunshangwaimai/d/backend/git/merge/46
刘子麟 1 год назад
Родитель
Сommit
db8afa9b81

+ 3 - 0
db/update_241024.sql

@@ -0,0 +1,3 @@
+ALTER TABLE goods_shop ADD message_configuration int COMMENT '消息配置  0开启  1关闭';
+
+UPDATE goods_shop SET message_configuration= 0;

+ 4 - 0
src/main/java/com/sqx/modules/app/entity/UserMoneyDetails.java

@@ -146,4 +146,8 @@ public class UserMoneyDetails implements Serializable {
     private BigDecimal orderAmount;
 
 
+//    配送类型 订单类型拓展 1上门 2骑手配送 3商家配送;
+    @TableField(exist = false)
+    private Integer orderTypeExtra;
+
 }

+ 2 - 1
src/main/java/com/sqx/modules/app/service/impl/UserMoneyDetailsServiceImpl.java

@@ -150,7 +150,7 @@ public class UserMoneyDetailsServiceImpl extends ServiceImpl<UserMoneyDetailsDao
         Double smsMoney = Double.valueOf(value);
 
 //        计算每个订单所发送短信金额
-        LambdaQueryWrapper<TbIndentSmsSendLog> wrapper=new LambdaQueryWrapper<>();
+
         for (int i = 0; i < userMoneyDetailsList.size(); i++) {
             UserMoneyDetails userMoneyDetails = userMoneyDetailsList.get(i);
             BigDecimal couponMoney = userMoneyDetails.getCouponMoney();
@@ -170,6 +170,7 @@ public class UserMoneyDetailsServiceImpl extends ServiceImpl<UserMoneyDetailsDao
             wrapperTBI.eq(TbIndent::getOrderId,userMoneyDetails.getOrderId());
             TbIndent tbIndent = tbIndentService.getOne(wrapperTBI);
             if (ObjectUtils.isNotEmpty(tbIndent)) {
+                LambdaQueryWrapper<TbIndentSmsSendLog> wrapper=new LambdaQueryWrapper<>();
                 wrapper.eq(TbIndentSmsSendLog::getSuccessFlag,"1");
                 wrapper.eq(TbIndentSmsSendLog::getOrderId,tbIndent.getIndentId());
                 List<TbIndentSmsSendLog> list = smsSendLogService.list(wrapper);

+ 25 - 0
src/main/java/com/sqx/modules/datacentre/controller/app/AppRiderBankCardInfoController.java

@@ -0,0 +1,25 @@
+package com.sqx.modules.datacentre.controller.app;
+
+import com.sqx.common.utils.Result;
+import com.sqx.modules.datacentre.service.RiderBankCardInfoService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Api(tags={"骑手银行卡信息"})
+@RestController
+@RequestMapping("/app/rider/bank")
+public class AppRiderBankCardInfoController {
+
+    @Autowired
+    private RiderBankCardInfoService riderBankCardInfoService;
+
+    @ApiOperation("查询单个骑手银行卡信息")
+    @GetMapping("/getUserId")
+    public Result getUserIdCardInfo(Long userId) {
+        return riderBankCardInfoService.getUserIdCardInfo(userId);
+    }
+}

+ 13 - 0
src/main/java/com/sqx/modules/goods/controller/app/AppGoodsController.java

@@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.app.annotation.Login;
 import com.sqx.modules.goods.dto.ShopQueryDTO;
+import com.sqx.modules.goods.entity.GoodsShop;
 import com.sqx.modules.goods.service.GoodsService;
 import com.sqx.modules.goods.service.GoodsShopService;
 import com.sqx.modules.shop.service.SearchHistoryService;
@@ -101,6 +102,18 @@ public class AppGoodsController {
         return goodsService.selectSupplierShop(queryDTO);
     }
 
+    @ApiOperation("根据商铺id查看消息订阅")
+    @GetMapping(value = "/selectGoodShop")
+    public Result selectGoodShop(Long shopId){
 
+        return goodsService.selectGoodShop(shopId);
+    }
+
+    @ApiOperation("修改消息订阅")
+    @PostMapping(value = "/updateGoodShop")
+    public Result updateGoodShop(@RequestBody GoodsShop goodsShop){
+
+        return goodsService.updateGoodShop(goodsShop);
+    }
 
 }

+ 3 - 0
src/main/java/com/sqx/modules/goods/entity/GoodsShop.java

@@ -258,4 +258,7 @@ public class GoodsShop implements Serializable {
 
     @ApiModelProperty("是否供应商 0是  1不是")
     private Integer isSupplier;
+
+    @ApiModelProperty("消息配置  0开启  1关闭")
+    private Integer messageConfiguration;
 }

+ 5 - 0
src/main/java/com/sqx/modules/goods/service/GoodsService.java

@@ -6,6 +6,7 @@ import com.sqx.common.utils.Result;
 import com.sqx.modules.goods.dto.ShopQueryDTO;
 import com.sqx.modules.goods.entity.Goods;
 import com.sqx.modules.goods.entity.GoodsAttr;
+import com.sqx.modules.goods.entity.GoodsShop;
 
 import java.util.List;
 
@@ -64,4 +65,8 @@ public interface GoodsService extends IService<Goods> {
     List<Long> getByAllGoodsIdByShopId(Long shopId);
 
     Result selectSupplierShop(ShopQueryDTO queryDTO);
+
+    Result selectGoodShop(Long shopId);
+
+    Result updateGoodShop(GoodsShop goodsShop);
 }

+ 25 - 0
src/main/java/com/sqx/modules/goods/service/impl/GoodsServiceImpl.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.sqx.common.exception.SqxException;
@@ -811,4 +812,28 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsDao, Goods> implements Go
         return Result.success().put("data", pageUtils);
     }
 
+    @Override
+    public Result selectGoodShop(Long shopId) {
+        GoodsShop goodsShop = goodsShopDao.selectById(shopId);
+
+        return Result.success().put("data",goodsShop);
+    }
+
+    @Override
+    public Result updateGoodShop(GoodsShop goodsShop) {
+        Long shopId = goodsShop.getShopId();
+        Integer messageConfiguration = goodsShop.getMessageConfiguration();
+
+        GoodsShop goodsShop1 = goodsShopDao.selectById(shopId);
+        if (ObjectUtils.isEmpty(goodsShop1)) {
+            return Result.error("不存在该店铺");
+        }
+
+        goodsShop1.setMessageConfiguration(messageConfiguration);
+
+        goodsShopDao.updateById(goodsShop1);
+
+        return Result.success();
+    }
+
 }

+ 4 - 1
src/main/java/com/sqx/modules/goods/service/impl/GoodsShopServiceImpl.java

@@ -146,7 +146,8 @@ public class GoodsShopServiceImpl extends ServiceImpl<GoodsShopDao, GoodsShop> i
         }
         //        默认不是供应商
         goodsShop.setIsSupplier(1);
-
+//        默认开启消息配置
+        goodsShop.setMessageConfiguration(0);
 
         baseMapper.insert(goodsShop);
         UserEntity userEntity1 = userService.selectUserById(goodsShop.getUserId());
@@ -470,6 +471,8 @@ public class GoodsShopServiceImpl extends ServiceImpl<GoodsShopDao, GoodsShop> i
         BeanUtils.copyProperties(goodsShopVo, shop);
 //        默认不是供应商
         shop.setIsSupplier(1);
+//        默认开启消息配置
+        shop.setMessageConfiguration(0);
         baseMapper.insert(shop);
         CommonInfo name = commonInfoService.findOne(12);
         Msg byPhone = msgDao.findByPhone(goodsShopVo.getPhone());

+ 6 - 0
src/main/java/com/sqx/modules/order/controller/OrderController.java

@@ -115,4 +115,10 @@ public class OrderController extends AbstractController {
         return Result.success().put("data", appOrderService.getEvaluateList(evaluate, page, limit));
     }
 
+    @ApiOperation("店铺总交易金额")
+    @GetMapping(value = "selectAllOrderTotalPrice")
+    public Result selectAllOrderTotalPrice(OrderQueryDto queryDto) {
+        return appOrderService.selectAllOrderTotalPrice(queryDto);
+    }
+
 }

+ 4 - 0
src/main/java/com/sqx/modules/order/dao/AppOrderDao.java

@@ -98,4 +98,8 @@ public interface AppOrderDao extends BaseMapper<TbOrder> {
     int countUnFinishByShopId(@Param("shopId") Long shopId);
 
     int countCurDayPayByShopId(@Param("shopId") Long shopId, @Param("payTime") String payTime);
+
+    IPage<TbOrder> selectOrderPage(Page<TbOrder> pages,@Param("userId") Long userId,@Param("orderId") Integer orderId);
+
+    BigDecimal selectAllOrderTotalPrice(@Param("query") OrderQueryDto queryDto);
 }

+ 3 - 0
src/main/java/com/sqx/modules/order/service/AppOrderService.java

@@ -172,4 +172,7 @@ public interface AppOrderService extends IService<TbOrder> {
     Result selectOrder(Long userId, Integer orderId,Integer page, Integer limit);
 
     Result updateTimeOutOrder(Long userId, Integer orderId);
+
+    Result selectAllOrderTotalPrice(OrderQueryDto queryDto);
+
 }

+ 8 - 4
src/main/java/com/sqx/modules/order/service/impl/AppAppOrderServiceImpl.java

@@ -2545,10 +2545,7 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
     public Result selectOrder(Long userId, Integer orderId,Integer page, Integer limit) {
         HashMap hashMap = new HashMap();
         Page<TbOrder> pages = new Page(page, limit);
-        LambdaQueryWrapper<TbOrder> wrapper=new LambdaQueryWrapper<>();
-        wrapper.eq(TbOrder::getOrderId,orderId)
-                .eq(TbOrder::getUserId,userId);
-        IPage<TbOrder> tbOrderList = baseMapper.selectPage(pages, wrapper);
+        IPage<TbOrder> tbOrderList = baseMapper.selectOrderPage(pages, userId,orderId);
         BigDecimal money = new BigDecimal(0);
         ArrayList list = new ArrayList();
         for (int i = 0; i < tbOrderList.getRecords().size(); i++) {
@@ -2593,6 +2590,13 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
 
     }
 
+    @Override
+    public Result selectAllOrderTotalPrice(OrderQueryDto queryDto) {
+        BigDecimal totalPrice = appOrderDao.selectAllOrderTotalPrice(queryDto);
+
+        return Result.success().put("data", totalPrice);
+    }
+
     /**
      * 获取当前店铺当前订单在已支付订单中的序号
      * @param order 订单信息

+ 6 - 0
src/main/java/com/sqx/modules/pay/entity/CashOut.java

@@ -117,6 +117,12 @@ public class CashOut implements Serializable {
     @ApiModelProperty(name = "银行卡开户行")
     private String openBank ;
 
+    /**
+     * 用户手机号
+     */
+    private String phone;
+
+
     @TableField(exist = false)
     private String userName;
 

+ 5 - 0
src/main/java/com/sqx/modules/pay/vo/CashOutVO.java

@@ -20,4 +20,9 @@ public class CashOutVO extends CashOut {
      */
     private String stationName;
 
+    /**
+     * 用户手机号
+     */
+    private String phoneNumber;
+
 }

+ 83 - 3
src/main/resources/mapper/order/OrderMapper.xml

@@ -395,13 +395,12 @@
             and tor.status = #{status}
         </if>
         <if test="status!=null and status==5">
-            and tor.status in (5, 8)
+            and tor.status =8
         </if>
         <if test="status==null">
-            and tor.status in (0, 7, 6, 3, 4, 5, 8)
+            and tor.status in (0, 7, 6, 3, 4, 8)
         </if>
         order by tor.pay_time desc, tor.create_time desc
-
     </select>
 
 
@@ -603,5 +602,86 @@
           and shop_id = #{shopId}
           and date(pay_time) = date(#{payTime})
     </select>
+    <select id="selectOrderPage" resultType="com.sqx.modules.order.entity.TbOrder">
+        select tor.*, gs.shop_name as shopName, gs.detailed_address as detailedAddress, gs.shop_lng as shopLng,
+        gs.shop_lat as shopLat, gs.phone as shopPhone,
+        gs.errand_money as errandMoney, gs.exempt_min_money as exemptMinMoney, gs.minimum_delivery as minimumDelivery,
+        gs.distribution_distance as distributionDistance
+        from tb_order tor left join goods_shop gs on tor.shop_id = gs.shop_id
+        where tor.user_id = #{userId}
+            and tor.order_id = #{orderId}
+
+    </select>
+    <select id="selectAllOrderTotalPrice" resultType="java.math.BigDecimal">
+        select SUM(tor.pay_money) as totalPrice
+        from tb_order tor
+        left join tb_user tu on tor.user_id = tu.user_id
+        left join goods_shop gs on tor.shop_id = gs.shop_id
+        left join tb_indent ti on tor.order_id = ti.order_id
+        left join tb_user tiu on tiu.user_id = ti.rider_user_id
+        left join tb_coupon_user tcu on tor.coupon_id = tcu.id
+        left join activity_part_record apr on apr.order_id = tor.order_id
+        left join activity ai on ai.id = apr.activity_id
+        left join goods_shop gs2 on gs2.shop_id=tcu.shop_id
+        where 1 = 1
+        <if test="query.riderPhone!=null and query.riderPhone!=''">
+            and tiu.phone =#{query.riderPhone}
+        </if>
+        <if test="query.shopName!=null and query.shopName!=''">
+            and gs.shop_name like concat('%',#{query.shopName},'%')
+        </if>
+        <if test="query.userName!=null and query.userName!=''">
+            and tor.user_name like concat('%',#{query.userName},'%')
+        </if>
+        <if test="query.phone!=null and query.phone!=''">
+            and tor.phone like concat('%',#{query.phone},'%')
+        </if>
+        <if test="query.orderNumber!=null and query.orderNumber!=''">
+            and tor.order_number = #{query.orderNumber}
+        </if>
+        <if test="query.status!=null and query.status!=-1 and query.status!=1">
+            and tor.status = #{query.status}
+        </if>
+        <if test="query.status!=null and query.status==1">
+            and tor.status in (1,2)
+        </if>
+        <if test="query.shopId!=null">
+            and tor.shop_id = #{query.shopId}
+        </if>
+        <if test="query.orderType!=null">
+            and tor.order_type_extra = #{query.orderType}
+        </if>
+        <if test="query.indentStatus != null and query.indentStatus != ''">
+            and ti.indent_state = #{query.indentStatus}
+        </if>
+        <if test="query.reservationFlag != null and query.reservationFlag !=''">
+            and tor.reservation_flag = #{query.reservationFlag}
+        </if>
+        <if test="query.startTime!=null and query.startTime!=''">
+            and date_format(tor.create_time,'%Y-%m-%d') >= date_format(#{query.startTime},'%Y-%m-%d')
+        </if>
+        <if test="query.endTime!=null and query.endTime!='' ">
+            and date_format(tor.create_time,'%Y-%m-%d') &lt;= date_format(#{query.endTime},'%Y-%m-%d')
+        </if>
+        <if test="query.payStartTime != null and query.payStartTime != ''">
+            and date_format(tor.pay_time,'%Y-%m-%d') >= date_format(#{query.payStartTime},'%Y-%m-%d')
+        </if>
+        <if test="query.payEndTime != null and query.payEndTime != '' ">
+            and date_format(tor.pay_time,'%Y-%m-%d') &lt;= date_format(#{query.payEndTime},'%Y-%m-%d')
+        </if>
+        <if test="query.riderStationId!=null and query.riderStationId!=''">
+            and tiu.rider_station_id=#{query.riderStationId}
+        </if>
+        <if test="query.shopTypeId!=null and query.shopTypeId!=''">
+            and gs.shop_type_id=#{query.shopTypeId}
+        </if>
+        <if test='query.couponType== "0" '>
+            and tcu.shop_id =0
+        </if>
+        <if test='query.couponType== "1"'>
+            and tcu.shop_id !=0
+        </if>
+        order by tor.pay_time desc, tor.create_time desc
+    </select>
 
 </mapper>

+ 1 - 1
src/main/resources/mapper/pay/CashDao.xml

@@ -298,7 +298,7 @@
     </sql>
 
     <select id="selectCashOutList" resultType="com.sqx.modules.pay.vo.CashOutVO">
-        select gh.shop_name, co.*,rs.station_name as stationName,tu.user_name as userName
+        select gh.shop_name, co.*,rs.station_name as stationName,tu.user_name as userName,tu.phone as phoneNumber
         from cash_out co
         left join goods_shop gh on gh.shop_id = co.shop_id
         left join tb_user tu on tu.user_id=co.user_id

+ 2 - 1
src/main/resources/mapper/userMoney/UserMoneyDetailsMapper.xml

@@ -123,7 +123,8 @@
         apr.discount_amount as activityDiscountAmount,
         tbo.errand_money as errandMoney,
         tbo.pay_money as payMoney,
-        tbo.order_id as orderId
+        tbo.order_id as orderId,
+        tbo.order_type_extra as orderTypeExtra
         FROM
         (
         SELECT