Commit ccc65532ef03176856a9cf59a744c8d5fe2f5b08

Authored by liujun001
2 parents 9e9d1c23 6eb28816

Merge branch 'dev' of http://192.168.168.245:8888/youxiw20000/trash into dev

Showing 40 changed files with 2184 additions and 1398 deletions
trash-common/src/main/java/com/trash/common/core/domain/entity/SysUser.java
... ... @@ -105,10 +105,28 @@ public class SysUser extends BaseEntity
105 105 List<String> companyAreas = new ArrayList<String>();
106 106 List<String> earthAreas = new ArrayList<String>();
107 107 List<String> truckList = new ArrayList<String>();
108   -
  108 +
  109 + List<String> streetsAreas = new ArrayList<String>();
  110 + List<String> streetsList = new ArrayList<String>();
109 111  
110 112  
111 113  
  114 + public List<String> getStreetsAreas() {
  115 + return streetsAreas;
  116 + }
  117 +
  118 + public void setStreetsAreas(List<String> streetsAreas) {
  119 + this.streetsAreas = streetsAreas;
  120 + }
  121 +
  122 + public List<String> getStreetsList() {
  123 + return streetsList;
  124 + }
  125 +
  126 + public void setStreetsList(List<String> streetsList) {
  127 + this.streetsList = streetsList;
  128 + }
  129 +
112 130 public List<String> getCompanyAreas() {
113 131 return companyAreas;
114 132 }
... ...
trash-common/src/main/java/com/trash/common/utils/RemoteServerUtils.java
... ... @@ -488,6 +488,32 @@ public class RemoteServerUtils {
488 488 return object;
489 489 }
490 490  
  491 + public static JSONArray getStreets(String token){
  492 + JSONArray array = null;
  493 +
  494 + if (okHttpClient == null) {
  495 + okHttpClient = getOkClient();
  496 + }
  497 +
  498 + Request request = new Request.Builder().url(remote + "/api/siteservice/v1/sites/tree/auth?type=4").addHeader("Authorization", token).get().build();
  499 +
  500 + try {
  501 + okhttp3.Response response = okHttpClient.newCall(request).execute();
  502 + String result = response.body().string();
  503 +
  504 + if (result != null) {
  505 + JSONArray json = JSON.parseArray(result);
  506 + return json;
  507 + } else {
  508 + return null;
  509 + }
  510 +
  511 + } catch (Exception e) {
  512 + e.printStackTrace();
  513 + return null;
  514 + }
  515 + }
  516 +
491 517 public static JSONArray getAreas(String token) {
492 518 JSONArray array = null;
493 519 Object object = get("/api/gpsservice/cs/area", null, token);
... ... @@ -634,7 +660,7 @@ public class RemoteServerUtils {
634 660 String token = SecurityUtils.getLoginUser().getToken();
635 661  
636 662 if (token.contains("durable:")) {
637   - token = token.replace("durable:", "Bearer durable:auth:token:");
  663 + token = "Bearer " + token;
638 664 } else {
639 665 token = "Bearer auth:token:" + token;
640 666 }
... ... @@ -674,8 +700,9 @@ public class RemoteServerUtils {
674 700  
675 701 String token = SecurityUtils.getLoginUser().getToken();
676 702  
  703 +
677 704 if (token.contains("durable:")) {
678   - token = token.replace("durable:", "Bearer durable:auth:token:");
  705 + token = "Bearer " + token;
679 706 } else {
680 707 token = "Bearer auth:token:" + token;
681 708 }
... ... @@ -724,13 +751,8 @@ public class RemoteServerUtils {
724 751 okHttpClient = getOkClient();
725 752 }
726 753  
727   -
728   - if (token.contains("durable:")) {
729   - token = "Bearer " + token.replaceAll("durable:", "");
730   - } else {
731   - token = "Bearer auth:token:" + token;
732   - }
733   -
  754 + token = "Bearer " + token;
  755 +
734 756  
735 757 String param = JSON.toJSON(obj).toString();
736 758  
... ... @@ -784,15 +806,11 @@ public class RemoteServerUtils {
784 806  
785 807 public static Object get(String url, Map<String, String> obj, String token) {
786 808 if (okHttpClient == null) {
787   -
788   -
789 809 okHttpClient = getOkClient();
790 810 }
791   - if (token.contains("durable:")) {
792   - token = "Bearer " + token.replaceAll("durable:", "");
793   - } else {
794   - token = "Bearer auth:token:" + token;
795   - }
  811 +
  812 + token = "Bearer " + token;
  813 +
796 814 String params = "";
797 815  
798 816 if (obj != null) {
... ... @@ -844,35 +862,27 @@ public class RemoteServerUtils {
844 862 }
845 863  
846 864  
847   - public static JSONArray getDriverList() {
  865 + public static JSONArray getDriverList(Map map) {
848 866  
849   - try {
850   - Map map = new HashMap<>();
851   - Object result = get(DriverListPath, null);
852 867  
853   - if (result != null) {
854   - JSONObject json = JSON.parseObject(result.toString());
855   - return json.getJSONArray("list");
856   -
857   - } else {
858   - return null;
859   - }
  868 + String token = SecurityUtils.getLoginUser().getToken();
860 869  
861   - } catch (Exception e) {
862   - e.printStackTrace();
863   - return null;
864   - }
  870 + return getDriverList(token,map);
865 871 }
866 872  
867   - public static JSONArray getDriverList(String token) {
  873 + public static JSONArray getDriverList(String token,Map map) {
868 874  
869 875 if (okHttpClient == null) {
870 876 okHttpClient = getOkClient();
871 877 }
  878 +
  879 + if (token.contains("durable:")) {
  880 + token = "Bearer " + token;
  881 + } else {
  882 + token = "Bearer auth:token:" + token;
  883 + }
872 884  
873   - token = "Bearer " + token;
874   -
875   - String param = JSON.toJSON(new HashMap<>()).toString();
  885 + String param = JSON.toJSON(map).toString();
876 886  
877 887 RequestBody body = RequestBody.create(MediaType.parse("application/json"), param);
878 888  
... ...
trash-framework/src/main/java/com/trash/framework/web/service/SysLoginService.java
... ... @@ -31,8 +31,10 @@ import org.springframework.stereotype.Component;
31 31  
32 32 import javax.annotation.Resource;
33 33 import java.util.ArrayList;
  34 +import java.util.HashMap;
34 35 import java.util.HashSet;
35 36 import java.util.List;
  37 +import java.util.Map;
36 38 import java.util.Set;
37 39  
38 40 /**
... ... @@ -41,264 +43,288 @@ import java.util.Set;
41 43 * @author trash
42 44 */
43 45 @Component
44   -public class SysLoginService
45   -{
46   - @Autowired
47   - private TokenService tokenService;
  46 +public class SysLoginService {
  47 + @Autowired
  48 + private TokenService tokenService;
48 49  
49   - @Resource
50   - private AuthenticationManager authenticationManager;
  50 + @Resource
  51 + private AuthenticationManager authenticationManager;
51 52  
52   - @Autowired
53   - private RedisCache redisCache;
54   -
55   - @Autowired
56   - UserDetailsService UserDetailsService;
  53 + @Autowired
  54 + private RedisCache redisCache;
57 55  
58   - @Autowired
  56 + @Autowired
  57 + UserDetailsService UserDetailsService;
  58 +
  59 + @Autowired
59 60 SysTempMapper tempMapper;
60   -
61   - /**
62   - * 登录验证
63   - *
64   - * @param username 用户名
65   - * @param password 密码
66   - * @param code 验证码
67   - * @param uuid 唯一标识
68   - * @return 结果
69   - */
70   - public String login(String username, String password, String code, String uuid)
71   - {
72   - String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
73   - String captcha = redisCache.getCacheObject(verifyKey);
74   - redisCache.deleteObject(verifyKey);
75   - if (captcha == null)
76   - {
77   - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
78   - throw new CaptchaExpireException();
79   - }
80   - if (!code.equalsIgnoreCase(captcha))
81   - {
82   - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
83   - throw new CaptchaException();
84   - }
85   - // 用户验证
86   - Authentication authentication = null;
87   - try
88   - {
89   - // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
90   - authentication = authenticationManager
91   - .authenticate(new UsernamePasswordAuthenticationToken(username, password));
92   - }
93   - catch (Exception e)
94   - {
95   - if (e instanceof BadCredentialsException)
96   - {
97   - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
98   - throw new UserPasswordNotMatchException();
99   - }
100   - else
101   - {
102   - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage()));
103   - throw new CustomException(e.getMessage());
104   - }
105   - }
106   -
107   - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
108   - LoginUser loginUser = (LoginUser) authentication.getPrincipal();
109   - // 生成token
110   - return tokenService.createToken(loginUser);
111   - }
112   -
113   -
114   -
115   - public final String LOGIN_URL = "/api/authservice/cs/thirdpart/user"; //登录地址 待配置
116   -
117   - public LoginUser loginByRemote(String token)
118   - {
119   - OkHttpClient okHttpClient = RemoteServerUtils.getOkClient();
120   -
121   - JSONObject userJson = null;
122   -
123   - if(!token.contains("Bearer ")){
124   - token = "Bearer "+ token;
125   - }
126   -
127   - Request request = new Request.Builder().url(RemoteServerUtils.remote + LOGIN_URL).addHeader("Authorization",token).get().build();
128   -
129   - try {
130   - okhttp3.Response response = okHttpClient.newCall(request).execute();
131   - String result = response.body().string();
132   -
133   - if(result != null){
134   - JSONObject json = JSON.parseObject(result);
135   - if("success".equals(json.getString("message"))){
136   - userJson = json.getJSONObject("result");
137   - }
138   - }else{
139   - return null;
140   - }
141   -
142   - }catch (Exception e) {
143   - e.printStackTrace();
144   - return null;
  61 +
  62 + /**
  63 + * 登录验证
  64 + *
  65 + * @param username
  66 + * 用户名
  67 + * @param password
  68 + * 密码
  69 + * @param code
  70 + * 验证码
  71 + * @param uuid
  72 + * 唯一标识
  73 + * @return 结果
  74 + */
  75 + public String login(String username, String password, String code, String uuid) {
  76 + String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
  77 + String captcha = redisCache.getCacheObject(verifyKey);
  78 + redisCache.deleteObject(verifyKey);
  79 + if (captcha == null) {
  80 + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL,
  81 + MessageUtils.message("user.jcaptcha.expire")));
  82 + throw new CaptchaExpireException();
  83 + }
  84 + if (!code.equalsIgnoreCase(captcha)) {
  85 + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL,
  86 + MessageUtils.message("user.jcaptcha.error")));
  87 + throw new CaptchaException();
  88 + }
  89 + // 用户验证
  90 + Authentication authentication = null;
  91 + try {
  92 + // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
  93 + authentication = authenticationManager
  94 + .authenticate(new UsernamePasswordAuthenticationToken(username, password));
  95 + } catch (Exception e) {
  96 + if (e instanceof BadCredentialsException) {
  97 + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL,
  98 + MessageUtils.message("user.password.not.match")));
  99 + throw new UserPasswordNotMatchException();
  100 + } else {
  101 + AsyncManager.me()
  102 + .execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage()));
  103 + throw new CustomException(e.getMessage());
  104 + }
  105 + }
  106 +
  107 + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS,
  108 + MessageUtils.message("user.login.success")));
  109 + LoginUser loginUser = (LoginUser) authentication.getPrincipal();
  110 + // 生成token
  111 + return tokenService.createToken(loginUser);
  112 + }
  113 +
  114 + public final String LOGIN_URL = "/api/authservice/cs/thirdpart/user"; // 登录地址
  115 + // 待配置
  116 +
  117 + public LoginUser loginByRemote(String token) {
  118 + OkHttpClient okHttpClient = RemoteServerUtils.getOkClient();
  119 +
  120 + JSONObject userJson = null;
  121 +
  122 + if (!token.contains("Bearer ")) {
  123 + token = "Bearer " + token;
  124 + }
  125 +
  126 + Request request = new Request.Builder().url(RemoteServerUtils.remote + LOGIN_URL)
  127 + .addHeader("Authorization", token).get().build();
  128 +
  129 + try {
  130 + okhttp3.Response response = okHttpClient.newCall(request).execute();
  131 + String result = response.body().string();
  132 +
  133 + if (result != null) {
  134 + JSONObject json = JSON.parseObject(result);
  135 + if ("success".equals(json.getString("message"))) {
  136 + userJson = json.getJSONObject("result");
  137 + }
  138 + } else {
  139 + return null;
  140 + }
  141 +
  142 + } catch (Exception e) {
  143 + e.printStackTrace();
  144 + return null;
  145 + }
  146 +
  147 + if (userJson == null) {
  148 + return null;
145 149 }
146   -
147   - if(userJson == null){
148   - return null;
149   - }
150   -
151   - LoginUser loginUser = new LoginUser();
152   -
153   - ArrayList<SimpleGrantedAuthority> authorities = new ArrayList<SimpleGrantedAuthority>();
154   - SimpleGrantedAuthority activitiUser = new SimpleGrantedAuthority("ROLE_ACTIVITI_USER");
155   - SimpleGrantedAuthority admin = new SimpleGrantedAuthority("admin");
156   - authorities.add(activitiUser);
157   - authorities.add(admin);
158   - loginUser.setAuthorities(authorities);
159   -
160   - Set<String> set = new HashSet<String>();
161   -
162   - SysUser user = new SysUser();
163   - user.setUserId(userJson.getString("id"));
164   - user.setUserName(userJson.getString("name"));
165   - user.setNickName(userJson.getString("name"));
166   - user.setPassword(userJson.getString("id"));
167   - SysDept dept = new SysDept();
168   -
169   - if(userJson.getJSONArray("userIdentityList")!=null){
170   -
171   - List<String> poStrings = new ArrayList<String>();
172   -
173   - List<String> rolStrings = new ArrayList<String>();
174   -
175   - try {
176   -
177   - for(Object obj:userJson.getJSONArray("userIdentityList")){
178   -
179   - JSONObject uId = (JSONObject)obj;
180   -
181   - poStrings.add(uId.getString("postType"));
182   -
183   - rolStrings.add(uId.getString("departmentType"));
184   -
185   -
186   - }
187   -
188   - user.setPostIds(poStrings);
189   -
190   - user.setRoleIds(rolStrings);
191   -
192   -
193   - } catch (Exception e) {
194   - // TODO: handle exception
195   - }
196   -
197   -
198   -
199   - }
200   -
201   - JSONArray compnayList = redisCache.getCacheObject("companyList");
202   -
203   - if(compnayList == null){
204   -
205   - compnayList = JSONArray.parseArray(tempMapper.getLocalData("companyList"));
206   - }
207   - for(Object obj:compnayList){
208   - JSONObject con = (JSONObject)(obj);
209   -
210   -
211   - if(con.getString("abbreviation").equals(user.getUserName().replace("公司", ""))){
212   - user.setCompanyName(con.getString("name"));
213   - user.setUserName(con.getString("abbreviation"));
214   - user.setNickName(con.getString("abbreviation"));
215   - break;
216   - }
217   -
218   - }
219   -
220   -
221   -
222   -
223   -
224   - JSONArray jsonArray = (JSONArray)RemoteServerUtils.getAuth(token);
225   - if(jsonArray != null){
226   - for(Object obj:jsonArray){
227   - JSONObject json = (JSONObject)obj;
228   - if(json.getInteger("sourceType") == 2){
229   - if(json.getJSONArray("sourceIds") != null){
230   - List<String> tIds = json.getJSONArray("sourceIds").toJavaList(String.class);
231   - user.setTruckList(tIds);
232   - }
233   - if(json.getJSONArray("companyIds") != null){
234   - List<String> companyIds = json.getJSONArray("companyIds").toJavaList(String.class);
235   - user.setCompanyIds(companyIds);
236   - }
237   -
238   - if(json.getJSONArray("adCodes") != null){
239   - List<String> areas = json.getJSONArray("adCodes").toJavaList(String.class);
240   - user.setCompanyAreas(areas);
241   - }
242   - }else if(json.getInteger("sourceType") == 3){
243   - if(json.getJSONArray("sourceIds") != null){
244   - List<String> companyIds = json.getJSONArray("sourceIds").toJavaList(String.class);
245   - user.setConList(companyIds);
246   - }
247   - if(json.getJSONArray("adCodes") != null){
248   - List<String> areas = json.getJSONArray("adCodes").toJavaList(String.class);
249   - user.setConAreas(areas);
250   - }
251   - }else if(json.getInteger("sourceType") == 4){
252   - if(json.getJSONArray("sourceIds") != null){
253   - List<String> companyIds = json.getJSONArray("sourceIds").toJavaList(String.class);
254   - user.setEarthList(companyIds);
255   - }
256   - if(json.getJSONArray("adCodes") != null){
257   - List<String> areas = json.getJSONArray("adCodes").toJavaList(String.class);
258   - user.setEarthAreas(areas);
259   - }
260   - }
261   - }
262   - }
263   -
264   -
265   -
266   - dept.setDeptName(userJson.getString("orgName"));
267   -
268   - user.setDept(dept);
269   -
270   - user.setAvatar(RemoteServerUtils.remote + userJson.getString("elecSignaturePath"));
271   -
272   - loginUser.setUser(user);
273   -
274   -
275   - set.add("*:*:*");//测试直接给admin
276   -
277   - for(Object object:userJson.getJSONArray("menus")){
278   - JSONObject menu = (JSONObject) object;
279   -
280   - set.add(menu.getString("code"));
281   - }
282   -
283   -
284   - SysRole role = new SysRole();
285   -
286   - role.setRoleKey("admin");
287   -
288   - ArrayList<SysRole> roles = new ArrayList<SysRole>();
289   -
290   - roles.add(role);
291   -
292   - user.setRoles(roles);
293   -
294   - token = token.replace("Bearer ", "").replace("auth:token:", "");
295   -
296   - loginUser.setPermissions(set);
297   -
298   - loginUser.setToken(token);
299   - tokenService.refreshToken(loginUser);
300   -
301   - // 生成token
302   - return loginUser;
303   - }
  150 +
  151 + LoginUser loginUser = new LoginUser();
  152 +
  153 + ArrayList<SimpleGrantedAuthority> authorities = new ArrayList<SimpleGrantedAuthority>();
  154 + SimpleGrantedAuthority activitiUser = new SimpleGrantedAuthority("ROLE_ACTIVITI_USER");
  155 + SimpleGrantedAuthority admin = new SimpleGrantedAuthority("admin");
  156 + authorities.add(activitiUser);
  157 + authorities.add(admin);
  158 + loginUser.setAuthorities(authorities);
  159 +
  160 + Set<String> set = new HashSet<String>();
  161 +
  162 + SysUser user = new SysUser();
  163 + user.setUserId(userJson.getString("id"));
  164 + user.setUserName(userJson.getString("name"));
  165 + user.setNickName(userJson.getString("name"));
  166 + user.setPassword(userJson.getString("id"));
  167 + SysDept dept = new SysDept();
  168 +
  169 + if (userJson.getJSONArray("userIdentityList") != null) {
  170 +
  171 + List<String> poStrings = new ArrayList<String>();
  172 +
  173 + List<String> rolStrings = new ArrayList<String>();
  174 +
  175 + try {
  176 +
  177 + for (Object obj : userJson.getJSONArray("userIdentityList")) {
  178 +
  179 + JSONObject uId = (JSONObject) obj;
  180 +
  181 + poStrings.add(uId.getString("postType"));
  182 +
  183 + rolStrings.add(uId.getString("departmentType"));
  184 +
  185 + }
  186 +
  187 + user.setPostIds(poStrings);
  188 +
  189 + user.setRoleIds(rolStrings);
  190 +
  191 + } catch (Exception e) {
  192 + // TODO: handle exception
  193 + }
  194 +
  195 + }
  196 +
  197 + JSONArray compnayList = redisCache.getCacheObject("companyList");
  198 +
  199 + if (compnayList == null) {
  200 + compnayList = JSONArray.parseArray(tempMapper.getLocalData("companyList"));
  201 + }
  202 + for (Object obj : compnayList) {
  203 + JSONObject con = (JSONObject) (obj);
  204 +
  205 + if (con.getString("abbreviation").equals(user.getUserName().replace("公司", ""))) {
  206 + user.setCompanyName(con.getString("name"));
  207 + user.setUserName(con.getString("abbreviation"));
  208 + user.setNickName(con.getString("abbreviation"));
  209 + break;
  210 + }
  211 +
  212 + }
  213 +
  214 + JSONArray jsonArray = (JSONArray) RemoteServerUtils.getAuth(token);
  215 +
  216 + JSONArray streets = (JSONArray) RemoteServerUtils.getStreets(token);
  217 +
  218 + Map<String, List<String>> streetsMap = new HashMap<String, List<String>>();
  219 +
  220 + for(Object obj:streets){
  221 + JSONObject jsonObject = (JSONObject) obj;
  222 + if(jsonObject.getString("level").equals("3")){
  223 + streetsMap.put(jsonObject.getString("id"), new ArrayList<>());
  224 + }
  225 + }
  226 +
  227 + for(Object obj:streets){
  228 + JSONObject jsonObject = (JSONObject) obj;
  229 + if(jsonObject.getString("level").equals("4")){
  230 + streetsMap.get(jsonObject.getString("pid")).add(jsonObject.getString("id"));
  231 + }
  232 + }
  233 +
  234 + if (jsonArray != null) {
  235 +
  236 +
  237 + if(user.getStreetsList() == null){
  238 + user.setStreetsList(new ArrayList<>());
  239 + }
  240 +
  241 + for (Object obj : jsonArray) {
  242 + JSONObject json = (JSONObject) obj;
  243 + if (json.getInteger("sourceType") == 2) {
  244 + if (json.getJSONArray("sourceIds") != null) {
  245 + List<String> tIds = json.getJSONArray("sourceIds").toJavaList(String.class);
  246 + user.setTruckList(tIds);
  247 + }
  248 + if (json.getJSONArray("companyIds") != null) {
  249 + List<String> companyIds = json.getJSONArray("companyIds").toJavaList(String.class);
  250 + user.setCompanyIds(companyIds);
  251 + }
  252 +
  253 + if (json.getJSONArray("adCodes") != null) {
  254 + List<String> areas = json.getJSONArray("adCodes").toJavaList(String.class);
  255 + user.setCompanyAreas(areas);
  256 + }
  257 + } else if (json.getInteger("sourceType") == 3) {
  258 + if (json.getJSONArray("sourceIds") != null) {
  259 + List<String> companyIds = json.getJSONArray("sourceIds").toJavaList(String.class);
  260 + user.setConList(companyIds);
  261 + }
  262 + if (json.getJSONArray("adCodes") != null) {
  263 + List<String> areas = json.getJSONArray("adCodes").toJavaList(String.class);
  264 + user.setConAreas(areas);
  265 + }
  266 + } else if (json.getInteger("sourceType") == 4) {
  267 + if (json.getJSONArray("sourceIds") != null) {
  268 + List<String> companyIds = json.getJSONArray("sourceIds").toJavaList(String.class);
  269 + user.setEarthList(companyIds);
  270 + }
  271 + if (json.getJSONArray("adCodes") != null) {
  272 + List<String> areas = json.getJSONArray("adCodes").toJavaList(String.class);
  273 + user.setEarthAreas(areas);
  274 + }
  275 + } else if (json.getInteger("sourceType") == 6) {
  276 + if (json.getJSONArray("sourceIds") != null) {
  277 + List<String> companyIds = json.getJSONArray("sourceIds").toJavaList(String.class);
  278 +
  279 + user.getStreetsList().addAll(companyIds);
  280 +
  281 + }
  282 + if (json.getJSONArray("adCodes") != null) {
  283 + List<String> areas = json.getJSONArray("adCodes").toJavaList(String.class);
  284 + for(String str:areas){
  285 + if(streetsMap.get(str) == null)
  286 + continue;
  287 + user.getStreetsList().addAll(streetsMap.get(str));
  288 + }
  289 + }
  290 + }
  291 + }
  292 + }
  293 +
  294 + dept.setDeptName(userJson.getString("orgName"));
  295 +
  296 + user.setDept(dept);
  297 +
  298 + user.setAvatar(RemoteServerUtils.remote + userJson.getString("elecSignaturePath"));
  299 +
  300 + loginUser.setUser(user);
  301 +
  302 + set.add("*:*:*");// 测试直接给admin
  303 +
  304 + for (Object object : userJson.getJSONArray("menus")) {
  305 + JSONObject menu = (JSONObject) object;
  306 +
  307 + set.add(menu.getString("code"));
  308 + }
  309 +
  310 + SysRole role = new SysRole();
  311 +
  312 + role.setRoleKey("admin");
  313 +
  314 + ArrayList<SysRole> roles = new ArrayList<SysRole>();
  315 +
  316 + roles.add(role);
  317 +
  318 + user.setRoles(roles);
  319 +
  320 + token = token.replace("Bearer ", "").replace("auth:token:", "");
  321 +
  322 + loginUser.setPermissions(set);
  323 +
  324 + loginUser.setToken(token);
  325 + tokenService.refreshToken(loginUser);
  326 +
  327 + // 生成token
  328 + return loginUser;
  329 + }
304 330 }
... ...
trash-quartz/src/main/java/com/trash/quartz/task/DriverTask.java
... ... @@ -603,8 +603,11 @@ public class DriverTask {
603 603 if (TOKEN == null) {
604 604 TOKEN = trashConfig.getToken();
605 605 }
606   -
607   - JSONArray drivers = RemoteServerUtils.getDriverList(TOKEN);
  606 +
  607 + Map map = new HashMap<>();
  608 + map.put("size", "99999");
  609 + map.put("page", "1");
  610 + JSONArray drivers = RemoteServerUtils.getDriverList(TOKEN,map);
608 611  
609 612 for (Object object : drivers) {
610 613  
... ... @@ -640,7 +643,7 @@ public class DriverTask {
640 643  
641 644 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
642 645 Map map = new HashMap<>();
643   - map.put("size", 9999);
  646 + map.put("size", 99999);
644 647 map.put("valid", 0);
645 648 map.put("page", 1);
646 649  
... ... @@ -713,7 +716,7 @@ public class DriverTask {
713 716 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
714 717  
715 718 Map map = new HashMap<>();
716   - map.put("size", 9999);
  719 + map.put("size", 99999);
717 720 map.put("page", 1);
718 721  
719 722 JSONArray companys = RemoteServerUtils.getCompanyList(map, TOKEN);
... ...
trash-ui/dist.7z
No preview for this file type
trash-ui/src/api/dayWorkReport.js
... ... @@ -218,7 +218,7 @@ export default {
218 218 var size = this.queryParams.pageSize;
219 219  
220 220 this.queryParams.page = 1;
221   - this.queryParams.pageSize = 9999;
  221 + this.queryParams.pageSize = 999999;
222 222  
223 223 if (this.queryParams.timeRange) {
224 224 this.queryParams.workStartTime = this.queryParams.timeRange[0];
... ...
trash-ui/src/api/dict.js
1 1 import requestRemote from '@/utils/requestRemote'
2   -
  2 +
3 3 export function getTruckList(params) {
4 4 return requestRemote({
5 5 url: ' /api/gpsservice/cs/basevehicle/simplelist',
6   - method: 'get',
  6 + method: 'get',
7 7 params:params
8 8 });
9   -}
10   -//license/ 先留一下免得又改
  9 +}
  10 +//license/ 先留一下免得又改
11 11 export function constructionLicenseById(id) {
12 12 return requestRemote({
13 13 url: '/api/siteservice/cs/constructionsites/'+id,
14 14 method: 'get',
15 15 });
16 16 }
17   -
  17 +
18 18  
19 19 export function constructionById(id) {
20 20 return requestRemote({
... ... @@ -58,23 +58,23 @@ export function earthsitesList(data) {
58 58 method: 'post',
59 59 data: data
60 60 });
61   -}
62   -
  61 +}
  62 +
63 63 export function constructionsitesLedgerList(data) {
64 64 return requestRemote({
65 65 url: '/api/siteservice/cs/constructionsites/ledger/list',
66 66 method: 'post',
67 67 data: data
68 68 });
69   -}
70   -
  69 +}
  70 +
71 71 export function earthsitesLedgerList(data) {
72 72 return requestRemote({
73 73 url: '/api/siteservice/cs/earthsites/ledger/list',
74 74 method: 'post',
75 75 data: data
76 76 });
77   -}
  77 +}
78 78  
79 79 export function updateEarthsites(data) {
80 80 return requestRemote({
... ... @@ -83,7 +83,7 @@ export function updateEarthsites(data) {
83 83 data: data
84 84 });
85 85 }
86   -
  86 +
87 87  
88 88 export function companyList(data) {
89 89 return requestRemote({
... ... @@ -142,14 +142,14 @@ export function getConstructionTruck(id) {
142 142 url: '/api/siteservice/cs/unitetransport/bysite/' + id,
143 143 method: 'get',
144 144 });
145   -}
  145 +}
146 146  
147 147 export function getTruckInfo(id) {
148 148 return requestRemote({
149 149 url: '/api/gpsservice/cs/basevehicle/' + id,
150 150 method: 'get',
151 151 });
152   -}
  152 +}
153 153  
154 154 export function getCompanyInfo(id) {
155 155 return requestRemote({
... ... @@ -179,15 +179,15 @@ export function getUsers(data){
179 179 method: 'post',
180 180 data:data
181 181 })
182   -}
  182 +}
183 183  
184 184 export function getAuth() {
185 185 return requestRemote({
186 186 url: '/api/gpsservice/cs/authority',
187 187 method: 'get',
188 188 });
189   -}
190   -
  189 +}
  190 +
191 191  
192 192  
193 193 export function getDict(params) {
... ... @@ -205,3 +205,20 @@ export function getSupervision(params) {
205 205 params: params
206 206 });
207 207 }
  208 +
  209 +/**
  210 + * 投放点获取区域数据
  211 + */
  212 +export function getAreaList() {
  213 + return requestRemote({
  214 + url: '/api/siteservice/v1/sites/tree/auth?type=4',
  215 + method: 'get'
  216 + });
  217 +}
  218 +
  219 +export function getAreasList() {
  220 + return requestRemote({
  221 + url: '/api/gisservice/v2/jurisdictions/areas?dict=1',
  222 + method: 'get'
  223 + });
  224 +}
... ...
trash-ui/src/api/taskmethod.js
1   -import {formDataSave, formDataShow, listTask,getNames} from "@/api/activiti/task";
2   -
3   -import {historyFromData} from '@/api/activiti/historyFormdata'
4   -import {addSign, getSignByObjId} from "@/api/sign/sign";
5   -import {updateCaseOffline} from "@/api/caseOffline/caseOffline";
6   -import {updateViolationCaseFileReader} from "@/api/casefile/violationCaseFile";
7   -import {updateViolationCaseFileReader1} from "@/api/casefile/violationWarningInformation";
8   -import {getDict, getSupervision, getUsers} from "@/api/dict";
9   -import {activeThreestep} from "@/api/business/threestep";
10   -import {getToken} from "@/utils/auth";
11   -import {addReplyApprovalProcess} from "@/api/casefile/replyApprovalProcess";
  1 +import {formDataSave, formDataShow, listTask,getNames} from "@/api/activiti/task";
  2 +
  3 +import {historyFromData} from '@/api/activiti/historyFormdata'
  4 +import {addSign, getSignByObjId} from "@/api/sign/sign";
  5 +import {updateCaseOffline} from "@/api/caseOffline/caseOffline";
  6 +import {updateViolationCaseFileReader} from "@/api/casefile/violationCaseFile";
  7 +import {updateViolationCaseFileReader1} from "@/api/casefile/violationWarningInformation";
  8 +import {getDict, getSupervision, getUsers} from "@/api/dict";
  9 +import {activeThreestep} from "@/api/business/threestep";
  10 +import {getToken} from "@/utils/auth";
  11 +import {addReplyApprovalProcess} from "@/api/casefile/replyApprovalProcess";
12 12 import {updateHandleAffairs} from "@/api/office/handle";
13 13 import { listTrack, getTrack} from "@/api/business/track";
14 14  
... ... @@ -155,6 +155,7 @@ export default {
155 155 this.leaveApplicationOpen = false;
156 156 this.company = false;
157 157 this.driver = false;
  158 + this.dropPoint = false;
158 159 this.vehicle = false;
159 160 this.videoSrc1 = [];
160 161 this.slides1 = [];
... ... @@ -317,6 +318,10 @@ export default {
317 318 this.driver = true;
318 319 return;
319 320 }
  321 + if(this.definitionKey == "workflow_drop_point"){
  322 + this.dropPoint = true;
  323 + return;
  324 + }
320 325 this.open = true;
321 326 this.title = "审批";
322 327 });
... ... @@ -561,6 +566,7 @@ export default {
561 566  
562 567 if (
563 568 this.definitionKey.indexOf("supervision") > -1 ||
  569 + this.definitionKey == "workflow_drop_point" ||
564 570 this.definitionKey == "workflow_company" ||
565 571 this.definitionKey == "workflow_driver" ||
566 572 this.definitionKey == "workflow_vehicle" ||
... ...
trash-ui/src/api/three_step.js
... ... @@ -109,7 +109,8 @@ export default {
109 109 companyTrucks: null,
110 110 status:null,
111 111 workStartTime:null,
112   - workEndTime:null,
  112 + workEndTime:null,
  113 + checkStatus:null
113 114 },
114 115 // 表单参数
115 116 form: {
... ... @@ -605,6 +606,7 @@ export default {
605 606 this.queryParams.pageStatus = tabIdx;
606 607 this.queryParams.status = null;
607 608 this.queryParams.his = null;
  609 + this.queryParams.checkStatus = null;
608 610  
609 611 getNames(this.queryParams).then(res => {
610 612  
... ...
trash-ui/src/api/truck_active.js
... ... @@ -298,16 +298,16 @@ export default {
298 298 let list = tres.result.list;
299 299  
300 300 let qr = {
301   - status:0,
302   - constructionId:item.objectId
  301 + status:0
303 302 }
304 303  
305 304 listTruckActivate(qr).then(response => {
306 305 let taList = response.rows;
307 306 for(let i = 0;i< list.length;i++){
308   - if(vids.indexOf(list[i].id) == -1){
309   - continue;
310   - }
  307 + //过滤勾选车辆
  308 + // if(vids.indexOf(list[i].id) == -1){
  309 + // continue;
  310 + // }
311 311 let count = 0;
312 312 for(let j in taList){
313 313 if(taList[j].objectId == list[i].id){
... ...
trash-ui/src/api/vio_warning_info.js
... ... @@ -80,10 +80,10 @@ export default {
80 80 replyPeople:obj.createBy,
81 81 replyTime:obj.createTime
82 82 };
83   -
  83 +
84 84 newRep.push(data);
85 85 }
86   -
  86 +
87 87  
88 88 for(let j in array){
89 89 newRep.push(array[j]);
... ... @@ -97,7 +97,7 @@ export default {
97 97 };
98 98 newRep.push(data);
99 99 }
100   -
  100 +
101 101 this.replyApprovalProcessList = newRep;
102 102 this.$forceUpdate();
103 103 });
... ...
trash-ui/src/api/warningInfo.js
... ... @@ -207,7 +207,16 @@ export default {
207 207 }
208 208  
209 209  
210   - this.getList();
  210 + this.getList();
  211 +
  212 +
  213 +
  214 + setInterval(() => {
  215 + console.log("getList");
  216 + this.getList();
  217 + }, 60000);
  218 +
  219 +
211 220 },
212 221 methods: {
213 222 getCaseStatus(item){
... ... @@ -245,8 +254,7 @@ export default {
245 254 return type;
246 255 },
247 256 /** 查询违规预警信息列表 */
248   - getList() {
249   - this.loading = true;
  257 + getList() {
250 258 if(this.queryParams.createTime){
251 259 this.queryParams.startTime = this.queryParams.createTime[0];
252 260 this.queryParams.endTime = this.queryParams.createTime[1];
... ... @@ -431,7 +439,7 @@ export default {
431 439 }
432 440 if(query.owningRegion)
433 441 query.owningRegion = query.owningRegion + ""
434   -
  442 +
435 443 query.createTime = null;
436 444  
437 445 this.$confirm('是否确认导出所有违规预警信息数据项?', "警告", {
... ...
trash-ui/src/utils/trash.js
... ... @@ -153,9 +153,9 @@ export function handleTree(data, id, parentId, children, rootId) {
153 153 * @returns {string}
154 154 */
155 155 export function parseStatus(status) {
156   - if(status==1){
  156 + if(status==='1'){
157 157 return "审批通过";
158   - }else if(status==2){
  158 + }else if(status==='2'){
159 159 return "审批驳回";
160 160 }else{
161 161 return "审批中";
... ...
trash-ui/src/views/activiti/task/dropPointinfo.vue 0 → 100644
  1 +<template>
  2 + <div>
  3 + <el-form ref="form" :model="infoData" label-width="148px">
  4 +
  5 + <el-form-item label="投放点编号" prop="dropPointNo">
  6 + <el-input v-model="infoData.dropPointNo" placeholder="请输入投放点编号" :disabled="true"/>
  7 + </el-form-item>
  8 +
  9 + <el-form-item label="投放点名称" prop="dropPointName">
  10 + <el-input v-model="infoData.dropPointName" placeholder="请输入投放点名称" :disabled="true"/>
  11 + </el-form-item>
  12 +
  13 + <el-form-item label="所属区域" prop="district">
  14 + <el-input v-model="infoData.district" placeholder="请输入区域" :disabled="true"/>
  15 + </el-form-item>
  16 +
  17 + <el-form-item label="所属街道" prop="street">
  18 + <el-input v-model="infoData.street" placeholder="请输入街道" :disabled="true"/>
  19 + </el-form-item>
  20 +
  21 + <el-form-item label="社区" prop="community">
  22 + <el-input v-model="infoData.community" placeholder="请输入社区" :disabled="true"/>
  23 + </el-form-item>
  24 +
  25 + <el-form-item label="所属小区" prop="street">
  26 + <el-input v-model="infoData.plot" placeholder="请输入小区" :disabled="true"/>
  27 + </el-form-item>
  28 +
  29 + <el-form-item label="详细地址" prop="address">
  30 + <el-input v-model="infoData.address" placeholder="请输入详细地址" :disabled="true"/>
  31 + </el-form-item>
  32 +
  33 + <el-form-item label="是否为实行物业管理的区域(小区)" prop="type">
  34 + <el-select v-model="infoData.type" placeholder="请选择是否为实行物业管理的区域(小区)" :disabled="true" style="width: 100%">
  35 + <el-option label="是" value="是"/>
  36 + <el-option label="否" value="否"/>
  37 + </el-select>
  38 + </el-form-item>
  39 +
  40 + <el-form-item label="投放点面积(m²)" prop="area" :disabled="true">
  41 + <el-input v-model="infoData.area" placeholder="请输入投放点面积" :disabled="true"/>
  42 + </el-form-item>
  43 +
  44 + <el-form-item label="投放点容量(m³)" prop="capacity">
  45 + <el-input v-model="infoData.capacity" placeholder="请输入投放点容量" :disabled="true"/>
  46 + </el-form-item>
  47 +
  48 + <el-form-item label="管理单位" prop="managementUnit">
  49 + <el-input v-model="infoData.managementUnit" placeholder="请输入管理单位" :disabled="true"/>
  50 + </el-form-item>
  51 +
  52 + <el-form-item label="管理员" prop="custodian">
  53 + <el-input v-model="infoData.custodian" placeholder="请输入管理员" :disabled="true"/>
  54 + </el-form-item>
  55 +
  56 + <el-form-item label="管理员电话" prop="custodianPhone">
  57 + <el-input v-model="infoData.custodianPhone" placeholder="请输入管理员联系电话" :maxlength="11" show-word-limit :disabled="true"/>
  58 + </el-form-item>
  59 +
  60 + <el-form-item label="投放时间" prop="dropTime">
  61 + <el-time-select
  62 + v-model="infoData.dropTime[0]"
  63 + style="width: 50%"
  64 + :picker-options="{
  65 + start: '00:00',
  66 + step: '00:30',
  67 + end: '23:30'
  68 + }"
  69 + :disabled="true"
  70 + placeholder="选择时间">
  71 + </el-time-select>
  72 + <el-time-select
  73 + v-model="infoData.dropTime[1]"
  74 + style="width: 50%"
  75 + :picker-options="{
  76 + start: '00:00',
  77 + step: '00:30',
  78 + end: '23:30'
  79 + }"
  80 + :disabled="true"
  81 + placeholder="选择时间">
  82 + </el-time-select>
  83 + </el-form-item>
  84 +
  85 + <el-form-item label="运营单位" prop="operatingUnit">
  86 + <el-input v-model="infoData.operatingUnit" placeholder="请输入运营单位" :disabled="true" />
  87 + </el-form-item>
  88 +
  89 + <el-form-item label="运输单位" prop="transportUnit">
  90 + <el-input v-model="infoData.transportUnit" placeholder="请输入运输单位" :disabled="true"/>
  91 + </el-form-item>
  92 +
  93 + <el-form-item label="坐标点" prop="coordinatePoint">
  94 + <el-input v-model="infoData.coordinatePoint" placeholder="请输入坐标点经纬度" :disabled="true"/>
  95 + </el-form-item>
  96 + <!-- <el-button type="primary" @click="handleOpenMap">坐标点</el-button>-->
  97 +
  98 + </el-form>
  99 + </div>
  100 +</template>
  101 +
  102 +<script>
  103 +
  104 +
  105 +import store from "@/store";
  106 +import {
  107 + getToken
  108 +} from "@/utils/auth";
  109 +import {
  110 + listDropPointInfo,
  111 + getDropPointInfo,
  112 + delDropPointInfo,
  113 + addDropPointInfo,
  114 + updateDropPointInfo,
  115 + exportDropPointInfo
  116 +} from "@/api/unit/dropPointInfo";
  117 +import {getAreaList} from "@/api/dict"
  118 +
  119 +
  120 +
  121 +
  122 +export default {
  123 + name: "dropPointinfo",
  124 + props: {
  125 + businessKey: {
  126 + type: String
  127 + },
  128 + },
  129 + data() {
  130 + return {
  131 + sign: store.getters.avatar, //裁剪图片的地址
  132 + areas: [],
  133 + loading: null,
  134 + infoData: {},
  135 + dicts:null,
  136 + showPic:false,
  137 + picImage:null,
  138 + }
  139 + },
  140 + created() {
  141 + getAreaList().then(response => {
  142 + if(response==null || response.length===0){
  143 + this.$message.error("获取区域列表失败");
  144 + return;
  145 + }
  146 + const data = response;
  147 + for (let dataKey in data) {
  148 + if(data[dataKey].level === '3'){
  149 + this.areas.push({name:data[dataKey].name,code:data[dataKey].id, streets:[]})
  150 + }
  151 + }
  152 + for(let dataKey in data){
  153 + for(let areas1Key in this.areas){
  154 + if(data[dataKey].pid === this.areas[areas1Key].code){
  155 + this.areas[areas1Key].streets.push({code:data[dataKey].id, name:data[dataKey].name})
  156 + }
  157 + }
  158 + }
  159 + });
  160 + this.loading = true;
  161 + this.getInfo();
  162 +
  163 + },
  164 + methods: {
  165 + dict(code) {
  166 + for (let key in this.areas) {
  167 + if (this.areas[key].code === code) {
  168 + return this.areas[key].name;
  169 + }
  170 + }
  171 + },
  172 + dictInfo(code) {
  173 + for (let key in this.areas) {
  174 + for (let keyInfo in this.areas[key].streets) {
  175 + if (this.areas[key].streets[keyInfo].code === code) {
  176 + return this.areas[key].streets[keyInfo].name;
  177 + }
  178 + }
  179 + }
  180 + },
  181 + getInfo() {
  182 + let id;
  183 + if (this.businessKey.split(":").length == 2) {
  184 + id = this.businessKey.split(":")[1];
  185 + } else {
  186 + id = this.businessKey;
  187 + }
  188 +
  189 + getDropPointInfo(id).then(response => {
  190 +
  191 + this.infoData = response.data;
  192 + this.infoData.dropTime = response.data.dropTime.split("~");
  193 + // getArea().then(res => {
  194 + // this.areas = res.result;
  195 + // this.loading = false;
  196 + // for (let i = 0; i < this.areas.length; i++) {
  197 + // if (Number(this.infoData.place) == this.areas[i].code) {
  198 + // this.infoData.place = this.areas[i].name;
  199 + // }
  200 + // }
  201 + // });
  202 +
  203 + // for(let i in obj){
  204 + // if(this.objectDict[i]){
  205 + // this.infoData.push({label:this.objectDict[i] ,value:obj[i]})
  206 + // }
  207 + // }
  208 + this.loading = false;
  209 + });
  210 + },
  211 + }
  212 +
  213 +}
  214 +</script>
  215 +<style>
  216 +.bd{
  217 + padding:5px;
  218 +}
  219 +
  220 +
  221 +
  222 +</style>
... ...
trash-ui/src/views/activiti/task/index.vue
... ... @@ -406,7 +406,27 @@
406 406 <el-button type="primary" @click="submitForm(form.formData[0].controlId ,0)">通过</el-button>
407 407 </div>
408 408 </el-dialog>
409   -
  409 +
  410 +
  411 + <!-- 投放点 -->
  412 + <el-dialog :title="title" :visible.sync="dropInfoOpen" width="500px" append-to-body
  413 + :close-on-click-modal="false">
  414 + <dropInfo :idInfo="idInfo" v-if="dropInfoOpen"/>
  415 + <el-table :data="hisfromData" v-if="hisfromData != null">
  416 + <div v-for="item in this.form.formData">
  417 + <el-input v-if="item.controlType=='textarea'" :label="item.controlLable" v-model="item.controlValue"
  418 + placeholder="批注" type="textarea" :rows="3" style="margin-top:20px;"/>
  419 + </div>
  420 + <el-table-column label="处理意见" align="center" prop="controlValue"/>
  421 + <el-table-column label="处理人" align="center" prop="createName"/>
  422 + <el-table-column label="处理时间" align="center" prop="createTime"/>
  423 + </el-table>
  424 + <div slot="footer" class="dialog-footer">
  425 + <el-button type="danger" @click="submitForm(form.formData[0].controlId,1)">驳回</el-button>
  426 + <el-button type="primary" @click="submitForm(form.formData[0].controlId,0)">通过</el-button>
  427 + </div>
  428 + </el-dialog>
  429 +
410 430 <!-- 后勤管理 -->
411 431 <el-dialog :title="title" :visible.sync="logisticsInfoOpen" width="500px" append-to-body
412 432 :close-on-click-modal="false">
... ... @@ -658,6 +678,25 @@
658 678 </div>
659 679 </el-dialog>
660 680  
  681 + <el-dialog :title="title" :visible.sync="dropPoint" width="1500px" append-to-body :close-on-click-modal="false">
  682 + <dropPointinfo :businessKey="businessKey" :businessType="5" v-if="dropPoint"/>
  683 + <div v-for="item in this.form.formData">
  684 + <el-input v-if="item.controlType=='textarea'" :label="item.controlLable" v-model="item.controlValue"
  685 + placeholder="批注" type="textarea" :rows="3" style="margin-top:20px;"/>
  686 + </div>
  687 +
  688 + <el-table :data="hisfromData" v-if="hisfromData != null">
  689 +
  690 + <el-table-column label="处理意见" align="center" prop="controlValue"/>
  691 + <el-table-column label="处理人" align="center" prop="createName"/>
  692 + <el-table-column label="处理时间" align="center" prop="createTime"/>
  693 + </el-table>
  694 + <div slot="footer" class="dialog-footer">
  695 + <el-button type="danger" @click="submitForm(form.formData[0].controlId,1)">驳回</el-button>
  696 + <el-button type="primary" @click="submitForm(form.formData[0].controlId,0)">通过</el-button>
  697 + </div>
  698 + </el-dialog>
  699 +
661 700 </div>
662 701 </template>
663 702  
... ... @@ -696,6 +735,7 @@
696 735 import companyInfo from "@/views/activiti/task/companyInfo";
697 736 import driverInfo from "@/views/activiti/task/driverInfo";
698 737 import vehicleInfo from "@/views/activiti/task/vehicleInfo";
  738 + import dropPointinfo from "@/views/activiti/task/dropPointinfo";
699 739  
700 740 import taskmethod from '@/api/taskmethod'
701 741  
... ... @@ -720,7 +760,8 @@
720 760 supervisionInfo,
721 761 companyInfo,
722 762 driverInfo,
723   - vehicleInfo
  763 + vehicleInfo,
  764 + dropPointinfo
724 765 },
725 766 data() {
726 767 return {
... ... @@ -816,6 +857,7 @@
816 857 company: false,
817 858 driver: false,
818 859 vehicle: false,
  860 + dropPoint: false,
819 861 names: null,
820 862 hisfromData: [],
821 863 slides: [],
... ...
trash-ui/src/views/business/threestep/index.vue
... ... @@ -48,6 +48,12 @@
48 48 value-format="yyyy-MM-dd HH:mm:ss" placeholder="开始时间">
49 49 </el-date-picker>
50 50 </el-form-item>
  51 + <el-form-item label="抽查状态" prop="checkStatus" v-if="this.queryParams.his==1">
  52 + <el-select v-model="queryParams.checkStatus" placeholder="请选择抽查状态" size="small">
  53 + <el-option label="未抽查" value="0" />
  54 + <el-option label="已抽查" value="1" />
  55 + </el-select>
  56 + </el-form-item>
51 57  
52 58  
53 59 <el-form-item>
... ...
trash-ui/src/views/h5/task/dropPointinfo.vue 0 → 100644
  1 +<template>
  2 + <div>
  3 + <el-form ref="form" :model="infoData" label-width="148px">
  4 +
  5 + <el-form-item label="投放点编号" prop="dropPointNo">
  6 + <el-input v-model="infoData.dropPointNo" placeholder="请输入投放点编号" :disabled="true"/>
  7 + </el-form-item>
  8 +
  9 + <el-form-item label="投放点名称" prop="dropPointName">
  10 + <el-input v-model="infoData.dropPointName" placeholder="请输入投放点名称" :disabled="true"/>
  11 + </el-form-item>
  12 +
  13 + <el-form-item label="所属区域" prop="district">
  14 + <el-input v-model="infoData.district" placeholder="请输入区域" :disabled="true"/>
  15 + </el-form-item>
  16 +
  17 + <el-form-item label="所属街道" prop="street">
  18 + <el-input v-model="infoData.street" placeholder="请输入街道" :disabled="true"/>
  19 + </el-form-item>
  20 +
  21 + <el-form-item label="社区" prop="community">
  22 + <el-input v-model="infoData.community" placeholder="请输入社区" :disabled="true"/>
  23 + </el-form-item>
  24 +
  25 + <el-form-item label="所属小区" prop="street">
  26 + <el-input v-model="infoData.plot" placeholder="请输入小区" :disabled="true"/>
  27 + </el-form-item>
  28 +
  29 + <el-form-item label="详细地址" prop="address">
  30 + <el-input v-model="infoData.address" placeholder="请输入详细地址" :disabled="true"/>
  31 + </el-form-item>
  32 +
  33 + <el-form-item label="是否为实行物业管理的区域(小区)" prop="type">
  34 + <el-select v-model="infoData.type" placeholder="请选择是否为实行物业管理的区域(小区)" :disabled="true" style="width: 100%">
  35 + <el-option label="是" value="是"/>
  36 + <el-option label="否" value="否"/>
  37 + </el-select>
  38 + </el-form-item>
  39 +
  40 + <el-form-item label="投放点面积(m²)" prop="area" :disabled="true">
  41 + <el-input v-model="infoData.area" placeholder="请输入投放点面积" :disabled="true"/>
  42 + </el-form-item>
  43 +
  44 + <el-form-item label="投放点容量(m³)" prop="capacity">
  45 + <el-input v-model="infoData.capacity" placeholder="请输入投放点容量" :disabled="true"/>
  46 + </el-form-item>
  47 +
  48 + <el-form-item label="管理单位" prop="managementUnit">
  49 + <el-input v-model="infoData.managementUnit" placeholder="请输入管理单位" :disabled="true"/>
  50 + </el-form-item>
  51 +
  52 + <el-form-item label="管理员" prop="custodian">
  53 + <el-input v-model="infoData.custodian" placeholder="请输入管理员" :disabled="true"/>
  54 + </el-form-item>
  55 +
  56 + <el-form-item label="管理员电话" prop="custodianPhone">
  57 + <el-input v-model="infoData.custodianPhone" placeholder="请输入管理员联系电话" :maxlength="11" show-word-limit :disabled="true"/>
  58 + </el-form-item>
  59 +
  60 + <el-form-item label="投放时间" prop="dropTime">
  61 + <el-time-select
  62 + v-model="infoData.dropTime[0]"
  63 + style="width: 50%"
  64 + :picker-options="{
  65 + start: '00:00',
  66 + step: '00:30',
  67 + end: '23:30'
  68 + }"
  69 + :disabled="true"
  70 + placeholder="选择时间">
  71 + </el-time-select>
  72 + <el-time-select
  73 + v-model="infoData.dropTime[1]"
  74 + style="width: 50%"
  75 + :picker-options="{
  76 + start: '00:00',
  77 + step: '00:30',
  78 + end: '23:30'
  79 + }"
  80 + :disabled="true"
  81 + placeholder="选择时间">
  82 + </el-time-select>
  83 + </el-form-item>
  84 +
  85 + <el-form-item label="运营单位" prop="operatingUnit">
  86 + <el-input v-model="infoData.operatingUnit" placeholder="请输入运营单位" :disabled="true" />
  87 + </el-form-item>
  88 +
  89 + <el-form-item label="运输单位" prop="transportUnit">
  90 + <el-input v-model="infoData.transportUnit" placeholder="请输入运输单位" :disabled="true"/>
  91 + </el-form-item>
  92 +
  93 + <el-form-item label="坐标点" prop="coordinatePoint">
  94 + <el-input v-model="infoData.coordinatePoint" placeholder="请输入坐标点经纬度" :disabled="true"/>
  95 + </el-form-item>
  96 + <!-- <el-button type="primary" @click="handleOpenMap">坐标点</el-button>-->
  97 +
  98 + </el-form>
  99 + </div>
  100 +</template>
  101 +
  102 +<script>
  103 +
  104 +
  105 +import store from "@/store";
  106 +import {
  107 + getToken
  108 +} from "@/utils/auth";
  109 +import {
  110 + listDropPointInfo,
  111 + getDropPointInfo,
  112 + delDropPointInfo,
  113 + addDropPointInfo,
  114 + updateDropPointInfo,
  115 + exportDropPointInfo
  116 +} from "@/api/unit/dropPointInfo";
  117 +import {getAreaList} from "@/api/dict"
  118 +
  119 +
  120 +
  121 +
  122 +export default {
  123 + name: "dropPointinfo",
  124 + props: {
  125 + businessKey: {
  126 + type: String
  127 + },
  128 + },
  129 + data() {
  130 + return {
  131 + sign: store.getters.avatar, //裁剪图片的地址
  132 + areas: [],
  133 + loading: null,
  134 + infoData: {},
  135 + dicts:null,
  136 + showPic:false,
  137 + picImage:null,
  138 + }
  139 + },
  140 + created() {
  141 + getAreaList().then(response => {
  142 + if(response==null || response.length===0){
  143 + this.$message.error("获取区域列表失败");
  144 + return;
  145 + }
  146 + const data = response;
  147 + for (let dataKey in data) {
  148 + if(data[dataKey].level === '3'){
  149 + this.areas.push({name:data[dataKey].name,code:data[dataKey].id, streets:[]})
  150 + }
  151 + }
  152 + for(let dataKey in data){
  153 + for(let areas1Key in this.areas){
  154 + if(data[dataKey].pid === this.areas[areas1Key].code){
  155 + this.areas[areas1Key].streets.push({code:data[dataKey].id, name:data[dataKey].name})
  156 + }
  157 + }
  158 + }
  159 + });
  160 + this.loading = true;
  161 + this.getInfo();
  162 +
  163 + },
  164 + methods: {
  165 + dict(code) {
  166 + for (let key in this.areas) {
  167 + if (this.areas[key].code === code) {
  168 + return this.areas[key].name;
  169 + }
  170 + }
  171 + },
  172 + dictInfo(code) {
  173 + for (let key in this.areas) {
  174 + for (let keyInfo in this.areas[key].streets) {
  175 + if (this.areas[key].streets[keyInfo].code === code) {
  176 + return this.areas[key].streets[keyInfo].name;
  177 + }
  178 + }
  179 + }
  180 + },
  181 + getInfo() {
  182 + let id;
  183 + if (this.businessKey.split(":").length == 2) {
  184 + id = this.businessKey.split(":")[1];
  185 + } else {
  186 + id = this.businessKey;
  187 + }
  188 +
  189 + getDropPointInfo(id).then(response => {
  190 +
  191 + this.infoData = response.data;
  192 + this.infoData.dropTime = response.data.dropTime.split("~");
  193 + // getArea().then(res => {
  194 + // this.areas = res.result;
  195 + // this.loading = false;
  196 + // for (let i = 0; i < this.areas.length; i++) {
  197 + // if (Number(this.infoData.place) == this.areas[i].code) {
  198 + // this.infoData.place = this.areas[i].name;
  199 + // }
  200 + // }
  201 + // });
  202 +
  203 + // for(let i in obj){
  204 + // if(this.objectDict[i]){
  205 + // this.infoData.push({label:this.objectDict[i] ,value:obj[i]})
  206 + // }
  207 + // }
  208 + this.loading = false;
  209 + });
  210 + },
  211 + }
  212 +
  213 +}
  214 +</script>
  215 +<style>
  216 +.bd{
  217 + padding:5px;
  218 +}
  219 +
  220 +
  221 +
  222 +</style>
... ...
trash-ui/src/views/h5/task/violationCaseFileInfo.vue
1 1 <template>
2   - <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  2 + <el-form ref="form" :model="form" label-width="80px">
3 3  
4 4 <el-form-item label="预警编号" prop="number">
5 5 <el-input v-model="form.number" placeholder="请输入预警编号" :disabled="true"/>
... ...
trash-ui/src/views/h5/task/violationWarningInformationInfo.vue
1 1 <template>
2   - <el-form ref="form" :model="form" :rules="rules" label-width="85px">
  2 + <el-form ref="form" :model="form" label-width="85px">
3 3  
4 4 <el-form-item label="案卷编号" prop="number">
5 5 <el-input v-model="form.number" placeholder="请输入案卷编号" :disabled="true"/>
... ...
trash-ui/src/views/h5/threestep/index.vue
... ... @@ -30,6 +30,13 @@
30 30 format="yyyy-MM-dd HH:mm:ss"
31 31 value-format="yyyy-MM-dd HH:mm:ss" placeholder="结束时间">
32 32 </el-date-picker>
  33 + </el-form-item>
  34 +
  35 + <el-form-item label="抽查状态" prop="checkStatus" v-if="this.queryParams.his==1">
  36 + <el-select v-model="queryParams.checkStatus" placeholder="请选择抽查状态" size="small">
  37 + <el-option label="未抽查" value="0" />
  38 + <el-option label="已抽查" value="1" />
  39 + </el-select>
33 40 </el-form-item>
34 41 <el-form-item>
35 42 <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
... ... @@ -67,13 +74,23 @@
67 74 <el-col :span="24">
68 75 <div>巡查时间:{{item.checkTime}}</div>
69 76 </el-col>
70   - </el-row>
  77 + </el-row>
  78 +
  79 + <el-row class="card_row" style="margin-top: 20px;" v-if="queryParams.pageStatus==1">
  80 + <el-col :span="24">
  81 + <div>抽查时间:{{item.checkEndTime}}</div>
  82 + </el-col>
  83 + </el-row>
  84 +
  85 +
71 86  
72 87 <span v-if="item.status==3">已停工"</span>
73 88  
74 89  
75   - <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(item,0)" v-hasPermi="['business:threestep:edit']" v-if="queryParams.pageStatus==1 && item.status==1 && item.checkEndTime == null">抽查</el-button>
76   - <el-button size="mini" type="text" icon="el-icon-edit" @click="reSub(item)" v-hasPermi="['business:threestep:add']" v-if="item.status==2">被驳回</el-button>
  90 + <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(item,0)"
  91 + v-if="queryParams.pageStatus==1 && item.status==1 && item.checkEndTime == null
  92 + && checkPer(['business.supervision.threestep.spot'])">抽查</el-button>
  93 + <el-button size="mini" type="text" icon="el-icon-edit" @click="reSub(item)" v-hasPermi="['business:threestep:add']" v-if="item.status==2">被驳回</el-button>
77 94  
78 95  
79 96 <el-button size="mini" type="text" @click="handleUpdate(item,1)" v-hasPermi="['business:threestep:edit']">查看详情</el-button>
... ...
trash-ui/src/views/h5/truckActivate/index.vue
... ... @@ -49,8 +49,8 @@
49 49 placeholder="结束日期">
50 50 </el-date-picker>
51 51 </el-form-item>
52   -
53   -
  52 +
  53 +
54 54 <el-form-item>
55 55 <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
56 56 <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
... ... @@ -120,7 +120,7 @@
120 120 <el-form ref="form" :model="form" :rules="rules" label-width="80px">
121 121 <el-form-item label="所属工地" prop="construction">
122 122 <el-select v-model="form.construction" placeholder="请选择所属工地" filterable reserve-keyword @change="getCompany">
123   - <el-option v-for="item in constList" :label="item.name" :value="item.name" ></el-option>
  123 + <el-option class="custom-option" v-for="item in constList" :label="item.name" :value="item.name" ></el-option>
124 124 </el-select>
125 125 </el-form-item>
126 126 <el-form-item label="所属企业" prop="company">
... ... @@ -157,4 +157,11 @@
157 157 .el-select-dropdown__item{
158 158 width:300px;
159 159 }
  160 + .el-select-dropdown__item.hover, .el-select-dropdown__item:hover{
  161 + height:auto;
  162 + }
  163 + .custom-option {
  164 + white-space: normal; /* 允许文本换行 */
  165 + word-wrap: break-word; /* 在长单词或URL地址内部进行换行 */
  166 + }
160 167 </style>
... ...
trash-ui/src/views/unit/dropPointInfo/index.vue
... ... @@ -19,11 +19,11 @@
19 19 @keyup.enter.native="handleQuery"
20 20 />
21 21 </el-form-item>
22   - <el-form-item label="投放点形式" prop="type">
23   - <el-select v-model="queryParams.type" placeholder="请选择投放点形式" clearable size="small">
  22 + <el-form-item label="是否为实行物业管理的区域(小区)" prop="type">
  23 + <el-select v-model="queryParams.type" placeholder="请选择是否为实行物业管理的区域(小区)" clearable size="small">
24 24 <el-option label="全部" value=""/>
25   - <el-option label="固定" value="固定"/>
26   - <el-option label="临时" value="临时"/>
  25 + <el-option label="是" value="是"/>
  26 + <el-option label="否" value="否"/>
27 27 </el-select>
28 28 </el-form-item>
29 29 <el-form-item>
... ... @@ -81,23 +81,39 @@
81 81 <el-table v-loading="loading" :data="dropPointInfoList" @selection-change="handleSelectionChange">
82 82 <el-table-column type="selection" width="55" align="center"/>
83 83 <el-table-column label="投放点名称" align="center" prop="dropPointName"/>
84   - <el-table-column label="所属区域" align="center" prop="district"/>
85   - <el-table-column label="所属街道" align="center" prop="street"/>
  84 + <el-table-column label="所属区域" align="center" prop="district">
  85 + <template slot-scope="scope">
  86 + <span>{{ dict(scope.row.district) }}</span>
  87 + </template>
  88 + </el-table-column>
  89 + <el-table-column label="所属街道" align="center" prop="street">
  90 + <template slot-scope="scope">
  91 + <span>{{
  92 + dictInfo(scope.row.street)
  93 + }}</span>
  94 + </template>
  95 + </el-table-column>
86 96 <el-table-column label="社区" align="center" prop="community"/>
  97 + <el-table-column label="小区" align="center" prop="plot"/>
87 98 <el-table-column label="详细地址" align="center" prop="address"/>
88 99 <el-table-column label="投放点形式" align="center" prop="type"/>
89 100 <el-table-column label="投放点面积(m²)" align="center" prop="area"/>
90 101 <el-table-column label="投放点容量(m³)" align="center" prop="capacity"/>
91 102 <el-table-column label="管理单位" align="center" prop="managementUnit"/>
92   - <el-table-column label="管理" align="center" prop="custodian"/>
  103 + <el-table-column label="管理" align="center" prop="custodian"/>
93 104 <el-table-column label="管理员电话" align="center" prop="custodianPhone"/>
94 105 <el-table-column label="投放时间" align="center" prop="dropTime" width="180"/>
95 106 <el-table-column label="投放点编号" align="center" prop="dropPointNo"/>
96 107 <el-table-column label="运营单位" align="center" prop="operatingUnit"/>
97 108 <el-table-column label="运输单位" align="center" prop="transportUnit"/>
  109 + <el-table-column label="审批状态" align="center" prop="status">
  110 + <template slot-scope="scope">
  111 + <span>{{ parseStatus(scope.row.status) }}</span>
  112 + </template>
  113 + </el-table-column>
98 114 <el-table-column label="创建时间" align="center" prop="createTime" width="180">
99 115 <template slot-scope="scope">
100   - <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}-{i}-{s}') }}</span>
  116 + <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
101 117 </template>
102 118 </el-table-column>
103 119 <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
... ... @@ -132,123 +148,106 @@
132 148  
133 149 <!-- 添加或修改投放点信息管理对话框 -->
134 150 <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
135   - <el-form ref="form" :model="form" :rules="rules" label-width="128px">
136   - <el-row>
137   - <el-col :span="12">
  151 + <el-form ref="form" :model="form" :rules="rules" label-width="148px">
  152 +
138 153 <el-form-item label="投放点编号" prop="dropPointNo">
139 154 <el-input v-model="form.dropPointNo" placeholder="请输入投放点编号" :disabled="true"/>
140 155 </el-form-item>
141   - </el-col>
142   - <el-col :span="12">
  156 +
143 157 <el-form-item label="投放点名称" prop="dropPointName">
144 158 <el-input v-model="form.dropPointName" placeholder="请输入投放点名称"/>
145 159 </el-form-item>
146   - </el-col>
147   - </el-row>
148   - <el-row>
149   - <el-col :span="12">
  160 +
150 161 <el-form-item label="所属区域" prop="street">
151 162 <el-select v-model="form.district" placeholder="请输入所属区域" style="width: 100%" clearable @change="getStreets">
152   - <el-option v-for="(area,index) in areas" :label="area.name" :value="area.name" :key="index"/>
  163 + <el-option v-for="(area,index) in areas" :label="area.name" :value="area.code" :key="index"/>
153 164 </el-select>
154 165 </el-form-item>
155   - </el-col>
156   - <el-col :span="12">
  166 +
157 167 <el-form-item label="所属街道" prop="street">
158   - <el-select v-model="form.street" placeholder="请输入所属街道" style="width: 100%" clearable>
159   - <el-option v-for="(area,index) in streets" :label="area.name" :value="area.name" :key="area.code" @click.native="createDropPointNo(area)"/>
  168 + <el-select v-model="form.street" placeholder="请输入所属街道" style="width: 100%" clearable @change="getCommunitys">
  169 + <el-option v-for="(area,index) in streets" :label="area.name" :value="area.code" :key="area.code"/>
160 170 </el-select>
161 171 </el-form-item>
162 172  
163   - </el-col>
164   - </el-row>
165   - <el-row>
166   - <el-col :span="12">
167   - <el-form-item label="社区" prop="community">
168   - <el-input v-model="form.community" placeholder="请输入社区"/>
169   - </el-form-item>
  173 + <el-form-item label="社区" prop="community">
  174 + <el-select v-model="form.community" placeholder="请输入所属社区" style="width: 100%" clearable>
  175 + <el-option v-for="(area,index) in communitys" :label="area.name" :value="area.code" :key="area.code" @click.native="createDropPointNo(area,'community')"/>
  176 + </el-select>
  177 + </el-form-item>
  178 +
  179 + <el-form-item label="小区" prop="plot">
  180 + <el-input v-model="form.plot" placeholder="请输入小区"/>
  181 + </el-form-item>
170 182  
171   - </el-col>
172   - <el-col :span="12">
173 183 <el-form-item label="详细地址" prop="address">
174 184 <el-input v-model="form.address" placeholder="请输入详细地址"/>
175 185 </el-form-item>
176   - </el-col>
177   - </el-row>
178   - <el-row>
179   - <el-col :span="12">
180   - <el-form-item label="投放点形式" prop="type">
181   - <el-select v-model="form.type" placeholder="请选择投放点形式" style="width: 100%">
182   - <el-option label="固定" value="固定"/>
183   - <el-option label="临时" value="临时"/>
  186 +
  187 + <el-form-item label="是否为实行物业管理的区域(小区)" prop="type">
  188 + <el-select v-model="form.type" placeholder="请选择是否为实行物业管理的区域(小区)" style="width: 100%">
  189 + <el-option label="是" value="是"/>
  190 + <el-option label="否" value="否"/>
184 191 </el-select>
185 192 </el-form-item>
186 193  
187   - </el-col>
188   - <el-col :span="12">
189 194 <el-form-item label="投放点面积(m²)" prop="area">
190 195 <el-input v-model="form.area" placeholder="请输入投放点面积"/>
191 196 </el-form-item>
192   - </el-col>
193   - </el-row>
194   - <el-row>
195   - <el-col :span="12">
  197 +
196 198 <el-form-item label="投放点容量(m³)" prop="capacity">
197 199 <el-input v-model="form.capacity" placeholder="请输入投放点容量"/>
198 200 </el-form-item>
199   - </el-col>
200   - <el-col :span="12">
  201 +
201 202 <el-form-item label="管理单位" prop="managementUnit">
202 203 <el-input v-model="form.managementUnit" placeholder="请输入管理单位"/>
203 204 </el-form-item>
204   - </el-col>
205   - </el-row>
206   - <el-row>
207   - <el-col :span="12">
208   - <el-form-item label="管理人" prop="custodian">
209   - <el-input v-model="form.custodian" placeholder="请输入管理人"/>
  205 +
  206 + <el-form-item label="管理员" prop="custodian">
  207 + <el-input v-model="form.custodian" placeholder="请输入管理员"/>
210 208 </el-form-item>
211   - </el-col>
212   - <el-col :span="12">
  209 +
213 210 <el-form-item label="管理员电话" prop="custodianPhone">
214 211 <el-input v-model="form.custodianPhone" placeholder="请输入管理员联系电话" :maxlength="11" show-word-limit/>
215 212 </el-form-item>
216   - </el-col>
217   - </el-row>
218   - <el-row>
219   - <el-col :span="12">
220   - <el-form-item label="投放时间" prop="dropTime">
  213 +
  214 + <el-form-item label="投放时间" prop="dropTime" v-if="dropTime">
221 215 <el-time-select
  216 + placeholder="起始时间"
222 217 v-model="form.dropTime"
223   - style="width: 100%"
  218 + style="width: 50%"
224 219 :picker-options="{
225   - start: '00:00',
226   - step: '00:30',
227   - end: '23:30'
228   - }"
229   - placeholder="选择时间">
  220 + start: '00:00',
  221 + step: '00:15',
  222 + end: '23:45'
  223 + }">
  224 + </el-time-select>
  225 + <el-time-select
  226 + placeholder="结束时间"
  227 + v-model="endTime"
  228 + style="width: 50%"
  229 + :picker-options="{
  230 + start: '00:15',
  231 + step: '00:15',
  232 + end: '24:00',
  233 + minTime: form.dropTime
  234 + }">
230 235 </el-time-select>
231 236 </el-form-item>
232   - </el-col>
233   - <el-col :span="12">
  237 +
234 238 <el-form-item label="运营单位" prop="operatingUnit">
235 239 <el-input v-model="form.operatingUnit" placeholder="请输入运营单位"/>
236 240 </el-form-item>
237   - </el-col>
238   - </el-row>
239   - <el-row>
240   - <el-col :span="12">
  241 +
241 242 <el-form-item label="运输单位" prop="transportUnit">
242 243 <el-input v-model="form.transportUnit" placeholder="请输入运输单位"/>
243 244 </el-form-item>
244   - </el-col>
245   - <el-col :span="12">
  245 +
246 246 <el-form-item label="坐标点" prop="coordinatePoint">
247 247 <el-input v-model="form.coordinatePoint" placeholder="请输入坐标点经纬度" readonly @click.native="handleOpenMap"/>
248 248 </el-form-item>
249 249 <!-- <el-button type="primary" @click="handleOpenMap">坐标点</el-button>-->
250   - </el-col>
251   - </el-row>
  250 +
252 251 </el-form>
253 252 <div slot="footer" class="dialog-footer">
254 253 <el-button type="primary" @click="submitForm">确 定</el-button>
... ... @@ -302,7 +301,7 @@ import {
302 301 updateDropPointInfo,
303 302 exportDropPointInfo
304 303 } from "@/api/unit/dropPointInfo";
305   -import {getAreaList} from "@/api/casefile/remoteServer";
  304 +import {getAreaList,getAreasList} from "@/api/dict"
306 305 import AMapLoader from "@amap/amap-jsapi-loader";
307 306 import Treeselect from "@riophae/vue-treeselect";
308 307  
... ... @@ -356,7 +355,10 @@ export default {
356 355 {required: true, message: "请输入所属街道", trigger: "blur"}
357 356 ],
358 357 community: [
359   - {required: true, message: "请输入社区", trigger: "blur"}
  358 + {required: true, message: "请选择社区", trigger: "blur"}
  359 + ],
  360 + plot: [
  361 + {required: true, message: "请输入小区", trigger: "blur"}
360 362 ],
361 363 address: [
362 364 {required: true, message: "请输入详细地址", trigger: "blur"}
... ... @@ -378,7 +380,7 @@ export default {
378 380 {required: true, message: "请输入管理单位", trigger: "blur"}
379 381 ],
380 382 custodian: [
381   - {required: true, message: "请输入管理", trigger: "blur"}
  383 + {required: true, message: "请输入管理", trigger: "blur"}
382 384 ],
383 385 custodianPhone: [
384 386 {required: true, message: "请输入管理员电话", trigger: "blur"},
... ... @@ -391,9 +393,6 @@ export default {
391 393 dropTime: [
392 394 {required: true, message: "请选择投放时间", trigger: "change"}
393 395 ],
394   - operatingUnit: [
395   - {required: true, message: "请输入运营单位", trigger: "blur"}
396   - ],
397 396 transportUnit: [
398 397 {required: true, message: "请输入运输单位", trigger: "blur"}
399 398 ],
... ... @@ -401,160 +400,12 @@ export default {
401 400 {required: true, message: "请点击坐标点按钮选择坐标点", trigger: "blur"}
402 401 ]
403 402 },
404   - areas: [
405   - {
406   - name: "芙蓉区",
407   - streets: [
408   - {code: "FR01", name: "湘湖"},
409   - {code: "FR02", name: "定王台街道"},
410   - {code: "FR03", name: "韭菜园街道"},
411   - {code: "FR04", name: "文艺路街道"},
412   - {code: "FR05", name: "朝阳街道"},
413   - {code: "FR06", name: "五里牌街道"},
414   - {code: "FR07", name: "马王堆街道"},
415   - {code: "FR08", name: "荷花园街道"},
416   - {code: "FR09", name: "东屯渡街道"},
417   - {code: "FR10", name: "火星街道"},
418   - {code: "FR11", name: "东岸街道"},
419   - {code: "FR12", name: "马坡岭街道"},
420   - {code: "FR13", name: "东湖街道"}
421   - ]
422   - },
423   - {
424   - name: "天心区",
425   - streets: [
426   - {code: "TX01", name: "坡子街街道"},
427   - {code: "TX02", name: "城南路街道"},
428   - {code: "TX03", name: "裕南街街道"},
429   - {code: "TX04", name: "赤岭路街道"},
430   - {code: "TX05", name: "金盆岭街道"},
431   - {code: "TX06", name: "新开铺街道"},
432   - {code: "TX07", name: "文源街道"},
433   - {code: "TX08", name: "桂花坪街道"},
434   - {code: "TX09", name: "青园街道"},
435   - {code: "TX10", name: "黑石铺街道"},
436   - {code: "TX11", name: "大托铺街道"},
437   - {code: "TX12", name: "先锋街道"},
438   - {code: "TX13", name: "南托街道"},
439   - {code: "TX14", name: "暮云街道"}
440   - ]
441   - },
442   - {
443   - name: "开福区",
444   - streets: [
445   - {code: "KF01", name: "望麓园街道"},
446   - {code: "KF02", name: "清水塘街道"},
447   - {code: "KF03", name: "湘雅路街道"},
448   - {code: "KF04", name: "伍家岭街道"},
449   - {code: "KF05", name: "新河街道"},
450   - {code: "KF06", name: "东风路街道"},
451   - {code: "KF07", name: "通泰街街道"},
452   - {code: "KF08", name: "四方坪街道"},
453   - {code: "KF09", name: "芙蓉北路街道"},
454   - {code: "KF10", name: "洪山街道"},
455   - {code: "KF11", name: "月湖街道"},
456   - {code: "KF12", name: "浏阳河街道"},
457   - {code: "KF13", name: "秀峰街道"},
458   - {code: "KF14", name: "捞刀河街道"},
459   - {code: "KF15", name: "沙坪街道"},
460   - {code: "KF16", name: "青竹湖街道"}
461   - ]
462   - },
463   - {
464   - name: "雨花区",
465   - streets: [
466   - {code: "YH01", name: "雨花亭街道"},
467   - {code: "YH02", name: "高桥街道"},
468   - {code: "YH03", name: "左家塘街道"},
469   - {code: "YH04", name: "侯家塘街道"},
470   - {code: "YH05", name: "砂子塘街道"},
471   - {code: "YH06", name: "东塘街道"},
472   - {code: "YH07", name: "圭塘街道"},
473   - {code: "YH08", name: "黎托街道"},
474   - {code: "YH09", name: "洞井街道"},
475   - {code: "YH10", name: "井湾子街道"},
476   - {code: "YH11", name: "东山街道"},
477   - {code: "YH12", name: "同升街道"},
478   - {code: "YH13", name: "跳马镇"}
479   - ]
480   - },
481   - {
482   - name: "长沙县",
483   - streets: [
484   - {code: "CS01", name: "星沙街道"},
485   - {code: "CS02", name: "湘龙街道"},
486   - {code: "CS03", name: "泉塘街道"},
487   - {code: "CS04", name: "榔梨街道"}
488   - ]
489   - },
490   - {
491   - name: "望城",
492   - streets: [
493   - {code: "WC01", name: "丁字湾街道"},
494   - {code: "WC02", name: "书堂山街道"},
495   - {code: "WC03", name: "高塘岭街道"},
496   - {code: "WC04", name: "喻家坡街道"},
497   - {code: "WC05", name: "白沙洲街道"},
498   - {code: "WC06", name: "大泽湖街道"},
499   - {code: "WC07", name: "月亮岛街道"},
500   - {code: "WC08", name: "廖家坪街道"}
501   - ]
502   - },
503   - {
504   - name: "浏阳",
505   - streets: [
506   - {code: "LY01", name: "淮川街道"},
507   - {code: "LY02", name: "集里街道"},
508   - {code: "LY03", name: "荷花街道"},
509   - {code: "LY04", name: "关口街道"}
510   - ]
511   - },
512   - {
513   - name: "宁乡",
514   - streets: [
515   - {code: "NX01", name: "玉潭街道"},
516   - {code: "NX02", name: "城郊街道"},
517   - {code: "NX03", name: "历经铺街道"},
518   - {code: "NX04", name: "白马桥街道"},
519   - {code: "NX05", name: "煤炭坝镇"},
520   - {code: "NX06", name: "双凫铺镇"},
521   - {code: "NX07", name: "双江口镇"},
522   - {code: "NX08", name: "回龙铺镇"},
523   - {code: "NX09", name: "夏铎铺镇"},
524   - {code: "NX10", name: "历经铺镇"}
525   - ]
526   - },
527   - {
528   - name: "湘江新区",
529   - streets: [
530   - {code: "XJ01", name: "岳麓街道"},
531   - {code: "XJ02", name: "桔子洲街道"},
532   - {code: "XJ03", name: "望月湖街道"},
533   - {code: "XJ04", name: "银盆岭街道"},
534   - {code: "XJ05", name: "观沙岭街道"},
535   - {code: "XJ06", name: "西湖街道"},
536   - {code: "XJ07", name: "望城坡街道"},
537   - {code: "XJ08", name: "望岳街道"},
538   - {code: "XJ09", name: "咸嘉湖街道"},
539   - {code: "XJ10", name: "梅溪湖街道"},
540   - {code: "XJ11", name: "天顶街道"},
541   - {code: "XJ12", name: "坪塘街道"},
542   - {code: "XJ13", name: "洋湖街道"},
543   - {code: "XJ14", name: "含浦街道"},
544   - {code: "XJ15", name: "学士街道"},
545   - {code: "XJ16", name: "莲花镇"},
546   - {code: "XJ17", name: "雨敞坪镇"},
547   - {code: "XJ18", name: "麓谷街道"},
548   - {code: "XJ19", name: "东方红街道"},
549   - {code: "XJ20", name: "白马街道"},
550   - {code: "XJ21", name: "雷锋街道"},
551   - {code: "XJ22", name: "黄金园街道"},
552   - {code: "XJ23", name: "金山桥街道"},
553   - {code: "XJ24", name: "白箬铺镇"}
554   - ]
555   - }
556   - ],
  403 + //区域
  404 + areas: [],
  405 + //街道
557 406 streets:[],
  407 + //社区
  408 + communitys:[],
558 409 // 地图
559 410 map: null,
560 411 keywords: "",
... ... @@ -562,13 +413,54 @@ export default {
562 413 openMap:false,
563 414 center: null,
564 415 circleMarker: null,
  416 + endTime: null,
  417 + dropTime: true
565 418 };
566 419 },
567 420 created() {
  421 + getAreasList().then(response => {
  422 + if(response==null || response.length===0){
  423 + this.$message.error("获取区域列表失败");
  424 + return;
  425 + }
  426 + let data = response.filter(data => data.code === "430100" && data.code !== "430182" && data.code !== "430183" && data.code !== "430681"&& data.code !== "430624");
  427 + // console.log(data)
  428 + this.areas = data[0].items.filter(data => data.code !== "430182" && data.code !== "430183" && data.code !== "430681"&& data.code !== "430624");
  429 + console.log(this.areas)
  430 + // for (let dataKey in data) {
  431 + // if(data[dataKey].parentCode === '430100'){
  432 + // this.areas.push({name:data[dataKey].name,code:data[dataKey].code, streets:[]})
  433 + // }
  434 + // }
  435 + // for(let dataKey in data){
  436 + // for(let areas1Key in this.areas){
  437 + // if(data[dataKey].parentCode === this.areas[areas1Key].code){
  438 + // this.areas[areas1Key].streets.push({code:data[dataKey].code, name:data[dataKey].name,item:data[dataKey].items})
  439 + // }
  440 + // }
  441 + // }
  442 + });
  443 +
568 444 this.getList();
569 445 // this.initAMap();
570 446 },
571 447 methods: {
  448 + dict(code){
  449 + for(let key in this.areas){
  450 + if(this.areas[key].code === code){
  451 + return this.areas[key].name;
  452 + }
  453 + }
  454 + },
  455 + dictInfo(code){
  456 + for(let key in this.areas){
  457 + for(let keyInfo in this.areas[key].streets){
  458 + if(this.areas[key].streets[keyInfo].code === code){
  459 + return this.areas[key].streets[keyInfo].name;
  460 + }
  461 + }
  462 + }
  463 + },
572 464 clearCoordinatePoint(){
573 465 this.center = null;
574 466 this.form.coordinatePoint = null;
... ... @@ -707,17 +599,25 @@ export default {
707 599 }
708 600 },
709 601 createDropPointNo(area){
710   - listDropPointInfo({dropPointNo: area.code}).then(response => {
711   - const total = response.total+1;
712   - this.form.dropPointNo = area.code+total.toString().padStart(3, '0');
713   - });
  602 + listDropPointInfo({dropPointNo: area.code}).then(response => {
  603 + const total = response.total+1;
  604 + this.form.dropPointNo = area.code+total.toString().padStart(3, '0');
  605 + });
  606 +
714 607 },
715 608 getStreets(regionName) {
716 609 this.streets = [];
717 610 this.form.dropPointNo = null;
718 611 this.form.street = null;
719   - const region = this.areas.find(region => region.name === regionName);
720   - this.streets = region.streets;
  612 + const region = this.areas.find(region => region.code === regionName);
  613 + this.streets = region.items;
  614 + },
  615 + getCommunitys(regionName){
  616 + this.communitys = [];
  617 + this.form.dropPointNo = null;
  618 + this.form.community = null;
  619 + const region = this.streets.find(region => region.code === regionName);
  620 + this.communitys = region.items;
721 621 },
722 622 /** 下载文件 */
723 623 /** 查询投放点信息管理列表 */
... ... @@ -758,6 +658,9 @@ export default {
758 658 updateTime: null,
759 659 updateBy: null
760 660 };
  661 + this.endTime = null;
  662 + this.streets = [];
  663 + this.communitys = [];
761 664 this.map = null;
762 665 this.center = null;
763 666 this.resetForm("form");
... ... @@ -788,26 +691,42 @@ export default {
788 691 handleUpdate(row) {
789 692 this.reset();
790 693 const id = row.id || this.ids
  694 + this.dropTime = false;
791 695 getDropPointInfo(id).then(response => {
  696 + let dropTime = response.data.dropTime.split("~");
  697 + console.log(dropTime)
792 698 this.form = response.data;
  699 + this.form.dropTime = dropTime[0];
  700 + this.endTime = dropTime[1];
793 701 this.open = true;
794 702 this.title = "修改投放点信息管理";
  703 + this.dropTime = true;
795 704 });
796 705 },
797 706 /** 提交按钮 */
798 707 submitForm() {
  708 +
799 709 this.$refs["form"].validate(valid => {
800 710 if (valid) {
  711 + let dropTime = this.form.dropTime;
  712 + if(this.endTime!=null){
  713 + this.form.dropTime = this.form.dropTime + "~" + this.endTime;
  714 + }else{
  715 + this.$message.error("请选择投放结束时间");
  716 + return;
  717 + }
801 718 if (this.form.id != null) {
802 719 updateDropPointInfo(this.form).then(response => {
803 720 this.msgSuccess("修改成功");
804 721 this.open = false;
  722 + this.form.dropTime = dropTime;
805 723 this.getList();
806 724 });
807 725 } else {
808 726 addDropPointInfo(this.form).then(response => {
809 727 this.msgSuccess("新增成功");
810 728 this.open = false;
  729 + this.form.dropTime = dropTime;
811 730 this.getList();
812 731 });
813 732 }
... ...
trash-unit/pom.xml
... ... @@ -20,5 +20,10 @@
20 20 <groupId>com.trash</groupId>
21 21 <artifactId>trash-common</artifactId>
22 22 </dependency>
  23 +
  24 + <dependency>
  25 + <groupId>com.trash</groupId>
  26 + <artifactId>trash-workflow</artifactId>
  27 + </dependency>
23 28 </dependencies>
24 29 </project>
25 30 \ No newline at end of file
... ...
trash-unit/src/main/java/com/trash/dropPointInfo/domain/DropPointInfo.java
... ... @@ -2,6 +2,8 @@ package com.trash.dropPointInfo.domain;
2 2  
3 3 import java.math.BigDecimal;
4 4 import java.util.Date;
  5 +import java.util.List;
  6 +
5 7 import com.fasterxml.jackson.annotation.JsonFormat;
6 8 import org.apache.commons.lang3.builder.ToStringBuilder;
7 9 import org.apache.commons.lang3.builder.ToStringStyle;
... ... @@ -37,6 +39,10 @@ public class DropPointInfo extends BaseEntity
37 39 @Excel(name = "社区")
38 40 private String community;
39 41  
  42 + /** 小区 */
  43 + @Excel(name = "小区")
  44 + private String plot;
  45 +
40 46 /** 详细地址 */
41 47 @Excel(name = "详细地址")
42 48 private String address;
... ... @@ -57,8 +63,8 @@ public class DropPointInfo extends BaseEntity
57 63 @Excel(name = "管理单位")
58 64 private String managementUnit;
59 65  
60   - /** 管理人 */
61   - @Excel(name = "管理人")
  66 + /** 管理员 */
  67 + @Excel(name = "管理员")
62 68 private String custodian;
63 69  
64 70 /** 管理员电话 */
... ... @@ -84,11 +90,28 @@ public class DropPointInfo extends BaseEntity
84 90 /** 坐标点 */
85 91 @Excel(name = "坐标点")
86 92 private String coordinatePoint;
87   -
88   - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  93 +
  94 + private List<String> sList;
  95 +
  96 + public List<String> getSList() {
  97 + return sList;
  98 + }
  99 +
  100 + public void setSList(List<String> sList) {
  101 + this.sList = sList;
  102 + }
  103 +
  104 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
89 105 @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
90 106 private Date createTime;
91 107  
  108 + public String getPlot() {
  109 + return plot;
  110 + }
  111 +
  112 + public void setPlot(String plot) {
  113 + this.plot = plot;
  114 + }
92 115  
93 116 public String getCoordinatePoint() {
94 117 return coordinatePoint;
... ...
trash-unit/src/main/java/com/trash/dropPointInfo/service/impl/DropPointInfoServiceImpl.java
1 1 package com.trash.dropPointInfo.service.impl;
2 2  
  3 +import java.util.ArrayList;
  4 +import java.util.HashMap;
3 5 import java.util.List;
  6 +import java.util.Map;
  7 +
4 8 import com.trash.common.utils.DateUtils;
5 9 import com.trash.common.utils.SecurityUtils;
  10 +import com.trash.common.utils.spring.SpringUtils;
  11 +
6 12 import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.security.core.annotation.AuthenticationPrincipal;
7 14 import org.springframework.stereotype.Service;
8 15 import com.trash.dropPointInfo.mapper.DropPointInfoMapper;
9 16 import com.trash.dropPointInfo.domain.DropPointInfo;
10 17 import com.trash.dropPointInfo.service.IDropPointInfoService;
  18 +import com.trash.office.mapper.UploadFileMapper;
  19 +import com.trash.workflow.service.IWorkflowService;
11 20  
12 21 /**
13 22 * 投放点信息管理Service业务层处理
... ... @@ -41,8 +50,16 @@ public class DropPointInfoServiceImpl implements IDropPointInfoService
41 50 */
42 51 @Override
43 52 public List<DropPointInfo> selectDropPointInfoList(DropPointInfo dropPointInfo)
44   - {
45   - return dropPointInfoMapper.selectDropPointInfoList(dropPointInfo);
  53 + {
  54 + List<String> ids = SecurityUtils.getLoginUser().getUser().getStreetsList();
  55 +
  56 + if(ids.size() > 0){
  57 + dropPointInfo.setSList(ids);
  58 + return dropPointInfoMapper.selectDropPointInfoList(dropPointInfo);
  59 + }
  60 +
  61 + return new ArrayList<DropPointInfo>();
  62 +
46 63 }
47 64  
48 65 /**
... ... @@ -51,12 +68,31 @@ public class DropPointInfoServiceImpl implements IDropPointInfoService
51 68 * @param dropPointInfo 投放点信息管理
52 69 * @return 结果
53 70 */
  71 + @Autowired
  72 + IWorkflowService workflow;
  73 +
54 74 @Override
55 75 public int insertDropPointInfo(DropPointInfo dropPointInfo)
56 76 {
57 77 dropPointInfo.setCreateTime(DateUtils.getNowDate());
58 78 dropPointInfo.setCreateBy(SecurityUtils.getUsername());
59   - return dropPointInfoMapper.insertDropPointInfo(dropPointInfo);
  79 +
  80 + int i = dropPointInfoMapper.insertDropPointInfo(dropPointInfo);
  81 +
  82 + if(i == 0){
  83 + return i;
  84 + }
  85 + Map<String, String> map = new HashMap<String, String>();
  86 + map.put("name", dropPointInfo.getDropPointName());
  87 + map.put("area", dropPointInfo.getDistrict());
  88 + map.put("id", dropPointInfo.getId()+"");
  89 +
  90 + i = workflow.createDropPointWorkFlow(map);
  91 + if (i == 0) {
  92 + dropPointInfoMapper.deleteDropPointInfoById(dropPointInfo.getId());
  93 + }
  94 +
  95 + return i;
60 96 }
61 97  
62 98 /**
... ...
trash-unit/src/main/resources/mapper/unit/DropPointInfoMapper.xml
... ... @@ -3,134 +3,154 @@
3 3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 5 <mapper namespace="com.trash.dropPointInfo.mapper.DropPointInfoMapper">
6   -
7   - <resultMap type="DropPointInfo" id="DropPointInfoResult">
8   - <result property="id" column="id" />
9   - <result property="dropPointName" column="drop_point_name" />
10   - <result property="district" column="district" />
11   - <result property="street" column="street" />
12   - <result property="community" column="community" />
13   - <result property="address" column="address" />
14   - <result property="type" column="type" />
15   - <result property="area" column="area" />
16   - <result property="capacity" column="capacity" />
17   - <result property="managementUnit" column="management_unit" />
18   - <result property="custodian" column="custodian" />
19   - <result property="custodianPhone" column="custodian_phone" />
20   - <result property="dropTime" column="drop_time" />
21   - <result property="dropPointNo" column="drop_point_no" />
22   - <result property="operatingUnit" column="operating_unit" />
23   - <result property="transportUnit" column="transport_unit" />
24   - <result property="coordinatePoint" column="coordinate_point" />
25   - <result property="createTime" column="create_time" />
26   - <result property="createBy" column="create_by" />
27   - <result property="updateTime" column="update_time" />
28   - <result property="updateBy" column="update_by" />
29   - </resultMap>
30 6  
31   - <sql id="selectDropPointInfoVo">
32   - select id, drop_point_name, district, street, community, address, type, area, capacity, management_unit, custodian, custodian_phone, drop_time, drop_point_no, operating_unit, transport_unit,coordinate_point, create_time, create_by, update_time, update_by from drop_point_info
33   - </sql>
  7 + <resultMap type="DropPointInfo" id="DropPointInfoResult">
  8 + <result property="id" column="id" />
  9 + <result property="dropPointName" column="drop_point_name" />
  10 + <result property="district" column="district" />
  11 + <result property="street" column="street" />
  12 + <result property="community" column="community" />
  13 + <result property="address" column="address" />
  14 + <result property="type" column="type" />
  15 + <result property="area" column="area" />
  16 + <result property="capacity" column="capacity" />
  17 + <result property="managementUnit" column="management_unit" />
  18 + <result property="custodian" column="custodian" />
  19 + <result property="custodianPhone" column="custodian_phone" />
  20 + <result property="dropTime" column="drop_time" />
  21 + <result property="dropPointNo" column="drop_point_no" />
  22 + <result property="operatingUnit" column="operating_unit" />
  23 + <result property="transportUnit" column="transport_unit" />
  24 + <result property="coordinatePoint" column="coordinate_point" />
  25 + <result property="createTime" column="create_time" />
  26 + <result property="createBy" column="create_by" />
  27 + <result property="updateTime" column="update_time" />
  28 + <result property="updateBy" column="update_by" />
  29 + <result property="plot" column="plot" />
  30 + </resultMap>
34 31  
35   - <select id="selectDropPointInfoList" parameterType="DropPointInfo" resultMap="DropPointInfoResult">
36   - <include refid="selectDropPointInfoVo"/>
37   - <where>
38   - <if test="dropPointName != null and dropPointName != ''"> and drop_point_name like concat('%', #{dropPointName}, '%')</if>
39   - <if test="address != null and address != ''"> and address like concat('%', #{address}, '%')</if>
40   - <if test="type != null and type != ''"> and type = #{type}</if>
41   - <if test="dropPointNo != null and dropPointNo != ''"> and drop_point_no like concat(#{dropPointNo}, '%')</if>
42   - </where>
43   - </select>
44   -
45   - <select id="selectDropPointInfoById" parameterType="Long" resultMap="DropPointInfoResult">
46   - <include refid="selectDropPointInfoVo"/>
47   - where id = #{id}
48   - </select>
49   -
50   - <insert id="insertDropPointInfo" parameterType="DropPointInfo" useGeneratedKeys="true" keyProperty="id">
51   - insert into drop_point_info
52   - <trim prefix="(" suffix=")" suffixOverrides=",">
53   - <if test="dropPointName != null">drop_point_name,</if>
54   - <if test="district != null">district,</if>
55   - <if test="street != null">street,</if>
56   - <if test="community != null">community,</if>
57   - <if test="address != null">address,</if>
58   - <if test="type != null">type,</if>
59   - <if test="area != null">area,</if>
60   - <if test="capacity != null">capacity,</if>
61   - <if test="managementUnit != null">management_unit,</if>
62   - <if test="custodian != null">custodian,</if>
63   - <if test="custodianPhone != null">custodian_phone,</if>
64   - <if test="dropTime != null">drop_time,</if>
65   - <if test="dropPointNo != null">drop_point_no,</if>
66   - <if test="operatingUnit != null">operating_unit,</if>
67   - <if test="transportUnit != null">transport_unit,</if>
68   - <if test="coordinatePoint != null">coordinate_point,</if>
69   - <if test="createTime != null">create_time,</if>
70   - <if test="createBy != null">create_by,</if>
71   - <if test="updateTime != null">update_time,</if>
72   - <if test="updateBy != null">update_by,</if>
73   - </trim>
74   - <trim prefix="values (" suffix=")" suffixOverrides=",">
75   - <if test="dropPointName != null">#{dropPointName},</if>
76   - <if test="district != null">#{district},</if>
77   - <if test="street != null">#{street},</if>
78   - <if test="community != null">#{community},</if>
79   - <if test="address != null">#{address},</if>
80   - <if test="type != null">#{type},</if>
81   - <if test="area != null">#{area},</if>
82   - <if test="capacity != null">#{capacity},</if>
83   - <if test="managementUnit != null">#{managementUnit},</if>
84   - <if test="custodian != null">#{custodian},</if>
85   - <if test="custodianPhone != null">#{custodianPhone},</if>
86   - <if test="dropTime != null">#{dropTime},</if>
87   - <if test="dropPointNo != null">#{dropPointNo},</if>
88   - <if test="operatingUnit != null">#{operatingUnit},</if>
89   - <if test="transportUnit != null">#{transportUnit},</if>
90   - <if test="coordinatePoint != null">#{coordinatePoint},</if>
91   - <if test="createTime != null">#{createTime},</if>
92   - <if test="createBy != null">#{createBy},</if>
93   - <if test="updateTime != null">#{updateTime},</if>
94   - <if test="updateBy != null">#{updateBy},</if>
95   - </trim>
96   - </insert>
  32 + <sql id="selectDropPointInfoVo">
  33 + select id, drop_point_name, district, street, community, address, type,
  34 + area, capacity, management_unit, custodian, custodian_phone,
  35 + drop_time, drop_point_no, operating_unit,
  36 + transport_unit,coordinate_point, create_time, create_by, update_time,
  37 + update_by,plot from drop_point_info
  38 + </sql>
97 39  
98   - <update id="updateDropPointInfo" parameterType="DropPointInfo">
99   - update drop_point_info
100   - <trim prefix="SET" suffixOverrides=",">
101   - <if test="dropPointName != null">drop_point_name = #{dropPointName},</if>
102   - <if test="district != null">district = #{district},</if>
103   - <if test="street != null">street = #{street},</if>
104   - <if test="community != null">community = #{community},</if>
105   - <if test="address != null">address = #{address},</if>
106   - <if test="type != null">type = #{type},</if>
107   - <if test="area != null">area = #{area},</if>
108   - <if test="capacity != null">capacity = #{capacity},</if>
109   - <if test="managementUnit != null">management_unit = #{managementUnit},</if>
110   - <if test="custodian != null">custodian = #{custodian},</if>
111   - <if test="custodianPhone != null">custodian_phone = #{custodianPhone},</if>
112   - <if test="dropTime != null">drop_time = #{dropTime},</if>
113   - <if test="dropPointNo != null">drop_point_no = #{dropPointNo},</if>
114   - <if test="operatingUnit != null">operating_unit = #{operatingUnit},</if>
115   - <if test="transportUnit != null">transport_unit = #{transportUnit},</if>
116   - <if test="coordinatePoint != null">coordinate_point = #{coordinatePoint},</if>
117   - <if test="createTime != null">create_time = #{createTime},</if>
118   - <if test="createBy != null">create_by = #{createBy},</if>
119   - <if test="updateTime != null">update_time = #{updateTime},</if>
120   - <if test="updateBy != null">update_by = #{updateBy},</if>
121   - </trim>
122   - where id = #{id}
123   - </update>
  40 + <select id="selectDropPointInfoList" parameterType="DropPointInfo"
  41 + resultMap="DropPointInfoResult">
  42 + <include refid="selectDropPointInfoVo" />
  43 + <where>
  44 + <if test="dropPointName != null and dropPointName != ''"> and drop_point_name like concat('%', #{dropPointName},
  45 + '%')</if>
  46 + <if test="address != null and address != ''"> and address like concat('%', #{address}, '%')</if>
  47 + <if test="type != null and type != ''"> and type = #{type}</if>
  48 + <if test="dropPointNo != null and dropPointNo != ''"> and drop_point_no like concat(#{dropPointNo}, '%')</if>
  49 + <if test="sList != null and sList.size() > 0 ">
  50 + and street in
  51 + <foreach item="id" collection="sList" open="(" separator=","
  52 + close=")">
  53 + #{id}
  54 + </foreach>
  55 + </if>
  56 + </where>
  57 + </select>
124 58  
125   - <delete id="deleteDropPointInfoById" parameterType="Long">
126   - delete from drop_point_info where id = #{id}
127   - </delete>
  59 + <select id="selectDropPointInfoById" parameterType="Long"
  60 + resultMap="DropPointInfoResult">
  61 + <include refid="selectDropPointInfoVo" />
  62 + where id = #{id}
  63 + </select>
  64 +
  65 + <insert id="insertDropPointInfo" parameterType="DropPointInfo"
  66 + useGeneratedKeys="true" keyProperty="id">
  67 + insert into drop_point_info
  68 + <trim prefix="(" suffix=")" suffixOverrides=",">
  69 + <if test="dropPointName != null">drop_point_name,</if>
  70 + <if test="district != null">district,</if>
  71 + <if test="street != null">street,</if>
  72 + <if test="community != null">community,</if>
  73 + <if test="address != null">address,</if>
  74 + <if test="type != null">type,</if>
  75 + <if test="area != null">area,</if>
  76 + <if test="capacity != null">capacity,</if>
  77 + <if test="managementUnit != null">management_unit,</if>
  78 + <if test="custodian != null">custodian,</if>
  79 + <if test="custodianPhone != null">custodian_phone,</if>
  80 + <if test="dropTime != null">drop_time,</if>
  81 + <if test="dropPointNo != null">drop_point_no,</if>
  82 + <if test="operatingUnit != null">operating_unit,</if>
  83 + <if test="transportUnit != null">transport_unit,</if>
  84 + <if test="coordinatePoint != null">coordinate_point,</if>
  85 + <if test="createTime != null">create_time,</if>
  86 + <if test="createBy != null">create_by,</if>
  87 + <if test="updateTime != null">update_time,</if>
  88 + <if test="updateBy != null">update_by,</if>
  89 + <if test="plot != null">plot,</if>
  90 + </trim>
  91 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  92 + <if test="dropPointName != null">#{dropPointName},</if>
  93 + <if test="district != null">#{district},</if>
  94 + <if test="street != null">#{street},</if>
  95 + <if test="community != null">#{community},</if>
  96 + <if test="address != null">#{address},</if>
  97 + <if test="type != null">#{type},</if>
  98 + <if test="area != null">#{area},</if>
  99 + <if test="capacity != null">#{capacity},</if>
  100 + <if test="managementUnit != null">#{managementUnit},</if>
  101 + <if test="custodian != null">#{custodian},</if>
  102 + <if test="custodianPhone != null">#{custodianPhone},</if>
  103 + <if test="dropTime != null">#{dropTime},</if>
  104 + <if test="dropPointNo != null">#{dropPointNo},</if>
  105 + <if test="operatingUnit != null">#{operatingUnit},</if>
  106 + <if test="transportUnit != null">#{transportUnit},</if>
  107 + <if test="coordinatePoint != null">#{coordinatePoint},</if>
  108 + <if test="createTime != null">#{createTime},</if>
  109 + <if test="createBy != null">#{createBy},</if>
  110 + <if test="updateTime != null">#{updateTime},</if>
  111 + <if test="updateBy != null">#{updateBy},</if>
  112 + <if test="plot != null">#{plot},</if>
  113 + </trim>
  114 + </insert>
  115 +
  116 + <update id="updateDropPointInfo" parameterType="DropPointInfo">
  117 + update drop_point_info
  118 + <trim prefix="SET" suffixOverrides=",">
  119 + <if test="dropPointName != null">drop_point_name = #{dropPointName},</if>
  120 + <if test="district != null">district = #{district},</if>
  121 + <if test="street != null">street = #{street},</if>
  122 + <if test="community != null">community = #{community},</if>
  123 + <if test="address != null">address = #{address},</if>
  124 + <if test="type != null">type = #{type},</if>
  125 + <if test="area != null">area = #{area},</if>
  126 + <if test="capacity != null">capacity = #{capacity},</if>
  127 + <if test="managementUnit != null">management_unit = #{managementUnit},</if>
  128 + <if test="custodian != null">custodian = #{custodian},</if>
  129 + <if test="custodianPhone != null">custodian_phone = #{custodianPhone},</if>
  130 + <if test="dropTime != null">drop_time = #{dropTime},</if>
  131 + <if test="dropPointNo != null">drop_point_no = #{dropPointNo},</if>
  132 + <if test="operatingUnit != null">operating_unit = #{operatingUnit},</if>
  133 + <if test="transportUnit != null">transport_unit = #{transportUnit},</if>
  134 + <if test="coordinatePoint != null">coordinate_point = #{coordinatePoint},</if>
  135 + <if test="createTime != null">create_time = #{createTime},</if>
  136 + <if test="createBy != null">create_by = #{createBy},</if>
  137 + <if test="updateTime != null">update_time = #{updateTime},</if>
  138 + <if test="updateBy != null">update_by = #{updateBy},</if>
  139 + <if test="plot != null">plot = #{plot},</if>
  140 + </trim>
  141 + where id = #{id}
  142 + </update>
  143 +
  144 + <delete id="deleteDropPointInfoById" parameterType="Long">
  145 + delete from drop_point_info where id = #{id}
  146 + </delete>
  147 +
  148 + <delete id="deleteDropPointInfoByIds" parameterType="String">
  149 + delete from drop_point_info where id in
  150 + <foreach item="id" collection="array" open="(" separator=","
  151 + close=")">
  152 + #{id}
  153 + </foreach>
  154 + </delete>
128 155  
129   - <delete id="deleteDropPointInfoByIds" parameterType="String">
130   - delete from drop_point_info where id in
131   - <foreach item="id" collection="array" open="(" separator="," close=")">
132   - #{id}
133   - </foreach>
134   - </delete>
135   -
136 156 </mapper>
137 157 \ No newline at end of file
... ...
trash-workFlow/pom.xml
... ... @@ -21,7 +21,6 @@
21 21 <groupId>com.trash</groupId>
22 22 <artifactId>trash-common</artifactId>
23 23 </dependency>
24   -
25 24 <!-- kafka -->
26 25 <dependency>
27 26 <groupId>org.springframework.kafka</groupId>
... ...
trash-workFlow/src/main/java/com/trash/business/controller/TruckActivateController.java
... ... @@ -185,7 +185,7 @@ public class TruckActivateController extends BaseController
185 185 info.setAddress(turck.getAddress());
186 186 info.setEarthName(turck.getEarthName());
187 187 info.setRouteName(turck.getRouteName());
188   - info.setTransportEndTime(turck.getTransportStartTime());
  188 + info.setTransportEndTime(turck.getTransportEndTime());
189 189 info.setTransportStartTime(turck.getTransportStartTime());
190 190 info.setEffectiveFrom(turck.getEffectiveFrom());
191 191 info.setEffectiveEnd(turck.getEffectiveEnd());
... ...
trash-workFlow/src/main/java/com/trash/business/domain/SupervisionThreestep.java
... ... @@ -138,10 +138,20 @@ public class SupervisionThreestep extends BaseEntity
138 138 private String attchItem2;
139 139 private String attchItem3;
140 140  
  141 + private String checkStatus;
  142 +
141 143 private String[] places;
142 144  
143 145  
144   - public String[] getPlaces() {
  146 + public String getCheckStatus() {
  147 + return checkStatus;
  148 + }
  149 +
  150 + public void setCheckStatus(String checkStatus) {
  151 + this.checkStatus = checkStatus;
  152 + }
  153 +
  154 + public String[] getPlaces() {
145 155 return places;
146 156 }
147 157  
... ...
trash-workFlow/src/main/java/com/trash/business/mapper/GarMapper.java 0 → 100644
  1 +package com.trash.business.mapper;
  2 +
  3 +import org.apache.ibatis.annotations.Param;
  4 +
  5 +public interface GarMapper {
  6 +
  7 + public int updateDropPointById(@Param("id")String id ,@Param("status") String status);
  8 +
  9 +}
... ...
trash-workFlow/src/main/java/com/trash/business/service/impl/DriverCreditServiceImpl.java
... ... @@ -5,6 +5,7 @@ import java.util.Date;
5 5 import java.util.HashMap;
6 6 import java.util.List;
7 7 import java.util.Map;
  8 +import java.util.concurrent.TimeUnit;
8 9  
9 10 import com.trash.business.domain.TruckCredit;
10 11 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -23,6 +24,8 @@ import com.trash.common.utils.util.PostSms;
23 24 import com.trash.common.utils.vo.mt.JsonSmsSend;
24 25 import com.trash.common.utils.vo.mt.Mobile;
25 26  
  27 +import ch.qos.logback.core.util.TimeUtil;
  28 +
26 29 import org.springframework.transaction.annotation.Transactional;
27 30  
28 31 /**
... ... @@ -32,276 +35,300 @@ import org.springframework.transaction.annotation.Transactional;
32 35 * @date 2023-04-26
33 36 */
34 37 @Service
35   -public class DriverCreditServiceImpl implements IDriverCreditService
36   -{
37   - @Autowired
38   - private DriverCreditMapper driverCreditMapper;
39   -
40   - @Autowired
41   - RedisCache redisCache;
42   -
43   - /**
44   - * 查询驾驶员失信
45   - *
46   - * @param id 驾驶员失信ID
47   - * @return 驾驶员失信
48   - */
49   - @Override
50   - public DriverCredit selectDriverCreditById(Long id)
51   - {
52   - return driverCreditMapper.selectDriverCreditById(id);
53   - }
54   -
55   - /**
56   - * 查询驾驶员失信列表
57   - *
58   - * @param driverCredit 驾驶员失信
59   - * @return 驾驶员失信
60   - */
61   - @Autowired
62   - private trashConfig trashConfig;
63   -
64   - @Autowired
65   - RedisCache redis;
66   -
67   - @Override
68   - public List<DriverCredit> selectDriverCreditList(DriverCredit driverCredit)
69   - {
70   -
71   - List<DriverCredit> list = new ArrayList<>();
72   -
73   - List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds();
74   - List<String> areas = SecurityUtils.getLoginUser().getUser().getCompanyAreas();
75   -
76   -
77   - if(areas.size() > 0) {
78   - JSONArray array = redis.getCacheObject("companyList");
79   - if(array != null) {
80   - for(Object obj:array) {
81   - JSONObject json = (JSONObject)obj;
82   - if(areas.indexOf(json.getString("areaCode")) > -1) {
83   - companys.add(json.getString("id"));
84   - }
  38 +public class DriverCreditServiceImpl implements IDriverCreditService {
  39 + @Autowired
  40 + private DriverCreditMapper driverCreditMapper;
  41 +
  42 + @Autowired
  43 + RedisCache redisCache;
  44 +
  45 + /**
  46 + * 查询驾驶员失信
  47 + *
  48 + * @param id
  49 + * 驾驶员失信ID
  50 + * @return 驾驶员失信
  51 + */
  52 + @Override
  53 + public DriverCredit selectDriverCreditById(Long id) {
  54 + return driverCreditMapper.selectDriverCreditById(id);
  55 + }
  56 +
  57 + /**
  58 + * 查询驾驶员失信列表
  59 + *
  60 + * @param driverCredit
  61 + * 驾驶员失信
  62 + * @return 驾驶员失信
  63 + */
  64 + @Autowired
  65 + private trashConfig trashConfig;
  66 +
  67 + @Override
  68 + public List<DriverCredit> selectDriverCreditList(DriverCredit driverCredit) {
  69 +
  70 + List<DriverCredit> list = new ArrayList<>();
  71 +
  72 + List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds();
  73 + List<String> areas = SecurityUtils.getLoginUser().getUser().getCompanyAreas();
  74 +
  75 + if (areas.size() > 0) {
  76 + JSONArray array = redisCache.getCacheObject("companyList");
  77 + if (array != null) {
  78 + for (Object obj : array) {
  79 + JSONObject json = (JSONObject) obj;
  80 + if (areas.indexOf(json.getString("areaCode")) > -1) {
  81 + companys.add(json.getString("id"));
85 82 }
86 83 }
87 84 }
88   -
89   - if (companys.size() > 0) {
  85 + }
90 86  
91   - List<String> ids = new ArrayList<>();
92   -
93   - JSONArray jsonArray = RemoteServerUtils.getDriverList(trashConfig.getToken());
94   -
95   - for(Object obj:jsonArray){
96   - JSONObject json = (JSONObject) obj;
97   - if(companys.indexOf(json.getString("companyId")) > -1){
98   - ids.add(json.getString("id"));
99   - System.out.print(json.getString("id") + " ");
100   - }
101   - }
102   -
103   - driverCredit.setIds(ids);
104   -
  87 + if (companys.size() > 0) {
  88 +
  89 + List<String> ids = new ArrayList<>();
  90 + JSONArray jsonArray = redisCache.getCacheObject("driverList");
  91 + if(jsonArray == null){
  92 + Map map = new HashMap<>();
  93 + map.put("size", "99999");
  94 + map.put("page", "1");
  95 + jsonArray = RemoteServerUtils.getDriverList(trashConfig.getToken(), map);
105 96  
  97 + if(jsonArray != null){
  98 + redisCache.setCacheObject("driverList", jsonArray, 60, TimeUnit.DAYS);
  99 + }
106 100  
107   - list = driverCreditMapper.selectDriverCreditList(driverCredit);
108 101 }
109   -
110 102  
111   -
112   - return list;
113   -
114   - }
115   -
116   - /**
117   - * 新增驾驶员失信
118   - *
119   - * @param driverCredit 驾驶员失信
120   - * @return 结果
121   - */
122   - @Override
123   - public int insertDriverCredit(DriverCredit driverCredit)
124   - {
125   -
126   - int i;
127   -
128   - DriverCredit cc = new DriverCredit();
129   -
130   - cc.setStatus(0L);
131   - cc.setLostCredit(driverCredit.getLostCredit());
132   - cc.setObjectId(driverCredit.getObjectId());
133   -
134   - List old = driverCreditMapper.selectDriverCreditList(cc);
135   -
136   - if(old.size() > 0){
137   - i = 1;
138   - }else{
139   - i = driverCreditMapper.insertDriverCredit(driverCredit);
140   -
141   -
142   - JSONArray array = redisCache.getCacheObject("companyList");
143   -
144   -
145   - JSONArray drivers = RemoteServerUtils.getDriverList();
146   - String companyId = null;
147   -
148   - for(Object obj:drivers){
149   -
150   - JSONObject json = (JSONObject)obj;
151   - if(json.getString("id").equals(driverCredit.getObjectId())){
152   - companyId = json.getString("companyId");
  103 +
  104 +
  105 +
  106 + for (Object obj : jsonArray) {
  107 + JSONObject json = (JSONObject) obj;
  108 + if (companys.indexOf(json.getString("companyId")) > -1) {
  109 + ids.add(json.getString("id"));
  110 + System.out.print(json.getString("id") + " ");
  111 + }
153 112 }
  113 +
  114 + driverCredit.setIds(ids);
  115 +
  116 + list = driverCreditMapper.selectDriverCreditList(driverCredit);
154 117 }
155   -
156   - if(companyId != null){
157   - String number = null;
158   - for(Object obj:array){
159   - JSONObject json = (JSONObject)obj;
160   - if(companyId.equals(json.getString("id"))){
161   - number = json.getString("principalPhoneNo"); //企业安全负责人
162   - break;
  118 +
  119 + return list;
  120 +
  121 + }
  122 +
  123 + /**
  124 + * 新增驾驶员失信
  125 + *
  126 + * @param driverCredit
  127 + * 驾驶员失信
  128 + * @return 结果
  129 + */
  130 + @Override
  131 + public int insertDriverCredit(DriverCredit driverCredit) {
  132 +
  133 + int i;
  134 +
  135 + DriverCredit cc = new DriverCredit();
  136 +
  137 + cc.setStatus(0L);
  138 + cc.setLostCredit(driverCredit.getLostCredit());
  139 + cc.setObjectId(driverCredit.getObjectId());
  140 +
  141 + List old = driverCreditMapper.selectDriverCreditList(cc);
  142 +
  143 + if (old.size() > 0) {
  144 + i = 1;
  145 + } else {
  146 + i = driverCreditMapper.insertDriverCredit(driverCredit);
  147 +
  148 + JSONArray array = redisCache.getCacheObject("companyList");
  149 +
  150 + JSONArray jsonArray = redisCache.getCacheObject("driverList");
  151 + if(jsonArray == null){
  152 + Map map = new HashMap<>();
  153 + map.put("size", "99999");
  154 + map.put("page", "1");
  155 + jsonArray = RemoteServerUtils.getDriverList(trashConfig.getToken(), map);
  156 +
  157 + if(jsonArray != null){
  158 + redisCache.setCacheObject("driverList", jsonArray, 60, TimeUnit.DAYS);
163 159 }
164 160 }
165 161  
  162 + String companyId = null;
  163 +
  164 + for (Object obj : jsonArray) {
166 165  
167   -
168   -
169   - if(number != null){
170   - List<Mobile> mobileList=new ArrayList<Mobile>();
171   - Mobile mobile=new Mobile();
172   - mobile.setMobile(number);
173   - mobileList.add(mobile);
174   -
175   - String smsString = "";
176   - if(driverCredit.getLostCredit() == 1){
177   - smsString = "失信提醒:"+driverCredit.getName()+"因"+driverCredit.getReason()+"原因,被纳入失信名单,将影响渣土业务办理,请及时处理。";
178   - }else{
179   - smsString = "失信解除提醒:"+driverCredit.getName()+"现已解除失信,可以进行渣土业务办理,请知悉。";
180   - }
181   -
182   -
183   -
184   - JsonSmsSend jsonSmsSend= PostSms.sendSms(mobileList,smsString);
185   - if(jsonSmsSend!=null){
186   - if(jsonSmsSend.getState()==0){
187   - System.out.println("发送成功");
188   - }else{
189   - System.out.println(jsonSmsSend.getMessage());
190   - }
191   - }else{
192   - System.out.println("发送返回空");
193   - }
  166 + JSONObject json = (JSONObject) obj;
  167 + if (json.getString("id").equals(driverCredit.getObjectId())) {
  168 + companyId = json.getString("companyId");
  169 + break;
  170 + }
194 171 }
195   - }
196   -
197   - }
198   -
199   -
200   -
201   -
202   -// sentDataToRemoteServer(driverCredit);
203 172  
204   - return i;
205   - }
  173 + if (companyId != null) {
  174 + String number = null;
  175 + for (Object obj : array) {
  176 + JSONObject json = (JSONObject) obj;
  177 + if (companyId.equals(json.getString("id"))) {
  178 + number = json.getString("principalPhoneNo"); // 企业安全负责人
  179 + break;
  180 + }
  181 + }
206 182  
207   - private void sentDataToRemoteServer(DriverCredit driverCredit) {
  183 + if (number != null) {
  184 + List<Mobile> mobileList = new ArrayList<Mobile>();
  185 + Mobile mobile = new Mobile();
  186 + mobile.setMobile(number);
  187 + mobileList.add(mobile);
  188 +
  189 + String smsString = "";
  190 + if (driverCredit.getLostCredit() == 1) {
  191 + smsString = "失信提醒:" + driverCredit.getName() + "因" + driverCredit.getReason()
  192 + + "原因,被纳入失信名单,将影响渣土业务办理,请及时处理。";
  193 + } else {
  194 + smsString = "失信解除提醒:" + driverCredit.getName() + "现已解除失信,可以进行渣土业务办理,请知悉。";
  195 + }
208 196  
209   - System.out.println("sendData!" + driverCredit.getObjectId() + "status" + driverCredit.getStatus() );
  197 + JsonSmsSend jsonSmsSend = PostSms.sendSms(mobileList, smsString);
  198 + if (jsonSmsSend != null) {
  199 + if (jsonSmsSend.getState() == 0) {
  200 + System.out.println("发送成功");
  201 + } else {
  202 + System.out.println(jsonSmsSend.getMessage());
  203 + }
  204 + } else {
  205 + System.out.println("发送返回空");
  206 + }
  207 + }
  208 + }
210 209  
211   - }
  210 + }
212 211  
213   - /**
214   - * 修改驾驶员失信
215   - *
216   - * @param driverCredit 驾驶员失信
217   - * @return 结果
218   - */
219   - @Override
220   - @Transactional
221   - public int updateDriverCredit(DriverCredit driverCredit)
222   - {
223   - DriverCredit cc = driverCreditMapper.selectDriverCreditById(driverCredit.getId());
  212 + // sentDataToRemoteServer(driverCredit);
224 213  
225   - cc.setStatus(1L);
  214 + return i;
  215 + }
226 216  
227   - try {
228   - driverCreditMapper.updateDriverCredit(cc);
  217 + private void sentDataToRemoteServer(DriverCredit driverCredit) {
229 218  
230   - cc.setReason(driverCredit.getReason());
231   - cc.setTime(new Date());
232   - cc.setLostCredit(0L);
  219 + System.out.println("sendData!" + driverCredit.getObjectId() + "status" + driverCredit.getStatus());
233 220  
234   - return insertDriverCredit(cc);
  221 + }
235 222  
236   - } catch (Exception e) {
  223 + /**
  224 + * 修改驾驶员失信
  225 + *
  226 + * @param driverCredit
  227 + * 驾驶员失信
  228 + * @return 结果
  229 + */
  230 + @Override
  231 + @Transactional
  232 + public int updateDriverCredit(DriverCredit driverCredit) {
  233 + DriverCredit cc = driverCreditMapper.selectDriverCreditById(driverCredit.getId());
237 234  
238   - }
  235 + cc.setStatus(1L);
239 236  
240   - return 0;
241   - }
  237 + try {
  238 + driverCreditMapper.updateDriverCredit(cc);
242 239  
243   - @Override
244   - public List<DriverCredit> selectDriverCreditHistory(DriverCredit driverCredit)
245   - {
246   -
247   - List<DriverCredit> list = new ArrayList<>();
  240 + cc.setReason(driverCredit.getReason());
  241 + cc.setTime(new Date());
  242 + cc.setLostCredit(0L);
248 243  
249   - List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds();
  244 + return insertDriverCredit(cc);
250 245  
251   -
252   - if (companys.size() > 0) {
  246 + } catch (Exception e) {
  247 + e.printStackTrace();
  248 + }
253 249  
254   - List<String> ids = new ArrayList<>();
255   -
256   - JSONArray jsonArray = RemoteServerUtils.getDriverList(trashConfig.getToken());
257   -
258   - for(Object obj:jsonArray){
259   - JSONObject json = (JSONObject) obj;
260   - if(companys.indexOf(json.getString("companyId")) > -1){
261   - ids.add(json.getString("id"));
262   - }
  250 + return 0;
  251 + }
  252 +
  253 + @Override
  254 + public List<DriverCredit> selectDriverCreditHistory(DriverCredit driverCredit) {
  255 +
  256 + List<DriverCredit> list = new ArrayList<>();
  257 +
  258 + List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds();
  259 + List<String> areas = SecurityUtils.getLoginUser().getUser().getCompanyAreas();
  260 +
  261 + if (areas.size() > 0) {
  262 + JSONArray array = redisCache.getCacheObject("companyList");
  263 + if (array != null) {
  264 + for (Object obj : array) {
  265 + JSONObject json = (JSONObject) obj;
  266 + if (areas.indexOf(json.getString("areaCode")) > -1) {
  267 + companys.add(json.getString("id"));
263 268 }
  269 + }
  270 + }
  271 + }
  272 +
  273 + if (companys.size() > 0) {
  274 +
  275 +
  276 + List<String> ids = new ArrayList<>();
  277 +
  278 + JSONArray jsonArray = redisCache.getCacheObject("driverList");
  279 + if(jsonArray == null){
  280 + Map map = new HashMap<>();
  281 + map.put("size", "99999");
  282 + map.put("page", "1");
  283 + jsonArray = RemoteServerUtils.getDriverList(trashConfig.getToken(), map);
264 284  
  285 + if(jsonArray != null){
  286 + redisCache.setCacheObject("driverList", jsonArray, 60, TimeUnit.DAYS);
  287 + }
265 288  
266   - driverCredit.setIds(ids);
267   -
268   -
269   -
270   - list = driverCreditMapper.selectDriverCreditHistory(driverCredit);
271 289 }
272 290  
273   -
274   - return list;
275   - }
276   -
277   - /**
278   - * 批量删除驾驶员失信
279   - *
280   - * @param ids 需要删除的驾驶员失信ID
281   - * @return 结果
282   - */
283   - @Override
284   - public int deleteDriverCreditByIds(Long[] ids)
285   - {
286   - return driverCreditMapper.deleteDriverCreditByIds(ids);
287   - }
288   -
289   -
290   -
291   - public List<String> getNames(DriverCredit driverCredit) {
292   -
293   - return driverCreditMapper.getNames(driverCredit);
294   - }
295   -
296   - /**
297   - * 删除驾驶员失信信息
298   - *
299   - * @param id 驾驶员失信ID
300   - * @return 结果
301   - */
302   - @Override
303   - public int deleteDriverCreditById(Long id)
304   - {
305   - return driverCreditMapper.deleteDriverCreditById(id);
306   - }
  291 + for (Object obj : jsonArray) {
  292 + JSONObject json = (JSONObject) obj;
  293 + if (companys.indexOf(json.getString("companyId")) > -1) {
  294 + ids.add(json.getString("id"));
  295 + }
  296 + }
  297 +
  298 + driverCredit.setIds(ids);
  299 +
  300 + list = driverCreditMapper.selectDriverCreditHistory(driverCredit);
  301 + }
  302 +
  303 + return list;
  304 + }
  305 +
  306 + /**
  307 + * 批量删除驾驶员失信
  308 + *
  309 + * @param ids
  310 + * 需要删除的驾驶员失信ID
  311 + * @return 结果
  312 + */
  313 + @Override
  314 + public int deleteDriverCreditByIds(Long[] ids) {
  315 + return driverCreditMapper.deleteDriverCreditByIds(ids);
  316 + }
  317 +
  318 + public List<String> getNames(DriverCredit driverCredit) {
  319 +
  320 + return driverCreditMapper.getNames(driverCredit);
  321 + }
  322 +
  323 + /**
  324 + * 删除驾驶员失信信息
  325 + *
  326 + * @param id
  327 + * 驾驶员失信ID
  328 + * @return 结果
  329 + */
  330 + @Override
  331 + public int deleteDriverCreditById(Long id) {
  332 + return driverCreditMapper.deleteDriverCreditById(id);
  333 + }
307 334 }
308 335 \ No newline at end of file
... ...
trash-workFlow/src/main/java/com/trash/business/service/impl/SupervisionThreestepServiceImpl.java
... ... @@ -196,7 +196,7 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
196 196 if (ids.size() == 0) {
197 197 return list;
198 198 }
199   -
  199 +
200 200 list = supervisionThreestepMapper.selectSupervisionThreestepList(supervisionThreestep);
201 201 if (supervisionThreestep.getHis() != null && supervisionThreestep.getHis().equals("2")) {
202 202  
... ... @@ -989,7 +989,8 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
989 989 JSONObject truckObject = (JSONObject) object;
990 990  
991 991 for (TruckActivate ta : taList) {
992   -
  992 +
  993 +
993 994 if (truckObject.getString("vehicleId").equals(ta.getObjectId())) {
994 995  
995 996 if (truckObject.getInteger("vehicleStatus") == 1) {
... ...
trash-workFlow/src/main/java/com/trash/business/service/impl/TruckActivateServiceImpl.java
... ... @@ -77,9 +77,6 @@ public class TruckActivateServiceImpl implements ITruckActivateService {
77 77  
78 78  
79 79 List<TruckActivate> list = new ArrayList<>();
80   - if(1==1){
81   - return truckActivateMapper.selectTruckActivateList(truckActivate);
82   - }
83 80  
84 81 List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds();
85 82 List<String> tList = SecurityUtils.getLoginUser().getUser().getTruckList();
... ...
trash-workFlow/src/main/java/com/trash/casefile/kafka/Consumer.java
1 1 package com.trash.casefile.kafka;
2 2  
  3 +import com.alibaba.druid.sql.visitor.functions.If;
3 4 import com.alibaba.fastjson.JSONArray;
4 5 import com.alibaba.fastjson.JSONObject;
5 6 import com.trash.casefile.domain.KafkaCompensation;
... ... @@ -35,408 +36,464 @@ import java.util.concurrent.TimeUnit;
35 36  
36 37 @Component
37 38 public class Consumer {
38   - private static final Logger log = LoggerFactory.getLogger(Consumer.class);
39   -
40   - @Autowired
41   - private IViolationWarningInformationService violationWarningInformationService;
42   -
43   - @KafkaListener(topics = "record_process_alarm")
44   - public void consume(ConsumerRecord<?, ?> record, Acknowledgment ack) throws InterruptedException, IOException {
45   - if(record==null){
46   - throw new RuntimeException("kafka record对象为空");
47   - }
48   - if(record.value()==null){
49   - throw new RuntimeException("kafka消费数据为空");
50   - }
51   - if(ack==null){
52   - throw new RuntimeException("kafka ack对象为空");
53   - }
54   - log.info("kafka消费数据成功,offset:"+ record.offset() +",data:" + record.value());
55   - String id = insertKafkaCompensation(record.value().toString());
56   - autoViolationWarning(record.value().toString(),id);
57   - //手动提交offset
58   - ack.acknowledge();
59   - }
60   -
61   - @Autowired
62   - trashConfig trashConfig;
63   -
64   - @Autowired
65   - SysLoginService loginService;
66   -
67   - @Autowired
68   - RedisCache redisCache;
69   -
70   - public void autoViolationWarning(String data,String id) throws InterruptedException, IOException {
71   -
72   - JSONObject jsonObject = JSONObject.parseObject(data);
73   - //报警时间
74   - Date alarmTime = new Date(jsonObject.getLong("alarmTime")*1000L);
75   -
76   - //这一块是一天内同一工地,同一类型的报警,只报有一条数据,不重复报工,只累加
77   - String nowHour = DateFormatUtils.format(alarmTime, "HH");
78   - String nowDate = null;
79   - String tomorrowDate = null;
80   - if(Integer.valueOf(nowHour)<8){
81   - nowDate = DateFormatUtils.format(DateUtils.addDays(alarmTime, -1), "yyyy-MM-dd");
82   - tomorrowDate = DateFormatUtils.format(alarmTime, "yyyy-MM-dd");
83   - }else{
84   - nowDate = DateFormatUtils.format(alarmTime, "yyyy-MM-dd");
85   - tomorrowDate = DateFormatUtils.format(DateUtils.addDays(alarmTime, 1), "yyyy-MM-dd");
86   - }
87   -
88   - //违规类型code
89   - String violationTypeCode = jsonObject.getString("alarmType");
90   - //违规类型
91   - String violationType = jsonObject.getString("alarmName");
92   - if(RemoteServerUtils.remote==null){
93   - //登录
94   - RemoteServerUtils.remote = trashConfig.getRemotePath();
95   - loginService.loginByRemote(trashConfig.getToken());
96   - }
97   - ViolationWarningInformation violationWarningInformation1 = null;
98   - JSONArray company1 = null;
99   - JSONObject basevehicleInfo = null;
100   - //这些类型无需累加
101   - if(violationTypeCode.equals("44030021") || violationTypeCode.equals("44030025")||violationTypeCode.equals("44030023")){
102   - violationWarningInformation1 = null;
103   - }else if(violationTypeCode.equals("44030033")||violationTypeCode.equals("44030034")){//这两种类型根据公司累加
104   - company1 = redisCache.getCacheObject("companyList");
105   - basevehicleInfo = RemoteServerUtils.getBasevehicleInfo(jsonObject.getString("vehicleId"),trashConfig.getToken());
106   - if(company1==null){
107   - throw new RuntimeException("获取公司列表失败!!!");
108   - }
109   -
110   - if(basevehicleInfo==null){
111   - throw new RuntimeException("获取公司详情失败!vehicleId:"+jsonObject.getString("vehicleId"));
112   - }
113   - }else{//其他都是根据工地/消纳站累加
114   - String project = jsonObject.getString("siteName");
115   - violationWarningInformation1 = SpringUtils.getBean(ViolationWarningInformationMapper.class).selectViolationWarningInformation(null,project, violationTypeCode, nowDate, tomorrowDate);
116   - }
117   - String siteName = jsonObject.getString("siteName");
118   - //判断该类型,该工地,该时间段是否已经存在报警信息,如果存在则不再新增,如果不存在则新增
119   - if (violationWarningInformation1 == null) {
120   - ViolationWarningInformation violationWarningInformation = new ViolationWarningInformation();
121   - String siteType = jsonObject.getString("siteType");
122   - if ("2".equals(siteType)) {//消纳场
123   - violationWarningInformation.setViolationObjectType("1");
124   - }
125   - //所属区域
126   - violationWarningInformation.setOwningRegion(jsonObject.getString("areaName"));
127   - //案卷编码
128   - String number = DateFormatUtils.format(alarmTime, "yyyyMMddHHmmssSSS");
129   - violationWarningInformation.setNumber(number.substring(2));
130   - //公司名称
131   - violationWarningInformation.setCompanyName(jsonObject.getString("enterpriseName"));
132   - //违规类型
133   - violationWarningInformation.setViolationType(violationTypeCode);
134   - //发送人
135   - violationWarningInformation.setCreateBy("长沙市建筑垃圾智慧监管平台");
136   - //推送对象
137   - violationWarningInformation.setViolationGrade("一般类");
138   - violationWarningInformation.setSendObject("区管理部门");
139   - String describe = "";
140   - String alarmTimeString = DateFormatUtils.format(alarmTime,"HH:mm");
141   - //根据不同违规类型,走不同流程
142   - switch (violationTypeCode) {
143   - case "44030020"://工地预警-未报开工作业
144   - //获取报警次数
145   - int count44030020 = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020")==null?1:Integer.parseInt(redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020").toString())+1;
146   - //获取累计报警描述
147   - String describe44030020 = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020describe")==null?"":redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020describe").toString();
148   - if(!StringUtils.isEmpty(describe44030020)){
149   - describe44030020 = describe44030020 + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
150   - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
151   - jsonObject.get("siteName") + "出现" + violationType;
152   - }else{
153   - describe44030020 = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
154   - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
155   - jsonObject.get("siteName") + "出现" + violationType;
156   - }
157   - //报警次数等于5推送案卷
158   - if(count44030020==5){
159   - violationWarningInformation.setViolationObjectType("0");
160   - violationWarningInformation.setSendObject("区管理部门");
161   - violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
162   - violationWarningInformation.setCreateTime(alarmTime);
163   - violationWarningInformation.setDescribe(describe44030020);
164   - // 业务逻辑
165   - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
166   - }
167   - //次数+1
168   - redisCache.setCacheObject(nowDate+jsonObject.getString("siteId")+"44030020",count44030020,24, TimeUnit.HOURS);
169   - //累计描述
170   - redisCache.setCacheObject(nowDate+jsonObject.getString("siteId")+"44030020describe",describe44030020,24, TimeUnit.HOURS);
171   - break;
172   - case "44030023"://工地预警-未按时间作业
173   - try{
174   - //获取工地信息
175   - JSONObject object = RemoteServerUtils.getConstructionLicenseById(jsonObject.getString("siteId"), trashConfig.getToken());
176   - String transportEndTime = object.getString("transportEndTime");
177   - String transportStartTime = object.getString("transportStartTime");
178   - String endTime = manipulateTime(transportEndTime,30);
179   - String startTime = manipulateTime(transportStartTime,-30);
180   - //获取结束运输报警次数
181   - String countKey = nowDate+jsonObject.getString("siteId")+"44030023"+transportEndTime;
182   - int count44030023 = redisCache.getCacheObject(countKey)==null?1:Integer.parseInt(redisCache.getCacheObject(countKey).toString())+1;
183   - //获取结束运输累计报警描述
184   - String describeKey = nowDate+jsonObject.getString("siteId")+"44030023describe"+transportEndTime;
185   - String describe44030023 = redisCache.getCacheObject(describeKey)==null?"":redisCache.getCacheObject(describeKey).toString();
186   - //获取结束运输报警次数
187   - String countEKey = nowDate+jsonObject.getString("siteId")+"44030023"+transportStartTime;
188   - int countE = redisCache.getCacheObject(countEKey)==null?1:Integer.parseInt(redisCache.getCacheObject(countEKey).toString())+1;
189   - //获取结束运输累计报警描述
190   - String describeEKey = nowDate+jsonObject.getString("siteId")+"44030023describe"+transportStartTime;
191   - String describeE = redisCache.getCacheObject(describeEKey)==null?"":redisCache.getCacheObject(describeEKey).toString();
192   -
193   - if(!StringUtils.isEmpty(describe44030023)){
194   - describe44030023 = describe44030023 + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
195   - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
196   - jsonObject.get("siteName") + "出现" + violationType;
197   - }else{
198   - describe44030023 = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
199   - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
200   - jsonObject.get("siteName") + "出现" + violationType;
201   - }
202   - //报警次数等于5推送案卷
203   - if(count44030023==5&&isTimeWithinRange(alarmTimeString,transportEndTime,endTime)){
204   - violationWarningInformation.setViolationObjectType("0");
205   - violationWarningInformation.setSendObject("区管理部门");
206   - violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
207   -
208   - violationWarningInformation.setCreateTime(alarmTime);
209   - violationWarningInformation.setDescribe(describe44030023);
210   - // 业务逻辑
211   - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
212   - }
213   -
214   - if(!StringUtils.isEmpty(describeE)){
215   - describeE = describeE + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
216   - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
217   - jsonObject.get("siteName") + "出现" + violationType;
218   - }else{
219   - describeE = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
220   - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
221   - jsonObject.get("siteName") + "出现" + violationType;
222   - }
223   - //报警次数等于5推送案卷
224   - if(countE==5&&isTimeWithinRange(alarmTimeString,startTime,transportStartTime)){
225   - violationWarningInformation.setViolationObjectType("0");
226   - violationWarningInformation.setSendObject("区管理部门");
227   - violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
228   -
229   - violationWarningInformation.setCreateTime(alarmTime);
230   - violationWarningInformation.setDescribe(describeE);
231   - // 业务逻辑
232   - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
233   - }
234   -
235   -
236   - //判断结束运输
237   - if(isTimeWithinRange(alarmTimeString,transportEndTime,endTime)){
238   - //次数+1
239   - redisCache.setCacheObject(countKey,count44030023,1, TimeUnit.HOURS);
240   - //累计描述
241   - redisCache.setCacheObject(describeKey,describe44030023,1, TimeUnit.HOURS);
242   - }else if(isTimeWithinRange(alarmTimeString,startTime,transportStartTime)){
243   - //次数+1
244   - redisCache.setCacheObject(countEKey,countE,1, TimeUnit.HOURS);
245   - //累计描述
246   - redisCache.setCacheObject(describeEKey,describeE,1, TimeUnit.HOURS);
247   - }
248   - }catch (NullPointerException e){
249   - throw e;
250   - }
251   - break;
252   -
253   - case "44030030"://未激活车辆作业
254   - case "44030031"://未核准作业车辆作业
255   - case "44030022"://工地预警-三无车辆进入工地
256   - case "44030021"://工地预警-视频设备离线超时报警
257   - case "44030028"://离线运输报警(工)
258   -
259   - violationWarningInformation.setViolationObjectType("0");
260   - violationWarningInformation.setSendObject("区管理部门");
261   - violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
262   - describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
263   - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
264   - jsonObject.get("siteName") + "出现" + violationType;
265   - violationWarningInformation.setCreateTime(alarmTime);
266   - violationWarningInformation.setDescribe(describe);
267   - // 业务逻辑
268   - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
269   - break;
270   -
271   - case "44030024"://处理场所预警-未报开工作业
272   - //获取报警次数
273   - int count44030024 = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024")==null?1:Integer.parseInt(redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024").toString())+1;
274   - //获取累计报警描述
275   - String describe44030024 = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024describe")==null?"":redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024describe").toString();
276   - if(!StringUtils.isEmpty(describe44030024)){
277   - describe44030024 = describe44030024 + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
278   - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
279   - jsonObject.get("siteName") + "出现" + violationType;
280   - }else{
281   - describe44030024 = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
282   - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
283   - jsonObject.get("siteName") + "出现" + violationType;
284   - }
285   - //报警次数等于5推送案卷
286   - if(count44030024==5){
287   - violationWarningInformation.setViolationObjectType("1");
288   - violationWarningInformation.setSendObject("区管理部门");
289   - violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
290   -
291   - violationWarningInformation.setCreateTime(alarmTime);
292   - violationWarningInformation.setDescribe(describe44030024);
293   - // 业务逻辑
294   - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
295   - }
296   -
297   -
298   - //次数+1
299   - redisCache.setCacheObject(nowDate+jsonObject.getString("siteId")+"44030024",count44030024,24, TimeUnit.HOURS);
300   - //累计描述
301   - redisCache.setCacheObject(nowDate+jsonObject.getString("siteId")+"44030024describe",describe44030024,24, TimeUnit.HOURS);
302   - break;
303   - case "44030027"://处理场所预警-未到指定的处理场所作业
304   - case "44030026"://处理场所预警-三无车辆进入处理场所
305   - case "44030029"://离线运输报警(消)
306   - case "44030025"://处理场所预警-视频设备离线超时报警
307   - violationWarningInformation.setViolationObjectType("1");
308   - violationWarningInformation.setSendObject("区管理部门");
309   - violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
310   - describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
311   - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
312   - jsonObject.get("siteName") + "出现" + violationType;
313   - violationWarningInformation.setCreateTime(alarmTime);
314   - violationWarningInformation.setDescribe(describe);
315   - // 业务逻辑
316   - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
317   - break;
318   - case "44030032"://未按线路行驶
319   - violationWarningInformation.setViolationObjectType("0");
320   - violationWarningInformation.setSendObject("区管理部门");
321   - violationWarningInformation.setProjectName(siteName);
322   - describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
323   - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
324   - jsonObject.get("siteName") + "出现" + violationType;
325   - violationWarningInformation.setCreateTime(alarmTime);
326   - violationWarningInformation.setDescribe(describe);
327   - // 业务逻辑
328   - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
329   - break;
330   - case "44030033"://闯禁行驶
331   - violationWarningInformation.setViolationObjectType("0");
332   - violationWarningInformation.setSendObject("区管理部门");
333   - violationWarningInformation.setProjectName(siteName);
334   - describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
335   - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "出现" + violationType;
336   - //设置公司简称
337   - for(Object o:company1){
338   - JSONObject jo = (JSONObject) o;
339   - if(basevehicleInfo.getString("companyID").equals(jo.getString("id"))){
340   - violationWarningInformation.setAbbreviation(jo.getString("abbreviation"));
341   - }
342   - }
343   - violationWarningInformation.setCreateTime(alarmTime);
344   - violationWarningInformation.setDescribe(describe);
345   - // 业务逻辑
346   - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
347   - break;
348   -
349   - case "44030034"://失信车辆作业
350   - case "44030035"://卫星
351   - violationWarningInformation.setProjectName(siteName);
352   - violationWarningInformation.setViolationObjectType("2");
353   - violationWarningInformation.setSendObject("运输企业");
354   - describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
355   - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "出现" + violationType;
356   - //设置公司简称
357   - for(Object o:company1){
358   - JSONObject jo = (JSONObject) o;
359   - if(basevehicleInfo.getString("companyID").equals(jo.getString("id"))){
360   - violationWarningInformation.setAbbreviation(jo.getString("abbreviation"));
361   - }
362   - }
363   - violationWarningInformation.setCreateTime(alarmTime);
364   - violationWarningInformation.setDescribe(describe);
365   - // 业务逻辑
366   - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
367   - break;
368   - }
369   -
370   -
371   -
372   -
373   - } else {
374   - String describe = "";
375   - if(violationTypeCode.equals("44030033")||violationTypeCode.equals("44030034")){
376   - describe = violationWarningInformation1.getDescribe() + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
377   - + jsonObject.getString("enterpriseName") + " " + jsonObject.get("licenseplateNo") + "出现" + jsonObject.getString("alarmName");
378   - }else{
379   - describe = violationWarningInformation1.getDescribe() + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
380   - + jsonObject.getString("enterpriseName") + " " + jsonObject.get("licenseplateNo") + "在" +
381   - jsonObject.get("siteName") + "出现" + jsonObject.getString("alarmName");
382   - }
383   -
384   - violationWarningInformation1.setDescribe(describe);
385   - SpringUtils.getBean(ViolationWarningInformationMapper.class).updateViolationWarningInformation(violationWarningInformation1);
386   - }
387   - //kafka消费成功
388   - KafkaCompensation kafkaCompensation = new KafkaCompensation();
389   - kafkaCompensation.setId(Long.valueOf(id));
390   - kafkaCompensation.setStatus(1);
391   - SpringUtils.getBean(KafkaCompensationMapper.class).updateKafkaCompensation(kafkaCompensation);
392   -
393   - }
394   -
395   - public String insertKafkaCompensation(String data){
396   - KafkaCompensation kafkaCompensation = new KafkaCompensation();
397   - kafkaCompensation.setData(data);
398   - kafkaCompensation.setCreateTime(DateUtils.getNowDate());
399   - kafkaCompensation.setStatus(0);
400   - SpringUtils.getBean(KafkaCompensationMapper.class).insertKafkaCompensation(kafkaCompensation);
401   - return kafkaCompensation.getId().toString();
402   - }
403   -
404   - /**
405   - * 对HH:mm格式时间进行分钟的加减
406   - * @param timeStr
407   - * @param minutesToAddOrSubtract
408   - * @return
409   - */
410   - public String manipulateTime(String timeStr, int minutesToAddOrSubtract) {
411   - // 定义输入时间格式的日期时间格式器
412   - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
413   -
414   - // 解析输入的时间字符串为 LocalTime 对象
415   - LocalTime time = LocalTime.parse(timeStr, formatter);
416   -
417   - // 执行加减分钟的操作
418   - LocalTime modifiedTime = time.plusMinutes(minutesToAddOrSubtract);
419   -
420   - // 将修改后的时间格式化为 HH:mm 格式
421   - String formattedModifiedTime = modifiedTime.format(formatter);
422   -
423   - return formattedModifiedTime;
424   - }
425   -
426   - /**
427   - * 判断timeStr是否在startTimeStr-endTimeStr区间
428   - * @param timeStr
429   - * @param startTimeStr
430   - * @param endTimeStr
431   - * @return
432   - */
433   - public boolean isTimeWithinRange(String timeStr, String startTimeStr, String endTimeStr) {
434   - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
435   - LocalTime time = LocalTime.parse(timeStr, formatter);
436   - LocalTime startTime = LocalTime.parse(startTimeStr, formatter);
437   - LocalTime endTime = LocalTime.parse(endTimeStr, formatter);
438   -
439   - return !time.isBefore(startTime) && !time.isAfter(endTime);
440   -
441   - }
  39 + private static final Logger log = LoggerFactory.getLogger(Consumer.class);
  40 +
  41 + @Autowired
  42 + private IViolationWarningInformationService violationWarningInformationService;
  43 +
  44 + @KafkaListener(topics = "record_process_alarm")
  45 + public void consume(ConsumerRecord<?, ?> record, Acknowledgment ack) throws InterruptedException, IOException {
  46 + if (record == null) {
  47 + throw new RuntimeException("kafka record对象为空");
  48 + }
  49 + if (record.value() == null) {
  50 + throw new RuntimeException("kafka消费数据为空");
  51 + }
  52 + if (ack == null) {
  53 + throw new RuntimeException("kafka ack对象为空");
  54 + }
  55 + log.info("kafka消费数据成功,offset:" + record.offset() + ",data:" + record.value());
  56 + String id = insertKafkaCompensation(record.value().toString());
  57 + autoViolationWarning(record.value().toString(), id);
  58 + // 手动提交offset
  59 + ack.acknowledge();
  60 + }
  61 +
  62 + @Autowired
  63 + trashConfig trashConfig;
  64 +
  65 + @Autowired
  66 + SysLoginService loginService;
  67 +
  68 + @Autowired
  69 + RedisCache redisCache;
  70 +
  71 + Map<String, Long> cMap = new HashMap<String, Long>();
  72 +
  73 + JSONArray company1 = null;
  74 +
  75 + public void autoViolationWarning(String data, String id) throws InterruptedException, IOException {
  76 +
  77 + JSONObject jsonObject = JSONObject.parseObject(data);
  78 + // 报警时间
  79 + Date alarmTime = new Date(jsonObject.getLong("alarmTime") * 1000L);
  80 +
  81 + // 这一块是一天内同一工地,同一类型的报警,只报有一条数据,不重复报工,只累加
  82 + String nowHour = DateFormatUtils.format(alarmTime, "HH");
  83 + String nowDate = null;
  84 + String tomorrowDate = null;
  85 + if (Integer.valueOf(nowHour) < 8) {
  86 + nowDate = DateFormatUtils.format(DateUtils.addDays(alarmTime, -1), "yyyy-MM-dd");
  87 + tomorrowDate = DateFormatUtils.format(alarmTime, "yyyy-MM-dd");
  88 + } else {
  89 + nowDate = DateFormatUtils.format(alarmTime, "yyyy-MM-dd");
  90 + tomorrowDate = DateFormatUtils.format(DateUtils.addDays(alarmTime, 1), "yyyy-MM-dd");
  91 + }
  92 +
  93 + // 违规类型code
  94 + String violationTypeCode = jsonObject.getString("alarmType");
  95 + // 违规类型
  96 + String violationType = jsonObject.getString("alarmName");
  97 + if (RemoteServerUtils.remote == null) {
  98 + // 登录
  99 + RemoteServerUtils.remote = trashConfig.getRemotePath();
  100 + loginService.loginByRemote(trashConfig.getToken());
  101 + }
  102 + ViolationWarningInformation violationWarningInformation1 = null;
  103 + JSONObject basevehicleInfo = null;
  104 + // 这些类型无需累加
  105 + if (violationTypeCode.equals("44030021") || violationTypeCode.equals("44030025")
  106 + || violationTypeCode.equals("44030023")) {
  107 + violationWarningInformation1 = null;
  108 + } else if (violationTypeCode.equals("44030033") || violationTypeCode.equals("44030034")
  109 + || violationTypeCode.equals("44030035")) {// 这两种类型根据公司累加
  110 +
  111 + if (company1 == null || cMap.get("companyTime")==null || (new Date().getTime() - cMap.get("companyTime")) > 1000 * 60 * 60) {
  112 + company1 = redisCache.getCacheObject("companyList");
  113 + cMap.put("companyTime", new Date().getTime());
  114 + }
  115 + basevehicleInfo = RemoteServerUtils.getBasevehicleInfo(jsonObject.getString("vehicleId"),
  116 + trashConfig.getToken());
  117 + if (company1 == null) {
  118 + throw new RuntimeException("获取公司列表失败!!!");
  119 + }
  120 +
  121 + if (basevehicleInfo == null) {
  122 + throw new RuntimeException("获取公司详情失败!vehicleId:" + jsonObject.getString("vehicleId"));
  123 + }
  124 + } else {// 其他都是根据工地/消纳站累加
  125 + String project = jsonObject.getString("siteName");
  126 + violationWarningInformation1 = SpringUtils.getBean(ViolationWarningInformationMapper.class)
  127 + .selectViolationWarningInformation(null, project, violationTypeCode, nowDate, tomorrowDate);
  128 + }
  129 + String siteName = jsonObject.getString("siteName");
  130 + // 判断该类型,该工地,该时间段是否已经存在报警信息,如果存在则不再新增,如果不存在则新增
  131 + if (violationWarningInformation1 == null) {
  132 + ViolationWarningInformation violationWarningInformation = new ViolationWarningInformation();
  133 + String siteType = jsonObject.getString("siteType");
  134 + if ("2".equals(siteType)) {// 消纳场
  135 + violationWarningInformation.setViolationObjectType("1");
  136 + }
  137 + // 所属区域
  138 + violationWarningInformation.setOwningRegion(jsonObject.getString("areaName"));
  139 + // 案卷编码
  140 + String number = DateFormatUtils.format(alarmTime, "yyyyMMddHHmmssSSS");
  141 + violationWarningInformation.setNumber(number.substring(2));
  142 + // 公司名称
  143 + violationWarningInformation.setCompanyName(jsonObject.getString("enterpriseName"));
  144 + // 违规类型
  145 + violationWarningInformation.setViolationType(violationTypeCode);
  146 + // 发送人
  147 + violationWarningInformation.setCreateBy("长沙市建筑垃圾智慧监管平台");
  148 + // 推送对象
  149 + violationWarningInformation.setViolationGrade("一般类");
  150 + violationWarningInformation.setSendObject("区管理部门");
  151 + String describe = "";
  152 + String alarmTimeString = DateFormatUtils.format(alarmTime, "HH:mm");
  153 + // 根据不同违规类型,走不同流程
  154 + switch (violationTypeCode) {
  155 + case "44030020":// 工地预警-未报开工作业
  156 + // 获取报警次数
  157 + int count44030020 = redisCache
  158 + .getCacheObject(nowDate + jsonObject.getString("siteId") + "44030020") == null
  159 + ? 1
  160 + : Integer.parseInt(
  161 + redisCache.getCacheObject(nowDate + jsonObject.getString("siteId") + "44030020")
  162 + .toString())
  163 + + 1;
  164 + // 获取累计报警描述
  165 + String describe44030020 = redisCache
  166 + .getCacheObject(nowDate + jsonObject.getString("siteId") + "44030020describe") == null
  167 + ? ""
  168 + : redisCache
  169 + .getCacheObject(nowDate + jsonObject.getString("siteId") + "44030020describe")
  170 + .toString();
  171 + if (!StringUtils.isEmpty(describe44030020)) {
  172 + describe44030020 = describe44030020 + ";\n"
  173 + + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  174 + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo")
  175 + + "在" + jsonObject.get("siteName") + "出现" + violationType;
  176 + } else {
  177 + describe44030020 = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  178 + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo")
  179 + + "在" + jsonObject.get("siteName") + "出现" + violationType;
  180 + }
  181 + // 报警次数等于5推送案卷
  182 + if (count44030020 == 5) {
  183 + violationWarningInformation.setViolationObjectType("0");
  184 + violationWarningInformation.setSendObject("区管理部门");
  185 + violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
  186 + violationWarningInformation.setCreateTime(alarmTime);
  187 + violationWarningInformation.setDescribe(describe44030020);
  188 + // 业务逻辑
  189 + violationWarningInformationService.insertViolationWarningInformation(null,
  190 + violationWarningInformation);
  191 + }
  192 + // 次数+1
  193 + redisCache.setCacheObject(nowDate + jsonObject.getString("siteId") + "44030020", count44030020, 24,
  194 + TimeUnit.HOURS);
  195 + // 累计描述
  196 + redisCache.setCacheObject(nowDate + jsonObject.getString("siteId") + "44030020describe",
  197 + describe44030020, 24, TimeUnit.HOURS);
  198 + break;
  199 + case "44030023":// 工地预警-未按时间作业
  200 + try {
  201 + // 获取工地信息
  202 + JSONObject object = RemoteServerUtils.getConstructionLicenseById(jsonObject.getString("siteId"),
  203 + trashConfig.getToken());
  204 + String transportEndTime = object.getString("transportEndTime");
  205 + String transportStartTime = object.getString("transportStartTime");
  206 + String endTime = manipulateTime(transportEndTime, 30);
  207 + String startTime = manipulateTime(transportStartTime, -30);
  208 + // 获取结束运输报警次数
  209 + String countKey = nowDate + jsonObject.getString("siteId") + "44030023" + transportEndTime;
  210 + int count44030023 = redisCache.getCacheObject(countKey) == null ? 1
  211 + : Integer.parseInt(redisCache.getCacheObject(countKey).toString()) + 1;
  212 + // 获取结束运输累计报警描述
  213 + String describeKey = nowDate + jsonObject.getString("siteId") + "44030023describe"
  214 + + transportEndTime;
  215 + String describe44030023 = redisCache.getCacheObject(describeKey) == null ? ""
  216 + : redisCache.getCacheObject(describeKey).toString();
  217 + // 获取结束运输报警次数
  218 + String countEKey = nowDate + jsonObject.getString("siteId") + "44030023" + transportStartTime;
  219 + int countE = redisCache.getCacheObject(countEKey) == null ? 1
  220 + : Integer.parseInt(redisCache.getCacheObject(countEKey).toString()) + 1;
  221 + // 获取结束运输累计报警描述
  222 + String describeEKey = nowDate + jsonObject.getString("siteId") + "44030023describe"
  223 + + transportStartTime;
  224 + String describeE = redisCache.getCacheObject(describeEKey) == null ? ""
  225 + : redisCache.getCacheObject(describeEKey).toString();
  226 +
  227 + if (!StringUtils.isEmpty(describe44030023)) {
  228 + describe44030023 = describe44030023 + ";\n"
  229 + + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  230 + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo")
  231 + + "在" + jsonObject.get("siteName") + "出现" + violationType;
  232 + } else {
  233 + describe44030023 = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  234 + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo")
  235 + + "在" + jsonObject.get("siteName") + "出现" + violationType;
  236 + }
  237 + // 报警次数等于5推送案卷
  238 + if (count44030023 == 5 && isTimeWithinRange(alarmTimeString, transportEndTime, endTime)) {
  239 + violationWarningInformation.setViolationObjectType("0");
  240 + violationWarningInformation.setSendObject("区管理部门");
  241 + violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
  242 +
  243 + violationWarningInformation.setCreateTime(alarmTime);
  244 + violationWarningInformation.setDescribe(describe44030023);
  245 + // 业务逻辑
  246 + violationWarningInformationService.insertViolationWarningInformation(null,
  247 + violationWarningInformation);
  248 + }
  249 +
  250 + if (!StringUtils.isEmpty(describeE)) {
  251 + describeE = describeE + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  252 + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo")
  253 + + "在" + jsonObject.get("siteName") + "出现" + violationType;
  254 + } else {
  255 + describeE = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  256 + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo")
  257 + + "在" + jsonObject.get("siteName") + "出现" + violationType;
  258 + }
  259 + // 报警次数等于5推送案卷
  260 + if (countE == 5 && isTimeWithinRange(alarmTimeString, startTime, transportStartTime)) {
  261 + violationWarningInformation.setViolationObjectType("0");
  262 + violationWarningInformation.setSendObject("区管理部门");
  263 + violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
  264 +
  265 + violationWarningInformation.setCreateTime(alarmTime);
  266 + violationWarningInformation.setDescribe(describeE);
  267 + // 业务逻辑
  268 + violationWarningInformationService.insertViolationWarningInformation(null,
  269 + violationWarningInformation);
  270 + }
  271 +
  272 + // 判断结束运输
  273 + if (isTimeWithinRange(alarmTimeString, transportEndTime, endTime)) {
  274 + // 次数+1
  275 + redisCache.setCacheObject(countKey, count44030023, 1, TimeUnit.HOURS);
  276 + // 累计描述
  277 + redisCache.setCacheObject(describeKey, describe44030023, 1, TimeUnit.HOURS);
  278 + } else if (isTimeWithinRange(alarmTimeString, startTime, transportStartTime)) {
  279 + // 次数+1
  280 + redisCache.setCacheObject(countEKey, countE, 1, TimeUnit.HOURS);
  281 + // 累计描述
  282 + redisCache.setCacheObject(describeEKey, describeE, 1, TimeUnit.HOURS);
  283 + }
  284 + } catch (NullPointerException e) {
  285 + throw e;
  286 + }
  287 + break;
  288 +
  289 + case "44030030":// 未激活车辆作业
  290 + case "44030031":// 未核准作业车辆作业
  291 + case "44030022":// 工地预警-三无车辆进入工地
  292 + case "44030021":// 工地预警-视频设备离线超时报警
  293 + case "44030028":// 离线运输报警(工)
  294 +
  295 + violationWarningInformation.setViolationObjectType("0");
  296 + violationWarningInformation.setSendObject("区管理部门");
  297 + violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
  298 + describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  299 + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在"
  300 + + jsonObject.get("siteName") + "出现" + violationType;
  301 + violationWarningInformation.setCreateTime(alarmTime);
  302 + violationWarningInformation.setDescribe(describe);
  303 + // 业务逻辑
  304 + violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
  305 + break;
  306 +
  307 + case "44030024":// 处理场所预警-未报开工作业
  308 + // 获取报警次数
  309 + int count44030024 = redisCache
  310 + .getCacheObject(nowDate + jsonObject.getString("siteId") + "44030024") == null
  311 + ? 1
  312 + : Integer.parseInt(
  313 + redisCache.getCacheObject(nowDate + jsonObject.getString("siteId") + "44030024")
  314 + .toString())
  315 + + 1;
  316 + // 获取累计报警描述
  317 + String describe44030024 = redisCache
  318 + .getCacheObject(nowDate + jsonObject.getString("siteId") + "44030024describe") == null
  319 + ? ""
  320 + : redisCache
  321 + .getCacheObject(nowDate + jsonObject.getString("siteId") + "44030024describe")
  322 + .toString();
  323 + if (!StringUtils.isEmpty(describe44030024)) {
  324 + describe44030024 = describe44030024 + ";\n"
  325 + + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  326 + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo")
  327 + + "在" + jsonObject.get("siteName") + "出现" + violationType;
  328 + } else {
  329 + describe44030024 = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  330 + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo")
  331 + + "在" + jsonObject.get("siteName") + "出现" + violationType;
  332 + }
  333 + // 报警次数等于5推送案卷
  334 + if (count44030024 == 5) {
  335 + violationWarningInformation.setViolationObjectType("1");
  336 + violationWarningInformation.setSendObject("区管理部门");
  337 + violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
  338 +
  339 + violationWarningInformation.setCreateTime(alarmTime);
  340 + violationWarningInformation.setDescribe(describe44030024);
  341 + // 业务逻辑
  342 + violationWarningInformationService.insertViolationWarningInformation(null,
  343 + violationWarningInformation);
  344 + }
  345 +
  346 + // 次数+1
  347 + redisCache.setCacheObject(nowDate + jsonObject.getString("siteId") + "44030024", count44030024, 24,
  348 + TimeUnit.HOURS);
  349 + // 累计描述
  350 + redisCache.setCacheObject(nowDate + jsonObject.getString("siteId") + "44030024describe",
  351 + describe44030024, 24, TimeUnit.HOURS);
  352 + break;
  353 + case "44030027":// 处理场所预警-未到指定的处理场所作业
  354 + case "44030026":// 处理场所预警-三无车辆进入处理场所
  355 + case "44030029":// 离线运输报警(消)
  356 + case "44030025":// 处理场所预警-视频设备离线超时报警
  357 + violationWarningInformation.setViolationObjectType("1");
  358 + violationWarningInformation.setSendObject("区管理部门");
  359 + violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
  360 + describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  361 + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在"
  362 + + jsonObject.get("siteName") + "出现" + violationType;
  363 + violationWarningInformation.setCreateTime(alarmTime);
  364 + violationWarningInformation.setDescribe(describe);
  365 + // 业务逻辑
  366 + violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
  367 + break;
  368 + case "44030032":// 未按线路行驶
  369 + violationWarningInformation.setViolationObjectType("0");
  370 + violationWarningInformation.setSendObject("区管理部门");
  371 + violationWarningInformation.setProjectName(siteName);
  372 + describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  373 + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在"
  374 + + jsonObject.get("siteName") + "出现" + violationType;
  375 + violationWarningInformation.setCreateTime(alarmTime);
  376 + violationWarningInformation.setDescribe(describe);
  377 + // 业务逻辑
  378 + violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
  379 + break;
  380 + case "44030033":// 闯禁行驶
  381 + violationWarningInformation.setViolationObjectType("0");
  382 + violationWarningInformation.setSendObject("区管理部门");
  383 + violationWarningInformation.setProjectName(siteName);
  384 + describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  385 + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "出现"
  386 + + violationType;
  387 + // 设置公司简称
  388 + for (Object o : company1) {
  389 + JSONObject jo = (JSONObject) o;
  390 + if (basevehicleInfo.getString("companyID").equals(jo.getString("id"))) {
  391 + violationWarningInformation.setAbbreviation(jo.getString("abbreviation"));
  392 + break;
  393 + }
  394 + }
  395 + violationWarningInformation.setCreateTime(alarmTime);
  396 + violationWarningInformation.setDescribe(describe);
  397 + // 业务逻辑
  398 + violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
  399 + break;
  400 +
  401 + case "44030034":// 失信车辆作业
  402 + case "44030035":// 卫星
  403 + violationWarningInformation.setProjectName(siteName);
  404 + violationWarningInformation.setViolationObjectType("2");
  405 + violationWarningInformation.setSendObject("运输企业");
  406 + describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  407 + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "出现"
  408 + + violationType;
  409 + // 设置公司简称
  410 + for (Object o : company1) {
  411 + JSONObject jo = (JSONObject) o;
  412 + if (basevehicleInfo.getString("companyID").equals(jo.getString("id"))) {
  413 + violationWarningInformation.setAbbreviation(jo.getString("abbreviation"));
  414 + break;
  415 + }
  416 + }
  417 + violationWarningInformation.setCreateTime(alarmTime);
  418 + violationWarningInformation.setDescribe(describe);
  419 + // 业务逻辑
  420 + violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
  421 + break;
  422 + }
  423 +
  424 + } else {
  425 + String describe = "";
  426 + if (violationTypeCode.equals("44030033") || violationTypeCode.equals("44030034")) {
  427 + describe = violationWarningInformation1.getDescribe() + ";\n"
  428 + + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  429 + + jsonObject.getString("enterpriseName") + " " + jsonObject.get("licenseplateNo") + "出现"
  430 + + jsonObject.getString("alarmName");
  431 + } else {
  432 + describe = violationWarningInformation1.getDescribe() + ";\n"
  433 + + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  434 + + jsonObject.getString("enterpriseName") + " " + jsonObject.get("licenseplateNo") + "在"
  435 + + jsonObject.get("siteName") + "出现" + jsonObject.getString("alarmName");
  436 + }
  437 +
  438 + violationWarningInformation1.setDescribe(describe);
  439 + SpringUtils.getBean(ViolationWarningInformationMapper.class)
  440 + .updateViolationWarningInformation(violationWarningInformation1);
  441 + }
  442 + // kafka消费成功
  443 + KafkaCompensation kafkaCompensation = new KafkaCompensation();
  444 + kafkaCompensation.setId(Long.valueOf(id));
  445 + kafkaCompensation.setStatus(1);
  446 + SpringUtils.getBean(KafkaCompensationMapper.class).updateKafkaCompensation(kafkaCompensation);
  447 +
  448 + }
  449 +
  450 + public String insertKafkaCompensation(String data) {
  451 + KafkaCompensation kafkaCompensation = new KafkaCompensation();
  452 + kafkaCompensation.setData(data);
  453 + kafkaCompensation.setCreateTime(DateUtils.getNowDate());
  454 + kafkaCompensation.setStatus(0);
  455 + SpringUtils.getBean(KafkaCompensationMapper.class).insertKafkaCompensation(kafkaCompensation);
  456 + return kafkaCompensation.getId().toString();
  457 + }
  458 +
  459 + /**
  460 + * 对HH:mm格式时间进行分钟的加减
  461 + *
  462 + * @param timeStr
  463 + * @param minutesToAddOrSubtract
  464 + * @return
  465 + */
  466 + public String manipulateTime(String timeStr, int minutesToAddOrSubtract) {
  467 + // 定义输入时间格式的日期时间格式器
  468 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
  469 +
  470 + // 解析输入的时间字符串为 LocalTime 对象
  471 + LocalTime time = LocalTime.parse(timeStr, formatter);
  472 +
  473 + // 执行加减分钟的操作
  474 + LocalTime modifiedTime = time.plusMinutes(minutesToAddOrSubtract);
  475 +
  476 + // 将修改后的时间格式化为 HH:mm 格式
  477 + String formattedModifiedTime = modifiedTime.format(formatter);
  478 +
  479 + return formattedModifiedTime;
  480 + }
  481 +
  482 + /**
  483 + * 判断timeStr是否在startTimeStr-endTimeStr区间
  484 + *
  485 + * @param timeStr
  486 + * @param startTimeStr
  487 + * @param endTimeStr
  488 + * @return
  489 + */
  490 + public boolean isTimeWithinRange(String timeStr, String startTimeStr, String endTimeStr) {
  491 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
  492 + LocalTime time = LocalTime.parse(timeStr, formatter);
  493 + LocalTime startTime = LocalTime.parse(startTimeStr, formatter);
  494 + LocalTime endTime = LocalTime.parse(endTimeStr, formatter);
  495 +
  496 + return !time.isBefore(startTime) && !time.isAfter(endTime);
  497 +
  498 + }
442 499 }
... ...
trash-workFlow/src/main/java/com/trash/workflow/listener/DropPointListener.java 0 → 100644
  1 +package com.trash.workflow.listener;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +import java.util.Map;
  6 +
  7 +import org.activiti.engine.delegate.DelegateExecution;
  8 +import org.activiti.engine.delegate.ExecutionListener;
  9 +import org.activiti.engine.delegate.Expression;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +
  12 +import com.trash.business.mapper.GarMapper;
  13 +import com.trash.common.utils.spring.SpringUtils;
  14 +
  15 +
  16 +public class DropPointListener implements ExecutionListener {
  17 +
  18 + private Expression state;
  19 +
  20 + @Override
  21 + public void notify(DelegateExecution delegateExecution) {
  22 +
  23 + List<Map> maps = new ArrayList<Map>();
  24 +
  25 + String idString = (delegateExecution.getProcessInstanceBusinessKey().split(":")[1]);
  26 + String status = (state.getValue(delegateExecution).toString());
  27 +
  28 + SpringUtils.getBean(GarMapper.class).updateDropPointById(idString, status);
  29 +
  30 + workflowUtils.sendDataToHisTory(delegateExecution, state,null);
  31 +
  32 + System.out.println("纪检督察流程状态更新 更新ID:" + delegateExecution.getProcessInstanceBusinessKey() + "状态:" + state.getValue(delegateExecution).toString());
  33 + }
  34 +
  35 +
  36 +
  37 +}
... ...
trash-workFlow/src/main/java/com/trash/workflow/service/IWorkflowService.java
... ... @@ -3,17 +3,12 @@ package com.trash.workflow.service;
3 3 import java.util.List;
4 4 import java.util.Map;
5 5  
6   -import com.trash.casefile.domain.ViolationWarningInformation;
7   -import org.activiti.api.process.model.ProcessInstance;
8   -
9   -import com.trash.activiti.domain.dto.HistoryDataDTO;
10 6 import com.trash.business.domain.SupervisionThreestep;
11 7 import com.trash.caseOffline.domain.CaseOffline;
12 8 import com.trash.casefile.domain.ViolationCaseFile;
  9 +import com.trash.casefile.domain.ViolationWarningInformation;
13 10 import com.trash.workflow.domain.Workflow;
14 11  
15   -import net.sf.jsqlparser.statement.create.table.Index;
16   -
17 12 /**
18 13 * 请假Service接口
19 14 *
... ... @@ -79,6 +74,7 @@ public interface IWorkflowService
79 74 */
80 75 int deleteWorkflowById(String id);
81 76  
  77 + int createDropPointWorkFlow(Map<String,String> droppoint);
82 78  
83 79 int createLeaveWorkFlow(Workflow workflow,int index);
84 80  
... ...
trash-workFlow/src/main/java/com/trash/workflow/service/impl/WorkflowServiceImpl.java
... ... @@ -4,33 +4,20 @@ import java.text.SimpleDateFormat;
4 4 import java.util.Date;
5 5 import java.util.List;
6 6 import java.util.Map;
7   -import java.util.concurrent.TimeUnit;
8 7 import java.util.stream.Collectors;
9 8  
10   -import com.trash.casefile.domain.ViolationWarningInformation;
11   -import com.trash.common.config.trashConfig;
12   -import com.trash.common.core.redis.RedisCache;
13   -import com.trash.common.core.domain.entity.SysUser;
14   -import com.trash.common.core.domain.model.LoginUser;
15   -import com.trash.framework.web.service.SysLoginService;
16 9 import org.activiti.api.process.model.ProcessInstance;
17 10 import org.activiti.api.process.model.builders.ProcessPayloadBuilder;
18   -import org.activiti.api.process.model.payloads.StartProcessPayload;
19 11 import org.activiti.api.process.runtime.ProcessRuntime;
20 12 import org.activiti.api.task.runtime.TaskRuntime;
21 13 import org.activiti.engine.RuntimeService;
22 14 import org.activiti.engine.TaskService;
23 15 import org.activiti.engine.task.IdentityLink;
24   -import org.activiti.engine.task.IdentityLinkType;
25 16 import org.activiti.engine.task.Task;
26 17 import org.apache.commons.collections4.map.HashedMap;
27 18 import org.springframework.beans.factory.annotation.Autowired;
28   -import org.springframework.security.core.context.SecurityContext;
29 19 import org.springframework.security.core.context.SecurityContextHolder;
30 20 import org.springframework.security.core.context.SecurityContextImpl;
31   -import org.springframework.security.authentication.AuthenticationManager;
32   -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
33   -import org.springframework.security.core.Authentication;
34 21 import org.springframework.stereotype.Service;
35 22 import org.springframework.transaction.annotation.Transactional;
36 23  
... ... @@ -44,11 +31,14 @@ import com.trash.business.service.IConstructionSignService;
44 31 import com.trash.business.service.ISupervisionThreestepService;
45 32 import com.trash.caseOffline.domain.CaseOffline;
46 33 import com.trash.casefile.domain.ViolationCaseFile;
  34 +import com.trash.casefile.domain.ViolationWarningInformation;
  35 +import com.trash.common.core.domain.entity.SysUser;
  36 +import com.trash.common.core.redis.RedisCache;
47 37 import com.trash.common.utils.DateUtils;
48 38 import com.trash.common.utils.RemoteServerUtils;
49 39 import com.trash.common.utils.SecurityUtils;
50 40 import com.trash.common.utils.StringUtils;
51   -import com.trash.common.utils.uuid.UUID;
  41 +import com.trash.framework.web.service.SysLoginService;
52 42 import com.trash.system.service.ISysUserService;
53 43 import com.trash.workflow.domain.Workflow;
54 44 import com.trash.workflow.mapper.WorkflowMapper;
... ... @@ -280,6 +270,46 @@ public class WorkflowServiceImpl implements IWorkflowService {
280 270  
281 271 return 0;
282 272 }
  273 +
  274 + @Override
  275 + @Transactional
  276 + public int createDropPointWorkFlow(Map<String,String> droppoint) { // 三查
  277 + ProcessInstance processInstance = null;
  278 + ActWorkflowFormData awf = null;
  279 + try {
  280 + String name = "投放点审批:" + droppoint.get("name");
  281 +
  282 + processInstance = processRuntime.start(ProcessPayloadBuilder.start()
  283 + .withProcessDefinitionKey("workflow_drop_point").withName(name)
  284 + .withBusinessKey("workflow_drop_point:" + droppoint.get("id")).build());
  285 +
  286 + PorcThreeStepTask(processInstance, droppoint.get("area"));
  287 +
  288 + Workflow workflow = new Workflow();
  289 + workflow.setId("workflow_drop_point:" + droppoint.get("id"));
  290 + workflow.setTitle(name);
  291 + workflow.setReason(droppoint.get("name") + "审批流程");
  292 + workflow.setStartTime(sdf.format(new Date()));
  293 + workflow.setEndTime(sdf.format(new Date()));
  294 + workflow.setType("投放点审批");
  295 + workflow.setInstanceId(processInstance.getId());
  296 + workflow.setState("0");
  297 + workflow.setCreateTime(new Date());
  298 +
  299 +
  300 + SysUser user = SecurityUtils.getLoginUser().getUser();
  301 + awf = insertAwf(user,workflow);
  302 +
  303 + return workflowMapper.insertWorkflow(workflow);
  304 + } catch (Exception e) {
  305 + e.printStackTrace();
  306 + if(awf.getId() != null)
  307 + awfServer.deleteActWorkflowFormDataById(awf.getId());
  308 + processRuntime.delete(ProcessPayloadBuilder.delete(processInstance));
  309 + }
  310 +
  311 + return 0;
  312 + }
283 313  
284 314 @Override
285 315 @Transactional
... ...
trash-workFlow/src/main/resources/mapper/GarMapper.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.business.mapper.GarMapper">
  6 +
  7 + <update id="updateDropPointById" parameterType="String">
  8 + update drop_point_info Set update_time = NOW(),status = #{status}
  9 + where id = #{id}
  10 + </update>
  11 +</mapper>
0 12 \ No newline at end of file
... ...
trash-workFlow/src/main/resources/mapper/SupervisionThreestepMapper.xml
... ... @@ -133,6 +133,9 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
133 133 <if test="phone != null and phone != ''"> and phone = #{phone}</if>
134 134 <if test="status != null"> and status = #{status}</if>
135 135 <if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
  136 + <if test="checkStatus != null and checkStatus==1 "> and check_end_time is not null</if>
  137 + <if test="checkStatus != null and checkStatus==0 "> and check_end_time is null</if>
  138 +
136 139 <if test="workStartTime != null"> and self_check_time BETWEEN #{workStartTime} and
137 140 #{workEndTime}</if>
138 141  
... ... @@ -149,7 +152,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
149 152 close=")">
150 153 #{id}
151 154 </foreach>
152   - </if>
  155 + </if>
153 156 </where>
154 157 ORDER BY create_time desc
155 158 </select>
... ...
trash-workFlow/src/main/resources/mapper/TruckActivateMapper.xml
... ... @@ -26,9 +26,9 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
26 26 <result property="transportEndTime" column="transport_end_time" />
27 27 <result property="routeName" column="route_name" />
28 28 <result property="earthName" column="earth_name" />
29   - <result property="routeInfo" column="route_info" />
  29 +<!-- <result property="routeInfo" column="route_info" />
30 30 <result property="earthList" column="earth_list" />
31   - <result property="coord" column="coord" />
  31 + <result property="coord" column="coord" /> -->
32 32 </resultMap>
33 33  
34 34 <sql id="selectTruckActivateVo">
... ... @@ -161,9 +161,9 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
161 161 <if test="transportEndTime != null">transport_end_time,</if>
162 162 <if test="routeName != null">route_name,</if>
163 163 <if test="earthName != null">earth_name,</if>
164   - <if test="routeInfo != null">route_info,</if>
  164 +<!-- <if test="routeInfo != null">route_info,</if>
165 165 <if test="earthList != null">earth_list,</if>
166   - <if test="coord != null">coord,</if>
  166 + <if test="coord != null">coord,</if> -->
167 167 </trim>
168 168 <trim prefix="values (" suffix=")" suffixOverrides=",">
169 169 <if test="company != null">#{company},</if>
... ... @@ -187,9 +187,9 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
187 187 <if test="transportEndTime != null">#{transportEndTime},</if>
188 188 <if test="routeName != null">#{routeName},</if>
189 189 <if test="earthName != null">#{earthName},</if>
190   - <if test="routeInfo != null">#{routeInfo},</if>
  190 +<!-- <if test="routeInfo != null">#{routeInfo},</if>
191 191 <if test="earthList != null">#{earthList},</if>
192   - <if test="coord != null">#{coord},</if>
  192 + <if test="coord != null">#{coord},</if> -->
193 193 </trim>
194 194 </insert>
195 195  
... ... @@ -216,9 +216,9 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
216 216 <if test="transportEndTime != null">transport_end_time = #{transportEndTime},</if>
217 217 <if test="routeName != null">route_name = #{routeName},</if>
218 218 <if test="earthName != null">earth_name = #{earthName},</if>
219   - <if test="routeInfo != null">route_info = #{routeInfo},</if>
  219 +<!-- <if test="routeInfo != null">route_info = #{routeInfo},</if>
220 220 <if test="earthList != null">earth_list = #{earthList},</if>
221   - <if test="coord != null">coord = #{coord},</if>
  221 + <if test="coord != null">coord = #{coord},</if> -->
222 222 </trim>
223 223 where id = #{id}
224 224 </update>
... ...