csw 5 months ago
parent
commit
ed96a354c3

+ 7 - 7
sql/db.sql

@@ -17,9 +17,9 @@ CREATE TABLE ALG_DEFINITION (
     CHANGER               VARCHAR(100) DEFAULT 'sys' NOT NULL             COMMENT '修改人',
     IS_DELETED            INT(1) DEFAULT 0 NOT NULL                       COMMENT '是否删除',
     PRIMARY KEY (GKEY)
-);
+) comment '算法定义';
 
--- 第三方
+-- 第三方信息
 CREATE TABLE ALG_THIRD (
      GKEY                 VARCHAR(50) NOT NULL                            COMMENT '主键',
      ID                   VARCHAR(100)                                    COMMENT '第三方ID',
@@ -31,7 +31,7 @@ CREATE TABLE ALG_THIRD (
      CHANGER              VARCHAR(100) DEFAULT 'sys' NOT NULL             COMMENT '修改人',
      IS_DELETED           INT(1) DEFAULT 0 NOT NULL                       COMMENT '是否删除',
      PRIMARY KEY (GKEY)
-);
+) comment '第三方信息';
 
 -- 算法版本管理
 CREATE TABLE ALG_VERSION (
@@ -43,7 +43,7 @@ CREATE TABLE ALG_VERSION (
      IS_ONLINE            tinyint(1)                                      COMMENT '是否在线',
      SERVICE_ID           VARCHAR(100)                                    COMMENT '算法服务ID',
      SERVICE_ADDRESS      VARCHAR(500)                                    COMMENT '服务地址信息',
-     CALL_METHOD          VARCHAR(100)                                    COMMENT '请求方法',
+     REQUEST_MODE         VARCHAR(100)                                    COMMENT '请求方式',
      INTERFACE_NAME       VARCHAR(200)                                    COMMENT '接口名称',
      CALL_CLASS           VARCHAR(100)                                    COMMENT '调用类名',
      CALL_METHOD          VARCHAR(100)                                    COMMENT '调用方法名',
@@ -53,7 +53,7 @@ CREATE TABLE ALG_VERSION (
      CHANGER              VARCHAR(100) DEFAULT 'sys' NOT NULL             COMMENT '修改人',
      IS_DELETED           INT(1) DEFAULT 0 NOT NULL                       COMMENT '是否删除',
      PRIMARY KEY (GKEY)
-);
+) comment '算法版本';
 
 -- 执行日志
 CREATE TABLE ALG_EXECUTION_LOG (
@@ -65,7 +65,7 @@ CREATE TABLE ALG_EXECUTION_LOG (
      EXE_STATE            VARCHAR(100)                                    COMMENT '执行状态',
      RUN_VERSION          VARCHAR(100)                                    COMMENT '运行版本',
      COST_TIME            INT                                             COMMENT '计算耗时(ms)',
-     CALL_RESOURCE        VARCHAR(100)                                    COMMENT '调用来源',
+     CALL_SOURCE          VARCHAR(100)                                    COMMENT '调用来源',
      IN_DATA              longtext                                        COMMENT '输入数据',
      OUT_DATA             longtext                                        COMMENT '输出数据',
      EXE_LOG              longtext                                        COMMENT '执行日志',
@@ -76,4 +76,4 @@ CREATE TABLE ALG_EXECUTION_LOG (
      CHANGER              VARCHAR(100) DEFAULT 'sys' NOT NULL             COMMENT '修改人',
      IS_DELETED           INT(1) DEFAULT 0 NOT NULL                       COMMENT '是否删除',
      PRIMARY KEY (GKEY)
-);
+) comment '执行日志';

+ 27 - 0
src/main/java/com/ecnu/platform/pojo/inputs/SmartScheduleInfo.java

@@ -0,0 +1,27 @@
+package com.ecnu.platform.pojo.inputs;
+
+
+import com.three.common.annos.Doc4Class;
+import com.three.common.annos.Doc4Field;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@Doc4Class(desc = "船期信息")
+public class SmartScheduleInfo {
+
+    @Doc4Field(desc = "靠泊ID", nullable = false)
+    private Long berthId;//靠泊ID
+    private String vesselCode;//船舶CD
+    private String vesselType;//船舶类型,FCS大船,BAR驳船
+    private Date planBeginWorkTime;//计划开工时间
+    private Date planEndWorkTime;//计划完工时间
+    private Long planStartPst;//船头停泊位置
+    private Long planEndPst;//船尾停泊位置
+    private String planBerthDirect;//靠泊方向,R:反向,L:正向
+    private String maintainCwp;//保留当前CWP不做更改,用于刚开工的时候部分桥吊作业和部分桥吊辅助作业,用于全船 ***
+    private Boolean sendWorkInstruction;//是否发送该船指令标记
+    private String doCwpFlag; //执行多船CWP算法,标记是否执行详细CWP算法,Y表示执行单船算法
+    private String startWorkFlag; //船舶是否开工作业标记,Y表示已开工
+}

+ 4 - 0
src/main/java/com/ecnu/platform/pojo/results/SmartReCwpBlockInfo.java

@@ -0,0 +1,4 @@
+package com.ecnu.platform.pojo.results;
+
+public class SmartReCwpBlockInfo {
+}

+ 8 - 1
src/main/java/com/ecnu/platform/service/AlgDefinitionService.groovy

@@ -10,7 +10,8 @@ import com.three.data_api.service.impl.BaseEntityServiceImpl
 
 class AlgDefinitionService extends BaseEntityServiceImpl {
 
-    private static final String EN_AlgDefinition = "AlgDefinition"
+    public static final String EN_AlgDefinition = "AlgDefinition"
+    public static final String EN_AlgDefinitionVo = "AlgDefinitionVo"
 
     @Override
     @BizApiMethod(matchedApis = ThreeConstant.BIZ_API_NAME, desc = "查询实体ID")
@@ -25,6 +26,12 @@ class AlgDefinitionService extends BaseEntityServiceImpl {
         return super.query(map)
     }
 
+    @BizApiMethod(matchedApis = ThreeConstant.BIZ_API_NAME, desc = "查询所有算法定义")
+    @Doc4MethodRes(key = "result", desc = "算法定义", refClassName = EN_AlgDefinitionVo)
+    AuqResult queryAll(Map<String, Object> map) throws Exception {
+        return daoService.findAuq(EN_AlgDefinitionVo, map)
+    }
+
     @Override
     @BizApiMethod(matchedApis = ThreeConstant.BIZ_API_NAME, desc = "查询算法定义下拉框")
     List<SelectOption> getSelectOptions(Map<String, Object> map) throws Exception {

+ 80 - 0
src/main/java/com/ecnu/platform/service/AlgExecutionLogService.groovy

@@ -0,0 +1,80 @@
+package com.ecnu.platform.service
+
+import com.three.common.exception.ParamException
+import com.three.common.utils.StringUtil
+import com.three.common.vo.SelectOption
+import com.three.data_api.dm.annos.BizApiMethod
+import com.three.data_api.dm.annos.BizRequestPm
+import com.three.data_api.dm.annos.Doc4MethodRes
+import com.three.data_api.dm.constants.ParamName
+import com.three.data_api.dm.constants.ThreeConstant
+import com.three.data_api.dm.entity.AuqResult
+import com.three.data_api.dm.entity.three.ThreeAuq
+import com.three.data_api.dm.service.DaoService
+import com.three.data_api.service.impl.BaseEntityServiceImpl
+import org.springframework.beans.factory.annotation.Autowired
+
+class AlgExecutionLogService extends BaseEntityServiceImpl {
+
+    public static final String EN_AlgExecutionLog = "AlgExecutionLog"
+    public static final String EN_AlgExeLogVo = "AlgExeLogVo"
+
+    @Autowired
+    private DaoService daoService;
+
+    @Override
+    String getEntityId(Map<String, Object> map) {
+        return EN_AlgExecutionLog
+    }
+
+    @Override
+    @BizApiMethod(matchedApis = ThreeConstant.BIZ_API_NAME, desc = "查询算法执行日志")
+    @Doc4MethodRes(key = "result", desc = "算法执行日志", refClassName = EN_AlgExecutionLog)
+    AuqResult query(Map<String, Object> map) throws Exception {
+        if (StringUtil.isBlank(map.get(ParamName.pageIndex)) || StringUtil.isBlank(map.get(ParamName.pageSize))) {
+            throw new ParamException("分页参数(" + ParamName.pageSize + "," + ParamName.pageIndex + ")不可以为空")
+        }
+        if (StringUtil.isNotBlankStr(map.get("versionGkey"))) {
+            Map<String, Object> simpleFilter = new HashMap<>();
+            simpleFilter.put("versionGkey", map.get("versionGkey"))
+            map.put("simpleFilter", simpleFilter)
+        }
+        return daoService.findAuq(EN_AlgExeLogVo, map)
+    }
+
+    @BizApiMethod(matchedApis = ThreeConstant.BIZ_API_NAME, desc = "查询算法执行日志详情")
+    @Doc4MethodRes(key = "result", desc = "算法执行日志", refClassName = EN_AlgExecutionLog)
+    Object queryOne(@BizRequestPm(key = "gkey", nullable = false, desc = "算法执行日志主键") String gkey) throws Exception {
+        return findOneObject(EN_AlgExecutionLog, gkey)
+    }
+
+    @Override
+    List<SelectOption> getSelectOptions(Map<String, Object> map) throws Exception {
+        return super.getSelectOptions(map)
+    }
+
+    @Override
+    List<ThreeAuq> getAllAuqs(Map<String, Object> map) throws Exception {
+        return super.getAllAuqs(map)
+    }
+
+    @Override
+    void create(Map<String, Object> map) throws Exception {
+        super.create(map)
+    }
+
+    @Override
+    void update(Map<String, Object> map) throws Exception {
+        super.update(map)
+    }
+
+    @Override
+    void delete(Map<String, Object> map) throws Exception {
+        super.delete(map)
+    }
+
+    @Override
+    void recover(Map<String, Object> map) throws Exception {
+        super.recover(map)
+    }
+}

+ 71 - 0
src/main/java/com/ecnu/platform/service/AlgVersionVoService.groovy

@@ -0,0 +1,71 @@
+package com.ecnu.platform.service
+
+import com.three.common.exception.ParamException
+import com.three.common.utils.StringUtil
+import com.three.common.vo.SelectOption
+import com.three.data_api.dm.annos.BizApiMethod
+import com.three.data_api.dm.annos.BizRequestPm
+import com.three.data_api.dm.annos.Doc4MethodRes
+import com.three.data_api.dm.constants.ThreeConstant
+import com.three.data_api.dm.entity.AuqResult
+import com.three.data_api.dm.entity.three.ThreeAuq
+import com.three.data_api.service.impl.BaseEntityServiceImpl
+
+class AlgVersionVoService extends BaseEntityServiceImpl {
+
+    public static final String EN_AlgVersion = "AlgVersion"
+    public static final String EN_AlgVersionVo = "AlgVersionVo"
+
+    @Override
+    String getEntityId(Map<String, Object> map) {
+        return EN_AlgVersionVo
+    }
+
+    @Override
+    AuqResult query(Map<String, Object> map) throws Exception {
+        return super.query(map)
+    }
+
+    @BizApiMethod(matchedApis = ThreeConstant.BIZ_API_NAME, desc = "查询算法版本")
+    @Doc4MethodRes(key = "result", desc = "算法版本", refClassName = EN_AlgVersionVo)
+    AuqResult queryByAlg(@BizRequestPm(key = "algGkey", nullable = false, desc = "算法主键") String algGkey) throws Exception {
+        if (StringUtil.isBlank(algGkey)) {
+            throw new ParamException("算法主键(algGkey)不可以为空")
+        }
+        Map<String, Object> map = new HashMap<>()
+        Map<String, Object> simpleFilter = new HashMap<>();
+        simpleFilter.put("algGkey", algGkey)
+        map.put("simpleFilter", simpleFilter)
+        return daoService.findAuq(EN_AlgVersionVo, map)
+    }
+
+    @Override
+    List<SelectOption> getSelectOptions(Map<String, Object> map) throws Exception {
+        return super.getSelectOptions(map)
+    }
+
+    @Override
+    List<ThreeAuq> getAllAuqs(Map<String, Object> map) throws Exception {
+        return super.getAllAuqs(map)
+    }
+
+    @Override
+    void create(Map<String, Object> map) throws Exception {
+        super.create(map)
+    }
+
+    @Override
+    void update(Map<String, Object> map) throws Exception {
+        super.update(map)
+    }
+
+    @Override
+    void delete(Map<String, Object> map) throws Exception {
+        super.delete(map)
+    }
+
+    @Override
+    void recover(Map<String, Object> map) throws Exception {
+        super.recover(map)
+    }
+}