瀏覽代碼

修改工具类 轨迹类 强关联移除

785834757 1 年之前
父節點
當前提交
934c16377d

+ 7 - 5
commons/src/main/java/com/jzg/commons/aop/aspect/OperatorTrajectoryAspect.java

@@ -16,6 +16,7 @@ import org.aspectj.lang.annotation.*;
 import org.aspectj.lang.reflect.MethodSignature;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Component;
 
 import java.lang.reflect.Method;
@@ -29,6 +30,7 @@ public class OperatorTrajectoryAspect {
 
 
     @Autowired
+    @Lazy
     OperatorTrajectoryService operatorTrajectoryService;
 
 
@@ -63,7 +65,7 @@ public class OperatorTrajectoryAspect {
                     byId.setExecuteStatus(2);
                     byId.setErrorMsg(result.getMsg());
                 }
-                operatorTrajectoryService.updateById(byId);
+//                operatorTrajectoryService.updateById(byId);
             }
         }
         // 清除上下文
@@ -77,10 +79,10 @@ public class OperatorTrajectoryAspect {
         if (context != null) {
             String methodName = context.getMethodName();
             if(joinPoint.getSignature().getName().equals(methodName)){
-                com.jzg.commons.entity.po.OperatorTrajectory byId = operatorTrajectoryService.getById(context.getId());
-                byId.setExecuteStatus(2);
-                byId.setErrorMsg(ex.getMessage());
-                operatorTrajectoryService.updateById(byId);
+//                com.jzg.commons.entity.po.OperatorTrajectory byId = operatorTrajectoryService.getById(context.getId());
+//                byId.setExecuteStatus(2);
+//                byId.setErrorMsg(ex.getMessage());
+//                operatorTrajectoryService.updateById(byId);
             }
         }
         // 清除上下文

+ 1 - 1
commons/src/main/java/com/jzg/commons/mapper/OperatorTrajectoryMapper.java

@@ -5,5 +5,5 @@ import com.jzg.commons.entity.po.OperatorTrajectory;
 import org.apache.ibatis.annotations.Mapper;
 
 @Mapper
-public interface OperatorTrajectoryMapper extends BaseMapper<OperatorTrajectory> {
+public interface OperatorTrajectoryMapper extends BaseMapper<OperatorTrajectory>{
 }

+ 8 - 1
commons/src/main/java/com/jzg/commons/service/OperatorTrajectoryService.java

@@ -9,7 +9,14 @@ import com.jzg.commons.entity.po.OperatorTrajectory;
  * 
  * @author dongxin
  */
-public interface OperatorTrajectoryService extends IService<OperatorTrajectory>
+public interface OperatorTrajectoryService
 {
 
+    OperatorTrajectory getById(String id);
+
+    boolean save(OperatorTrajectory operatorTrajectory);
+
+
+
+
 }

+ 16 - 1
commons/src/main/java/com/jzg/commons/service/impl/OperatorTrajectoryServiceImpl.java

@@ -4,9 +4,24 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jzg.commons.entity.po.OperatorTrajectory;
 import com.jzg.commons.mapper.OperatorTrajectoryMapper;
 import com.jzg.commons.service.OperatorTrajectoryService;
+import jakarta.annotation.Resource;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
 @Service
-public class OperatorTrajectoryServiceImpl extends ServiceImpl<OperatorTrajectoryMapper, OperatorTrajectory> implements OperatorTrajectoryService {
+public class OperatorTrajectoryServiceImpl implements OperatorTrajectoryService {
+    @Resource
+    @Lazy
+    OperatorTrajectoryMapper operatorTrajectoryMapper;
+    
+    public OperatorTrajectory getById(String id){
+        return operatorTrajectoryMapper.selectById(id);
+    }
 
+    @Override
+    public boolean save(OperatorTrajectory operatorTrajectory) {
+        return operatorTrajectoryMapper.insert(operatorTrajectory) > 0;
+    }
 }