| | |
| | | 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("商家地址") |
| | |
| | | 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") |
| | |
| | | |
| | | @ApiModelProperty(value = "处理人", hidden = true) |
| | | private Long updatedBy; |
| | | |
| | | @ApiModelProperty(value = "被禁用商家关联用户id", hidden = true) |
| | | private List<Long> userIds; |
| | | } |
| | |
| | | |
| | | @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; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("浏览量") |
| | | private Integer viewNum; |
| | | |
| | | public void setOnShelf(Boolean onShelf) { |
| | | this.onShelf = onShelf ? 1 : 0; |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | }); |
| | | } |
| | | BeanUtils.copyProperties(convenientMerchantDTO, convenientMerchantDO); |
| | | convenientMerchantDO.setIntroduction(convenientMerchantDTO.getIntroduction()); |
| | | this.baseMapper.updateById(convenientMerchantDO); |
| | | return R.ok(); |
| | | } |
| | |
| | | |
| | | @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(); |
| | |
| | | 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); |
| | |
| | | AND ccm.business_status = #{pageConvenientMerchantDTO.businessStatus} |
| | | </if> |
| | | <if test="pageConvenientMerchantDTO.keyword != null and pageConvenientMerchantDTO.keyword != """> |
| | | 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> |
| | |
| | | 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"> |
| | |
| | | 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> |
| | |
| | | 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 |
| | |
| | | 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> |
| | |
| | | AND ccm.business_status = #{exportMerchantDTO.businessStatus} |
| | | </if> |
| | | <if test="exportMerchantDTO.keyword != null and exportMerchantDTO.keyword != """> |
| | | 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> |
| | |
| | | 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> |
| | |
| | | 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> |
| | |
| | | |
| | | @Override |
| | | public R disableOrEnableMerchantUsers(DisableOrEnableConvenientMerchantDTO disableOrEnableConvenientMerchantDTO) { |
| | | userDao.disableOrEnableMerchantUsers(disableOrEnableConvenientMerchantDTO.getType(), disableOrEnableConvenientMerchantDTO.getIds()); |
| | | userDao.disableOrEnableMerchantUsers(disableOrEnableConvenientMerchantDTO.getType(), disableOrEnableConvenientMerchantDTO.getUserIds()); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | @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); |
| | |
| | | @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); |
| | |
| | | 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)); |