Commit 2b5905e7 authored by litengwei's avatar litengwei

任务 24281

parent 5eca641c
...@@ -84,6 +84,53 @@ public class PluginInterceptor implements Interceptor { ...@@ -84,6 +84,53 @@ public class PluginInterceptor implements Interceptor {
ReflectionUtils.makeAccessible(field); ReflectionUtils.makeAccessible(field);
field.set(boundSql, sql); field.set(boundSql, sql);
return executor.query(mappedStatement, parameter, rowBounds, resultHandler, cacheKey, boundSql); return executor.query(mappedStatement, parameter, rowBounds, resultHandler, cacheKey, boundSql);
} else if ("com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper.listAll".equals(id) ||
"com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper.listOneDayDutyPerson".equals(id) ||
"com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper.pageList".equals(id)) {
HashMap par = new HashMap();
if (parameter instanceof HashMap) {
par = (HashMap) ((HashMap<?, ?>) parameter).get("params");
}
Iterator<String> iterator = par.keySet().iterator();
while (iterator.hasNext()) {
String next = iterator.next();
sql = sql.replaceFirst("_code", next);
}
//通过反射修改sql语句
Field field = boundSql.getClass().getDeclaredField("sql");
ReflectionUtils.makeAccessible(field);
field.set(boundSql, sql);
return executor.query(mappedStatement, parameter, rowBounds, resultHandler, cacheKey, boundSql);
} else if ("com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper.pageListNew".equals(id)) {
HashMap par = new HashMap();
HashMap par1 = new HashMap();
if (parameter instanceof HashMap) {
par = (HashMap) ((HashMap<?, ?>) parameter).get("params");
par1 = (HashMap) ((HashMap<?, ?>) parameter).get("fieldCodes");
}
Iterator<String> iterator = par.keySet().iterator();
while (iterator.hasNext()) {
String next = iterator.next();
sql = sql.replaceFirst("_code", next);
}
Iterator<String> iterator1 = par1.keySet().iterator();
while (iterator1.hasNext()) {
String next = iterator1.next();
sql = sql.replaceFirst("_keyName", next);
}
//通过反射修改sql语句
Field field = boundSql.getClass().getDeclaredField("sql");
ReflectionUtils.makeAccessible(field);
field.set(boundSql, sql);
return executor.query(mappedStatement, parameter, rowBounds, resultHandler, cacheKey, boundSql);
} else { } else {
return invocation.proceed(); return invocation.proceed();
} }
......
...@@ -107,16 +107,16 @@ ...@@ -107,16 +107,16 @@
<foreach collection="params" index="key" item="value" separator=""> <foreach collection="params" index="key" item="value" separator="">
<choose> <choose>
<when test="fieldCodes[key] == 'like' and value !=null and value !=''"> <when test="fieldCodes[key] == 'like' and value !=null and value !=''">
and d.${key} like concat('%',#{value},'%') and d._code like concat('%',#{value},'%')
</when> </when>
<when test="fieldCodes[key] == 'eq' and value !=null and value !=''"> <when test="fieldCodes[key] == 'eq' and value !=null and value !=''">
and d.${key} = #{value} and d._code = #{value}
</when> </when>
<when test="fieldCodes[key] == 'ge' and value !=null and value !=''"> <when test="fieldCodes[key] == 'ge' and value !=null and value !=''">
and d.${key} >= #{value} and d._code >= #{value}
</when> </when>
<when test="fieldCodes[key] == 'le' and value !=null and value !=''"> <when test="fieldCodes[key] == 'le' and value !=null and value !=''">
and d.${key} <![CDATA[<=]]> #{value} and d._code <![CDATA[<=]]> #{value}
</when> </when>
</choose> </choose>
</foreach> </foreach>
...@@ -157,10 +157,10 @@ ...@@ -157,10 +157,10 @@
<foreach collection="params" index="key" item="value" separator=""> <foreach collection="params" index="key" item="value" separator="">
<choose> <choose>
<when test="fieldCodes[key] == 'like' and value !=null and value !=''"> <when test="fieldCodes[key] == 'like' and value !=null and value !=''">
and d.${key} like concat('%',#{value},'%') and d._code like concat('%',#{value},'%')
</when> </when>
<when test="fieldCodes[key] == 'eq' and value !=null and value !=''"> <when test="fieldCodes[key] == 'eq' and value !=null and value !=''">
and d.${key} = #{value} and d._code = #{value}
</when> </when>
</choose> </choose>
</foreach> </foreach>
...@@ -211,10 +211,10 @@ ...@@ -211,10 +211,10 @@
<foreach collection="params" index="key" item="value" separator=""> <foreach collection="params" index="key" item="value" separator="">
<choose> <choose>
<when test="fieldCodes[key] == 'like' and value !=null and value !=''"> <when test="fieldCodes[key] == 'like' and value !=null and value !=''">
and d.${key} like concat('%',#{value},'%') and d._code like concat('%',#{value},'%')
</when> </when>
<when test="fieldCodes[key] == 'eq' and value !=null and value !=''"> <when test="fieldCodes[key] == 'eq' and value !=null and value !=''">
and d.${key} = #{value} and d._code = #{value}
</when> </when>
</choose> </choose>
</foreach> </foreach>
...@@ -335,7 +335,7 @@ ...@@ -335,7 +335,7 @@
<foreach collection="fieldCodes" item="value" index="key" > <foreach collection="fieldCodes" item="value" index="key" >
,MAX(CASE WHEN i.FIELD_CODE = #{key} THEN i.FIELD_VALUE END) as #{key}, ,MAX(CASE WHEN i.FIELD_CODE = #{key} THEN i.FIELD_VALUE END) as #{key},
IF(FIND_IN_SET(i.field_type,'radio,select,treeSelect'), MAX(CASE WHEN i.FIELD_CODE = #{key} THEN IF(FIND_IN_SET(i.field_type,'radio,select,treeSelect'), MAX(CASE WHEN i.FIELD_CODE = #{key} THEN
i.FIELD_VALUE_LABEL END), null) as ${key}Label i.FIELD_VALUE_LABEL END), null) as _keyNameLabel
</foreach> </foreach>
from from
cb_dynamic_form_instance i cb_dynamic_form_instance i
...@@ -361,16 +361,16 @@ ...@@ -361,16 +361,16 @@
<foreach collection="params" index="key" item="value" separator=""> <foreach collection="params" index="key" item="value" separator="">
<choose> <choose>
<when test="fieldCodes[key] == 'like' and value !=null and value !=''"> <when test="fieldCodes[key] == 'like' and value !=null and value !=''">
and d.${key} like concat('%',#{value},'%') and d._code like concat('%',#{value},'%')
</when> </when>
<when test="fieldCodes[key] == 'eq' and value !=null and value !=''"> <when test="fieldCodes[key] == 'eq' and value !=null and value !=''">
and d.${key} = #{value} and d._code = #{value}
</when> </when>
<when test="fieldCodes[key] == 'ge' and value !=null and value !=''"> <when test="fieldCodes[key] == 'ge' and value !=null and value !=''">
and d.${key} >= #{value} and d._code >= #{value}
</when> </when>
<when test="fieldCodes[key] == 'le' and value !=null and value !=''"> <when test="fieldCodes[key] == 'le' and value !=null and value !=''">
and d.${key} <![CDATA[<=]]> #{value} and d._code <![CDATA[<=]]> #{value}
</when> </when>
</choose> </choose>
</foreach> </foreach>
......
...@@ -2013,7 +2013,6 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -2013,7 +2013,6 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
map.put("bizOrgCode", mapPatrol.get("bizOrgCode").toString()); map.put("bizOrgCode", mapPatrol.get("bizOrgCode").toString());
map.put("bizOrgName", mapPatrol.get("bizOrgName").toString()); map.put("bizOrgName", mapPatrol.get("bizOrgName").toString());
try { try {
log.info("每日统计当天巡检任务情况:{}===========", map);
emqKeeper.getMqttClient().publish("equip/patrol/put", JSONObject.toJSONString(map).getBytes(), 1, false); emqKeeper.getMqttClient().publish("equip/patrol/put", JSONObject.toJSONString(map).getBytes(), 1, false);
} catch (MqttException exp) { } catch (MqttException exp) {
log.info(String.format("发送eqm转kafka消息失败:%s", exp.getMessage())); log.info(String.format("发送eqm转kafka消息失败:%s", exp.getMessage()));
......
...@@ -123,8 +123,6 @@ public class CheckServiceImpl implements ICheckService { ...@@ -123,8 +123,6 @@ public class CheckServiceImpl implements ICheckService {
@Value("${auth-key-auth-enabled:}") @Value("${auth-key-auth-enabled:}")
private String authKeyEnabled; private String authKeyEnabled;
public static final Logger log = LoggerFactory.getLogger(CheckServiceImpl.class);
@Override @Override
public Page<CheckInfoVo> getCheckInfo(String toke,String product,String appKey,CheckInfoPageParam param) { public Page<CheckInfoVo> getCheckInfo(String toke,String product,String appKey,CheckInfoPageParam param) {
long total = checkMapper.getCheckInfoCount(param); long total = checkMapper.getCheckInfoCount(param);
...@@ -630,7 +628,6 @@ public class CheckServiceImpl implements ICheckService { ...@@ -630,7 +628,6 @@ public class CheckServiceImpl implements ICheckService {
} }
// check = checkDao.save(check); // check = checkDao.save(check);
try { try {
log.error("手机app保存巡检记录++++++++++++++++++++++" + check.toString() + "<Over><Over><Over><Over>");
check = checkDao.save(check); check = checkDao.save(check);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -20,7 +20,6 @@ import java.util.Map; ...@@ -20,7 +20,6 @@ import java.util.Map;
@Service("remoteWorkFlowService") @Service("remoteWorkFlowService")
public class RemoteWorkFlowService { public class RemoteWorkFlowService {
private final Logger logger = LoggerFactory.getLogger(RemoteWorkFlowService.class);
@Value("${params.work.flow.address}") @Value("${params.work.flow.address}")
private String address; private String address;
...@@ -73,7 +72,6 @@ public class RemoteWorkFlowService { ...@@ -73,7 +72,6 @@ public class RemoteWorkFlowService {
headerMap.put(XJConstant.PRODUCT, RequestContext.getProduct()); headerMap.put(XJConstant.PRODUCT, RequestContext.getProduct());
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey()); headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap); String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
logger.info("\r\n请求路径=======================>" + url + "\r\n请求参数=======================>" + instanceId + "\r\n返回参数=======================>" + resultStr);
return handleResult(resultStr); return handleResult(resultStr);
} }
...@@ -104,7 +102,6 @@ public class RemoteWorkFlowService { ...@@ -104,7 +102,6 @@ public class RemoteWorkFlowService {
// String requestBody = body.toJSONString(); // String requestBody = body.toJSONString();
body.put("variables", dangerIdJson); body.put("variables", dangerIdJson);
String resultStr = HttpUtil.sendHttpPostJsonWithHeader(url, body.toJSONString(), headerMap); String resultStr = HttpUtil.sendHttpPostJsonWithHeader(url, body.toJSONString(), headerMap);
logger.info("\r\n请求路径=======================>" + url + "\r\n请求参数=======================>" + body + "\r\n返回参数=======================>" + resultStr);
return JSON.parseObject(resultStr); return JSON.parseObject(resultStr);
} }
...@@ -116,7 +113,6 @@ public class RemoteWorkFlowService { ...@@ -116,7 +113,6 @@ public class RemoteWorkFlowService {
String url = buildUrl(address, WorkFlowUriEnum.启动免登录流程, map); String url = buildUrl(address, WorkFlowUriEnum.启动免登录流程, map);
String requestBody = body.toJSONString(); String requestBody = body.toJSONString();
String resultStr = HttpUtil.sendHttpPostJson(url, requestBody); String resultStr = HttpUtil.sendHttpPostJson(url, requestBody);
logger.info("\r\n请求路径=======================>" + url + "\r\n请求参数=======================>" + requestBody + "\r\n返回参数=======================>" + resultStr);
return handleResult(resultStr); return handleResult(resultStr);
} }
...@@ -133,7 +129,6 @@ public class RemoteWorkFlowService { ...@@ -133,7 +129,6 @@ public class RemoteWorkFlowService {
dangerIdJson.put("dangerId", dangerId); dangerIdJson.put("dangerId", dangerId);
body.put("variables", dangerIdJson); body.put("variables", dangerIdJson);
String resultStr = HttpUtil.sendHttpPostJsonWithHeader(url, body.toJSONString(), headerMap); String resultStr = HttpUtil.sendHttpPostJsonWithHeader(url, body.toJSONString(), headerMap);
logger.info("\r\n请求路径=======================>" + url + "\r\n请求参数=======================>" + body + "\r\n返回参数=======================>" + resultStr);
return JSON.parseObject(resultStr); return JSON.parseObject(resultStr);
} }
// public JSONObject stop(String processInstanceId, String deleteReason) { // public JSONObject stop(String processInstanceId, String deleteReason) {
...@@ -143,7 +138,6 @@ public class RemoteWorkFlowService { ...@@ -143,7 +138,6 @@ public class RemoteWorkFlowService {
// String url = buildUrl(address, WorkFlowUriEnum.终止流程, map); // String url = buildUrl(address, WorkFlowUriEnum.终止流程, map);
// String resultStr = HttpUtil.sendHttpDelete(url); // String resultStr = HttpUtil.sendHttpDelete(url);
// JSONObject json = handleResult(resultStr); // JSONObject json = handleResult(resultStr);
// logger.info("\r\n终止流程请求路径=======================>" + url + "\r\n终止流程返回参数=======================>" + resultStr);
// return json; // return json;
// } // }
...@@ -158,7 +152,6 @@ public class RemoteWorkFlowService { ...@@ -158,7 +152,6 @@ public class RemoteWorkFlowService {
String url = buildUrl(address, WorkFlowUriEnum.终止流程, map); String url = buildUrl(address, WorkFlowUriEnum.终止流程, map);
String resultStr = HttpUtil.sendHttpDeleteWithHeader(url, headerMap); String resultStr = HttpUtil.sendHttpDeleteWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr); JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
return json; return json;
} }
...@@ -168,7 +161,6 @@ public class RemoteWorkFlowService { ...@@ -168,7 +161,6 @@ public class RemoteWorkFlowService {
// String url = buildUrl(address, WorkFlowUriEnum.执行流程, map); // String url = buildUrl(address, WorkFlowUriEnum.执行流程, map);
// String resultStr = HttpUtil.sendHttpPostJson(url, requestBody); // String resultStr = HttpUtil.sendHttpPostJson(url, requestBody);
// JSONObject json = handleResult(resultStr); // JSONObject json = handleResult(resultStr);
// logger.info("\r\n执行任务请求路径=======================>" + url + "\r\n执行任务请求参数=======================>" + requestBody + "\r\n执行任务返回参数=======================>" + resultStr);
// return json; // return json;
// } // }
...@@ -182,7 +174,6 @@ public class RemoteWorkFlowService { ...@@ -182,7 +174,6 @@ public class RemoteWorkFlowService {
String url = buildUrl(address, WorkFlowUriEnum.执行流程, map); String url = buildUrl(address, WorkFlowUriEnum.执行流程, map);
String resultStr = HttpUtil.sendHttpPostJsonWithHeader(url, requestBody, headerMap); String resultStr = HttpUtil.sendHttpPostJsonWithHeader(url, requestBody, headerMap);
JSONObject json = handleResult(resultStr); JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n请求参数=======================>" + requestBody + "\r\n返回参数=======================>" + resultStr);
return json; return json;
} }
...@@ -192,7 +183,6 @@ public class RemoteWorkFlowService { ...@@ -192,7 +183,6 @@ public class RemoteWorkFlowService {
String url = buildUrl(address, WorkFlowUriEnum.当前节点, map); String url = buildUrl(address, WorkFlowUriEnum.当前节点, map);
String resultStr = HttpUtil.sendHttpGet(url); String resultStr = HttpUtil.sendHttpGet(url);
JSONObject json = handleResult(resultStr); JSONObject json = handleResult(resultStr);
logger.info("\r\n当前任务请求路径=======================>" + url + "\r\n当前任务返回参数=======================>" + resultStr);
if (json == null) { if (json == null) {
return null; return null;
} }
...@@ -213,7 +203,6 @@ public class RemoteWorkFlowService { ...@@ -213,7 +203,6 @@ public class RemoteWorkFlowService {
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey()); headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap); String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr); JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
if (json == null) { if (json == null) {
return null; return null;
} }
...@@ -240,7 +229,6 @@ public class RemoteWorkFlowService { ...@@ -240,7 +229,6 @@ public class RemoteWorkFlowService {
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey()); headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap); String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr); JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
return json; return json;
} }
...@@ -261,7 +249,6 @@ public class RemoteWorkFlowService { ...@@ -261,7 +249,6 @@ public class RemoteWorkFlowService {
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey()); headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap); String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr); JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
return json; return json;
} }
...@@ -275,7 +262,6 @@ public class RemoteWorkFlowService { ...@@ -275,7 +262,6 @@ public class RemoteWorkFlowService {
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey()); headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap); String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr); JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
return json; return json;
} }
public JSONObject queryTaskNoAuth(String id) { public JSONObject queryTaskNoAuth(String id) {
...@@ -288,7 +274,6 @@ public class RemoteWorkFlowService { ...@@ -288,7 +274,6 @@ public class RemoteWorkFlowService {
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey()); headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap); String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr); JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
return json; return json;
} }
public JSONObject queryTaskDetail(String taskId) { public JSONObject queryTaskDetail(String taskId) {
...@@ -301,7 +286,6 @@ public class RemoteWorkFlowService { ...@@ -301,7 +286,6 @@ public class RemoteWorkFlowService {
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey()); headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap); String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr); JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
return json; return json;
} }
public JSONObject queryFinishTaskDetail(String taskId) { public JSONObject queryFinishTaskDetail(String taskId) {
...@@ -314,7 +298,6 @@ public class RemoteWorkFlowService { ...@@ -314,7 +298,6 @@ public class RemoteWorkFlowService {
headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey()); headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap); String resultStr = HttpUtil.sendHttpGetWithHeader(url, headerMap);
JSONObject json = handleResult(resultStr); JSONObject json = handleResult(resultStr);
logger.info("\r\n请求路径=======================>" + url + "\r\n返回参数=======================>" + resultStr);
return json; return json;
} }
} }
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