DESKTOP-71BH0QO\L、ming
2021-04-27 d0f8d410875660b7c9060af4bf25ca494fba3b67
fix:修改添加商家接口
2个文件已修改
18 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopStoreDAO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopStoreServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopStoreDAO.java
@@ -74,4 +74,9 @@
    @Select("delete from sys_role where role_key = #{account}")
    void deleteSysRoleByAccount(@Param("account") String account);
    @Select("select count(user_id) from sys_user where phone=#{phone} and type=5 ")
    int reasonableUserByPhone(@Param("phone") String phone);
    @Select("select count(user_id) from sys_user where account=#{account} and type=5 ")
    int reasonableUserByAccount(@Param("account") String account);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopStoreServiceImpl.java
@@ -15,7 +15,6 @@
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.service_community.dao.ComShopGoodsAttrDAO;
import com.panzhihua.service_community.dao.ComShopGoodsDAO;
import com.panzhihua.common.model.vos.shop.PageShopStoreVO;
import com.panzhihua.service_community.dao.ComShopStoreDAO;
import com.panzhihua.service_community.model.dos.ComShopGoodsAttrDO;
import com.panzhihua.service_community.model.dos.ComShopGoodsDO;
@@ -32,7 +31,6 @@
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
 * @auther lyq
@@ -51,6 +49,7 @@
    private ComShopOrderService orderService;
    @Resource
    private UserService userService;
    /**
     * 查询店铺列表
     *
@@ -160,8 +159,14 @@
        if (oldComShopStoreDO != null) {
            return R.fail("商家账号已注册");
        }
        //TODO 判断用户
        //this.baseMapper.select(storeVO.getPhone());
        int reasonable1 = this.baseMapper.reasonableUserByPhone(storeVO.getPhone());
        int reasonable2 = this.baseMapper.reasonableUserByAccount(storeVO.getStoreAccount());
        if (reasonable1 > 0) {
            return R.fail("手机号:" + storeVO.getPhone() + "在系统用户中已存在");
        }
        if (reasonable2 > 0) {
            return R.fail("账号:" + storeVO.getStoreAccount() + "在系统用户中已存在");
        }
        //新增店铺先判断是否拥有已删除的店铺
        ComShopStoreDO comShopStoreDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ComShopStoreDO>()
                .eq(ComShopStoreDO::getStoreAccount, storeVO.getStoreAccount()).eq(ComShopStoreDO::getDeleteStatus,ComShopStoreDO.deleteStatus.yes));