| | |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.dao.business.web.response.MiniProgrammeDTO; |
| | | import com.doumee.dao.system.SystemDictMapper; |
| | | import com.doumee.dao.system.model.SystemDict; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | |
| | | |
| | | @Autowired |
| | | private SystemDictDataMapper systemDictDataMapper; |
| | | @Autowired |
| | | private SystemDictMapper systemDictMapper; |
| | | |
| | | @Override |
| | | public String create(SystemDictData systemDictData) { |
| | |
| | | |
| | | @Override |
| | | public SystemDictData findOne(SystemDictData systemDictData) { |
| | | Wrapper<SystemDictData> wrapper = new QueryWrapper<>(systemDictData); |
| | | Wrapper<SystemDictData> wrapper = new QueryWrapper<>(systemDictData).last(" limit 1"); |
| | | return systemDictDataMapper.selectOne(wrapper ); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public MiniProgrammeDTO getMiniProgrammeDTO() { |
| | | try { |
| | | |
| | | String jasonStr = MiniProgrammeDTO.toUnderlineJSONString(new MiniProgrammeDTO()); |
| | | JSONObject parse = (JSONObject) JSONObject.parse(jasonStr); |
| | | List<String> collect = parse.entrySet().stream().map(s -> s.getKey().toUpperCase()).collect(Collectors.toList()); |
| | |
| | | String jasonStr = MiniProgrammeDTO.toUnderlineJSONString(miniProgrammeDTO); |
| | | JSONObject parse = (JSONObject) JSONObject.parse(jasonStr); |
| | | parse.entrySet().forEach(s->{ |
| | | if (StringUtils.isEmpty((String)s.getValue())){ |
| | | // if (StringUtils.isNotBlank((String)s.getValue())){ |
| | | UpdateWrapper<SystemDictData> wrapper = new UpdateWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(SystemDictData::getLabel,s.getKey().toUpperCase()) |
| | | .set(SystemDictData::getCode,s.getValue()); |
| | | systemDictDataMapper.update(null,wrapper); |
| | | } |
| | | // } |
| | | }); |
| | | } catch (JsonProcessingException e) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"字典值解析有误"); |