yanghui
2022-11-26 2d6c4eb6ef31179407203fbb46bb931640f3b41b
#feat 商家后台登录问题修改i
8个文件已修改
81 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/LoginApi.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientMerchantDAO.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ConvenientMerchantService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComShopFlowerOrderDAO.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientMerchantMapper.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -6580,6 +6580,14 @@
    R<ConvenientMerchantVO> getUserMerchantInfoByAccount(@RequestParam("account") String account);
    /**
     * 获取用户便民服务商家详情
     * @param account 商家绑定账号
     * @return
     */
    @GetMapping("/convenient/getMerchantInfoByAccount")
    R<ConvenientMerchantVO> getMerchantInfoByAccount(@RequestParam("account") String account);
    /**
     * 获取商便民服务商家信息
     * @param userId
     * @return
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/LoginApi.java
@@ -160,13 +160,13 @@
        }
        log.info("登录用户信息【{}】", loginBody);
        try {
            R<ConvenientMerchantVO> merchant = communityService.getUserMerchantInfoByAccount(account);
            R<ConvenientMerchantVO> merchant = communityService.getMerchantInfoByAccount(account);
            if (R.isOk(merchant)) {
                ConvenientMerchantVO merchantVO =
                        JSONObject.parseObject(JSONObject.toJSONString(merchant.getData()), ConvenientMerchantVO.class);
                Boolean accountValid = merchantVO.getAccountStatus() == 1;
                if (accountValid) {
                    R result = tokenService.loginMerchantBackStage(account, loginBody.getPassword(),this.getAppId());
                    R result = tokenService.loginShopBackStage(account, loginBody.getPassword(),this.getAppId());
                    return result;
                } else {
                    return R.fail("账号被禁用");
@@ -174,6 +174,7 @@
            }
            return R.fail(merchant.getMsg());
        } catch (Exception e) {
            e.printStackTrace();
            return R.fail("登陆失败了");
        }
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java
@@ -423,6 +423,17 @@
    }
    /**
     * 获取用户便民服务商家详情
     *
     * @param account 商家绑定账号
     * @return
     */
    @GetMapping("/getMerchantInfoByAccount")
    public R<ConvenientMerchantVO> getMerchantInfoByAccount(@RequestParam("account") String account) {
        return convenientMerchantService.getMerchantInfoByAccount(account);
    }
    /**
     * 获取商便民服务商家信息
     *
     * @param userId
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientMerchantDAO.java
@@ -33,6 +33,7 @@
public interface ConvenientMerchantDAO extends BaseMapper<ConvenientMerchantDO> {
    /**
     * 删除便民服务商家
     *
     * @param merchantId
     * @param operator
     * @return
@@ -41,7 +42,8 @@
    /**
     * 分页查询便民服务商家 运营后台
     * @param page 分页参数
     *
     * @param page                      分页参数
     * @param pageConvenientMerchantDTO
     * @return
     */
@@ -50,6 +52,7 @@
    /**
     * 查询商家信息
     *
     * @param merchantId
     * @return
     */
@@ -57,6 +60,7 @@
    /**
     * 根据后台用户id查询
     *
     * @param userId
     * @return
     */
@@ -72,10 +76,11 @@
     * @param currentMon
     * @return
     */
    IPage<ConvenientMerchantVO> getPopularMerchants(@Param("page") Page page, @Param("communityId") Long communityId, @Param("currentMon") String currentMon,@Param("areaCode")String areaCode);
    IPage<ConvenientMerchantVO> getPopularMerchants(@Param("page") Page page, @Param("communityId") Long communityId, @Param("currentMon") String currentMon, @Param("areaCode") String areaCode);
    /**
     * 获取指定类型的商家
     *
     * @param page
     * @param pageClassifyMerchantDTO
     * @param currentMon
@@ -85,6 +90,7 @@
    /**
     * 获取商家详情
     *
     * @param merchantId
     * @param currentMon
     * @return
@@ -93,6 +99,7 @@
    /**
     * 分页搜索商家信息
     *
     * @param page
     * @param pageSearchDTO
     * @param currentMon
@@ -102,6 +109,7 @@
    /**
     * 根据查询条件获取商家导出数据
     *
     * @param exportMerchantDTO
     * @return
     */
@@ -109,6 +117,7 @@
    /**
     * 批量更新商家咨询量
     *
     * @param consultationVOList
     * @return
     */
@@ -116,6 +125,7 @@
    /**
     * 批量更新商家浏览量
     *
     * @param viewVOList
     * @return
     */
@@ -123,6 +133,7 @@
    /**
     * 根据指定id获取商家导出数据
     *
     * @param needExportIds
     * @return
     */
@@ -130,6 +141,7 @@
    /**
     * 批量更新商家营业状态
     *
     * @param convenientMerchantDOList
     * @param status
     * @return
@@ -138,6 +150,7 @@
    /**
     * 社区商家
     *
     * @param communityId
     * @return
     */
@@ -145,6 +158,7 @@
    /**
     * 大屏分页获取热度排行商家
     *
     * @param page
     * @param pagePopularMerchantDTO
     * @return
@@ -160,4 +174,6 @@
    StatisticsCommVO getServiceTimesTotalPolylineDate(@Param("communityId") Long communityId, @Param("date") String date);
    IPage<ConvenientMerchantVO> indexMerchantList(@Param("page") Page page, @Param("pageBaseDTO") PageBaseDTO pageBaseDTO);
    List<ConvenientMerchantVO> getMerchantDetailByAccount(@Param("account") String account);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ConvenientMerchantService.java
@@ -79,6 +79,13 @@
    R<ConvenientMerchantVO> getUserMerchantInfoByAccount(String account);
    /**
     * 获取用户便民服务商家详情
     * @param account 商家绑定账号
     * @return
     */
    R<ConvenientMerchantVO> getMerchantInfoByAccount(String account);
    /**
     * 获取商便民服务商家信息
     * @param userId
     * @return
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java
@@ -1,5 +1,6 @@
package com.panzhihua.service_community.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -225,7 +226,7 @@
    @Override
    public R<ConvenientMerchantVO> getUserMerchantInfoByAccount(String account) {
        try {
            R<LoginUserInfoVO> loginUserInfoVOR = userService.getUserInfo(account + "_10");
            R<LoginUserInfoVO> loginUserInfoVOR = userService.getUserInfo(account + "_5");
            LoginUserInfoVO loginUserInfoVO =
                    JSONObject.parseObject(JSONObject.toJSONString(loginUserInfoVOR.getData()), LoginUserInfoVO.class);
@@ -248,6 +249,20 @@
    }
    @Override
    public R<ConvenientMerchantVO> getMerchantInfoByAccount(String account) {
        try {
            List<ConvenientMerchantVO> merchantDetailByAccount = this.baseMapper.getMerchantDetailByAccount(account);
            if (CollUtil.isEmpty(merchantDetailByAccount)){
                return R.fail(500, "该账号不存在");
            }
            ConvenientMerchantVO convenientMerchantVO = merchantDetailByAccount.get(0);
            return R.ok(convenientMerchantVO);
        } catch (Exception e) {
            return R.fail();
        }
    }
    @Override
    public R<ConvenientMerchantVO> getUserConvenientMerchantInfo(Long userId) {
        ConvenientMerchantDO merchantDO = this.baseMapper.selectOne(new QueryWrapper<ConvenientMerchantDO>()
                .lambda().eq(ConvenientMerchantDO::getUserId, userId));
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComShopFlowerOrderDAO.xml
@@ -281,11 +281,15 @@
        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}
        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}
        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}
        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}
        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 &lt;= date_sub(now(), INTERVAL 15 DAY) and store_id = #{storeId}
    </select>
    <select id="selectCountOrderDayByStoreId"
            resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdCountVO">
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientMerchantMapper.xml
@@ -326,4 +326,13 @@
            #{item.id}
        </foreach>
    </update>
    <select id="getMerchantDetailByAccount" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO">
        SELECT
        ccm.id, ccm.name, ccm.introduction, ccm.logo, ccm.phone, ccm.begin_at, ccm.end_at, ccm.period,ccm.detailed_address,
        ccm.address, ccm.lat, ccm.lon,u.status account_status,u.account,ccm.business_status
        FROM com_convenient_merchants ccm LEFT JOIN sys_user u on ccm.user_id = u.user_id WHERE u.type = 5
        and u.account = #{account}
    </select>
</mapper>