Browse Source

管控记录

develop
王兴琳 3 months ago
parent
commit
fe9ad02af0
  1. 24
      zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java

24
zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java

@ -27,9 +27,8 @@ import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.concurrent.atomic.AtomicBoolean;
@Aspect @Aspect
@Component @Component
@ -144,7 +143,24 @@ public class OperationLogAspect {
//SimpleDateFormat df = new SimpleDateFormat(UniversalEnum.TIME_FORMAT_ALL.getValue()); //SimpleDateFormat df = new SimpleDateFormat(UniversalEnum.TIME_FORMAT_ALL.getValue());
//String date = df.format(new Date()); //String date = df.format(new Date());
//String sta = UniversalEnum.EMPTY_STRING.getValue(); //String sta = UniversalEnum.EMPTY_STRING.getValue();
if (Objects.equals(state, UniversalEnum.ZERO.getValue()) && Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("code")), UniversalEnum.TWO_HUNDRED.getValue()) && !Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("msg")), UniversalEnum.FIVE_HUNDRED.getValue())) { AtomicBoolean status = new AtomicBoolean(true);
AjaxResult ajaxResult = (AjaxResult) jsonResult;
try {
JSONArray datas = (JSONArray) JSON.toJSON(ajaxResult.get("data"));
datas.forEach(item -> {
JSONObject json = (JSONObject) JSON.toJSON(item);
if (json.getJSONObject("result").getInteger("code") != UniversalEnum.TWO_HUNDRED.getNumber()) {
status.set(false);
}
});
} catch (Exception e) {
status.set(false);
}
// List<Object> result = datas.stream().filter(item -> {
// JSONObject json = (JSONObject) JSON.toJSON(item);
// return Objects.equals(json.getString("device"), "2");
// }).collect(Collectors.toList());
if (Objects.equals(state, UniversalEnum.ZERO.getValue()) && Objects.equals(String.valueOf(ajaxResult.get("code")), UniversalEnum.TWO_HUNDRED.getValue()) && !Objects.equals(String.valueOf(ajaxResult.get("msg")), UniversalEnum.FIVE_HUNDRED.getValue()) && status.get()) {
operLog.setStatus(UniversalEnum.ZERO.getNumber()); operLog.setStatus(UniversalEnum.ZERO.getNumber());
//sta = UniversalEnum.SUCCESSFUL.getValue(); //sta = UniversalEnum.SUCCESSFUL.getValue();
} else { } else {
@ -498,7 +514,7 @@ public class OperationLogAspect {
DcPublishManage dcPublishManage = new DcPublishManage(); DcPublishManage dcPublishManage = new DcPublishManage();
if (Objects.equals(state, UniversalEnum.ZERO.getValue()) && Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("code")), UniversalEnum.TWO_HUNDRED.getValue())) { if (Objects.equals(state, UniversalEnum.ZERO.getValue()) && Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("code")), UniversalEnum.TWO_HUNDRED.getValue()) && !Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("msg")), UniversalEnum.FIVE_HUNDRED.getValue()) && status.get()) {
dcPublishManage.setPublishStatus(UniversalEnum.ONE.getNumber());//发布状态1-成功2-失败 dcPublishManage.setPublishStatus(UniversalEnum.ONE.getNumber());//发布状态1-成功2-失败
} else { } else {
dcPublishManage.setPublishStatus(UniversalEnum.TWO.getNumber());//发布状态1-成功2-失败 dcPublishManage.setPublishStatus(UniversalEnum.TWO.getNumber());//发布状态1-成功2-失败

Loading…
Cancel
Save