Преглед на файлове

Merge branch 'dev-feat' of https://e.coding.net/chuanghaikeji/moxuanyunshangwaimai/backend into dev-wxl

wanxl преди 1 година
родител
ревизия
f752826fb0

+ 14 - 0
src/main/java/com/sqx/modules/app/dao/RechargeRecordDao.java

@@ -0,0 +1,14 @@
+package com.sqx.modules.app.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.app.entity.RechargeRecord;
+import com.sqx.modules.app.entity.UserMoney;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.math.BigDecimal;
+
+@Mapper
+public interface RechargeRecordDao extends BaseMapper<RechargeRecord> {
+
+}

+ 117 - 0
src/main/java/com/sqx/modules/app/entity/RechargeRecord.java

@@ -0,0 +1,117 @@
+package com.sqx.modules.app.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+@TableName("recharge_record")
+@ApiModel("充值记录")
+public class RechargeRecord implements Serializable {
+    /**
+     * 主键id
+     */
+    @ApiModelProperty("主键id")
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 用户id
+     */
+    @ApiModelProperty("用户id")
+    @TableField("user_id")
+    private Long userId;
+
+    /**
+     * 编号
+     */
+    @ApiModelProperty("编号")
+    @TableField("order_no")
+    private String orderNo;
+
+    /**
+     * 充值金额
+     */
+    @ApiModelProperty("充值金额")
+    @TableField("amount")
+    private String amount;
+
+    /**
+     * 充值前余额
+     */
+    @ApiModelProperty("充值前余额")
+    @TableField("old_money")
+    private BigDecimal oldMoney;
+
+    /**
+     * 充值后余额
+     */
+    @ApiModelProperty("充值后余额")
+    @TableField("balance")
+    private BigDecimal balance;
+
+    /**
+     * 被充值账号
+     */
+    @ApiModelProperty("被充值账号")
+    @TableField("user_phone")
+    private String userPhone;
+
+    /**
+     * 被充值名称
+     */
+    @ApiModelProperty("被充值名称")
+    @TableField("user_name")
+    private String userName;
+
+    /**
+     * 被充值昵称
+     */
+    @ApiModelProperty("被充值昵称")
+    @TableField("user_nick")
+    private String userNick;
+
+    /**
+     * 被充值头像
+     */
+    @ApiModelProperty("被充值头像")
+    @TableField("user_avatar")
+    private String userAvatar;
+
+    /**
+     * 充值时间
+     */
+    @ApiModelProperty("充值时间")
+    @TableField("create_time")
+    private String createTime;
+
+    /**
+     * 更新时间
+     */
+    @ApiModelProperty("更新时间")
+    @TableField("update_time")
+    private String updateTime;
+
+    /**
+     * 充值人账号
+     */
+    @ApiModelProperty("充值人账号")
+    @TableField("account")
+    private String account;
+
+    /**
+     * 备注
+     */
+    @ApiModelProperty("备注")
+    @TableField("remark")
+    private String remark;
+
+
+}

+ 17 - 0
src/main/java/com/sqx/modules/app/service/RechargeRecordService.java

@@ -0,0 +1,17 @@
+package com.sqx.modules.app.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.common.utils.Result;
+import com.sqx.modules.app.entity.RechargeRecord;
+import com.sqx.modules.printInfo.entity.PrintInfo;
+
+
+public interface RechargeRecordService extends IService<RechargeRecord> {
+    Result insertRechargeRecord(RechargeRecord rechargeRecord);
+
+    Result updateRechargeRecord(RechargeRecord rechargeRecord);
+
+    Result selectRechargeRecordList(Integer page, Integer limit,String orderNo,String phone);
+
+    RechargeRecord selectRechargeRecordById(Integer id);
+}

+ 1 - 1
src/main/java/com/sqx/modules/app/service/UserMoneyService.java

@@ -21,7 +21,7 @@ public interface UserMoneyService extends IService<UserMoney> {
 
     Result profitDetailed(@RequestAttribute Long userId, IPage ipage);
 
-    Result addUserMoney(Long userId, BigDecimal money, Integer type);
+    Result addUserMoney(Long userId, BigDecimal money, Integer type, String account, String remark);
 
     Result updateUserBalance(Long userId, BigDecimal money, Integer type);
 

+ 55 - 0
src/main/java/com/sqx/modules/app/service/impl/RechargeRecordServiceImpl.java

@@ -0,0 +1,55 @@
+package com.sqx.modules.app.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.common.utils.PageUtils;
+import com.sqx.common.utils.Result;
+import com.sqx.modules.app.dao.*;
+import com.sqx.modules.app.entity.RechargeRecord;
+import com.sqx.modules.app.service.RechargeRecordService;
+import com.sqx.modules.printInfo.entity.PrintInfo;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@Service
+@Slf4j
+public class RechargeRecordServiceImpl extends ServiceImpl<RechargeRecordDao, RechargeRecord> implements RechargeRecordService {
+
+    @Override
+    public Result selectRechargeRecordList(Integer page, Integer limit,String orderNo,String phone) {
+        Page<RechargeRecord> pages = new Page<>(page, limit);
+        QueryWrapper<RechargeRecord> queryWrapper = new QueryWrapper();
+        queryWrapper.like(StringUtils.isNotBlank(orderNo),"order_no", orderNo);
+        queryWrapper.like(StringUtils.isNotBlank(phone),"user_phone", phone);
+        PageUtils pageUtils = new PageUtils(baseMapper.selectPage(pages,queryWrapper));
+        return Result.success().put("data", pageUtils);
+    }
+
+    @Override
+    public Result insertRechargeRecord(RechargeRecord rechargeRecord) {
+        baseMapper.insert(rechargeRecord);
+        return Result.success();
+    }
+
+    @Override
+    public Result updateRechargeRecord(RechargeRecord rechargeRecord) {
+        String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
+        rechargeRecord.setUpdateTime(format);
+        int result = baseMapper.updateById(rechargeRecord);
+        return result > 0 ? Result.success() : Result.error();
+    }
+
+    @Override
+    public RechargeRecord selectRechargeRecordById(Integer id) {
+        RechargeRecord rr = baseMapper.selectById(id);
+        return rr;
+    }
+}

+ 81 - 21
src/main/java/com/sqx/modules/app/service/impl/UserMoneyServiceImpl.java

@@ -11,9 +11,11 @@ import com.sqx.modules.app.dao.UserMoneyDao;
 import com.sqx.modules.app.dao.UserMoneyDetailsDao;
 import com.sqx.modules.app.dao.UserVipDao;
 import com.sqx.modules.app.dao.VipDetailsDao;
+import com.sqx.modules.app.entity.RechargeRecord;
 import com.sqx.modules.app.entity.UserEntity;
 import com.sqx.modules.app.entity.UserMoney;
 import com.sqx.modules.app.entity.UserMoneyDetails;
+import com.sqx.modules.app.service.RechargeRecordService;
 import com.sqx.modules.app.service.UserMoneyDetailsService;
 import com.sqx.modules.app.service.UserMoneyService;
 import com.sqx.modules.common.entity.CommonInfo;
@@ -48,6 +50,8 @@ public class UserMoneyServiceImpl extends ServiceImpl<UserMoneyDao, UserMoney> i
     private UserMoneyDetailsService userMoneyDetailsService;
     @Autowired
     private CommonInfoService commonInfoService;
+    @Autowired
+    private RechargeRecordService rechargeRecordService;
 
     @Override
     public void updateMoney(int i, Long userId, double money) {
@@ -57,8 +61,8 @@ public class UserMoneyServiceImpl extends ServiceImpl<UserMoneyDao, UserMoney> i
     @Override
     public UserMoney selectUserMoneyByUserId(Long userId) {
         UserMoney userMoney = baseMapper.selectOne(new QueryWrapper<UserMoney>().eq("user_id", userId));
-        if(userMoney==null){
-            userMoney=new UserMoney();
+        if (userMoney == null) {
+            userMoney = new UserMoney();
             userMoney.setUserId(userId);
             userMoney.setMoney(BigDecimal.ZERO);
             baseMapper.insert(userMoney);
@@ -78,7 +82,7 @@ public class UserMoneyServiceImpl extends ServiceImpl<UserMoneyDao, UserMoney> i
         //余额明细
         Page<UserMoneyDetails> pages = new Page<>(page, limit);
         PageUtils pageUtils = new PageUtils(userMoneyDetailsDao.selectUserMoneyDetails(pages, userId, classify));
-        return Result.success().put("data",pageUtils);
+        return Result.success().put("data", pageUtils);
     }
 
     @Override
@@ -88,28 +92,76 @@ public class UserMoneyServiceImpl extends ServiceImpl<UserMoneyDao, UserMoney> i
     }
 
     @Override
-    public Result addUserMoney(Long userId, BigDecimal money, Integer type) {
+    public Result addUserMoney(Long userId, BigDecimal money, Integer type, String account, String remark) {
+        log.info("充值记录参数;userId:"+userId+"money:"+money+"type:"+type+"account:"+account+"remark:"+remark);
+
+        if(account == null){
+            return Result.error("充值账号不能为空");
+        }
+
+        if (type.equals(2) && money.signum() == -1) {
+            return Result.error("金额输入框请勿填充负号");
+        }
+
+        //获取用户信息
+        UserEntity userInfo = userDao.selectUserById(userId);
+        if (userInfo == null) {
+            return Result.error("用户失效,操作失败");
+        }
+
+        UserMoney um = userMoneyDao.selectMoney(userId);
+        BigDecimal oldMoney = BigDecimal.ZERO;
+        if (um != null) {
+            oldMoney = um.getMoney() != null ? um.getMoney() : BigDecimal.ZERO;
+        }
+
         userMoneyDao.addUserMoney(userId, money, type);
         UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
         userMoneyDetails.setMoney(money);
         userMoneyDetails.setUserId(userId);
-        if(type.equals(1)){
-            userMoneyDetails.setContent("赠送用户余额:"+money+"元");
+        if (type.equals(1)) {
+            userMoneyDetails.setContent("赠送用户余额:" + money + "元");
             userMoneyDetails.setTitle("系统赠送用户余额");
-        }else if(type.equals(2)){
-            userMoneyDetails.setContent("扣除用户余额:"+money+"元");
+        } else if (type.equals(2)) {
+            userMoneyDetails.setContent("扣除用户余额:" + money + "元");
             userMoneyDetails.setTitle("系统扣除用户余额");
         }
         userMoneyDetails.setType(type);
         userMoneyDetails.setClassify(3);
         userMoneyDetails.setState(2);
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        userMoneyDetails.setCreateTime(simpleDateFormat.format(new Date()));
+        String ct = simpleDateFormat.format(new Date());
+        userMoneyDetails.setCreateTime(ct);
         userMoneyDetailsService.save(userMoneyDetails);
 
+        //region 添加充值记录 将充值人和被充值手机号填进去
+        RechargeRecord rr = new RechargeRecord();
+        rr.setUserId(userInfo.getUserId());
+        String orderNo = getGeneralOrder();//订单号
+        rr.setOrderNo(orderNo);
+        String RechargeAmount = type.equals(1) ? "+" + money.doubleValue() : "-" + money.doubleValue();//充值金额
+        rr.setAmount(RechargeAmount);
+        rr.setOldMoney(oldMoney);//充值前余额 oldMoney
+        BigDecimal balance = type.equals(1) ? oldMoney.add(money) : (oldMoney.subtract(money).signum() == -1 ? BigDecimal.ZERO : (oldMoney.subtract(money))); //充值后余额
+        rr.setBalance(balance);
+        rr.setUserPhone(userInfo.getPhone());//手机号
+        rr.setUserName(userInfo.getUserName());//用户名称
+        rr.setUserNick(userInfo.getNickName());//昵称
+        rr.setUserAvatar(userInfo.getAvatar());//头像
+        //充值时间ct
+        rr.setCreateTime(ct);
+        rr.setUpdateTime(ct);
+        rr.setAccount(account);//充值人账号 account
+        if(remark != null){
+            rr.setRemark(remark);
+        }
+
+        rechargeRecordService.insertRechargeRecord(rr);
+        //endregion
+
         // 发送通知
         try {
-            if(type.equals(1)) {
+            if (type.equals(1)) {
                 UserEntity userEntity = userDao.selectById(userId);
                 List<String> msgList = new ArrayList<>();
                 msgList.add(userEntity.getUserName());
@@ -126,19 +178,27 @@ public class UserMoneyServiceImpl extends ServiceImpl<UserMoneyDao, UserMoney> i
         return Result.success();
     }
 
+    public String getGeneralOrder() {
+        Date date = new Date();
+        String newString = String.format("%0" + 4 + "d", (int) ((Math.random() * 9 + 1) * 1000));
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+        String format = sdf.format(date);
+        return format + newString;
+    }
+
     @Override
     public Result updateUserBalance(Long userId, BigDecimal money, Integer type) {
         userMoneyDao.updateUserBalance(userId, money, type);
 
         //将接单明细添加到钱包明细表里
-        UserMoneyDetails userMoneyDetails=new UserMoneyDetails();
+        UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
         userMoneyDetails.setMoney(money);
         userMoneyDetails.setUserId(userId);
-        if(type.equals(1)){
-            userMoneyDetails.setContent("赠送骑手余额:"+money+"元");
+        if (type.equals(1)) {
+            userMoneyDetails.setContent("赠送骑手余额:" + money + "元");
             userMoneyDetails.setTitle("系统赠送骑手余额");
-        }else if(type.equals(2)){
-            userMoneyDetails.setContent("扣除骑手余额:"+money+"元");
+        } else if (type.equals(2)) {
+            userMoneyDetails.setContent("扣除骑手余额:" + money + "元");
             userMoneyDetails.setTitle("系统扣除骑手余额");
         }
         userMoneyDetails.setType(type);
@@ -157,11 +217,11 @@ public class UserMoneyServiceImpl extends ServiceImpl<UserMoneyDao, UserMoney> i
         UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
         userMoneyDetails.setMoney(money);
         userMoneyDetails.setUserId(userId);
-        if(type.equals(1)){
-            userMoneyDetails.setContent("赠送用户保证金:"+money+"元");
+        if (type.equals(1)) {
+            userMoneyDetails.setContent("赠送用户保证金:" + money + "元");
             userMoneyDetails.setTitle("系统赠送用户保证金");
-        }else if(type.equals(2)){
-            userMoneyDetails.setContent("扣除用户保证金:"+money+"元");
+        } else if (type.equals(2)) {
+            userMoneyDetails.setContent("扣除用户保证金:" + money + "元");
             userMoneyDetails.setTitle("系统扣除用户保证金");
         }
         userMoneyDetails.setType(type);
@@ -214,9 +274,9 @@ public class UserMoneyServiceImpl extends ServiceImpl<UserMoneyDao, UserMoney> i
             //设置收益人
             userMoneyDetails.setUserId(user.getUserId());
             //设置购买人
-     //       userMoneyDetails.setByUserId(userId);
+            //       userMoneyDetails.setByUserId(userId);
             //设置类型
-     //       userMoneyDetails.setClassify(2);
+            //       userMoneyDetails.setClassify(2);
             //设置title
             userMoneyDetails.setTitle("购买会员");
             //设置创建时间

+ 28 - 4
src/main/java/com/sqx/modules/datacentre/controller/DataCentreController.java

@@ -1,6 +1,8 @@
 package com.sqx.modules.datacentre.controller;
 
 import com.sqx.common.utils.Result;
+import com.sqx.modules.app.entity.RechargeRecord;
+import com.sqx.modules.app.service.RechargeRecordService;
 import com.sqx.modules.app.service.UserMoneyService;
 import com.sqx.modules.coupon.entity.TbCouponUser;
 import com.sqx.modules.coupon.service.TbCouponService;
@@ -34,6 +36,8 @@ public class DataCentreController {
     private UserMoneyService userMoneyService;
     @Autowired
     private ErrandComplaintService errandComplaintService;
+    @Autowired
+    private RechargeRecordService rechargeRecordService;
 
     @ApiOperation("数据中心")
     @GetMapping(value = "/dataCentre")
@@ -67,8 +71,28 @@ public class DataCentreController {
 
     @ApiOperation("给用户账户修改余额")
     @GetMapping(value = "addUserMoney")
-    public Result addUserMoney(Long userId, BigDecimal money, Integer type) {
-        return userMoneyService.addUserMoney(userId, money, type);
+    public Result addUserMoney(Long userId, BigDecimal money, Integer type, String account, String remark) {
+        return userMoneyService.addUserMoney(userId, money, type, account, remark);
+    }
+
+    //修改充值记录备注
+    @ApiOperation("修改充值记录备注")
+    @GetMapping(value = "updateRecordById")
+    public Result updateRecordById(Integer id, String remark) {
+        RechargeRecord rr = rechargeRecordService.selectRechargeRecordById(id);
+        if (rr == null) {
+            return Result.error("记录无效,备注添加失败");
+        }
+        rr.setRemark(remark);
+
+        return rechargeRecordService.updateRechargeRecord(rr);
+    }
+
+    //分页数据
+    @ApiOperation("充值记录分页数据")
+    @GetMapping("getRecordList")
+    public Result getRecordList(Integer page, Integer limit, String orderNo, String phone) {
+        return rechargeRecordService.selectRechargeRecordList(page, limit, orderNo, phone);
     }
 
     @ApiOperation("修改用户保证金")
@@ -100,9 +124,9 @@ public class DataCentreController {
 
     @ApiOperation("查看用户拥有的优惠券")
     @GetMapping(value = "selectCouponByUserId")
-    public Result selectCouponByUserId(Integer page, Integer limit, Long userId, Integer status, String phone,String shopName,Long shopId,Integer shopFlag/*是否平台券 1是 2否 0 全部 */) {
+    public Result selectCouponByUserId(Integer page, Integer limit, Long userId, Integer status, String phone, String shopName, Long shopId, Integer shopFlag/*是否平台券 1是 2否 0 全部 */) {
 
-        return tbCouponUserService.selectCouponByUserId(page, limit, userId, status, phone,shopName,shopId,shopFlag);
+        return tbCouponUserService.selectCouponByUserId(page, limit, userId, status, phone, shopName, shopId, shopFlag);
     }
 
     @ApiOperation("查看积分明细")

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

@@ -87,4 +87,20 @@ public class AppGoodsController {
     // public Result getShopActivity(Long shopId){
     //     return Result.success().put("data", goodsShopService.getShopActivity(shopId));
     // }
+
+    @ApiOperation("筛选供应商")
+    @GetMapping(value = "selectSupplierShop")
+    public Result selectSupplierShop(ShopQueryDTO queryDTO){
+        if (StrUtil.isNotBlank(queryDTO.getImpotr())) {
+            //添加历史搜索记录
+            searchHistoryService.insertSearchHistory(queryDTO.getUserId(), queryDTO.getImpotr());
+        }
+        //screen ==1 综合排序(评分), == 2 商户类型筛选, == 3 距离排序,  ==4 销量,  ==5 配送费排序, ==6 免配送费筛选
+        //排序:评分,销量,距离,配送费最低,起送价最低。。。。。
+        //筛选:免配送费,
+        return goodsService.selectSupplierShop(queryDTO);
+    }
+
+
+
 }

+ 2 - 0
src/main/java/com/sqx/modules/goods/dao/GoodsShopDao.java

@@ -105,4 +105,6 @@ public interface GoodsShopDao extends BaseMapper<GoodsShop> {
 
     IPage<GoodsShop> getAdminShoActivityShopList(@Param("pages") Page<GoodsShop> pages, @Param("goodsShop") GoodsShop goodsShop);
 
+    IPage<GoodsShop> selectSupplierShop(Page<GoodsShop> pages, Integer screen, Integer shopTypeId, Double lng, Double lat, String city, String impotr,Long activityId);
+
 }

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

@@ -254,4 +254,8 @@ public class GoodsShop implements Serializable {
 
     public GoodsShop() {
     }
+
+
+    @ApiModelProperty("是否供应商 0是  1不是")
+    private Integer isSupplier;
 }

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

@@ -62,4 +62,6 @@ public interface GoodsService extends IService<Goods> {
 
     // 查询店铺所有的商品id
     List<Long> getByAllGoodsIdByShopId(Long shopId);
+
+    Result selectSupplierShop(ShopQueryDTO queryDTO);
 }

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

@@ -752,4 +752,63 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsDao, Goods> implements Go
         return baseMapper.getByAllGoodsIdByShopId(shopId);
     }
 
+    @Override
+    public Result selectSupplierShop(ShopQueryDTO queryDTO) {
+        //如果没有经纬度,则默认为北京的经纬度
+        Double lat = queryDTO.getLat();
+        Double lng = queryDTO.getLng();
+        if (lng == null || lat == null || lng == 0 || lat == 0) {
+            lng = 121.47;
+            lat = 31.23;
+        }
+        Page<GoodsShop> pages = new Page<>(queryDTO.getPage(), queryDTO.getLimit());
+
+        String city = queryDTO.getCity();
+        if (StrUtil.isBlank(city)) {
+            city = getCity(lat, lng);
+        }
+
+        IPage<GoodsShop> goodsShopIPage = goodsShopDao.selectSupplierShop(pages, queryDTO.getScreen(), queryDTO.getShopTypeId(), lng, lat, city, queryDTO.getImpotr(), queryDTO.getActivityId());
+        List<GoodsShop> records = goodsShopIPage.getRecords();
+
+        if (CollUtil.isNotEmpty(records)) {
+            CommonInfo one1 = commonInfoService.findOne(292);
+            CommonInfo one2 = commonInfoService.findOne(293);
+            List<Long> shopIdList = records.stream().map(GoodsShop::getShopId).collect(Collectors.toList());
+            List<Goods> goodsList = goodsDao.selectGoodsBySalesAndGoodsNameAndShopIds(shopIdList, queryDTO.getImpotr());
+            Map<Long, List<Goods>> goodsMap = goodsList.stream().collect(Collectors.groupingBy(Goods::getShopId));
+
+            List<TbCoupon> tbCoupons = tbCouponDao.selectCouponListByShopIdList(shopIdList, null);
+            Map<Long, List<TbCoupon>> couponMap = tbCoupons.stream().collect(Collectors.groupingBy(TbCoupon::getShopId));
+
+            // 查询店铺活动
+            List<ShopActivityVO> shopActivityVOS = activityShopService.getActivityByShopIds(shopIdList);
+            Map<Long, List<ShopActivityVO>> shopActivityMap = shopActivityVOS.stream().collect(Collectors.groupingBy(ShopActivityVO::getShopId));
+
+            for (int a = 0; a < goodsShopIPage.getRecords().size(); a++) {
+                GoodsShop goodsShop = goodsShopIPage.getRecords().get(a);
+                Long shopId = goodsShop.getShopId();
+                goodsShop.setCouponList(couponMap.get(shopId));
+
+                // 设置活动信息
+                goodsShop.setShopActivityList(shopActivityMap.get(shopId));
+
+                if (StringUtils.isNotEmpty(queryDTO.getImpotr())) {
+                    goodsShop.setGoodsList(goodsMap.get(shopId));
+                } else {
+                    goodsShop.setGoodsList(new ArrayList<>());
+                }
+                Double distance = goodsShop.getDistance();
+                double errandTime = distance / Double.parseDouble(one1.getValue());
+                if (errandTime < Double.parseDouble(one2.getValue())) {
+                    errandTime = Double.parseDouble(one2.getValue());
+                }
+                goodsShop.setErrandTime(errandTime);
+            }
+        }
+
+        PageUtils pageUtils = new PageUtils(goodsShopIPage);
+        return Result.success().put("data", pageUtils);
+    }
+
 }

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

@@ -143,6 +143,10 @@ public class GoodsShopServiceImpl extends ServiceImpl<GoodsShopDao, GoodsShop> i
         if(goodsShop.getCashDeposit()==null){
             goodsShop.setCashDeposit(0.0);
         }
+        //        默认不是供应商
+        goodsShop.setIsSupplier(1);
+
+
         baseMapper.insert(goodsShop);
         UserEntity userEntity1 = userService.selectUserById(goodsShop.getUserId());
         SysUserShop sysUserShop = shopAdminDao.selectOne(new QueryWrapper<SysUserShop>().eq("user_id", userEntity1.getAdminUserId()));

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

@@ -239,7 +239,10 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
                 Long orderId = order.getOrderId();
                 OrderGoods orderGoods = orderGoodsDao.selectOne(new QueryWrapper<OrderGoods>().eq("order_id", orderId).eq("goods_id", goods.getGoodsId()).eq("sku_id", skuId).eq("user_id", userId));
                 if (orderGoods != null) {
-                    orderGoods.setGoodsNum(orderGoods.getGoodsNum() + 1);
+//                    当前默认加1
+//                    orderGoods.setGoodsNum(orderGoods.getGoodsNum() + 1);
+
+                    orderGoods.setGoodsNum(orderGoods.getGoodsNum() + num);
                     orderGoodsDao.updateById(orderGoods);
                 } else {
                     orderGoods = new OrderGoods();

+ 1 - 1
src/main/resources/application-dev.yml

@@ -3,7 +3,7 @@ spring:
         type: com.alibaba.druid.pool.DruidDataSource
         druid:
             driver-class-name: com.mysql.cj.jdbc.Driver
-            url: jdbc:mysql://172.16.20.108:3306/tcwm2.5?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
+            url: jdbc:mysql://172.16.20.108:3306/tcwm2.5?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&serverTimezone=CTT
             username: root
             password: chuanghai@2024
             initial-size: 15

+ 37 - 1
src/main/resources/mapper/goods/GoodsShopMapper.xml

@@ -217,7 +217,7 @@
         distance
         from goods_shop gs
         left join shop_type st on gs.shop_type_id = st.id
-        where gs.status = 1 and gs.city = #{city} and gs.putaway_flag = 0
+        where gs.status = 1 and gs.city = #{city} and gs.putaway_flag = 0 and gs.is_supplier=1
         <if test="impotr!=null and impotr!=''">
             AND (gs.shop_name LIKE concat('%',#{impotr},'%') or
             st.shop_type_name like concat('%',#{impotr},'%') or
@@ -492,6 +492,42 @@
         order by distance asc
     </select>
 
+    <select id="selectSupplierShop" resultType="com.sqx.modules.goods.entity.GoodsShop">
+        select * from (select gs.*,(st_distance (point (gs.shop_lng,gs.shop_lat),point(#{lng},#{lat}) ) *111195) AS
+        distance
+        from goods_shop gs
+        left join shop_type st on gs.shop_type_id = st.id
+        where gs.status = 1 and gs.city = #{city} and gs.putaway_flag = 0 and gs.is_supplier=0
+        <if test="impotr!=null and impotr!=''">
+            AND (gs.shop_name LIKE concat('%',#{impotr},'%') or
+            st.shop_type_name like concat('%',#{impotr},'%') or
+            gs.shop_lable LIKE concat('%',#{impotr},'%') or
+            gs.shop_id in (
+            select shop_id from goods where goods_name like concat('%',#{impotr},'%')
+            )
+            )
+        </if>
+
+        <if test="activityId!=null">
+            and gs.activity_id = #{activityId}
+        </if>
+        <if test="shopTypeId!=null">
+            and gs.shop_type_id = #{shopTypeId}
+        </if>
+        order by gs.is_recommend desc
+        <if test="screen==1">
+            ,gs.sort,gs.shop_score desc, distance asc
+        </if>
+        <if test="screen==3">
+            ,distance asc
+        </if>
+        <if test="screen==4">
+            ,gs.shop_sales desc
+        </if>
+        ) a
+        where distribution_distance >= distance
+    </select>
+
 
     <insert id="insertGoodsShop" useGeneratedKeys="true" keyProperty="shopId"
             parameterType="com.sqx.modules.goods.entity.GoodsShop">

+ 5 - 0
src/main/resources/mapper/userMoney/RechargeRecordMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sqx.modules.app.dao.UserMoneyDao">
+
+</mapper>