Commit 358d6e0079d27f7c715cdd812022d85975fa7db6
1 parent
f9ee74ad
m
Showing
24 changed files
with
300 additions
and
162 deletions
trash-common/src/main/java/com/trash/common/utils/RemoteServerUtils.java
| ... | ... | @@ -32,6 +32,7 @@ import javax.net.ssl.X509TrustManager; |
| 32 | 32 | import com.alibaba.fastjson.JSON; |
| 33 | 33 | import com.alibaba.fastjson.JSONArray; |
| 34 | 34 | import com.alibaba.fastjson.JSONObject; |
| 35 | +import com.trash.common.utils.spring.SpringUtils; | |
| 35 | 36 | import com.trash.common.utils.util.PostSms; |
| 36 | 37 | import com.trash.common.utils.vo.mt.JsonSmsSend; |
| 37 | 38 | import com.trash.common.utils.vo.mt.Mobile; |
| ... | ... | @@ -930,7 +931,7 @@ public class RemoteServerUtils { |
| 930 | 931 | Map map = new HashMap<>(); |
| 931 | 932 | |
| 932 | 933 | map.put("userName", "市渣土管理系统"); |
| 933 | - map.put("password", "u2nuQKePryLy6ccJywKCCQ=="); | |
| 934 | + map.put("password", "mwcfVIiTfWttBJL02O+CGw=="); | |
| 934 | 935 | String param = JSON.toJSON(map).toString(); |
| 935 | 936 | |
| 936 | 937 | RequestBody body = RequestBody.create(MediaType.parse("application/json"), param); |
| ... | ... | @@ -1246,7 +1247,7 @@ public class RemoteServerUtils { |
| 1246 | 1247 | okHttpClient = new OkHttpClient.Builder().connectTimeout(20, TimeUnit.SECONDS) |
| 1247 | 1248 | .writeTimeout(20, TimeUnit.SECONDS).readTimeout(30, TimeUnit.SECONDS).build(); |
| 1248 | 1249 | } |
| 1249 | - | |
| 1250 | + | |
| 1250 | 1251 | Map map = new HashMap<>(); |
| 1251 | 1252 | |
| 1252 | 1253 | String param = JSON.toJSON(map).toString(); |
| ... | ... | @@ -1280,6 +1281,8 @@ public class RemoteServerUtils { |
| 1280 | 1281 | |
| 1281 | 1282 | return get(GETAUTH, null, token.replace("Bearer ", "")); |
| 1282 | 1283 | } |
| 1284 | + | |
| 1285 | + | |
| 1283 | 1286 | |
| 1284 | 1287 | |
| 1285 | 1288 | ... | ... |
trash-framework/src/main/java/com/trash/framework/web/service/SysLoginService.java
| 1 | 1 | package com.trash.framework.web.service; |
| 2 | 2 | |
| 3 | 3 | import java.util.ArrayList; |
| 4 | -import java.util.HashMap; | |
| 5 | 4 | import java.util.HashSet; |
| 6 | 5 | import java.util.List; |
| 7 | -import java.util.Map; | |
| 8 | 6 | import java.util.Set; |
| 9 | -import java.util.concurrent.TimeUnit; | |
| 10 | 7 | |
| 11 | 8 | import javax.annotation.Resource; |
| 12 | 9 | |
| 13 | -import org.apache.commons.collections4.iterators.ArrayListIterator; | |
| 14 | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| 15 | 11 | import org.springframework.security.authentication.AuthenticationManager; |
| 16 | 12 | import org.springframework.security.authentication.BadCredentialsException; |
| ... | ... | @@ -23,7 +19,6 @@ import org.springframework.stereotype.Component; |
| 23 | 19 | import com.alibaba.fastjson.JSON; |
| 24 | 20 | import com.alibaba.fastjson.JSONArray; |
| 25 | 21 | import com.alibaba.fastjson.JSONObject; |
| 26 | -import com.trash.common.config.trashConfig; | |
| 27 | 22 | import com.trash.common.constant.Constants; |
| 28 | 23 | import com.trash.common.core.domain.entity.SysDept; |
| 29 | 24 | import com.trash.common.core.domain.entity.SysRole; |
| ... | ... | @@ -36,9 +31,9 @@ import com.trash.common.exception.user.CaptchaExpireException; |
| 36 | 31 | import com.trash.common.exception.user.UserPasswordNotMatchException; |
| 37 | 32 | import com.trash.common.utils.MessageUtils; |
| 38 | 33 | import com.trash.common.utils.RemoteServerUtils; |
| 39 | -import com.trash.common.utils.SecurityUtils; | |
| 40 | 34 | import com.trash.framework.manager.AsyncManager; |
| 41 | 35 | import com.trash.framework.manager.factory.AsyncFactory; |
| 36 | +import com.trash.system.mapper.SysTempMapper; | |
| 42 | 37 | |
| 43 | 38 | import okhttp3.OkHttpClient; |
| 44 | 39 | import okhttp3.Request; |
| ... | ... | @@ -62,6 +57,9 @@ public class SysLoginService |
| 62 | 57 | |
| 63 | 58 | @Autowired |
| 64 | 59 | UserDetailsService UserDetailsService; |
| 60 | + | |
| 61 | + @Autowired | |
| 62 | + SysTempMapper tempMapper; | |
| 65 | 63 | |
| 66 | 64 | /** |
| 67 | 65 | * 登录验证 |
| ... | ... | @@ -180,7 +178,7 @@ public class SysLoginService |
| 180 | 178 | |
| 181 | 179 | for(Object obj:userJson.getJSONArray("userIdentityList")){ |
| 182 | 180 | |
| 183 | - JSONObject uId = (JSONObject)obj; | |
| 181 | + JSONObject uId = (JSONObject)obj; | |
| 184 | 182 | |
| 185 | 183 | poStrings.add(uId.getString("postType")); |
| 186 | 184 | |
| ... | ... | @@ -202,22 +200,28 @@ public class SysLoginService |
| 202 | 200 | |
| 203 | 201 | } |
| 204 | 202 | |
| 205 | - | |
| 206 | 203 | JSONArray compnayList = redisCache.getCacheObject("companyList"); |
| 207 | 204 | |
| 208 | - | |
| 209 | - for(Object obj:compnayList){ | |
| 210 | - JSONObject con = (JSONObject) obj; | |
| 211 | - | |
| 212 | - if(con.getString("abbreviation").equals(user.getUserName().replace("公司", ""))){ | |
| 213 | - user.setCompanyName(con.getString("name")); | |
| 214 | - user.setUserName(con.getString("abbreviation")); | |
| 215 | - user.setNickName(con.getString("abbreviation")); | |
| 216 | - break; | |
| 217 | - } | |
| 218 | - | |
| 205 | + if(compnayList == null){ | |
| 206 | + | |
| 207 | + compnayList = JSONArray.parseArray(tempMapper.getLocalData("companyList")); | |
| 219 | 208 | } |
| 209 | + for(Object obj:compnayList){ | |
| 210 | + JSONObject con = (JSONObject)(obj); | |
| 211 | + | |
| 212 | + | |
| 213 | + if(con.getString("abbreviation").equals(user.getUserName().replace("公司", ""))){ | |
| 214 | + user.setCompanyName(con.getString("name")); | |
| 215 | + user.setUserName(con.getString("abbreviation")); | |
| 216 | + user.setNickName(con.getString("abbreviation")); | |
| 217 | + break; | |
| 218 | + } | |
| 219 | + | |
| 220 | + } | |
| 221 | + | |
| 222 | + | |
| 220 | 223 | |
| 224 | + | |
| 221 | 225 | |
| 222 | 226 | JSONArray jsonArray = (JSONArray)RemoteServerUtils.getAuth(token); |
| 223 | 227 | if(jsonArray != null){ | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarUserServiceImpl.java
| 1 | 1 | package com.trash.garbage.service.impl; |
| 2 | 2 | |
| 3 | -import cn.hutool.core.collection.CollectionUtil; | |
| 4 | -import cn.hutool.http.HttpUtil; | |
| 3 | +import java.security.spec.AlgorithmParameterSpec; | |
| 4 | +import java.util.ArrayList; | |
| 5 | +import java.util.Arrays; | |
| 6 | +import java.util.HashSet; | |
| 7 | +import java.util.List; | |
| 8 | +import java.util.Objects; | |
| 9 | +import java.util.Set; | |
| 10 | +import java.util.concurrent.TimeUnit; | |
| 11 | + | |
| 12 | +import javax.annotation.Resource; | |
| 13 | +import javax.crypto.Cipher; | |
| 14 | +import javax.crypto.spec.IvParameterSpec; | |
| 15 | +import javax.crypto.spec.SecretKeySpec; | |
| 16 | +import javax.servlet.http.HttpServletRequest; | |
| 17 | + | |
| 18 | +import org.apache.commons.codec.binary.Base64; | |
| 19 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 20 | +import org.springframework.security.core.authority.SimpleGrantedAuthority; | |
| 21 | +import org.springframework.security.core.userdetails.UsernameNotFoundException; | |
| 22 | +import org.springframework.stereotype.Service; | |
| 23 | +import org.springframework.transaction.annotation.Transactional; | |
| 24 | + | |
| 5 | 25 | import com.alibaba.fastjson.JSONObject; |
| 6 | 26 | import com.aliyuncs.exceptions.ClientException; |
| 7 | 27 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| ... | ... | @@ -25,6 +45,7 @@ import com.trash.garbage.custom.BizException; |
| 25 | 45 | import com.trash.garbage.global.GlobalRedisProperties; |
| 26 | 46 | import com.trash.garbage.global.GlobalStatus; |
| 27 | 47 | import com.trash.garbage.global.ResultCode; |
| 48 | +import com.trash.garbage.mapper.GarUserMapper; | |
| 28 | 49 | import com.trash.garbage.pojo.domain.GarAddress; |
| 29 | 50 | import com.trash.garbage.pojo.domain.GarUser; |
| 30 | 51 | import com.trash.garbage.pojo.dto.AddressDto; |
| ... | ... | @@ -32,23 +53,11 @@ import com.trash.garbage.pojo.dto.LoginDto; |
| 32 | 53 | import com.trash.garbage.pojo.vo.LoginVo; |
| 33 | 54 | import com.trash.garbage.service.GarAddressService; |
| 34 | 55 | import com.trash.garbage.service.GarUserService; |
| 35 | -import com.trash.garbage.mapper.GarUserMapper; | |
| 36 | -import com.trash.garbage.utils.*; | |
| 37 | -import org.apache.commons.codec.binary.Base64; | |
| 38 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 39 | -import org.springframework.security.core.authority.SimpleGrantedAuthority; | |
| 40 | -import org.springframework.security.core.userdetails.UsernameNotFoundException; | |
| 41 | -import org.springframework.stereotype.Service; | |
| 42 | -import org.springframework.transaction.annotation.Transactional; | |
| 56 | +import com.trash.garbage.utils.JwtUtils; | |
| 57 | +import com.trash.garbage.utils.ValidateCodeUtil; | |
| 43 | 58 | |
| 44 | -import javax.annotation.Resource; | |
| 45 | -import javax.crypto.Cipher; | |
| 46 | -import javax.crypto.spec.IvParameterSpec; | |
| 47 | -import javax.crypto.spec.SecretKeySpec; | |
| 48 | -import javax.servlet.http.HttpServletRequest; | |
| 49 | -import java.security.spec.AlgorithmParameterSpec; | |
| 50 | -import java.util.*; | |
| 51 | -import java.util.concurrent.TimeUnit; | |
| 59 | +import cn.hutool.core.collection.CollectionUtil; | |
| 60 | +import cn.hutool.http.HttpUtil; | |
| 52 | 61 | |
| 53 | 62 | /** |
| 54 | 63 | * @author 20412 | ... | ... |
trash-generator/src/main/java/com/trash/generator/service/GenTableServiceImpl.java
| ... | ... | @@ -407,7 +407,7 @@ public class GenTableServiceImpl implements IGenTableService |
| 407 | 407 | */ |
| 408 | 408 | public void setTableFromOptions(GenTable genTable) |
| 409 | 409 | { |
| 410 | - JSONObject paramsObj = JSONObject.parseObject(genTable.getOptions()); | |
| 410 | + JSONObject paramsObj = JSONObject.parseObject(genTable.getOptions()); | |
| 411 | 411 | if (StringUtils.isNotNull(paramsObj)) |
| 412 | 412 | { |
| 413 | 413 | String treeCode = paramsObj.getString(GenConstants.TREE_CODE); | ... | ... |
trash-quartz/pom.xml
| ... | ... | @@ -38,7 +38,10 @@ |
| 38 | 38 | <groupId>com.trash</groupId> |
| 39 | 39 | <artifactId>trash-activiti</artifactId> |
| 40 | 40 | </dependency> |
| 41 | - | |
| 41 | + <dependency> | |
| 42 | + <groupId>com.trash</groupId> | |
| 43 | + <artifactId>trash-system</artifactId> | |
| 44 | + </dependency> | |
| 42 | 45 | <dependency> |
| 43 | 46 | <groupId>com.trash</groupId> |
| 44 | 47 | <artifactId>trash-workflow</artifactId> | ... | ... |
trash-quartz/src/main/java/com/trash/quartz/task/DriverTask.java
| ... | ... | @@ -15,17 +15,13 @@ import java.util.Map; |
| 15 | 15 | import java.util.concurrent.TimeUnit; |
| 16 | 16 | import java.util.stream.Collectors; |
| 17 | 17 | |
| 18 | -import javax.swing.Spring; | |
| 19 | - | |
| 20 | 18 | import org.springframework.beans.BeansException; |
| 21 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| 22 | 20 | import org.springframework.stereotype.Component; |
| 23 | -import org.springframework.web.multipart.MultipartFile; | |
| 24 | 21 | |
| 25 | 22 | import com.alibaba.fastjson.JSONArray; |
| 26 | 23 | import com.alibaba.fastjson.JSONObject; |
| 27 | 24 | import com.google.gson.Gson; |
| 28 | -import com.google.gson.JsonObject; | |
| 29 | 25 | import com.google.gson.reflect.TypeToken; |
| 30 | 26 | import com.trash.activiti.service.IActTaskService; |
| 31 | 27 | import com.trash.business.domain.CompanyCredit; |
| ... | ... | @@ -48,13 +44,10 @@ import com.trash.casefile.kafka.Consumer; |
| 48 | 44 | import com.trash.casefile.mapper.KafkaCompensationMapper; |
| 49 | 45 | import com.trash.casefile.mapper.ReplyApprovalProcessMapper; |
| 50 | 46 | import com.trash.casefile.mapper.ViolationCaseFileMapper; |
| 51 | -import com.trash.casefile.service.IViolationCaseFileService; | |
| 52 | 47 | import com.trash.common.config.trashConfig; |
| 53 | 48 | import com.trash.common.core.redis.RedisCache; |
| 54 | 49 | import com.trash.common.utils.LogUtils; |
| 55 | 50 | import com.trash.common.utils.RemoteServerUtils; |
| 56 | -import com.trash.common.utils.SecurityUtils; | |
| 57 | -import com.trash.common.utils.file.FileUploadUtils; | |
| 58 | 51 | import com.trash.common.utils.spring.SpringUtils; |
| 59 | 52 | import com.trash.common.utils.util.PostSms; |
| 60 | 53 | import com.trash.common.utils.vo.mt.JsonSmsSend; |
| ... | ... | @@ -63,6 +56,7 @@ import com.trash.office.domain.LogisticsManagement; |
| 63 | 56 | import com.trash.office.domain.UploadFile; |
| 64 | 57 | import com.trash.office.mapper.LogisticsManagementMapper; |
| 65 | 58 | import com.trash.office.mapper.UploadFileMapper; |
| 59 | +import com.trash.system.mapper.SysTempMapper; | |
| 66 | 60 | import com.trash.workflow.service.IWorkflowService; |
| 67 | 61 | |
| 68 | 62 | /** |
| ... | ... | @@ -84,7 +78,18 @@ public class DriverTask { |
| 84 | 78 | private RedisCache redisCache; |
| 85 | 79 | |
| 86 | 80 | public void getUpCase() { |
| 87 | - JSONArray array = RemoteServerUtils.getCaseList(); | |
| 81 | + JSONArray array = null; | |
| 82 | + try{ | |
| 83 | + array = RemoteServerUtils.getCaseList(); | |
| 84 | + }catch(Exception e){ | |
| 85 | + e.printStackTrace(); | |
| 86 | + } | |
| 87 | + | |
| 88 | + if(array == null){ | |
| 89 | + System.out.print("综管数据无法获取!"); | |
| 90 | + return; | |
| 91 | + } | |
| 92 | + | |
| 88 | 93 | Map map = new HashMap<>(); |
| 89 | 94 | List<String> ids = new ArrayList<String>(); |
| 90 | 95 | |
| ... | ... | @@ -130,7 +135,20 @@ public class DriverTask { |
| 130 | 135 | |
| 131 | 136 | getCaseStateIntoDB("/api/thirdApi/query/superviseList", "supUser", "supDesc", "supTime", "Q4"); |
| 132 | 137 | |
| 133 | - JSONArray array = RemoteServerUtils.getUpCaseResult(); | |
| 138 | + JSONArray array = null; | |
| 139 | + | |
| 140 | + try{ | |
| 141 | + array = RemoteServerUtils.getUpCaseResult(); | |
| 142 | + }catch(Exception e){ | |
| 143 | + e.printStackTrace(); | |
| 144 | + } | |
| 145 | + | |
| 146 | + if(array == null){ | |
| 147 | + System.out.print("综管数据无法获取!"); | |
| 148 | + return; | |
| 149 | + } | |
| 150 | + | |
| 151 | + | |
| 134 | 152 | Map map = new HashMap<>(); |
| 135 | 153 | List<String> ids = new ArrayList<String>(); |
| 136 | 154 | |
| ... | ... | @@ -938,7 +956,10 @@ public class DriverTask { |
| 938 | 956 | map.put("size", 99999); |
| 939 | 957 | map.put("page", 1); |
| 940 | 958 | JSONArray jsonArray = RemoteServerUtils.getCompanyList(map, trashConfig.getToken()); |
| 959 | + | |
| 941 | 960 | if (jsonArray != null) { |
| 961 | + SpringUtils.getBean(SysTempMapper.class).delLocalData("companyList"); | |
| 962 | + SpringUtils.getBean(SysTempMapper.class).setLocalData("companyList",jsonArray.toString()); | |
| 942 | 963 | redisCache.setCacheObject("companyList", jsonArray, 1,TimeUnit.DAYS); |
| 943 | 964 | } |
| 944 | 965 | } |
| ... | ... | @@ -954,6 +975,9 @@ public class DriverTask { |
| 954 | 975 | map.put("auditStatus", 1); |
| 955 | 976 | JSONArray jsonArray = RemoteServerUtils.getContractList(map, trashConfig.getToken()); |
| 956 | 977 | if (jsonArray != null) { |
| 978 | + | |
| 979 | + SpringUtils.getBean(SysTempMapper.class).delLocalData("contractList"); | |
| 980 | + SpringUtils.getBean(SysTempMapper.class).setLocalData("contractList",jsonArray.toString()); | |
| 957 | 981 | redisCache.setCacheObject("contractList", jsonArray, 1,TimeUnit.DAYS); |
| 958 | 982 | } |
| 959 | 983 | } |
| ... | ... | @@ -970,11 +994,15 @@ public class DriverTask { |
| 970 | 994 | map.put("page", 1); |
| 971 | 995 | JSONArray jsonArray = RemoteServerUtils.getConstructionList(map, trashConfig.getToken()); |
| 972 | 996 | if (jsonArray != null) { |
| 997 | + SpringUtils.getBean(SysTempMapper.class).delLocalData("constructionList"); | |
| 998 | + SpringUtils.getBean(SysTempMapper.class).setLocalData("constructionList",jsonArray.toString()); | |
| 973 | 999 | redisCache.setCacheObject("constructionList", jsonArray, 1,TimeUnit.DAYS); |
| 974 | 1000 | } |
| 975 | 1001 | |
| 976 | 1002 | jsonArray = RemoteServerUtils.getConstructionLedgerList(map, trashConfig.getToken()); |
| 977 | 1003 | if (jsonArray != null) { |
| 1004 | + SpringUtils.getBean(SysTempMapper.class).delLocalData("constructionLedgerList"); | |
| 1005 | + SpringUtils.getBean(SysTempMapper.class).setLocalData("constructionLedgerList",jsonArray.toString()); | |
| 978 | 1006 | redisCache.setCacheObject("constructionLedgerList", jsonArray, 1,TimeUnit.DAYS); |
| 979 | 1007 | } |
| 980 | 1008 | } |
| ... | ... | @@ -991,6 +1019,8 @@ public class DriverTask { |
| 991 | 1019 | map.put("page", 1); |
| 992 | 1020 | JSONArray jsonArray = RemoteServerUtils.getEarthSitesList(map, trashConfig.getToken()); |
| 993 | 1021 | if (jsonArray != null) { |
| 1022 | + SpringUtils.getBean(SysTempMapper.class).delLocalData("earthSitesList"); | |
| 1023 | + SpringUtils.getBean(SysTempMapper.class).setLocalData("earthSitesList",jsonArray.toString()); | |
| 994 | 1024 | redisCache.setCacheObject("earthSitesList", jsonArray, 1,TimeUnit.DAYS); |
| 995 | 1025 | } |
| 996 | 1026 | } |
| ... | ... | @@ -1009,6 +1039,8 @@ public class DriverTask { |
| 1009 | 1039 | |
| 1010 | 1040 | JSONArray jsonArray = RemoteServerUtils.getTruckList(map, trashConfig.getToken()); |
| 1011 | 1041 | if (jsonArray != null) { |
| 1042 | + SpringUtils.getBean(SysTempMapper.class).delLocalData("truckList"); | |
| 1043 | + SpringUtils.getBean(SysTempMapper.class).setLocalData("truckList",jsonArray.toString()); | |
| 1012 | 1044 | redisCache.setCacheObject("truckList", jsonArray, 1,TimeUnit.DAYS); |
| 1013 | 1045 | } |
| 1014 | 1046 | } |
| ... | ... | @@ -1025,6 +1057,8 @@ public class DriverTask { |
| 1025 | 1057 | map.put("page", 1); |
| 1026 | 1058 | JSONArray jsonArray = RemoteServerUtils.getAreas(trashConfig.getToken()); |
| 1027 | 1059 | if (jsonArray != null) { |
| 1060 | + SpringUtils.getBean(SysTempMapper.class).delLocalData("areaList"); | |
| 1061 | + SpringUtils.getBean(SysTempMapper.class).setLocalData("areaList",jsonArray.toString()); | |
| 1028 | 1062 | redisCache.setCacheObject("areaList", jsonArray, 1,TimeUnit.DAYS); |
| 1029 | 1063 | } |
| 1030 | 1064 | } | ... | ... |
trash-system/src/main/java/com/trash/system/mapper/SysTempMapper.java
0 → 100644
| 1 | +package com.trash.system.mapper; | |
| 2 | + | |
| 3 | +import org.apache.ibatis.annotations.Param; | |
| 4 | + | |
| 5 | +public interface SysTempMapper { | |
| 6 | + | |
| 7 | + public String getPhoneNumber(@Param("type")String type ,@Param("checkpoint") String checkpoint); | |
| 8 | + | |
| 9 | + | |
| 10 | + public String getLocalData(@Param("type")String type); | |
| 11 | + | |
| 12 | + | |
| 13 | + public String delLocalData(@Param("type")String type); | |
| 14 | + | |
| 15 | + public String setLocalData(@Param("type")String type,@Param("data") String json); | |
| 16 | + | |
| 17 | + | |
| 18 | +} | ... | ... |
trash-system/src/main/resources/mapper/system/SysTempMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
| 2 | +<!DOCTYPE mapper | |
| 3 | +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 5 | +<mapper namespace="com.trash.system.mapper.SysTempMapper"> | |
| 6 | + | |
| 7 | + <select id="getPhoneNumber" parameterType="String" resultType="java.lang.String"> | |
| 8 | + select number from sms where checkpoint = #{checkpoint} and type = #{type} | |
| 9 | + </select> | |
| 10 | + | |
| 11 | + | |
| 12 | + <select id="getLocalData" parameterType="String" resultType="java.lang.String"> | |
| 13 | + select json from temp where type = #{type} | |
| 14 | + </select> | |
| 15 | + | |
| 16 | + <select id="setLocalData" parameterType="String" resultType="java.lang.String"> | |
| 17 | + insert INTO temp(type,json) values(#{type},#{data}); | |
| 18 | + </select> | |
| 19 | + | |
| 20 | + <select id="delLocalData" parameterType="String" resultType="java.lang.String"> | |
| 21 | + delete from temp where type = #{type} | |
| 22 | + </select> | |
| 23 | + | |
| 24 | + | |
| 25 | +</mapper> | |
| 0 | 26 | \ No newline at end of file | ... | ... |
trash-workFlow/src/main/java/com/trash/business/controller/ConstructionCreditController.java
| ... | ... | @@ -5,7 +5,6 @@ import java.util.Date; |
| 5 | 5 | import java.util.List; |
| 6 | 6 | |
| 7 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | -import org.springframework.security.access.prepost.PreAuthorize; | |
| 9 | 8 | import org.springframework.web.bind.annotation.DeleteMapping; |
| 10 | 9 | import org.springframework.web.bind.annotation.GetMapping; |
| 11 | 10 | import org.springframework.web.bind.annotation.PathVariable; |
| ... | ... | @@ -15,9 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody; |
| 15 | 14 | import org.springframework.web.bind.annotation.RequestMapping; |
| 16 | 15 | import org.springframework.web.bind.annotation.RestController; |
| 17 | 16 | |
| 18 | -import com.alibaba.fastjson.JSONArray; | |
| 19 | -import com.alibaba.fastjson.JSONObject; | |
| 20 | -import com.trash.business.domain.CompanyCredit; | |
| 21 | 17 | import com.trash.business.domain.ConstructionCredit; |
| 22 | 18 | import com.trash.business.service.IConstructionCreditService; |
| 23 | 19 | import com.trash.common.annotation.Log; |
| ... | ... | @@ -25,7 +21,6 @@ import com.trash.common.annotation.RepeatSubmit; |
| 25 | 21 | import com.trash.common.core.controller.BaseController; |
| 26 | 22 | import com.trash.common.core.domain.AjaxResult; |
| 27 | 23 | import com.trash.common.core.page.TableDataInfo; |
| 28 | -import com.trash.common.core.redis.RedisCache; | |
| 29 | 24 | import com.trash.common.enums.BusinessType; |
| 30 | 25 | import com.trash.common.utils.SecurityUtils; |
| 31 | 26 | import com.trash.common.utils.poi.ExcelUtil; | ... | ... |
trash-workFlow/src/main/java/com/trash/business/controller/EarthsitesCreditController.java
| ... | ... | @@ -4,30 +4,26 @@ import java.util.ArrayList; |
| 4 | 4 | import java.util.Date; |
| 5 | 5 | import java.util.List; |
| 6 | 6 | |
| 7 | -import com.alibaba.fastjson.JSONArray; | |
| 8 | -import com.alibaba.fastjson.JSONObject; | |
| 9 | -import com.trash.business.domain.ConstructionCredit; | |
| 10 | -import org.springframework.security.access.prepost.PreAuthorize; | |
| 11 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | +import org.springframework.web.bind.annotation.DeleteMapping; | |
| 12 | 9 | import org.springframework.web.bind.annotation.GetMapping; |
| 10 | +import org.springframework.web.bind.annotation.PathVariable; | |
| 13 | 11 | import org.springframework.web.bind.annotation.PostMapping; |
| 14 | 12 | import org.springframework.web.bind.annotation.PutMapping; |
| 15 | -import org.springframework.web.bind.annotation.DeleteMapping; | |
| 16 | -import org.springframework.web.bind.annotation.PathVariable; | |
| 17 | 13 | import org.springframework.web.bind.annotation.RequestBody; |
| 18 | 14 | import org.springframework.web.bind.annotation.RequestMapping; |
| 19 | 15 | import org.springframework.web.bind.annotation.RestController; |
| 16 | + | |
| 17 | +import com.trash.business.domain.EarthsitesCredit; | |
| 18 | +import com.trash.business.service.IEarthsitesCreditService; | |
| 20 | 19 | import com.trash.common.annotation.Log; |
| 21 | 20 | import com.trash.common.annotation.RepeatSubmit; |
| 22 | 21 | import com.trash.common.core.controller.BaseController; |
| 23 | 22 | import com.trash.common.core.domain.AjaxResult; |
| 23 | +import com.trash.common.core.page.TableDataInfo; | |
| 24 | 24 | import com.trash.common.enums.BusinessType; |
| 25 | -import com.trash.business.domain.EarthsitesCredit; | |
| 26 | -import com.trash.business.service.IEarthsitesCreditService; | |
| 27 | 25 | import com.trash.common.utils.SecurityUtils; |
| 28 | 26 | import com.trash.common.utils.poi.ExcelUtil; |
| 29 | -import com.trash.common.core.page.TableDataInfo; | |
| 30 | -import com.trash.common.core.redis.RedisCache; | |
| 31 | 27 | |
| 32 | 28 | /** |
| 33 | 29 | * 处理场所失信Controller | ... | ... |
trash-workFlow/src/main/java/com/trash/business/controller/SupervisionThreestepController.java
| ... | ... | @@ -3,6 +3,7 @@ package com.trash.business.controller; |
| 3 | 3 | import java.io.File; |
| 4 | 4 | import java.io.FileInputStream; |
| 5 | 5 | import java.io.IOException; |
| 6 | +import java.text.SimpleDateFormat; | |
| 6 | 7 | import java.util.ArrayList; |
| 7 | 8 | import java.util.Date; |
| 8 | 9 | import java.util.HashMap; |
| ... | ... | @@ -13,42 +14,41 @@ import java.util.concurrent.TimeUnit; |
| 13 | 14 | import javax.servlet.http.HttpServletRequest; |
| 14 | 15 | import javax.servlet.http.HttpServletResponse; |
| 15 | 16 | |
| 16 | -import org.springframework.security.access.prepost.PreAuthorize; | |
| 17 | -import org.springframework.util.Base64Utils; | |
| 18 | 17 | import org.springframework.beans.factory.annotation.Autowired; |
| 18 | +import org.springframework.util.Base64Utils; | |
| 19 | +import org.springframework.web.bind.annotation.DeleteMapping; | |
| 19 | 20 | import org.springframework.web.bind.annotation.GetMapping; |
| 21 | +import org.springframework.web.bind.annotation.PathVariable; | |
| 20 | 22 | import org.springframework.web.bind.annotation.PostMapping; |
| 21 | 23 | import org.springframework.web.bind.annotation.PutMapping; |
| 22 | -import org.springframework.web.bind.annotation.DeleteMapping; | |
| 23 | -import org.springframework.web.bind.annotation.PathVariable; | |
| 24 | 24 | import org.springframework.web.bind.annotation.RequestBody; |
| 25 | 25 | import org.springframework.web.bind.annotation.RequestMapping; |
| 26 | 26 | import org.springframework.web.bind.annotation.RequestParam; |
| 27 | 27 | import org.springframework.web.bind.annotation.RestController; |
| 28 | 28 | import org.springframework.web.multipart.MultipartFile; |
| 29 | 29 | |
| 30 | -import com.trash.common.annotation.Log; | |
| 31 | -import com.trash.common.annotation.RepeatSubmit; | |
| 32 | -import com.trash.common.config.trashConfig; | |
| 33 | -import com.trash.common.core.controller.BaseController; | |
| 34 | -import com.trash.common.core.domain.AjaxResult; | |
| 35 | -import com.trash.common.enums.BusinessType; | |
| 36 | -import com.alibaba.fastjson.JSON; | |
| 37 | 30 | import com.alibaba.fastjson.JSONArray; |
| 38 | 31 | import com.alibaba.fastjson.JSONObject; |
| 39 | 32 | import com.trash.business.domain.SupervisionThreestep; |
| 40 | 33 | import com.trash.business.domain.SupervisionThreestepWithWorkArea; |
| 41 | 34 | import com.trash.business.domain.dayWork; |
| 35 | +import com.trash.business.mapper.SupervisionThreestepMapper; | |
| 42 | 36 | import com.trash.business.service.ISupervisionThreestepService; |
| 43 | -import com.trash.common.utils.RemoteServerUtils; | |
| 44 | -import com.trash.common.utils.SecurityUtils; | |
| 45 | -import com.trash.common.utils.StringUtils; | |
| 46 | -import com.trash.common.utils.file.FileUtils; | |
| 47 | -import com.trash.common.utils.poi.ExcelUtil; | |
| 37 | +import com.trash.common.annotation.Log; | |
| 38 | +import com.trash.common.annotation.RepeatSubmit; | |
| 39 | +import com.trash.common.config.trashConfig; | |
| 40 | +import com.trash.common.core.controller.BaseController; | |
| 41 | +import com.trash.common.core.domain.AjaxResult; | |
| 48 | 42 | import com.trash.common.core.page.PageDomain; |
| 49 | 43 | import com.trash.common.core.page.TableDataInfo; |
| 50 | 44 | import com.trash.common.core.page.TableSupport; |
| 51 | 45 | import com.trash.common.core.redis.RedisCache; |
| 46 | +import com.trash.common.enums.BusinessType; | |
| 47 | +import com.trash.common.utils.RemoteServerUtils; | |
| 48 | +import com.trash.common.utils.file.FileUtils; | |
| 49 | +import com.trash.common.utils.poi.ExcelUtil; | |
| 50 | +import com.trash.common.utils.spring.SpringUtils; | |
| 51 | +import com.trash.system.mapper.SysTempMapper; | |
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * 三查机制Controller |
| ... | ... | @@ -63,6 +63,8 @@ public class SupervisionThreestepController extends BaseController { |
| 63 | 63 | private ISupervisionThreestepService supervisionThreestepService; |
| 64 | 64 | |
| 65 | 65 | @Autowired |
| 66 | + private SupervisionThreestepMapper mapper; | |
| 67 | + @Autowired | |
| 66 | 68 | RedisCache redisCache; |
| 67 | 69 | |
| 68 | 70 | /** |
| ... | ... | @@ -87,8 +89,38 @@ public class SupervisionThreestepController extends BaseController { |
| 87 | 89 | @PostMapping("/getByObjects") |
| 88 | 90 | public AjaxResult getLists(@RequestBody SupervisionThreestep supervisionThreestep) { |
| 89 | 91 | AjaxResult ajaxResult = AjaxResult.success(); |
| 92 | + | |
| 93 | + if (supervisionThreestep.getWorkStartTime() == null) { | |
| 94 | + String start, end; | |
| 95 | + | |
| 96 | + SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd"); | |
| 97 | + SimpleDateFormat dateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 98 | + Date date = new Date(); | |
| 99 | + | |
| 100 | + if (new Date().getHours() < 8) { | |
| 101 | + end = yearFomat.format(date); | |
| 102 | + date.setDate(date.getDate() - 1); | |
| 103 | + start = yearFomat.format(date); | |
| 104 | + } else { | |
| 105 | + start = yearFomat.format(date); | |
| 106 | + date.setDate(date.getDate() + 1); | |
| 107 | + end = yearFomat.format(date); | |
| 108 | + } | |
| 109 | + | |
| 110 | + end += " 8:00:00"; | |
| 111 | + start += " 8:00:00"; | |
| 112 | + | |
| 113 | + try { | |
| 114 | + supervisionThreestep.setWorkStartTime(dateTime.parse(start)); | |
| 115 | + supervisionThreestep.setWorkEndTime(dateTime.parse(end)); | |
| 116 | + } catch (Exception e) { | |
| 117 | + // TODO Auto-generated catch block | |
| 118 | + e.printStackTrace(); | |
| 119 | + } | |
| 120 | + } | |
| 121 | + | |
| 90 | 122 | try { |
| 91 | - ajaxResult.put("result", supervisionThreestepService.selectSupervisionThreestepList(supervisionThreestep)); | |
| 123 | + ajaxResult.put("result", mapper.selectSupervisionThreestepList(supervisionThreestep)); | |
| 92 | 124 | } catch (Exception e) { |
| 93 | 125 | e.printStackTrace(); |
| 94 | 126 | } |
| ... | ... | @@ -119,7 +151,7 @@ public class SupervisionThreestepController extends BaseController { |
| 119 | 151 | JSONArray areas = redisCache.getCacheObject("areas"); |
| 120 | 152 | |
| 121 | 153 | if (areas == null) { |
| 122 | - areas = RemoteServerUtils.getAreas(); | |
| 154 | + areas = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("areas")); | |
| 123 | 155 | redisCache.setCacheObject("areas", areas); |
| 124 | 156 | } |
| 125 | 157 | |
| ... | ... | @@ -249,10 +281,7 @@ public class SupervisionThreestepController extends BaseController { |
| 249 | 281 | |
| 250 | 282 | JSONArray constructionList = redisCache.getCacheObject("constructionLedgerList"); |
| 251 | 283 | if (constructionList == null) { |
| 252 | - Map<String, Object> map = new HashMap<>(); | |
| 253 | - map.put("size", 99999); | |
| 254 | - map.put("page", 1); | |
| 255 | - constructionList = RemoteServerUtils.getConstructionLedgerList(map); | |
| 284 | + constructionList = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("constructionLedgerList")); | |
| 256 | 285 | if (constructionList != null) { |
| 257 | 286 | redisCache.setCacheObject("constructionLedgerList", constructionList, 60, TimeUnit.MINUTES); |
| 258 | 287 | } | ... | ... |
trash-workFlow/src/main/java/com/trash/business/controller/TruckActivateController.java
| 1 | 1 | package com.trash.business.controller; |
| 2 | 2 | |
| 3 | 3 | import java.util.ArrayList; |
| 4 | -import java.util.HashMap; | |
| 5 | 4 | import java.util.List; |
| 6 | -import java.util.Map; | |
| 7 | 5 | |
| 8 | -import org.springframework.security.access.prepost.PreAuthorize; | |
| 9 | -import org.apache.commons.collections4.map.HashedMap; | |
| 10 | -import org.apache.tomcat.jni.Mmap; | |
| 11 | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | +import org.springframework.web.bind.annotation.DeleteMapping; | |
| 12 | 8 | import org.springframework.web.bind.annotation.GetMapping; |
| 9 | +import org.springframework.web.bind.annotation.PathVariable; | |
| 13 | 10 | import org.springframework.web.bind.annotation.PostMapping; |
| 14 | 11 | import org.springframework.web.bind.annotation.PutMapping; |
| 15 | -import org.springframework.web.bind.annotation.DeleteMapping; | |
| 16 | -import org.springframework.web.bind.annotation.PathVariable; | |
| 17 | 12 | import org.springframework.web.bind.annotation.RequestBody; |
| 18 | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
| 19 | 14 | import org.springframework.web.bind.annotation.RestController; |
| 20 | -import com.trash.common.annotation.Log; | |
| 21 | -import com.trash.common.annotation.RepeatSubmit; | |
| 22 | -import com.trash.common.core.controller.BaseController; | |
| 23 | -import com.trash.common.core.domain.AjaxResult; | |
| 24 | -import com.trash.common.enums.BusinessType; | |
| 25 | -import com.alibaba.fastjson.JSONArray; | |
| 26 | -import com.alibaba.fastjson.JSONObject; | |
| 27 | -import com.trash.business.domain.SupervisionThreestep; | |
| 15 | + | |
| 28 | 16 | import com.trash.business.domain.TruckActivate; |
| 29 | 17 | import com.trash.business.domain.TruckActivateInfo; |
| 30 | -import com.trash.business.mapper.SupervisionThreestepMapper; | |
| 31 | 18 | import com.trash.business.mapper.TruckActivateMapper; |
| 32 | 19 | import com.trash.business.service.ISupervisionThreestepService; |
| 33 | 20 | import com.trash.business.service.ITruckActivateService; |
| 34 | -import com.trash.common.utils.RemoteServerUtils; | |
| 35 | -import com.trash.common.utils.SecurityUtils; | |
| 36 | -import com.trash.common.utils.poi.ExcelUtil; | |
| 21 | +import com.trash.common.annotation.Log; | |
| 22 | +import com.trash.common.annotation.RepeatSubmit; | |
| 23 | +import com.trash.common.core.controller.BaseController; | |
| 24 | +import com.trash.common.core.domain.AjaxResult; | |
| 37 | 25 | import com.trash.common.core.page.TableDataInfo; |
| 38 | 26 | import com.trash.common.core.redis.RedisCache; |
| 27 | +import com.trash.common.enums.BusinessType; | |
| 28 | +import com.trash.common.utils.poi.ExcelUtil; | |
| 39 | 29 | |
| 40 | 30 | /** |
| 41 | 31 | * 车辆激活Controller | ... | ... |
trash-workFlow/src/main/java/com/trash/business/mapper/SmsMapper.java
| ... | ... | @@ -8,14 +8,11 @@ import java.util.List; |
| 8 | 8 | import java.util.Map; |
| 9 | 9 | import java.util.Set; |
| 10 | 10 | |
| 11 | -/** | |
| 12 | - * 汇讯数码科技(深圳)有限公司 | |
| 13 | - * 创建日期:2020/10/23-15:47 | |
| 14 | - * 版本 开发者 日期 | |
| 15 | - * 1.0 Danny 2020/10/23 | |
| 16 | - */ | |
| 17 | 11 | public interface SmsMapper { |
| 18 | 12 | |
| 19 | 13 | public String getPhoneNumber(@Param("type")String type ,@Param("checkpoint") String checkpoint); |
| 14 | + | |
| 15 | + | |
| 16 | + public String getLocalData(@Param("type")String type); | |
| 20 | 17 | |
| 21 | 18 | } | ... | ... |
trash-workFlow/src/main/java/com/trash/business/service/impl/CompanyCreditServiceImpl.java
| ... | ... | @@ -24,7 +24,6 @@ import com.trash.common.utils.SecurityUtils; |
| 24 | 24 | import com.trash.common.utils.util.PostSms; |
| 25 | 25 | import com.trash.common.utils.vo.mt.JsonSmsSend; |
| 26 | 26 | import com.trash.common.utils.vo.mt.Mobile; |
| 27 | -import com.trash.common.utils.vo.mt.SendSms; | |
| 28 | 27 | |
| 29 | 28 | /** |
| 30 | 29 | * 企业失信Service业务层处理 | ... | ... |
trash-workFlow/src/main/java/com/trash/business/service/impl/ConstructionCreditServiceImpl.java
| ... | ... | @@ -12,7 +12,6 @@ import org.springframework.transaction.annotation.Transactional; |
| 12 | 12 | |
| 13 | 13 | import com.alibaba.fastjson.JSONArray; |
| 14 | 14 | import com.alibaba.fastjson.JSONObject; |
| 15 | -import com.trash.business.domain.CompanyCredit; | |
| 16 | 15 | import com.trash.business.domain.ConstructionCredit; |
| 17 | 16 | import com.trash.business.mapper.ConstructionCreditMapper; |
| 18 | 17 | import com.trash.business.mapper.SmsMapper; | ... | ... |
trash-workFlow/src/main/java/com/trash/business/service/impl/SupervisionThreestepServiceImpl.java
| ... | ... | @@ -31,6 +31,8 @@ import com.trash.common.utils.DateUtils; |
| 31 | 31 | import com.trash.common.utils.RemoteServerUtils; |
| 32 | 32 | import com.trash.common.utils.SecurityUtils; |
| 33 | 33 | import com.trash.common.utils.file.FileUploadUtils; |
| 34 | +import com.trash.common.utils.spring.SpringUtils; | |
| 35 | +import com.trash.system.mapper.SysTempMapper; | |
| 34 | 36 | import com.trash.workflow.service.IWorkflowService; |
| 35 | 37 | |
| 36 | 38 | import net.sf.jsqlparser.expression.DateTimeLiteralExpression.DateTime; |
| ... | ... | @@ -129,14 +131,9 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer |
| 129 | 131 | List<String> eArea = SecurityUtils.getLoginUser().getUser().getEarthAreas(); |
| 130 | 132 | List<String> cArea = SecurityUtils.getLoginUser().getUser().getConAreas(); |
| 131 | 133 | |
| 132 | - | |
| 133 | - | |
| 134 | 134 | JSONArray constructionList = redisCache.getCacheObject("constructionLedgerList"); |
| 135 | 135 | if (constructionList == null) { |
| 136 | - Map<String, Object> map = new HashMap<>(); | |
| 137 | - map.put("size", 99999); | |
| 138 | - map.put("page", 1); | |
| 139 | - constructionList = RemoteServerUtils.getConstructionLedgerList(map); | |
| 136 | + constructionList = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("constructionLedgerList")); | |
| 140 | 137 | if (constructionList != null) { |
| 141 | 138 | redisCache.setCacheObject("constructionLedgerList", constructionList, 1, TimeUnit.DAYS); |
| 142 | 139 | } |
| ... | ... | @@ -182,10 +179,7 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer |
| 182 | 179 | JSONArray jsonArray = redis.getCacheObject("earthSitesList"); |
| 183 | 180 | |
| 184 | 181 | if(jsonArray == null){ |
| 185 | - Map<String, Object> map = new HashMap<>(); | |
| 186 | - map.put("size", 99999); | |
| 187 | - map.put("page", 1); | |
| 188 | - jsonArray = RemoteServerUtils.getEarthSitesList(map); | |
| 182 | + jsonArray = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("earthSitesList")); | |
| 189 | 183 | if (jsonArray != null) { |
| 190 | 184 | redisCache.setCacheObject("earthSitesList", jsonArray, 1,TimeUnit.DAYS); |
| 191 | 185 | } |
| ... | ... | @@ -320,23 +314,17 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer |
| 320 | 314 | |
| 321 | 315 | JSONArray contracts = redisCache.getCacheObject("contractList"); |
| 322 | 316 | if (contracts == null) { |
| 323 | - Map param = new HashMap<>(); | |
| 324 | 317 | |
| 325 | - param.put("page", 1); | |
| 326 | - param.put("size", 99999); | |
| 327 | - param.put("contractStatus", 1); | |
| 328 | - param.put("auditStatus", 1); | |
| 329 | - | |
| 330 | - contracts = RemoteServerUtils.getContractList(param); | |
| 331 | - redisCache.setCacheObject("contractList", contracts); | |
| 318 | + contracts = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("contractList")); | |
| 319 | + if(contracts != null){ | |
| 320 | + redisCache.setCacheObject("contractList", contracts); | |
| 321 | + } | |
| 332 | 322 | } |
| 333 | 323 | |
| 334 | 324 | JSONArray constructionList = redisCache.getCacheObject("constructionLedgerList"); |
| 335 | 325 | if (constructionList == null) { |
| 336 | - Map<String, Object> map = new HashMap<>(); | |
| 337 | - map.put("size", 99999); | |
| 338 | - map.put("page", 1); | |
| 339 | - constructionList = RemoteServerUtils.getConstructionLedgerList(map); | |
| 326 | + | |
| 327 | + constructionList = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("constructionLedgerList")); | |
| 340 | 328 | if (constructionList != null) { |
| 341 | 329 | redisCache.setCacheObject("constructionLedgerList", constructionList, 1, TimeUnit.DAYS); |
| 342 | 330 | } |
| ... | ... | @@ -349,7 +337,7 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer |
| 349 | 337 | String areaCode = ""; |
| 350 | 338 | |
| 351 | 339 | if (areas == null) { |
| 352 | - areas = RemoteServerUtils.getAreas(); | |
| 340 | + areas = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("areas")); | |
| 353 | 341 | redisCache.setCacheObject("areas", areas); |
| 354 | 342 | } |
| 355 | 343 | |
| ... | ... | @@ -715,10 +703,7 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer |
| 715 | 703 | JSONArray array = redisCache.getCacheObject("constructionList"); |
| 716 | 704 | |
| 717 | 705 | if(array == null){ |
| 718 | - Map<String, Object> map = new HashMap<>(); | |
| 719 | - map.put("size", 99999); | |
| 720 | - map.put("page", 1); | |
| 721 | - array = RemoteServerUtils.getConstructionList(map); | |
| 706 | + array = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("constructionList")); | |
| 722 | 707 | if(array != null){ |
| 723 | 708 | redisCache.setCacheObject("constructionList", array,1,TimeUnit.DAYS); |
| 724 | 709 | } |
| ... | ... | @@ -1135,14 +1120,7 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer |
| 1135 | 1120 | JSONArray contracts = redisCache.getCacheObject("contractList"); |
| 1136 | 1121 | |
| 1137 | 1122 | if (contracts == null) { |
| 1138 | - Map param = new HashMap<>(); | |
| 1139 | - | |
| 1140 | - param.put("page", 1); | |
| 1141 | - param.put("size", 99999); | |
| 1142 | - param.put("contractStatus", 1); | |
| 1143 | - param.put("auditStatus", 1); | |
| 1144 | - | |
| 1145 | - contracts = RemoteServerUtils.getContractList(param, token); | |
| 1123 | + contracts = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("contractList")); | |
| 1146 | 1124 | redisCache.setCacheObject("contractList", contracts); |
| 1147 | 1125 | } |
| 1148 | 1126 | ... | ... |
trash-workFlow/src/main/java/com/trash/business/service/impl/ThreestepHistoryServiceImpl.java
| ... | ... | @@ -24,6 +24,8 @@ import com.trash.common.core.redis.RedisCache; |
| 24 | 24 | import com.trash.common.utils.DateUtils; |
| 25 | 25 | import com.trash.common.utils.RemoteServerUtils; |
| 26 | 26 | import com.trash.common.utils.SecurityUtils; |
| 27 | +import com.trash.common.utils.spring.SpringUtils; | |
| 28 | +import com.trash.system.mapper.SysTempMapper; | |
| 27 | 29 | |
| 28 | 30 | /** |
| 29 | 31 | * 开停工Service业务层处理 |
| ... | ... | @@ -70,10 +72,8 @@ public class ThreestepHistoryServiceImpl implements IThreestepHistoryService |
| 70 | 72 | JSONArray constructionList = redisCache.getCacheObject("constructionLedgerList"); |
| 71 | 73 | List<String> ids = redisCache.getCacheObject("constructionIds"); |
| 72 | 74 | if (constructionList == null || ids == null) { |
| 73 | - Map<String, Object> map = new HashMap<>(); | |
| 74 | - map.put("size", 99999); | |
| 75 | - map.put("page", 1); | |
| 76 | - constructionList = RemoteServerUtils.getConstructionLedgerList(map); | |
| 75 | + | |
| 76 | + constructionList = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("constructionLedgerList")); | |
| 77 | 77 | if (constructionList != null) { |
| 78 | 78 | ids = new ArrayList(); |
| 79 | 79 | ... | ... |
trash-workFlow/src/main/java/com/trash/business/service/impl/TruckActivateServiceImpl.java
| ... | ... | @@ -13,6 +13,8 @@ import com.trash.common.core.redis.RedisCache; |
| 13 | 13 | import com.trash.common.utils.DateUtils; |
| 14 | 14 | import com.trash.common.utils.RemoteServerUtils; |
| 15 | 15 | import com.trash.common.utils.SecurityUtils; |
| 16 | +import com.trash.common.utils.spring.SpringUtils; | |
| 17 | +import com.trash.system.mapper.SysTempMapper; | |
| 16 | 18 | |
| 17 | 19 | import org.apache.commons.lang3.time.DateFormatUtils; |
| 18 | 20 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -88,6 +90,8 @@ public class TruckActivateServiceImpl implements ITruckActivateService { |
| 88 | 90 | |
| 89 | 91 | if(areas.size() > 0) { |
| 90 | 92 | JSONArray array = redis.getCacheObject("companyList"); |
| 93 | + if(array == null) | |
| 94 | + array = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("companyList")); | |
| 91 | 95 | if(array != null) { |
| 92 | 96 | for(Object obj:array) { |
| 93 | 97 | JSONObject json = (JSONObject)obj; |
| ... | ... | @@ -106,7 +110,8 @@ public class TruckActivateServiceImpl implements ITruckActivateService { |
| 106 | 110 | if (companys.size() > 0) { |
| 107 | 111 | |
| 108 | 112 | JSONArray jsonArray = redis.getCacheObject("truckList"); |
| 109 | - | |
| 113 | + if(jsonArray == null) | |
| 114 | + jsonArray = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("truckList")); | |
| 110 | 115 | for (Object obj : jsonArray) { |
| 111 | 116 | JSONObject json = (JSONObject) obj; |
| 112 | 117 | if (companys.indexOf(json.getString("companyID")) > -1) { |
| ... | ... | @@ -448,10 +453,8 @@ public class TruckActivateServiceImpl implements ITruckActivateService { |
| 448 | 453 | JSONArray contracts = redis.getCacheObject("contractList"); |
| 449 | 454 | |
| 450 | 455 | if (contracts == null) { |
| 451 | - param.put("page", 1); | |
| 452 | - param.put("size", 99999); | |
| 453 | 456 | |
| 454 | - contracts = RemoteServerUtils.getContractList(param); | |
| 457 | + contracts = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("contractList")); | |
| 455 | 458 | redis.setCacheObject("contractList", contracts); |
| 456 | 459 | } |
| 457 | 460 | ... | ... |
trash-workFlow/src/main/java/com/trash/business/service/impl/TruckCreditServiceImpl.java
| ... | ... | @@ -20,9 +20,11 @@ import com.trash.business.service.ITruckCreditService; |
| 20 | 20 | import com.trash.common.core.redis.RedisCache; |
| 21 | 21 | import com.trash.common.utils.RemoteServerUtils; |
| 22 | 22 | import com.trash.common.utils.SecurityUtils; |
| 23 | +import com.trash.common.utils.spring.SpringUtils; | |
| 23 | 24 | import com.trash.common.utils.util.PostSms; |
| 24 | 25 | import com.trash.common.utils.vo.mt.JsonSmsSend; |
| 25 | 26 | import com.trash.common.utils.vo.mt.Mobile; |
| 27 | +import com.trash.system.mapper.SysTempMapper; | |
| 26 | 28 | |
| 27 | 29 | /** |
| 28 | 30 | * 车辆失信Service业务层处理 |
| ... | ... | @@ -69,6 +71,8 @@ public class TruckCreditServiceImpl implements ITruckCreditService |
| 69 | 71 | |
| 70 | 72 | if(areas.size() > 0) { |
| 71 | 73 | JSONArray array = redisCache.getCacheObject("companyList"); |
| 74 | + if(array == null) | |
| 75 | + array = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("companyList")); | |
| 72 | 76 | if(array != null) { |
| 73 | 77 | for(Object obj:array) { |
| 74 | 78 | JSONObject json = (JSONObject)obj; |
| ... | ... | @@ -90,7 +94,8 @@ public class TruckCreditServiceImpl implements ITruckCreditService |
| 90 | 94 | if(companys.size() > 0){ |
| 91 | 95 | |
| 92 | 96 | JSONArray jsonArray = redisCache.getCacheObject("truckList"); |
| 93 | - | |
| 97 | + if(jsonArray == null) | |
| 98 | + jsonArray = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("truckList")); | |
| 94 | 99 | for(Object obj:jsonArray){ |
| 95 | 100 | JSONObject json = (JSONObject) obj; |
| 96 | 101 | if(companys.indexOf(json.getString("companyID")) > -1){ |
| ... | ... | @@ -141,7 +146,9 @@ public class TruckCreditServiceImpl implements ITruckCreditService |
| 141 | 146 | |
| 142 | 147 | |
| 143 | 148 | JSONArray array = redisCache.getCacheObject("companyList"); |
| 144 | - | |
| 149 | + | |
| 150 | + if(array == null) | |
| 151 | + array = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("companyList")); | |
| 145 | 152 | String number = null; |
| 146 | 153 | for(Object obj:array){ |
| 147 | 154 | JSONObject json = (JSONObject)obj; |
| ... | ... | @@ -258,6 +265,9 @@ public class TruckCreditServiceImpl implements ITruckCreditService |
| 258 | 265 | |
| 259 | 266 | if(areas.size() > 0) { |
| 260 | 267 | JSONArray array = redisCache.getCacheObject("companyList"); |
| 268 | + | |
| 269 | + if(array == null) | |
| 270 | + array = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("companyList")); | |
| 261 | 271 | if(array != null) { |
| 262 | 272 | for(Object obj:array) { |
| 263 | 273 | JSONObject json = (JSONObject)obj; | ... | ... |
trash-workFlow/src/main/java/com/trash/caseOffline/service/impl/CaseOfflineServiceImpl.java
| ... | ... | @@ -13,6 +13,7 @@ import com.trash.common.utils.DateUtils; |
| 13 | 13 | import com.trash.common.utils.RemoteServerUtils; |
| 14 | 14 | import com.trash.common.utils.SecurityUtils; |
| 15 | 15 | import com.trash.common.utils.spring.SpringUtils; |
| 16 | +import com.trash.system.mapper.SysTempMapper; | |
| 16 | 17 | import com.trash.system.service.ISysDictTypeService; |
| 17 | 18 | import com.trash.workflow.service.IWorkflowService; |
| 18 | 19 | |
| ... | ... | @@ -92,6 +93,15 @@ public class CaseOfflineServiceImpl implements ICaseOfflineService |
| 92 | 93 | JSONArray earthList = redisCache.getCacheObject("earthSitesList"); |
| 93 | 94 | JSONArray construList = redisCache.getCacheObject("constructionList"); |
| 94 | 95 | |
| 96 | + | |
| 97 | + if(earthList == null){ | |
| 98 | + earthList = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("earthSitesList")); | |
| 99 | + } | |
| 100 | + | |
| 101 | + if(construList == null){ | |
| 102 | + construList = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("constructionList")); | |
| 103 | + } | |
| 104 | + | |
| 95 | 105 | if(caseOffline.status1 != null){ |
| 96 | 106 | if(caseOffline.status1.equals("0")){ |
| 97 | 107 | caseOffline.status1 = " and advice1 is null"; | ... | ... |
trash-workFlow/src/main/java/com/trash/casefile/service/impl/ViolationCaseFileServiceImpl.java
| ... | ... | @@ -16,6 +16,8 @@ import org.springframework.web.multipart.MultipartFile; |
| 16 | 16 | |
| 17 | 17 | import com.alibaba.fastjson.JSONArray; |
| 18 | 18 | import com.alibaba.fastjson.JSONObject; |
| 19 | +import com.google.gson.Gson; | |
| 20 | +import com.google.gson.JsonArray; | |
| 19 | 21 | import com.trash.casefile.domain.ViolationCaseFile; |
| 20 | 22 | import com.trash.casefile.domain.vo.ViolationCaseFileVo; |
| 21 | 23 | import com.trash.casefile.mapper.ViolationCaseFileMapper; |
| ... | ... | @@ -31,6 +33,7 @@ import com.trash.common.utils.file.FileUploadUtils; |
| 31 | 33 | import com.trash.common.utils.spring.SpringUtils; |
| 32 | 34 | import com.trash.office.domain.UploadFile; |
| 33 | 35 | import com.trash.office.mapper.UploadFileMapper; |
| 36 | +import com.trash.system.mapper.SysTempMapper; | |
| 34 | 37 | import com.trash.system.service.ISysDictTypeService; |
| 35 | 38 | import com.trash.workflow.service.IWorkflowService; |
| 36 | 39 | |
| ... | ... | @@ -175,6 +178,17 @@ public class ViolationCaseFileServiceImpl implements IViolationCaseFileService { |
| 175 | 178 | JSONArray earthList = redisCache.getCacheObject("earthSitesList"); |
| 176 | 179 | JSONArray construList = redisCache.getCacheObject("constructionList"); |
| 177 | 180 | JSONArray companyList = redisCache.getCacheObject("companyList"); |
| 181 | + | |
| 182 | + | |
| 183 | + if(construList == null){ | |
| 184 | + construList = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("constructionList")); | |
| 185 | + } | |
| 186 | + if(earthList == null){ | |
| 187 | + earthList = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("earthSitesList")); | |
| 188 | + } | |
| 189 | + if(companyList == null){ | |
| 190 | + companyList = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("companyList")); | |
| 191 | + } | |
| 178 | 192 | |
| 179 | 193 | for (Object obj : companyList) { |
| 180 | 194 | JSONObject jsonObject = (JSONObject) obj; |
| ... | ... | @@ -264,6 +278,9 @@ public class ViolationCaseFileServiceImpl implements IViolationCaseFileService { |
| 264 | 278 | // 判断公司是否为空,如果不为空则查询公司简称 |
| 265 | 279 | if (StringUtils.isNotEmpty(violationCaseFile.getCompanyName())) { |
| 266 | 280 | JSONArray companyList = redisCache.getCacheObject("companyList"); |
| 281 | + if(companyList==null){ | |
| 282 | + companyList = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("companyList")); | |
| 283 | + } | |
| 267 | 284 | for (Object o : companyList) { |
| 268 | 285 | JSONObject jo = (JSONObject) o; |
| 269 | 286 | if (violationCaseFile.getCompanyName().equals(jo.getString("name"))) { | ... | ... |
trash-workFlow/src/main/java/com/trash/casefile/service/impl/ViolationWarningInformationServiceImpl.java
| ... | ... | @@ -29,6 +29,7 @@ import com.trash.common.utils.file.FileUploadUtils; |
| 29 | 29 | import com.trash.common.utils.spring.SpringUtils; |
| 30 | 30 | import com.trash.office.domain.UploadFile; |
| 31 | 31 | import com.trash.office.mapper.UploadFileMapper; |
| 32 | +import com.trash.system.mapper.SysTempMapper; | |
| 32 | 33 | import com.trash.system.service.ISysDictTypeService; |
| 33 | 34 | import com.trash.workflow.service.IWorkflowService; |
| 34 | 35 | |
| ... | ... | @@ -120,8 +121,18 @@ public class ViolationWarningInformationServiceImpl implements IViolationWarning |
| 120 | 121 | |
| 121 | 122 | JSONArray earthList = redisCache.getCacheObject("earthSitesList"); |
| 122 | 123 | JSONArray construList = redisCache.getCacheObject("constructionList"); |
| 123 | - | |
| 124 | 124 | JSONArray companyList = redisCache.getCacheObject("companyList"); |
| 125 | + | |
| 126 | + if(construList == null){ | |
| 127 | + construList = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("constructionList")); | |
| 128 | + } | |
| 129 | + if(earthList == null){ | |
| 130 | + earthList = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("earthSitesList")); | |
| 131 | + } | |
| 132 | + if(companyList == null){ | |
| 133 | + companyList = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("companyList")); | |
| 134 | + } | |
| 135 | + | |
| 125 | 136 | |
| 126 | 137 | List<String> companyAreas = SecurityUtils.getLoginUser().getUser().getCompanyAreas(); |
| 127 | 138 | List<String> companyIds = SecurityUtils.getLoginUser().getUser().getCompanyIds(); |
| ... | ... | @@ -224,6 +235,10 @@ public class ViolationWarningInformationServiceImpl implements IViolationWarning |
| 224 | 235 | // 判断公司是否为空,如果不为空则查询公司简称 |
| 225 | 236 | if (StringUtils.isNotEmpty(violationWarningInformation.getCompanyName())) { |
| 226 | 237 | JSONArray companyList = redisCache.getCacheObject("companyList"); |
| 238 | + | |
| 239 | + if(companyList == null){ | |
| 240 | + companyList = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("companyList")); | |
| 241 | + } | |
| 227 | 242 | for (Object o : companyList) { |
| 228 | 243 | JSONObject jo = (JSONObject) o; |
| 229 | 244 | if (violationWarningInformation.getCompanyName().equals(jo.getString("name"))) { | ... | ... |
trash-workFlow/src/main/java/com/trash/workflow/service/impl/WorkflowServiceImpl.java
| ... | ... | @@ -286,8 +286,7 @@ public class WorkflowServiceImpl implements IWorkflowService { |
| 286 | 286 | if(areas == null){ |
| 287 | 287 | areas = RemoteServerUtils.getAreas(); |
| 288 | 288 | redisCache.setCacheObject("areas", areas); |
| 289 | - } | |
| 290 | - | |
| 289 | + } | |
| 291 | 290 | |
| 292 | 291 | for(Object obj : areas){ |
| 293 | 292 | JSONObject jsonObject = (JSONObject) obj; | ... | ... |
trash-workFlow/src/main/resources/mapper/SmsMapper.xml
| ... | ... | @@ -8,4 +8,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 8 | 8 | select number from sms where checkpoint = #{checkpoint} and type = #{type} |
| 9 | 9 | </select> |
| 10 | 10 | |
| 11 | + | |
| 12 | + <select id="getLocalData" parameterType="String" resultType="java.lang.String"> | |
| 13 | + select json from temp where type = #{type} | |
| 14 | + </select> | |
| 15 | + | |
| 11 | 16 | </mapper> |
| 12 | 17 | \ No newline at end of file | ... | ... |