| | |
| | | @Resource |
| | | private ConvenientViewStatisticsDAO convenientViewStatisticsDAO; |
| | | |
| | | private static final String DQ="510402"; |
| | | private static final String RHQ="510411"; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addMerchant(ConvenientMerchantDTO convenientMerchantDTO) { |
| | | ConvenientMerchantDO convenientMerchantDO = new ConvenientMerchantDO(); |
| | | BeanUtils.copyProperties(convenientMerchantDTO, convenientMerchantDO); |
| | | if(convenientMerchantDTO.getCommunityId()==0){ |
| | | convenientMerchantDO.setCommunityName("西区社区"); |
| | | if(DQ.equals(convenientMerchantDTO.getAreaCode())){ |
| | | convenientMerchantDO.setCommunityName("东区社区"); |
| | | }else if(RHQ.equals(convenientMerchantDTO.getAreaCode())){ |
| | | convenientMerchantDO.setCommunityName("仁和区社区"); |
| | | }else{ |
| | | convenientMerchantDO.setCommunityName("西区社区"); |
| | | } |
| | | } |
| | | else { |
| | | ComActDO comActDO = comActDAO.selectById(convenientMerchantDTO.getCommunityId()); |
| | |
| | | Page page = new Page<>(); |
| | | page.setSize(pagePopularMerchantDTO.getPageSize()); |
| | | page.setCurrent(pagePopularMerchantDTO.getPageNum()); |
| | | IPage<ConvenientMerchantVO> merchantVOList = this.baseMapper.getPopularMerchants(page, pagePopularMerchantDTO.getCommunityId(), currentMon); |
| | | IPage<ConvenientMerchantVO> merchantVOList = this.baseMapper.getPopularMerchants(page, pagePopularMerchantDTO.getCommunityId(), currentMon,pagePopularMerchantDTO.getAreaCode()); |
| | | if(pagePopularMerchantDTO.getPageNum().equals(1L)){ |
| | | //第一页默认把犇师傅维修中心加载到第一个 |
| | | List<ConvenientMerchantVO> merchantList = this.baseMapper.selectMerchantByName(pagePopularMerchantDTO.getCommunityId(), currentMon); |
| | |
| | | this.baseMapper.batchUpdateMerchantViewNum(viewVOList); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * check商家/店铺是否有效 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Boolean checkStoreIsValid(Long userId) { |
| | | R<LoginUserInfoVO> loginUserInfo = userService.getUserInfoByUserId(userId.toString()); |
| | | LoginUserInfoVO loginUserInfoVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(loginUserInfo.getData()), LoginUserInfoVO.class); |
| | | if (isNull(loginUserInfoVO) || !loginUserInfoVO.getType().equals(10) || loginUserInfoVO.getStatus() != 1) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | } |