| | |
| | | if (isNull(convenientMerchantDO)) { |
| | | return R.fail("商家不存在"); |
| | | } |
| | | Long createBy = convenientMerchantDO.getCreatedBy(); |
| | | BeanUtils.copyProperties(convenientMerchantDTO, convenientMerchantDO); |
| | | if (nonNull(merchantDO) && !merchantDO.getId().equals(convenientMerchantDO.getId())) { |
| | | R.fail("该微信手机号:" + mobilePhone + "已被使用!请更换"); |
| | | } |
| | |
| | | serviceIds.forEach(serviceId -> { |
| | | ConvenientServiceCategoryDO convenientServiceCategoryDO = convenientServiceCategoryDAO.selectById(serviceId); |
| | | convenientServiceCategoryDAO.createMerchantServiceRelation(Snowflake.getId(), merchantId, serviceId, |
| | | convenientServiceCategoryDO.getName(), convenientMerchantDTO.getCreatedBy()); |
| | | convenientServiceCategoryDO.getName(), createBy); |
| | | }); |
| | | } |
| | | BeanUtils.copyProperties(convenientMerchantDTO, convenientMerchantDO); |
| | | |
| | | convenientMerchantDO.setIntroduction(convenientMerchantDTO.getIntroduction()); |
| | | this.baseMapper.updateById(convenientMerchantDO); |
| | | return R.ok(); |
| | |
| | | @Override |
| | | public R getMerchant(Long merchantId) { |
| | | ConvenientMerchantVO convenientMerchantVO = this.baseMapper.selectMerchantById(merchantId); |
| | | List<Long> serviceIds = convenientServiceCategoryDAO.selectServiceIdsForMerchant(merchantId); |
| | | List<String> serviceIds = convenientServiceCategoryDAO.selectServiceIdsForMerchant(merchantId); |
| | | convenientMerchantVO.setServiceIds(serviceIds); |
| | | return R.ok(convenientMerchantVO); |
| | | } |
| | |
| | | Long merchantId = merchantDO.getId(); |
| | | ConvenientMerchantVO convenientMerchantVO = new ConvenientMerchantVO(); |
| | | BeanUtils.copyProperties(merchantDO, convenientMerchantVO); |
| | | List<Long> serviceIds = convenientServiceCategoryDAO.selectServiceIdsForMerchant(merchantId); |
| | | List<String> serviceIds = convenientServiceCategoryDAO.selectServiceIdsForMerchant(merchantId); |
| | | convenientMerchantVO.setServiceIds(serviceIds); |
| | | Date nowDate = new Date(); |
| | | SimpleDateFormat mothFormat = new SimpleDateFormat("yyyy-MM"); |
| | |
| | | return R.fail("商家不存在"); |
| | | } |
| | | Long merchantId = convenientMerchantVO.getId(); |
| | | List<Long> serviceIds = convenientServiceCategoryDAO.selectServiceIdsForMerchant(merchantId); |
| | | List<String> serviceIds = convenientServiceCategoryDAO.selectServiceIdsForMerchant(merchantId); |
| | | convenientMerchantVO.setServiceIds(serviceIds); |
| | | BigDecimal score = comShopFlowerEvaluateDAO.statisticsScore(merchantId); |
| | | convenientMerchantVO.setScore(null == score ? BigDecimal.ZERO : NumberUtil.round(score, 1)); |