Browse Source

接口类名首字母加I

yangwanyi 3 years ago
parent
commit
d86460e912

+ 5 - 0
src/main/java/com/persagy/transfer/constant/InfosKeyConstant.java

@@ -18,6 +18,11 @@ public class InfosKeyConstant {
     public static final String EQUIPMENT_NAME = "wD_shebeimingcheng";
 
     /**
+     * 设备安装位置
+     */
+    public static final String EQUIPMENT_INSTALL_AREA = "wD_equipanzhuangweizhi";
+
+    /**
      * 设备服务区域
      */
     public static final String EQUIPMENT_SERVICE_ZONE = "wD_equipfuwuquyu";

+ 4 - 4
src/main/java/com/persagy/transfer/controller/DemoController.java

@@ -1,7 +1,7 @@
 package com.persagy.transfer.controller;
 
-import com.persagy.transfer.service.PersagyDbService;
-import com.persagy.transfer.service.WdDbService;
+import com.persagy.transfer.service.IPersagyDbService;
+import com.persagy.transfer.service.IWdDbService;
 import com.persagy.transfer.service.impl.DemoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -24,10 +24,10 @@ public class DemoController {
     private DemoService demoService;
 
     @Autowired
-    private PersagyDbService persagyDbService;
+    private IPersagyDbService persagyDbService;
 
     @Autowired
-    private WdDbService wdDbService;
+    private IWdDbService wdDbService;
 
     @RequestMapping("/test")
     public Object queryCount(HttpServletRequest request) {

+ 26 - 0
src/main/java/com/persagy/transfer/pojo/dto/HydomcAsset.java

@@ -123,6 +123,10 @@ public class HydomcAsset extends Model<HydomcAsset> {
     @TableField(updateStrategy = FieldStrategy.NOT_NULL)
     private Date changedate; // 数据更新时间
 
+    @TableField(updateStrategy = FieldStrategy.NOT_NULL)
+    private String ctx; // 变更人员的万信账号
+
+
     public static Builder builder() {
         return new Builder();
     }
@@ -320,6 +324,13 @@ public class HydomcAsset extends Model<HydomcAsset> {
             return this;
         }
 
+        public BuilderQueryWrapper ctxEq(String ctx) {
+            if (StringUtil.isNotBlank(ctx)) {
+                queryWrapper.eq(HydomcAsset::getCtx, ctx);
+            }
+            return this;
+        }
+
         public BuilderQueryWrapper sfzldEq(String sfzld) {
             if (StringUtil.isNotBlank(sfzld)) {
                 queryWrapper.eq(HydomcAsset::getSfzld, sfzld);
@@ -547,6 +558,16 @@ public class HydomcAsset extends Model<HydomcAsset> {
             return this;
         }
 
+
+
+        public BuilderUpdateWrapper ctxEq(String ctx) {
+            if (StringUtil.isNotBlank(ctx)) {
+                updateWrapper.eq(HydomcAsset::getCtx, ctx);
+            }
+            return this;
+        }
+
+
         public BuilderUpdateWrapper sfzldEq(String sfzld) {
             if (StringUtil.isNotBlank(sfzld)) {
                 updateWrapper.eq(HydomcAsset::getSfzld, sfzld);
@@ -720,6 +741,11 @@ public class HydomcAsset extends Model<HydomcAsset> {
             return this;
         }
 
+        public Builder ctx(String ctx) {
+            hydomcAsset.setCtx(ctx);
+            return this;
+        }
+
         public Builder sfzld(String sfzld) {
             hydomcAsset.setSfzld(sfzld);
             return this;

+ 1 - 1
src/main/java/com/persagy/transfer/service/PersagyDbService.java

@@ -1,6 +1,6 @@
 package com.persagy.transfer.service;
 
-public interface PersagyDbService {
+public interface IPersagyDbService {
 
     /**
      * @author YangWanYi

+ 1 - 1
src/main/java/com/persagy/transfer/service/WdDbService.java

@@ -7,7 +7,7 @@ import com.persagy.transfer.pojo.dto.WdfacilityRelPersagy;
 
 import java.util.List;
 
-public interface WdDbService {
+public interface IWdDbService {
     Object getDataByMasterTwo();
 
     /**

+ 4 - 4
src/main/java/com/persagy/transfer/service/impl/PersagyDbServiceImpl.java

@@ -21,8 +21,8 @@ import com.persagy.transfer.pojo.dto.RwdObjectWd;
 import com.persagy.transfer.pojo.dto.WdclassRelPersagy;
 import com.persagy.transfer.pojo.dto.WdfacilityRelPersagy;
 import com.persagy.transfer.pojo.dto.WdprojRelPersagyproj;
-import com.persagy.transfer.service.PersagyDbService;
-import com.persagy.transfer.service.WdDbService;
+import com.persagy.transfer.service.IPersagyDbService;
+import com.persagy.transfer.service.IWdDbService;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -34,10 +34,10 @@ import lombok.extern.slf4j.Slf4j;
 @Service
 @DS(value = SwitchConstant.DS_MASTER_1)
 @Slf4j
-public class PersagyDbServiceImpl implements PersagyDbService {
+public class PersagyDbServiceImpl implements IPersagyDbService {
 
     @Autowired
-    private WdDbService wdDbService;
+    private IWdDbService wdDbService;
 
     @Autowired
     private WdclassRelPersagyMapper wdclassRelPersagyMapper;

+ 7 - 4
src/main/java/com/persagy/transfer/service/impl/WdDbServiceImpl.java

@@ -12,7 +12,7 @@ import com.persagy.transfer.mapper.MasterTwoMapper;
 import com.persagy.transfer.pojo.dto.HydomcAsset;
 import com.persagy.transfer.pojo.dto.HydomcAssetspec;
 import com.persagy.transfer.pojo.dto.WdfacilityRelPersagy;
-import com.persagy.transfer.service.WdDbService;
+import com.persagy.transfer.service.IWdDbService;
 import com.persagy.transfer.utils.StringTool;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -30,7 +30,7 @@ import java.util.List;
 @Service
 @DS(value = SwitchConstant.DS_MASTER_2)
 @Slf4j
-public class WdDbServiceImpl implements WdDbService {
+public class WdDbServiceImpl implements IWdDbService {
 
     @Autowired
     private MasterTwoMapper masterTwoMapper;
@@ -68,7 +68,7 @@ public class WdDbServiceImpl implements WdDbService {
             hydomcAsset = new HydomcAsset(); // 万达设备信息主表实体
             hydomcAsset.setSbybm(StringTool.object2String(infosObj.get(InfosKeyConstant.EQUIPMENT_CODE))); // 主键  无其他主键可采用设备编码为主键,但要确保唯一(工程信息化设备原码)
             hydomcAsset.setDescription(StringTool.object2String(infosObj.get(InfosKeyConstant.EQUIPMENT_NAME))); // 设备名称
-            // hydomcAsset.setWzqy(); // 详细设备安装位置,格式:楼体-楼层-区域 没有key 后续补充
+            hydomcAsset.setWzqy(StringTool.object2String(infosObj.get(InfosKeyConstant.EQUIPMENT_INSTALL_AREA))); // 详细设备安装位置,格式:楼体-楼层-区域
             hydomcAsset.setFwqy(StringTool.object2String(infosObj.get(InfosKeyConstant.EQUIPMENT_SERVICE_ZONE))); // 设备服务区域 设备/系统服务范围
             hydomcAsset.setSbxh(StringTool.object2String(infosObj.get(InfosKeyConstant.EQUIPMENT_MODEL))); // 厂商设备型号
             hydomcAsset.setClassstructureid(classstrucrureid); // 对接设备分类id,同步后不可更改
@@ -97,6 +97,8 @@ public class WdDbServiceImpl implements WdDbService {
             hydomcAsset.setSiteid(wdProjectId); // 项目唯一id,可采用租赁系统广场id,同步后不可更改
             hydomcAsset.setDatastatus(valid == 0 ? SwitchConstant.IS_DELETE : SwitchConstant.IS_UPDATE); // 数据状态 update/delete 当数据状态为delete时,设备状态需改为报废
             hydomcAsset.setChangedate(updateTime); // 数据更新时间 增量字段
+            // 新增一个ctx字段 变更人员的万信账号
+            hydomcAsset.setCtx("数据从哪儿来");
             this.hydomcAssetMapper.insert(hydomcAsset);
         } else {
             UpdateWrapper<HydomcAsset> updateWrapper = new UpdateWrapper<>();
@@ -109,7 +111,7 @@ public class WdDbServiceImpl implements WdDbService {
                 log.debug("万达数据库已经存在该条数据,但博锐尚格这条数据状态为有效,因此需要更新所有字段");
                 updateWrapper.set("sbybm", StringTool.object2String(infosObj.get(InfosKeyConstant.EQUIPMENT_CODE))); // 主键  无其他主键可采用设备编码为主键,但要确保唯一(工程信息化设备原码)
                 updateWrapper.set("description", StringTool.object2String(infosObj.get(InfosKeyConstant.EQUIPMENT_NAME))); // 设备名称
-                // updateWrapper.setWzqy(); // 详细设备安装位置,格式:楼体-楼层-区域 没有key 后续补充
+                updateWrapper.set("wzqy", StringTool.object2String(infosObj.get(InfosKeyConstant.EQUIPMENT_INSTALL_AREA))); // 详细设备安装位置,格式:楼体-楼层-区域
                 updateWrapper.set("fwqy", StringTool.object2String(infosObj.get(InfosKeyConstant.EQUIPMENT_SERVICE_ZONE))); // 设备服务区域 设备/系统服务范围
                 updateWrapper.set("sbxh", StringTool.object2String(infosObj.get(InfosKeyConstant.EQUIPMENT_MODEL))); // 厂商设备型号
                 updateWrapper.set("classstructureid", classstrucrureid); // 对接设备分类id,同步后不可更改
@@ -138,6 +140,7 @@ public class WdDbServiceImpl implements WdDbService {
                 updateWrapper.set("siteid", wdProjectId); // 项目唯一id,可采用租赁系统广场id,同步后不可更改
                 updateWrapper.set("datastatus", SwitchConstant.IS_UPDATE); // 数据状态 update/delete 当数据状态为delete时,设备状态需改为报废
             }
+            updateWrapper.set("ctx", "数据从哪儿来"); // 新增一个ctx字段 变更人员的万信账号
             updateWrapper.set("changedate", updateTime); // 数据更新时间 增量字段
             this.hydomcAssetMapper.update(hydomcAsset, updateWrapper);
         }

+ 2 - 2
src/main/java/com/persagy/transfer/task/SycnEquDataToWdTask.java

@@ -1,6 +1,6 @@
 package com.persagy.transfer.task;
 
-import com.persagy.transfer.service.PersagyDbService;
+import com.persagy.transfer.service.IPersagyDbService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.PropertySource;
@@ -20,7 +20,7 @@ public class SycnEquDataToWdTask {
     private int times;
 
     @Autowired
-    private PersagyDbService persagyDbService;
+    private IPersagyDbService persagyDbService;
 
     /**
      * 数据同步逻辑

+ 1 - 1
src/main/resources/configuration.properties

@@ -1 +1 @@
-sycnData2wdTaskCron=0 */10 * * * ?
+sycnData2wdTaskCron=0 */3 * * * ?