| | |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.wx.WxMiniConfig; |
| | | import com.doumee.dao.business.BikesMapper; |
| | | import com.google.common.collect.Lists; |
| | | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Autowired |
| | | private BikesMapper bikesMapper; |
| | | |
| | | @Override |
| | | public String create(Locks locks) { |
| | |
| | | } |
| | | return new ArrayList<>(); |
| | | } |
| | | @Override |
| | | public Bikes findBikeBase(String bikeId) { |
| | | Locks re = new Locks(); |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | String fullPath = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.FILE_DIR).getCode() + |
| | | systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PROJECTS).getCode() ; |
| | | |
| | | Bikes bikes = bikesMapper.selectById(bikeId); |
| | | if(bikes == null){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | String code = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.PROJECTS).getCode(); |
| | | String prePath = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.IMG_DIR).getCode(); |
| | | // 检查是否有图片信息没有更新保存图片 |
| | | if (StringUtils.isBlank(bikes.getImgurl())){ |
| | | try { |
| | | wxMiniUtilService.generateEbikeWXMiniCode(bikes, WxMiniConfig.wxMaService.getAccessToken(),prePath,code); |
| | | }catch (Exception e){ |
| | | } |
| | | if (StringUtils.isNotBlank(bikes.getImgurl())){ |
| | | bikes.setEditor(loginUserInfo.getId()); |
| | | bikes.setEditDate(new Date()); |
| | | bikesMapper.updateById(bikes); |
| | | } |
| | | } |
| | | if (StringUtils.isNotBlank(bikes.getImgurl())){ |
| | | bikes.setImgurl(fullPath+bikes.getInfo()); |
| | | } |
| | | return bikes; |
| | | } |
| | | |
| | | |
| | | @Override |