Commit a3662a71 authored by 李成龙's avatar 李成龙

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

# Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/AlertCalledController.java
parents 5c9f6b74 550d0d3c
package com.yeejoin.amos.boot.biz.common.workflow;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.workflow.business.util.HttpUtil;
import com.yeejoin.amos.boot.biz.common.workflow.constants.XJConstant;
import com.yeejoin.amos.boot.biz.common.workflow.enums.WorkFlowUriEnum;
import com.yeejoin.amos.boot.biz.common.workflow.enums.YesOrNoEnum;
@Service("remoteWorkFlowService")
public class RemoteWorkFlowService {
private final Logger logger = LoggerFactory.getLogger(RemoteWorkFlowService.class);
@Value("${params.work.flow.address}")
private String address;
@Value("${params.work.flow.processDefinitionKey}")
private String processDefinitionKey;
private String buildUrl(String address, WorkFlowUriEnum workFlowUriEnum, Map<String, String> map) {
String uri = workFlowUriEnum.getUri();
String params = workFlowUriEnum.getParams();
if (!StringUtils.isEmpty(params) && map != null) {
String[] paramsArr = params.split(",");
for (String param : paramsArr) {
uri = uri.replace("{" + param + "}", map.get(param));
}
}
return address + uri;
}
private JSONObject handleResult(String resultStr) {
if (resultStr == null) {
return null;
}
JSONObject json = JSON.parseObject(resultStr);
if ("200".equals(json.getString("code"))) {
return json;
}
return null;
}
public JSONObject start(String businessKey, String processDefinitionKey) {
String url = buildUrl(address, WorkFlowUriEnum.启动流程, null);
JSONObject body = new JSONObject();
body.put("businessKey", businessKey);
body.put("processDefinitionKey", processDefinitionKey);
String resultStr = HttpUtil.sendHttpPostJson(url, body.toJSONString());
return handleResult(resultStr);
}
public JSONObject getChildNodeDetail(String instanceId) {
Map<String, String> map = Maps.newHashMap();
map.put("instanceId", instanceId);
String url = buildUrl(address, WorkFlowUriEnum.子节点信息, map);
Map<String, String> headerMap = Maps.newHashMap();
headerMap.put(XJConstant.TOKEN_KEY, RequestContext.getToken());
headerMap.put(XJConstant.PRODUCT, RequestContext.getProduct());
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
logger.info("\r\n请求路径=======================>" + url + "\r\n请求参数=======================>" + instanceId + "\r\n返回参数=======================>" + resultStr);
return handleResult(resultStr);
}
public JSONObject start(Long dangerId, String businessKey, String processDefinitionKey) {
String url = buildUrl(address, WorkFlowUriEnum.启动流程, null);
Map<String, String> headerMap = Maps.newHashMap();
headerMap.put(XJConstant.TOKEN_KEY, RequestContext.getToken());
headerMap.put(XJConstant.PRODUCT, RequestContext.getProduct());
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
JSONObject body = new JSONObject();
body.put("businessKey", businessKey);
body.put("processDefinitionKey", processDefinitionKey);
JSONArray variables = new JSONArray();
// JSONObject companyJson = new JSONObject();
// companyJson.put("name", "companyId");
// companyJson.put("value", companyId);
// JSONObject departmentJson = new JSONObject();
// departmentJson.put("name", "departmentId");
// departmentJson.put("value", departmentId);
JSONObject dangerIdJson = new JSONObject();
// dangerIdJson.put("name", "dangerId");
dangerIdJson.put("dangerId", dangerId);
// variables.add(companyJson);
// variables.add(departmentJson);
// variables.add(dangerIdJson);
// body.put("variables", variables);
// String requestBody = body.toJSONString();
body.put("variables", dangerIdJson);
String resultStr = HttpUtil.sendHttpPostJsonWithHeader(url, body.toJSONString(), headerMap);
logger.info("\r\n请求路径=======================>" + url + "\r\n请求参数=======================>" + body + "\r\n返回参数=======================>" + resultStr);
return JSON.parseObject(resultStr);
}
public JSONObject startWithAppKey(JSONObject body) {
Map<String, String> map = Maps.newHashMap();
map.put(XJConstant.TOKEN_KEY, RequestContext.getToken());
map.put(XJConstant.PRODUCT, RequestContext.getProduct());
map.put(XJConstant.APPKEY, RequestContext.getAppKey());
String url = buildUrl(address, WorkFlowUriEnum.启动免登录流程, map);
String requestBody = body.toJSONString();
String resultStr = HttpUtil.sendHttpPostJson(url, requestBody);
logger.info("\r\n请求路径=======================>" + url + "\r\n请求参数=======================>" + requestBody + "\r\n返回参数=======================>" + resultStr);
return handleResult(resultStr);
}
public JSONObject startNew(Long dangerId, String businessKey, String processDefinitionKey) {
String url = buildUrl(address, WorkFlowUriEnum.合并启动流程, null);
Map<String, String> headerMap = Maps.newHashMap();
headerMap.put(XJConstant.TOKEN_KEY, RequestContext.getToken());
headerMap.put(XJConstant.PRODUCT, RequestContext.getProduct());
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
JSONObject body = new JSONObject();
body.put("businessKey", businessKey);
body.put("processDefinitionKey", processDefinitionKey);
JSONObject dangerIdJson = new JSONObject();
dangerIdJson.put("dangerId", dangerId);
body.put("variables", dangerIdJson);
String resultStr = HttpUtil.sendHttpPostJsonWithHeader(url, body.toJSONString(), headerMap);
logger.info("\r\n请求路径=======================>" + url + "\r\n请求参数=======================>" + body + "\r\n返回参数=======================>" + resultStr);
return JSON.parseObject(resultStr);
}
// public JSONObject stop(String processInstanceId, String deleteReason) {
// Map<String, String> map = Maps.newHashMap();
// map.put("deleteReason", deleteReason);
// map.put("processInstanceId", processInstanceId);
// String url = buildUrl(address, WorkFlowUriEnum.终止流程, map);
// String resultStr = HttpUtil.sendHttpDelete(url);
// JSONObject json = handleResult(resultStr);
// logger.info("\r\n终止流程请求路径=======================>" + url + "\r\n终止流程返回参数=======================>" + resultStr);
// return json;
// }
public JSONObject stop(String processInstanceId) {
Map<String, String> map = Maps.newHashMap();
// map.put("deleteReason", deleteReason);
map.put("processInstanceId", processInstanceId);
Map<String, String> headerMap = Maps.newHashMap();
headerMap.put(XJConstant.TOKEN_KEY, RequestContext.getToken());
headerMap.put(XJConstant.PRODUCT, RequestContext.getProduct());
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String url = buildUrl(address, WorkFlowUriEnum.终止流程, map);
String resultStr = HttpUtil.sendHttpDeleteWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
return json;
}
// public JSONObject excute(String taskId, String requestBody) {
// Map<String, String> map = Maps.newHashMap();
// map.put("taskId", taskId);
// String url = buildUrl(address, WorkFlowUriEnum.执行流程, map);
// String resultStr = HttpUtil.sendHttpPostJson(url, requestBody);
// JSONObject json = handleResult(resultStr);
// logger.info("\r\n执行任务请求路径=======================>" + url + "\r\n执行任务请求参数=======================>" + requestBody + "\r\n执行任务返回参数=======================>" + resultStr);
// return json;
// }
public JSONObject excute(String taskId, String requestBody) {
Map<String, String> map = Maps.newHashMap();
map.put("taskId", taskId);
Map<String, String> headerMap = Maps.newHashMap();
headerMap.put(XJConstant.TOKEN_KEY, RequestContext.getToken());
headerMap.put(XJConstant.PRODUCT, RequestContext.getProduct());
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String url = buildUrl(address, WorkFlowUriEnum.执行流程, map);
String resultStr = HttpUtil.sendHttpPostJsonWithHeader(url, requestBody, headerMap);
JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n请求参数=======================>" + requestBody + "\r\n返回参数=======================>" + resultStr);
return json;
}
public JSONObject currentTask(String instanceId) {
Map<String, String> map = Maps.newHashMap();
map.put("processInstanceId", instanceId);
String url = buildUrl(address, WorkFlowUriEnum.当前节点, map);
String resultStr = HttpUtil.sendHttpGet(url);
JSONObject json = handleResult(resultStr);
logger.info("\r\n当前任务请求路径=======================>" + url + "\r\n当前任务返回参数=======================>" + resultStr);
if (json == null) {
return null;
}
JSONArray reviewContent = json.getJSONObject("dataList").getJSONArray("content");
if (reviewContent != null && reviewContent.size() > 0) {
return reviewContent.getJSONObject(0);
}
return null;
}
public JSONObject allTasksInProcessInstanceId(String instanceId) {
Map<String, String> map = Maps.newHashMap();
map.put("processInstanceId", instanceId);
String url = buildUrl(address, WorkFlowUriEnum.工作流流水, map);
Map<String, String> headerMap = Maps.newHashMap();
headerMap.put(XJConstant.TOKEN_KEY, RequestContext.getToken());
headerMap.put(XJConstant.PRODUCT, RequestContext.getProduct());
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
if (json == null) {
return null;
}
JSONArray allContent = json.getJSONArray("dataList");
if (allContent != null && allContent.size() > 0) {
return allContent.getJSONObject(allContent.size() - 1);
}
return null;
}
public JSONObject pageTask(String userId,Integer BelongType) {
Map<String, String> map = Maps.newHashMap();
String url = "";
map.put("processDefinitionKey", processDefinitionKey);
if(Integer.parseInt(YesOrNoEnum.YES.getCode())==BelongType){
map.put("userId", userId);
url = buildUrl(address, WorkFlowUriEnum.我的代办有ID, map);
}else{
url = buildUrl(address, WorkFlowUriEnum.我的代办, map);
}
Map<String, String> headerMap = Maps.newHashMap();
headerMap.put(XJConstant.TOKEN_KEY, RequestContext.getToken());
headerMap.put(XJConstant.PRODUCT, RequestContext.getProduct());
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
return json;
}
public JSONObject completedPageTask(String userId,Integer BelongType) {
Map<String, String> map = Maps.newHashMap();
String url = "";
map.put("processDefinitionKey", processDefinitionKey);
if(Integer.parseInt(YesOrNoEnum.YES.getCode())==BelongType){
map.put("userId", userId);
url = buildUrl(address, WorkFlowUriEnum.已执行任务有ID, map);
}else{
url = buildUrl(address, WorkFlowUriEnum.已执行任务, map);
}
Map<String, String> headerMap = Maps.newHashMap();
headerMap.put(XJConstant.TOKEN_KEY, RequestContext.getToken());
headerMap.put(XJConstant.PRODUCT, RequestContext.getProduct());
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
return json;
}
public JSONObject queryTask(String id) {
Map<String, String> map = Maps.newHashMap();
map.put("processInstanceId", id);
String url = buildUrl(address, WorkFlowUriEnum.流程任务, map);
Map<String, String> headerMap = Maps.newHashMap();
headerMap.put(XJConstant.TOKEN_KEY, RequestContext.getToken());
headerMap.put(XJConstant.PRODUCT, RequestContext.getProduct());
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
return json;
}
public JSONObject queryTaskDetail(String taskId) {
Map<String, String> map = Maps.newHashMap();
map.put("taskId", taskId);
String url = buildUrl(address, WorkFlowUriEnum.流程详情, map);
Map<String, String> headerMap = Maps.newHashMap();
headerMap.put(XJConstant.TOKEN_KEY, RequestContext.getToken());
headerMap.put(XJConstant.PRODUCT, RequestContext.getProduct());
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
return json;
}
public JSONObject queryFinishTaskDetail(String taskId) {
Map<String, String> map = Maps.newHashMap();
map.put("taskId", taskId);
String url = buildUrl(address, WorkFlowUriEnum.所有已执行任务详情, map);
Map<String, String> headerMap = Maps.newHashMap();
headerMap.put(XJConstant.TOKEN_KEY, RequestContext.getToken());
headerMap.put(XJConstant.PRODUCT, RequestContext.getProduct());
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
return json;
}
public JSONObject queryFinishTaskDetailByInstanceId(String InstanceId) {
Map<String, String> map = Maps.newHashMap();
map.put("processInstanceId", InstanceId);
String url = buildUrl(address, WorkFlowUriEnum.所有已执行任务集合, map);
Map<String, String> headerMap = Maps.newHashMap();
headerMap.put(XJConstant.TOKEN_KEY, RequestContext.getToken());
headerMap.put(XJConstant.PRODUCT, RequestContext.getProduct());
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
return json;
}
}
package com.yeejoin.amos.boot.biz.common.workflow.business.util;
import org.apache.http.HttpEntity;
import org.apache.http.HttpStatus;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.config.Registry;
import org.apache.http.config.RegistryBuilder;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.ssl.SSLContextBuilder;
import org.apache.http.util.EntityUtils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Iterator;
import java.util.Map;
public class HttpUtil {
// utf-8字符编码
private static final String CHARSET_UTF_8 = "utf-8";
// HTTP内容类型。
private static final String CONTENT_TYPE_TEXT_HTML = "text/xml";
// HTTP内容类型。相当于form表单的形式,提交数据
private static final String CONTENT_TYPE_FORM_URL = "application/x-www-form-urlencoded";
// HTTP内容类型。相当于form表单的形式,提交数据
private static final String CONTENT_TYPE_JSON_URL = "application/json;charset=utf-8";
// 连接管理器
private static PoolingHttpClientConnectionManager pool;
// 请求配置
private static RequestConfig requestConfig;
static {
try {
//System.out.println("初始化HttpClientTest~~~开始");
SSLContextBuilder builder = new SSLContextBuilder();
builder.loadTrustMaterial(null, new TrustSelfSignedStrategy());
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
builder.build());
// 配置同时支持 HTTP 和 HTPPS
Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create().register(
"http", PlainConnectionSocketFactory.getSocketFactory()).register(
"https", sslsf).build();
// 初始化连接管理器
pool = new PoolingHttpClientConnectionManager(
socketFactoryRegistry);
// 将最大连接数增加到200,实际项目最好从配置文件中读取这个值
pool.setMaxTotal(200);
// 设置最大路由
pool.setDefaultMaxPerRoute(2);
// 根据默认超时限制初始化requestConfig
int socketTimeout = 10000;
int connectTimeout = 10000;
int connectionRequestTimeout = 10000;
requestConfig = RequestConfig.custom().setConnectionRequestTimeout(
connectionRequestTimeout).setSocketTimeout(socketTimeout).setConnectTimeout(
connectTimeout).build();
//System.out.println("初始化HttpClientTest~~~结束");
} catch (Exception e) {
e.printStackTrace();
}
// 设置请求超时时间
requestConfig = RequestConfig.custom().setSocketTimeout(50000).setConnectTimeout(50000)
.setConnectionRequestTimeout(50000).build();
}
private static CloseableHttpClient getHttpClient() {
return HttpClients.custom()
// 设置连接池管理
.setConnectionManager(pool)
// 设置请求配置
.setDefaultRequestConfig(requestConfig)
// 设置重试次数
.setRetryHandler(new DefaultHttpRequestRetryHandler(0, false))
.build();
}
/**
* 发送Post请求
*/
private static String sendHttpPost(HttpPost httpPost) {
CloseableHttpClient httpClient = null;
CloseableHttpResponse response = null;
// 响应内容
String responseContent = null;
try {
// 创建默认的httpClient实例.
httpClient = getHttpClient();
// 配置请求信息
httpPost.setConfig(requestConfig);
// 执行请求
response = httpClient.execute(httpPost);
// 得到响应实例
HttpEntity entity = response.getEntity();
// 可以获得响应头
// Header[] headers = response.getHeaders(HttpHeaders.CONTENT_TYPE);
// for (Header header : headers) {
// System.out.println(header.getName());
// }
// 得到响应类型
// System.out.println(ContentType.getOrDefault(response.getEntity()).getMimeType());
// 判断响应状态
if (response.getStatusLine().getStatusCode() >= 300) {
throw new Exception(
"HTTP Request is not success, Response code is " + response.getStatusLine().getStatusCode());
}
if (HttpStatus.SC_OK == response.getStatusLine().getStatusCode() || HttpStatus.SC_CREATED == response.getStatusLine().getStatusCode()) {
responseContent = EntityUtils.toString(entity, CHARSET_UTF_8);
EntityUtils.consume(entity);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
// 释放资源
if (response != null) {
response.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return responseContent;
}
/**
* 发送Post请求
*
* @param httpPut
* @return
*/
private static String sendHttpPut(HttpPut httpPut) {
CloseableHttpClient httpClient = null;
CloseableHttpResponse response = null;
// 响应内容
String responseContent = null;
try {
// 创建默认的httpClient实例.
httpClient = getHttpClient();
// 配置请求信息
httpPut.setConfig(requestConfig);
// 执行请求
response = httpClient.execute(httpPut);
// 得到响应实例
HttpEntity entity = response.getEntity();
// 可以获得响应头
// Header[] headers = response.getHeaders(HttpHeaders.CONTENT_TYPE);
// for (Header header : headers) {
// System.out.println(header.getName());
// }
// 得到响应类型
// System.out.println(ContentType.getOrDefault(response.getEntity()).getMimeType());
// 判断响应状态
if (response.getStatusLine().getStatusCode() >= 300) {
throw new Exception(
"HTTP Request is not success, Response code is " + response.getStatusLine().getStatusCode());
}
if (HttpStatus.SC_OK == response.getStatusLine().getStatusCode() || HttpStatus.SC_CREATED == response.getStatusLine().getStatusCode()) {
responseContent = EntityUtils.toString(entity, CHARSET_UTF_8);
EntityUtils.consume(entity);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
// 释放资源
if (response != null) {
response.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return responseContent;
}
/**
* 发送Post请求
*
* @param httpDelete
* @return
*/
private static String sendHttpDelete(HttpDelete httpDelete) {
CloseableHttpClient httpClient = null;
CloseableHttpResponse response = null;
// 响应内容
String responseContent = null;
try {
// 创建默认的httpClient实例.
httpClient = getHttpClient();
// 配置请求信息
httpDelete.setConfig(requestConfig);
// 执行请求
response = httpClient.execute(httpDelete);
// 得到响应实例
HttpEntity entity = response.getEntity();
// 可以获得响应头
// Header[] headers = response.getHeaders(HttpHeaders.CONTENT_TYPE);
// for (Header header : headers) {
// System.out.println(header.getName());
// }
// 得到响应类型
// System.out.println(ContentType.getOrDefault(response.getEntity()).getMimeType());
// 判断响应状态
if (response.getStatusLine().getStatusCode() >= 300) {
throw new Exception(
"HTTP Request is not success, Response code is " + response.getStatusLine().getStatusCode());
}
if (HttpStatus.SC_OK == response.getStatusLine().getStatusCode() || HttpStatus.SC_CREATED == response.getStatusLine().getStatusCode()) {
responseContent = EntityUtils.toString(entity, CHARSET_UTF_8);
EntityUtils.consume(entity);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
// 释放资源
if (response != null) {
response.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return responseContent;
}
/**
* 发送Get请求
*
* @param httpGet
* @return
*/
private static String sendHttpGet(HttpGet httpGet) {
CloseableHttpClient httpClient = null;
CloseableHttpResponse response = null;
// 响应内容
String responseContent = null;
try {
// 创建默认的httpClient实例.
httpClient = getHttpClient();
// 配置请求信息
httpGet.setConfig(requestConfig);
// 执行请求
response = httpClient.execute(httpGet);
// 得到响应实例
HttpEntity entity = response.getEntity();
// 可以获得响应头
// Header[] headers = response.getHeaders(HttpHeaders.CONTENT_TYPE);
// for (Header header : headers) {
// System.out.println(header.getName());
// }
// 得到响应类型
// System.out.println(ContentType.getOrDefault(response.getEntity()).getMimeType());
// 判断响应状态
if (response.getStatusLine().getStatusCode() >= 300) {
throw new Exception(
"HTTP Request is not success, Response code is " + response.getStatusLine().getStatusCode());
}
if (HttpStatus.SC_OK == response.getStatusLine().getStatusCode()) {
responseContent = EntityUtils.toString(entity, CHARSET_UTF_8);
EntityUtils.consume(entity);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
// 释放资源
if (response != null) {
response.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return responseContent;
}
/**
* 发送 post请求
*
* @param httpUrl 地址
*/
public static String sendHttpPost(String httpUrl) {
// 创建httpPost
HttpPost httpPost = new HttpPost(httpUrl);
return sendHttpPost(httpPost);
}
/**
* 发送 delete请求
*
* @param httpUrl 地址
*/
public static String sendHttpDelete(String httpUrl) {
// 创建httpPost
HttpDelete httpDelete = new HttpDelete(httpUrl);
return sendHttpDelete(httpDelete);
}
/**
* 发送 post请求
*
* @param httpUrl 地址
*/
public static String sendHttpPostWithHeader(String httpUrl, Map<String, String> headerMap) {
// 创建httpPost
HttpPost httpPost = new HttpPost(httpUrl);
for (Map.Entry<String, String> entry : headerMap.entrySet()) {
httpPost.setHeader(entry.getKey(), entry.getValue());
}
return sendHttpPost(httpPost);
}
/**
* 发送 get请求
*
* @param httpUrl
*/
public static String sendHttpGet(String httpUrl) {
// 创建get请求
HttpGet httpGet = new HttpGet(httpUrl);
return sendHttpGet(httpGet);
}
/**
* 发送 delete请求带请求头
*/
public static String sendHttpDeleteWithHeader(String httpUrl, Map<String, String> headerMap) {
// 创建get请求
HttpDelete httpDelete = new HttpDelete(httpUrl);
for (Map.Entry<String, String> entry : headerMap.entrySet()) {
httpDelete.setHeader(entry.getKey(), entry.getValue());
}
return sendHttpDelete(httpDelete);
}
/**
* 发送 get请求带请求头
*/
public static String sendHttpGetWithHeader(String httpUrl, Map<String, String> headerMap) {
// 创建get请求
HttpGet httpGet = new HttpGet(httpUrl);
for (Map.Entry<String, String> entry : headerMap.entrySet()) {
httpGet.setHeader(entry.getKey(), entry.getValue());
}
return sendHttpGet(httpGet);
}
/**
* 发送 delete请求带请求头
*/
public static String sendHttpDeleteJsonWithHeader(String httpUrl, String paramsJson, Map<String, String> headerMap) {
StringBuffer content = new StringBuffer();
try {
URL url = new URL(httpUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("DELETE");
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8");
for (Map.Entry<String, String> entry : headerMap.entrySet()) {
connection.setRequestProperty(entry.getKey(), entry.getValue());
}
PrintWriter printWriter = new PrintWriter(connection.getOutputStream());
printWriter.write(paramsJson);
printWriter.flush();
BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
while ((line = br.readLine()) != null) {
content.append(line);
}
br.close();
connection.disconnect();
} catch (Exception e) {
}
return content.toString();
}
/**
* 发送 post请求
*
* @param httpUrl 地址
* @param params 参数(格式:key1=value1&key2=value2)
*/
public static String sendHttpPost(String httpUrl, String params) {
HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost
try {
// 设置参数
if (params != null && params.trim().length() > 0) {
StringEntity stringEntity = new StringEntity(params, "UTF-8");
stringEntity.setContentType(CONTENT_TYPE_FORM_URL);
httpPost.setEntity(stringEntity);
}
} catch (Exception e) {
e.printStackTrace();
}
return sendHttpPost(httpPost);
}
/**
* 发送 post请求
*
* @param maps 参数
*/
public static String sendHttpPost(String httpUrl, Map<String, String> maps) {
String parem = convertStringParamter(maps);
return sendHttpPost(httpUrl, parem);
}
/**
* 发送 post请求 发送json数据
*
* @param httpUrl 地址
* @param paramsJson 参数(格式 json)
*/
public static String sendHttpPostJsonWithHeader(String httpUrl, String paramsJson, Map<String, String> headerMap) {
HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost
try {
for (Map.Entry<String, String> entry : headerMap.entrySet()) {
httpPost.setHeader(entry.getKey(), entry.getValue());
}
// 设置参数
if (paramsJson != null && paramsJson.trim().length() > 0) {
StringEntity stringEntity = new StringEntity(paramsJson, "UTF-8");
stringEntity.setContentType(CONTENT_TYPE_JSON_URL);
httpPost.setEntity(stringEntity);
}
} catch (Exception e) {
e.printStackTrace();
}
return sendHttpPost(httpPost);
}
/**
* 发送 put请求 发送json数据
*
* @param httpUrl 地址
* @param paramsJson 参数(格式 json)
*/
public static String sendHttpPutJsonWithHeader(String httpUrl, String paramsJson, Map<String, String> headerMap) {
HttpPut httpPost = new HttpPut(httpUrl);// 创建HttpPut
try {
for (Map.Entry<String, String> entry : headerMap.entrySet()) {
httpPost.setHeader(entry.getKey(), entry.getValue());
}
// 设置参数
if (paramsJson != null && paramsJson.trim().length() > 0) {
StringEntity stringEntity = new StringEntity(paramsJson, "UTF-8");
stringEntity.setContentType(CONTENT_TYPE_JSON_URL);
httpPost.setEntity(stringEntity);
}
} catch (Exception e) {
e.printStackTrace();
}
return sendHttpPut(httpPost);
}
/**
* 发送 post请求 发送json数据
*
* @param httpUrl 地址
* @param paramsJson 参数(格式 json)
*/
public static String sendHttpPostJson(String httpUrl, String paramsJson) {
HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost
try {
// 设置参数
if (paramsJson != null && paramsJson.trim().length() > 0) {
StringEntity stringEntity = new StringEntity(paramsJson, "UTF-8");
stringEntity.setContentType(CONTENT_TYPE_JSON_URL);
httpPost.setEntity(stringEntity);
}
} catch (Exception e) {
e.printStackTrace();
}
return sendHttpPost(httpPost);
}
/**
* 发送 post请求 发送xml数据
*
* @param httpUrl 地址
* @param paramsXml 参数(格式 Xml)
*/
public static String sendHttpPostXml(String httpUrl, String paramsXml) {
HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost
try {
// 设置参数
if (paramsXml != null && paramsXml.trim().length() > 0) {
StringEntity stringEntity = new StringEntity(paramsXml, "UTF-8");
stringEntity.setContentType(CONTENT_TYPE_TEXT_HTML);
httpPost.setEntity(stringEntity);
}
} catch (Exception e) {
e.printStackTrace();
}
return sendHttpPost(httpPost);
}
/**
* 将map集合的键值对转化成:key1=value1&key2=value2 的形式
*
* @param parameterMap 需要转化的键值对集合
* @return 字符串
*/
private static String convertStringParamter(Map parameterMap) {
StringBuffer parameterBuffer = new StringBuffer();
if (parameterMap != null) {
Iterator iterator = parameterMap.keySet().iterator();
String key = null;
String value = null;
while (iterator.hasNext()) {
key = (String) iterator.next();
if (parameterMap.get(key) != null) {
value = (String) parameterMap.get(key);
} else {
value = "";
}
parameterBuffer.append(key).append("=").append(value);
if (iterator.hasNext()) {
parameterBuffer.append("&");
}
}
}
return parameterBuffer.toString();
}
}
\ No newline at end of file
/**
*
*/
package com.yeejoin.amos.boot.biz.common.workflow.constants;
import org.slf4j.LoggerFactory;
import java.text.SimpleDateFormat;
/**
* 常量
*/
public class XJConstant {
public static final String ROOT_PATH = "F:/software/nginx-1.14.2/html/";
public static final String NGINX_ADDRESS = "172.16.3.77:8081/";
public static final String DEFAULT_RISKDESC = "默认";
public static final String JPUSH_USER_KEY ="BANK88";
public static final String CHECK_TYPE = "CHECK_TYPE";
public static final String DEPT_WF_MAP_DIC_CODE = "DEPT_WF_MAP";
/**
* 构造方法
*/
private XJConstant() {
LoggerFactory.getLogger(this.getClass()).debug(XJConstant.CONSTRUCTOR);
}
/**
* 网络服务ip
*/
public static final String NET_SERVER_HOST = "0.0.0.0";
/**
* 请求头key
*/
public static final String TOKEN_KEY = "token";
/**
* 请求头key
*/
public static final String PRODUCT = "product";
/**
* 请求头key
*/
public static final String APPKEY = "appKey";
/**
* 时间格式(yyyy-MM-dd HH:mm:ss)
*/
public static final SimpleDateFormat SIMPLEDATAFORMAT_YMDHMS = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
/**
* 构造方法字符串
*/
public static final String CONSTRUCTOR = "constructor...";
/**
* 轮询job最大线程数
*/
public static final int POLLING_JOB_THREAD_MAX_NUM = 20;
/**
* amos线程池数量
*/
public static final int AMOS_THREAD_NUM = 20;
/**
* 设备测试最大线程数
*/
public static final int TEST_EQUIPMENT_THREAD_MAX_NUM = 5;
/**
* 时间格式字符串:yyyy-MM-dd HH:mm:ss
*/
public static final String DATE_TIME_STR_YMDHMS = "yyyy-MM-dd HH:mm:ss";
/**
* bar
*/
public static final String BAR = "-";
/**
* Underline
*/
public static final String UNDERLINE = "_";
/**
* user
*/
public static final String USER = "user";
/**
* token
*/
public static final String TOKEN = "token";
/**
* loginType
*/
public static final String LOGIN_TYPE = "loginType";
/**
* subGraphId
*/
public static final String SUB_GRAPH_ID = "subGraphId";
public static final String ADMIN_ID = "1";
/**
* 帧报文异常
*/
public static final String FRAME_EXECPTION = "FRAME";
/**
* 性能指标
*/
public static final String METRIC = "METRIC";
/**
* 报文通道
*/
public static final String CHANNEL = "CHANNEL";
/**
* 设备状态(掉线)告警
*/
public static final String EQUIPMENT_STATUS = "EQUIPMENT_STATUS";
/**
* 设备连通性告警告警
*/
public static final String EQUIPMENT_CONNECTION = "EQUIPMENT_CONNECTION";
/**
* 通道注册
*/
public static final String REGISTER = "REGISTER";
/**
* 通道注销
*/
public static final String UNREGISTER = "UNREGISTER";
/**
* 报文正常
*/
public static final String NORMAL = "NORMAL";
/**
* 报文异常
*/
public static final String UNNORMAL = "UNNORMAL";
/**
* 告警socket类型
*/
public static final String ALARM_SOCKET = "ALARM_SOCKET";
/**
* 数据socket类型
*/
public static final String METRIC_SOCKET = "METRIC_SOCKET";
/**
* 数据socket类型
*/
public static final String MORPHIC_SOCKET = "MORPHIC_SOCKET";
/**
* false
*/
public static final Boolean FAIL_BOOLEAN_VALUE = Boolean.FALSE;
/**
* 0
*/
public static final Integer ZERO_INT_VALUE = Integer.parseInt("0");
/**
* -1
*/
public static final Integer FAIL_INT_VALUE = Integer.parseInt("-1");
/**
* -1
*/
public static final Long FAIL_LONG_VALUE = Long.parseLong("-1");
/**
* -1
*/
public static final Short FAIL_SHORT_VALUE = Short.parseShort("-1");
/**
*
*/
public static final Float FAIL_FLOAT_VALUE = Float.parseFloat("-1");
/**
* -1
*/
public static final Double FAIL_DOUBLE_VALUE = Double.parseDouble("-1");
/**
* 空格
*/
public static final Character FAIL_CHARACTER_VALUE = Character.valueOf(' ');
/**
* 失败
*/
public static final int FAILURE = 0;
/**
* 成功
*/
public static final int SUCCESS = 1;
/**
* 在线
*/
public static final String ONLINE = "在线";
/**
* 掉线
*/
public static final String OFFLINE = "掉线";
/**
* 通
*/
public static final String OPEN = "通";
/**
* 不通
*/
public static final String OFF = "不通";
/**
* ip
*/
public static final String IP = "ip";
/**
* #
*/
public static final String SHARP = "#";
/**
* TCP
*/
public static final String TCP = "TCP";
public static final String PIE_CHAR = "pieChar";
public static final String BAR_CHAR = "barChar";
public static final String HBAR_CHAR = "hbarChar";
public static final String LINE_CHAR = "lineChar";
public static final String DOUGHUNT_CHAR = "doughuntChar";
public static final String ROSE_CHAR = "roseChar";
public static final String AREA_CHAR = "areaChar";
public static final String DIMENSION = "dimension";
public static final String MEASURE = "measure";
/**
* xunjian
*/
public static final String TABLE_USERS = "Users";
public static final String EDIT_PWD = "editPassword";
public static final String EDIT_NOT_PWD = "editUsersInfo";
public static final String SAVE_USERS = "saveTableById";
public static final String SAVE_COM_USER = "saveComUserInfo";
public static final String EDIT_COM_USER = "editComUserInfo";
public static final String TABLE_CHECK = "Check";
public static final String TABLE_COM_USER = "companyUser";
public static final int FINISH_YES = 2;
public static final int FINISH_ING = 1;
public static final int FINISH_NO = 0;
public static final String SAVE_DEPART = "saveDepartMent";
public static final String EDIT_DEPART = "editsDepartMent";
public static final String TABLE_DEPART = "Group";
public static final String TABLE_ERROR = "Error";//隐患表
public static final String SAVE_ERROR = "saveErrorByID";//更新隐患表
public static final int XJ_ADMIN_ROLE = 9;//巡检管理员角色ID
public static final int XJ_USER_ROLE = 0;//巡检普通用户角色ID
public static final int TASK_STATUS_TIMEOUT = 3;//已超时
public static final int TASK_STATUS_FINISH = 2;//已结束
public static final int TASK_STATUS_DEAL = 1;//进行中
public static final int TASK_STATUS_NO_START = 0;//未开始
public static final String PLAN_TASK_DET_FINISH_NO = "0";//任务明细状态:未完成
public static final String PLAN_TASK_DET_FINISH_YES = "1";//任务明细状态:完成
public static final String PLAN_TASK_DET_FINISH_OUT = "2";//任务明细状态:超时漏检
public static final String USER_DATA_ADMIN = "全部可见"; //用户数据可见范围
public static final String USER_DATA_DEPART = "部门可见"; //用户数据可见范围
public static final String USER_DATA_PERSON = "个人可见"; //用户数据可见范围
public static final String USER_ROLE_SUPERADMIN = "1"; //权限id-超级管理员
public static final String USER_ROLE_ADMIN = "2"; //权限id-管理员
public static final String USER_ROLE_DEPART = "3"; //权限id-部门管理
public static final String USER_ROLE_PERSON = "4"; //权限id-普通用户
public static final String ROLE_NAME_SUPERADMIN = "SUPERADMIN"; //数据权限-超级管理员
public static final String ROLE_NAME_ADMIN = "ADMIN"; //数据权限-超级管理员
public static final String ROLE_NAME_DEPTADMIN = "DEPTADMIN"; //数据权限-部门
public static final String ROLE_NAME_PERSON = "PERSONAL"; //数据权限-个人
public static final String ADMIN_FLAG = "2"; //权限标记
public static final String DEPART_FLAG = "1"; //权限标记
public static final String PERSON_FLAG = "0";//权限标记
public static final String ADMIN_FLAG_NO = "0"; //标记 0-无关
public static final String ADMIN_FLAG_UP = "1"; //1-上级admin
public static final String ADMIN_FLAG_THIS = "2"; //2-本级admin
public static final String UNCLASSIFIED = "Unclassifed"; //巡检点未分类
public static final String ADMIN_ORG_CODE = "2";
public static final String CHECK_CHANGE_NO = "0";//是否记为合格:否
public static final String CHECK_CHANGE_YES = "1";//是否记为合格:是
public static final String SCHED_FLAG = "99";//自动任务标记
public static final String REGEN_FLAG = "98";//重做任务标记
public static final String FIX_DATE_NO = "0";//不固定日期(区间)
public static final String FIX_DATE_YES = "1";//固定日期
//计划类型
public static final String PLAN_TYPE_DAY = "1";//日计划
public static final String PLAN_TYPE_WEEK = "2";//周计划
public static final String PLAN_TYPE_MONTH = "3";//月计划
public static final String PLAN_TYPE_YEAR = "4";//年计划
//月类型
public static final String MONTH_TYPE_DAY = "1";//第几天
public static final String MONTH_TYPE_AT = "2";//在第几周的第几天
public static final String INTERVAL_UNIT_HOUR = "1";//执行间隔小时
public static final String INTERVAL_UNIT_MINUTE = "2";//执行间隔分钟
public static final String INTERVAL_UNIT_SECOND = "3";//执行间隔秒
public static final String ZERO_TIME = "00:00:00";//time
public static final String PLAN_STATUS_START = "0";//计划状态:正常
public static final String PLAN_STATUS_STOP = "1";//计划状态:已停用
public static final int PLAN_FIRST_STATUS_YES = 0;//计划:初始状态
public static final int PLAN_FIRST_STATUS_NO = 1;//计划:非初始状态
public static final String UPD_PLAN_GEN_DATE = "1";//更新plan表日期
public static final String UPD_PLAN_STATUS = "2";//更新plan表next_gen_status
public static final int DAY_RATE_ONE = 0;//0-1次
public static final int DAY_RATE_MANY = 1;//1-多次
public static final int IS_DETETE_NO = 0;//未删除
public static final int IS_DETETE_YES = 1;//删除
public static final String UPLOAD_ROOT_PATH = "upload";
public static final String INPUT_ITEM_TEXT = "文本";
public static final String INPUT_ITEM_NUMBER = "数字";
public static final String INPUT_ITEM_SELECT = "选择";
public static final String CHECK_TYPE_ALWAYS_OK = "始终合格";
public static final String CHECK_TYPE_ALWAYS_NO = "始终不合格";
public static final String CHECK_TYPE_NO_CONTEXT_OK = "无内容合格";
public static final String CHECK_TYPE_CONTEXT_OK = "有内容合格";
public static final String OK = "合格";
public static final String NO = "不合格";
public static final String YES = "是";
public static final String NOT = "否";
public static final String INPUT_ITEM_OK_SCORE = "OkScore";
public static final String INPUT_ITEM_NOT_SCORE = "NoScore";
public static final String POINT_OK_SCORE = "1";
public static final String POINT_NOT_SCORE = "0";
/**
* 任务是否发送消息状态
*/
public static final String TASK_WARN = "是";
public static final String TASK_NOT_WARN = "否";
/**
* 系统定时任务类型
*/
public static final String STATUS_MONITOR_START = "statusMonitorStart"; //状态监控是否开始
public static final String STATUS_MONITOR_END = "statusMonitorEnd"; //状态监控是否结束
public static final String PLAN_TASK_WARN_MSG_PUSH = "planTaskWarnMsgPush"; //计划即将开始消息提醒推送
public static final String PLAN_TASK_BEGIN_MSG_PUSH = "planTaskBeginMsgPush"; //计划已经开始消息提醒推送
public static final String PLAN_TASK_END_MSG_PUSH = "planTaskEndMsgPush"; //计划已经开始消息提醒推送
public static final String MESSAGE_PUSH = "messagePush"; //消息推送
public static final int IS_SENT = 1; //已发送
public static final int NOT_SENT = 0; //未发送
public static final String IS_FIXED_YES = "1"; //固定点
}
package com.yeejoin.amos.boot.biz.common.workflow.enums;
public enum WorkFlowUriEnum {
启动流程("启动流程", "/workflow/task/startTask", ""),
流程详情("流程详情", "/workflow/task/{taskId}", "taskId"),
合并启动流程("合并启动流程", "/workflow/task/startProcess", ""),
所有已执行任务详情("所有已执行任务详情","/workflow/activitiHistory/task/detail/{taskId}","taskId"),
流程任务("流程任务", "/workflow/task?processInstanceId={processInstanceId}", "processInstanceId"),
我的代办("我的代办", "/workflow/task/all-list?processDefinitionKey={processDefinitionKey}", "processDefinitionKey"),
我的代办有ID("我的代办有ID", "/workflow/task/all-list?processDefinitionKey={processDefinitionKey}&userId={userId}", "processDefinitionKey,userId"),
已执行任务("已执行任务", "/workflow/activitiHistory/all-historytasks?processDefinitionKey={processDefinitionKey}", "processDefinitionKey"),
已执行任务有ID("已执行任务有ID", "/workflow/activitiHistory/all-historytasks?processDefinitionKey={processDefinitionKey}&userId={userId}", "processDefinitionKey,userId"),
启动免登录流程("启动免登录流程", "/processes/{appKey}", "appKey"),
当前节点("当前节点", "/wf/taskstodo?processInstanceId={processInstanceId}", "processInstanceId"),
执行流程("执行流程", "/workflow/task/pickupAndCompleteTask/{taskId}", "taskId"),
终止流程("终止流程", "/wf/processes/{processInstanceId}?deleteReason={deleteReason}", "processInstanceId,deleteReason"),
当前子节点("当前子节点", "/wf/processes/{processInstanceId}/tasks?taskDefinitionKey={taskDefinitionKey}", "processInstanceId,taskDefinitionKey"),
工作流流水("工作流流水","/wf/processes/{processInstanceId}/tasks", "processInstanceId"),
子节点信息("子节点信息","/workflow/task/list/all/{instanceId}", "instanceId"),
所有已执行任务集合("所有已执行任务集合","/workflow/activitiHistory/tasks/{processInstanceId}", "processInstanceId");
private String desc;
private String uri;
private String params;
WorkFlowUriEnum(String desc, String uri, String params) {
this.desc = desc;
this.uri = uri;
this.params = params;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public String getParams() {
return params;
}
public void setParams(String params) {
this.params = params;
}
}
package com.yeejoin.amos.boot.biz.common.workflow.enums;
/**
* 是否枚举
* @author WJK
*
*/
public enum YesOrNoEnum {
NO("否","0"),
YES("是","1" );
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
private YesOrNoEnum(String name, String code){
this.name = name;
this.code = code;
}
public static YesOrNoEnum getEnum(String code) {
YesOrNoEnum jPushTypeEnum = null;
for(YesOrNoEnum type: YesOrNoEnum.values()) {
if (type.getCode().equals(code)) {
jPushTypeEnum = type;
break;
}
}
return jPushTypeEnum;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
package com.yeejoin.amos.boot.biz.common.workflow.feign;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @Author: xl
* @Description:
* @Date: 2020/3/30 16:26
*/
@Configuration
public class CommonMultipartSupportConfig {
@Autowired
private ObjectFactory<HttpMessageConverters> messageConverters;
@Bean
public Encoder feignCommonFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters));
}
}
package com.yeejoin.amos.boot.biz.common.workflow.feign;
import java.util.HashMap;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.alibaba.fastjson.JSONObject;
@FeignClient(name = "AMOS-API-WORKFLOW", path = "workflow", configuration = { CommonMultipartSupportConfig.class })
public interface WorkflowFeignService {
/**
* 发起流程
*
* @param params
* @return
*/
@RequestMapping(value = "/task/startProcess", method = RequestMethod.POST)
JSONObject startByVariable(@RequestBody Object params);
/**
* 完成任务
*
* @param taskID
* @param variable
* @return
* @throws Exception
*/
@RequestMapping(value = "/task/pickupAndCompleteTask/{taskId}", method = RequestMethod.POST)
JSONObject pickupAndCompleteTask(@PathVariable("taskId") String taskID,
@RequestBody(required = false) HashMap<String, Object> variable) throws Exception;
/**
* 查询当前流程下所有的可执行任务
*
* @param processInstanceId
* @return
*/
@RequestMapping(value = "/task/list/all/{processInstanceId}", method = RequestMethod.GET)
JSONObject getTaskList(@PathVariable("processInstanceId") String processInstanceId);
/**
* 查询当前任务的执行用户组
*
* @param processInstanceId
* @return
*/
@RequestMapping(value = "/getTaskGroupName/{taskId}", method = RequestMethod.GET)
JSONObject getTaskGroupName(@PathVariable("taskId") String taskId);
}
package com.yeejoin.amos.boot.module.tzs.api.vo;
package com.yeejoin.amos.boot.module.tzs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -14,8 +14,8 @@ import java.util.Map;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "AlarmStatisticsVo", description = "AlarmStatisticsVo")
public class AlarmStatisticsVo {
@ApiModel(value = "AlarmStatisticsDto", description = "AlarmStatisticsDto")
public class AlarmStatisticsDto {
@ApiModelProperty(value = "我的待办数量")
private Integer todoNum;
......
......@@ -127,14 +127,15 @@ public class AlertCalledDto extends BaseDto {
@ApiModelProperty(value = "警情地址")
private String alertAddress;
/**
* 工单编号
*/
@ApiModelProperty(value = "响应级别")
private String responseLevel;
@ApiModelProperty("工单编号")
private String workOrderNumber;
@ApiModelProperty(value = "接警时间str")
private String callTimeStr;
@ApiModelProperty(value = "接警人")
protected String recUserName;
// @ApiModelProperty(value = "接警人")
// protected String recUserName;
}
package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.tzs.api.vo.AlertCalledVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -21,14 +20,14 @@ public class AlertCalledFormDto extends BaseDto{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情基本信息")
private AlertCalledVo alertCalledVo;
private AlertCalledDto alertCalledDto;
@ApiModelProperty(value = "动态表单值")
private List<FormValue> dynamicFormAlert;
public AlertCalledFormDto(AlertCalledVo alertCalledVo, List<FormValue> formValue) {
this.alertCalledVo = alertCalledVo;
public AlertCalledFormDto(AlertCalledDto alertCalledDto, List<FormValue> formValue) {
this.alertCalledDto = alertCalledDto;
this.dynamicFormAlert = formValue;
}
}
package com.yeejoin.amos.boot.module.tzs.api.vo;
package com.yeejoin.amos.boot.module.tzs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -11,8 +11,8 @@ import lombok.experimental.Accessors;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "DutyPersonVo", description = "负责人VO")
public class DutyPersonVo {
@ApiModel(value = "DutyPersonDto", description = "负责人DTO")
public class DutyPersonDto {
private static final long serialVersionUID = 1L;
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -9,6 +10,8 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author tb
......@@ -203,14 +206,11 @@ public class ElevatorDto extends BaseDto {
@ApiModelProperty(value = "功率")
private String power;
@ApiModelProperty(value = "设备图片")
private String photos;
@ApiModelProperty(value = "原始表id(来自历史数据库)")
private String originalId;
// @ApiModelProperty(value = "附件")
//private Map<String, List<AttachmentDto>> attachments;
@ApiModelProperty(value = "附件")
private Map<String, List<AttachmentDto>> attachments;
@ApiModelProperty(value = "经度")
private String longitude;
......
......@@ -8,6 +8,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.List;
/**
* @author tb
* @date 2021-06-01
......@@ -20,7 +22,6 @@ import lombok.experimental.Accessors;
public class MaintenanceUnitDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "统一社会信用代码")
private String socialCreditCode;
......@@ -93,4 +94,6 @@ public class MaintenanceUnitDto extends BaseDto {
@ApiModelProperty(value = "原始表id(来自历史数据库)")
private String originalId;
@ApiModelProperty(value = "人员信息")
List<DutyPersonDto> dutyPersonList;
}
package com.yeejoin.amos.boot.module.tzs.api.vo;
package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
......@@ -16,10 +16,8 @@ import lombok.experimental.Accessors;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("cb_maintenance_unit")
@ApiModel(value = "MaintenanceUnitNameVo", description = "MaintenanceUnitNameVo")
public class MaintenanceUnitNameVo extends BaseEntity {
@ApiModel(value = "MaintenanceUnitNameDto", description = "MaintenanceUnitNameDto")
public class MaintenanceUnitNameDto extends BaseEntity {
private static final long serialVersionUID = 1L;
......
......@@ -8,6 +8,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.List;
/**
* @author tb
* @date 2021-06-01
......@@ -20,7 +22,6 @@ import lombok.experimental.Accessors;
public class RescueStationDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "应急救援机构名称")
private String name;
......@@ -75,4 +76,6 @@ public class RescueStationDto extends BaseDto {
@ApiModelProperty(value = "距离")
private String distance;
@ApiModelProperty(value = "人员信息")
List<DutyPersonDto> dutyPersonList;
}
......@@ -8,6 +8,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.List;
/**
* @author tb
* @date 2021-06-01
......@@ -20,7 +22,6 @@ import lombok.experimental.Accessors;
public class UseUnitDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "统一社会信用代码")
private String socialCreditCode;
......@@ -72,4 +73,6 @@ public class UseUnitDto extends BaseDto {
@ApiModelProperty(value = "原始表id(来自历史数据库)")
private String originalId;
@ApiModelProperty(value = "人员信息")
List<DutyPersonDto> dutyPersonList;
}
package com.yeejoin.amos.boot.module.tzs.api.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 警情接警填报记录
*
* @author litw
* @date 2021-08-03
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tz_alert_called")
@ApiModel(value = "AlertCalledVo", description = "AlertCalledVo")
public class AlertCalledVo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 警情状态 (0 未结案 1 结案)
*/
@ApiModelProperty("警情状态")
private Boolean alertStatus;
/**
* 警情来源类型
*/
@ApiModelProperty("警情来源类型")
private String alertSource;
/**
* 警情来源类型Code
*/
@ApiModelProperty("警情来源类型Code")
private String alertSourceCode;
/**
* 接警时间
*/
@ApiModelProperty("接警时间")
private Date callTime;
/**
* 报警人电话
*/
@ApiModelProperty("报警人电话")
private String emergencyCall;
/**
* 报警人名称,默认为先生或女士
*/
@ApiModelProperty("报警人名称,默认为先生或女士")
private String emergencyPerson;
/**
* 联系人姓名
*/
@ApiModelProperty("联系人姓名")
private String contactUser;
/**
* 联系人电话
*/
@ApiModelProperty("联系人电话")
private String contactPhone;
/**
* 设备分类,字典表数据
*/
@ApiModelProperty("设备分类")
private String equipmentClassification;
/**
* 报警类型
*/
@ApiModelProperty("报警类型")
private String type;
/**
* 警情类别
*/
@ApiModelProperty("警情类别")
private String alarmType;
/**
* 通话记录信息id
*/
@ApiModelProperty("通话记录信息id")
private Integer callRecordId;
/**
* 警情阶段
*/
@ApiModelProperty("警情阶段")
private String alertStage;
/**
* 父警情id
*/
@ApiModelProperty("父警情id")
private Long fatherAlert;
/**
* 设备识别码
*/
@ApiModelProperty("设备识别码")
private String deviceId;
/**
* 注册编码
*/
@ApiModelProperty("注册编码")
private String registrationCode;
/**
* 备注
*/
@ApiModelProperty("备注")
private String remark;
/**
* 更新时间
*/
@ApiModelProperty("更新时间")
private Date updateTime;
/**
* 设备分类code
*/
@ApiModelProperty("设备分类code")
private String equipmentClassificationCode;
/**
* 报警类型code
*/
@ApiModelProperty("报警类型code")
private String typeCode;
/**
* 警情类别code
*/
@ApiModelProperty("警情类别code")
private String alarmTypeCode;
/**
* 警情阶段code
*/
@ApiModelProperty("警情阶段code")
private String alertStageCode;
/**
* 组织机构
*/
@ApiModelProperty("组织机构")
private String orgCode;
@ApiModelProperty(value = "使用单位")
private String useUnit;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "接警时间开始---用于列表过滤")
private Date callTimeStart ;
@ApiModelProperty(value = "接警时间结束---用于列表过滤")
private Date callTimeEnd ;
@ApiModelProperty(value = "是否处警")
private Boolean isFatherAlert = false;
@ApiModelProperty(value = "所属省")
private String province;
@ApiModelProperty(value = "所属地市")
private String city;
@ApiModelProperty(value = "所属区县")
private String district;
@ApiModelProperty(value = "所属区域代码")
private String regionCode;
@ApiModelProperty(value = "使用场所分类")
private String useSiteCategory;
@ApiModelProperty(value = "电梯使用状态")
private Integer useStatus;
@ApiModelProperty(value = "警情地址")
private String alertAddress;
@ApiModelProperty(value = "响应级别")
private String responseLevel;
/**
* 工单编号
*/
@ApiModelProperty("工单编号")
private String workOrderNumber;
@ApiModelProperty(value = "接警时间str")
private String callTimeStr;
}
//package com.yeejoin.amos.boot.module.tzs.api.vo;
//
//import com.baomidou.mybatisplus.annotation.TableName;
//import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
//import lombok.experimental.Accessors;
//
//import java.util.Date;
//
///**
// * 警情接警填报记录
// *
// * @author litw
// * @date 2021-08-03
// */
//@Data
//@EqualsAndHashCode(callSuper = true)
//@Accessors(chain = true)
//@TableName("tz_alert_called")
//@ApiModel(value = "AlertCalledVo", description = "AlertCalledVo")
//public class AlertCalledVo extends BaseEntity {
//
// private static final long serialVersionUID = 1L;
//
// /**
// * 警情状态 (0 未结案 1 结案)
// */
// @ApiModelProperty("警情状态")
// private Boolean alertStatus;
//
// /**
// * 警情来源类型
// */
// @ApiModelProperty("警情来源类型")
// private String alertSource;
//
// /**
// * 警情来源类型Code
// */
// @ApiModelProperty("警情来源类型Code")
// private String alertSourceCode;
//
// /**
// * 接警时间
// */
// @ApiModelProperty("接警时间")
// private Date callTime;
//
// /**
// * 报警人电话
// */
// @ApiModelProperty("报警人电话")
// private String emergencyCall;
//
// /**
// * 报警人名称,默认为先生或女士
// */
// @ApiModelProperty("报警人名称,默认为先生或女士")
// private String emergencyPerson;
//
// /**
// * 联系人姓名
// */
// @ApiModelProperty("联系人姓名")
// private String contactUser;
//
// /**
// * 联系人电话
// */
// @ApiModelProperty("联系人电话")
// private String contactPhone;
//
// /**
// * 设备分类,字典表数据
// */
// @ApiModelProperty("设备分类")
// private String equipmentClassification;
//
// /**
// * 报警类型
// */
// @ApiModelProperty("报警类型")
// private String type;
//
// /**
// * 警情类别
// */
// @ApiModelProperty("警情类别")
// private String alarmType;
//
// /**
// * 通话记录信息id
// */
// @ApiModelProperty("通话记录信息id")
// private Integer callRecordId;
//
// /**
// * 警情阶段
// */
// @ApiModelProperty("警情阶段")
// private String alertStage;
//
// /**
// * 父警情id
// */
// @ApiModelProperty("父警情id")
// private Long fatherAlert;
//
// /**
// * 设备识别码
// */
// @ApiModelProperty("设备识别码")
// private String deviceId;
//
// /**
// * 注册编码
// */
// @ApiModelProperty("注册编码")
// private String registrationCode;
//
// /**
// * 备注
// */
// @ApiModelProperty("备注")
// private String remark;
//
// /**
// * 更新时间
// */
// @ApiModelProperty("更新时间")
// private Date updateTime;
//
// /**
// * 设备分类code
// */
// @ApiModelProperty("设备分类code")
// private String equipmentClassificationCode;
//
// /**
// * 报警类型code
// */
// @ApiModelProperty("报警类型code")
// private String typeCode;
//
// /**
// * 警情类别code
// */
// @ApiModelProperty("警情类别code")
// private String alarmTypeCode;
//
// /**
// * 警情阶段code
// */
// @ApiModelProperty("警情阶段code")
// private String alertStageCode;
//
// /**
// * 组织机构
// */
// @ApiModelProperty("组织机构")
// private String orgCode;
//
//
// @ApiModelProperty(value = "使用单位")
// private String useUnit;
//
//
// @ApiModelProperty(value = "地址")
// private String address;
//
// @ApiModelProperty(value = "接警时间开始---用于列表过滤")
// private Date callTimeStart ;
//
// @ApiModelProperty(value = "接警时间结束---用于列表过滤")
// private Date callTimeEnd ;
//
// @ApiModelProperty(value = "是否处警")
// private Boolean isFatherAlert = false;
//
// @ApiModelProperty(value = "所属省")
// private String province;
//
// @ApiModelProperty(value = "所属地市")
// private String city;
//
// @ApiModelProperty(value = "所属区县")
// private String district;
//
// @ApiModelProperty(value = "所属区域代码")
// private String regionCode;
//
// @ApiModelProperty(value = "使用场所分类")
// private String useSiteCategory;
//
// @ApiModelProperty(value = "电梯使用状态")
// private Integer useStatus;
//
// @ApiModelProperty(value = "警情地址")
// private String alertAddress;
//
// @ApiModelProperty(value = "响应级别")
// private String responseLevel;
//
// /**
// * 工单编号
// */
// @ApiModelProperty("工单编号")
// private String workOrderNumber;
//
// @ApiModelProperty(value = "接警时间str")
// private String callTimeStr;
//
//}
//package com.yeejoin.amos.boot.module.tzs.api.vo;
//
//import com.baomidou.mybatisplus.annotation.TableName;
//import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
//import lombok.experimental.Accessors;
//
//import java.util.Date;
//import java.util.List;
//
///**
// * @author tb
// * @date 2021-06-01
// */
//@Data
//@EqualsAndHashCode(callSuper = true)
//@Accessors(chain = true)
//@TableName("tcb_elevator")
//@ApiModel(value = "ElevatorDto", description = "ElevatorDto")
//public class ElevatorDto extends BaseEntity {
//
// private static final long serialVersionUID = 1L;
//
//
// @ApiModelProperty(value = "电梯应急救援识别码")
// private Integer rescueCode;
//
// @ApiModelProperty(value = "设备注册代码")
// private String registerCode;
//
// @ApiModelProperty(value = "所属省")
// private String province;
//
// @ApiModelProperty(value = "所属地市")
// private String city;
//
// @ApiModelProperty(value = "所属区县")
// private String district;
//
// @ApiModelProperty(value = "所属区域代码")
// private String regionCode;
//
// @ApiModelProperty(value = "安装地址")
// private String address;
//
// @ApiModelProperty(value = "内部编号")
// private String innerNum;
//
// @ApiModelProperty(value = "电梯品牌")
// private String brand;
//
// @ApiModelProperty(value = "出厂编号")
// private String factoryNum;
//
// @ApiModelProperty(value = "电梯安装单位")
// private String installationUnit;
//
// @ApiModelProperty(value = "制造日期(出厂时间)")
// private Date factoryDate;
//
// @ApiModelProperty(value = "电梯大修/改造日期")
// private Date overhaulDate;
//
// @ApiModelProperty(value = "开始使用日期")
// private Date startUseDate;
//
// @ApiModelProperty(value = "设备类别")
// private String category;
//
// @ApiModelProperty(value = "使用场所分类")
// private String useSiteCategory;
//
// @ApiModelProperty(value = "电梯型号")
// private String model;
//
// @ApiModelProperty(value = "电梯层数")
// private Integer floors;
//
// @ApiModelProperty(value = "电梯站数")
// private Integer stations;
//
// @ApiModelProperty(value = "电梯门数")
// private Integer doors;
//
// @ApiModelProperty(value = "电梯额定速度(单位:m/s)")
// private Float ratedSpeed;
//
// @ApiModelProperty(value = "电梯额定载重量(单位:kg)")
// private Float ratedLoad;
//
// @ApiModelProperty(value = "最大荷载人数")
// private Integer maxPersonLoad;
//
// @ApiModelProperty(value = "提升高度")
// private Float raiseHeight;
//
// @ApiModelProperty(value = "拖动方式")
// private String dragMode;
//
// @ApiModelProperty(value = "电梯使用状态")
// private Integer useStatus;
//
// @ApiModelProperty(value = "使用单位")
// private String useUnit;
//
// @ApiModelProperty(value = "使用单位id")
// private Long useUnitId;
//
// @ApiModelProperty(value = "制造单位名称")
// private String manufacturerName;
//
// @ApiModelProperty(value = "制造许可编号")
// private String manufacturingLicense;
//
// @ApiModelProperty(value = "维保类型")
// private String maintainType;
//
// @ApiModelProperty(value = "维护周期")
// private String maintainPeriod;
//
// @ApiModelProperty(value = "维保单位")
// private String maintainUnit;
//
// @ApiModelProperty(value = "维保单位id")
// private Long maintainUnitId;
//
// @ApiModelProperty(value = "维保负责人")
// private String maintainLeader;
//
// @ApiModelProperty(value = "维保负责人id")
// private Long maintainLeaderId;
//
// @ApiModelProperty(value = "维保负责人手机")
// private String maintainLeaderPhone;
//
// @ApiModelProperty(value = "主机模式")
// private String hostModel;
//
// @ApiModelProperty(value = "主机编号")
// private String hostNum;
//
// @ApiModelProperty(value = "动力类型")
// private String engineType;
//
// @ApiModelProperty(value = "动力编号")
// private String engineNum;
//
// @ApiModelProperty(value = "面板模型")
// private String panelModel;
//
// @ApiModelProperty(value = "面板编号")
// private String panelNum;
//
// @ApiModelProperty(value = "级联模型")
// private String cascadeModel;
//
// @ApiModelProperty(value = "级联线路模型")
// private String cascadeLineModel;
//
// @ApiModelProperty(value = "扶手带类型")
// private String handrailType;
//
// @ApiModelProperty(value = "扶手面板模型")
// private String handrailPanelModel;
//
// @ApiModelProperty(value = "扶手面板品牌")
// private String handrailPanelBrand;
//
// @ApiModelProperty(value = "滚转机模式")
// private String rollerMode;
//
// @ApiModelProperty(value = "倾斜的角度")
// private String tiltAngle;
//
// @ApiModelProperty(value = "横向跨度")
// private String horizontalSpan;
//
// @ApiModelProperty(value = "运行噪音")
// private String runningNoise;
//
// @ApiModelProperty(value = "运行方式")
// private String runningMode;
//
// @ApiModelProperty(value = "运行振动")
// private String runningVibration;
//
// @ApiModelProperty(value = "功率")
// private String power;
//
// @ApiModelProperty(value = "设备图片")
// private String photos;
//
// @ApiModelProperty(value = "设备图片")
// private List<Img> img;
//
// @ApiModelProperty(value = "原始表id(来自历史数据库)")
// private String originalId;
//
// @Data
// @EqualsAndHashCode()
// @Accessors(chain = true)
// @ApiModel(value = "Img", description = "Img")
// public static class Img {
// private String url;
//
// public Img(String url) {
// this.url = url;
// }
// }
//
//}
package com.yeejoin.amos.boot.module.tzs.api.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
/**
* @author tb
* @date 2021-06-01
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tcb_elevator")
@ApiModel(value = "ElevatorVo", description = "ElevatorVo")
public class ElevatorVo extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "电梯应急救援识别码")
private Integer rescueCode;
@ApiModelProperty(value = "设备注册代码")
private String registerCode;
@ApiModelProperty(value = "所属省")
private String province;
@ApiModelProperty(value = "所属地市")
private String city;
@ApiModelProperty(value = "所属区县")
private String district;
@ApiModelProperty(value = "所属区域代码")
private String regionCode;
@ApiModelProperty(value = "安装地址")
private String address;
@ApiModelProperty(value = "内部编号")
private String innerNum;
@ApiModelProperty(value = "电梯品牌")
private String brand;
@ApiModelProperty(value = "出厂编号")
private String factoryNum;
@ApiModelProperty(value = "电梯安装单位")
private String installationUnit;
@ApiModelProperty(value = "制造日期(出厂时间)")
private Date factoryDate;
@ApiModelProperty(value = "电梯大修/改造日期")
private Date overhaulDate;
@ApiModelProperty(value = "开始使用日期")
private Date startUseDate;
@ApiModelProperty(value = "设备类别")
private String category;
@ApiModelProperty(value = "使用场所分类")
private String useSiteCategory;
@ApiModelProperty(value = "电梯型号")
private String model;
@ApiModelProperty(value = "电梯层数")
private Integer floors;
@ApiModelProperty(value = "电梯站数")
private Integer stations;
@ApiModelProperty(value = "电梯门数")
private Integer doors;
@ApiModelProperty(value = "电梯额定速度(单位:m/s)")
private Float ratedSpeed;
@ApiModelProperty(value = "电梯额定载重量(单位:kg)")
private Float ratedLoad;
@ApiModelProperty(value = "最大荷载人数")
private Integer maxPersonLoad;
@ApiModelProperty(value = "提升高度")
private Float raiseHeight;
@ApiModelProperty(value = "拖动方式")
private String dragMode;
@ApiModelProperty(value = "电梯使用状态")
private Integer useStatus;
@ApiModelProperty(value = "使用单位")
private String useUnit;
@ApiModelProperty(value = "使用单位id")
private Long useUnitId;
@ApiModelProperty(value = "制造单位名称")
private String manufacturerName;
@ApiModelProperty(value = "制造许可编号")
private String manufacturingLicense;
@ApiModelProperty(value = "维保类型")
private String maintainType;
@ApiModelProperty(value = "维护周期")
private String maintainPeriod;
@ApiModelProperty(value = "维保单位")
private String maintainUnit;
@ApiModelProperty(value = "维保单位id")
private Long maintainUnitId;
@ApiModelProperty(value = "维保负责人")
private String maintainLeader;
@ApiModelProperty(value = "维保负责人id")
private Long maintainLeaderId;
@ApiModelProperty(value = "维保负责人手机")
private String maintainLeaderPhone;
@ApiModelProperty(value = "主机模式")
private String hostModel;
@ApiModelProperty(value = "主机编号")
private String hostNum;
@ApiModelProperty(value = "动力类型")
private String engineType;
@ApiModelProperty(value = "动力编号")
private String engineNum;
@ApiModelProperty(value = "面板模型")
private String panelModel;
@ApiModelProperty(value = "面板编号")
private String panelNum;
@ApiModelProperty(value = "级联模型")
private String cascadeModel;
@ApiModelProperty(value = "级联线路模型")
private String cascadeLineModel;
@ApiModelProperty(value = "扶手带类型")
private String handrailType;
@ApiModelProperty(value = "扶手面板模型")
private String handrailPanelModel;
@ApiModelProperty(value = "扶手面板品牌")
private String handrailPanelBrand;
@ApiModelProperty(value = "滚转机模式")
private String rollerMode;
@ApiModelProperty(value = "倾斜的角度")
private String tiltAngle;
@ApiModelProperty(value = "横向跨度")
private String horizontalSpan;
@ApiModelProperty(value = "运行噪音")
private String runningNoise;
@ApiModelProperty(value = "运行方式")
private String runningMode;
@ApiModelProperty(value = "运行振动")
private String runningVibration;
@ApiModelProperty(value = "功率")
private String power;
@ApiModelProperty(value = "设备图片")
private String photos;
@ApiModelProperty(value = "设备图片")
private List<Img> img;
@ApiModelProperty(value = "原始表id(来自历史数据库)")
private String originalId;
@Data
@EqualsAndHashCode()
@Accessors(chain = true)
@ApiModel(value = "Img", description = "Img")
public static class Img {
private String url;
public Img(String url) {
this.url = url;
}
}
}
package com.yeejoin.amos.boot.module.tzs.api.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.List;
/**
* @author tb
* @date 2021-06-01
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("cb_maintenance_unit")
@ApiModel(value = "MaintenanceUnitVo", description = "MaintenanceUnitVo")
public class MaintenanceUnitVo extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "统一社会信用代码")
private String socialCreditCode;
@ApiModelProperty(value = "维护保养单位名称")
private String unitName;
@ApiModelProperty(value = "省份")
private String province;
@ApiModelProperty(value = "地市")
private String city;
@ApiModelProperty(value = "区县")
private String district;
@ApiModelProperty(value = "区域代码")
private String regionCode;
@ApiModelProperty(value = "地址(详细地址,包括道路、门牌号码)")
private String address;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
@ApiModelProperty(value = "法人id")
private Long legalPersonId;
@ApiModelProperty(value = "法人")
private String legalPerson;
@ApiModelProperty(value = "法人电话/注册电话")
private String legalPersonPhone;
@ApiModelProperty(value = "企业资质等级")
private String qualificationLevel;
@ApiModelProperty(value = "信用级别")
private Integer creditLevel;
@ApiModelProperty(value = "许可证编号")
private String licenseNum;
@ApiModelProperty(value = "值班电话")
private String dutyPhone;
@ApiModelProperty(value = "紧急电话号码")
private String emergencyPhone;
@ApiModelProperty(value = "主要负责人1")
private String principalFirst;
@ApiModelProperty(value = "主要负责人1手机号码")
private String principalFirstPhone;
@ApiModelProperty(value = "主要负责人1id")
private Long principalFirstId;
@ApiModelProperty(value = "主要负责人2")
private String principalSecond;
@ApiModelProperty(value = "主要负责人2手机号码")
private String principalSecondPhone;
@ApiModelProperty(value = "主要负责人2id")
private Long principalSecondId;
@ApiModelProperty(value = "原始表id(来自历史数据库)")
private String originalId;
@ApiModelProperty(value = "人员信息")
List<DutyPersonVo> dutyPersonList;
}
//package com.yeejoin.amos.boot.module.tzs.api.vo;
//
//import com.baomidou.mybatisplus.annotation.TableName;
//import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
//import lombok.experimental.Accessors;
//
///**
// * @author tb
// * @date 2021-06-01
// */
//@Data
//@EqualsAndHashCode(callSuper = true)
//@Accessors(chain = true)
//@TableName("cb_maintenance_unit")
//@ApiModel(value = "MaintenanceUnitVo", description = "MaintenanceUnitVo")
//public class MaintenanceUnitVo extends BaseEntity {
//
// private static final long serialVersionUID = 1L;
//
//
// @ApiModelProperty(value = "统一社会信用代码")
// private String socialCreditCode;
//
// @ApiModelProperty(value = "维护保养单位名称")
// private String unitName;
//
// @ApiModelProperty(value = "省份")
// private String province;
//
// @ApiModelProperty(value = "地市")
// private String city;
//
// @ApiModelProperty(value = "区县")
// private String district;
//
// @ApiModelProperty(value = "区域代码")
// private String regionCode;
//
// @ApiModelProperty(value = "地址(详细地址,包括道路、门牌号码)")
// private String address;
//
// @ApiModelProperty(value = "经度")
// private String longitude;
//
// @ApiModelProperty(value = "纬度")
// private String latitude;
//
// @ApiModelProperty(value = "法人id")
// private Long legalPersonId;
//
// @ApiModelProperty(value = "法人")
// private String legalPerson;
//
// @ApiModelProperty(value = "法人电话/注册电话")
// private String legalPersonPhone;
//
// @ApiModelProperty(value = "企业资质等级")
// private String qualificationLevel;
//
// @ApiModelProperty(value = "信用级别")
// private Integer creditLevel;
//
// @ApiModelProperty(value = "许可证编号")
// private String licenseNum;
//
// @ApiModelProperty(value = "值班电话")
// private String dutyPhone;
//
// @ApiModelProperty(value = "紧急电话号码")
// private String emergencyPhone;
//
// @ApiModelProperty(value = "主要负责人1")
// private String principalFirst;
//
// @ApiModelProperty(value = "主要负责人1手机号码")
// private String principalFirstPhone;
//
// @ApiModelProperty(value = "主要负责人1id")
// private Long principalFirstId;
//
// @ApiModelProperty(value = "主要负责人2")
// private String principalSecond;
//
// @ApiModelProperty(value = "主要负责人2手机号码")
// private String principalSecondPhone;
//
// @ApiModelProperty(value = "主要负责人2id")
// private Long principalSecondId;
//
// @ApiModelProperty(value = "原始表id(来自历史数据库)")
// private String originalId;
//
//}
package com.yeejoin.amos.boot.module.tzs.api.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.List;
/**
* @author tb
* @date 2021-06-01
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tcb_rescue_station")
@ApiModel(value = "RescueStationVo", description = "RescueStationVo")
public class RescueStationVo extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "应急救援机构名称")
private String name;
@ApiModelProperty(value = "省份")
private String province;
@ApiModelProperty(value = "地市")
private String city;
@ApiModelProperty(value = "区县")
private String district;
@ApiModelProperty(value = "区域代码")
private String regionCode;
@ApiModelProperty(value = "地址(详细地址,包括道路、门牌号码)")
private String address;
@ApiModelProperty(value = "责任人id")
private Long principalId;
@ApiModelProperty(value = "主要负责人")
private String principal;
@ApiModelProperty(value = "负责人电话")
private String principalPhone;
@ApiModelProperty(value = "应急救援负责人")
private String rescueLeader;
@ApiModelProperty(value = "应急救援负责人手机号")
private String rescueLeaderPhone;
@ApiModelProperty(value = "应急救援负责人id")
private Long rescueLeaderId;
@ApiModelProperty(value = "所属单位(维保单位)")
private String affiliatedUnit;
@ApiModelProperty(value = "所属单位id")
private Long affiliatedUnitId;
@ApiModelProperty(value = "经纬度")
private String longitudeLatitude;
@ApiModelProperty(value = "人员信息")
List<DutyPersonVo> dutyPersonList;
}
//package com.yeejoin.amos.boot.module.tzs.api.vo;
//
//import com.baomidou.mybatisplus.annotation.TableName;
//import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
//import lombok.experimental.Accessors;
//
///**
// * @author tb
// * @date 2021-06-01
// */
//@Data
//@EqualsAndHashCode(callSuper = true)
//@Accessors(chain = true)
//@TableName("tcb_rescue_station")
//@ApiModel(value = "RescueStationVo", description = "RescueStationVo")
//public class RescueStationVo extends BaseEntity {
//
// private static final long serialVersionUID = 1L;
//
//
// @ApiModelProperty(value = "应急救援机构名称")
// private String name;
//
// @ApiModelProperty(value = "省份")
// private String province;
//
// @ApiModelProperty(value = "地市")
// private String city;
//
// @ApiModelProperty(value = "区县")
// private String district;
//
// @ApiModelProperty(value = "区域代码")
// private String regionCode;
//
// @ApiModelProperty(value = "地址(详细地址,包括道路、门牌号码)")
// private String address;
//
// @ApiModelProperty(value = "责任人id")
// private Long principalId;
//
// @ApiModelProperty(value = "主要负责人")
// private String principal;
//
// @ApiModelProperty(value = "负责人电话")
// private String principalPhone;
//
// @ApiModelProperty(value = "应急救援负责人")
// private String rescueLeader;
//
// @ApiModelProperty(value = "应急救援负责人手机号")
// private String rescueLeaderPhone;
//
// @ApiModelProperty(value = "应急救援负责人id")
// private Long rescueLeaderId;
//
// @ApiModelProperty(value = "所属单位(维保单位)")
// private String affiliatedUnit;
//
// @ApiModelProperty(value = "所属单位id")
// private Long affiliatedUnitId;
//
// @ApiModelProperty(value = "经纬度")
// private String longitudeLatitude;
//
//}
package com.yeejoin.amos.boot.module.tzs.api.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.List;
/**
* @author tb
* @date 2021-06-01
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tcb_use_unit")
@ApiModel(value = "UseUnitVo", description = "UseUnitVo")
public class UseUnitVo extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "统一社会信用代码")
private String socialCreditCode;
@ApiModelProperty(value = "使用单位(小区)名称")
private String useUnitName;
@ApiModelProperty(value = "小区所属地产品牌")
private String realEstateBrand;
@ApiModelProperty(value = "物业公司所属品牌")
private String propertyCompanyBrand;
@ApiModelProperty(value = "省份")
private String province;
@ApiModelProperty(value = "地市")
private String city;
@ApiModelProperty(value = "区县")
private String district;
@ApiModelProperty(value = "区域代码")
private String regionCode;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "责任人id")
private Long principalId;
@ApiModelProperty(value = "主要负责人")
private String principal;
@ApiModelProperty(value = "负责人电话")
private String principalPhone;
@ApiModelProperty(value = "管理部门")
private String management;
@ApiModelProperty(value = "管理员id")
private Long managerId;
@ApiModelProperty(value = "电梯安全管理员")
private String manager;
@ApiModelProperty(value = "电梯管理员手机")
private String managerPhone;
@ApiModelProperty(value = "原始表id(来自历史数据库)")
private String originalId;
@ApiModelProperty(value = "人员信息")
List<DutyPersonVo> dutyPersonList;
}
//package com.yeejoin.amos.boot.module.tzs.api.vo;
//
//import com.baomidou.mybatisplus.annotation.TableName;
//import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
//import lombok.experimental.Accessors;
//
///**
// * @author tb
// * @date 2021-06-01
// */
//@Data
//@EqualsAndHashCode(callSuper = true)
//@Accessors(chain = true)
//@TableName("tcb_use_unit")
//@ApiModel(value = "UseUnitVo", description = "UseUnitVo")
//public class UseUnitVo extends BaseEntity {
//
// private static final long serialVersionUID = 1L;
//
//
// @ApiModelProperty(value = "统一社会信用代码")
// private String socialCreditCode;
//
// @ApiModelProperty(value = "使用单位(小区)名称")
// private String useUnitName;
//
// @ApiModelProperty(value = "小区所属地产品牌")
// private String realEstateBrand;
//
// @ApiModelProperty(value = "物业公司所属品牌")
// private String propertyCompanyBrand;
//
// @ApiModelProperty(value = "省份")
// private String province;
//
// @ApiModelProperty(value = "地市")
// private String city;
//
// @ApiModelProperty(value = "区县")
// private String district;
//
// @ApiModelProperty(value = "区域代码")
// private String regionCode;
//
// @ApiModelProperty(value = "地址")
// private String address;
//
// @ApiModelProperty(value = "责任人id")
// private Long principalId;
//
// @ApiModelProperty(value = "主要负责人")
// private String principal;
//
// @ApiModelProperty(value = "负责人电话")
// private String principalPhone;
//
// @ApiModelProperty(value = "管理部门")
// private String management;
//
// @ApiModelProperty(value = "管理员id")
// private Long managerId;
//
// @ApiModelProperty(value = "电梯安全管理员")
// private String manager;
//
// @ApiModelProperty(value = "电梯管理员手机")
// private String managerPhone;
//
// @ApiModelProperty(value = "原始表id(来自历史数据库)")
// private String originalId;
//
//}
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FailureAuditServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -86,6 +87,18 @@ public class FailureAuditController extends BaseController {
public ResponseModel<List<FailureAuditDto>> selectForList() {
return ResponseHelper.buildResponse(failureAuditServiceImpl.queryForFailureAuditList());
}
/**
* 审核列表记录查询
*根据关联主表faultId查询
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "审核列表记录查询", notes = "审核列表记录查询")
@GetMapping(value = "/list/{faultId}")
public ResponseModel<List<FailureAudit>> findByFaultIDFotList(@RequestParam long faultId) {
return ResponseHelper.buildResponse(failureAuditServiceImpl.findByfaultId(faultId));
}
......
......@@ -4,6 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -52,28 +53,21 @@ public class FailureDetailsController extends BaseController {
* 新增
*
* @return
* @throws Exception
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<Object> save(@RequestBody FailureDetailsDto model) {
Object result = failureDetailsServiceImpl.savemodel(model,getSelectedOrgInfo());
return ResponseHelper.buildResponse(result);
// CommonResponse commonResponse = new CommonResponse();
// try {
// AgencyUserModel user = getUserInfo();
// if (ObjectUtils.isEmpty(user)) {
// return CommonResponseUtil.failure("用户session过期");
// }
// return failureDetailsServiceImpl.savemodel(model);
// } catch (Exception e) {
// logger.error("", e.getMessage());
// return CommonResponseUtil.failure("系统繁忙,请稍后再试");
// }
public ResponseModel<Object> save(@RequestBody FailureDetailsDto model) {
Object result;
try {
result = failureDetailsServiceImpl.savemodel(model,getSelectedOrgInfo());
return ResponseHelper.buildResponse(result);
} catch (Exception e) {
// TODO Auto-generated catch block
return ResponseHelper.buildResponse("erro");
}
}
......@@ -128,11 +122,12 @@ public class FailureDetailsController extends BaseController {
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<Page<FailureDetailsDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
(value = "size") int size,@RequestParam Long currentStatus) {
Page<FailureDetailsDto> page = new Page<FailureDetailsDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForFailureDetailsPage(page));
final AgencyUserModel userInfo = getUserInfo();
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForFailureDetailsPage(page,currentStatus,userInfo));
}
/**
......@@ -160,5 +155,33 @@ public class FailureDetailsController extends BaseController {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForFailureDetailsList(currentStatus));
}
/**
* 查询当前状态任务数量
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "查询当前状态任务数量", notes = "查询当前状态任务数量")
@GetMapping(value = "/list/count/{currentStatus}")
public ResponseModel<Integer> selectStatusCount(@RequestParam Long currentStatus) {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryStatusCount(currentStatus));
}
/**
* 查询我提交状态任务数量
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "查询我提交状态任务数量", notes = "查询我提交状态任务数量")
@GetMapping(value = "/list/userID")
public ResponseModel<Page<FailureDetailsDto>> selectISubmit(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<FailureDetailsDto> page = new Page<FailureDetailsDto>();
page.setCurrent(current);
page.setSize(size);
String userId = getUserInfo().getUserId();
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForPage(page,userId));
}
}
......@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -73,8 +75,18 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
failureDetailsDto.setCurrentStatus(status);
failureDetailsDto.setSequenceNbr(model.getFaultId());
return failureDetailsService.updateWithModel(failureDetailsDto);
}
/**
* 根据FaultId查询
*/
public List<FailureAudit> findByfaultId(Long faultId) {
Page<FailureAudit> page = new Page<>();
QueryWrapper<FailureAudit> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("fault_id", faultId).orderByDesc("submission_time");
return baseMapper.selectList(queryWrapper);
}
public FailureAudit findByFaultId(Long faultId) {
LambdaQueryWrapper<FailureAudit> wrapper = new LambdaQueryWrapper<FailureAudit>();
wrapper.eq(FailureAudit::getIsDelete, false);
......
......@@ -7,6 +7,9 @@ import java.util.List;
import java.util.Map;
import java.util.Random;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -21,9 +24,8 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.workflow.RemoteWorkFlowService;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
......@@ -46,12 +48,15 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
SourceFileServiceImpl sourceFileServiceImpl;
@Autowired
RemoteWorkFlowService remoteWorkFlowService;
WorkflowFeignService workflowFeignService;
@Value("${failure.work.flow.processDefinitionKey}")
private String processDefinitionKey;
@Autowired
FailureAuditServiceImpl failureAuditServiceImpl;
@Autowired
IFailureAuditService failureAuditService;
public static String EMERGENCY_COMMAND = "应急指挥科";
......@@ -61,8 +66,21 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
/**
* 分页查询
*/
public Page<FailureDetailsDto> queryForFailureDetailsPage(Page<FailureDetailsDto> page) {
return this.queryForPage(page, null, false);
public Page<FailureDetailsDto> queryForFailureDetailsPage(Page<FailureDetailsDto> page, Long currentStatus, AgencyUserModel userInfo ) {
if (currentStatus == null){
return this.queryForPage(page, "submission_time", true);
}
return this.queryForPage(page, "submission_time", true,currentStatus);
}
/**
* 我发起分页查询
*/
public Page<FailureDetailsDto> queryForPage(Page<FailureDetailsDto> page, String userId ) {
if (userId == null){
return null;
}
return this.queryForPage(page, "submission_time", true,userId);
}
/**
......@@ -83,12 +101,26 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
}
/**
* 查询任务状态数量
*/
public Integer queryStatusCount(Long currentStatus) {
QueryWrapper<FailureDetails> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("current_status", currentStatus);
return baseMapper.selectCount(queryWrapper);
}
/**
* 发起故障保修单
*
* @throws Exception
*/
@Transactional
public Object savemodel(FailureDetailsDto failureDetailsDto, ReginParams userInfo) {
public Object savemodel(FailureDetailsDto failureDetailsDto, ReginParams userInfo) throws Exception {
String businessKey = buildOrderNo();
JSONObject jsonObject = remoteWorkFlowService.startNew(null, businessKey, processDefinitionKey);
JSONObject body = new JSONObject();
body.put("businessKey", businessKey);
body.put("processDefinitionKey", processDefinitionKey);
JSONObject jsonObject = workflowFeignService.startByVariable(body);
if (jsonObject == null) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
// return CommonResponseUtil.failure("启动流程失败");
......@@ -106,91 +138,112 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
sourceFileServiceImpl.saveSourceFile(failureDetailsDto.getSequenceNbr(),
failureDetailsDto.getAttachment());
}
/*failureDetailsDto.set*/
model = this.createWithModel(failureDetailsDto);
FailureAuditDto failureAuditDto = new FailureAuditDto();
failureAuditDto.setAuditor(model.getRecUserName());
failureAuditDto.setFaultId(model.getSequenceNbr());
failureAuditDto.setAuditOpinion("已发起");
failureAuditServiceImpl.savemodel(failureAuditDto);
} catch (Exception e) {
logger.info("添加故障维修信息到数据库失败");
return false;
// return CommonResponseUtil.failure("添加失败");
}
if (ObjectUtils.isNotEmpty(model)) {
excuteTask( instance.getString("id"), userInfo, null);
excuteTask(instance.getString("id"), userInfo, null);
}
return true;
}
public boolean excuteTask( Long sequenceNbr, ReginParams userInfo,
String condition) {
Map<String, Object> conditionMap = new HashMap<String, Object>();
public boolean excuteTask(Long sequenceNbr, ReginParams userInfo, String condition) {
HashMap<String, Object> conditionMap = new HashMap<String, Object>();
conditionMap.put("condition", condition);
Map<String,Object> map= checkExcuteTaskAuthMap(sequenceNbr,userInfo);
try {
if(Boolean.parseBoolean(map.get("checkFlag").toString())) {
remoteWorkFlowService.excute(map.get("taskId").toString(), conditionMap.toString());
}
Map<String, Object> map = checkExcuteTaskAuthMap(sequenceNbr, userInfo);
try {
if (Boolean.parseBoolean(map.get("checkFlag").toString())) {
workflowFeignService.pickupAndCompleteTask(map.get("taskId").toString(), conditionMap);
}
} catch (Exception e) {
return false;
}
return true;
}
public boolean excuteTask(String procressId, ReginParams userInfo,
String condition) {
Map<String, Object> conditionMap = new HashMap<String, Object>();
public boolean excuteTask(String procressId, ReginParams userInfo, String condition) throws Exception {
HashMap<String, Object> conditionMap = new HashMap<String, Object>();
conditionMap.put("condition", condition);
JSONObject teskObject = remoteWorkFlowService.getChildNodeDetail(procressId);
JSONObject teskObject = workflowFeignService.getTaskList(procressId);
if (ObjectUtils.isNotEmpty(teskObject)) {
JSONArray taskDetailArray = teskObject.getJSONArray("data");
for (Object obj : taskDetailArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
remoteWorkFlowService.excute(detail.getString("id"), conditionMap.toString());
workflowFeignService.pickupAndCompleteTask(detail.getString("id"), conditionMap);
}
}
return true;
}
public boolean checkExcuteTaskAuth(Long sequenceNbr, ReginParams userInfo) {
Map<String,Object> map= this.checkExcuteTaskAuthMap(sequenceNbr,userInfo);
Map<String, Object> map = this.checkExcuteTaskAuthMap(sequenceNbr, userInfo);
return Boolean.parseBoolean(map.get("checkFlag").toString());
}
public Map<String,Object> checkExcuteTaskAuthMap(Long sequenceNbr, ReginParams userInfo) {
Map<String,Object> map = new HashMap<String,Object>();
public Map<String, Object> checkExcuteTaskAuthMap(Long sequenceNbr, ReginParams userInfo) {
String currentLoginUserRole = userInfo.getRole().getRoleName();
Map<String, Object> map = new HashMap<String, Object>();
map.put("checkFlag", false);
FailureDetailsDto failureDetailsDto = this.queryBySeq(sequenceNbr);
// 获取送达部门的ID
Integer failureEquipmentId = failureDetailsDto.getFailureEquipmentId();
//获取上一级操作部门的Id
// 获取上一级操作部门的Id
FailureDetails details = this.baseMapper.selectById(sequenceNbr);
String procressId = details.getProcessId();
Long seq = userInfo.getDepartment().getSequenceNbr();
JSONObject teskObject = remoteWorkFlowService.getChildNodeDetail(procressId);
JSONObject teskObject = workflowFeignService.getTaskList(procressId);
if (ObjectUtils.isNotEmpty(teskObject)) {
JSONArray taskDetailArray = teskObject.getJSONArray("data");
for (Object obj : taskDetailArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
String name = detail.getString("name");
if (name.contains(EMERGENCY_COMMAND) ) {
JSONObject taskGroupNameObject = workflowFeignService.getTaskGroupName(detail.getString("id"));
// 获取流程中原本设置的当前节点的执行权限
JSONArray taskGroupNameDetail = taskGroupNameObject.getJSONArray("data");
// 如果拿不到当前任务的执行角色,则返回校验失败
if (ObjectUtils.isEmpty(taskGroupNameDetail)) {
continue;
}
String defaultExecutionRoleProcess = taskGroupNameDetail.getJSONObject(0).getString("groupId");
// 判断当前登录人的角色是不是与流程中设置的当前任务节点权限一致,一致则执行,不一致则退出
if (!defaultExecutionRoleProcess.equals(currentLoginUserRole)) {
continue;
}
// 当流程节点为应急指挥科时,需要判断当前用户所在的部门id和前面处理的用户部门id是否一致
if (name.contains(EMERGENCY_COMMAND)) {
FailureAudit failureAuditDetail = failureAuditService.findByFaultId(sequenceNbr);
Long auditDepartmentId = failureAuditDetail.getAuditDepartmentId();
if(auditDepartmentId.intValue() == seq.intValue()) {
map.put("taskId", detail.getString("id"));
map.put("checkFlag", true);
return map;
}
Long auditDepartmentId = failureAuditDetail.getAuditDepartmentId();
if (auditDepartmentId.intValue() == seq.intValue()) {
map.put("taskId", detail.getString("id"));
map.put("checkFlag", true);
break;
}
} else {
// 判断当前节点任务属于送达部门节点时需要判断当前登录人所在的部门id是否与表单发起时设置的送达部门一致
if (failureEquipmentId.intValue() == seq.intValue()) {
map.put("taskId", detail.getString("id"));
map.put("checkFlag", true);
return map;
break;
}
}
}
}
map.put("checkFlag", false);
return map;
}
public Object getCurrentProcessHistoryTask(Long id) {
FailureDetailsDto failureDetailsDto = this.queryBySeq(id);
String processId = failureDetailsDto.getProcessId();
JSONObject historyObject = remoteWorkFlowService.queryFinishTaskDetailByInstanceId(processId);
return logger;
}
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureMaintainDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.api.entity.FailureMaintain;
import com.yeejoin.amos.boot.module.common.api.enums.AuditResultEnum;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
......@@ -57,6 +59,16 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
}
/**
* 根据FaultId查询
*/
public List<FailureMaintain> findByfaultId(Long faultId) {
Page<FailureMaintain> page = new Page<>();
QueryWrapper<FailureMaintain> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("fault_id", faultId).orderByDesc("submission_time");
return baseMapper.selectList(queryWrapper);
}
/**
*根据审核结果更新维修表
*/
public FailureMaintainDto updateModel(FailureMaintainDto failureMaintainDto,Integer status) {
......
......@@ -498,8 +498,8 @@ public class PlanTaskController extends AbstractBaseController {
@ApiParam(value = "维保状态") @RequestParam(value = "finishStatus", required = false) Integer finishStatus,
@ApiParam(value = "排序条件") @RequestParam(value = "orderBy") String orderBy,
@ApiParam(value = "业主单位") @RequestParam(value = "companyId", required = false) String companyId,
@ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int current,
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int size) throws Exception {
@ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber,
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) throws Exception {
HashMap<String, Object> params = new HashMap<String, Object>();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
......@@ -512,7 +512,7 @@ public class PlanTaskController extends AbstractBaseController {
params.put("endTime", endTime);
params.put("finishStatus", finishStatus);
params.put("orderBy", OrderByEnum.getEumByCode(orderBy).getOderBy());
CommonPageable pageable = new CommonPageable(current, size);
CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
try {
return CommonResponseUtil.success(planTaskService.getPlanTasks(params, pageable));
} catch (Exception e) {
......
......@@ -19,8 +19,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper;
import com.yeejoin.amos.boot.module.tzs.api.vo.AlarmStatisticsVo;
import com.yeejoin.amos.boot.module.tzs.api.vo.AlertCalledVo;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlarmStatisticsDto;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.DispatchPaperServiceImpl;
......@@ -191,14 +190,15 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/alertStatistics")
@ApiOperation(httpMethod = "GET",value = "警情统计", notes = "警情统计")
public ResponseModel<AlarmStatisticsVo> alertStatistics() throws ParseException {
public ResponseModel<AlarmStatisticsDto> alertStatistics() throws ParseException {
ReginParams reginParams =getSelectedOrgInfo();
//我的待办数量
QueryWrapper<AlertCalled> todoNumQueryWrapper = new QueryWrapper<>();
//全部待办数量
QueryWrapper<AlertCalled> allNumQueryWrapper = new QueryWrapper<>();
AlarmStatisticsVo alarmStatisticsVo = new AlarmStatisticsVo();
AlarmStatisticsDto alarmStatisticsDto = new AlarmStatisticsDto();
todoNumQueryWrapper.eq("alert_status",false);
allNumQueryWrapper.eq("alert_status",false);
if(null != reginParams) {
......@@ -206,22 +206,22 @@ public class AlertCalledController extends BaseController {
todoNumQueryWrapper.or(true);
todoNumQueryWrapper.eq("org_code",reginParams.getCompany().getOrgCode());
alarmStatisticsVo.setTodoNum(iAlertCalledService.list(todoNumQueryWrapper).size());
alarmStatisticsVo.setAllNum(iAlertCalledService.list(allNumQueryWrapper).size());
alarmStatisticsDto.setTodoNum(iAlertCalledService.list(todoNumQueryWrapper).size());
alarmStatisticsDto.setAllNum(iAlertCalledService.list(allNumQueryWrapper).size());
Map<String, Object> map = iAlertCalledService.getAlertInfoList(DateUtils.dateFormat(new Date(),"")+" 00:00:00",
DateUtils.dateFormat(new Date(),"")+" 23:59:59",reginParams.getCompany().getOrgCode(),
reginParams.getUserModel().getUserId());
// 当天接警
alarmStatisticsVo.setTodayAlarmNum(map.get("calledCount") == null ? 0 : Integer.valueOf(map.get("calledCount").toString())) ;
alarmStatisticsDto.setTodayAlarmNum(map.get("calledCount") == null ? 0 : Integer.valueOf(map.get("calledCount").toString())) ;
//当天提交
alarmStatisticsVo.setTodayAlarmNum(map.get("majorAlertCount") == null ? 0 : Integer.valueOf(map.get("majorAlertCount").toString())) ;
alarmStatisticsDto.setTodayAlarmNum(map.get("majorAlertCount") == null ? 0 : Integer.valueOf(map.get("majorAlertCount").toString())) ;
//投诉咨询数量
alarmStatisticsVo.setSuggestions(map.get("suggestionsCount") == null ? 0 : Integer.valueOf(map.get("suggestionsCount").toString())) ;
alarmStatisticsDto.setSuggestions(map.get("suggestionsCount") == null ? 0 : Integer.valueOf(map.get("suggestionsCount").toString())) ;
//故障维修数量
alarmStatisticsVo.setSuggestions(map.get("faultRescueCount") == null ? 0 : Integer.valueOf(map.get("faultRescueCount").toString())) ;
alarmStatisticsDto.setSuggestions(map.get("faultRescueCount") == null ? 0 : Integer.valueOf(map.get("faultRescueCount").toString())) ;
//困人救援数量
alarmStatisticsVo.setSuggestions(map.get("sleepyIncidentCount") == null ? 0 : Integer.valueOf(map.get("sleepyIncidentCount").toString())) ;
alarmStatisticsDto.setSuggestions(map.get("sleepyIncidentCount") == null ? 0 : Integer.valueOf(map.get("sleepyIncidentCount").toString())) ;
Map<String,Integer> recordMap = Maps.newHashMap();
// 近七天办理数量
......@@ -232,9 +232,9 @@ public class AlertCalledController extends BaseController {
reginParams.getUserModel().getUserId());
recordMap.put(DateUtils.dateFormat(DateUtils.dateAddDays(new Date(), -i),""),nearlySevenDaysMap.get("calledCount") == null ? 0 : Integer.valueOf(nearlySevenDaysMap.get("calledCount").toString()));
}
alarmStatisticsVo.setNearlySevenDaysNum(recordMap);
alarmStatisticsDto.setNearlySevenDaysNum(recordMap);
}
return ResponseHelper.buildResponse(alarmStatisticsVo);
return ResponseHelper.buildResponse(alarmStatisticsDto);
}
/**
......@@ -247,7 +247,7 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/list")
@ApiOperation(httpMethod = "GET",value = "警情接警填报记录分页查询", notes = "警情接警填报记录分页查询")
public ResponseModel<IPage<AlertCalledVo>> queryForPage(String pageNum, String pageSize,String sort, AlertCalledDto alertCalledDto) {
public ResponseModel<IPage<AlertCalledDto>> queryForPage(String pageNum, String pageSize,String sort, AlertCalledDto alertCalledDto) {
AlertCalled alertCalled = BeanDtoVoUtils.convert(alertCalledDto,AlertCalled.class);
Page<AlertCalled> pageBean;
IPage<AlertCalled> page;
......@@ -261,10 +261,10 @@ public class AlertCalledController extends BaseController {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper);
IPage<AlertCalledVo> calledVoIPage = AlertBeanDtoVoUtils.alertCalledIPageVo(page);
IPage<AlertCalledDto> calledVoIPage = AlertBeanDtoVoUtils.alertCalledIPageDto(page);
calledVoIPage.getRecords().stream().forEach(e->e.setAlertAddress(e.getCity()+e.getDistrict()));
calledVoIPage.getRecords().stream().forEach(e->{
getResponseLevel(alertCalled.getSequenceNbr(),e,null);
getResponseLevel(alertCalled.getSequenceNbr(), e,null);
});
return ResponseHelper.buildResponse(calledVoIPage);
}
......@@ -324,7 +324,7 @@ public class AlertCalledController extends BaseController {
return queryWrapper;
}
void getResponseLevel(Long alertId,AlertCalledVo alertCalledVo,ESAlertCalledDto esAlertCalledDto) {
void getResponseLevel(Long alertId, AlertCalledDto alertCalledDto, ESAlertCalledDto esAlertCalledDto) {
QueryWrapper<DispatchPaper> dispatchPaperQueryWrapper = new QueryWrapper<>();
dispatchPaperQueryWrapper.eq("alert_id",alertId);
DispatchPaper dispatchPaper = dispatchPaperServiceImpl.getOne(dispatchPaperQueryWrapper);
......@@ -339,8 +339,8 @@ public class AlertCalledController extends BaseController {
dynamicParms.put("field_code","field_value");
});
String responseLevel = dynamicParms.get("response_level");
if(null != alertCalledVo) {
alertCalledVo.setResponseLevel(responseLevel);
if(null != alertCalledDto) {
alertCalledDto.setResponseLevel(responseLevel);
} else {
esAlertCalledDto.setResponseLevel(responseLevel);
}
......
......@@ -9,7 +9,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorNewDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.service.IElevatorService;
import com.yeejoin.amos.boot.module.tzs.api.vo.ElevatorVo;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ElevatorServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -47,6 +48,9 @@ public class ElevatorController extends BaseController {
@Autowired
IElevatorService iElevatorService;
@Autowired
ElevatorServiceImpl elevatorService;
/**
* 新增电梯
*
......@@ -56,24 +60,21 @@ public class ElevatorController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增电梯", notes = "新增电梯")
public ResponseModel<Boolean> saveElevator(@RequestBody ElevatorDto elevatorDto) {
Elevator elevator = BeanDtoVoUtils.convert(elevatorDto, Elevator.class);
boolean save = iElevatorService.save(elevator);
return ResponseHelper.buildResponse(save);
public ResponseModel<com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto> saveElevator(@RequestBody com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto elevatorDto) {
return ResponseHelper.buildResponse(elevatorService.saveElevator(elevatorDto));
}
/**
* 根据id删除
* 根据id批量删除
*
* @param id id
* @param idList id
* @return 返回结果
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
@ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除")
public ResponseModel<Boolean> deleteById(@PathVariable Long id) {
boolean removed = iElevatorService.removeById(id);
return ResponseHelper.buildResponse(removed);
public ResponseModel<Boolean> deleteById(@RequestParam String idList) {
return ResponseHelper.buildResponse(elevatorService.deleteBatchBySeq(idList));
}
/**
......@@ -85,26 +86,22 @@ public class ElevatorController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/updateById", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "修改电梯", notes = "修改电梯")
public ResponseModel<Boolean> updateByIdElevator(@RequestBody ElevatorDto elevatorDto) {
Elevator elevator = BeanDtoVoUtils.convert(elevatorDto, Elevator.class);
boolean update = iElevatorService.updateById(elevator);
return ResponseHelper.buildResponse(update);
public ResponseModel<com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto> updateByIdElevator(@RequestBody com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto elevatorDto) {
return ResponseHelper.buildResponse(elevatorService.updateElevator(elevatorDto));
}
/**
* 根据id查询
* 根据sequenceNbr查询
*
* @param id id
* @param sequenceNbr sequenceNbr
* @return 返回结果
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@RequestMapping(value = "/{sequenceNbr}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel<ElevatorVo> selectById(@PathVariable Long id) {
Elevator elevator = iElevatorService.getById(id);
ElevatorVo elevatorVo = BeanDtoVoUtils.convertElevatorToVo(elevator,false);
return ResponseHelper.buildResponse(elevatorVo);
public ResponseModel<com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto> selectById(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(elevatorService.selectBySeq(sequenceNbr));
}
/**
......@@ -118,7 +115,7 @@ public class ElevatorController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", notes = "列表分页查询")
public ResponseModel<IPage<ElevatorVo>> listPage(String pageNum, String pageSize, ElevatorDto elevatorDto) {
public ResponseModel<IPage<ElevatorDto>> listPage(String pageNum, String pageSize, com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto elevatorDto) {
Elevator elevator = BeanDtoVoUtils.convert(elevatorDto, Elevator.class);
Page<Elevator> pageBean;
QueryWrapper<Elevator> elevatorQueryWrapper = new QueryWrapper<>();
......@@ -131,16 +128,16 @@ public class ElevatorController extends BaseController {
Class<?> type = field.getType();
String name = NameUtils.camel2Underline(field.getName());
if (type.equals(Integer.class)) {
Integer fileValue = (Integer) field.get(elevator);
Integer fileValue = (Integer) o;
elevatorQueryWrapper.eq(name, fileValue);
} else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(elevator);
Long fileValue = (Long) o;
elevatorQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) {
String fileValue = (String) field.get(elevator);
String fileValue = (String) o;
elevatorQueryWrapper.eq(name, fileValue);
} else {
String fileValue = (String) field.get(elevator);
String fileValue = (String) o;
elevatorQueryWrapper.eq(name, fileValue);
}
}
......@@ -155,7 +152,7 @@ public class ElevatorController extends BaseController {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = iElevatorService.page(pageBean, elevatorQueryWrapper);
IPage<ElevatorVo> elevatorVoIPage = BeanDtoVoUtils.elevatorIPageVo(page);
IPage<ElevatorDto> elevatorVoIPage = BeanDtoVoUtils.elevatorIPageDto(page);
return ResponseHelper.buildResponse(elevatorVoIPage);
}
......@@ -169,7 +166,7 @@ public class ElevatorController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/page/similar", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "相似电梯模糊查询", notes = "相似电梯模糊查询")
public ResponseModel<List<ElevatorVo>> similar(@RequestBody ElevatorNewDto elevatorNewDto) {
public ResponseModel<List<ElevatorDto>> similar(@RequestBody ElevatorNewDto elevatorNewDto) {
Elevator elevator = BeanDtoVoUtils.convert(elevatorNewDto.getElevatorDto(), Elevator.class);
QueryWrapper<Elevator> elevatorQueryWrapper = new QueryWrapper<>();
Class<? extends Elevator> aClass = elevator.getClass();
......@@ -195,13 +192,12 @@ public class ElevatorController extends BaseController {
}
});
List<Elevator> elevators = iElevatorService.list(elevatorQueryWrapper);
List<ElevatorVo> elevatorVos = new ArrayList<>();
for (Elevator elevato:elevators
) {
ElevatorVo elevatorVo = BeanDtoVoUtils.convertElevatorToVo(elevato,false);
elevatorVos.add(elevatorVo);
List<ElevatorDto> elevatorDtoList = new ArrayList<>();
for (Elevator ele : elevators ) {
ElevatorDto eleDto = BeanDtoVoUtils.convertElevatorToDto(ele,false);
elevatorDtoList.add(eleDto);
}
return ResponseHelper.buildResponse(elevatorVos);
return ResponseHelper.buildResponse(elevatorDtoList);
}
/**
......@@ -215,8 +211,8 @@ public class ElevatorController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/query_elevator_list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "分页查询电梯信息", notes = "分页查询电梯信息")
public ResponseModel<IPage<ElevatorVo>> queryElevatorList(String pageNum, String pageSize,
ElevatorDto elevatorDto) {
public ResponseModel<IPage<ElevatorDto>> queryElevatorList(String pageNum, String pageSize,
com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto elevatorDto) {
Elevator elevator = BeanDtoVoUtils.convert(elevatorDto, Elevator.class);
Page<Elevator> pageBean;
QueryWrapper<Elevator> elevatorQueryWrapper = new QueryWrapper<>();
......@@ -249,8 +245,8 @@ public class ElevatorController extends BaseController {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = iElevatorService.page(pageBean, elevatorQueryWrapper);
IPage<ElevatorVo> elevatorVoIPage = BeanDtoVoUtils.elevatorIPageVo(page);
return ResponseHelper.buildResponse(elevatorVoIPage);
IPage<ElevatorDto> elevatorDtoIPage = BeanDtoVoUtils.elevatorIPageDto(page);
return ResponseHelper.buildResponse(elevatorDtoIPage);
}
}
......@@ -5,20 +5,15 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.MaintenanceUnitDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit;
import com.yeejoin.amos.boot.module.tzs.api.entity.UseUnit;
import com.yeejoin.amos.boot.module.tzs.api.service.IMaintenanceUnitService;
import com.yeejoin.amos.boot.module.tzs.api.vo.DutyPersonVo;
import com.yeejoin.amos.boot.module.tzs.api.vo.MaintenanceUnitNameVo;
import com.yeejoin.amos.boot.module.tzs.api.vo.MaintenanceUnitVo;
import com.yeejoin.amos.boot.module.tzs.api.vo.UseUnitVo;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.tzs.api.dto.MaintenanceUnitNameDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ElevatorServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
......@@ -108,10 +103,10 @@ public class MaintenanceUnitController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel<MaintenanceUnitVo> selectById(@PathVariable Long id) {
public ResponseModel<MaintenanceUnitDto> selectById(@PathVariable Long id) {
MaintenanceUnit maintenanceUnit = iMaintenanceUnitService.getById(id);
MaintenanceUnitVo maintenanceUnitVo = BeanDtoVoUtils.convertMaintenanceUnitToVo(maintenanceUnit, false);
return ResponseHelper.buildResponse(maintenanceUnitVo);
MaintenanceUnitDto maintenanceUnitDto = BeanDtoVoUtils.convertMaintenanceUnitToVo(maintenanceUnit, false);
return ResponseHelper.buildResponse(maintenanceUnitDto);
}
/**
......@@ -125,7 +120,7 @@ public class MaintenanceUnitController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", notes = "列表分页查询")
public ResponseModel<IPage<MaintenanceUnitVo>> listPage(String pageNum, String pageSize,
public ResponseModel<IPage<MaintenanceUnitDto>> listPage(String pageNum, String pageSize,
MaintenanceUnit maintenanceUnitDto) {
MaintenanceUnit maintenanceUnit = BeanDtoVoUtils.convert(maintenanceUnitDto, MaintenanceUnit.class);
Page<MaintenanceUnit> pageBean;
......@@ -163,8 +158,8 @@ public class MaintenanceUnitController extends BaseController {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = iMaintenanceUnitService.page(pageBean, maintenanceUnitQueryWrapper);
IPage<MaintenanceUnitVo> maintenanceUnitVoIPage = BeanDtoVoUtils.maintenanceUnitIPageVo(page);
return ResponseHelper.buildResponse(maintenanceUnitVoIPage);
IPage<MaintenanceUnitDto> maintenanceUnitDtoIPage = BeanDtoVoUtils.maintenanceUnitIPageDto(page);
return ResponseHelper.buildResponse(maintenanceUnitDtoIPage);
}
/**
......@@ -178,7 +173,7 @@ public class MaintenanceUnitController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/query_maintenance_unit_list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "分页查询维保单位信息", notes = "分页查询维保单位信息")
public ResponseModel<IPage<MaintenanceUnitVo>> queryMaintenanceUnitList(String pageNum, String pageSize,
public ResponseModel<IPage<MaintenanceUnitDto>> queryMaintenanceUnitList(String pageNum, String pageSize,
MaintenanceUnit maintenanceUnitDto) {
MaintenanceUnit maintenanceUnit = BeanDtoVoUtils.convert(maintenanceUnitDto, MaintenanceUnit.class);
Page<MaintenanceUnit> pageBean;
......@@ -212,8 +207,8 @@ public class MaintenanceUnitController extends BaseController {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = iMaintenanceUnitService.page(pageBean, maintenanceUnitQueryWrapper);
IPage<MaintenanceUnitVo> maintenanceUnitVoIPage = BeanDtoVoUtils.maintenanceUnitIPageVo(page);
return ResponseHelper.buildResponse(maintenanceUnitVoIPage);
IPage<MaintenanceUnitDto> maintenanceUnitDtoIPage = BeanDtoVoUtils.maintenanceUnitIPageDto(page);
return ResponseHelper.buildResponse(maintenanceUnitDtoIPage);
}
/**
......@@ -225,15 +220,15 @@ public class MaintenanceUnitController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/query_maintenance_unit_name_list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据名称查询维保单位列表", notes = "根据名称查询维保单位列表")
public ResponseModel<IPage<MaintenanceUnitNameVo>> queryMaintenanceUnitListWithName(@PathVariable(required =
public ResponseModel<IPage<MaintenanceUnitNameDto>> queryMaintenanceUnitListWithName(@PathVariable(required =
false) String unitName) {
QueryWrapper<MaintenanceUnit> maintenanceUnitQueryWrapper = new QueryWrapper<>();
maintenanceUnitQueryWrapper.select("distinct sequence_nbr,unit_name").like(StringUtils.isNotEmpty(unitName),
"unit_name", unitName);
Page<MaintenanceUnit> pageBean = new Page<>(0, Long.MAX_VALUE);
IPage<MaintenanceUnit> page = iMaintenanceUnitService.page(pageBean, maintenanceUnitQueryWrapper);
IPage<MaintenanceUnitNameVo> maintenanceUnitVoIPage = BeanDtoVoUtils.iPageVoStream(page,
MaintenanceUnitNameVo.class);
IPage<MaintenanceUnitNameDto> maintenanceUnitVoIPage = BeanDtoVoUtils.iPageVoStream(page,
MaintenanceUnitNameDto.class);
return ResponseHelper.buildResponse(maintenanceUnitVoIPage);
}
......@@ -245,24 +240,26 @@ public class MaintenanceUnitController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/alert/{alertId}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据警情id 查找设备维保单位信息", notes = "根据警情id 查找设备维保单位信息")
public ResponseModel<MaintenanceUnitVo> selectByAlertId(@PathVariable Long alertId) {
public ResponseModel<MaintenanceUnitDto> selectByAlertId(@PathVariable Long alertId) {
// 获取根据警情获取电梯信息
Elevator elevator = elevatorServiceImpl.selectByAlertId(alertId);
if (ValidationUtil.isEmpty(elevator))
if (ValidationUtil.isEmpty(elevator)) {
throw new BadRequest("设备未找到");
}
// 根据设备使用单位id 获取使用单位信息
MaintenanceUnit maintenanceUnit = iMaintenanceUnitService.getById(elevator.getMaintainUnitId());
if (ValidationUtil.isEmpty(maintenanceUnit))
if (ValidationUtil.isEmpty(maintenanceUnit)) {
throw new BadRequest("维保单位未找到");
MaintenanceUnitVo maintenanceUnitVo = BeanDtoVoUtils.convert(maintenanceUnit, MaintenanceUnitVo.class);
List<DutyPersonVo> dutyPersonList = new ArrayList<DutyPersonVo>();
DutyPersonVo principal = new DutyPersonVo();
}
MaintenanceUnitDto maintenanceUnitVo = BeanDtoVoUtils.convert(maintenanceUnit, MaintenanceUnitDto.class);
List<DutyPersonDto> dutyPersonList = new ArrayList<DutyPersonDto>();
DutyPersonDto principal = new DutyPersonDto();
principal.setDeptName("主要负责人1");
principal.setPhone(maintenanceUnitVo.getPrincipalFirstPhone());
principal.setUserId(maintenanceUnitVo.getPrincipalFirstId()+"");
principal.setUserName(maintenanceUnitVo.getPrincipalFirst());
dutyPersonList.add(principal);
DutyPersonVo manager = new DutyPersonVo();
DutyPersonDto manager = new DutyPersonDto();
manager.setDeptName("主要负责人2");
manager.setPhone(maintenanceUnitVo.getPrincipalSecondPhone());
manager.setUserId(maintenanceUnitVo.getPrincipalSecondId()+"");
......
......@@ -9,7 +9,6 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.RescueStationDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.RescueStation;
import com.yeejoin.amos.boot.module.tzs.api.service.IRescueStationService;
import com.yeejoin.amos.boot.module.tzs.api.vo.RescueStationVo;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ElevatorServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import io.swagger.annotations.Api;
......@@ -18,7 +17,11 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -110,10 +113,10 @@ public class RescueStationController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel<RescueStationVo> selectById(@PathVariable Long id) {
public ResponseModel<RescueStationDto> selectById(@PathVariable Long id) {
RescueStation rescueStation = iRescueStationService.getById(id);
RescueStationVo rescueStationVo = BeanDtoVoUtils.convert(rescueStation, RescueStationVo.class);
return ResponseHelper.buildResponse(rescueStationVo);
RescueStationDto rescueStationDto = BeanDtoVoUtils.convert(rescueStation, RescueStationDto.class);
return ResponseHelper.buildResponse(rescueStationDto);
}
/**
......@@ -127,8 +130,8 @@ public class RescueStationController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", notes = "列表分页查询")
public ResponseModel<IPage<RescueStationVo>> listPage(String pageNum, String pageSize,
RescueStationDto rescueStationDto) {
public ResponseModel<IPage<RescueStationDto>> listPage(String pageNum, String pageSize,
RescueStationDto rescueStationDto) {
RescueStation rescueStation = BeanDtoVoUtils.convert(rescueStationDto, RescueStation.class);
Page<RescueStation> pageBean;
QueryWrapper<RescueStation> rescueStationQueryWrapper = new QueryWrapper<>();
......@@ -165,8 +168,8 @@ public class RescueStationController extends BaseController {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = iRescueStationService.page(pageBean, rescueStationQueryWrapper);
IPage<RescueStationVo> rescueStationVoIPage = BeanDtoVoUtils.iPageVoStream(page, RescueStationVo.class);
return ResponseHelper.buildResponse(rescueStationVoIPage);
IPage<RescueStationDto> rescueStationDtoIPage = BeanDtoVoUtils.iPageVoStream(page, RescueStationDto.class);
return ResponseHelper.buildResponse(rescueStationDtoIPage);
}
/**
......@@ -180,7 +183,7 @@ public class RescueStationController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/query_rescue_station_list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "分页查询救援站信息", notes = "分页查询救援站信息")
public ResponseModel<IPage<RescueStationVo>> queryRescueStationList(String pageNum, String pageSize,
public ResponseModel<IPage<RescueStationDto>> queryRescueStationList(String pageNum, String pageSize,
RescueStationDto rescueStationDto) {
RescueStation rescueStation = BeanDtoVoUtils.convert(rescueStationDto, RescueStation.class);
Page<RescueStation> pageBean;
......@@ -215,8 +218,8 @@ public class RescueStationController extends BaseController {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = iRescueStationService.page(pageBean, rescueStationQueryWrapper);
IPage<RescueStationVo> rescueStationVoIPage = BeanDtoVoUtils.iPageVoStream(page, RescueStationVo.class);
return ResponseHelper.buildResponse(rescueStationVoIPage);
IPage<RescueStationDto> rescueStationDtoIPage = BeanDtoVoUtils.iPageVoStream(page, RescueStationDto.class);
return ResponseHelper.buildResponse(rescueStationDtoIPage);
}
......
......@@ -7,15 +7,14 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.feign.AmosFeignService;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.tzs.api.dto.UseUnitDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.UseUnit;
import com.yeejoin.amos.boot.module.tzs.api.service.IUseUnitService;
import com.yeejoin.amos.boot.module.tzs.api.vo.DutyPersonVo;
import com.yeejoin.amos.boot.module.tzs.api.vo.UseUnitVo;
import com.yeejoin.amos.boot.module.tzs.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ElevatorServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
......@@ -127,10 +126,10 @@ public class UseUnitController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel<UseUnitVo> selectById(@PathVariable Long id) {
public ResponseModel<UseUnitDto> selectById(@PathVariable Long id) {
UseUnit useUnit = iUseUnitService.getById(id);
UseUnitVo useUnitVo = BeanDtoVoUtils.convert(useUnit, UseUnitVo.class);
return ResponseHelper.buildResponse(useUnitVo);
UseUnitDto useUnitDto = BeanDtoVoUtils.convert(useUnit, UseUnitDto.class);
return ResponseHelper.buildResponse(useUnitDto);
}
/**
......@@ -211,22 +210,23 @@ public class UseUnitController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/alert/{alertId}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据警情id 查找设备使用单位信息", notes = "根据警情id 查找设备使用单位信息")
public ResponseModel<UseUnitVo> selectByAlertId(@PathVariable Long alertId) {
public ResponseModel<UseUnitDto> selectByAlertId(@PathVariable Long alertId) {
// 获取根据警情获取电梯信息
Elevator elevator = elevatorServiceImpl.selectByAlertId(alertId);
// 根据设备使用单位id 获取使用单位信息
UseUnit useUnit = iUseUnitService.getById(elevator.getUseUnitId());
if (ValidationUtil.isEmpty(useUnit))
if (ValidationUtil.isEmpty(useUnit)) {
throw new BadRequest("使用单位未找到");
UseUnitVo useUnitVo = BeanDtoVoUtils.convert(useUnit, UseUnitVo.class);
List<DutyPersonVo> dutyPersonList = new ArrayList<DutyPersonVo>();
DutyPersonVo principal = new DutyPersonVo();
}
UseUnitDto useUnitVo = BeanDtoVoUtils.convert(useUnit, UseUnitDto.class);
List<DutyPersonDto> dutyPersonList = new ArrayList<DutyPersonDto>();
DutyPersonDto principal = new DutyPersonDto();
principal.setDeptName("主要负责人");
principal.setPhone(useUnitVo.getPrincipalPhone());
principal.setUserId(useUnitVo.getPrincipalId()+"");
principal.setUserName(useUnitVo.getPrincipal());
dutyPersonList.add(principal);
DutyPersonVo manager = new DutyPersonVo();
DutyPersonDto manager = new DutyPersonDto();
manager.setDeptName("电梯安全管理员");
manager.setPhone(useUnitVo.getManagerPhone());
manager.setUserId(useUnitVo.getManagerId()+"");
......
......@@ -18,7 +18,6 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.Template;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.tzs.api.vo.AlertCalledVo;
import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import org.apache.logging.log4j.LogManager;
......@@ -94,22 +93,21 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
}
}
AlertCalledDto alertCalledDto = BeanDtoVoUtils.convert(alertCalled,AlertCalledDto.class);
AlertCalledVo alertCalledVo = AlertBeanDtoVoUtils.convertAlertCalledDtoToVo(alertCalledDto);
QueryWrapper<Elevator> elevatorQueryWrapper = new QueryWrapper<>();
elevatorQueryWrapper.eq("rescue_code", alertCalled.getDeviceId());
elevatorQueryWrapper.eq("register_code", alertCalled.getRegistrationCode());
Elevator elevator = iElevatorService.getOne(elevatorQueryWrapper);
if(null != elevator) {
alertCalledVo.setAddress(elevator.getAddress());
alertCalledVo.setProvince(elevator.getProvince());
alertCalledVo.setCity(elevator.getCity());
alertCalledVo.setDistrict(elevator.getDistrict());
alertCalledVo.setUseStatus(elevator.getUseStatus());
alertCalledVo.setUseSiteCategory(elevator.getUseSiteCategory());
alertCalledVo.setUseUnit(elevator.getUseUnit());
alertCalledVo.setRegionCode(elevator.getRegionCode());
alertCalledDto.setAddress(elevator.getAddress());
alertCalledDto.setProvince(elevator.getProvince());
alertCalledDto.setCity(elevator.getCity());
alertCalledDto.setDistrict(elevator.getDistrict());
alertCalledDto.setUseStatus(elevator.getUseStatus());
alertCalledDto.setUseSiteCategory(elevator.getUseSiteCategory());
alertCalledDto.setUseUnit(elevator.getUseUnit());
alertCalledDto.setRegionCode(elevator.getRegionCode());
}
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalledVo, formValue);
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalledDto, formValue);
redisUtils.set(RedisKey.TZS_ALERTCALLED_ID+id, JSON.toJSON(alertCalledFormVo),time);
return alertCalledFormVo;
......@@ -132,22 +130,21 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
}
}
AlertCalledDto alertCalledDto = BeanDtoVoUtils.convert(alertCalled,AlertCalledDto.class);
AlertCalledVo alertCalledVo = AlertBeanDtoVoUtils.convertAlertCalledDtoToVo(alertCalledDto);
QueryWrapper<Elevator> elevatorQueryWrapper = new QueryWrapper<>();
elevatorQueryWrapper.eq("rescue_code", alertCalled.getDeviceId());
elevatorQueryWrapper.eq("register_code", alertCalled.getRegistrationCode());
Elevator elevator = iElevatorService.getOne(elevatorQueryWrapper);
if(null != elevator) {
alertCalledVo.setAddress(elevator.getAddress());
alertCalledVo.setProvince(elevator.getProvince());
alertCalledVo.setCity(elevator.getCity());
alertCalledVo.setDistrict(elevator.getDistrict());
alertCalledVo.setUseStatus(elevator.getUseStatus());
alertCalledVo.setUseSiteCategory(elevator.getUseSiteCategory());
alertCalledVo.setUseUnit(elevator.getUseUnit());
alertCalledVo.setRegionCode(elevator.getRegionCode());
alertCalledDto.setAddress(elevator.getAddress());
alertCalledDto.setProvince(elevator.getProvince());
alertCalledDto.setCity(elevator.getCity());
alertCalledDto.setDistrict(elevator.getDistrict());
alertCalledDto.setUseStatus(elevator.getUseStatus());
alertCalledDto.setUseSiteCategory(elevator.getUseSiteCategory());
alertCalledDto.setUseUnit(elevator.getUseUnit());
alertCalledDto.setRegionCode(elevator.getRegionCode());
}
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalledVo, formValue);
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalledDto, formValue);
return alertCalledFormVo;
}
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertFormInitDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchConsultFeedbackDto;
......@@ -21,7 +22,6 @@ import com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums;
import com.yeejoin.amos.boot.module.tzs.api.mapper.DispatchPaperMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IDispatchPaperService;
import com.yeejoin.amos.boot.module.tzs.api.service.IMaintenanceUnitService;
import com.yeejoin.amos.boot.module.tzs.api.vo.AlertCalledVo;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -206,9 +206,9 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchSaveFeedbackDto.setAlertId(alertId);
AlertCalledFormDto alertCalledFormVo = alertCalledServiceImpl.selectAlertCalledByIdNoCache(alertId);
// 警情信息
AlertCalledVo alertCalledVo = alertCalledFormVo.getAlertCalledVo();
dispatchSaveFeedbackDto.setEmergency(alertCalledVo.getEmergencyPerson());
dispatchSaveFeedbackDto.setEmergencyCall(alertCalledVo.getEmergencyCall());
AlertCalledDto alertCalledDto = alertCalledFormVo.getAlertCalledDto();
dispatchSaveFeedbackDto.setEmergency(alertCalledDto.getEmergencyPerson());
dispatchSaveFeedbackDto.setEmergencyCall(alertCalledDto.getEmergencyCall());
// 派遣单信息
DispatchPaperFormDto dispatchPaperFormDto = this.selectDispatchPaperDtoByAlertId(alertId);
if(dispatchPaperFormDto == null || dispatchPaperFormDto.getDispatchPaper() == null) {
......@@ -365,9 +365,9 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchRepairFeedbackDto.setAlertId(alertId);
AlertCalledFormDto alertCalledFormVo = alertCalledServiceImpl.selectAlertCalledByIdNoCache(alertId);
// 警情信息
AlertCalledVo alertCalledVo = alertCalledFormVo.getAlertCalledVo();
dispatchRepairFeedbackDto.setEmergency(alertCalledVo.getEmergencyPerson());
dispatchRepairFeedbackDto.setEmergencyCall(alertCalledVo.getEmergencyCall());
AlertCalledDto alertCalledDto = alertCalledFormVo.getAlertCalledDto();
dispatchRepairFeedbackDto.setEmergency(alertCalledDto.getEmergencyPerson());
dispatchRepairFeedbackDto.setEmergencyCall(alertCalledDto.getEmergencyCall());
// 派遣单信息
DispatchPaperFormDto dispatchPaperFormDto = this.selectDispatchPaperDtoByAlertId(alertId);
......@@ -555,9 +555,9 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchConsultFeedbackDto.setAlertId(alertId);
AlertCalledFormDto alertCalledFormVo = alertCalledServiceImpl.selectAlertCalledByIdNoCache(alertId);
// 警情信息
AlertCalledVo alertCalledVo = alertCalledFormVo.getAlertCalledVo();
dispatchConsultFeedbackDto.setEmergency(alertCalledVo.getEmergencyPerson());
dispatchConsultFeedbackDto.setEmergencyCall(alertCalledVo.getEmergencyCall());
AlertCalledDto alertCalledDto = alertCalledFormVo.getAlertCalledDto();
dispatchConsultFeedbackDto.setEmergency(alertCalledDto.getEmergencyPerson());
dispatchConsultFeedbackDto.setEmergencyCall(alertCalledDto.getEmergencyCall());
// 派遣单信息
DispatchPaperFormDto dispatchPaperFormDto = this.selectDispatchPaperDtoByAlertId(alertId);
......
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto;
......@@ -13,6 +16,8 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.List;
/**
* 服务实现类
*
......@@ -37,12 +42,29 @@ public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, Elev
public ElevatorDto saveElevator(ElevatorDto elevatorDto) {
elevatorDto = createWithModel(elevatorDto);
// TODO 保存附件
// sourceFileService.saveAttachments(elevatorDto.getSequenceNbr(), elevatorDto.getAttachments());
// 保存附件
sourceFileService.saveAttachments(elevatorDto.getSequenceNbr(), elevatorDto.getAttachments());
return elevatorDto;
}
/**
* 批量删除电梯信息
*
* @param seqStr 电梯主键(逗号分割)
* @return
*/
public boolean deleteBatchBySeq(String seqStr) {
if (!ValidationUtil.isEmpty(seqStr)) {
List<String> seqList = Lists.newArrayList(seqStr.split(","));
LambdaUpdateWrapper<Elevator> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.in(Elevator::getSequenceNbr, seqList).set(Elevator::getIsDelete, true);
this.update(lambdaUpdateWrapper);
return true;
}
return false;
}
/**
* 更新电梯信息
*
* @param elevatorDto
......@@ -51,11 +73,24 @@ public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, Elev
public ElevatorDto updateElevator(ElevatorDto elevatorDto) {
elevatorDto = updateWithModel(elevatorDto);
// TODO 保存附件
// sourceFileService.saveAttachments(elevatorDto.getSequenceNbr(), elevatorDto.getAttachments());
// 保存附件
sourceFileService.saveAttachments(elevatorDto.getSequenceNbr(), elevatorDto.getAttachments());
return elevatorDto;
}
/**
* 根据id查询电梯信息
*
* @param sequenceNbr
* @return
*/
public ElevatorDto selectBySeq(Long sequenceNbr) {
ElevatorDto elevatorDto = this.queryBySeq(sequenceNbr);
// 获取附件
elevatorDto.setAttachments(sourceFileService.getAttachments(sequenceNbr));
return elevatorDto;
}
@Override
public Elevator selectByAlertId(Long alertId) {
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchPaperFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.RepairConsultDto;
......@@ -15,7 +16,6 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.Template;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.mapper.RepairConsultMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IRepairConsultService;
import com.yeejoin.amos.boot.module.tzs.api.vo.AlertCalledVo;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -72,10 +72,10 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
RepairConsult repairConsult = new RepairConsult();
repairConsult.setParentId(alertId);
AlertCalledFormDto alertCallFrom = alertCalledServiceImpl.selectAlertCalledByIdNoCache(alertId);
if(alertCallFrom == null || alertCallFrom.getAlertCalledVo() == null) {
if(alertCallFrom == null || alertCallFrom.getAlertCalledDto() == null) {
throw new BadRequest("未找到警情信息");
}
AlertCalledVo alertCalledVo = alertCallFrom.getAlertCalledVo();
AlertCalledDto alertCalledVo = alertCallFrom.getAlertCalledDto();
// 获取模板 拼接json
QueryWrapper<Template> templateQueryWrapper = new QueryWrapper<>();
templateQueryWrapper.eq("type_code","RECORD-" + type);
......
......@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.tzs.biz.utils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.vo.AlertCalledVo;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
......@@ -21,38 +20,14 @@ public class AlertBeanDtoVoUtils {
* @param source 实体类
* @return Vo类
*/
public static AlertCalledVo convertAlertCalledDtoToVo( AlertCalledDto source) {
public static AlertCalledDto convertAlertCalledToDto(AlertCalled source) {
// 判断source是否为空
if (source == null) {
return null;
}
try {
// 创建新的对象实例
AlertCalledVo target = new AlertCalledVo();
// 把原对象数据拷贝到新对象
BeanUtils.copyProperties(source, target);
// 返回新对象
return target;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 将警情记录实体类转换为Vo
*
* @param source 实体类
* @return Vo类
*/
public static AlertCalledVo convertAlertCalledToVo( AlertCalled source) {
// 判断source是否为空
if (source == null) {
return null;
}
try {
// 创建新的对象实例
AlertCalledVo target = new AlertCalledVo();
AlertCalledDto target = new AlertCalledDto();
// 把原对象数据拷贝到新对象
BeanUtils.copyProperties(source, target);
// 返回新对象
......@@ -71,10 +46,10 @@ public class AlertBeanDtoVoUtils {
* @param page 原分页对象
* @return 转换后的Vo
*/
public static IPage<AlertCalledVo> alertCalledIPageVo(IPage<AlertCalled> page) {
public static IPage<AlertCalledDto> alertCalledIPageDto(IPage<AlertCalled> page) {
return page.convert(item -> {
try {
return convertAlertCalledToVo(item);
return convertAlertCalledToDto(item);
} catch (Exception e) {
return null;
}
......
......@@ -2,17 +2,16 @@ package com.yeejoin.amos.boot.module.tzs.biz.utils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.feign.AmosFeignService;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.MaintenanceUnitDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit;
import com.yeejoin.amos.boot.module.tzs.api.vo.ElevatorVo;
import com.yeejoin.amos.boot.module.tzs.api.vo.MaintenanceUnitVo;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
......@@ -118,28 +117,22 @@ public class BeanDtoVoUtils {
}
/**
* 将电梯实体类转换为Vo
* 将电梯实体类转换为Dto
*
* @param source 实体类
* @param isBatch 是否批量
* @return Vo类
*/
public static ElevatorVo convertElevatorToVo(Elevator source, boolean isBatch) {
public static ElevatorDto convertElevatorToDto(Elevator source, boolean isBatch) {
// 判断source是否为空
if (source == null) {
return null;
}
try {
// 创建新的对象实例
ElevatorVo target = new ElevatorVo();
ElevatorDto target = new ElevatorDto();
// 把原对象数据拷贝到新对象
BeanUtils.copyProperties(source, target);
// 将设备图片转换为集合
String photos = source.getPhotos();
if (photos != null) {
String[] photoList = photos.split(",");
target.setImg(Arrays.stream(photoList).map(ElevatorVo.Img::new).collect(Collectors.toList()));
}
if (!isBatch) {
getElevatorDictionaryByDictCode();
}
......@@ -169,12 +162,12 @@ public class BeanDtoVoUtils {
}
/**
* 将Elevator转换为IPage<ElevatorVo>
* 将Elevator转换为IPage<ElevatorDto>
*
* @param page 原分页对象
* @return 转换后的Vo
*/
public static IPage<ElevatorVo> elevatorIPageVo(IPage<Elevator> page) {
public static IPage<ElevatorDto> elevatorIPageDto(IPage<Elevator> page) {
try {
getElevatorDictionaryByDictCode();
} catch (Exception e) {
......@@ -182,7 +175,7 @@ public class BeanDtoVoUtils {
}
return page.convert(item -> {
try {
return convertElevatorToVo(item, true);
return convertElevatorToDto(item, true);
} catch (Exception e) {
return null;
}
......@@ -198,14 +191,14 @@ public class BeanDtoVoUtils {
* @param isBatch 是否批量
* @return 转换后的Vo
*/
public static MaintenanceUnitVo convertMaintenanceUnitToVo(MaintenanceUnit source, boolean isBatch) {
public static MaintenanceUnitDto convertMaintenanceUnitToVo(MaintenanceUnit source, boolean isBatch) {
// 判断source是否为空
if (source == null) {
return null;
}
try {
// 创建新的对象实例
MaintenanceUnitVo target = new MaintenanceUnitVo();
MaintenanceUnitDto target = new MaintenanceUnitDto();
// 把原对象数据拷贝到新对象
BeanUtils.copyProperties(source, target);
// 返回新对象
......@@ -229,7 +222,7 @@ public class BeanDtoVoUtils {
* @param page 原分页对象
* @return 转换后的分页对象
*/
public static IPage<MaintenanceUnitVo> maintenanceUnitIPageVo(IPage<MaintenanceUnit> page) {
public static IPage<MaintenanceUnitDto> maintenanceUnitIPageDto(IPage<MaintenanceUnit> page) {
try {
getMaintenanceUnitDictionaryByDictCode();
} catch (Exception e) {
......
......@@ -39,9 +39,4 @@ file.url=http://39.98.45.134:9000/
video.url=https://11.11.16.4:443/
params.work.flow.normalProcessDefinitionKey=normalHazardManagement
params.work.flow.processDefinitionKey=hazardManagement
params.work.flow.address=http://172.16.3.4:30040
#params.work.flow.address=http://172.16.10.80:30040
params.spc.address=http://172.16.3.89:9001
failure.work.flow.processDefinitionKey=malfunction_repair
\ No newline at end of file
......@@ -171,28 +171,14 @@
</select>
<select id="getPlanTasks" resultType="Map">
SELECT
a.planTaskId,
a.OrgCode,
a.taskName,
a.userId,
a.beginTime,
a.endTime,
a.checkDate,
a.finishNum,
a.taskPlanNum,
a.finishStatus,
a.batchNo,
a.userId executiveName,
a.userName,
a.userDept
FROM
(
SELECT
SELECT
*
FROM
(SELECT
pt.id planTaskId,
pt.org_code OrgCode,
p. NAME taskName,
pt. STATUS,
pt.org_code orgCode,
p.name taskName,
pt.status,
pt.user_id userId,
date_format(
pt.begin_time,
......@@ -202,93 +188,83 @@
pt.end_time,
'%Y-%m-%d %H:%i:%s'
) endTime,
date_format(
pt.check_date,
'%Y-%m-%d %H:%i:%s'
)checkDate,
) checkDate,
pt.point_num as taskPlanNum,
pt.finish_num finishNum,
(pt.point_num - pt.finish_num) as waitNum,
pt.finish_status finishStatus,
pt.id batchNo,
pt.route_id,
pt.point_num taskPlanNum,
pt.user_name userName,
pt.user_dept userDept
r.owner_id,
R.owner_name as ownerName
FROM
p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id
p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id
) a
<include refid="mobile-plan-task-where" />
limit #{offset},#{pageSize}
</select>
<sql id="mobile-plan-task-where">
<where>
<if test="userId != null and userId > 0 "> and find_in_set(#{userId},a.userId)>0</if>
<if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if>
<if test="orgCode != null and orgCode !=''" >
and (a.OrgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.OrgCode= #{orgCode} )
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
AND (
(
a.beginTime <![CDATA[>=]]> #{startTime}
AND a.endTime <![CDATA[<=]]> #{endTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{endTime}
AND a.endTime <![CDATA[>=]]> #{endTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{startTime}
AND a.endTime <![CDATA[>]]> #{startTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{startTime}
AND a.endTime <![CDATA[>=]]> #{endTime}
)
<if test="userId != null and userId > 0 "> and find_in_set(#{userId},a.userId)>0</if>
<if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
AND (
(
a.beginTime <![CDATA[>=]]> #{startTime}
AND a.endTime <![CDATA[<=]]> #{endTime}
)
</if>
OR (
a.beginTime <![CDATA[<=]]> #{endTime}
AND a.endTime <![CDATA[>=]]> #{endTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{startTime}
AND a.endTime <![CDATA[>]]> #{startTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{startTime}
AND a.endTime <![CDATA[>=]]> #{endTime}
)
)
</if>
<choose>
<when test="identityType==1">
And (a.orgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.orgCode= #{orgCode} )
<if test="companyId != null"> and a.owner_id = #{companyId}</if>
</when>
<when test="identityType==2">
And a.owner_id = #{companyId}
</when>
</choose>
</where>
<if test="orderBy != null and orderBy != '' "> order by ${orderBy} </if>
limit #{offset},#{pageSize}
</select>
<if test="orderBy != null and orderBy != ''"> order by ${orderBy} </if>
</sql>
<select id="getPlanTasksCount" resultType="long">
SELECT
count(1) tasksCount
FROM
(
SELECT
pt.id
FROM
SELECT
pt.id,
pt.user_id as userId,
pt.finish_status as finishStatus,
pt.org_code as orgCode,
pt.begin_time as beginTime,
pt.end_time as endTime,
r.owner_id
FROM
p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id
) a
<where>
<if test="userId != null and userId > 0 "> and find_in_set(#{userId},a.userId)>0 </if>
<if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if>
<if test="orgCode != null and orgCode !=''" >
and (a.OrgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.OrgCode= #{orgCode} )
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
AND (
(
a.beginTime <![CDATA[>=]]> #{startTime}
AND a.endTime <![CDATA[<=]]> #{endTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{endTime}
AND a.endTime <![CDATA[>=]]> #{endTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{startTime}
AND a.endTime <![CDATA[>]]> #{startTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{startTime}
AND a.endTime <![CDATA[>=]]> #{endTime}
)
)
</if>
</where>
<include refid="mobile-plan-task-where" />
</select>
<select id="queryPlanTaskById" resultType="Map">
SELECT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment