puhanshu
2021-09-27 6dce00ecae1a0fd933d9b9d274791880247669b9
修改便民服务bug
11个文件已修改
83 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/convenient/ConvenientMerchantDTO.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/convenient/DisableOrEnableConvenientMerchantDTO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/user/ConvenientResetPasswordDTO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/convenient/ConvenientProductVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientMerchantMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientServiceCategoryMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/api/ConvenientApi.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/filters/JWTAuthenticationTokenFilter.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/convenient/ConvenientMerchantDTO.java
@@ -52,7 +52,7 @@
    private String idCard;
    @ApiModelProperty("咨询电话")
    @Pattern(groups = {AddGroup.class}, message = "咨询电话格式错误", regexp = "(1[3|4|5|7|8][0-9]\\d{8})|(\\d{3}-\\d{8}|\\d{4}-\\d{7})")
    @Pattern(groups = {AddGroup.class}, message = "咨询电话格式错误", regexp = "^(13[0-9]|14[01456879]|15[0-3,5-9]|16[2567]|17[0-8]|18[0-9]|19[0-3,5-9])\\d{8}$")
    private String phone;
    @ApiModelProperty("商家地址")
@@ -94,14 +94,12 @@
    private Integer businessStatus;
    @ApiModelProperty("管理账号")
    @Pattern(groups = {AddGroup.class}, message = "请输入6-10位管理账号,由英文或数字组成", regexp = "^[0-9A-Za-z]{6,10}$")
    @NotBlank(groups = {AddGroup.class}, message = "管理账号不能为空")
    private String account;
    @ApiModelProperty("登陆密码")
//    @Pattern(groups = {AddGroup.class}, message = "请输入8-12位登陆密码,由英文,数字和特殊符号组成",
//            regexp = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[$@$!%*#?&])[A-Za-z\\d$@$!%*#?&]{8,12}$")
    @Pattern(groups = {AddGroup.class}, message = "请输入8-12位登陆密码,由英文,数字和特殊符号组成",
            regexp = "^(?=.*[A-Za-z])(?=(.*[\\d]){1,})(?=(.*[\\W]){1,})(?!.*\\s).{8,}$")
            regexp = "^(?=.*[A-Za-z])(?=(.*[\\d]){1,})(?=(.*[\\W]){1,})(?!.*\\s).{8,12}$")
    private String password;
    @ApiModelProperty(value = "所属社区id")
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/convenient/DisableOrEnableConvenientMerchantDTO.java
@@ -30,4 +30,7 @@
    @ApiModelProperty(value = "处理人", hidden = true)
    private Long updatedBy;
    @ApiModelProperty(value = "被禁用商家关联用户id", hidden = true)
    private List<Long> userIds;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/user/ConvenientResetPasswordDTO.java
@@ -26,6 +26,6 @@
    @ApiModelProperty("新密码")
    @Pattern(groups = {AddGroup.class}, message = "请输入8-12位登陆密码,由英文,数字和特殊符号组成",
            regexp = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[$@$!%*#?&])[A-Za-z\\d$@$!%*#?&]{8,12}$")
            regexp = "^(?=.*[A-Za-z])(?=(.*[\\d]){1,})(?=(.*[\\W]){1,})(?!.*\\s).{8,12}$")
    private String newPassword;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/convenient/ConvenientProductVO.java
@@ -50,4 +50,8 @@
    @ApiModelProperty("浏览量")
    private Integer viewNum;
    public void setOnShelf(Boolean onShelf) {
        this.onShelf = onShelf ? 1 : 0;
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java
@@ -8,10 +8,10 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.panzhihua.common.model.vos.community.convenient.ExportMerchantVO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -39,6 +39,7 @@
import com.panzhihua.common.model.vos.community.convenient.ConvenientProductSpecificationVO;
import com.panzhihua.common.model.vos.community.convenient.ConvenientProductVO;
import com.panzhihua.common.model.vos.community.convenient.ConvenientViewStatisticsVO;
import com.panzhihua.common.model.vos.community.convenient.ExportMerchantVO;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.service_community.dao.ComActDAO;
import com.panzhihua.service_community.dao.ConvenientConsultationStatisticsDAO;
@@ -141,6 +142,7 @@
            });
        }
        BeanUtils.copyProperties(convenientMerchantDTO, convenientMerchantDO);
        convenientMerchantDO.setIntroduction(convenientMerchantDTO.getIntroduction());
        this.baseMapper.updateById(convenientMerchantDO);
        return R.ok();
    }
@@ -182,6 +184,10 @@
    @Override
    public R disableOrEnableMerchant(DisableOrEnableConvenientMerchantDTO disableOrEnableConvenientMerchantDTO) {
        List<ConvenientMerchantDO> convenientMerchantDOList = this.baseMapper.selectList(new QueryWrapper<ConvenientMerchantDO>()
                .lambda().in(ConvenientMerchantDO::getId, disableOrEnableConvenientMerchantDTO.getIds()));
        List<Long> userIds = convenientMerchantDOList.stream().map(ConvenientMerchantDO::getUserId).collect(Collectors.toList());
        disableOrEnableConvenientMerchantDTO.setUserIds(userIds);
        R result = userService.disableOrEnableMerchantUsers(disableOrEnableConvenientMerchantDTO);
        if (R.isOk(result)) {
            return R.ok();
@@ -239,10 +245,16 @@
        SimpleDateFormat dayFormat = new SimpleDateFormat("yyyy-MM-dd");
        String moth = mothFormat.format(nowDate);
        String day = dayFormat.format(nowDate);
        int consultationCount = convenientConsultationStatisticsDAO.selectCount(new QueryWrapper<ConvenientConsultationStatisticsDO>()
                .lambda().eq(ConvenientConsultationStatisticsDO::getMerchantId, merchantId));
        int monthConsultationVolume = convenientConsultationStatisticsDAO.selectMonthConsultationVolume(merchantId, moth);
        int dayConsultationVolume = convenientConsultationStatisticsDAO.selectDayConsultationVolume(merchantId, day);
        Integer viewCount = convenientViewStatisticsDAO.selectCount(new QueryWrapper<ConvenientViewStatisticsDO>()
                .lambda().eq(ConvenientViewStatisticsDO::getMerchantId, merchantId));
        int monthViewNum = convenientViewStatisticsDAO.selectMonthViewNum(merchantId, moth);
        int dayViewNum = convenientViewStatisticsDAO.selectDayViewNum(merchantId, day);
        convenientMerchantVO.setConsultationVolume(consultationCount);
        convenientMerchantVO.setViewNum(viewCount);
        convenientMerchantVO.setMonthConsultationVolume(monthConsultationVolume);
        convenientMerchantVO.setDayConsultationVolume(dayConsultationVolume);
        convenientMerchantVO.setMonthViewNum(monthViewNum);
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientMerchantMapper.xml
@@ -54,9 +54,11 @@
            AND ccm.business_status = #{pageConvenientMerchantDTO.businessStatus}
        </if>
        <if test="pageConvenientMerchantDTO.keyword != null and pageConvenientMerchantDTO.keyword != &quot;&quot;">
            AND ccm.name LIKE CONCAT('%', #{pageConvenientMerchantDTO.keyword}, '%')
            AND ccm.address LIKE CONCAT('%', #{pageConvenientMerchantDTO.keyword}, '%')
            AND ccm.phone LIKE CONCAT('%', #{pageConvenientMerchantDTO.keyword}, '%')
            AND (
                    ccm.name LIKE CONCAT('%', #{pageConvenientMerchantDTO.keyword}, '%')
                    OR ccm.address LIKE CONCAT('%', #{pageConvenientMerchantDTO.keyword}, '%')
                    OR ccm.phone LIKE CONCAT('%', #{pageConvenientMerchantDTO.keyword}, '%')
                )
        </if>
        GROUP BY ccm.id
    </select>
@@ -77,7 +79,7 @@
            FROM com_convenient_merchants ccm
            LEFT JOIN com_convenient_consultation_statistics cccs ON ccm.id = cccs.merchant_id
            LEFT JOIN com_convenient_service_scope ccss ON ccm.id = ccss.merchant_id
            WHERE ccm.community_id = #{communityId} AND (cccs.statistic_date LIKE #{currentMon} OR cccs.statistic_date IS NULL) GROUP BY cccs.id
            WHERE ccm.community_id = #{communityId} AND ccm.business_status = 1 AND (cccs.statistic_date LIKE #{currentMon} OR cccs.statistic_date IS NULL) GROUP BY cccs.id
        ) temp GROUP BY temp.id ORDER BY SUM(temp.consultation_volume) DESC
    </select>
    <select id="getClassifyMerchants" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO">
@@ -90,7 +92,7 @@
            FROM com_convenient_merchants ccm
            LEFT JOIN com_convenient_consultation_statistics cccs ON ccm.id = cccs.merchant_id
            LEFT JOIN com_convenient_service_scope ccss ON ccm.id = ccss.merchant_id
            WHERE ccm.community_id = #{pageClassifyMerchantDTO.communityId} AND ccss.service_category_id = #{pageClassifyMerchantDTO.serviceId}
            WHERE ccm.community_id = #{pageClassifyMerchantDTO.communityId} AND ccm.business_status = 1 AND ccss.service_category_id = #{pageClassifyMerchantDTO.serviceId}
                AND (cccs.statistic_date LIKE #{currentMon} OR cccs.statistic_date IS NULL) GROUP BY cccs.id
        ) temp GROUP BY temp.id ORDER BY SUM(temp.consultation_volume) DESC
    </select>
@@ -103,7 +105,7 @@
                ccm.id, ccm.name, ccm.introduction, ccm.logo, ccm.phone, ccm.begin_at, ccm.end_at, ccm.period,
                ccm.address, ccm.lat, ccm.lon, cccs.consultation_volume,GROUP_CONCAT(ccss.service_name) AS serviceScope
            FROM com_convenient_merchants ccm
            INNER JOIN com_convenient_consultation_statistics cccs ON ccm.id = cccs.merchant_id
            LEFT JOIN com_convenient_consultation_statistics cccs ON ccm.id = cccs.merchant_id
            LEFT JOIN com_convenient_service_scope ccss ON ccm.id = ccss.merchant_id
            WHERE ccm.id = #{merchantId} AND (cccs.statistic_date LIKE #{currentMon} OR cccs.statistic_date IS NULL) GROUP BY cccs.id
        ) temp GROUP BY temp.id ORDER BY SUM(temp.consultation_volume) DESC
@@ -119,7 +121,7 @@
            FROM com_convenient_merchants ccm
            INNER JOIN com_convenient_consultation_statistics cccs ON ccm.id = cccs.merchant_id
            LEFT JOIN com_convenient_service_scope ccss ON ccm.id = ccss.merchant_id
            WHERE ccm.community_id = #{pageSearchDTO.communityId} AND ccm.`name` LIKE CONCAT('%', #{pageSearchDTO.keyword}, '%')
            WHERE ccm.community_id = #{pageSearchDTO.communityId} AND ccm.business_status = 1 AND ccm.`name` LIKE CONCAT('%', #{pageSearchDTO.keyword}, '%')
                AND ccm.is_del = 0 AND (cccs.statistic_date LIKE #{currentMon} OR cccs.statistic_date IS NULL) GROUP BY cccs.id
        ) temp GROUP BY temp.id ORDER BY SUM(temp.consultation_volume) DESC
    </select>
@@ -140,9 +142,11 @@
            AND ccm.business_status = #{exportMerchantDTO.businessStatus}
        </if>
        <if test="exportMerchantDTO.keyword != null and exportMerchantDTO.keyword != &quot;&quot;">
            AND ccm.name LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%')
            AND ccm.address LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%')
            AND ccm.phone LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%')
            AND (
                    ccm.name LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%')
                    OR ccm.address LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%')
                    OR ccm.phone LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%')
                )
        </if>
        GROUP BY ccm.id
    </select>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductMapper.xml
@@ -71,6 +71,8 @@
        SELECT ccp.id,ccp.`name`,ccp.category_id,ccp.merchant_id,ccp.introduction
        FROM com_convenient_products ccp
        LEFT JOIN com_convenient_merchants ccm  ON  ccp.merchant_id = ccm.id
        WHERE ccm.community_id = #{pageSearchDTO.communityId} AND ccp.`name` LIKE CONCAT('%', #{pageSearchDTO.keyword}, '%')
        INNER JOIN com_convenient_product_specifications ccps ON ccp.id = ccps.product_id
        WHERE ccm.community_id = #{pageSearchDTO.communityId} AND ccp.is_del = 0
        AND ccp.on_shelf = 1 AND ccps.is_del = 0 AND ccp.`name` LIKE CONCAT('%', #{pageSearchDTO.keyword}, '%') GROUP BY ccp.id
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientServiceCategoryMapper.xml
@@ -50,6 +50,6 @@
        FROM com_convenient_service_categories ccsc
        INNER JOIN com_convenient_service_scope ccss ON ccsc.id = ccss.service_category_id
        LEFT JOIN com_convenient_merchants ccm ON ccss.merchant_id = ccm.id
        WHERE ccsc.is_del = 0 AND ccm.is_del = 0 AND ccm.community_id = #{communityId} GROUP BY ccsc.id
        WHERE ccsc.is_del = 0 AND ccm.is_del = 0 AND ccm.community_id = #{communityId} AND ccm.business_status = 1 GROUP BY ccsc.id
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -2671,7 +2671,7 @@
    @Override
    public R disableOrEnableMerchantUsers(DisableOrEnableConvenientMerchantDTO disableOrEnableConvenientMerchantDTO) {
        userDao.disableOrEnableMerchantUsers(disableOrEnableConvenientMerchantDTO.getType(), disableOrEnableConvenientMerchantDTO.getIds());
        userDao.disableOrEnableMerchantUsers(disableOrEnableConvenientMerchantDTO.getType(), disableOrEnableConvenientMerchantDTO.getUserIds());
        return R.ok();
    }
}
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/api/ConvenientApi.java
@@ -1,12 +1,19 @@
package com.panzhihua.shop_backstage.api;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.TreeSet;
import java.util.UUID;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import com.panzhihua.common.model.dtos.community.convenient.ConvenientProductSpecificationDTO;
import com.panzhihua.common.model.vos.community.convenient.ConvenientProductShelfVO;
import org.apache.commons.io.FilenameUtils;
import org.springframework.beans.BeanUtils;
@@ -234,6 +241,12 @@
    @ApiOperation(value = "便民服务商家后台新增产品")
    @PostMapping("/product/add")
    public R addProduct(@RequestBody @Validated(AddGroup.class) ConvenientProductDTO convenientProductDTO) {
        List<ConvenientProductSpecificationDTO> specificationDTOList = convenientProductDTO.getProductSpecificationDTOList();
        ArrayList<ConvenientProductSpecificationDTO> filteredSpecificationList = specificationDTOList.stream()
                .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(ConvenientProductSpecificationDTO::getName))), ArrayList::new));
        if (specificationDTOList.size() != filteredSpecificationList.size()) {
            return R.fail("规格名称重复!");
        }
        Long userId = this.getUserId();
        convenientProductDTO.setCreatedBy(userId);
        R<ConvenientMerchantVO> merchantInfo = communityService.getUserConvenientMerchantInfo(userId);
@@ -249,6 +262,12 @@
    @ApiOperation(value = "便民服务商家后台编辑产品")
    @PutMapping("/product/put")
    public R putProduct(@RequestBody @Validated(PutGroup.class) ConvenientProductDTO convenientProductDTO) {
        List<ConvenientProductSpecificationDTO> specificationDTOList = convenientProductDTO.getProductSpecificationDTOList();
        ArrayList<ConvenientProductSpecificationDTO> filteredSpecificationList = specificationDTOList.stream()
                .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(ConvenientProductSpecificationDTO::getName))), ArrayList::new));
        if (specificationDTOList.size() != filteredSpecificationList.size()) {
            return R.fail("规格名称重复!");
        }
        Long userId = this.getUserId();
        convenientProductDTO.setUpdatedBy(userId);
        R<ConvenientMerchantVO> merchantInfo = communityService.getUserConvenientMerchantInfo(userId);
springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/filters/JWTAuthenticationTokenFilter.java
@@ -260,6 +260,7 @@
                noLoginUrl.add("/api/applets/convenient/merchant/incr-consult");
                noLoginUrl.add("/api/applets/convenient/merchant/incr-view");
                noLoginUrl.add("/api/applets/convenient/product/incr-view");
                noLoginUrl.add("/api/shopbackstage/convenient/upload/file");
                if (noLoginUrl.contains(requestURI)) {
                    List<SimpleGrantedAuthority> authorities = new ArrayList<>();
                    authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS));