| | |
| | | package com.doumee.service.system.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @Override |
| | | public void updateMiniProgrammeDTO(MiniProgrammeDTO miniProgrammeDTO) { |
| | | try { |
| | | if(miniProgrammeDTO.getParkLatLngList()!=null){ |
| | | try { |
| | | TypeReference typeReference = new TypeReference<List<Map<String,BigDecimal>>>(){}; |
| | | List<Map<String,BigDecimal>> response = JSONObject.parseObject(miniProgrammeDTO.getParkLatLngList(), typeReference.getType()); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"运营区域参数解析有误!"); |
| | | } |
| | | } |
| | | String jasonStr = MiniProgrammeDTO.toUnderlineJSONString(miniProgrammeDTO); |
| | | JSONObject parse = (JSONObject) JSONObject.parse(jasonStr); |
| | | parse.entrySet().forEach(s->{ |
| | | if (StringUtils.isNotBlank((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(),"字典值解析有误"); |