Commit 53c536e2e92e65750834075c1b734e30072a9e42
1 parent
66818066
m
Showing
20 changed files
with
1075 additions
and
1066 deletions
trash-activiti/src/main/java/com/trash/activiti/domain/dto/ActTaskDTO.java
| @@ -152,8 +152,7 @@ public class ActTaskDTO | @@ -152,8 +152,7 @@ public class ActTaskDTO | ||
| 152 | String route = null; | 152 | String route = null; |
| 153 | String index = null; | 153 | String index = null; |
| 154 | 154 | ||
| 155 | - String key = this.businessKey.split(":")[0]; | ||
| 156 | - | 155 | + String key = et.getProcessDefinitionId(); |
| 157 | 156 | ||
| 158 | if(params.get("route")!=null){ | 157 | if(params.get("route")!=null){ |
| 159 | route = params.get("route").toString(); | 158 | route = params.get("route").toString(); |
| @@ -237,8 +236,7 @@ public class ActTaskDTO | @@ -237,8 +236,7 @@ public class ActTaskDTO | ||
| 237 | String route = null; | 236 | String route = null; |
| 238 | String index = null; | 237 | String index = null; |
| 239 | 238 | ||
| 240 | - String key = this.businessKey.split(":")[0]; | ||
| 241 | - | 239 | + String key = task.getProcessDefinitionId(); |
| 242 | 240 | ||
| 243 | if(params.get("route")!=null){ | 241 | if(params.get("route")!=null){ |
| 244 | route = params.get("route").toString(); | 242 | route = params.get("route").toString(); |
trash-activiti/src/main/java/com/trash/activiti/service/impl/ActTaskServiceImpl.java
| @@ -70,7 +70,7 @@ public class ActTaskServiceImpl implements IActTaskService { | @@ -70,7 +70,7 @@ public class ActTaskServiceImpl implements IActTaskService { | ||
| 70 | 70 | ||
| 71 | @Autowired | 71 | @Autowired |
| 72 | private IActWorkflowFormDataService actWorkflowFormDataService; | 72 | private IActWorkflowFormDataService actWorkflowFormDataService; |
| 73 | - | 73 | + |
| 74 | @Autowired | 74 | @Autowired |
| 75 | private ActWorkflowFormDataMapper actWorkflowFormDataMapper; | 75 | private ActWorkflowFormDataMapper actWorkflowFormDataMapper; |
| 76 | 76 | ||
| @@ -84,7 +84,7 @@ public class ActTaskServiceImpl implements IActTaskService { | @@ -84,7 +84,7 @@ public class ActTaskServiceImpl implements IActTaskService { | ||
| 84 | UserGroupManager userGroupManager; | 84 | UserGroupManager userGroupManager; |
| 85 | 85 | ||
| 86 | HistoricProcessInstanceQuery processInstanceQuery; | 86 | HistoricProcessInstanceQuery processInstanceQuery; |
| 87 | - | 87 | + |
| 88 | @Autowired | 88 | @Autowired |
| 89 | private RedisCache redisCache; | 89 | private RedisCache redisCache; |
| 90 | 90 | ||
| @@ -92,174 +92,164 @@ public class ActTaskServiceImpl implements IActTaskService { | @@ -92,174 +92,164 @@ public class ActTaskServiceImpl implements IActTaskService { | ||
| 92 | public Page<ActTaskDTO> selectProcessDefinitionList(PageDomain pageDomain) { | 92 | public Page<ActTaskDTO> selectProcessDefinitionList(PageDomain pageDomain) { |
| 93 | Page<ActTaskDTO> list = new Page<ActTaskDTO>(); | 93 | Page<ActTaskDTO> list = new Page<ActTaskDTO>(); |
| 94 | List<ActTaskDTO> actTaskDTOS = new ArrayList<>(); | 94 | List<ActTaskDTO> actTaskDTOS = new ArrayList<>(); |
| 95 | - | ||
| 96 | - if (ServletUtils.getParameter("role") != null) { | ||
| 97 | - List<String> posts = new ArrayList<>(); | ||
| 98 | - posts.add(ServletUtils.getParameter("role")); | ||
| 99 | - SecurityUtils.getLoginUser().getUser().setPostIds(posts); | ||
| 100 | - } | ||
| 101 | - if (ServletUtils.getParameter("dept") != null) { | ||
| 102 | - List<String> roles = new ArrayList<>(); | ||
| 103 | - roles.add(ServletUtils.getParameter("dept")); | ||
| 104 | - SecurityUtils.getLoginUser().getUser().setRoleIds(roles); | ||
| 105 | - } | ||
| 106 | - if (SecurityUtils.getLoginUser().getUser().getPostIds().size() == 0 || SecurityUtils.getLoginUser().getUser().getRoleIds().size() == 0) { | ||
| 107 | - return list; | ||
| 108 | - } | ||
| 109 | - | 95 | + |
| 96 | + if (ServletUtils.getParameter("role") != null) { | ||
| 97 | + List<String> posts = new ArrayList<>(); | ||
| 98 | + posts.add(ServletUtils.getParameter("role")); | ||
| 99 | + SecurityUtils.getLoginUser().getUser().setPostIds(posts); | ||
| 100 | + } | ||
| 101 | + if (ServletUtils.getParameter("dept") != null) { | ||
| 102 | + List<String> roles = new ArrayList<>(); | ||
| 103 | + roles.add(ServletUtils.getParameter("dept")); | ||
| 104 | + SecurityUtils.getLoginUser().getUser().setRoleIds(roles); | ||
| 105 | + } | ||
| 106 | + if (SecurityUtils.getLoginUser().getUser().getPostIds().size() == 0 | ||
| 107 | + || SecurityUtils.getLoginUser().getUser().getRoleIds().size() == 0) { | ||
| 108 | + return list; | ||
| 109 | + } | ||
| 110 | + | ||
| 110 | String type = ServletUtils.getParameter("type"); | 111 | String type = ServletUtils.getParameter("type"); |
| 111 | String prev = ServletUtils.getParameter("prev"); | 112 | String prev = ServletUtils.getParameter("prev"); |
| 112 | String name = ServletUtils.getParameter("name"); | 113 | String name = ServletUtils.getParameter("name"); |
| 113 | - if(type != null && type.isEmpty()){ | 114 | + if (type != null && type.isEmpty()) { |
| 114 | type = null; | 115 | type = null; |
| 115 | } | 116 | } |
| 116 | - if(prev != null && prev.isEmpty()){ | 117 | + if (prev != null && prev.isEmpty()) { |
| 117 | prev = null; | 118 | prev = null; |
| 118 | } | 119 | } |
| 119 | - | ||
| 120 | - | 120 | + |
| 121 | String[] strings; | 121 | String[] strings; |
| 122 | Set<String> keys = new HashSet<String>(); | 122 | Set<String> keys = new HashSet<String>(); |
| 123 | - | ||
| 124 | - if(type != null && !type.isEmpty()){ | 123 | + |
| 124 | + if (type != null && !type.isEmpty()) { | ||
| 125 | strings = type.split(","); | 125 | strings = type.split(","); |
| 126 | keys = new HashSet<String>(); | 126 | keys = new HashSet<String>(); |
| 127 | - | ||
| 128 | - for(String str:strings ){ | 127 | + |
| 128 | + for (String str : strings) { | ||
| 129 | keys.add(str); | 129 | keys.add(str); |
| 130 | } | 130 | } |
| 131 | } | 131 | } |
| 132 | org.activiti.api.runtime.shared.query.Page<Task> pageTasks; | 132 | org.activiti.api.runtime.shared.query.Page<Task> pageTasks; |
| 133 | - | 133 | + |
| 134 | int pageNum = pageDomain.getPageNum(); | 134 | int pageNum = pageDomain.getPageNum(); |
| 135 | int pageSize = pageDomain.getPageSize(); | 135 | int pageSize = pageDomain.getPageSize(); |
| 136 | - if(prev == null){ | ||
| 137 | - pageTasks = taskRuntime.tasks(Pageable.of((pageNum-1) * pageSize,pageSize),null,keys,name); | ||
| 138 | - }else{ | ||
| 139 | - pageTasks = taskRuntime.tasks(Pageable.of(0,999999),null,keys,name); | 136 | + if (prev == null) { |
| 137 | + pageTasks = taskRuntime.tasks(Pageable.of((pageNum - 1) * pageSize, pageSize), null, keys, name); | ||
| 138 | + } else { | ||
| 139 | + pageTasks = taskRuntime.tasks(Pageable.of(0, 999999), null, keys, name); | ||
| 140 | } | 140 | } |
| 141 | - | ||
| 142 | - List<Task> tasks = pageTasks.getContent(); | ||
| 143 | - int totalItems = pageTasks.getTotalItems(); | ||
| 144 | - | ||
| 145 | - list.setTotal(totalItems); | ||
| 146 | - | ||
| 147 | - if (totalItems != 0) { | ||
| 148 | - | ||
| 149 | - | ||
| 150 | - Set<String> processInstanceIdIds = tasks.parallelStream().map(t -> t.getProcessInstanceId()).collect(Collectors.toSet()); | ||
| 151 | - | ||
| 152 | - if(processInstanceIdIds.size() > 0){ | ||
| 153 | - | ||
| 154 | - | ||
| 155 | - | ||
| 156 | - List<Map<String, Object>> maps = actMapper.selectWorkByIds(processInstanceIdIds); | ||
| 157 | - | ||
| 158 | - | ||
| 159 | - for(Task task:tasks){ | ||
| 160 | - try { | ||
| 161 | - ActTaskDTO dto = new ActTaskDTO(task,maps.parallelStream().filter(t -> t.get("instance_id").equals(task.getProcessInstanceId())).findAny().get()); | ||
| 162 | - | ||
| 163 | - if(prev != null && !prev.isEmpty() && (dto.getPrev() == null || !dto.getPrev().contains(prev))){ | ||
| 164 | - continue; | ||
| 165 | - } | ||
| 166 | - | ||
| 167 | - list.add(dto); | ||
| 168 | - } catch (Exception e) { | ||
| 169 | - e.printStackTrace(); | 141 | + |
| 142 | + List<Task> tasks = pageTasks.getContent(); | ||
| 143 | + int totalItems = pageTasks.getTotalItems(); | ||
| 144 | + | ||
| 145 | + list.setTotal(totalItems); | ||
| 146 | + | ||
| 147 | + if (totalItems != 0) { | ||
| 148 | + | ||
| 149 | + Set<String> processInstanceIdIds = tasks.parallelStream().map(t -> t.getProcessInstanceId()) | ||
| 150 | + .collect(Collectors.toSet()); | ||
| 151 | + | ||
| 152 | + if (processInstanceIdIds.size() > 0) { | ||
| 153 | + | ||
| 154 | + List<Map<String, Object>> maps = actMapper.selectWorkByIds(processInstanceIdIds); | ||
| 155 | + | ||
| 156 | + for (Task task : tasks) { | ||
| 157 | + try { | ||
| 158 | + ActTaskDTO dto = new ActTaskDTO(task, maps.parallelStream() | ||
| 159 | + .filter(t -> t.get("instance_id").equals(task.getProcessInstanceId())).findAny().get()); | ||
| 160 | + | ||
| 161 | + if (prev != null && !prev.isEmpty() | ||
| 162 | + && (dto.getPrev() == null || !dto.getPrev().contains(prev))) { | ||
| 163 | + continue; | ||
| 170 | } | 164 | } |
| 165 | + | ||
| 166 | + list.add(dto); | ||
| 167 | + } catch (Exception e) { | ||
| 168 | + e.printStackTrace(); | ||
| 171 | } | 169 | } |
| 172 | } | 170 | } |
| 173 | } | 171 | } |
| 172 | + } | ||
| 173 | + | ||
| 174 | + if (prev != null) { | ||
| 175 | + list.setTotal(list.size()); | ||
| 176 | + } | ||
| 174 | 177 | ||
| 175 | - if(prev != null){ | ||
| 176 | - list.setTotal(list.size()); | ||
| 177 | - } | ||
| 178 | - | ||
| 179 | - | ||
| 180 | return list; | 178 | return list; |
| 181 | } | 179 | } |
| 182 | 180 | ||
| 183 | @Override | 181 | @Override |
| 184 | public Page<ActTaskDTO> selectTaskEndHistoryDefinitionList(PageDomain pageDomain) { | 182 | public Page<ActTaskDTO> selectTaskEndHistoryDefinitionList(PageDomain pageDomain) { |
| 185 | - | 183 | + |
| 186 | int pageNum = pageDomain.getPageNum(); | 184 | int pageNum = pageDomain.getPageNum(); |
| 187 | int pageSize = pageDomain.getPageSize(); | 185 | int pageSize = pageDomain.getPageSize(); |
| 188 | - | 186 | + |
| 189 | Page<ActTaskDTO> list = new Page<ActTaskDTO>(); | 187 | Page<ActTaskDTO> list = new Page<ActTaskDTO>(); |
| 190 | 188 | ||
| 191 | ProcessEngine pes = ProcessEngines.getDefaultProcessEngine(); | 189 | ProcessEngine pes = ProcessEngines.getDefaultProcessEngine(); |
| 192 | HistoryService historyService = pes.getHistoryService(); | 190 | HistoryService historyService = pes.getHistoryService(); |
| 193 | 191 | ||
| 194 | String username = securityManager.getAuthenticatedUserId(); | 192 | String username = securityManager.getAuthenticatedUserId(); |
| 195 | - | 193 | + |
| 196 | Map map = new HashedMap<>(); | 194 | Map map = new HashedMap<>(); |
| 197 | 195 | ||
| 198 | String type = ServletUtils.getParameter("type"); | 196 | String type = ServletUtils.getParameter("type"); |
| 199 | String name = ServletUtils.getParameter("name"); | 197 | String name = ServletUtils.getParameter("name"); |
| 200 | - if(type != null && type.isEmpty()){ | 198 | + if (type != null && type.isEmpty()) { |
| 201 | type = null; | 199 | type = null; |
| 202 | } | 200 | } |
| 203 | - if(name != null && name.isEmpty()){ | 201 | + if (name != null && name.isEmpty()) { |
| 204 | name = null; | 202 | name = null; |
| 205 | } | 203 | } |
| 206 | map.put("username", username); | 204 | map.put("username", username); |
| 207 | - if(name != null) | 205 | + if (name != null) |
| 208 | map.put("name", name); | 206 | map.put("name", name); |
| 209 | - | ||
| 210 | - | ||
| 211 | - List<HistoricProcessInstance> processInstanceList; | ||
| 212 | - | ||
| 213 | - | ||
| 214 | - HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery().involvedUser(username).finished().orderByProcessInstanceStartTime().desc(); | ||
| 215 | - | ||
| 216 | - if(name != null) | ||
| 217 | - query.processInstanceNameLike("%"+name+"%"); | ||
| 218 | - | ||
| 219 | - if(type != null && !type.isEmpty()){ | ||
| 220 | - List<String> types = new ArrayList<String>(); | ||
| 221 | - for(String string :type.split(",")){ | ||
| 222 | - types.add(string); | ||
| 223 | - } | ||
| 224 | - query.processDefinitionKeyIn(types); | ||
| 225 | - } | ||
| 226 | - | ||
| 227 | - | ||
| 228 | - list.setTotal(query.count()); | ||
| 229 | - | ||
| 230 | - processInstanceList = query.listPage((pageNum-1) * pageSize,pageSize); | ||
| 231 | - | ||
| 232 | - | ||
| 233 | - | ||
| 234 | -// List<ActWorkflowFormData> dataList = actWorkflowFormDataMapper.selectActWorkFlowFormDataListByUser(username); | ||
| 235 | 207 | ||
| 236 | - if (processInstanceList.size() > 0) { | 208 | + List<HistoricProcessInstance> processInstanceList; |
| 237 | 209 | ||
| 238 | - Set<String> idString = new HashSet<String>(); | ||
| 239 | - for (HistoricProcessInstance pi : processInstanceList) { | ||
| 240 | - idString.add(pi.getId()); | ||
| 241 | - } | 210 | + HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery().involvedUser(username) |
| 211 | + .finished().orderByProcessInstanceStartTime().desc(); | ||
| 242 | 212 | ||
| 243 | - List<Map<String, Object>> maps = actMapper.selectHistoryWorkByPIds(idString); | ||
| 244 | - | ||
| 245 | - for (HistoricProcessInstance p : processInstanceList) { | ||
| 246 | - try { | ||
| 247 | - ActTaskDTO dto = new ActTaskDTO(p, | ||
| 248 | - maps.parallelStream().filter(pi -> p.getId().equals(pi.get("instance_id"))).findAny().get()); | ||
| 249 | - | ||
| 250 | - | ||
| 251 | - | ||
| 252 | - list.add(dto);} | ||
| 253 | - catch (Exception e) { | ||
| 254 | - System.out.println(p.getBusinessKey()); | ||
| 255 | - e.printStackTrace(); | ||
| 256 | - } | ||
| 257 | - } | 213 | + if (name != null) |
| 214 | + query.processInstanceNameLike("%" + name + "%"); | ||
| 258 | 215 | ||
| 259 | - | 216 | + if (type != null && !type.isEmpty()) { |
| 217 | + List<String> types = new ArrayList<String>(); | ||
| 218 | + for (String string : type.split(",")) { | ||
| 219 | + types.add(string); | ||
| 220 | + } | ||
| 221 | + query.processDefinitionKeyIn(types); | ||
| 260 | } | 222 | } |
| 261 | 223 | ||
| 224 | + list.setTotal(query.count()); | ||
| 225 | + | ||
| 226 | + processInstanceList = query.listPage((pageNum - 1) * pageSize, pageSize); | ||
| 227 | + | ||
| 228 | + // List<ActWorkflowFormData> dataList = | ||
| 229 | + // actWorkflowFormDataMapper.selectActWorkFlowFormDataListByUser(username); | ||
| 230 | + | ||
| 231 | + if (processInstanceList.size() > 0) { | ||
| 232 | + | ||
| 233 | + Set<String> idString = new HashSet<String>(); | ||
| 234 | + for (HistoricProcessInstance pi : processInstanceList) { | ||
| 235 | + idString.add(pi.getId()); | ||
| 236 | + } | ||
| 262 | 237 | ||
| 238 | + List<Map<String, Object>> maps = actMapper.selectHistoryWorkByPIds(idString); | ||
| 239 | + | ||
| 240 | + for (HistoricProcessInstance p : processInstanceList) { | ||
| 241 | + try { | ||
| 242 | + ActTaskDTO dto = new ActTaskDTO(p, maps.parallelStream() | ||
| 243 | + .filter(pi -> p.getId().equals(pi.get("instance_id"))).findAny().get()); | ||
| 244 | + | ||
| 245 | + list.add(dto); | ||
| 246 | + } catch (Exception e) { | ||
| 247 | + System.out.println(p.getBusinessKey()); | ||
| 248 | + e.printStackTrace(); | ||
| 249 | + } | ||
| 250 | + } | ||
| 251 | + | ||
| 252 | + } | ||
| 263 | 253 | ||
| 264 | return list; | 254 | return list; |
| 265 | } | 255 | } |
| @@ -271,49 +261,43 @@ public class ActTaskServiceImpl implements IActTaskService { | @@ -271,49 +261,43 @@ public class ActTaskServiceImpl implements IActTaskService { | ||
| 271 | int pageNum = pageDomain.getPageNum(); | 261 | int pageNum = pageDomain.getPageNum(); |
| 272 | int pageSize = pageDomain.getPageSize(); | 262 | int pageSize = pageDomain.getPageSize(); |
| 273 | String username = securityManager.getAuthenticatedUserId(); | 263 | String username = securityManager.getAuthenticatedUserId(); |
| 274 | - | 264 | + |
| 275 | Map map = new HashedMap<>(); | 265 | Map map = new HashedMap<>(); |
| 276 | 266 | ||
| 277 | String type = ServletUtils.getParameter("type"); | 267 | String type = ServletUtils.getParameter("type"); |
| 278 | String name = ServletUtils.getParameter("name"); | 268 | String name = ServletUtils.getParameter("name"); |
| 279 | map.put("username", username); | 269 | map.put("username", username); |
| 280 | - if(type != null && type.isEmpty()){ | 270 | + if (type != null && type.isEmpty()) { |
| 281 | type = null; | 271 | type = null; |
| 282 | } | 272 | } |
| 283 | - if(name != null && name.isEmpty()){ | 273 | + if (name != null && name.isEmpty()) { |
| 284 | name = null; | 274 | name = null; |
| 285 | } | 275 | } |
| 286 | - | ||
| 287 | 276 | ||
| 288 | ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery().involvedUser(username); | 277 | ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery().involvedUser(username); |
| 289 | - | ||
| 290 | - | ||
| 291 | - | ||
| 292 | - if(name != null) | ||
| 293 | - query.processInstanceNameLike("%"+name+"%"); | ||
| 294 | - | ||
| 295 | - if(type != null && !type.isEmpty()){ | 278 | + |
| 279 | + if (name != null) | ||
| 280 | + query.processInstanceNameLike("%" + name + "%"); | ||
| 281 | + | ||
| 282 | + if (type != null && !type.isEmpty()) { | ||
| 296 | Set<String> types = new HashSet<String>(); | 283 | Set<String> types = new HashSet<String>(); |
| 297 | - for(String string :type.split(",")){ | ||
| 298 | - types.add(string); | ||
| 299 | - } | 284 | + for (String string : type.split(",")) { |
| 285 | + types.add(string); | ||
| 286 | + } | ||
| 300 | query.processDefinitionKeys(types); | 287 | query.processDefinitionKeys(types); |
| 301 | } | 288 | } |
| 302 | - | 289 | + |
| 303 | List<ProcessInstance> processInstanceList = query.list(); | 290 | List<ProcessInstance> processInstanceList = query.list(); |
| 304 | - | ||
| 305 | 291 | ||
| 306 | - | ||
| 307 | list.setTotal(query.count()); | 292 | list.setTotal(query.count()); |
| 308 | - | ||
| 309 | - processInstanceList = query.listPage((pageNum-1) * pageSize,pageSize); | ||
| 310 | - | 293 | + |
| 294 | + processInstanceList = query.listPage((pageNum - 1) * pageSize, pageSize); | ||
| 295 | + | ||
| 311 | if (processInstanceList.size() > 0) { | 296 | if (processInstanceList.size() > 0) { |
| 312 | - | ||
| 313 | - List<String> pids = processInstanceList.parallelStream().map(p->p.getId()).collect(Collectors.toList()); | ||
| 314 | - | 297 | + |
| 298 | + List<String> pids = processInstanceList.parallelStream().map(p -> p.getId()).collect(Collectors.toList()); | ||
| 299 | + | ||
| 315 | List<org.activiti.engine.task.Task> tasks = taskService.createTaskQuery().processInstanceIdIn(pids).list(); | 300 | List<org.activiti.engine.task.Task> tasks = taskService.createTaskQuery().processInstanceIdIn(pids).list(); |
| 316 | - | ||
| 317 | 301 | ||
| 318 | Set<String> idString = new HashSet<String>(); | 302 | Set<String> idString = new HashSet<String>(); |
| 319 | for (ProcessInstance pi : processInstanceList) { | 303 | for (ProcessInstance pi : processInstanceList) { |
| @@ -322,15 +306,18 @@ public class ActTaskServiceImpl implements IActTaskService { | @@ -322,15 +306,18 @@ public class ActTaskServiceImpl implements IActTaskService { | ||
| 322 | 306 | ||
| 323 | List<Map<String, Object>> maps = actMapper.selectWorkByIds(idString); | 307 | List<Map<String, Object>> maps = actMapper.selectWorkByIds(idString); |
| 324 | 308 | ||
| 325 | - List<ActWorkflowFormData> dataList = actWorkflowFormDataMapper.selectActWorkFlowFormDataListByUser(username); | 309 | + List<ActWorkflowFormData> dataList = actWorkflowFormDataMapper |
| 310 | + .selectActWorkFlowFormDataListByUser(username); | ||
| 326 | if (processInstanceList.size() > 0) { | 311 | if (processInstanceList.size() > 0) { |
| 327 | for (ProcessInstance p : processInstanceList) { | 312 | for (ProcessInstance p : processInstanceList) { |
| 328 | try { | 313 | try { |
| 329 | - ActTaskDTO dto = new ActTaskDTO(p, maps.parallelStream().filter(pi -> p.getProcessInstanceId().equals(pi.get("instance_id"))).findAny().get(), | ||
| 330 | - dataList.parallelStream().filter(pi -> p.getBusinessKey().equals(pi.getBusinessKey())).findAny().get(), | ||
| 331 | - tasks.parallelStream().filter(t -> p.getId().equals(t.getProcessInstanceId())).findAny().get()); | ||
| 332 | - | ||
| 333 | - | 314 | + ActTaskDTO dto = new ActTaskDTO(p, maps.parallelStream() |
| 315 | + .filter(pi -> p.getProcessInstanceId().equals(pi.get("instance_id"))).findAny().get(), | ||
| 316 | + dataList.parallelStream().filter(pi -> p.getBusinessKey().equals(pi.getBusinessKey())) | ||
| 317 | + .findAny().get(), | ||
| 318 | + tasks.parallelStream().filter(t -> p.getId().equals(t.getProcessInstanceId())).findAny() | ||
| 319 | + .get()); | ||
| 320 | + | ||
| 334 | list.add(dto); | 321 | list.add(dto); |
| 335 | } catch (Exception e) { | 322 | } catch (Exception e) { |
| 336 | e.printStackTrace(); | 323 | e.printStackTrace(); |
| @@ -339,7 +326,7 @@ public class ActTaskServiceImpl implements IActTaskService { | @@ -339,7 +326,7 @@ public class ActTaskServiceImpl implements IActTaskService { | ||
| 339 | 326 | ||
| 340 | } | 327 | } |
| 341 | } | 328 | } |
| 342 | - | 329 | + |
| 343 | list.sort(new Comparator<ActTaskDTO>() { | 330 | list.sort(new Comparator<ActTaskDTO>() { |
| 344 | 331 | ||
| 345 | @Override | 332 | @Override |
| @@ -348,7 +335,7 @@ public class ActTaskServiceImpl implements IActTaskService { | @@ -348,7 +335,7 @@ public class ActTaskServiceImpl implements IActTaskService { | ||
| 348 | return (int) (o2.getCreatedDate().getTime() - o1.getCreatedDate().getTime()); | 335 | return (int) (o2.getCreatedDate().getTime() - o1.getCreatedDate().getTime()); |
| 349 | } | 336 | } |
| 350 | }); | 337 | }); |
| 351 | - | 338 | + |
| 352 | return list; | 339 | return list; |
| 353 | } | 340 | } |
| 354 | 341 | ||
| @@ -357,12 +344,12 @@ public class ActTaskServiceImpl implements IActTaskService { | @@ -357,12 +344,12 @@ public class ActTaskServiceImpl implements IActTaskService { | ||
| 357 | ActWorkflowFormData.setBusinessKey(actTaskDTOS.getBusinessKey()); | 344 | ActWorkflowFormData.setBusinessKey(actTaskDTOS.getBusinessKey()); |
| 358 | ActWorkflowFormData.setCreateBy(securityManager.getAuthenticatedUserId()); | 345 | ActWorkflowFormData.setCreateBy(securityManager.getAuthenticatedUserId()); |
| 359 | ActWorkflowFormData.setControlName("ๅฎกๆน"); | 346 | ActWorkflowFormData.setControlName("ๅฎกๆน"); |
| 360 | - | 347 | + |
| 361 | ActWorkflowFormData = actWorkflowFormDataService.selectActWorkflowFormDataList(ActWorkflowFormData).get(0); | 348 | ActWorkflowFormData = actWorkflowFormDataService.selectActWorkflowFormDataList(ActWorkflowFormData).get(0); |
| 362 | 349 | ||
| 363 | actTaskDTOS.setCheckStatus(ActWorkflowFormData.getControlValue().equals("้่ฟ") ? "0" : "1"); | 350 | actTaskDTOS.setCheckStatus(ActWorkflowFormData.getControlValue().equals("้่ฟ") ? "0" : "1"); |
| 364 | actTaskDTOS.setCreatedDate(ActWorkflowFormData.getCreateTime()); | 351 | actTaskDTOS.setCreatedDate(ActWorkflowFormData.getCreateTime()); |
| 365 | - | 352 | + |
| 366 | } | 353 | } |
| 367 | 354 | ||
| 368 | SimpleDateFormat sdFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:SS"); | 355 | SimpleDateFormat sdFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:SS"); |
| @@ -448,59 +435,60 @@ public class ActTaskServiceImpl implements IActTaskService { | @@ -448,59 +435,60 @@ public class ActTaskServiceImpl implements IActTaskService { | ||
| 448 | 435 | ||
| 449 | private void updateThreesetpTask(ProcessInstance processInstance, String placeCode) { | 436 | private void updateThreesetpTask(ProcessInstance processInstance, String placeCode) { |
| 450 | 437 | ||
| 451 | - org.activiti.engine.task.Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()) | 438 | + final org.activiti.engine.task.Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()) |
| 452 | .singleResult(); | 439 | .singleResult(); |
| 453 | - | 440 | + |
| 454 | if (task == null) | 441 | if (task == null) |
| 455 | return; | 442 | return; |
| 456 | - | ||
| 457 | - if(task != null){ | ||
| 458 | - | ||
| 459 | - try{ | ||
| 460 | - | ||
| 461 | - | ||
| 462 | - List<Mobile> mobileList=new ArrayList<Mobile>(); | ||
| 463 | - | ||
| 464 | - | ||
| 465 | - String number = actMapper.getPhoneNumber(processInstance.getProcessDefinitionKey(),task.getName()); | ||
| 466 | - | ||
| 467 | - | ||
| 468 | - if(number != null){ | ||
| 469 | - String smsString = "ๅทฅไฝๆ้๏ผๆจๆๆฐ็ๅทฅไฝๆต็จ๏ผ่ฏทๅๆถๅค็ใ"; | ||
| 470 | - Mobile mobile=new Mobile(); | ||
| 471 | - mobile.setMobile(number); | ||
| 472 | - mobileList.add(mobile); | ||
| 473 | - | ||
| 474 | - if(processInstance.getProcessDefinitionKey().equals("workflow_constructsite")){ | ||
| 475 | - | ||
| 476 | - JSONObject json = RemoteServerUtils.getConstructionInfo(processInstance.getBusinessKey().split(":")[1]); | ||
| 477 | - if(json != null) | ||
| 478 | - smsString = "ๅฎกๆนๆ้๏ผๆจๆๆฐ็ๅทฅไฝๆต็จ้่ฆๅฎกๆน "+json.getString("areaCodeName")+" "+json.getString("name"); | ||
| 479 | - | ||
| 480 | - } | ||
| 481 | - | ||
| 482 | - if(processInstance.getProcessDefinitionKey().equals("workflow_caseoffline")){ | ||
| 483 | - | ||
| 484 | - String dname = actMapper.getCaseTypeName("case_offline_type",processInstance.getBusinessKey().split(":")[1]); | ||
| 485 | - smsString = "ๆกๅทๆ้๏ผๆไธๆก"+ dname +"็ๆกๅท๏ผ่ฏทๅๆถๅค็ใ"; | ||
| 486 | - } | ||
| 487 | - | ||
| 488 | - JsonSmsSend jsonSmsSend= PostSms.sendSms(mobileList,smsString); | ||
| 489 | - if(jsonSmsSend!=null){ | ||
| 490 | - if(jsonSmsSend.getState()==0){ | ||
| 491 | - System.out.println("ๅ้ๆๅ"); | ||
| 492 | - }else{ | ||
| 493 | - System.out.println(jsonSmsSend.getMessage()); | ||
| 494 | - } | ||
| 495 | - }else{ | ||
| 496 | - System.out.println("ๅ้่ฟๅ็ฉบ"); | ||
| 497 | - } | ||
| 498 | - } | ||
| 499 | - }catch(Exception e){ | ||
| 500 | - e.printStackTrace(); | ||
| 501 | - } | ||
| 502 | - | ||
| 503 | - } | 443 | + |
| 444 | + if (task != null) { | ||
| 445 | + new Thread(new Runnable() { | ||
| 446 | + | ||
| 447 | + @Override | ||
| 448 | + public void run() { | ||
| 449 | + | ||
| 450 | + List<Mobile> mobileList = new ArrayList<Mobile>(); | ||
| 451 | + | ||
| 452 | + String number = actMapper.getPhoneNumber(processInstance.getProcessDefinitionKey(), task.getName()); | ||
| 453 | + | ||
| 454 | + if (number != null) { | ||
| 455 | + String smsString = "ๅทฅไฝๆ้๏ผๆจๆๆฐ็ๅทฅไฝๆต็จ๏ผ่ฏทๅๆถๅค็ใ"; | ||
| 456 | + Mobile mobile = new Mobile(); | ||
| 457 | + mobile.setMobile(number); | ||
| 458 | + mobileList.add(mobile); | ||
| 459 | + | ||
| 460 | + if (processInstance.getProcessDefinitionKey().equals("workflow_constructsite")) { | ||
| 461 | + | ||
| 462 | + JSONObject json = RemoteServerUtils.getConstructionInfo(processInstance.getBusinessKey().split(":")[1]); | ||
| 463 | + if (json != null) | ||
| 464 | + smsString = "ๅฎกๆนๆ้๏ผๆจๆๆฐ็ๅทฅไฝๆต็จ้่ฆๅฎกๆน " + json.getString("areaCodeName") + " " | ||
| 465 | + + json.getString("name"); | ||
| 466 | + | ||
| 467 | + } | ||
| 468 | + | ||
| 469 | + if (processInstance.getProcessDefinitionKey().equals("workflow_caseoffline")) { | ||
| 470 | + | ||
| 471 | + String dname = actMapper.getCaseTypeName("case_offline_type", | ||
| 472 | + processInstance.getBusinessKey().split(":")[1]); | ||
| 473 | + smsString = "ๆกๅทๆ้๏ผๆไธๆก" + dname + "็ๆกๅท๏ผ่ฏทๅๆถๅค็ใ"; | ||
| 474 | + } | ||
| 475 | + | ||
| 476 | + JsonSmsSend jsonSmsSend = PostSms.sendSms(mobileList, smsString); | ||
| 477 | + if (jsonSmsSend != null) { | ||
| 478 | + if (jsonSmsSend.getState() == 0) { | ||
| 479 | + System.out.println("ๅ้ๆๅ"); | ||
| 480 | + } else { | ||
| 481 | + System.out.println(jsonSmsSend.getMessage()); | ||
| 482 | + } | ||
| 483 | + } else { | ||
| 484 | + System.out.println("ๅ้่ฟๅ็ฉบ"); | ||
| 485 | + } | ||
| 486 | + } | ||
| 487 | + | ||
| 488 | + } | ||
| 489 | + | ||
| 490 | + }).start(); | ||
| 491 | + } | ||
| 504 | 492 | ||
| 505 | task.setDescription(placeCode); | 493 | task.setDescription(placeCode); |
| 506 | 494 | ||
| @@ -510,10 +498,14 @@ public class ActTaskServiceImpl implements IActTaskService { | @@ -510,10 +498,14 @@ public class ActTaskServiceImpl implements IActTaskService { | ||
| 510 | taskService.addCandidateUser(task.getId(), placeCode); | 498 | taskService.addCandidateUser(task.getId(), placeCode); |
| 511 | } | 499 | } |
| 512 | 500 | ||
| 513 | - task.setDescription(placeCode); | ||
| 514 | - | ||
| 515 | taskService.saveTask(task); | 501 | taskService.saveTask(task); |
| 516 | 502 | ||
| 503 | + if ("่ฝฆ่พๆๅฑไผไธ".equals(task.getName())) { | ||
| 504 | + org.activiti.engine.task.Task task1 = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); | ||
| 505 | + taskService.setAssignee(task1.getId(), placeCode); | ||
| 506 | + return; | ||
| 507 | + } | ||
| 508 | + | ||
| 517 | } | 509 | } |
| 518 | 510 | ||
| 519 | @Override | 511 | @Override |
trash-activiti/src/main/java/com/trash/activiti/service/impl/FormHistoryDataServiceImpl.java
| @@ -51,115 +51,42 @@ public class FormHistoryDataServiceImpl implements IFormHistoryDataService { | @@ -51,115 +51,42 @@ public class FormHistoryDataServiceImpl implements IFormHistoryDataService { | ||
| 51 | List<ActWorkflowFormData> actWorkflowFormData=new ArrayList<>(); | 51 | List<ActWorkflowFormData> actWorkflowFormData=new ArrayList<>(); |
| 52 | 52 | ||
| 53 | List<Task> tasks = null; | 53 | List<Task> tasks = null; |
| 54 | - | ||
| 55 | - | ||
| 56 | - | ||
| 57 | - | ||
| 58 | 54 | ||
| 59 | - | ||
| 60 | - if(businessKey.contains("constructsite")){ | ||
| 61 | - String id = businessKey.split(":")[1]; | ||
| 62 | - | ||
| 63 | - | ||
| 64 | - tasks =taskService.createTaskQuery().processInstanceBusinessKey("workflow_constructsite:" + id).list(); | ||
| 65 | - | ||
| 66 | - if(tasks.size() > 0){ | ||
| 67 | - | ||
| 68 | - ActWorkflowFormData afw = new ActWorkflowFormData(); | ||
| 69 | - | ||
| 70 | - | ||
| 71 | - afw.setControlName("ๅฎกๆน"); | ||
| 72 | - afw.setControlValue("ๅพ ๅค็"); | ||
| 73 | - afw.setTaskNodeName(tasks.get(0).getName()); | ||
| 74 | - afw.setCreateBy(tasks.get(0).getName()); | ||
| 75 | - afw.setCreateName(tasks.get(0).getName()); | ||
| 76 | - afw.setCreateTime(new Date()); | ||
| 77 | - | ||
| 78 | - returnHistoryFromDataDTOS.add(afw); | ||
| 79 | - } | ||
| 80 | - tasks =taskService.createTaskQuery().processInstanceBusinessKey("workflow_constructsite_edit:" + id).list(); | ||
| 81 | - | ||
| 82 | - if(tasks.size() > 0){ | ||
| 83 | - | ||
| 84 | - ActWorkflowFormData afw = new ActWorkflowFormData(); | ||
| 85 | - | ||
| 86 | - | ||
| 87 | - afw.setControlName("ๅฎกๆน"); | ||
| 88 | - afw.setControlValue("ๅพ ๅค็"); | ||
| 89 | - afw.setTaskNodeName(tasks.get(0).getName()); | ||
| 90 | - afw.setCreateBy(tasks.get(0).getName()); | ||
| 91 | - afw.setCreateName(tasks.get(0).getName()); | ||
| 92 | - afw.setCreateTime(new Date()); | ||
| 93 | - | ||
| 94 | - returnHistoryFromDataDTOS.add(afw); | ||
| 95 | - } | ||
| 96 | - | ||
| 97 | - actWorkflowFormData.addAll( actWorkflowFormDataService.selectActWorkflowFormDataByBusinessKey( "workflow_constructsite:" + id)); | ||
| 98 | - | ||
| 99 | - actWorkflowFormData.addAll( actWorkflowFormDataService.selectActWorkflowFormDataByBusinessKey("workflow_constructsite_edit:" + id)); | ||
| 100 | - }else if(businessKey.contains("earthsites")){ | ||
| 101 | - | ||
| 102 | - String id = businessKey.split(":")[1]; | ||
| 103 | 55 | ||
| 104 | - | ||
| 105 | - tasks =taskService.createTaskQuery().processInstanceBusinessKey("workflow_earthsites:" + id).list(); | ||
| 106 | - | ||
| 107 | - if(tasks.size() > 0){ | ||
| 108 | - | ||
| 109 | - ActWorkflowFormData afw = new ActWorkflowFormData(); | ||
| 110 | - | ||
| 111 | - | ||
| 112 | - afw.setControlName("ๅฎกๆน"); | ||
| 113 | - afw.setControlValue("ๅพ ๅค็"); | ||
| 114 | - afw.setTaskNodeName(tasks.get(0).getName()); | ||
| 115 | - afw.setCreateBy(tasks.get(0).getName()); | ||
| 116 | - afw.setCreateName(tasks.get(0).getName()); | ||
| 117 | - afw.setCreateTime(new Date()); | ||
| 118 | - | ||
| 119 | - returnHistoryFromDataDTOS.add(afw); | ||
| 120 | - } | ||
| 121 | - tasks =taskService.createTaskQuery().processInstanceBusinessKey("workflow_earthsites_edit:" + id).list(); | ||
| 122 | - | ||
| 123 | - if(tasks.size() > 0){ | ||
| 124 | - | ||
| 125 | - ActWorkflowFormData afw = new ActWorkflowFormData(); | ||
| 126 | - | ||
| 127 | - | ||
| 128 | - afw.setControlName("ๅฎกๆน"); | ||
| 129 | - afw.setControlValue("ๅพ ๅค็"); | ||
| 130 | - afw.setTaskNodeName(tasks.get(0).getName()); | ||
| 131 | - afw.setCreateBy(tasks.get(0).getName()); | ||
| 132 | - afw.setCreateName(tasks.get(0).getName()); | ||
| 133 | - afw.setCreateTime(new Date()); | ||
| 134 | - | ||
| 135 | - returnHistoryFromDataDTOS.add(afw); | ||
| 136 | - } | ||
| 137 | - | ||
| 138 | - actWorkflowFormData.addAll( actWorkflowFormDataService.selectActWorkflowFormDataByBusinessKey( "workflow_earthsites:" + id)); | ||
| 139 | - | ||
| 140 | - actWorkflowFormData.addAll( actWorkflowFormDataService.selectActWorkflowFormDataByBusinessKey("workflow_earthsites_edit:" + id)); | ||
| 141 | - }else{ | ||
| 142 | - | ||
| 143 | - tasks =taskService.createTaskQuery().processInstanceBusinessKey(businessKey).list(); | ||
| 144 | - | ||
| 145 | - if(tasks.size() > 0){ | ||
| 146 | - | ||
| 147 | - ActWorkflowFormData afw = new ActWorkflowFormData(); | ||
| 148 | - | ||
| 149 | - | ||
| 150 | - afw.setControlName("ๅฎกๆน"); | ||
| 151 | - afw.setControlValue("ๅพ ๅค็"); | ||
| 152 | - afw.setTaskNodeName(tasks.get(0).getName()); | ||
| 153 | - afw.setCreateBy(tasks.get(0).getName()); | ||
| 154 | - afw.setCreateName(tasks.get(0).getName()); | ||
| 155 | - afw.setCreateTime(new Date()); | ||
| 156 | - | ||
| 157 | - returnHistoryFromDataDTOS.add(afw); | ||
| 158 | - } | ||
| 159 | - | ||
| 160 | - actWorkflowFormData = actWorkflowFormDataService.selectActWorkflowFormDataByBusinessKey(businessKey); | ||
| 161 | - } | ||
| 162 | - | 56 | + getEditData(businessKey,returnHistoryFromDataDTOS,actWorkflowFormData); |
| 57 | +// | ||
| 58 | +// if(businessKey.contains("constructsite")){ | ||
| 59 | +// String id = businessKey.split(":")[1]; | ||
| 60 | +// getEditData(id,"constructsite",returnHistoryFromDataDTOS,actWorkflowFormData); | ||
| 61 | +// }else if(businessKey.contains("earthsites")){ | ||
| 62 | +// String id = businessKey.split(":")[1]; | ||
| 63 | +// getEditData(id,"earthsites",returnHistoryFromDataDTOS,actWorkflowFormData); | ||
| 64 | +// }else if(businessKey.contains("conract")){ | ||
| 65 | +// | ||
| 66 | +// String id = businessKey.split(":")[1]; | ||
| 67 | +// getEditData(id,"conract",returnHistoryFromDataDTOS,actWorkflowFormData); | ||
| 68 | +// | ||
| 69 | +// }else{ | ||
| 70 | +// | ||
| 71 | +// tasks =taskService.createTaskQuery().processInstanceBusinessKey(businessKey).list(); | ||
| 72 | +// | ||
| 73 | +// if(tasks.size() > 0){ | ||
| 74 | +// | ||
| 75 | +// ActWorkflowFormData afw = new ActWorkflowFormData(); | ||
| 76 | +// | ||
| 77 | +// | ||
| 78 | +// afw.setControlName("ๅฎกๆน"); | ||
| 79 | +// afw.setControlValue("ๅพ ๅค็"); | ||
| 80 | +// afw.setTaskNodeName(tasks.get(0).getName()); | ||
| 81 | +// afw.setCreateBy(tasks.get(0).getName()); | ||
| 82 | +// afw.setCreateName(tasks.get(0).getName()); | ||
| 83 | +// afw.setCreateTime(new Date()); | ||
| 84 | +// | ||
| 85 | +// returnHistoryFromDataDTOS.add(afw); | ||
| 86 | +// } | ||
| 87 | +// | ||
| 88 | +// actWorkflowFormData = actWorkflowFormDataService.selectActWorkflowFormDataByBusinessKey(businessKey); | ||
| 89 | +// } | ||
| 163 | 90 | ||
| 164 | 91 | ||
| 165 | for(int i =0;i<actWorkflowFormData.size();i++){ | 92 | for(int i =0;i<actWorkflowFormData.size();i++){ |
| @@ -206,7 +133,39 @@ public class FormHistoryDataServiceImpl implements IFormHistoryDataService { | @@ -206,7 +133,39 @@ public class FormHistoryDataServiceImpl implements IFormHistoryDataService { | ||
| 206 | } | 133 | } |
| 207 | 134 | ||
| 208 | 135 | ||
| 209 | - @Override | 136 | + private void getEditData(String businessKey,List<ActWorkflowFormData> returnHistoryFromDataDTOS,List<ActWorkflowFormData> actWorkflowFormData) { |
| 137 | + | ||
| 138 | + List<Task> tasks =taskService.createTaskQuery().processInstanceBusinessKey(businessKey).list(); | ||
| 139 | + if(tasks.size() > 0){ | ||
| 140 | + ActWorkflowFormData afw = new ActWorkflowFormData(); | ||
| 141 | + afw.setControlName("ๅฎกๆน"); | ||
| 142 | + afw.setControlValue("ๅพ ๅค็"); | ||
| 143 | + afw.setTaskNodeName(tasks.get(0).getName()); | ||
| 144 | + afw.setCreateBy(tasks.get(0).getName()); | ||
| 145 | + afw.setCreateName(tasks.get(0).getName()); | ||
| 146 | + afw.setCreateTime(new Date()); | ||
| 147 | + returnHistoryFromDataDTOS.add(afw); | ||
| 148 | + } | ||
| 149 | + tasks =taskService.createTaskQuery().processInstanceBusinessKey(businessKey.replace(":", "_edit:")).list(); | ||
| 150 | + if(tasks.size() > 0){ | ||
| 151 | + ActWorkflowFormData afw = new ActWorkflowFormData(); | ||
| 152 | + afw.setControlName("ๅฎกๆน"); | ||
| 153 | + afw.setControlValue("ๅพ ๅค็"); | ||
| 154 | + afw.setTaskNodeName(tasks.get(0).getName()); | ||
| 155 | + afw.setCreateBy(tasks.get(0).getName()); | ||
| 156 | + afw.setCreateName(tasks.get(0).getName()); | ||
| 157 | + afw.setCreateTime(new Date()); | ||
| 158 | + returnHistoryFromDataDTOS.add(afw); | ||
| 159 | + } | ||
| 160 | + | ||
| 161 | + actWorkflowFormData.addAll( actWorkflowFormDataService.selectActWorkflowFormDataByBusinessKey( businessKey)); | ||
| 162 | + | ||
| 163 | + actWorkflowFormData.addAll( actWorkflowFormDataService.selectActWorkflowFormDataByBusinessKey(businessKey.replace(":", "_edit:"))); | ||
| 164 | + | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + | ||
| 168 | + @Override | ||
| 210 | public List<ActWorkflowFormData> historyFromDataByTime(Map<String,String> map) { | 169 | public List<ActWorkflowFormData> historyFromDataByTime(Map<String,String> map) { |
| 211 | List<ActWorkflowFormData> returnHistoryFromDataDTOS=new ArrayList<>(); | 170 | List<ActWorkflowFormData> returnHistoryFromDataDTOS=new ArrayList<>(); |
| 212 | List<ActWorkflowFormData> actWorkflowFormData=new ArrayList<>(); | 171 | List<ActWorkflowFormData> actWorkflowFormData=new ArrayList<>(); |
trash-system/src/main/java/com/trash/system/service/impl/SysDictTypeServiceImpl.java
| @@ -76,12 +76,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService | @@ -76,12 +76,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService | ||
| 76 | @Override | 76 | @Override |
| 77 | public List<SysDictData> selectDictDataByType(String dictType) | 77 | public List<SysDictData> selectDictDataByType(String dictType) |
| 78 | { | 78 | { |
| 79 | - List<SysDictData> dictDatas = DictUtils.getDictCache(dictType); | ||
| 80 | - if (StringUtils.isNotEmpty(dictDatas)) | ||
| 81 | - { | ||
| 82 | - return dictDatas; | ||
| 83 | - } | ||
| 84 | - dictDatas = dictDataMapper.selectDictDataByType(dictType); | 79 | + List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType); |
| 85 | if (StringUtils.isNotEmpty(dictDatas)) | 80 | if (StringUtils.isNotEmpty(dictDatas)) |
| 86 | { | 81 | { |
| 87 | DictUtils.setDictCache(dictType, dictDatas); | 82 | DictUtils.setDictCache(dictType, dictDatas); |
trash-ui/dist.7z
0 โ 100644
No preview for this file type
trash-ui/dist.zip deleted
100644 โ 0
No preview for this file type
trash-ui/src/api/caseOfflineInfo.js
| @@ -187,18 +187,28 @@ export default { | @@ -187,18 +187,28 @@ export default { | ||
| 187 | }); | 187 | }); |
| 188 | 188 | ||
| 189 | 189 | ||
| 190 | - | 190 | + console.log(12312312); |
| 191 | historyFromData(this.workflow + ":" + id).then(response => { | 191 | historyFromData(this.workflow + ":" + id).then(response => { |
| 192 | - | 192 | + debugger; |
| 193 | let obj = response.data[0]; | 193 | let obj = response.data[0]; |
| 194 | let data = { | 194 | let data = { |
| 195 | reply:obj.controlValue, | 195 | reply:obj.controlValue, |
| 196 | replyPeople:obj.createBy, | 196 | replyPeople:obj.createBy, |
| 197 | replyTime:obj.createTime | 197 | replyTime:obj.createTime |
| 198 | }; | 198 | }; |
| 199 | - | ||
| 200 | this.replyApprovalProcessList.push(data); | 199 | this.replyApprovalProcessList.push(data); |
| 201 | 200 | ||
| 201 | + if(response.data[response.data.length-1].controlValue.indexOf("ๅพ ") > -1){ | ||
| 202 | + let obj = response.data[response.data.length-1]; | ||
| 203 | + let data = { | ||
| 204 | + reply:obj.controlValue, | ||
| 205 | + replyPeople:obj.createBy, | ||
| 206 | + replyTime:obj.createTime | ||
| 207 | + }; | ||
| 208 | + this.replyApprovalProcessList.push(data); | ||
| 209 | + } | ||
| 210 | + | ||
| 211 | + | ||
| 202 | listReplyApprovalProcess({tableName: "workflow_caseoffline:"+id}).then(response => { | 212 | listReplyApprovalProcess({tableName: "workflow_caseoffline:"+id}).then(response => { |
| 203 | for(let i in response.rows){ | 213 | for(let i in response.rows){ |
| 204 | 214 |
trash-ui/src/api/caseoffline.js
| @@ -171,18 +171,20 @@ export default { | @@ -171,18 +171,20 @@ export default { | ||
| 171 | }); | 171 | }); |
| 172 | }, | 172 | }, |
| 173 | getStatus(item){ | 173 | getStatus(item){ |
| 174 | - if(item.advice4){ | ||
| 175 | - return "็ปๆกๅญๆกฃ"; | 174 | + |
| 175 | + if(item.status == 2){ | ||
| 176 | + return "่ขซ้ฉณๅ"; | ||
| 176 | } | 177 | } |
| 177 | - if(!item.advice1){ | ||
| 178 | - return "ๆชๅๅค"; | 178 | + if(item.status == 1){ |
| 179 | + return "็ปๆกๅญๆกฃ"; | ||
| 179 | } | 180 | } |
| 180 | - if(!item.advice4 && !item.advice3){ | 181 | + if(item.status1 && Number(item.status1) == 1){ |
| 181 | return "ๅทฒๅๅค"; | 182 | return "ๅทฒๅๅค"; |
| 182 | } | 183 | } |
| 183 | - if(!item.advice4 && item.advice3){ | ||
| 184 | - return "ๅฎกๆ ธไธญ"; | 184 | + if(item.status1 && Number(item.status1) > 1){ |
| 185 | + return "ๅฎกๆ ธไธญ"; | ||
| 185 | } | 186 | } |
| 187 | + return "ๆชๅๅค"; | ||
| 186 | }, | 188 | }, |
| 187 | getSite(item){ | 189 | getSite(item){ |
| 188 | this.remoteQueryData.name = item; | 190 | this.remoteQueryData.name = item; |
| @@ -247,7 +249,7 @@ export default { | @@ -247,7 +249,7 @@ export default { | ||
| 247 | /** ๆฅ่ฏข็บฟไธไบคๅๆกๅทๅ่กจ */ | 249 | /** ๆฅ่ฏข็บฟไธไบคๅๆกๅทๅ่กจ */ |
| 248 | getList() { | 250 | getList() { |
| 249 | this.loading = true; | 251 | this.loading = true; |
| 250 | - | 252 | + |
| 251 | if(this.queryParams.createTime){ | 253 | if(this.queryParams.createTime){ |
| 252 | this.queryParams.startTime = this.queryParams.createTime[0]; | 254 | this.queryParams.startTime = this.queryParams.createTime[0]; |
| 253 | this.queryParams.endTime = this.queryParams.createTime[1]; | 255 | this.queryParams.endTime = this.queryParams.createTime[1]; |
| @@ -260,7 +262,7 @@ export default { | @@ -260,7 +262,7 @@ export default { | ||
| 260 | } | 262 | } |
| 261 | 263 | ||
| 262 | query.createTime = null; | 264 | query.createTime = null; |
| 263 | - | 265 | + |
| 264 | if(query.place) | 266 | if(query.place) |
| 265 | query.place = query.place + "" | 267 | query.place = query.place + "" |
| 266 | 268 | ||
| @@ -445,7 +447,7 @@ export default { | @@ -445,7 +447,7 @@ export default { | ||
| 445 | for(var i in this.queryParams){ | 447 | for(var i in this.queryParams){ |
| 446 | query[i] = this.queryParams[i]; | 448 | query[i] = this.queryParams[i]; |
| 447 | } | 449 | } |
| 448 | - | 450 | + |
| 449 | if(query.place) | 451 | if(query.place) |
| 450 | query.place = query.place + "" | 452 | query.place = query.place + "" |
| 451 | 453 |
trash-ui/src/api/taskmethod.js
| @@ -215,6 +215,7 @@ export default { | @@ -215,6 +215,7 @@ export default { | ||
| 215 | }) | 215 | }) |
| 216 | } | 216 | } |
| 217 | this.form.formData = formData; | 217 | this.form.formData = formData; |
| 218 | + console.log(this.form.formData); | ||
| 218 | 219 | ||
| 219 | if (this.definitionKey == "workflow_threestep") { | 220 | if (this.definitionKey == "workflow_threestep") { |
| 220 | 221 | ||
| @@ -326,18 +327,35 @@ export default { | @@ -326,18 +327,35 @@ export default { | ||
| 326 | this.title = "ๅฎกๆน"; | 327 | this.title = "ๅฎกๆน"; |
| 327 | }); | 328 | }); |
| 328 | }, | 329 | }, |
| 329 | - | 330 | + getNotId(obj,id){ |
| 331 | + if(!obj) | ||
| 332 | + return false; | ||
| 333 | + return obj.controlId!=id; | ||
| 334 | + }, | ||
| 335 | + getLabel(obj,i){ | ||
| 336 | + if(obj){ | ||
| 337 | + return obj.controlDefault.split("--__--")[i] | ||
| 338 | + } | ||
| 339 | + return i == 0 ? "้่ฟ" : "้ฉณๅ"; | ||
| 340 | + }, | ||
| 330 | /** ๆไบคๆ้ฎ */ | 341 | /** ๆไบคๆ้ฎ */ |
| 331 | submitForm(formid, value) { | 342 | submitForm(formid, value) { |
| 332 | - this.form.formData[0].controlValue = value; | ||
| 333 | - this.form.formData[0].controlId = formid; | ||
| 334 | - this.form.id = this.businessKey.split(":")[1]; | ||
| 335 | - if (this.form.formData[0].controlValue == 0) { | ||
| 336 | - this.form.status = 1; | ||
| 337 | - } else { | ||
| 338 | - this.form.status = 2; | 343 | + |
| 344 | + for(let i in this.form.formData){ | ||
| 345 | + if(this.form.formData[i].controlType == 'radio'){ | ||
| 346 | + this.form.formData[i].controlValue = value; | ||
| 347 | + this.form.formData[i].controlId = formid; | ||
| 348 | + this.form.id = this.businessKey.split(":")[1]; | ||
| 349 | + if (this.form.formData[i].controlValue == 0) { | ||
| 350 | + this.form.status = 1; | ||
| 351 | + } else { | ||
| 352 | + this.form.status = 2; | ||
| 353 | + } | ||
| 354 | + } | ||
| 339 | } | 355 | } |
| 340 | 356 | ||
| 357 | + | ||
| 358 | + | ||
| 341 | if (this.definitionKey == "workflow_threestep") { | 359 | if (this.definitionKey == "workflow_threestep") { |
| 342 | 360 | ||
| 343 | 361 | ||
| @@ -346,9 +364,6 @@ export default { | @@ -346,9 +364,6 @@ export default { | ||
| 346 | return; | 364 | return; |
| 347 | } | 365 | } |
| 348 | 366 | ||
| 349 | - | ||
| 350 | - | ||
| 351 | - | ||
| 352 | for (let i = 0; i < 13; i++) { | 367 | for (let i = 0; i < 13; i++) { |
| 353 | if (this.form["sub_img" + i]) { | 368 | if (this.form["sub_img" + i]) { |
| 354 | let paths = ""; | 369 | let paths = ""; |
| @@ -408,7 +423,6 @@ export default { | @@ -408,7 +423,6 @@ export default { | ||
| 408 | break; | 423 | break; |
| 409 | } | 424 | } |
| 410 | } | 425 | } |
| 411 | - | ||
| 412 | if (this.taskName.indexOf("็งๅ") > -1) { | 426 | if (this.taskName.indexOf("็งๅ") > -1) { |
| 413 | query.idx = 0; | 427 | query.idx = 0; |
| 414 | query.sign1Text = text; | 428 | query.sign1Text = text; |
| @@ -451,6 +465,23 @@ export default { | @@ -451,6 +465,23 @@ export default { | ||
| 451 | postData.tableName = this.businessKey; | 465 | postData.tableName = this.businessKey; |
| 452 | postData.replyImg = this.form.replyImg + ""; | 466 | postData.replyImg = this.form.replyImg + ""; |
| 453 | postData.reply = this.form.reply; | 467 | postData.reply = this.form.reply; |
| 468 | + | ||
| 469 | + if(!postData.reply){ | ||
| 470 | + postData.reply = ""; | ||
| 471 | + } | ||
| 472 | + | ||
| 473 | + let text = ""; | ||
| 474 | + for (let i = 0; i < this.form.formData.length; i++) { | ||
| 475 | + let strings = this.form.formData[i]; | ||
| 476 | + switch (strings.controlType) { | ||
| 477 | + case 'radio': | ||
| 478 | + postData.reply = this.form.formData[i].controlDefault.split("--__--")[value] +" "+ postData.reply | ||
| 479 | + break; | ||
| 480 | + } | ||
| 481 | + } | ||
| 482 | + | ||
| 483 | + | ||
| 484 | + | ||
| 454 | if(postData.reply==null || postData.reply==""){ | 485 | if(postData.reply==null || postData.reply==""){ |
| 455 | if(value==0){ | 486 | if(value==0){ |
| 456 | postData.reply = "้่ฟ"; | 487 | postData.reply = "้่ฟ"; |
| @@ -459,42 +490,25 @@ export default { | @@ -459,42 +490,25 @@ export default { | ||
| 459 | } | 490 | } |
| 460 | } | 491 | } |
| 461 | 492 | ||
| 462 | - addReplyApprovalProcess(postData).then(res => { | ||
| 463 | - this.videoSrc1 = []; | ||
| 464 | - this.slides1 = []; | ||
| 465 | - }); | ||
| 466 | - let id = this.businessKey.split(":")[1]; | ||
| 467 | - let query = { | ||
| 468 | - id: id, | ||
| 469 | - }; | ||
| 470 | 493 | ||
| 471 | - let adv = this.form.advice; | ||
| 472 | - | ||
| 473 | - if (!adv) { | ||
| 474 | - if (value == 0) { | ||
| 475 | - adv = "ๅฎกๆน้่ฟ"; | ||
| 476 | - } else { | ||
| 477 | - adv = "ๅฎกๆน้ฉณๅ"; | 494 | + if ( this.taskName == "่ฝฆ่พๆๅฑไผไธ" || this.taskName == "ๆธฃๅๅ็งๅ" || (this.form.formData[0].controlLable == "ๆฏๅฆๅฑๅฎ" && this.form.formData[0].controlValue==0)) { |
| 495 | + if((this.form.formData[0].controlLable == "ๆฏๅฆๅฑๅฎ" && this.form.formData[0].controlValue==0 && (postData.replyImg == "" || !postData.replyImg || postData.replyImg == "undefined")) | ||
| 496 | + || (this.taskName == "ๆธฃๅๅ็งๅ" && (postData.replyImg == "" || !postData.replyImg || postData.replyImg == "undefined"))){ | ||
| 497 | + this.$message("่ฏทไธไผ ๅค็ฝฎ้ไปถ!") | ||
| 498 | + return; | ||
| 478 | } | 499 | } |
| 479 | } | 500 | } |
| 480 | 501 | ||
| 481 | - if (this.taskName == "ๆธฃๅๅ็งๅ") { | ||
| 482 | - query.advice1 = adv; | ||
| 483 | - } else if (this.taskName == "ๆธฃๅๅๅ็ฎก้ขๅฏผ") { | ||
| 484 | - query.advice2 = adv; | ||
| 485 | - } else if (this.taskName == "ๆฒป็้จ้จ้ฟ") { | ||
| 486 | - query.advice3 = adv; | ||
| 487 | - } else if (this.taskName == "ๆฒป็้จๅ็ฎก้ขๅฏผ") { | ||
| 488 | - query.advice4 = adv; | ||
| 489 | - } | ||
| 490 | 502 | ||
| 491 | - updateCaseOffline(query).then(res => { | 503 | + addReplyApprovalProcess(postData).then(res => { |
| 504 | + this.videoSrc1 = []; | ||
| 505 | + this.slides1 = []; | ||
| 506 | + }); | ||
| 492 | formDataSave(this.id, this.form.formData).then(response => { | 507 | formDataSave(this.id, this.form.formData).then(response => { |
| 493 | this.msgSuccess("ๅฎกๆนๆๅ"); | 508 | this.msgSuccess("ๅฎกๆนๆๅ"); |
| 494 | this.caseOffline = false; | 509 | this.caseOffline = false; |
| 495 | this.getList(); | 510 | this.getList(); |
| 496 | }); | 511 | }); |
| 497 | - }) | ||
| 498 | return; | 512 | return; |
| 499 | } | 513 | } |
| 500 | 514 | ||
| @@ -504,15 +518,32 @@ export default { | @@ -504,15 +518,32 @@ export default { | ||
| 504 | postData.tableName = this.businessKey; | 518 | postData.tableName = this.businessKey; |
| 505 | postData.replyImg = this.form.replyImg + ""; | 519 | postData.replyImg = this.form.replyImg + ""; |
| 506 | postData.reply = this.form.reply; | 520 | postData.reply = this.form.reply; |
| 507 | - if(postData.reply==null || postData.reply==""){ | 521 | + |
| 522 | + if(!postData.reply){ | ||
| 523 | + postData.reply = ""; | ||
| 524 | + } | ||
| 525 | + | ||
| 526 | + let text = ""; | ||
| 527 | + for (let i = 0; i < this.form.formData.length; i++) { | ||
| 528 | + let strings = this.form.formData[i]; | ||
| 529 | + switch (strings.controlType) { | ||
| 530 | + case 'radio': | ||
| 531 | + postData.reply = this.form.formData[i].controlDefault.split("--__--")[value] +" "+ postData.reply | ||
| 532 | + break; | ||
| 533 | + } | ||
| 534 | + } | ||
| 535 | + | ||
| 536 | + if(postData.reply==""){ | ||
| 508 | if(value==0){ | 537 | if(value==0){ |
| 509 | postData.reply = "้่ฟ"; | 538 | postData.reply = "้่ฟ"; |
| 510 | }else{ | 539 | }else{ |
| 511 | postData.reply = "้ฉณๅ"; | 540 | postData.reply = "้ฉณๅ"; |
| 512 | } | 541 | } |
| 513 | } | 542 | } |
| 514 | - if (this.taskName == "่ฝฆ่พๆๅฑไผไธ" || this.taskName == "ๆธฃๅๅ็งๅ") { | ||
| 515 | - if(this.taskName == "ๆธฃๅๅ็งๅ" && (postData.replyImg == "" || !postData.replyImg || postData.replyImg == "undefined")){ | 543 | + |
| 544 | + if ( this.taskName == "่ฝฆ่พๆๅฑไผไธ" || this.taskName == "ๆธฃๅๅ็งๅ" || (this.form.formData[0].controlLable == "ๆฏๅฆๅฑๅฎ" && this.form.formData[0].controlValue==0)) { | ||
| 545 | + if((this.form.formData[0].controlLable == "ๆฏๅฆๅฑๅฎ" && this.form.formData[0].controlValue==0 && (postData.replyImg == "" || !postData.replyImg || postData.replyImg == "undefined")) | ||
| 546 | + || (this.taskName == "ๆธฃๅๅ็งๅ" && (postData.replyImg == "" || !postData.replyImg || postData.replyImg == "undefined"))){ | ||
| 516 | this.$message("่ฏทไธไผ ๅค็ฝฎ้ไปถ!") | 547 | this.$message("่ฏทไธไผ ๅค็ฝฎ้ไปถ!") |
| 517 | return; | 548 | return; |
| 518 | } | 549 | } |
trash-ui/src/views/activiti/task/index.vue
| @@ -406,8 +406,8 @@ | @@ -406,8 +406,8 @@ | ||
| 406 | <el-button type="primary" @click="submitForm(form.formData[0].controlId ,0)">้่ฟ</el-button> | 406 | <el-button type="primary" @click="submitForm(form.formData[0].controlId ,0)">้่ฟ</el-button> |
| 407 | </div> | 407 | </div> |
| 408 | </el-dialog> | 408 | </el-dialog> |
| 409 | - | ||
| 410 | - | 409 | + |
| 410 | + | ||
| 411 | <!-- ๆๆพ็น --> | 411 | <!-- ๆๆพ็น --> |
| 412 | <el-dialog :title="title" :visible.sync="dropInfoOpen" width="500px" append-to-body | 412 | <el-dialog :title="title" :visible.sync="dropInfoOpen" width="500px" append-to-body |
| 413 | :close-on-click-modal="false"> | 413 | :close-on-click-modal="false"> |
| @@ -426,7 +426,7 @@ | @@ -426,7 +426,7 @@ | ||
| 426 | <el-button type="primary" @click="submitForm(form.formData[0].controlId,0)">้่ฟ</el-button> | 426 | <el-button type="primary" @click="submitForm(form.formData[0].controlId,0)">้่ฟ</el-button> |
| 427 | </div> | 427 | </div> |
| 428 | </el-dialog> | 428 | </el-dialog> |
| 429 | - | 429 | + |
| 430 | <!-- ๅๅค็ฎก็ --> | 430 | <!-- ๅๅค็ฎก็ --> |
| 431 | <el-dialog :title="title" :visible.sync="logisticsInfoOpen" width="500px" append-to-body | 431 | <el-dialog :title="title" :visible.sync="logisticsInfoOpen" width="500px" append-to-body |
| 432 | :close-on-click-modal="false"> | 432 | :close-on-click-modal="false"> |
| @@ -515,9 +515,11 @@ | @@ -515,9 +515,11 @@ | ||
| 515 | </el-form> | 515 | </el-form> |
| 516 | <div slot="footer" class="dialog-footer"> | 516 | <div slot="footer" class="dialog-footer"> |
| 517 | <el-button type="danger" @click="submitForm(form.formData[0].controlId,1)" | 517 | <el-button type="danger" @click="submitForm(form.formData[0].controlId,1)" |
| 518 | - v-if="this.taskName != '่ฝฆ่พๆๅฑไผไธ' && this.taskName != 'ๆธฃๅๅ็งๅ'">้ฉณๅ | ||
| 519 | - </el-button> | ||
| 520 | - <el-button type="primary" @click="submitForm(form.formData[0].controlId,0)">้่ฟ</el-button> | 518 | + v-if="this.taskName != '่ฝฆ่พๆๅฑไผไธ' |
| 519 | + && this.taskName != 'ๆธฃๅๅ็งๅ' | ||
| 520 | + && getNotId(form.formData[0],'FormProperty_21sue5n')" | ||
| 521 | + v-text="getLabel(form.formData[0],1)"></el-button> | ||
| 522 | + <el-button type="primary" @click="submitForm(form.formData[0].controlId,0)" v-text="getLabel(form.formData[0],0)"></el-button> | ||
| 521 | </div> | 523 | </div> |
| 522 | </el-dialog> | 524 | </el-dialog> |
| 523 | 525 | ||
| @@ -553,12 +555,13 @@ | @@ -553,12 +555,13 @@ | ||
| 553 | 555 | ||
| 554 | <div slot="footer" class="dialog-footer"> | 556 | <div slot="footer" class="dialog-footer"> |
| 555 | <el-button type="danger" @click="submitForm(form.formData[0].controlId,1)" | 557 | <el-button type="danger" @click="submitForm(form.formData[0].controlId,1)" |
| 556 | - v-if="this.taskName != '่ฝฆ่พๆๅฑไผไธ' && this.taskName != 'ๆธฃๅๅ็งๅ'">้ฉณๅ | 558 | + v-if="this.taskName != '่ฝฆ่พๆๅฑไผไธ' && this.taskName != 'ๆธฃๅๅ็งๅ' |
| 559 | + && getNotId(form.formData[0],'FormProperty_21sue5n')" v-text="getLabel(form.formData[0],1)"> | ||
| 557 | </el-button> | 560 | </el-button> |
| 558 | <el-button type="primary" | 561 | <el-button type="primary" |
| 559 | 562 | ||
| 560 | v-loading.fullscreen.lock="modalLoading" | 563 | v-loading.fullscreen.lock="modalLoading" |
| 561 | - @click="submitForm(form.formData[0].controlId,0)">้่ฟ</el-button> | 564 | + @click="submitForm(form.formData[0].controlId,0)" v-text="getLabel(form.formData[0],0)"></el-button> |
| 562 | </div> | 565 | </div> |
| 563 | </el-dialog> | 566 | </el-dialog> |
| 564 | 567 | ||
| @@ -864,6 +867,7 @@ | @@ -864,6 +867,7 @@ | ||
| 864 | slidesArys: [], | 867 | slidesArys: [], |
| 865 | slides1: [], | 868 | slides1: [], |
| 866 | videoSrc1: [], | 869 | videoSrc1: [], |
| 870 | + dropInfoOpen:false, | ||
| 867 | }; | 871 | }; |
| 868 | }, | 872 | }, |
| 869 | created() { | 873 | created() { |
trash-ui/src/views/casefile/violationCaseFile/violationCaseTable.vue
| @@ -24,7 +24,13 @@ | @@ -24,7 +24,13 @@ | ||
| 24 | v-if="hackReset"> | 24 | v-if="hackReset"> |
| 25 | <el-table-column label="่กๆฟ่ๅด" header-align="center" align="center"> | 25 | <el-table-column label="่กๆฟ่ๅด" header-align="center" align="center"> |
| 26 | <template slot-scope="scope"> | 26 | <template slot-scope="scope"> |
| 27 | - {{ owningRegion != "" && owningRegion != null ? owningRegion : "้ฟๆฒๅธ" }} | 27 | + <h3> |
| 28 | + {{ owningRegion != "" && owningRegion != null ? owningRegion+"" : "้ฟๆฒๅธ" }}</h3> | ||
| 29 | + | ||
| 30 | + <h4> | ||
| 31 | + ่ฏฅๅบๅไฟกๆฏๆฐ{{allCount[2]}}๏ผๅๅคๆฐ{{allCount[3]}}๏ผๅ็{{allCount[4]}} | ||
| 32 | + </h4> | ||
| 33 | + | ||
| 28 | </template> | 34 | </template> |
| 29 | </el-table-column> | 35 | </el-table-column> |
| 30 | <el-table-column property="type" label="้ข่ญฆ็ฑปๅ" header-align="center" align="center"></el-table-column> | 36 | <el-table-column property="type" label="้ข่ญฆ็ฑปๅ" header-align="center" align="center"></el-table-column> |
| @@ -53,6 +59,7 @@ export default { | @@ -53,6 +59,7 @@ export default { | ||
| 53 | hackReset: false, | 59 | hackReset: false, |
| 54 | pickerMinDate: null, | 60 | pickerMinDate: null, |
| 55 | pickerMaxDate: null, | 61 | pickerMaxDate: null, |
| 62 | + allCount:[] | ||
| 56 | } | 63 | } |
| 57 | }, | 64 | }, |
| 58 | created() { | 65 | created() { |
| @@ -108,7 +115,7 @@ export default { | @@ -108,7 +115,7 @@ export default { | ||
| 108 | } | 115 | } |
| 109 | } | 116 | } |
| 110 | }) | 117 | }) |
| 111 | - | 118 | + this.allCount = sums; |
| 112 | return sums; | 119 | return sums; |
| 113 | }, | 120 | }, |
| 114 | handleQuery() { | 121 | handleQuery() { |
trash-workFlow/src/main/java/com/trash/business/service/impl/CompanyCreditServiceImpl.java
| @@ -43,10 +43,12 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | @@ -43,10 +43,12 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | ||
| 43 | private ITruckCreditService truckService; | 43 | private ITruckCreditService truckService; |
| 44 | @Autowired | 44 | @Autowired |
| 45 | RedisCache redisCache; | 45 | RedisCache redisCache; |
| 46 | + | ||
| 46 | /** | 47 | /** |
| 47 | * ๆฅ่ฏขไผไธๅคฑไฟก | 48 | * ๆฅ่ฏขไผไธๅคฑไฟก |
| 48 | * | 49 | * |
| 49 | - * @param id ไผไธๅคฑไฟกID | 50 | + * @param id |
| 51 | + * ไผไธๅคฑไฟกID | ||
| 50 | * @return ไผไธๅคฑไฟก | 52 | * @return ไผไธๅคฑไฟก |
| 51 | */ | 53 | */ |
| 52 | @Override | 54 | @Override |
| @@ -57,29 +59,30 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | @@ -57,29 +59,30 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | ||
| 57 | /** | 59 | /** |
| 58 | * ๆฅ่ฏขไผไธๅคฑไฟกๅ่กจ | 60 | * ๆฅ่ฏขไผไธๅคฑไฟกๅ่กจ |
| 59 | * | 61 | * |
| 60 | - * @param companyCredit ไผไธๅคฑไฟก | 62 | + * @param companyCredit |
| 63 | + * ไผไธๅคฑไฟก | ||
| 61 | * @return ไผไธๅคฑไฟก | 64 | * @return ไผไธๅคฑไฟก |
| 62 | */ | 65 | */ |
| 63 | @Override | 66 | @Override |
| 64 | public List<CompanyCredit> selectCompanyCreditList(CompanyCredit companyCredit) { | 67 | public List<CompanyCredit> selectCompanyCreditList(CompanyCredit companyCredit) { |
| 65 | List<CompanyCredit> list = new ArrayList<>(); | 68 | List<CompanyCredit> list = new ArrayList<>(); |
| 66 | - | 69 | + |
| 67 | List<String> areas = SecurityUtils.getLoginUser().getUser().getCompanyAreas(); | 70 | List<String> areas = SecurityUtils.getLoginUser().getUser().getCompanyAreas(); |
| 68 | List<String> ids = SecurityUtils.getLoginUser().getUser().getCompanyIds(); | 71 | List<String> ids = SecurityUtils.getLoginUser().getUser().getCompanyIds(); |
| 69 | - | ||
| 70 | - if(areas.size() > 0) { | 72 | + |
| 73 | + if (areas.size() > 0) { | ||
| 71 | JSONArray array = redisCache.getCacheObject("companyList"); | 74 | JSONArray array = redisCache.getCacheObject("companyList"); |
| 72 | - if(array != null) { | ||
| 73 | - for(Object obj:array) { | ||
| 74 | - JSONObject json = (JSONObject)obj; | ||
| 75 | - if(areas.indexOf(json.getString("areaCode")) > -1) { | 75 | + if (array != null) { |
| 76 | + for (Object obj : array) { | ||
| 77 | + JSONObject json = (JSONObject) obj; | ||
| 78 | + if (areas.indexOf(json.getString("areaCode")) > -1) { | ||
| 76 | ids.add(json.getString("id")); | 79 | ids.add(json.getString("id")); |
| 77 | } | 80 | } |
| 78 | } | 81 | } |
| 79 | } | 82 | } |
| 80 | } | 83 | } |
| 81 | - | ||
| 82 | - if ( ids.size()> 0) { | 84 | + |
| 85 | + if (ids.size() > 0) { | ||
| 83 | companyCredit.setIds(SecurityUtils.getLoginUser().getUser().getCompanyIds()); | 86 | companyCredit.setIds(SecurityUtils.getLoginUser().getUser().getCompanyIds()); |
| 84 | list = companyCreditMapper.selectCompanyCreditList(companyCredit); | 87 | list = companyCreditMapper.selectCompanyCreditList(companyCredit); |
| 85 | } | 88 | } |
| @@ -89,7 +92,9 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | @@ -89,7 +92,9 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | ||
| 89 | 92 | ||
| 90 | /** | 93 | /** |
| 91 | * ๆฐๅขไผไธๅคฑไฟก | 94 | * ๆฐๅขไผไธๅคฑไฟก |
| 92 | - * @param companyCredit ไผไธๅคฑไฟก | 95 | + * |
| 96 | + * @param companyCredit | ||
| 97 | + * ไผไธๅคฑไฟก | ||
| 93 | * @return ็ปๆ | 98 | * @return ็ปๆ |
| 94 | */ | 99 | */ |
| 95 | @SuppressWarnings("unchecked") | 100 | @SuppressWarnings("unchecked") |
| @@ -134,62 +139,62 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | @@ -134,62 +139,62 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | ||
| 134 | } | 139 | } |
| 135 | 140 | ||
| 136 | updateRemoteCompanyAndTruck(companyCredit, token); | 141 | updateRemoteCompanyAndTruck(companyCredit, token); |
| 137 | - | ||
| 138 | - | ||
| 139 | - | 142 | + |
| 140 | return; | 143 | return; |
| 141 | } | 144 | } |
| 142 | 145 | ||
| 143 | private void SendSms(CompanyCredit companyCredit) { | 146 | private void SendSms(CompanyCredit companyCredit) { |
| 144 | JSONArray array = redisCache.getCacheObject("companyList"); | 147 | JSONArray array = redisCache.getCacheObject("companyList"); |
| 145 | - | ||
| 146 | - String number = null; | ||
| 147 | - for(Object obj:array){ | ||
| 148 | - JSONObject json = (JSONObject)obj; | ||
| 149 | - if(companyCredit.getObjectId().equals(json.getString("id"))){ | ||
| 150 | - number = json.getString("principalPhoneNo"); //ไผไธๅฎๅ จ่ด่ดฃไบบ | ||
| 151 | - break; | 148 | + |
| 149 | + new Thread(new Runnable() { | ||
| 150 | + | ||
| 151 | + @Override | ||
| 152 | + public void run() { | ||
| 153 | + // TODO Auto-generated method stub | ||
| 154 | + | ||
| 155 | + String number = null; | ||
| 156 | + for (Object obj : array) { | ||
| 157 | + JSONObject json = (JSONObject) obj; | ||
| 158 | + if (companyCredit.getObjectId().equals(json.getString("id"))) { | ||
| 159 | + number = json.getString("principalPhoneNo"); // ไผไธๅฎๅ จ่ด่ดฃไบบ | ||
| 160 | + break; | ||
| 161 | + } | ||
| 162 | + } | ||
| 163 | + | ||
| 164 | + if (number != null) { | ||
| 165 | + List<Mobile> mobileList = new ArrayList<Mobile>(); | ||
| 166 | + Mobile mobile = new Mobile(); | ||
| 167 | + mobile.setMobile(number); | ||
| 168 | + mobileList.add(mobile); | ||
| 169 | + | ||
| 170 | + String smsString = ""; | ||
| 171 | + if (companyCredit.getLostCredit() == 1) { | ||
| 172 | + smsString = "ๅคฑไฟกๆ้๏ผ" + companyCredit.getName() + "ๅ " + companyCredit.getReason() | ||
| 173 | + + "ๅๅ ๏ผ่ขซ็บณๅ ฅๅคฑไฟกๅๅ๏ผๅฐๅฝฑๅๆธฃๅไธๅกๅ็๏ผ่ฏทๅๆถๅค็ใ"; | ||
| 174 | + } else { | ||
| 175 | + smsString = "ๅคฑไฟก่งฃ้คๆ้๏ผ" + companyCredit.getName() + "็ฐๅทฒ่งฃ้คๅคฑไฟก๏ผๅฏไปฅ่ฟ่กๆธฃๅไธๅกๅ็๏ผ่ฏท็ฅๆใ"; | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + JsonSmsSend jsonSmsSend = PostSms.sendSms(mobileList, smsString); | ||
| 179 | + if (jsonSmsSend != null) { | ||
| 180 | + if (jsonSmsSend.getState() == 0) { | ||
| 181 | + System.out.println("ๅ้ๆๅ"); | ||
| 182 | + } else { | ||
| 183 | + System.out.println(jsonSmsSend.getMessage()); | ||
| 184 | + } | ||
| 185 | + } else { | ||
| 186 | + System.out.println("ๅ้่ฟๅ็ฉบ"); | ||
| 187 | + } | ||
| 188 | + } | ||
| 152 | } | 189 | } |
| 153 | - } | ||
| 154 | - | ||
| 155 | - | ||
| 156 | - | ||
| 157 | - if(number != null){ | ||
| 158 | - List<Mobile> mobileList=new ArrayList<Mobile>(); | ||
| 159 | - Mobile mobile=new Mobile(); | ||
| 160 | - mobile.setMobile(number); | ||
| 161 | - mobileList.add(mobile); | ||
| 162 | - | ||
| 163 | - String smsString = ""; | ||
| 164 | - if(companyCredit.getLostCredit() == 1){ | ||
| 165 | - smsString = "ๅคฑไฟกๆ้๏ผ"+companyCredit.getName()+"ๅ "+companyCredit.getReason()+"ๅๅ ๏ผ่ขซ็บณๅ ฅๅคฑไฟกๅๅ๏ผๅฐๅฝฑๅๆธฃๅไธๅกๅ็๏ผ่ฏทๅๆถๅค็ใ"; | ||
| 166 | - }else{ | ||
| 167 | - smsString = "ๅคฑไฟก่งฃ้คๆ้๏ผ"+companyCredit.getName()+"็ฐๅทฒ่งฃ้คๅคฑไฟก๏ผๅฏไปฅ่ฟ่กๆธฃๅไธๅกๅ็๏ผ่ฏท็ฅๆใ"; | ||
| 168 | - } | ||
| 169 | - | ||
| 170 | - | ||
| 171 | - | ||
| 172 | - JsonSmsSend jsonSmsSend= PostSms.sendSms(mobileList,smsString); | ||
| 173 | - if(jsonSmsSend!=null){ | ||
| 174 | - if(jsonSmsSend.getState()==0){ | ||
| 175 | - System.out.println("ๅ้ๆๅ"); | ||
| 176 | - }else{ | ||
| 177 | - System.out.println(jsonSmsSend.getMessage()); | ||
| 178 | - } | ||
| 179 | - }else{ | ||
| 180 | - System.out.println("ๅ้่ฟๅ็ฉบ"); | ||
| 181 | - } | ||
| 182 | - } | ||
| 183 | - | 190 | + }).start(); |
| 184 | } | 191 | } |
| 185 | 192 | ||
| 186 | @Override | 193 | @Override |
| 187 | public void updateRemoteCompanyAndTruck(CompanyCredit companyCredit, String token) { | 194 | public void updateRemoteCompanyAndTruck(CompanyCredit companyCredit, String token) { |
| 188 | long credit = companyCredit.getLostCredit(); | 195 | long credit = companyCredit.getLostCredit(); |
| 189 | String companyId = companyCredit.getObjectId(); | 196 | String companyId = companyCredit.getObjectId(); |
| 190 | - | ||
| 191 | 197 | ||
| 192 | - | ||
| 193 | List<Map> cpcList = new ArrayList<>(); | 198 | List<Map> cpcList = new ArrayList<>(); |
| 194 | Map cpc = new HashedMap<>(); | 199 | Map cpc = new HashedMap<>(); |
| 195 | cpc.put("dishonestState", credit); | 200 | cpc.put("dishonestState", credit); |
| @@ -232,7 +237,7 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | @@ -232,7 +237,7 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | ||
| 232 | if (credit == 0 && (data.getCreateType() != null && data.getCreateType() == 1)) { | 237 | if (credit == 0 && (data.getCreateType() != null && data.getCreateType() == 1)) { |
| 233 | data.setLostCredit(credit); | 238 | data.setLostCredit(credit); |
| 234 | data.setReason("ๅ ฌๅธๅคฑไฟกๆขๅค"); | 239 | data.setReason("ๅ ฌๅธๅคฑไฟกๆขๅค"); |
| 235 | - truckService.updateTruckCredit(data,1); | 240 | + truckService.updateTruckCredit(data, 1); |
| 236 | Map upParam = new HashedMap<>(); | 241 | Map upParam = new HashedMap<>(); |
| 237 | upParam.put("creditStatus", credit); | 242 | upParam.put("creditStatus", credit); |
| 238 | upParam.put("id", truckId); | 243 | upParam.put("id", truckId); |
| @@ -260,7 +265,7 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | @@ -260,7 +265,7 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | ||
| 260 | 265 | ||
| 261 | data.setTime(new Date()); | 266 | data.setTime(new Date()); |
| 262 | 267 | ||
| 263 | -// data.setCreateBy(SecurityUtils.getUsername()); | 268 | + // data.setCreateBy(SecurityUtils.getUsername()); |
| 264 | data.setCreateBy(""); | 269 | data.setCreateBy(""); |
| 265 | 270 | ||
| 266 | data.setReason("ๅ ฌๅธๅคฑไฟก"); | 271 | data.setReason("ๅ ฌๅธๅคฑไฟก"); |
| @@ -269,7 +274,7 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | @@ -269,7 +274,7 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | ||
| 269 | 274 | ||
| 270 | data.setObjectId(truckId); | 275 | data.setObjectId(truckId); |
| 271 | 276 | ||
| 272 | - truckService.insertTruckCredit(data,1); | 277 | + truckService.insertTruckCredit(data, 1); |
| 273 | 278 | ||
| 274 | Map upParam = new HashedMap<>(); | 279 | Map upParam = new HashedMap<>(); |
| 275 | upParam.put("creditStatus", credit); | 280 | upParam.put("creditStatus", credit); |
| @@ -289,7 +294,8 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | @@ -289,7 +294,8 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | ||
| 289 | /** | 294 | /** |
| 290 | * ไฟฎๆนไผไธๅคฑไฟก | 295 | * ไฟฎๆนไผไธๅคฑไฟก |
| 291 | * | 296 | * |
| 292 | - * @param companyCredit ไผไธๅคฑไฟก | 297 | + * @param companyCredit |
| 298 | + * ไผไธๅคฑไฟก | ||
| 293 | * @return ็ปๆ | 299 | * @return ็ปๆ |
| 294 | */ | 300 | */ |
| 295 | @Override | 301 | @Override |
| @@ -302,7 +308,7 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | @@ -302,7 +308,7 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | ||
| 302 | 308 | ||
| 303 | try { | 309 | try { |
| 304 | companyCreditMapper.updateCompanyCredit(cc); | 310 | companyCreditMapper.updateCompanyCredit(cc); |
| 305 | - cc.setTime(new Date()); | 311 | + cc.setTime(new Date()); |
| 306 | 312 | ||
| 307 | cc.setReason(companyCredit.getReason()); | 313 | cc.setReason(companyCredit.getReason()); |
| 308 | cc.setLostCredit(0L); | 314 | cc.setLostCredit(0L); |
| @@ -320,7 +326,8 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | @@ -320,7 +326,8 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | ||
| 320 | /** | 326 | /** |
| 321 | * ๆน้ๅ ้คไผไธๅคฑไฟก | 327 | * ๆน้ๅ ้คไผไธๅคฑไฟก |
| 322 | * | 328 | * |
| 323 | - * @param ids ้่ฆๅ ้ค็ไผไธๅคฑไฟกID | 329 | + * @param ids |
| 330 | + * ้่ฆๅ ้ค็ไผไธๅคฑไฟกID | ||
| 324 | * @return ็ปๆ | 331 | * @return ็ปๆ |
| 325 | */ | 332 | */ |
| 326 | @Override | 333 | @Override |
| @@ -341,13 +348,13 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | @@ -341,13 +348,13 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | ||
| 341 | List<CompanyCredit> list = new ArrayList<>(); | 348 | List<CompanyCredit> list = new ArrayList<>(); |
| 342 | List<String> areas = SecurityUtils.getLoginUser().getUser().getCompanyAreas(); | 349 | List<String> areas = SecurityUtils.getLoginUser().getUser().getCompanyAreas(); |
| 343 | List<String> ids = SecurityUtils.getLoginUser().getUser().getCompanyIds(); | 350 | List<String> ids = SecurityUtils.getLoginUser().getUser().getCompanyIds(); |
| 344 | - | ||
| 345 | - if(areas.size() > 0) { | 351 | + |
| 352 | + if (areas.size() > 0) { | ||
| 346 | JSONArray array = redisCache.getCacheObject("companyList"); | 353 | JSONArray array = redisCache.getCacheObject("companyList"); |
| 347 | - if(array != null) { | ||
| 348 | - for(Object obj:array) { | ||
| 349 | - JSONObject json = (JSONObject)obj; | ||
| 350 | - if(areas.indexOf(json.getString("areaCode")) > -1) { | 354 | + if (array != null) { |
| 355 | + for (Object obj : array) { | ||
| 356 | + JSONObject json = (JSONObject) obj; | ||
| 357 | + if (areas.indexOf(json.getString("areaCode")) > -1) { | ||
| 351 | ids.add(json.getString("id")); | 358 | ids.add(json.getString("id")); |
| 352 | } | 359 | } |
| 353 | } | 360 | } |
| @@ -364,7 +371,8 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | @@ -364,7 +371,8 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { | ||
| 364 | /** | 371 | /** |
| 365 | * ๅ ้คไผไธๅคฑไฟกไฟกๆฏ | 372 | * ๅ ้คไผไธๅคฑไฟกไฟกๆฏ |
| 366 | * | 373 | * |
| 367 | - * @param id ไผไธๅคฑไฟกID | 374 | + * @param id |
| 375 | + * ไผไธๅคฑไฟกID | ||
| 368 | * @return ็ปๆ | 376 | * @return ็ปๆ |
| 369 | */ | 377 | */ |
| 370 | @Override | 378 | @Override |
trash-workFlow/src/main/java/com/trash/business/service/impl/ConstructionCreditServiceImpl.java
| @@ -167,15 +167,23 @@ public class ConstructionCreditServiceImpl implements IConstructionCreditService | @@ -167,15 +167,23 @@ public class ConstructionCreditServiceImpl implements IConstructionCreditService | ||
| 167 | RemoteServerUtils.updateConstationCreditAndStatus(map); | 167 | RemoteServerUtils.updateConstationCreditAndStatus(map); |
| 168 | 168 | ||
| 169 | try { | 169 | try { |
| 170 | - JSONArray array = redis.getCacheObject("constructionList"); | ||
| 171 | 170 | ||
| 172 | - if (array == null) { | ||
| 173 | - array = JSONArray | ||
| 174 | - .parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("constructionList")); | ||
| 175 | - } | ||
| 176 | - sendCreditSMS(constructionCredit.getObjectId(), constructionCredit.getName(), | ||
| 177 | - constructionCredit.getReason(), constructionCredit.getLostCredit(), array, "credit", smsMapper, | ||
| 178 | - "constructionCompanyPhone", "projectnCompanyPhone"); | 171 | + new Thread(new Runnable() { |
| 172 | + | ||
| 173 | + @Override | ||
| 174 | + public void run() { | ||
| 175 | + JSONArray array = redis.getCacheObject("constructionList"); | ||
| 176 | + | ||
| 177 | + if (array == null) { | ||
| 178 | + array = JSONArray.parseArray( | ||
| 179 | + SpringUtils.getBean(SysTempMapper.class).getLocalData("constructionList")); | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + sendCreditSMS(constructionCredit.getObjectId(), constructionCredit.getName(), | ||
| 183 | + constructionCredit.getReason(), constructionCredit.getLostCredit(), array, "credit", | ||
| 184 | + smsMapper, "constructionCompanyPhone", "projectnCompanyPhone"); | ||
| 185 | + } | ||
| 186 | + }).start(); | ||
| 179 | } catch (Exception e) { | 187 | } catch (Exception e) { |
| 180 | 188 | ||
| 181 | e.printStackTrace(); | 189 | e.printStackTrace(); |
trash-workFlow/src/main/java/com/trash/business/service/impl/DriverCreditServiceImpl.java
| @@ -88,20 +88,17 @@ public class DriverCreditServiceImpl implements IDriverCreditService { | @@ -88,20 +88,17 @@ public class DriverCreditServiceImpl implements IDriverCreditService { | ||
| 88 | 88 | ||
| 89 | List<String> ids = new ArrayList<>(); | 89 | List<String> ids = new ArrayList<>(); |
| 90 | JSONArray jsonArray = redisCache.getCacheObject("driverList"); | 90 | JSONArray jsonArray = redisCache.getCacheObject("driverList"); |
| 91 | - if(jsonArray == null){ | 91 | + if (jsonArray == null) { |
| 92 | Map map = new HashMap<>(); | 92 | Map map = new HashMap<>(); |
| 93 | map.put("size", "99999"); | 93 | map.put("size", "99999"); |
| 94 | map.put("page", "1"); | 94 | map.put("page", "1"); |
| 95 | jsonArray = RemoteServerUtils.getDriverList(trashConfig.getToken(), map); | 95 | jsonArray = RemoteServerUtils.getDriverList(trashConfig.getToken(), map); |
| 96 | - | ||
| 97 | - if(jsonArray != null){ | 96 | + |
| 97 | + if (jsonArray != null) { | ||
| 98 | redisCache.setCacheObject("driverList", jsonArray, 60, TimeUnit.DAYS); | 98 | redisCache.setCacheObject("driverList", jsonArray, 60, TimeUnit.DAYS); |
| 99 | } | 99 | } |
| 100 | - | 100 | + |
| 101 | } | 101 | } |
| 102 | - | ||
| 103 | - | ||
| 104 | - | ||
| 105 | 102 | ||
| 106 | for (Object obj : jsonArray) { | 103 | for (Object obj : jsonArray) { |
| 107 | JSONObject json = (JSONObject) obj; | 104 | JSONObject json = (JSONObject) obj; |
| @@ -147,66 +144,71 @@ public class DriverCreditServiceImpl implements IDriverCreditService { | @@ -147,66 +144,71 @@ public class DriverCreditServiceImpl implements IDriverCreditService { | ||
| 147 | 144 | ||
| 148 | JSONArray array = redisCache.getCacheObject("companyList"); | 145 | JSONArray array = redisCache.getCacheObject("companyList"); |
| 149 | 146 | ||
| 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); | ||
| 159 | - } | ||
| 160 | - } | ||
| 161 | - | ||
| 162 | - String companyId = null; | ||
| 163 | - | ||
| 164 | - for (Object obj : jsonArray) { | 147 | + new Thread(new Runnable() { |
| 165 | 148 | ||
| 166 | - JSONObject json = (JSONObject) obj; | ||
| 167 | - if (json.getString("id").equals(driverCredit.getObjectId())) { | ||
| 168 | - companyId = json.getString("companyId"); | ||
| 169 | - break; | ||
| 170 | - } | ||
| 171 | - } | 149 | + @Override |
| 150 | + public void run() { | ||
| 151 | + JSONArray jsonArray = redisCache.getCacheObject("driverList"); | ||
| 152 | + if (jsonArray == null) { | ||
| 153 | + Map map = new HashMap<>(); | ||
| 154 | + map.put("size", "99999"); | ||
| 155 | + map.put("page", "1"); | ||
| 156 | + jsonArray = RemoteServerUtils.getDriverList(trashConfig.getToken(), map); | ||
| 172 | 157 | ||
| 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; | 158 | + if (jsonArray != null) { |
| 159 | + redisCache.setCacheObject("driverList", jsonArray, 60, TimeUnit.DAYS); | ||
| 160 | + } | ||
| 180 | } | 161 | } |
| 181 | - } | ||
| 182 | 162 | ||
| 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() + "็ฐๅทฒ่งฃ้คๅคฑไฟก๏ผๅฏไปฅ่ฟ่กๆธฃๅไธๅกๅ็๏ผ่ฏท็ฅๆใ"; | 163 | + String companyId = null; |
| 164 | + | ||
| 165 | + for (Object obj : jsonArray) { | ||
| 166 | + | ||
| 167 | + JSONObject json = (JSONObject) obj; | ||
| 168 | + if (json.getString("id").equals(driverCredit.getObjectId())) { | ||
| 169 | + companyId = json.getString("companyId"); | ||
| 170 | + break; | ||
| 171 | + } | ||
| 195 | } | 172 | } |
| 196 | 173 | ||
| 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()); | 174 | + if (companyId != null) { |
| 175 | + String number = null; | ||
| 176 | + for (Object obj : array) { | ||
| 177 | + JSONObject json = (JSONObject) obj; | ||
| 178 | + if (companyId.equals(json.getString("id"))) { | ||
| 179 | + number = json.getString("principalPhoneNo"); // ไผไธๅฎๅ จ่ด่ดฃไบบ | ||
| 180 | + break; | ||
| 181 | + } | ||
| 182 | + } | ||
| 183 | + | ||
| 184 | + if (number != null) { | ||
| 185 | + List<Mobile> mobileList = new ArrayList<Mobile>(); | ||
| 186 | + Mobile mobile = new Mobile(); | ||
| 187 | + mobile.setMobile(number); | ||
| 188 | + mobileList.add(mobile); | ||
| 189 | + | ||
| 190 | + String smsString = ""; | ||
| 191 | + if (driverCredit.getLostCredit() == 1) { | ||
| 192 | + smsString = "ๅคฑไฟกๆ้๏ผ" + driverCredit.getName() + "ๅ " + driverCredit.getReason() | ||
| 193 | + + "ๅๅ ๏ผ่ขซ็บณๅ ฅๅคฑไฟกๅๅ๏ผๅฐๅฝฑๅๆธฃๅไธๅกๅ็๏ผ่ฏทๅๆถๅค็ใ"; | ||
| 194 | + } else { | ||
| 195 | + smsString = "ๅคฑไฟก่งฃ้คๆ้๏ผ" + driverCredit.getName() + "็ฐๅทฒ่งฃ้คๅคฑไฟก๏ผๅฏไปฅ่ฟ่กๆธฃๅไธๅกๅ็๏ผ่ฏท็ฅๆใ"; | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + JsonSmsSend jsonSmsSend = PostSms.sendSms(mobileList, smsString); | ||
| 199 | + if (jsonSmsSend != null) { | ||
| 200 | + if (jsonSmsSend.getState() == 0) { | ||
| 201 | + System.out.println("ๅ้ๆๅ"); | ||
| 202 | + } else { | ||
| 203 | + System.out.println(jsonSmsSend.getMessage()); | ||
| 204 | + } | ||
| 205 | + } else { | ||
| 206 | + System.out.println("ๅ้่ฟๅ็ฉบ"); | ||
| 207 | + } | ||
| 203 | } | 208 | } |
| 204 | - } else { | ||
| 205 | - System.out.println("ๅ้่ฟๅ็ฉบ"); | ||
| 206 | } | 209 | } |
| 207 | } | 210 | } |
| 208 | - } | ||
| 209 | - | 211 | + }).start(); |
| 210 | } | 212 | } |
| 211 | 213 | ||
| 212 | // sentDataToRemoteServer(driverCredit); | 214 | // sentDataToRemoteServer(driverCredit); |
| @@ -257,7 +259,7 @@ public class DriverCreditServiceImpl implements IDriverCreditService { | @@ -257,7 +259,7 @@ public class DriverCreditServiceImpl implements IDriverCreditService { | ||
| 257 | 259 | ||
| 258 | List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds(); | 260 | List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds(); |
| 259 | List<String> areas = SecurityUtils.getLoginUser().getUser().getCompanyAreas(); | 261 | List<String> areas = SecurityUtils.getLoginUser().getUser().getCompanyAreas(); |
| 260 | - | 262 | + |
| 261 | if (areas.size() > 0) { | 263 | if (areas.size() > 0) { |
| 262 | JSONArray array = redisCache.getCacheObject("companyList"); | 264 | JSONArray array = redisCache.getCacheObject("companyList"); |
| 263 | if (array != null) { | 265 | if (array != null) { |
| @@ -271,21 +273,20 @@ public class DriverCreditServiceImpl implements IDriverCreditService { | @@ -271,21 +273,20 @@ public class DriverCreditServiceImpl implements IDriverCreditService { | ||
| 271 | } | 273 | } |
| 272 | 274 | ||
| 273 | if (companys.size() > 0) { | 275 | if (companys.size() > 0) { |
| 274 | - | ||
| 275 | - | 276 | + |
| 276 | List<String> ids = new ArrayList<>(); | 277 | List<String> ids = new ArrayList<>(); |
| 277 | 278 | ||
| 278 | JSONArray jsonArray = redisCache.getCacheObject("driverList"); | 279 | JSONArray jsonArray = redisCache.getCacheObject("driverList"); |
| 279 | - if(jsonArray == null){ | 280 | + if (jsonArray == null) { |
| 280 | Map map = new HashMap<>(); | 281 | Map map = new HashMap<>(); |
| 281 | map.put("size", "99999"); | 282 | map.put("size", "99999"); |
| 282 | map.put("page", "1"); | 283 | map.put("page", "1"); |
| 283 | jsonArray = RemoteServerUtils.getDriverList(trashConfig.getToken(), map); | 284 | jsonArray = RemoteServerUtils.getDriverList(trashConfig.getToken(), map); |
| 284 | - | ||
| 285 | - if(jsonArray != null){ | 285 | + |
| 286 | + if (jsonArray != null) { | ||
| 286 | redisCache.setCacheObject("driverList", jsonArray, 60, TimeUnit.DAYS); | 287 | redisCache.setCacheObject("driverList", jsonArray, 60, TimeUnit.DAYS); |
| 287 | } | 288 | } |
| 288 | - | 289 | + |
| 289 | } | 290 | } |
| 290 | 291 | ||
| 291 | for (Object obj : jsonArray) { | 292 | for (Object obj : jsonArray) { |
trash-workFlow/src/main/java/com/trash/business/service/impl/TruckCreditServiceImpl.java
| @@ -33,197 +33,196 @@ import com.trash.system.mapper.SysTempMapper; | @@ -33,197 +33,196 @@ import com.trash.system.mapper.SysTempMapper; | ||
| 33 | * @date 2023-04-25 | 33 | * @date 2023-04-25 |
| 34 | */ | 34 | */ |
| 35 | @Service | 35 | @Service |
| 36 | -public class TruckCreditServiceImpl implements ITruckCreditService | ||
| 37 | -{ | ||
| 38 | - @Autowired | ||
| 39 | - private TruckCreditMapper truckCreditMapper; | ||
| 40 | - | ||
| 41 | - @Autowired | ||
| 42 | - RedisCache redisCache; | ||
| 43 | - /** | ||
| 44 | - * ๆฅ่ฏข่ฝฆ่พๅคฑไฟก | ||
| 45 | - * | ||
| 46 | - * @param id ่ฝฆ่พๅคฑไฟกID | ||
| 47 | - * @return ่ฝฆ่พๅคฑไฟก | ||
| 48 | - */ | ||
| 49 | - @Override | ||
| 50 | - public TruckCredit selectTruckCreditById(Long id) | ||
| 51 | - { | ||
| 52 | - return truckCreditMapper.selectTruckCreditById(id); | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | - /** | ||
| 56 | - * ๆฅ่ฏข่ฝฆ่พๅคฑไฟกๅ่กจ | ||
| 57 | - * | ||
| 58 | - * @param truckCredit ่ฝฆ่พๅคฑไฟก | ||
| 59 | - * @return ่ฝฆ่พๅคฑไฟก | ||
| 60 | - */ | ||
| 61 | - @Override | ||
| 62 | - public List<TruckCredit> selectTruckCreditList(TruckCredit truckCredit) | ||
| 63 | - { | ||
| 64 | - | ||
| 65 | - List<TruckCredit> list = new ArrayList<>(); | ||
| 66 | - | ||
| 67 | - List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds(); | ||
| 68 | - List<String> tList = SecurityUtils.getLoginUser().getUser().getTruckList(); | ||
| 69 | - List<String> areas = SecurityUtils.getLoginUser().getUser().getCompanyAreas(); | ||
| 70 | - | ||
| 71 | - | ||
| 72 | - if(areas.size() > 0) { | ||
| 73 | - JSONArray array = redisCache.getCacheObject("companyList"); | ||
| 74 | - if(array == null) | ||
| 75 | - array = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("companyList")); | ||
| 76 | - if(array != null) { | ||
| 77 | - for(Object obj:array) { | ||
| 78 | - JSONObject json = (JSONObject)obj; | ||
| 79 | - if(areas.indexOf(json.getString("areaCode")) > -1) { | ||
| 80 | - companys.add(json.getString("id")); | ||
| 81 | - } | 36 | +public class TruckCreditServiceImpl implements ITruckCreditService { |
| 37 | + @Autowired | ||
| 38 | + private TruckCreditMapper truckCreditMapper; | ||
| 39 | + | ||
| 40 | + @Autowired | ||
| 41 | + RedisCache redisCache; | ||
| 42 | + | ||
| 43 | + /** | ||
| 44 | + * ๆฅ่ฏข่ฝฆ่พๅคฑไฟก | ||
| 45 | + * | ||
| 46 | + * @param id | ||
| 47 | + * ่ฝฆ่พๅคฑไฟกID | ||
| 48 | + * @return ่ฝฆ่พๅคฑไฟก | ||
| 49 | + */ | ||
| 50 | + @Override | ||
| 51 | + public TruckCredit selectTruckCreditById(Long id) { | ||
| 52 | + return truckCreditMapper.selectTruckCreditById(id); | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + /** | ||
| 56 | + * ๆฅ่ฏข่ฝฆ่พๅคฑไฟกๅ่กจ | ||
| 57 | + * | ||
| 58 | + * @param truckCredit | ||
| 59 | + * ่ฝฆ่พๅคฑไฟก | ||
| 60 | + * @return ่ฝฆ่พๅคฑไฟก | ||
| 61 | + */ | ||
| 62 | + @Override | ||
| 63 | + public List<TruckCredit> selectTruckCreditList(TruckCredit truckCredit) { | ||
| 64 | + | ||
| 65 | + List<TruckCredit> list = new ArrayList<>(); | ||
| 66 | + | ||
| 67 | + List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds(); | ||
| 68 | + List<String> tList = SecurityUtils.getLoginUser().getUser().getTruckList(); | ||
| 69 | + List<String> areas = SecurityUtils.getLoginUser().getUser().getCompanyAreas(); | ||
| 70 | + | ||
| 71 | + if (areas.size() > 0) { | ||
| 72 | + JSONArray array = redisCache.getCacheObject("companyList"); | ||
| 73 | + if (array == null) | ||
| 74 | + array = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("companyList")); | ||
| 75 | + if (array != null) { | ||
| 76 | + for (Object obj : array) { | ||
| 77 | + JSONObject json = (JSONObject) obj; | ||
| 78 | + if (areas.indexOf(json.getString("areaCode")) > -1) { | ||
| 79 | + companys.add(json.getString("id")); | ||
| 82 | } | 80 | } |
| 83 | } | 81 | } |
| 84 | } | 82 | } |
| 83 | + } | ||
| 85 | 84 | ||
| 86 | - | ||
| 87 | - if (tList.size() > 0 || companys.size() > 0) { | ||
| 88 | - List<String> ids = new ArrayList<>(); | ||
| 89 | - for(String str:tList){ | ||
| 90 | - ids.add(str); | ||
| 91 | - } | ||
| 92 | - | ||
| 93 | - | ||
| 94 | - if(companys.size() > 0){ | ||
| 95 | - | ||
| 96 | - JSONArray jsonArray = redisCache.getCacheObject("truckList"); | ||
| 97 | - if(jsonArray == null) | ||
| 98 | - jsonArray = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("truckList")); | ||
| 99 | - for(Object obj:jsonArray){ | ||
| 100 | - JSONObject json = (JSONObject) obj; | ||
| 101 | - if(companys.indexOf(json.getString("companyID")) > -1){ | ||
| 102 | - ids.add(json.getString("id")); | ||
| 103 | - } | 85 | + if (tList.size() > 0 || companys.size() > 0) { |
| 86 | + List<String> ids = new ArrayList<>(); | ||
| 87 | + for (String str : tList) { | ||
| 88 | + ids.add(str); | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + if (companys.size() > 0) { | ||
| 92 | + | ||
| 93 | + JSONArray jsonArray = redisCache.getCacheObject("truckList"); | ||
| 94 | + if (jsonArray == null) | ||
| 95 | + jsonArray = JSONArray | ||
| 96 | + .parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("truckList")); | ||
| 97 | + for (Object obj : jsonArray) { | ||
| 98 | + JSONObject json = (JSONObject) obj; | ||
| 99 | + if (companys.indexOf(json.getString("companyID")) > -1) { | ||
| 100 | + ids.add(json.getString("id")); | ||
| 104 | } | 101 | } |
| 105 | } | 102 | } |
| 106 | - | ||
| 107 | - truckCredit.setIds(ids); | ||
| 108 | - | ||
| 109 | - | ||
| 110 | - list = truckCreditMapper.selectTruckCreditList(truckCredit); | ||
| 111 | } | 103 | } |
| 112 | 104 | ||
| 113 | - | ||
| 114 | - return list; | ||
| 115 | - } | ||
| 116 | - | ||
| 117 | - /** | ||
| 118 | - * ๆฐๅข่ฝฆ่พๅคฑไฟก | ||
| 119 | - * | ||
| 120 | - * @param truckCredit ่ฝฆ่พๅคฑไฟก | ||
| 121 | - * @param isCompany | ||
| 122 | - * @return ็ปๆ | ||
| 123 | - */ | ||
| 124 | - @Override | ||
| 125 | - public int insertTruckCredit(TruckCredit truckCredit, int isCompany) | ||
| 126 | - { | ||
| 127 | - | ||
| 128 | - int i; | ||
| 129 | - | ||
| 130 | - TruckCredit cc = new TruckCredit(); | ||
| 131 | - | ||
| 132 | - cc.setStatus(0L); | ||
| 133 | - cc.setLostCredit(truckCredit.getLostCredit()); | ||
| 134 | - cc.setObjectId(truckCredit.getObjectId()); | ||
| 135 | - | ||
| 136 | - List old = truckCreditMapper.selectTruckCreditList(cc); | ||
| 137 | - | ||
| 138 | - if(old.size() > 0){ | ||
| 139 | - i = 1; | ||
| 140 | - }else{ | ||
| 141 | - cc.setTime(new Date()); | ||
| 142 | - i = truckCreditMapper.insertTruckCredit(truckCredit); | ||
| 143 | - | ||
| 144 | - | ||
| 145 | - if(isCompany == 0){ | ||
| 146 | - | ||
| 147 | - | ||
| 148 | - JSONArray array = redisCache.getCacheObject("companyList"); | ||
| 149 | - | ||
| 150 | - if(array == null) | ||
| 151 | - array = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("companyList")); | ||
| 152 | - String number = null; | ||
| 153 | - for(Object obj:array){ | ||
| 154 | - JSONObject json = (JSONObject)obj; | ||
| 155 | - if(truckCredit.getCompanyId().equals(json.getString("name"))){ | ||
| 156 | - number = json.getString("principalPhoneNo"); //ไผไธๅฎๅ จ่ด่ดฃไบบ | ||
| 157 | - break; | 105 | + truckCredit.setIds(ids); |
| 106 | + | ||
| 107 | + list = truckCreditMapper.selectTruckCreditList(truckCredit); | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + return list; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + /** | ||
| 114 | + * ๆฐๅข่ฝฆ่พๅคฑไฟก | ||
| 115 | + * | ||
| 116 | + * @param truckCredit | ||
| 117 | + * ่ฝฆ่พๅคฑไฟก | ||
| 118 | + * @param isCompany | ||
| 119 | + * @return ็ปๆ | ||
| 120 | + */ | ||
| 121 | + @Override | ||
| 122 | + public int insertTruckCredit(TruckCredit truckCredit, int isCompany) { | ||
| 123 | + | ||
| 124 | + int i; | ||
| 125 | + | ||
| 126 | + TruckCredit cc = new TruckCredit(); | ||
| 127 | + | ||
| 128 | + cc.setStatus(0L); | ||
| 129 | + cc.setLostCredit(truckCredit.getLostCredit()); | ||
| 130 | + cc.setObjectId(truckCredit.getObjectId()); | ||
| 131 | + | ||
| 132 | + List old = truckCreditMapper.selectTruckCreditList(cc); | ||
| 133 | + | ||
| 134 | + if (old.size() > 0) { | ||
| 135 | + i = 1; | ||
| 136 | + } else { | ||
| 137 | + cc.setTime(new Date()); | ||
| 138 | + i = truckCreditMapper.insertTruckCredit(truckCredit); | ||
| 139 | + | ||
| 140 | + new Thread(new Runnable() { | ||
| 141 | + | ||
| 142 | + @Override | ||
| 143 | + public void run() { | ||
| 144 | + // TODO Auto-generated method stub | ||
| 145 | + | ||
| 146 | + if (isCompany == 0) { | ||
| 147 | + | ||
| 148 | + JSONArray array = redisCache.getCacheObject("companyList"); | ||
| 149 | + | ||
| 150 | + if (array == null) | ||
| 151 | + array = JSONArray | ||
| 152 | + .parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("companyList")); | ||
| 153 | + String number = null; | ||
| 154 | + for (Object obj : array) { | ||
| 155 | + JSONObject json = (JSONObject) obj; | ||
| 156 | + if (truckCredit.getCompanyId().equals(json.getString("name"))) { | ||
| 157 | + number = json.getString("principalPhoneNo"); // ไผไธๅฎๅ จ่ด่ดฃไบบ | ||
| 158 | + break; | ||
| 159 | + } | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + if (number != null) { | ||
| 163 | + List<Mobile> mobileList = new ArrayList<Mobile>(); | ||
| 164 | + Mobile mobile = new Mobile(); | ||
| 165 | + mobile.setMobile(number); | ||
| 166 | + mobileList.add(mobile); | ||
| 167 | + | ||
| 168 | + String smsString = ""; | ||
| 169 | + if (truckCredit.getLostCredit() == 1) { | ||
| 170 | + smsString = "ๅคฑไฟกๆ้๏ผ" + truckCredit.getLicensePlate() + "ๅ " + truckCredit.getReason() | ||
| 171 | + + "ๅๅ ๏ผ่ขซ็บณๅ ฅๅคฑไฟกๅๅ๏ผๅฐๅฝฑๅๆธฃๅไธๅกๅ็๏ผ่ฏทๅๆถๅค็ใ"; | ||
| 172 | + } else { | ||
| 173 | + smsString = "ๅคฑไฟก่งฃ้คๆ้๏ผ" + truckCredit.getLicensePlate() + "็ฐๅทฒ่งฃ้คๅคฑไฟก๏ผๅฏไปฅ่ฟ่กๆธฃๅไธๅกๅ็๏ผ่ฏท็ฅๆใ"; | ||
| 174 | + } | ||
| 175 | + | ||
| 176 | + JsonSmsSend jsonSmsSend = PostSms.sendSms(mobileList, smsString); | ||
| 177 | + if (jsonSmsSend != null) { | ||
| 178 | + if (jsonSmsSend.getState() == 0) { | ||
| 179 | + System.out.println("ๅ้ๆๅ"); | ||
| 180 | + } else { | ||
| 181 | + System.out.println(jsonSmsSend.getMessage()); | ||
| 182 | + } | ||
| 183 | + } else { | ||
| 184 | + System.out.println("ๅ้่ฟๅ็ฉบ"); | ||
| 185 | + } | ||
| 186 | + } | ||
| 187 | + } | ||
| 188 | + | ||
| 158 | } | 189 | } |
| 159 | - } | ||
| 160 | - | ||
| 161 | - | ||
| 162 | - | ||
| 163 | - if(number != null){ | ||
| 164 | - List<Mobile> mobileList=new ArrayList<Mobile>(); | ||
| 165 | - Mobile mobile=new Mobile(); | ||
| 166 | - mobile.setMobile(number); | ||
| 167 | - mobileList.add(mobile); | ||
| 168 | - | ||
| 169 | - String smsString = ""; | ||
| 170 | - if(truckCredit.getLostCredit() == 1){ | ||
| 171 | - smsString = "ๅคฑไฟกๆ้๏ผ"+truckCredit.getLicensePlate()+"ๅ "+truckCredit.getReason()+"ๅๅ ๏ผ่ขซ็บณๅ ฅๅคฑไฟกๅๅ๏ผๅฐๅฝฑๅๆธฃๅไธๅกๅ็๏ผ่ฏทๅๆถๅค็ใ"; | ||
| 172 | - }else{ | ||
| 173 | - smsString = "ๅคฑไฟก่งฃ้คๆ้๏ผ"+truckCredit.getLicensePlate()+"็ฐๅทฒ่งฃ้คๅคฑไฟก๏ผๅฏไปฅ่ฟ่กๆธฃๅไธๅกๅ็๏ผ่ฏท็ฅๆใ"; | ||
| 174 | - } | ||
| 175 | - | ||
| 176 | - | ||
| 177 | - | ||
| 178 | - JsonSmsSend jsonSmsSend= PostSms.sendSms(mobileList,smsString); | ||
| 179 | - if(jsonSmsSend!=null){ | ||
| 180 | - if(jsonSmsSend.getState()==0){ | ||
| 181 | - System.out.println("ๅ้ๆๅ"); | ||
| 182 | - }else{ | ||
| 183 | - System.out.println(jsonSmsSend.getMessage()); | ||
| 184 | - } | ||
| 185 | - }else{ | ||
| 186 | - System.out.println("ๅ้่ฟๅ็ฉบ"); | ||
| 187 | - } | ||
| 188 | - } | ||
| 189 | - }} | ||
| 190 | - return i; | ||
| 191 | - } | ||
| 192 | - | ||
| 193 | - | ||
| 194 | - | ||
| 195 | - | ||
| 196 | - /** | ||
| 197 | - * ไฟฎๆน่ฝฆ่พๅคฑไฟก | ||
| 198 | - * | ||
| 199 | - * @param truckCredit ่ฝฆ่พๅคฑไฟก | ||
| 200 | - * @return ็ปๆ | ||
| 201 | - */ | ||
| 202 | - @Override | ||
| 203 | - @Transactional | ||
| 204 | - public int updateTruckCredit(TruckCredit truckCredit,int i) | ||
| 205 | - { | ||
| 206 | - TruckCredit cc = null; | ||
| 207 | - if(truckCredit.getObjectId() != null){ | ||
| 208 | - cc = truckCreditMapper.selectTruckCreditByObjectId(truckCredit.getObjectId()); | ||
| 209 | - }else{ | ||
| 210 | - cc = truckCreditMapper.selectTruckCreditById(truckCredit.getId()); | ||
| 211 | - } | ||
| 212 | - | ||
| 213 | - if(cc == null) | ||
| 214 | - return 0; | ||
| 215 | - | ||
| 216 | - cc.setStatus(1L); | ||
| 217 | - | ||
| 218 | - try { | ||
| 219 | - truckCreditMapper.updateTruckCredit(cc); | ||
| 220 | - | ||
| 221 | - cc.setReason(truckCredit.getReason()); | ||
| 222 | - cc.setTime(new Date()); | ||
| 223 | - cc.setLostCredit(0L); | ||
| 224 | - | ||
| 225 | - List<Map> listParam = new ArrayList<>(); | ||
| 226 | - Map param = new HashMap<>(); | 190 | + }).start(); |
| 191 | + } | ||
| 192 | + return i; | ||
| 193 | + } | ||
| 194 | + | ||
| 195 | + /** | ||
| 196 | + * ไฟฎๆน่ฝฆ่พๅคฑไฟก | ||
| 197 | + * | ||
| 198 | + * @param truckCredit | ||
| 199 | + * ่ฝฆ่พๅคฑไฟก | ||
| 200 | + * @return ็ปๆ | ||
| 201 | + */ | ||
| 202 | + @Override | ||
| 203 | + @Transactional | ||
| 204 | + public int updateTruckCredit(TruckCredit truckCredit, int i) { | ||
| 205 | + TruckCredit cc = null; | ||
| 206 | + if (truckCredit.getObjectId() != null) { | ||
| 207 | + cc = truckCreditMapper.selectTruckCreditByObjectId(truckCredit.getObjectId()); | ||
| 208 | + } else { | ||
| 209 | + cc = truckCreditMapper.selectTruckCreditById(truckCredit.getId()); | ||
| 210 | + } | ||
| 211 | + | ||
| 212 | + if (cc == null) | ||
| 213 | + return 0; | ||
| 214 | + | ||
| 215 | + cc.setStatus(1L); | ||
| 216 | + | ||
| 217 | + try { | ||
| 218 | + truckCreditMapper.updateTruckCredit(cc); | ||
| 219 | + | ||
| 220 | + cc.setReason(truckCredit.getReason()); | ||
| 221 | + cc.setTime(new Date()); | ||
| 222 | + cc.setLostCredit(0L); | ||
| 223 | + | ||
| 224 | + List<Map> listParam = new ArrayList<>(); | ||
| 225 | + Map param = new HashMap<>(); | ||
| 227 | 226 | ||
| 228 | param.put("id", cc.getObjectId()); | 227 | param.put("id", cc.getObjectId()); |
| 229 | param.put("creditStatus", 0); | 228 | param.put("creditStatus", 0); |
| @@ -231,115 +230,110 @@ public class TruckCreditServiceImpl implements ITruckCreditService | @@ -231,115 +230,110 @@ public class TruckCreditServiceImpl implements ITruckCreditService | ||
| 231 | listParam.add(param); | 230 | listParam.add(param); |
| 232 | 231 | ||
| 233 | RemoteServerUtils.updateTruckList(listParam); | 232 | RemoteServerUtils.updateTruckList(listParam); |
| 234 | - | ||
| 235 | - return insertTruckCredit(cc,i); | ||
| 236 | - | ||
| 237 | - } catch (Exception e) { | ||
| 238 | - | ||
| 239 | - } | ||
| 240 | - | ||
| 241 | - return 0; | ||
| 242 | - } | ||
| 243 | - | ||
| 244 | - /** | ||
| 245 | - * ๆน้ๅ ้ค่ฝฆ่พๅคฑไฟก | ||
| 246 | - * | ||
| 247 | - * @param ids ้่ฆๅ ้ค็่ฝฆ่พๅคฑไฟกID | ||
| 248 | - * @return ็ปๆ | ||
| 249 | - */ | ||
| 250 | - @Override | ||
| 251 | - public int deleteTruckCreditByIds(Long[] ids) | ||
| 252 | - { | ||
| 253 | - return truckCreditMapper.deleteTruckCreditByIds(ids); | ||
| 254 | - } | ||
| 255 | - | ||
| 256 | - | ||
| 257 | - @Override | ||
| 258 | - public List<TruckCredit> selectTruckCreditHistory(TruckCredit truckCredit) | ||
| 259 | - { | ||
| 260 | - List<TruckCredit> list = new ArrayList<>(); | ||
| 261 | - List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds(); | ||
| 262 | - List<String> tList = SecurityUtils.getLoginUser().getUser().getTruckList(); | ||
| 263 | - List<String> areas = SecurityUtils.getLoginUser().getUser().getCompanyAreas(); | ||
| 264 | - | ||
| 265 | - | ||
| 266 | - if(areas.size() > 0) { | ||
| 267 | - JSONArray array = redisCache.getCacheObject("companyList"); | ||
| 268 | - | ||
| 269 | - if(array == null) | ||
| 270 | - array = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("companyList")); | ||
| 271 | - | ||
| 272 | - if(array != null) { | ||
| 273 | - for(Object obj:array) { | ||
| 274 | - JSONObject json = (JSONObject)obj; | ||
| 275 | - if(areas.indexOf(json.getString("areaCode")) > -1) { | ||
| 276 | - companys.add(json.getString("id")); | ||
| 277 | - } | 233 | + |
| 234 | + return insertTruckCredit(cc, i); | ||
| 235 | + | ||
| 236 | + } catch (Exception e) { | ||
| 237 | + | ||
| 238 | + } | ||
| 239 | + | ||
| 240 | + return 0; | ||
| 241 | + } | ||
| 242 | + | ||
| 243 | + /** | ||
| 244 | + * ๆน้ๅ ้ค่ฝฆ่พๅคฑไฟก | ||
| 245 | + * | ||
| 246 | + * @param ids | ||
| 247 | + * ้่ฆๅ ้ค็่ฝฆ่พๅคฑไฟกID | ||
| 248 | + * @return ็ปๆ | ||
| 249 | + */ | ||
| 250 | + @Override | ||
| 251 | + public int deleteTruckCreditByIds(Long[] ids) { | ||
| 252 | + return truckCreditMapper.deleteTruckCreditByIds(ids); | ||
| 253 | + } | ||
| 254 | + | ||
| 255 | + @Override | ||
| 256 | + public List<TruckCredit> selectTruckCreditHistory(TruckCredit truckCredit) { | ||
| 257 | + List<TruckCredit> list = new ArrayList<>(); | ||
| 258 | + List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds(); | ||
| 259 | + List<String> tList = SecurityUtils.getLoginUser().getUser().getTruckList(); | ||
| 260 | + List<String> areas = SecurityUtils.getLoginUser().getUser().getCompanyAreas(); | ||
| 261 | + | ||
| 262 | + if (areas.size() > 0) { | ||
| 263 | + JSONArray array = redisCache.getCacheObject("companyList"); | ||
| 264 | + | ||
| 265 | + if (array == null) | ||
| 266 | + array = JSONArray.parseArray(SpringUtils.getBean(SysTempMapper.class).getLocalData("companyList")); | ||
| 267 | + | ||
| 268 | + if (array != null) { | ||
| 269 | + for (Object obj : array) { | ||
| 270 | + JSONObject json = (JSONObject) obj; | ||
| 271 | + if (areas.indexOf(json.getString("areaCode")) > -1) { | ||
| 272 | + companys.add(json.getString("id")); | ||
| 278 | } | 273 | } |
| 279 | } | 274 | } |
| 280 | } | 275 | } |
| 281 | - if (tList.size() > 0 || companys.size() > 0) { | ||
| 282 | - List<String> ids = new ArrayList<>(); | ||
| 283 | - for(String str:tList){ | ||
| 284 | - ids.add(str); | 276 | + } |
| 277 | + if (tList.size() > 0 || companys.size() > 0) { | ||
| 278 | + List<String> ids = new ArrayList<>(); | ||
| 279 | + for (String str : tList) { | ||
| 280 | + ids.add(str); | ||
| 281 | + } | ||
| 282 | + | ||
| 283 | + if (companys.size() > 0) { | ||
| 284 | + | ||
| 285 | + JSONArray jsonArray = redisCache.getCacheObject("truckList"); | ||
| 286 | + JSONArray delete = redisCache.getCacheObject("deletedTrucks"); | ||
| 287 | + | ||
| 288 | + if (delete == null) { | ||
| 289 | + Map<String, Object> map = new HashMap<>(); | ||
| 290 | + map.put("size", 99999); | ||
| 291 | + map.put("valid", 1); | ||
| 292 | + map.put("page", 1); | ||
| 293 | + | ||
| 294 | + delete = RemoteServerUtils.getTruckList(map); | ||
| 295 | + redisCache.setCacheObject("deletedTrucks", delete); | ||
| 285 | } | 296 | } |
| 286 | - | ||
| 287 | - | ||
| 288 | - if(companys.size() > 0){ | ||
| 289 | - | ||
| 290 | - JSONArray jsonArray = redisCache.getCacheObject("truckList"); | ||
| 291 | - JSONArray delete= redisCache.getCacheObject("deletedTrucks"); | ||
| 292 | - | ||
| 293 | - if(delete == null){ | ||
| 294 | - Map<String, Object> map = new HashMap<>(); | ||
| 295 | - map.put("size", 99999); | ||
| 296 | - map.put("valid", 1); | ||
| 297 | - map.put("page", 1); | ||
| 298 | - | ||
| 299 | - delete = RemoteServerUtils.getTruckList(map); | ||
| 300 | - redisCache.setCacheObject("deletedTrucks", delete); | ||
| 301 | - } | ||
| 302 | - | ||
| 303 | - if(jsonArray != null){ | ||
| 304 | - if(delete != null) | ||
| 305 | - jsonArray.addAll(delete); | ||
| 306 | - | ||
| 307 | - | ||
| 308 | - for(Object obj:jsonArray){ | ||
| 309 | - JSONObject json = (JSONObject) obj; | ||
| 310 | - if(companys.indexOf(json.getString("companyID")) > -1){ | ||
| 311 | - ids.add(json.getString("id")); | ||
| 312 | - } | 297 | + |
| 298 | + if (jsonArray != null) { | ||
| 299 | + if (delete != null) | ||
| 300 | + jsonArray.addAll(delete); | ||
| 301 | + | ||
| 302 | + for (Object obj : jsonArray) { | ||
| 303 | + JSONObject json = (JSONObject) obj; | ||
| 304 | + if (companys.indexOf(json.getString("companyID")) > -1) { | ||
| 305 | + ids.add(json.getString("id")); | ||
| 313 | } | 306 | } |
| 314 | } | 307 | } |
| 315 | } | 308 | } |
| 316 | - | ||
| 317 | - truckCredit.setIds(ids); | ||
| 318 | - | ||
| 319 | - list = truckCreditMapper.selectTruckCreditHistory(truckCredit); | ||
| 320 | } | 309 | } |
| 321 | 310 | ||
| 322 | - return list; | ||
| 323 | - } | ||
| 324 | - | ||
| 325 | - /** | ||
| 326 | - * ๅ ้ค่ฝฆ่พๅคฑไฟกไฟกๆฏ | ||
| 327 | - * | ||
| 328 | - * @param id ่ฝฆ่พๅคฑไฟกID | ||
| 329 | - * @return ็ปๆ | ||
| 330 | - */ | ||
| 331 | - @Override | ||
| 332 | - public int deleteTruckCreditById(Long id) | ||
| 333 | - { | ||
| 334 | - return truckCreditMapper.deleteTruckCreditById(id); | ||
| 335 | - } | ||
| 336 | - | ||
| 337 | - public List<String> getNames(TruckCredit truckCredit){ | ||
| 338 | - return truckCreditMapper.getNames(truckCredit); | ||
| 339 | - } | ||
| 340 | - | ||
| 341 | - public List<String> getCompanys(TruckCredit truckCredit){ | ||
| 342 | - return truckCreditMapper.getCompanys(truckCredit); | ||
| 343 | - } | 311 | + truckCredit.setIds(ids); |
| 312 | + | ||
| 313 | + list = truckCreditMapper.selectTruckCreditHistory(truckCredit); | ||
| 314 | + } | ||
| 315 | + | ||
| 316 | + return list; | ||
| 317 | + } | ||
| 318 | + | ||
| 319 | + /** | ||
| 320 | + * ๅ ้ค่ฝฆ่พๅคฑไฟกไฟกๆฏ | ||
| 321 | + * | ||
| 322 | + * @param id | ||
| 323 | + * ่ฝฆ่พๅคฑไฟกID | ||
| 324 | + * @return ็ปๆ | ||
| 325 | + */ | ||
| 326 | + @Override | ||
| 327 | + public int deleteTruckCreditById(Long id) { | ||
| 328 | + return truckCreditMapper.deleteTruckCreditById(id); | ||
| 329 | + } | ||
| 330 | + | ||
| 331 | + public List<String> getNames(TruckCredit truckCredit) { | ||
| 332 | + return truckCreditMapper.getNames(truckCredit); | ||
| 333 | + } | ||
| 334 | + | ||
| 335 | + public List<String> getCompanys(TruckCredit truckCredit) { | ||
| 336 | + return truckCreditMapper.getCompanys(truckCredit); | ||
| 337 | + } | ||
| 344 | 338 | ||
| 345 | } | 339 | } |
trash-workFlow/src/main/java/com/trash/caseOffline/service/impl/CaseOfflineServiceImpl.java
| @@ -91,23 +91,24 @@ public class CaseOfflineServiceImpl implements ICaseOfflineService | @@ -91,23 +91,24 @@ public class CaseOfflineServiceImpl implements ICaseOfflineService | ||
| 91 | JSONArray construList = redisCache.getCacheObject("constructionList"); | 91 | JSONArray construList = redisCache.getCacheObject("constructionList"); |
| 92 | JSONArray companyList = redisCache.getCacheObject("companyList"); | 92 | JSONArray companyList = redisCache.getCacheObject("companyList"); |
| 93 | 93 | ||
| 94 | - | ||
| 95 | - if(caseOffline.status1 != null){ | ||
| 96 | - if(caseOffline.status1.equals("0")){ | ||
| 97 | - caseOffline.status1 = " and advice1 is null"; | ||
| 98 | - }else if(caseOffline.status1.equals("1")){ | ||
| 99 | - caseOffline.status1 = " and advice1 is not null and advice3 is null"; | ||
| 100 | - }else if(caseOffline.status1.equals("2")){ | ||
| 101 | - caseOffline.status1 = " and advice3 is not null and advice4 is null"; | ||
| 102 | - }else if(caseOffline.status1.equals("3")){ | ||
| 103 | - caseOffline.status1 = " and advice4 is not null"; | ||
| 104 | - } | ||
| 105 | - } | ||
| 106 | - | 94 | + |
| 107 | companyArea.add("x"); | 95 | companyArea.add("x"); |
| 108 | cArea.add("x"); | 96 | cArea.add("x"); |
| 109 | eArea.add("x"); | 97 | eArea.add("x"); |
| 110 | 98 | ||
| 99 | + if (caseOffline.getStatus1() != null) { | ||
| 100 | + if (caseOffline.getStatus1().equals("0")) { | ||
| 101 | + caseOffline.setStatus1(" and status1 = 0 and status = 0"); | ||
| 102 | + } else if (caseOffline.getStatus1().equals("1")) { | ||
| 103 | + caseOffline.setStatus1(" and status1 = 1 and status = 0"); | ||
| 104 | + } else if (caseOffline.getStatus1().equals("2")) { | ||
| 105 | + caseOffline.setStatus1(" and status1 > 1 and status = 0"); | ||
| 106 | + } else if (caseOffline.getStatus1().equals("3")) { | ||
| 107 | + caseOffline.setStatus1(" and status = 1"); | ||
| 108 | + } | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + | ||
| 111 | caseOffline.setCompanyArea(companyArea); | 112 | caseOffline.setCompanyArea(companyArea); |
| 112 | caseOffline.setcArea(cArea); | 113 | caseOffline.setcArea(cArea); |
| 113 | caseOffline.seteArea(eArea); | 114 | caseOffline.seteArea(eArea); |
| @@ -115,19 +116,6 @@ public class CaseOfflineServiceImpl implements ICaseOfflineService | @@ -115,19 +116,6 @@ public class CaseOfflineServiceImpl implements ICaseOfflineService | ||
| 115 | 116 | ||
| 116 | return caseOfflineMapper.selectCaseOfflineList(caseOffline); | 117 | return caseOfflineMapper.selectCaseOfflineList(caseOffline); |
| 117 | } | 118 | } |
| 118 | - | ||
| 119 | - | ||
| 120 | - String[] typeName = { | ||
| 121 | - "ๆธฃๅๅค็ฝฎๅทฅๅฐ๏ผๅซๅค็ๅบๆ๏ผ็ๆธฃๅ่ฟ่พ่ฝฆ่พๅบๅบ่ฝฆ่บซไธๆด๏ผ่ฝฆ่ฝฎๅธฆๆณฅ", | ||
| 122 | - "ๆชๆด่ฝฆๅบๅบๆ่ ๅบๅบๆธ ๆดไธๅฝปๅบ", | ||
| 123 | - "ๆธฃๅ่ฟ่พ่ฝฆ่พ่ดง็ฎฑ้กถ็ๆชๆ่งๅฎๅ ณ้ญๅฐไฝๆๆชๆ่งๅฎๅๆ ๅ่ฃ ่ฝฝๆธฃๅๅบๅบ", | ||
| 124 | - "้ๆ ธๅ่ฝฆ่พ่ฟๅ ฅๆธฃๅๅค็ฝฎๅทฅๅฐ่ฟ่พๆธฃๅ", | ||
| 125 | - "ๆธฃๅๅค็ฝฎๅทฅๅฐๆชๆ่งๅฎๆถ้ดๅผๅๅทฅ", | ||
| 126 | - "ๆธฃๅๅค็ฝฎๅทฅๅฐๆด่ฝฆ่ฎพๆฝ็ญ็ ดๆใๆชๆญฃๅธธไฝฟ็จๅๆชๆฝไธๅฐไฝ็", | ||
| 127 | - "ๆธฃๅๅค็ฝฎๅทฅๅฐใๅค็ๅบๆ(ๅซๅๅกซๅบ๏ผๅบๅ ฅๅฃไธคไพง50็ฑณ่ๅดๅ ๅบ็ฐๆธฃๅๆฑกๆใๆฑกๆฐดๅคๆ็ญ็ฐ่ฑก", | ||
| 128 | - "ๆ ่ฎธๅฏๆถ็บณ๏ผๅทฅ๏ผ", | ||
| 129 | - "ๆ ่ฎธๅฏๆถ็บณ๏ผๆถ๏ผ", | ||
| 130 | - "ไฝฟ็จ้ไธ็จ่ฝฆ่พ"}; | ||
| 131 | 119 | ||
| 132 | /** | 120 | /** |
| 133 | * ๆฐๅข็บฟไธไบคๅๆกๅท | 121 | * ๆฐๅข็บฟไธไบคๅๆกๅท |
trash-workFlow/src/main/java/com/trash/casefile/service/impl/ViolationCaseFileServiceImpl.java
| @@ -383,23 +383,7 @@ public class ViolationCaseFileServiceImpl implements IViolationCaseFileService { | @@ -383,23 +383,7 @@ public class ViolationCaseFileServiceImpl implements IViolationCaseFileService { | ||
| 383 | return result; | 383 | return result; |
| 384 | } | 384 | } |
| 385 | 385 | ||
| 386 | - int i = 0; | ||
| 387 | - // ๆ นๆฎๅ้ๅฏน่ฑกๅคๆญๆต็จ | ||
| 388 | - if (violationCaseFile.getSendObject().equals("ๅบ็ฎก็้จ้จ")) { | ||
| 389 | - | ||
| 390 | - if (violationCaseFile.getViolationGrade().equals("ไธ่ฌ็ฑป")) { | ||
| 391 | - i = 1; | ||
| 392 | - } else { | ||
| 393 | - i = 2; | ||
| 394 | - } | ||
| 395 | - } | ||
| 396 | - if (violationCaseFile.getViolationType().equals("ไธๆ ่ฝฆ่พ่ฟๅ ฅๅทฅๅฐ") | ||
| 397 | - || violationCaseFile.getViolationType().equals("ไธๆ ่ฝฆ่พ่ฟๅ ฅๅค็ๅบๆ") | ||
| 398 | - || violationCaseFile.getViolationType().equals("ไธๆ ่ฝฆ่พ่ฟ่พ")) { | ||
| 399 | - i = 2; | ||
| 400 | - } | ||
| 401 | - | ||
| 402 | - WorkflowService.createCaseFile(violationCaseFile, i); | 386 | + WorkflowService.createCaseFile(violationCaseFile, 0); |
| 403 | 387 | ||
| 404 | return result; | 388 | return result; |
| 405 | } | 389 | } |
trash-workFlow/src/main/java/com/trash/workflow/service/IWorkflowService.java
| @@ -84,7 +84,6 @@ public interface IWorkflowService | @@ -84,7 +84,6 @@ public interface IWorkflowService | ||
| 84 | 84 | ||
| 85 | public void deleteWorkflowByName(String string); | 85 | public void deleteWorkflowByName(String string); |
| 86 | 86 | ||
| 87 | - int createCaseFileByTask(ViolationCaseFile violationCaseFile,int index); | ||
| 88 | 87 | ||
| 89 | int createCaseOffline(CaseOffline caseOffline); | 88 | int createCaseOffline(CaseOffline caseOffline); |
| 90 | 89 |
trash-workFlow/src/main/java/com/trash/workflow/service/impl/WorkflowServiceImpl.java
| @@ -25,6 +25,7 @@ import com.alibaba.fastjson.JSONArray; | @@ -25,6 +25,7 @@ import com.alibaba.fastjson.JSONArray; | ||
| 25 | import com.alibaba.fastjson.JSONObject; | 25 | import com.alibaba.fastjson.JSONObject; |
| 26 | import com.trash.activiti.domain.ActWorkflowFormData; | 26 | import com.trash.activiti.domain.ActWorkflowFormData; |
| 27 | import com.trash.activiti.service.IActWorkflowFormDataService; | 27 | import com.trash.activiti.service.IActWorkflowFormDataService; |
| 28 | +import com.trash.business.domain.ConstructionCredit; | ||
| 28 | import com.trash.business.domain.ConstructionSign; | 29 | import com.trash.business.domain.ConstructionSign; |
| 29 | import com.trash.business.domain.SupervisionThreestep; | 30 | import com.trash.business.domain.SupervisionThreestep; |
| 30 | import com.trash.business.service.IConstructionSignService; | 31 | import com.trash.business.service.IConstructionSignService; |
| @@ -32,13 +33,16 @@ import com.trash.business.service.ISupervisionThreestepService; | @@ -32,13 +33,16 @@ import com.trash.business.service.ISupervisionThreestepService; | ||
| 32 | import com.trash.caseOffline.domain.CaseOffline; | 33 | import com.trash.caseOffline.domain.CaseOffline; |
| 33 | import com.trash.casefile.domain.ViolationCaseFile; | 34 | import com.trash.casefile.domain.ViolationCaseFile; |
| 34 | import com.trash.casefile.domain.ViolationWarningInformation; | 35 | import com.trash.casefile.domain.ViolationWarningInformation; |
| 36 | +import com.trash.common.core.domain.entity.SysDictData; | ||
| 35 | import com.trash.common.core.domain.entity.SysUser; | 37 | import com.trash.common.core.domain.entity.SysUser; |
| 36 | import com.trash.common.core.redis.RedisCache; | 38 | import com.trash.common.core.redis.RedisCache; |
| 37 | import com.trash.common.utils.DateUtils; | 39 | import com.trash.common.utils.DateUtils; |
| 38 | import com.trash.common.utils.RemoteServerUtils; | 40 | import com.trash.common.utils.RemoteServerUtils; |
| 39 | import com.trash.common.utils.SecurityUtils; | 41 | import com.trash.common.utils.SecurityUtils; |
| 40 | import com.trash.common.utils.StringUtils; | 42 | import com.trash.common.utils.StringUtils; |
| 43 | +import com.trash.common.utils.spring.SpringUtils; | ||
| 41 | import com.trash.framework.web.service.SysLoginService; | 44 | import com.trash.framework.web.service.SysLoginService; |
| 45 | +import com.trash.system.service.ISysDictTypeService; | ||
| 42 | import com.trash.system.service.ISysUserService; | 46 | import com.trash.system.service.ISysUserService; |
| 43 | import com.trash.workflow.domain.Workflow; | 47 | import com.trash.workflow.domain.Workflow; |
| 44 | import com.trash.workflow.mapper.WorkflowMapper; | 48 | import com.trash.workflow.mapper.WorkflowMapper; |
| @@ -77,17 +81,14 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -77,17 +81,14 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 77 | String siteType[] = { "ๅค็ๅบๆ", "ๅปบ็ญๅๅพ่ตๆบๅๅค็ฝฎๅบ", "็พๆๅ็ฏไฟๅค็ฝฎๅบ", "็พๆๅๅบๆฅๅค็ๅบๆ", "ๅๅกซๅบ" }; | 81 | String siteType[] = { "ๅค็ๅบๆ", "ๅปบ็ญๅๅพ่ตๆบๅๅค็ฝฎๅบ", "็พๆๅ็ฏไฟๅค็ฝฎๅบ", "็พๆๅๅบๆฅๅค็ๅบๆ", "ๅๅกซๅบ" }; |
| 78 | 82 | ||
| 79 | String outArea = "ๆ ชๆดฒๅธ,ๆนๆฝญๅธ,ๆฑจ็ฝๅธ,ๆน้ดๅฟ"; | 83 | String outArea = "ๆ ชๆดฒๅธ,ๆนๆฝญๅธ,ๆฑจ็ฝๅธ,ๆน้ดๅฟ"; |
| 80 | - | ||
| 81 | - String tcdOutArea = "้ฟๆฒๅฟ,ๆๅๅบ,ๆต้ณๅธ,ๅฎไนกๅธ"; //่ฝฆไผไบบๅคๅบ | ||
| 82 | - | ||
| 83 | - | 84 | + |
| 85 | + String tcdOutArea = "้ฟๆฒๅฟ,ๆๅๅบ,ๆต้ณๅธ,ๅฎไนกๅธ"; // ่ฝฆไผไบบๅคๅบ | ||
| 84 | 86 | ||
| 85 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 87 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 86 | - | ||
| 87 | 88 | ||
| 88 | @Autowired | 89 | @Autowired |
| 89 | IActWorkflowFormDataService awfServer; | 90 | IActWorkflowFormDataService awfServer; |
| 90 | - | 91 | + |
| 91 | @Autowired | 92 | @Autowired |
| 92 | RuntimeService runtimeService; | 93 | RuntimeService runtimeService; |
| 93 | 94 | ||
| @@ -100,9 +101,9 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -100,9 +101,9 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 100 | @Override | 101 | @Override |
| 101 | @Transactional | 102 | @Transactional |
| 102 | public int createWorkFlow(Map<String, Object> data) { // ็ฌฌไธๆน้็จๆฅๆถๆฅๅฃ | 103 | public int createWorkFlow(Map<String, Object> data) { // ็ฌฌไธๆน้็จๆฅๆถๆฅๅฃ |
| 103 | - | 104 | + |
| 104 | SysUser user = SecurityUtils.getLoginUser().getUser(); | 105 | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| 105 | - | 106 | + |
| 106 | String flowType = data.get("type").toString(); | 107 | String flowType = data.get("type").toString(); |
| 107 | 108 | ||
| 108 | Map map = (Map) data.get("data"); | 109 | Map map = (Map) data.get("data"); |
| @@ -115,24 +116,25 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -115,24 +116,25 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 115 | String areaCode = null; | 116 | String areaCode = null; |
| 116 | int index = 0; | 117 | int index = 0; |
| 117 | JSONArray areas = RemoteServerUtils.getAreas(); | 118 | JSONArray areas = RemoteServerUtils.getAreas(); |
| 118 | - if (map.get("area") != null){ | 119 | + if (map.get("area") != null) { |
| 119 | areaCode = map.get("area").toString(); | 120 | areaCode = map.get("area").toString(); |
| 120 | - | ||
| 121 | - if(flowType.equals("workflow_vehicle") || flowType.equals("workflow_company") || flowType.equals("workflow_driver")){ | ||
| 122 | - for(Object obj : areas){ | 121 | + |
| 122 | + if (flowType.equals("workflow_vehicle") || flowType.equals("workflow_company") | ||
| 123 | + || flowType.equals("workflow_driver")) { | ||
| 124 | + for (Object obj : areas) { | ||
| 123 | JSONObject jsonObject = (JSONObject) obj; | 125 | JSONObject jsonObject = (JSONObject) obj; |
| 124 | - if(areaCode.equals(jsonObject.getString("code"))){ | ||
| 125 | - if(tcdOutArea.contains(jsonObject.getString("name"))){ | 126 | + if (areaCode.equals(jsonObject.getString("code"))) { |
| 127 | + if (tcdOutArea.contains(jsonObject.getString("name"))) { | ||
| 126 | index = 1; | 128 | index = 1; |
| 127 | } | 129 | } |
| 128 | break; | 130 | break; |
| 129 | } | 131 | } |
| 130 | } | 132 | } |
| 131 | - }else{ | ||
| 132 | - for(Object obj : areas){ | 133 | + } else { |
| 134 | + for (Object obj : areas) { | ||
| 133 | JSONObject jsonObject = (JSONObject) obj; | 135 | JSONObject jsonObject = (JSONObject) obj; |
| 134 | - if(areaCode.equals(jsonObject.getString("code"))){ | ||
| 135 | - if(outArea.contains(jsonObject.getString("name"))){ | 136 | + if (areaCode.equals(jsonObject.getString("code"))) { |
| 137 | + if (outArea.contains(jsonObject.getString("name"))) { | ||
| 136 | index = 1; | 138 | index = 1; |
| 137 | } | 139 | } |
| 138 | break; | 140 | break; |
| @@ -145,7 +147,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -145,7 +147,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 145 | ActWorkflowFormData awf = null; | 147 | ActWorkflowFormData awf = null; |
| 146 | 148 | ||
| 147 | try { | 149 | try { |
| 148 | - | 150 | + |
| 149 | processInstance = processRuntime.start(ProcessPayloadBuilder.start().withProcessDefinitionKey(flowType) | 151 | processInstance = processRuntime.start(ProcessPayloadBuilder.start().withProcessDefinitionKey(flowType) |
| 150 | .withName(title).withVariable("route", index).withBusinessKey(businessKey).build()); | 152 | .withName(title).withVariable("route", index).withBusinessKey(businessKey).build()); |
| 151 | 153 | ||
| @@ -167,7 +169,6 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -167,7 +169,6 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 167 | signService.insertConstructionSign(constructionSign); | 169 | signService.insertConstructionSign(constructionSign); |
| 168 | 170 | ||
| 169 | } | 171 | } |
| 170 | - | ||
| 171 | 172 | ||
| 172 | Workflow workflow = new Workflow(); | 173 | Workflow workflow = new Workflow(); |
| 173 | workflow.setId(businessKey); | 174 | workflow.setId(businessKey); |
| @@ -182,15 +183,15 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -182,15 +183,15 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 182 | workflow.setCreateBy(user.getUserName()); | 183 | workflow.setCreateBy(user.getUserName()); |
| 183 | workflow.setCreateName(user.getUserName()); | 184 | workflow.setCreateName(user.getUserName()); |
| 184 | 185 | ||
| 185 | - awf = insertAwf(user,workflow); | ||
| 186 | - | 186 | + awf = insertAwf(user, workflow); |
| 187 | + | ||
| 187 | return workflowMapper.insertWorkflow(workflow); | 188 | return workflowMapper.insertWorkflow(workflow); |
| 188 | } catch (Exception e) { | 189 | } catch (Exception e) { |
| 189 | - | ||
| 190 | - if(processInstance != null) | 190 | + |
| 191 | + if (processInstance != null) | ||
| 191 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); | 192 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); |
| 192 | - | ||
| 193 | - if(awf.getId() != null) | 193 | + |
| 194 | + if (awf.getId() != null) | ||
| 194 | awfServer.deleteActWorkflowFormDataById(awf.getId()); | 195 | awfServer.deleteActWorkflowFormDataById(awf.getId()); |
| 195 | 196 | ||
| 196 | e.printStackTrace(); | 197 | e.printStackTrace(); |
| @@ -199,13 +200,13 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -199,13 +200,13 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 199 | return 0; | 200 | return 0; |
| 200 | } | 201 | } |
| 201 | 202 | ||
| 202 | - private ActWorkflowFormData insertAwf(SysUser user ,Workflow workflow) { | ||
| 203 | - | ||
| 204 | - if(user == null){ | 203 | + private ActWorkflowFormData insertAwf(SysUser user, Workflow workflow) { |
| 204 | + | ||
| 205 | + if (user == null) { | ||
| 205 | user = new SysUser(); | 206 | user = new SysUser(); |
| 206 | user.setUserName("้ฟๆฒๅธๅปบ็ญๅๅพๆบๆ ง็็ฎกๅนณๅฐ"); | 207 | user.setUserName("้ฟๆฒๅธๅปบ็ญๅๅพๆบๆ ง็็ฎกๅนณๅฐ"); |
| 207 | } | 208 | } |
| 208 | - | 209 | + |
| 209 | ActWorkflowFormData awf; | 210 | ActWorkflowFormData awf; |
| 210 | awf = new ActWorkflowFormData(); | 211 | awf = new ActWorkflowFormData(); |
| 211 | awf.setCreateBy(user.getUserName()); | 212 | awf.setCreateBy(user.getUserName()); |
| @@ -217,7 +218,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -217,7 +218,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 217 | awf.setFormKey("CREATED"); | 218 | awf.setFormKey("CREATED"); |
| 218 | awf.setTaskNodeName(user.getUserName() + "ๅ่ตท"); | 219 | awf.setTaskNodeName(user.getUserName() + "ๅ่ตท"); |
| 219 | awf.setControlValue(workflow.getReason()); | 220 | awf.setControlValue(workflow.getReason()); |
| 220 | - | 221 | + |
| 221 | awfServer.insertActWorkflowFormData(awf); | 222 | awfServer.insertActWorkflowFormData(awf); |
| 222 | return awf; | 223 | return awf; |
| 223 | } | 224 | } |
| @@ -228,9 +229,9 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -228,9 +229,9 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 228 | ProcessInstance processInstance = null; | 229 | ProcessInstance processInstance = null; |
| 229 | 230 | ||
| 230 | ActWorkflowFormData awf = null; | 231 | ActWorkflowFormData awf = null; |
| 231 | - | 232 | + |
| 232 | SysUser user = SecurityUtils.getLoginUser().getUser(); | 233 | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| 233 | - | 234 | + |
| 234 | try { | 235 | try { |
| 235 | 236 | ||
| 236 | processInstance = processRuntime.start(ProcessPayloadBuilder.start() | 237 | processInstance = processRuntime.start(ProcessPayloadBuilder.start() |
| @@ -251,17 +252,16 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -251,17 +252,16 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 251 | 252 | ||
| 252 | taskService.saveTask(task); | 253 | taskService.saveTask(task); |
| 253 | } | 254 | } |
| 254 | - | ||
| 255 | 255 | ||
| 256 | - awf = insertAwf(user,workflow); | ||
| 257 | - | 256 | + awf = insertAwf(user, workflow); |
| 257 | + | ||
| 258 | workflow.setInstanceId(processInstance.getId()); | 258 | workflow.setInstanceId(processInstance.getId()); |
| 259 | 259 | ||
| 260 | workflow.setCreateTime(new Date()); | 260 | workflow.setCreateTime(new Date()); |
| 261 | return workflowMapper.insertWorkflow(workflow); | 261 | return workflowMapper.insertWorkflow(workflow); |
| 262 | } catch (Exception e) { | 262 | } catch (Exception e) { |
| 263 | 263 | ||
| 264 | - if(awf.getId() != null) | 264 | + if (awf.getId() != null) |
| 265 | awfServer.deleteActWorkflowFormDataById(awf.getId()); | 265 | awfServer.deleteActWorkflowFormDataById(awf.getId()); |
| 266 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); | 266 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); |
| 267 | 267 | ||
| @@ -270,19 +270,19 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -270,19 +270,19 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 270 | 270 | ||
| 271 | return 0; | 271 | return 0; |
| 272 | } | 272 | } |
| 273 | - | 273 | + |
| 274 | @Override | 274 | @Override |
| 275 | @Transactional | 275 | @Transactional |
| 276 | - public int createDropPointWorkFlow(Map<String,String> droppoint) { // ไธๆฅ | 276 | + public int createDropPointWorkFlow(Map<String, String> droppoint) { // ไธๆฅ |
| 277 | ProcessInstance processInstance = null; | 277 | ProcessInstance processInstance = null; |
| 278 | ActWorkflowFormData awf = null; | 278 | ActWorkflowFormData awf = null; |
| 279 | try { | 279 | try { |
| 280 | String name = "ๆๆพ็นๅฎกๆน:" + droppoint.get("name"); | 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 | - | 281 | + |
| 282 | + processInstance = processRuntime | ||
| 283 | + .start(ProcessPayloadBuilder.start().withProcessDefinitionKey("workflow_drop_point").withName(name) | ||
| 284 | + .withBusinessKey("workflow_drop_point:" + droppoint.get("id")).build()); | ||
| 285 | + | ||
| 286 | PorcThreeStepTask(processInstance, droppoint.get("area")); | 286 | PorcThreeStepTask(processInstance, droppoint.get("area")); |
| 287 | 287 | ||
| 288 | Workflow workflow = new Workflow(); | 288 | Workflow workflow = new Workflow(); |
| @@ -295,15 +295,14 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -295,15 +295,14 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 295 | workflow.setInstanceId(processInstance.getId()); | 295 | workflow.setInstanceId(processInstance.getId()); |
| 296 | workflow.setState("0"); | 296 | workflow.setState("0"); |
| 297 | workflow.setCreateTime(new Date()); | 297 | workflow.setCreateTime(new Date()); |
| 298 | - | ||
| 299 | 298 | ||
| 300 | SysUser user = SecurityUtils.getLoginUser().getUser(); | 299 | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| 301 | - awf = insertAwf(user,workflow); | 300 | + awf = insertAwf(user, workflow); |
| 302 | 301 | ||
| 303 | return workflowMapper.insertWorkflow(workflow); | 302 | return workflowMapper.insertWorkflow(workflow); |
| 304 | } catch (Exception e) { | 303 | } catch (Exception e) { |
| 305 | e.printStackTrace(); | 304 | e.printStackTrace(); |
| 306 | - if(awf.getId() != null) | 305 | + if (awf.getId() != null) |
| 307 | awfServer.deleteActWorkflowFormDataById(awf.getId()); | 306 | awfServer.deleteActWorkflowFormDataById(awf.getId()); |
| 308 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); | 307 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); |
| 309 | } | 308 | } |
| @@ -318,34 +317,30 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -318,34 +317,30 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 318 | ActWorkflowFormData awf = null; | 317 | ActWorkflowFormData awf = null; |
| 319 | try { | 318 | try { |
| 320 | String name = "ๆฅๅทฅ่ชๆฅ:" + supervision.getName(); | 319 | String name = "ๆฅๅทฅ่ชๆฅ:" + supervision.getName(); |
| 321 | - | ||
| 322 | - | 320 | + |
| 323 | JSONArray areas = redisCache.getCacheObject("areas"); | 321 | JSONArray areas = redisCache.getCacheObject("areas"); |
| 324 | - | 322 | + |
| 325 | int route = 0; | 323 | int route = 0; |
| 326 | - | ||
| 327 | - | ||
| 328 | - if(areas == null){ | ||
| 329 | - areas = RemoteServerUtils.getAreas(); | ||
| 330 | - redisCache.setCacheObject("areas", areas); | ||
| 331 | - } | ||
| 332 | - | ||
| 333 | - for(Object obj : areas){ | ||
| 334 | - JSONObject jsonObject = (JSONObject) obj; | ||
| 335 | - if(supervision.getPlace().equals(jsonObject.getString("code"))){ | ||
| 336 | - if(jsonObject.getString("name").contains("ๆนๆฑๆฐๅบ")){ | ||
| 337 | - route = 1; | ||
| 338 | - } | ||
| 339 | - break; | 324 | + |
| 325 | + if (areas == null) { | ||
| 326 | + areas = RemoteServerUtils.getAreas(); | ||
| 327 | + redisCache.setCacheObject("areas", areas); | ||
| 328 | + } | ||
| 329 | + | ||
| 330 | + for (Object obj : areas) { | ||
| 331 | + JSONObject jsonObject = (JSONObject) obj; | ||
| 332 | + if (supervision.getPlace().equals(jsonObject.getString("code"))) { | ||
| 333 | + if (jsonObject.getString("name").contains("ๆนๆฑๆฐๅบ")) { | ||
| 334 | + route = 1; | ||
| 340 | } | 335 | } |
| 336 | + break; | ||
| 341 | } | 337 | } |
| 342 | - | ||
| 343 | - | 338 | + } |
| 339 | + | ||
| 344 | processInstance = processRuntime.start(ProcessPayloadBuilder.start() | 340 | processInstance = processRuntime.start(ProcessPayloadBuilder.start() |
| 345 | - .withProcessDefinitionKey("workflow_threestep").withName(name) | ||
| 346 | - .withVariable("route", route) | 341 | + .withProcessDefinitionKey("workflow_threestep").withName(name).withVariable("route", route) |
| 347 | .withBusinessKey("workflow_threestep:" + supervision.getId()).build()); | 342 | .withBusinessKey("workflow_threestep:" + supervision.getId()).build()); |
| 348 | - | 343 | + |
| 349 | PorcThreeStepTask(processInstance, supervision.getPlace()); | 344 | PorcThreeStepTask(processInstance, supervision.getPlace()); |
| 350 | 345 | ||
| 351 | Workflow workflow = new Workflow(); | 346 | Workflow workflow = new Workflow(); |
| @@ -358,98 +353,92 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -358,98 +353,92 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 358 | workflow.setInstanceId(processInstance.getId()); | 353 | workflow.setInstanceId(processInstance.getId()); |
| 359 | workflow.setState("0"); | 354 | workflow.setState("0"); |
| 360 | workflow.setCreateTime(new Date()); | 355 | workflow.setCreateTime(new Date()); |
| 361 | - | ||
| 362 | 356 | ||
| 363 | SysUser user = SecurityUtils.getLoginUser().getUser(); | 357 | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| 364 | - awf = insertAwf(user,workflow); | 358 | + awf = insertAwf(user, workflow); |
| 365 | 359 | ||
| 366 | return workflowMapper.insertWorkflow(workflow); | 360 | return workflowMapper.insertWorkflow(workflow); |
| 367 | } catch (Exception e) { | 361 | } catch (Exception e) { |
| 368 | e.printStackTrace(); | 362 | e.printStackTrace(); |
| 369 | - if(awf.getId() != null) | 363 | + if (awf.getId() != null) |
| 370 | awfServer.deleteActWorkflowFormDataById(awf.getId()); | 364 | awfServer.deleteActWorkflowFormDataById(awf.getId()); |
| 371 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); | 365 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); |
| 372 | } | 366 | } |
| 373 | 367 | ||
| 374 | return 0; | 368 | return 0; |
| 375 | } | 369 | } |
| 376 | - | ||
| 377 | - @Override | ||
| 378 | - @Transactional | ||
| 379 | - public int createCaseFileByTask(ViolationCaseFile caseFile, int index) { // ่ฟ่ง้ข่ญฆๆกๅท | ||
| 380 | - | ||
| 381 | - if(StringUtils.isEmpty(RemoteServerUtils.remote)) { | ||
| 382 | - RemoteServerUtils.remote = trashConfig.getRemotePath(); | ||
| 383 | - } | ||
| 384 | - loginService.loginByRemote(trashConfig.getToken()); | ||
| 385 | - | ||
| 386 | - | ||
| 387 | - SysUser user = null; | ||
| 388 | - | ||
| 389 | - try { | ||
| 390 | - user = SecurityUtils.getLoginUser().getUser(); | ||
| 391 | - } catch (Exception e) { | ||
| 392 | -// e.printStackTrace(); | ||
| 393 | - } | ||
| 394 | - | ||
| 395 | - | ||
| 396 | - | ||
| 397 | - | ||
| 398 | - SecurityContextImpl securityContextImpl = new SecurityContextImpl(); | ||
| 399 | - | ||
| 400 | - securityContextImpl.setAuthentication(SecurityContextHolder.getContext().getAuthentication()); | ||
| 401 | - org.activiti.engine.runtime.ProcessInstance instance = null; | ||
| 402 | - String title = "ๆกๅทๅท:" + caseFile.getNumber(); | ||
| 403 | - String flowType = "workflow_casefile"; | ||
| 404 | - | ||
| 405 | - if(index > 0 && caseFile.getOwningRegion().contains("ๆนๆฑๆฐๅบ")){ | ||
| 406 | - index += 3; | ||
| 407 | - } | ||
| 408 | - ActWorkflowFormData awf = null; | ||
| 409 | - | ||
| 410 | - try { | ||
| 411 | - Map map = new HashedMap<>(); | ||
| 412 | - | ||
| 413 | - map.put("route", index); | ||
| 414 | - instance = runtimeService.createProcessInstanceBuilder().businessKey(flowType + ":" + caseFile.getId()) | ||
| 415 | - .name(title).variable("route", index).processDefinitionKey(flowType).variables(map).start(); | ||
| 416 | - | ||
| 417 | - // runtimeService.startProcessInstanceById(instance.getProcessDefinitionId(),map); | ||
| 418 | - | ||
| 419 | - if (index == 0) { | ||
| 420 | - Task task = taskService.createTaskQuery().processInstanceId(instance.getId()).singleResult(); | ||
| 421 | - | ||
| 422 | - task.setAssignee(caseFile.getAbbreviation()); | ||
| 423 | - | ||
| 424 | - task.setDescription(caseFile.getAbbreviation()); | ||
| 425 | - taskService.saveTask(task); | ||
| 426 | - } else { | ||
| 427 | - updateProcessKafka(instance, caseFile.getOwningRegion(), trashConfig.getToken()); | ||
| 428 | - } | ||
| 429 | - | ||
| 430 | - Workflow workflow = new Workflow(); | ||
| 431 | - workflow.setId(flowType + ":" + caseFile.getId()); | ||
| 432 | - workflow.setTitle(title); | ||
| 433 | - workflow.setReason("ๅนณๅฐๆกๅท"); | ||
| 434 | - workflow.setStartTime(sdf.format(caseFile.getCreateTime())); | ||
| 435 | - workflow.setEndTime(sdf.format(caseFile.getCreateTime())); | ||
| 436 | - workflow.setType("่ฟ่งๆกๅทๅค็ฝฎๆต็จ"); | ||
| 437 | - workflow.setInstanceId(instance.getId()); | ||
| 438 | - workflow.setState("0"); | ||
| 439 | - workflow.setCreateTime(new Date()); | ||
| 440 | - | ||
| 441 | - | ||
| 442 | - awf = insertAwf(user,workflow); | ||
| 443 | - | ||
| 444 | - return workflowMapper.insertWorkflow(workflow); | ||
| 445 | - } catch (Exception e) { | ||
| 446 | - if(awf.getId() != null) | ||
| 447 | - awfServer.deleteActWorkflowFormDataById(awf.getId()); | ||
| 448 | - runtimeService.deleteProcessInstance(instance.getId(), "ๅๅปบๅคฑ่ดฅ"); | ||
| 449 | - throw new RuntimeException(e); | ||
| 450 | - } | ||
| 451 | 370 | ||
| 452 | - } | 371 | +// @Override |
| 372 | +// @Transactional | ||
| 373 | +// public int createCaseFileByTask(ViolationCaseFile caseFile, int index) { // ่ฟ่ง้ข่ญฆๆกๅท | ||
| 374 | +// | ||
| 375 | +// if (StringUtils.isEmpty(RemoteServerUtils.remote)) { | ||
| 376 | +// RemoteServerUtils.remote = trashConfig.getRemotePath(); | ||
| 377 | +// } | ||
| 378 | +// loginService.loginByRemote(trashConfig.getToken()); | ||
| 379 | +// | ||
| 380 | +// SysUser user = null; | ||
| 381 | +// | ||
| 382 | +// try { | ||
| 383 | +// user = SecurityUtils.getLoginUser().getUser(); | ||
| 384 | +// } catch (Exception e) { | ||
| 385 | +// // e.printStackTrace(); | ||
| 386 | +// } | ||
| 387 | +// | ||
| 388 | +// SecurityContextImpl securityContextImpl = new SecurityContextImpl(); | ||
| 389 | +// | ||
| 390 | +// securityContextImpl.setAuthentication(SecurityContextHolder.getContext().getAuthentication()); | ||
| 391 | +// org.activiti.engine.runtime.ProcessInstance instance = null; | ||
| 392 | +// String title = "ๆกๅทๅท:" + caseFile.getNumber(); | ||
| 393 | +// String flowType = "workflow_casefile"; | ||
| 394 | +// | ||
| 395 | +// if (index > 0 && caseFile.getOwningRegion().contains("ๆนๆฑๆฐๅบ")) { | ||
| 396 | +// index += 3; | ||
| 397 | +// } | ||
| 398 | +// ActWorkflowFormData awf = null; | ||
| 399 | +// | ||
| 400 | +// try { | ||
| 401 | +// Map map = new HashedMap<>(); | ||
| 402 | +// | ||
| 403 | +// map.put("route", index); | ||
| 404 | +// instance = runtimeService.createProcessInstanceBuilder().businessKey(flowType + ":" + caseFile.getId()) | ||
| 405 | +// .name(title).variable("route", index).processDefinitionKey(flowType).variables(map).start(); | ||
| 406 | +// | ||
| 407 | +// // runtimeService.startProcessInstanceById(instance.getProcessDefinitionId(),map); | ||
| 408 | +// | ||
| 409 | +// if (index == 0) { | ||
| 410 | +// Task task = taskService.createTaskQuery().processInstanceId(instance.getId()).singleResult(); | ||
| 411 | +// | ||
| 412 | +// task.setAssignee(caseFile.getAbbreviation()); | ||
| 413 | +// | ||
| 414 | +// task.setDescription(caseFile.getAbbreviation()); | ||
| 415 | +// taskService.saveTask(task); | ||
| 416 | +// } else { | ||
| 417 | +// updateProcessKafka(instance, caseFile.getOwningRegion(), trashConfig.getToken()); | ||
| 418 | +// } | ||
| 419 | +// | ||
| 420 | +// Workflow workflow = new Workflow(); | ||
| 421 | +// workflow.setId(flowType + ":" + caseFile.getId()); | ||
| 422 | +// workflow.setTitle(title); | ||
| 423 | +// workflow.setReason("ๅนณๅฐๆกๅท"); | ||
| 424 | +// workflow.setStartTime(sdf.format(caseFile.getCreateTime())); | ||
| 425 | +// workflow.setEndTime(sdf.format(caseFile.getCreateTime())); | ||
| 426 | +// workflow.setType("่ฟ่งๆกๅทๅค็ฝฎๆต็จ"); | ||
| 427 | +// workflow.setInstanceId(instance.getId()); | ||
| 428 | +// workflow.setState("0"); | ||
| 429 | +// workflow.setCreateTime(new Date()); | ||
| 430 | +// | ||
| 431 | +// awf = insertAwf(user, workflow); | ||
| 432 | +// | ||
| 433 | +// return workflowMapper.insertWorkflow(workflow); | ||
| 434 | +// } catch (Exception e) { | ||
| 435 | +// if (awf.getId() != null) | ||
| 436 | +// awfServer.deleteActWorkflowFormDataById(awf.getId()); | ||
| 437 | +// runtimeService.deleteProcessInstance(instance.getId(), "ๅๅปบๅคฑ่ดฅ"); | ||
| 438 | +// throw new RuntimeException(e); | ||
| 439 | +// } | ||
| 440 | +// | ||
| 441 | +// } | ||
| 453 | 442 | ||
| 454 | @Override | 443 | @Override |
| 455 | @Transactional | 444 | @Transactional |
| @@ -459,25 +448,38 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -459,25 +448,38 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 459 | String title = "ๆกๅทๅท:" + caseFile.getNumber(); | 448 | String title = "ๆกๅทๅท:" + caseFile.getNumber(); |
| 460 | String flowType = "workflow_casefile"; | 449 | String flowType = "workflow_casefile"; |
| 461 | try { | 450 | try { |
| 451 | + List<SysDictData> caseType = SpringUtils.getBean(ISysDictTypeService.class) | ||
| 452 | + .selectDictDataByType("vio_casefile"); | ||
| 453 | + | ||
| 454 | + for (SysDictData d : caseType) { | ||
| 455 | + if (caseFile.getViolationType().equals(d.getDictValue())) { | ||
| 456 | + if (d.getRemark() != null) { | ||
| 457 | + index = 1; | ||
| 458 | + } | ||
| 459 | + break; | ||
| 460 | + } | ||
| 461 | + } | ||
| 462 | 462 | ||
| 463 | - if(index > 0 && caseFile.getOwningRegion().contains("ๆนๆฑๆฐๅบ")){ | ||
| 464 | - index += 3; | 463 | + if(index == 0){ |
| 464 | + if (tcdOutArea.indexOf(caseFile.getOwningRegion()) > -1) { | ||
| 465 | + index = 2; | ||
| 466 | + } | ||
| 467 | + | ||
| 468 | + if ("ๆนๆฑๆฐๅบ".equals(caseFile.getOwningRegion())) { | ||
| 469 | + index = 3; | ||
| 470 | + } | ||
| 465 | } | 471 | } |
| 466 | 472 | ||
| 473 | + | ||
| 474 | + | ||
| 475 | + | ||
| 467 | processInstance = processRuntime | 476 | processInstance = processRuntime |
| 468 | .start(ProcessPayloadBuilder.start().withProcessDefinitionKey(flowType).withName(title) | 477 | .start(ProcessPayloadBuilder.start().withProcessDefinitionKey(flowType).withName(title) |
| 469 | .withBusinessKey(flowType + ":" + caseFile.getId()).withVariable("route", index).build()); | 478 | .withBusinessKey(flowType + ":" + caseFile.getId()).withVariable("route", index).build()); |
| 470 | 479 | ||
| 471 | - if (index == 0) { | ||
| 472 | - Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); | ||
| 473 | - | ||
| 474 | - task.setAssignee(caseFile.getAbbreviation()); | ||
| 475 | - task.setDescription(caseFile.getAbbreviation()); | ||
| 476 | 480 | ||
| 477 | - taskService.saveTask(task); | ||
| 478 | - } else { | ||
| 479 | - updateProcess(processInstance, caseFile.getOwningRegion()); | ||
| 480 | - } | 481 | + updateProcess(processInstance, caseFile.getOwningRegion()); |
| 482 | + | ||
| 481 | 483 | ||
| 482 | Workflow workflow = new Workflow(); | 484 | Workflow workflow = new Workflow(); |
| 483 | workflow.setId(flowType + ":" + caseFile.getId()); | 485 | workflow.setId(flowType + ":" + caseFile.getId()); |
| @@ -491,19 +493,17 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -491,19 +493,17 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 491 | workflow.setCreateTime(new Date()); | 493 | workflow.setCreateTime(new Date()); |
| 492 | 494 | ||
| 493 | SysUser user = SecurityUtils.getLoginUser().getUser(); | 495 | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| 494 | - awf = insertAwf(user,workflow); | 496 | + awf = insertAwf(user, workflow); |
| 495 | return workflowMapper.insertWorkflow(workflow); | 497 | return workflowMapper.insertWorkflow(workflow); |
| 496 | } catch (Exception e) { | 498 | } catch (Exception e) { |
| 497 | e.printStackTrace(); | 499 | e.printStackTrace(); |
| 498 | - if(awf.getId() != null) | 500 | + if (awf.getId() != null) |
| 499 | awfServer.deleteActWorkflowFormDataById(awf.getId()); | 501 | awfServer.deleteActWorkflowFormDataById(awf.getId()); |
| 500 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); | 502 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); |
| 501 | throw new RuntimeException(e); | 503 | throw new RuntimeException(e); |
| 502 | } | 504 | } |
| 503 | } | 505 | } |
| 504 | 506 | ||
| 505 | - | ||
| 506 | - | ||
| 507 | @Override | 507 | @Override |
| 508 | @Transactional | 508 | @Transactional |
| 509 | public int createCaseFile1(ViolationWarningInformation caseFile, int index, int isAuto) { // ่ฟ่ง้ข่ญฆๆกๅท | 509 | public int createCaseFile1(ViolationWarningInformation caseFile, int index, int isAuto) { // ่ฟ่ง้ข่ญฆๆกๅท |
| @@ -513,20 +513,15 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -513,20 +513,15 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 513 | } | 513 | } |
| 514 | loginService.loginByRemote(trashConfig.getToken()); | 514 | loginService.loginByRemote(trashConfig.getToken()); |
| 515 | } | 515 | } |
| 516 | - | ||
| 517 | - | ||
| 518 | 516 | ||
| 519 | SysUser user = null; | 517 | SysUser user = null; |
| 520 | - | 518 | + |
| 521 | try { | 519 | try { |
| 522 | user = SecurityUtils.getLoginUser().getUser(); | 520 | user = SecurityUtils.getLoginUser().getUser(); |
| 523 | } catch (Exception e) { | 521 | } catch (Exception e) { |
| 524 | -// e.printStackTrace(); | 522 | + // e.printStackTrace(); |
| 525 | } | 523 | } |
| 526 | - | ||
| 527 | - | ||
| 528 | - | ||
| 529 | - | 524 | + |
| 530 | SecurityContextImpl securityContextImpl = new SecurityContextImpl(); | 525 | SecurityContextImpl securityContextImpl = new SecurityContextImpl(); |
| 531 | 526 | ||
| 532 | securityContextImpl.setAuthentication(SecurityContextHolder.getContext().getAuthentication()); | 527 | securityContextImpl.setAuthentication(SecurityContextHolder.getContext().getAuthentication()); |
| @@ -534,11 +529,11 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -534,11 +529,11 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 534 | String title = "ๆกๅทๅท:" + caseFile.getNumber(); | 529 | String title = "ๆกๅทๅท:" + caseFile.getNumber(); |
| 535 | String flowType = "violation_warning"; | 530 | String flowType = "violation_warning"; |
| 536 | 531 | ||
| 537 | - if(index > 0 && caseFile.getOwningRegion().contains("ๆนๆฑๆฐๅบ")){ | 532 | + if (index > 0 && caseFile.getOwningRegion().contains("ๆนๆฑๆฐๅบ")) { |
| 538 | index += 3; | 533 | index += 3; |
| 539 | } | 534 | } |
| 540 | ActWorkflowFormData awf = null; | 535 | ActWorkflowFormData awf = null; |
| 541 | - | 536 | + |
| 542 | try { | 537 | try { |
| 543 | Map map = new HashedMap<>(); | 538 | Map map = new HashedMap<>(); |
| 544 | 539 | ||
| @@ -569,13 +564,12 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -569,13 +564,12 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 569 | workflow.setInstanceId(instance.getId()); | 564 | workflow.setInstanceId(instance.getId()); |
| 570 | workflow.setState("0"); | 565 | workflow.setState("0"); |
| 571 | workflow.setCreateTime(new Date()); | 566 | workflow.setCreateTime(new Date()); |
| 572 | - | ||
| 573 | 567 | ||
| 574 | - awf = insertAwf(user,workflow); | 568 | + awf = insertAwf(user, workflow); |
| 575 | 569 | ||
| 576 | return workflowMapper.insertWorkflow(workflow); | 570 | return workflowMapper.insertWorkflow(workflow); |
| 577 | } catch (Exception e) { | 571 | } catch (Exception e) { |
| 578 | - if(awf.getId() != null) | 572 | + if (awf.getId() != null) |
| 579 | awfServer.deleteActWorkflowFormDataById(awf.getId()); | 573 | awfServer.deleteActWorkflowFormDataById(awf.getId()); |
| 580 | runtimeService.deleteProcessInstance(instance.getId(), "ๅๅปบๅคฑ่ดฅ"); | 574 | runtimeService.deleteProcessInstance(instance.getId(), "ๅๅปบๅคฑ่ดฅ"); |
| 581 | throw new RuntimeException(e); | 575 | throw new RuntimeException(e); |
| @@ -591,10 +585,46 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -591,10 +585,46 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 591 | try { | 585 | try { |
| 592 | 586 | ||
| 593 | String title = "ๆกๅทๅท:" + caseOffline.getNumber(); | 587 | String title = "ๆกๅทๅท:" + caseOffline.getNumber(); |
| 588 | + int index = 0; | ||
| 589 | + | ||
| 590 | + List<SysDictData> caseType = SpringUtils.getBean(ISysDictTypeService.class) | ||
| 591 | + .selectDictDataByType("case_offline_type"); | ||
| 592 | + | ||
| 593 | + for (SysDictData d : caseType) { | ||
| 594 | + if (caseOffline.getType().equals(d.getDictValue())) { | ||
| 595 | + if (d.getRemark() != null) { | ||
| 596 | + index = 1; | ||
| 597 | + } | ||
| 598 | + break; | ||
| 599 | + } | ||
| 600 | + } | ||
| 601 | + | ||
| 602 | + if(index == 0){ | ||
| 603 | + JSONArray array = RemoteServerUtils.getAreas(); | ||
| 604 | + String placeName = ""; | ||
| 605 | + String placeCode = caseOffline.getPlace(); | ||
| 606 | + | ||
| 607 | + for (Object obj : array) { | ||
| 608 | + if (((JSONObject) (obj)).getString("code").equals(placeCode)) { | ||
| 609 | + placeName = ((JSONObject) (obj)).getString("name"); | ||
| 610 | + if ("ๆนๆฑๆฐๅบ".equals(placeName)) { | ||
| 611 | + index = 3; | ||
| 612 | + } | ||
| 613 | + | ||
| 614 | + break; | ||
| 615 | + } | ||
| 616 | + } | ||
| 617 | + | ||
| 618 | + if (tcdOutArea.indexOf(placeName) > -1) { | ||
| 619 | + index = 2; | ||
| 620 | + } | ||
| 621 | + } | ||
| 622 | + | ||
| 594 | 623 | ||
| 595 | processInstance = processRuntime | 624 | processInstance = processRuntime |
| 596 | .start(ProcessPayloadBuilder.start().withProcessDefinitionKey("workflow_caseoffline") | 625 | .start(ProcessPayloadBuilder.start().withProcessDefinitionKey("workflow_caseoffline") |
| 597 | - .withName(title).withBusinessKey("workflow_caseoffline:" + caseOffline.getId()).build()); | 626 | + .withName(title).withBusinessKey("workflow_caseoffline:" + caseOffline.getId()) |
| 627 | + .withVariable("route", index).build()); | ||
| 598 | 628 | ||
| 599 | PorcThreeStepTask(processInstance, caseOffline.getPlace()); | 629 | PorcThreeStepTask(processInstance, caseOffline.getPlace()); |
| 600 | 630 | ||
| @@ -610,20 +640,18 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -610,20 +640,18 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 610 | workflow.setCreateTime(new Date()); | 640 | workflow.setCreateTime(new Date()); |
| 611 | 641 | ||
| 612 | SysUser user = null; | 642 | SysUser user = null; |
| 613 | - | 643 | + |
| 614 | try { | 644 | try { |
| 615 | user = SecurityUtils.getLoginUser().getUser(); | 645 | user = SecurityUtils.getLoginUser().getUser(); |
| 616 | } catch (Exception e) { | 646 | } catch (Exception e) { |
| 617 | -// e.printStackTrace(); | 647 | + // e.printStackTrace(); |
| 618 | } | 648 | } |
| 619 | - | ||
| 620 | 649 | ||
| 621 | - awf = insertAwf(user,workflow); | 650 | + awf = insertAwf(user, workflow); |
| 622 | 651 | ||
| 623 | - | ||
| 624 | return workflowMapper.insertWorkflow(workflow); | 652 | return workflowMapper.insertWorkflow(workflow); |
| 625 | } catch (Exception e) { | 653 | } catch (Exception e) { |
| 626 | - if(awf.getId() != null) | 654 | + if (awf.getId() != null) |
| 627 | awfServer.deleteActWorkflowFormDataById(awf.getId()); | 655 | awfServer.deleteActWorkflowFormDataById(awf.getId()); |
| 628 | e.printStackTrace(); | 656 | e.printStackTrace(); |
| 629 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); | 657 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); |
| @@ -633,36 +661,35 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -633,36 +661,35 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 633 | } | 661 | } |
| 634 | 662 | ||
| 635 | private void updateProcess(ProcessInstance processInstance, String owningRegion) { | 663 | private void updateProcess(ProcessInstance processInstance, String owningRegion) { |
| 636 | - | ||
| 637 | - JSONArray array = RemoteServerUtils.getAreas(); | ||
| 638 | 664 | ||
| 665 | + JSONArray array = RemoteServerUtils.getAreas(); | ||
| 639 | 666 | ||
| 640 | - String placeCode = null; | 667 | + String placeCode = null; |
| 641 | 668 | ||
| 642 | - for (Object obj : array) { | ||
| 643 | - if (((JSONObject) (obj)).getString("name").equals(owningRegion)) { | 669 | + for (Object obj : array) { |
| 670 | + if (((JSONObject) (obj)).getString("name").equals(owningRegion)) { | ||
| 644 | 671 | ||
| 645 | - placeCode = ((JSONObject) (obj)).getString("code"); | 672 | + placeCode = ((JSONObject) (obj)).getString("code"); |
| 673 | + | ||
| 674 | + break; | ||
| 675 | + } | ||
| 676 | + } | ||
| 677 | + | ||
| 678 | + if (placeCode != null) { | ||
| 679 | + PorcThreeStepTask(processInstance, placeCode); | ||
| 680 | + } | ||
| 646 | 681 | ||
| 647 | - break; | ||
| 648 | - } | ||
| 649 | - } | ||
| 650 | - | ||
| 651 | - if(placeCode != null){ | ||
| 652 | - PorcThreeStepTask(processInstance,placeCode); | ||
| 653 | - } | ||
| 654 | - | ||
| 655 | } | 682 | } |
| 656 | - | 683 | + |
| 657 | public void PorcThreeStepTask(ProcessInstance processInstance, String areaCode) { | 684 | public void PorcThreeStepTask(ProcessInstance processInstance, String areaCode) { |
| 658 | Map map = new HashedMap<>(); | 685 | Map map = new HashedMap<>(); |
| 659 | 686 | ||
| 660 | map.put("type", "CSUserDepartmentType"); | 687 | map.put("type", "CSUserDepartmentType"); |
| 661 | 688 | ||
| 662 | Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); | 689 | Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); |
| 663 | - | 690 | + |
| 664 | List<IdentityLink> list = taskService.getIdentityLinksForTask(task.getId()); | 691 | List<IdentityLink> list = taskService.getIdentityLinksForTask(task.getId()); |
| 665 | - | 692 | + |
| 666 | if (list.size() == 1) { | 693 | if (list.size() == 1) { |
| 667 | taskService.addCandidateUser(task.getId(), areaCode); | 694 | taskService.addCandidateUser(task.getId(), areaCode); |
| 668 | } | 695 | } |
| @@ -672,23 +699,20 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -672,23 +699,20 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 672 | taskService.saveTask(task); | 699 | taskService.saveTask(task); |
| 673 | } | 700 | } |
| 674 | 701 | ||
| 675 | - | ||
| 676 | void updateProcessKafka(org.activiti.engine.runtime.ProcessInstance processInstance, String placeName, | 702 | void updateProcessKafka(org.activiti.engine.runtime.ProcessInstance processInstance, String placeName, |
| 677 | String token) { | 703 | String token) { |
| 678 | - JSONArray array = RemoteServerUtils.getAreas(trashConfig.getToken()); | ||
| 679 | - | 704 | + JSONArray array = RemoteServerUtils.getAreas(trashConfig.getToken()); |
| 680 | 705 | ||
| 681 | - String placeCode = null; | 706 | + String placeCode = null; |
| 682 | 707 | ||
| 683 | - for (Object obj : array) { | ||
| 684 | - if (((JSONObject) (obj)).getString("name").equals(placeName)) { | 708 | + for (Object obj : array) { |
| 709 | + if (((JSONObject) (obj)).getString("name").equals(placeName)) { | ||
| 685 | 710 | ||
| 686 | - placeCode = ((JSONObject) (obj)).getString("code"); | 711 | + placeCode = ((JSONObject) (obj)).getString("code"); |
| 687 | 712 | ||
| 688 | - break; | ||
| 689 | - } | ||
| 690 | - } | ||
| 691 | - | 713 | + break; |
| 714 | + } | ||
| 715 | + } | ||
| 692 | 716 | ||
| 693 | if (placeCode != null) { | 717 | if (placeCode != null) { |
| 694 | Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); | 718 | Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); |
trash-workFlow/src/main/resources/mapper/caseOffline/CaseOfflineMapper.xml
| @@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 25 | <result property="advice3Time" column="advice3_time" /> | 25 | <result property="advice3Time" column="advice3_time" /> |
| 26 | <result property="advice4Time" column="advice4_time" /> | 26 | <result property="advice4Time" column="advice4_time" /> |
| 27 | <result property="attach" column="attach" /> | 27 | <result property="attach" column="attach" /> |
| 28 | + <result property="status1" column="status1" /> | ||
| 28 | </resultMap> | 29 | </resultMap> |
| 29 | 30 | ||
| 30 | <sql id="selectCaseOfflineVo"> | 31 | <sql id="selectCaseOfflineVo"> |
| @@ -32,9 +33,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -32,9 +33,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 32 | </sql> | 33 | </sql> |
| 33 | 34 | ||
| 34 | <select id="selectCaseOfflineList" parameterType="CaseOffline" resultMap="CaseOfflineResult"> | 35 | <select id="selectCaseOfflineList" parameterType="CaseOffline" resultMap="CaseOfflineResult"> |
| 35 | - <include refid="selectCaseOfflineVo"/> | 36 | + select a.*,c.status1 from case_offline a |
| 37 | + left join (select a.table_name,count(*) status1 from | ||
| 38 | + (select * from reply_approval_process b where table_name like "%workflow_caseoffline%" GROUP BY b.table_name,b.reply_people) a | ||
| 39 | + group by a.table_name) c | ||
| 40 | + on CONCAT("workflow_caseoffline:",a.id) = c.table_name | ||
| 36 | <where> | 41 | <where> |
| 37 | - <if test="status1 != null "> ${status1}</if> | 42 | + <if test="status1 != null ">${status1}</if> |
| 38 | <if test="type != null and type != ''"> and type = #{type}</if> | 43 | <if test="type != null and type != ''"> and type = #{type}</if> |
| 39 | <if test="place != null and place != ''">and LOCATE(place , #{place}) > 0</if> | 44 | <if test="place != null and place != ''">and LOCATE(place , #{place}) > 0</if> |
| 40 | <if test="startTime != null "> and create_time between #{startTime} and #{endTime}</if> | 45 | <if test="startTime != null "> and create_time between #{startTime} and #{endTime}</if> |