|  |  |  | 
|---|
|  |  |  | import com.doumee.biz.system.SystemDictDataBiz; | 
|---|
|  |  |  | import com.doumee.core.constants.ResponseStatus; | 
|---|
|  |  |  | import com.doumee.core.exception.BusinessException; | 
|---|
|  |  |  | import com.doumee.core.model.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.system.model.SystemDict; | 
|---|
|  |  |  | import com.doumee.dao.system.model.SystemDictData; | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.doumee.service.system.SystemDictService; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.apache.shiro.SecurityUtils; | 
|---|
|  |  |  | import org.springframework.beans.BeanUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.Arrays; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Optional; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Service | 
|---|
|  |  |  | public class SystemDictDataBizImpl implements SystemDictDataBiz { | 
|---|
|  |  |  | 
|---|
|  |  |  | public Integer create(SystemDictData systemDictData) { | 
|---|
|  |  |  | SystemDictData queryDto = new SystemDictData(); | 
|---|
|  |  |  | queryDto.setDictId(systemDictData.getDictId()); | 
|---|
|  |  |  | queryDto.setCode(systemDictData.getCode()); | 
|---|
|  |  |  | queryDto.setLabel(systemDictData.getLabel()); | 
|---|
|  |  |  | queryDto.setDeleted(Boolean.FALSE); | 
|---|
|  |  |  | SystemDictData dictData = systemDictDataService.findOne(queryDto); | 
|---|
|  |  |  | if (dictData != null) { | 
|---|
|  |  |  | 
|---|
|  |  |  | queryDto.setDeleted(Boolean.FALSE); | 
|---|
|  |  |  | SystemDict dictData = systemDictService.findOne(queryDto); | 
|---|
|  |  |  | if (dictData == null) { | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "数据值不存在"); | 
|---|
|  |  |  | return  new SystemDictData(); | 
|---|
|  |  |  | //            throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "数据值不存在"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | SystemDictData data = new SystemDictData(); | 
|---|
|  |  |  | data.setDictId(dictData.getId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void refreshCache() { | 
|---|
|  |  |  | /* HKCarOpenService.ACCESS_KEY= queryByCode(Constants.HK_PARAM, Constants.HK_CARS_OPENAPI_ACCESS_KEY).getCode(); | 
|---|
|  |  |  | HKCarOpenService.BASE_URL= queryByCode(Constants.HK_PARAM, Constants.HK_CARS_OPENAPI_URL).getCode(); | 
|---|
|  |  |  | HKCarOpenService.ACCESS_SECRET= queryByCode(Constants.HK_PARAM, Constants.HK_CARS_OPENAPI_ACCESS_SECRET).getCode(); | 
|---|
|  |  |  | ArtemisConfig.host = queryByCode(Constants.HK_PARAM, Constants.HK_HOST).getCode(); | 
|---|
|  |  |  | ArtemisConfig.appKey = queryByCode(Constants.HK_PARAM, Constants.HK_APPKEY).getCode(); | 
|---|
|  |  |  | ArtemisConfig.appSecret = queryByCode(Constants.HK_PARAM, Constants.HK_APPSECRET).getCode(); | 
|---|
|  |  |  | HKConstants.https = queryByCode(Constants.HK_PARAM, Constants.HK_HTTPS).getCode();*/ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public    String getWxAccessToken(){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return  queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public String getPreFixPath(String resourceCode, String targetCode) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (StringUtils.isBlank(resourceCode) || StringUtils.isBlank(targetCode)){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"路径参数不完整"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | SystemDict queryDto = new SystemDict(); | 
|---|
|  |  |  | queryDto.setCode(Constants.OSS); | 
|---|
|  |  |  | queryDto.setCode(Constants.FTP); | 
|---|
|  |  |  | queryDto.setDeleted(Boolean.FALSE); | 
|---|
|  |  |  | SystemDict dictData = systemDictService.findOne(queryDto); | 
|---|
|  |  |  | if (dictData == null) { | 
|---|