|
|
@ -17,7 +17,6 @@ import com.zc.business.domain.DcOperLog; |
|
|
|
import com.zc.business.domain.DcPublishManage; |
|
|
|
import com.zc.business.service.IDcDeviceService; |
|
|
|
import com.zc.business.service.IDcOperLogService; |
|
|
|
import com.zc.business.service.IDcPublishInfoService; |
|
|
|
import com.zc.business.service.IDcPublishManageService; |
|
|
|
import org.aspectj.lang.JoinPoint; |
|
|
|
import org.aspectj.lang.ProceedingJoinPoint; |
|
|
@ -27,6 +26,7 @@ import org.springframework.stereotype.Component; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Aspect |
|
|
|
@Component |
|
|
@ -162,7 +162,7 @@ public class OperationLogAspect { |
|
|
|
} else { |
|
|
|
pointArg = (JSONObject) JSON.toJSON(pointArgs[0]); |
|
|
|
} |
|
|
|
|
|
|
|
String contentDetails = ""; |
|
|
|
|
|
|
|
JSONArray devices = pointArg.getJSONArray("devices"); |
|
|
|
JSONArray functions = pointArg.getJSONArray("functions"); |
|
|
@ -205,6 +205,19 @@ public class OperationLogAspect { |
|
|
|
if (i1 < functions.size() - 1) { |
|
|
|
remark.append("、"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Objects.equals(function.getString("functionId"), "13")&&Objects.equals(deviceType,"2")){ |
|
|
|
JSONArray parameters = function.getJSONObject("params").getJSONArray("parameters"); |
|
|
|
List<String> content = parameters.stream().map(item->((JSONObject)item).getString("CONTENT")).collect(Collectors.toList()); |
|
|
|
contentDetails = content.toString().replace("[", "").replace("]", ""); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (Objects.equals(deviceType,"5")){ |
|
|
|
contentDetails = function.getJSONObject("params").getString("text"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (i < (devices.size() - 1)) { |
|
|
@ -262,7 +275,7 @@ public class OperationLogAspect { |
|
|
|
dcPublishManage.setPublishChannels(7); |
|
|
|
} |
|
|
|
|
|
|
|
dcPublishManage.setContentDetails(remark.toString()); |
|
|
|
dcPublishManage.setContentDetails(contentDetails); |
|
|
|
dcPublishManageService.insertDcPublishManage(dcPublishManage); |
|
|
|
} |
|
|
|
|
|
|
@ -312,33 +325,33 @@ public class OperationLogAspect { |
|
|
|
dcOperLogService.save(operLog); |
|
|
|
|
|
|
|
|
|
|
|
if ((Objects.equals(deviceType, "2") || Objects.equals(deviceType, "5")) && Objects.nonNull(operLog.getId())) { |
|
|
|
DcPublishManage dcPublishManage = new DcPublishManage(); |
|
|
|
|
|
|
|
if (Objects.equals(state, "0") && Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("code")), "200")) { |
|
|
|
dcPublishManage.setPublishStatus(1);//发布状态1-成功2-失败
|
|
|
|
} else { |
|
|
|
dcPublishManage.setPublishStatus(2);//发布状态1-成功2-失败
|
|
|
|
} |
|
|
|
|
|
|
|
if (loginUser != null) { |
|
|
|
dcPublishManage.setPublisher(loginUser.getUsername());//发布人
|
|
|
|
} else { |
|
|
|
dcPublishManage.setPublisher("系统定时调用");//发布人
|
|
|
|
} |
|
|
|
dcPublishManage.setPublishTime(new Date());//发布时间
|
|
|
|
dcPublishManage.setCreateTime(new Date());//创建时间
|
|
|
|
|
|
|
|
dcPublishManage.setLogId(Long.valueOf(operLog.getId()));//发布的如果的情报板传对应id
|
|
|
|
if (Objects.equals(deviceType, "2")) { |
|
|
|
dcPublishManage.setPublishChannels(4); |
|
|
|
} else { |
|
|
|
dcPublishManage.setPublishChannels(7); |
|
|
|
} |
|
|
|
|
|
|
|
dcPublishManage.setContentDetails(remark.toString()); |
|
|
|
dcPublishManageService.insertDcPublishManage(dcPublishManage); |
|
|
|
} |
|
|
|
//if ((Objects.equals(deviceType, "2") || Objects.equals(deviceType, "5")) && Objects.nonNull(operLog.getId())) {
|
|
|
|
// DcPublishManage dcPublishManage = new DcPublishManage();
|
|
|
|
//
|
|
|
|
// if (Objects.equals(state, "0") && Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("code")), "200")) {
|
|
|
|
// dcPublishManage.setPublishStatus(1);//发布状态1-成功2-失败
|
|
|
|
// } else {
|
|
|
|
// dcPublishManage.setPublishStatus(2);//发布状态1-成功2-失败
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// if (loginUser != null) {
|
|
|
|
// dcPublishManage.setPublisher(loginUser.getUsername());//发布人
|
|
|
|
// } else {
|
|
|
|
// dcPublishManage.setPublisher("系统定时调用");//发布人
|
|
|
|
// }
|
|
|
|
// dcPublishManage.setPublishTime(new Date());//发布时间
|
|
|
|
// dcPublishManage.setCreateTime(new Date());//创建时间
|
|
|
|
//
|
|
|
|
// dcPublishManage.setLogId(Long.valueOf(operLog.getId()));//发布的如果的情报板传对应id
|
|
|
|
// if (Objects.equals(deviceType, "2")) {
|
|
|
|
// dcPublishManage.setPublishChannels(4);
|
|
|
|
// } else {
|
|
|
|
// dcPublishManage.setPublishChannels(7);
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// dcPublishManage.setContentDetails(remark.toString());
|
|
|
|
// dcPublishManageService.insertDcPublishManage(dcPublishManage);
|
|
|
|
//}
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|