| | |
| | | package com.doumee.service.system.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.dao.system.SystemDictDataMapper; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.doumee.dao.system.vo.SystemQrcodeListVO; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.doumee.core.model.PageData; |
| | |
| | | import com.doumee.service.system.SystemDictService; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private SystemDictMapper systemDictMapper; |
| | | @Autowired |
| | | private SystemDictDataMapper systemDictDataMapper; |
| | | |
| | | @Override |
| | | public Integer create(SystemDict systemDict) { |
| | |
| | | PageHelper.startPage(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | return PageData.from(new PageInfo<>(systemDictMapper.selectManageList(pageWrap.getModel(), pageWrap.getOrderByClause()))); |
| | | } |
| | | @Override |
| | | public List<SystemQrcodeListVO> qrcodeList(QuerySystemDictDTO pageWrap) { |
| | | List<SystemQrcodeListVO> list = new ArrayList<>(); |
| | | SystemDict dict =systemDictMapper.selectOne(new LambdaQueryWrapper<SystemDict>(). |
| | | eq(SystemDict::getCode,Constants.QRCODE_URLS) |
| | | .last("limit 1")) ; |
| | | if(dict!=null){ |
| | | List<SystemDictData> dataList = systemDictDataMapper.selectList(new LambdaQueryWrapper<SystemDictData>(). |
| | | eq(SystemDictData::getDictId,dict.getId())) ; |
| | | if(dataList!=null && dataList.size()>0){ |
| | | for(SystemDictData data :dataList){ |
| | | SystemQrcodeListVO t = new SystemQrcodeListVO(); |
| | | t.setId(data.getId()+""); |
| | | t.setName(data.getRemark()); |
| | | t.setUrl(data.getCode()); |
| | | if(StringUtils.equals(data.getLabel(),Constants.SHE_QRCODES_URL) |
| | | ||StringUtils.equals(data.getLabel(),Constants.DCA_QRCODES_URL) |
| | | ||StringUtils.equals(data.getLabel(),Constants.DBH_QRCODES_URL)){ |
| | | list.add(t); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public long count(SystemDict systemDict) { |