|
@@ -1,41 +1,302 @@
|
|
|
package com.persagy.transfer.service.impl;
|
|
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.persagy.transfer.constant.InfosKeyConstant;
|
|
|
import com.persagy.transfer.constant.SwitchConstant;
|
|
|
-import com.persagy.transfer.mapper.MasterOneMapper;
|
|
|
-import com.persagy.transfer.mapper.MasterTwoMapper;
|
|
|
+import com.persagy.transfer.mapper.*;
|
|
|
+import com.persagy.transfer.pojo.dto.*;
|
|
|
import com.persagy.transfer.service.IDemoService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.sql.Date;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 多数据源测试
|
|
|
- *
|
|
|
- * @version 1.0.0
|
|
|
- * @company persagy
|
|
|
+ *
|
|
|
* @author zhangqiankun
|
|
|
+ * @version 1.0.0
|
|
|
+ * @company persagy
|
|
|
* @date 2021年9月15日 下午4:13:29
|
|
|
*/
|
|
|
@Service
|
|
|
@DS(value = SwitchConstant.DS_MASTER_1)
|
|
|
+@Slf4j
|
|
|
public class DemoService implements IDemoService {
|
|
|
|
|
|
- @Autowired
|
|
|
- private MasterOneMapper masterOneMapper;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private MasterTwoMapper masterTwoMapper;
|
|
|
-
|
|
|
- @Override
|
|
|
- public Object getDataByMasterOne() {
|
|
|
- return this.masterOneMapper.queryOne();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- @DS(value = SwitchConstant.DS_MASTER_2)
|
|
|
- public Object getDataByMasterTwo() {
|
|
|
- return this.masterTwoMapper.queryTwo();
|
|
|
- }
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private MasterOneMapper masterOneMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private MasterTwoMapper masterTwoMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private WdclassRelPersagyMapper wdclassRelPersagyMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private WdprojRelPersagyprojMapper wdprojRelPersagyprojMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RwdObjecWdMapper rwdObjecWdMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private WdfacilityRelPersagyMapper wdfacilityRelPersagyMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private HydomcAssetMapper hydomcAssetMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private HydomcAssetspecMapper hydomcAssetspecMapper;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Object getDataByMasterOne() {
|
|
|
+ return this.masterOneMapper.queryOne();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @DS(value = SwitchConstant.DS_MASTER_2)
|
|
|
+ public Object getDataByMasterTwo() {
|
|
|
+ return this.masterTwoMapper.queryTwo();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @author YangWanYi
|
|
|
+ * @describe 向万达数据库同步设备数据
|
|
|
+ * @date 2021/9/16 11:38
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void syncData2WD() {
|
|
|
+ /*
|
|
|
+ 处理逻辑
|
|
|
+ 1、获取表wdclass_rel_persagy去重class_code的数据
|
|
|
+ 2、获取表wdproj_rel_persagyproj去重博锐尚格项目ID的数据
|
|
|
+ 3、根据1的class_code,2的persagy_project_id、obj_type='equipment',获取表rwd_object_wd_*的数据
|
|
|
+ 4、对应数据进行insert或者update或者delete
|
|
|
+ */
|
|
|
+
|
|
|
+ // 1.获取表wdclass_rel_persagy去重class_code的数据
|
|
|
+ log.info("准备同步设备数据到万达数据库");
|
|
|
+ LambdaQueryWrapper<WdclassRelPersagy> queryWdclassRelWrapper = new WdclassRelPersagy.BuilderQueryWrapper().builder();
|
|
|
+ List<WdclassRelPersagy> funcList = this.wdclassRelPersagyMapper.selectList(queryWdclassRelWrapper);
|
|
|
+
|
|
|
+ // 2.获取表wdproj_rel_persagyproj所有数据
|
|
|
+ LambdaQueryWrapper<WdprojRelPersagyproj> queryProjRelWrapper = new WdprojRelPersagyproj.BuilderQueryWrapper().builder();
|
|
|
+ List<WdprojRelPersagyproj> projList = this.wdprojRelPersagyprojMapper.selectList(queryProjRelWrapper);
|
|
|
+
|
|
|
+ // 3.遍历获取rwd_object_wd_?的数据
|
|
|
+ List<RwdObjecWd> rwdObjecWdList;
|
|
|
+ final String OBJ_TYPE = "equipment"; // 对象分类(设备类)
|
|
|
+ List<String> classCodeList = new ArrayList<>();
|
|
|
+ List<String> persagyProjectIdList = new ArrayList<>();
|
|
|
+ for (WdclassRelPersagy wdclassRelPersagy : funcList) {
|
|
|
+ for (WdprojRelPersagyproj wdprojRelPersagyproj : projList) {
|
|
|
+ // classCode和persagyProjectid去重
|
|
|
+ if (classCodeList.contains(wdclassRelPersagy.getClassCode()) || persagyProjectIdList.contains(wdprojRelPersagyproj.getPersagyProjectid())) {
|
|
|
+ log.info("有已经处理过的BDTP类编码或者博锐尚格项目id,准备跳过此次处理");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ classCodeList.add(wdclassRelPersagy.getClassCode());
|
|
|
+ persagyProjectIdList.add(wdprojRelPersagyproj.getPersagyProjectid());
|
|
|
+ // 根据外循环对象的classCode、objType='equipment',内循环对象的persagyProjectId,查询wd_object_wd_?表
|
|
|
+ rwdObjecWdList = this.rwdObjecWdMapper.listByProjectId(wdclassRelPersagy.getClassCode(), OBJ_TYPE, wdprojRelPersagyproj.getPersagyProjectid());
|
|
|
+ if (rwdObjecWdList != null && !rwdObjecWdList.isEmpty()) {
|
|
|
+ this.handleFieldMapping(rwdObjecWdList, wdprojRelPersagyproj, wdclassRelPersagy);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param rwdObjecWdList 博锐尚格的项目对象
|
|
|
+ * @param wdprojRelPersagyproj 万达项目ID与博锐尚格项目ID映射表实体
|
|
|
+ * @author YangWanYi
|
|
|
+ * @describe 同步万达设备数据的新增与更新
|
|
|
+ * @date 2021/9/16 14:19
|
|
|
+ */
|
|
|
+ private void handleFieldMapping(List<RwdObjecWd> rwdObjecWdList, WdprojRelPersagyproj wdprojRelPersagyproj, WdclassRelPersagy wdclassRelPersagy) {
|
|
|
+ JSONObject infosObj;
|
|
|
+ HydomcAsset hydomcAsset = null; // 万达数据库的设备信息表实体
|
|
|
+ List<WdfacilityRelPersagy> wdfacilityRelList = null;
|
|
|
+ for (RwdObjecWd rwdObjecWd : rwdObjecWdList) {
|
|
|
+ infosObj = rwdObjecWd.getInfos();
|
|
|
+ /*万达设备信息对象数据同步*/
|
|
|
+ this.sycnHydomcAsset(infosObj, wdprojRelPersagyproj.getWdProjectid(), hydomcAsset, rwdObjecWd.getValid(), rwdObjecWd.getUpdateTime(), wdclassRelPersagy.getClassstrucrureid());
|
|
|
+ /*万达设备参数信息数据同步*/
|
|
|
+ if (wdfacilityRelList == null) { // 循环万达项目ID与博锐尚格项目ID映射表数据时,wdfacility_rel_persagy只查询一次
|
|
|
+ wdfacilityRelList = this.listWdfacilityRelPersagy(wdclassRelPersagy.getWdClassCode(), wdclassRelPersagy.getClassstrucrureid());
|
|
|
+ }
|
|
|
+ this.sycnHydomcAssetspec(wdfacilityRelList, wdprojRelPersagyproj.getWdProjectid(), infosObj, rwdObjecWd.getUpdateTime());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param wdfacilityRelList 筛选后的万达设备参数信息表与博锐尚格信息点的映射表数据
|
|
|
+ * @param wdProjectid 万达项目ID(广场ID)
|
|
|
+ * @param infosObj 博锐尚格项目表的infos字段值
|
|
|
+ * @param updateTime 项目最后更新时间
|
|
|
+ * @author YangWanYi
|
|
|
+ * @describe 同步万达设备参数对象数据
|
|
|
+ * @date 2021/9/16 18:56
|
|
|
+ */
|
|
|
+ @DS(value = SwitchConstant.DS_MASTER_2)
|
|
|
+ private void sycnHydomcAssetspec(List<WdfacilityRelPersagy> wdfacilityRelList, String wdProjectid, JSONObject infosObj, java.util.Date updateTime) {
|
|
|
+ log.info("准备同步万达设备参数对象数据");
|
|
|
+ boolean isInsert = false; // 默认操作类型为更新
|
|
|
+ HydomcAssetspec hydomcAssetspec;
|
|
|
+ final String IS_NUMBER = "数字";
|
|
|
+ final String IS_LETTER = "字母";
|
|
|
+ for (WdfacilityRelPersagy wdfacilityRelPersagy : wdfacilityRelList) {
|
|
|
+ // 根据万达设备信息表的主键查询数据是否存在
|
|
|
+ hydomcAssetspec = this.getHydomcAssetspecByPKey(wdfacilityRelPersagy.getAssetattrid());
|
|
|
+ if (hydomcAssetspec == null) {
|
|
|
+ hydomcAssetspec = new HydomcAssetspec(); // 万达设备参数信息表实体
|
|
|
+ isInsert = true; // 万达数据库没有这条数据 需要新增
|
|
|
+ }
|
|
|
+ hydomcAssetspec.setSiteid(wdProjectid); // 广场id 关联设备信息 Pj4403070003
|
|
|
+ if (!infosObj.isEmpty()) {
|
|
|
+ hydomcAssetspec.setSbybm(String.valueOf(infosObj.get(InfosKeyConstant.EQUIPMENT_CODE))); // 设备编码 关联设备信息 wD_gongchengxinxihua
|
|
|
+ hydomcAssetspec.setClassstructureid(String.valueOf(infosObj.get(InfosKeyConstant.EQUIPMENT_SORT))); // 设备分类id 1507
|
|
|
+ // 根据Datatype判断设置设备参数数字值还是设备参数文本值 key为wdfacility_rel_persagy的code值从infos取
|
|
|
+ if (IS_NUMBER.equals(wdfacilityRelPersagy.getDatatype())) { // 是数字
|
|
|
+ log.info("dataType是数字");
|
|
|
+ hydomcAssetspec.setNumvalue(Double.valueOf(String.valueOf(infosObj.get(wdfacilityRelPersagy.getCode())))); // 设备参数数字值 (取自infos)
|
|
|
+ } else if (IS_LETTER.equals(wdfacilityRelPersagy.getDatatype())) { // 是字母
|
|
|
+ log.info("dataType是字母");
|
|
|
+ hydomcAssetspec.setAlnvalue(String.valueOf(infosObj.get(wdfacilityRelPersagy.getCode()))); // 设备参数文本值 (取自infos)
|
|
|
+ }
|
|
|
+ // key为wdfacility_rel_persagy的code值从infos取 有值update 无值(空、空字符串)就是delete
|
|
|
+ if (StringUtils.isBlank(String.valueOf(infosObj.get(wdfacilityRelPersagy.getCode())))) {
|
|
|
+ // 无值 delete
|
|
|
+ log.info("code没有值,数据状态设置为delete");
|
|
|
+ hydomcAssetspec.setDatastatus(SwitchConstant.IS_DELETE); // 数据状态 update/delete
|
|
|
+ } else {
|
|
|
+ // 有值 update
|
|
|
+ log.info("code有值,数据状态设置为update");
|
|
|
+ hydomcAssetspec.setDatastatus(SwitchConstant.IS_UPDATE); // 数据状态 update/delete
|
|
|
+ }
|
|
|
+ }
|
|
|
+ hydomcAssetspec.setClassqc(wdfacilityRelPersagy.getClassqc()); // 设备分类名称 电梯系统/扶梯/人行步道 (取自中间表wdfacility_rel_persagy)
|
|
|
+ hydomcAssetspec.setAssetattrid(wdfacilityRelPersagy.getAssetattrid()); // 主键 设备参数id 1106 (取自中间表wdfacility_rel_persagy)
|
|
|
+ hydomcAssetspec.setCsdesc(wdfacilityRelPersagy.getCsdesc()); // 设备参数名称 (取自中间表wdfacility_rel_persagy)
|
|
|
+ hydomcAssetspec.setDatatype(wdfacilityRelPersagy.getDatatype()); // 设备参数类型 (取自中间表wdfacility_rel_persagy)
|
|
|
+ hydomcAssetspec.setMeasureunitid(wdfacilityRelPersagy.getMeasureunitid()); // 设备参数单位编码 (取自中间表wdfacility_rel_persagy)
|
|
|
+ hydomcAssetspec.setCsjldw(wdfacilityRelPersagy.getCsjldw()); // 设备参数单位名称 (取自中间表wdfacility_rel_persagy)
|
|
|
+ hydomcAssetspec.setChangedate(updateTime); // 数据更新时间 增量字段
|
|
|
+ if (isInsert) {
|
|
|
+ this.hydomcAssetspecMapper.insert(hydomcAssetspec);
|
|
|
+ } else {
|
|
|
+ this.hydomcAssetspecMapper.updateById(hydomcAssetspec);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param primaryKey 万达设备参数信息表主键
|
|
|
+ * @return com.persagy.transfer.pojo.dto.HydomcAssetspec
|
|
|
+ * @author YangWanYi
|
|
|
+ * @describe 根据主键查询设备参数信息
|
|
|
+ * @date 2021/9/16 18:17
|
|
|
+ */
|
|
|
+ @DS(value = SwitchConstant.DS_MASTER_2)
|
|
|
+ private HydomcAssetspec getHydomcAssetspecByPKey(String primaryKey) {
|
|
|
+ return this.hydomcAssetspecMapper.selectById(primaryKey);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param wdClassCode 万达设备类编码 (从wdclass_rel_persagy获取)
|
|
|
+ * @param classStrucrureId 万达设备分类表id (从wdclass_rel_persagy获取)
|
|
|
+ * @return java.util.List<com.persagy.transfer.pojo.dto.WdfacilityRelPersagy>
|
|
|
+ * @author YangWanYi
|
|
|
+ * @describe 根据万达设备类编码和万达设备分类表id查询表wdfacility_rel_persagy数据
|
|
|
+ * @date 2021/9/16 17:49
|
|
|
+ */
|
|
|
+ private List<WdfacilityRelPersagy> listWdfacilityRelPersagy(String wdClassCode, String classStrucrureId) {
|
|
|
+ HashMap<String, Object> columnMap = new HashMap<>();
|
|
|
+ columnMap.put("wdClassCode", wdClassCode); // 万达设备类编码
|
|
|
+ columnMap.put("classstrucrureid", classStrucrureId); // 万达设备分类表id
|
|
|
+ return this.wdfacilityRelPersagyMapper.selectByMap(columnMap);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param infosObj 博锐尚格项目表的infos字段值
|
|
|
+ * @param wdProjectId 博锐尚格项目ID映射的万达项目ID
|
|
|
+ * @param hydomcAsset 万达设备信息对象
|
|
|
+ * @param valid 项目数据对象状态:1有效,0无效
|
|
|
+ * @param updateTime 项目最后更新时间
|
|
|
+ * @param classstrucrureid 万达设备分类ID
|
|
|
+ * @return int
|
|
|
+ * @author YangWanYi
|
|
|
+ * @describe 万达设备信息对象数据同步
|
|
|
+ * @date 2021/9/16 16:00
|
|
|
+ */
|
|
|
+ @DS(value = SwitchConstant.DS_MASTER_2)
|
|
|
+ private int sycnHydomcAsset(JSONObject infosObj, String wdProjectId, HydomcAsset hydomcAsset, Integer valid, java.util.Date updateTime, String classstrucrureid) {
|
|
|
+ log.info("准备同步万达设备信息对象数据");
|
|
|
+ boolean isInsert = false; // 默认操作类型为更新
|
|
|
+ if (!infosObj.isEmpty()) {
|
|
|
+ // 根据万达设备信息表的主键查询数据是否存在
|
|
|
+ hydomcAsset = this.getHydomcAssetByPKey(String.valueOf(infosObj.get(InfosKeyConstant.EQUIPMENT_CODE)));
|
|
|
+ if (hydomcAsset == null) {
|
|
|
+ hydomcAsset = new HydomcAsset(); // 万达设备信息主表实体
|
|
|
+ isInsert = true; // 万达数据库没有这条数据 需要新增
|
|
|
+ }
|
|
|
+ hydomcAsset.setSbybm(String.valueOf(infosObj.get(InfosKeyConstant.EQUIPMENT_CODE))); // 主键 无其他主键可采用设备编码为主键,但要确保唯一(工程信息化设备原码)
|
|
|
+ hydomcAsset.setDescription(String.valueOf(infosObj.get(InfosKeyConstant.EQUIPMENT_NAME))); // 设备名称
|
|
|
+ // hydomcAsset.setWzqy(); // 详细设备安装位置,格式:楼体-楼层-区域 没有key 后续补充
|
|
|
+ hydomcAsset.setFwqy(String.valueOf(infosObj.get(InfosKeyConstant.EQUIPMENT_SERVICE_ZONE))); // 设备服务区域 设备/系统服务范围
|
|
|
+ hydomcAsset.setSbxh(String.valueOf(infosObj.get(InfosKeyConstant.EQUIPMENT_MODEL))); // 厂商设备型号
|
|
|
+ hydomcAsset.setClassstructureid(classstrucrureid); // 对接设备分类id,同步后不可更改
|
|
|
+ hydomcAsset.setStatus(valid == 0 ? SwitchConstant.SCRAP : SwitchConstant.RUNNING); // 设备状态 运行中/报废 默认都为运行中
|
|
|
+ hydomcAsset.setSbxhh(String.valueOf(infosObj.get(InfosKeyConstant.EQUIPMENT_IDX))); // 设备序号 同类设备的序号,即第几台设备:第几台电梯
|
|
|
+ hydomcAsset.setCjsbxh(String.valueOf(infosObj.get(InfosKeyConstant.SERIAL_NUM))); // 厂家设备序列号
|
|
|
+ hydomcAsset.setManufacturer(String.valueOf(infosObj.get(InfosKeyConstant.MANUFACTURER))); // 生产商公司供方管理系统编码code
|
|
|
+ hydomcAsset.setVendor(String.valueOf(infosObj.get(InfosKeyConstant.SUPPLIER))); // 供应商公司供方管理系统编码code
|
|
|
+ hydomcAsset.setFws(String.valueOf(infosObj.get(InfosKeyConstant.MAINTAINER))); // 服务商公司供方管理系统编码code
|
|
|
+ hydomcAsset.setPurchaseprice(Double.valueOf(String.valueOf(infosObj.get(InfosKeyConstant.PURCHASE_PRICE)))); // 采购金额 填写人民币元
|
|
|
+ hydomcAsset.setZjsynx(Double.valueOf(String.valueOf(infosObj.get(InfosKeyConstant.SERVICE_LIFE)))); // 折旧/使用年限 按年填写 如3年半则填写 3.5
|
|
|
+ hydomcAsset.setScrq(Date.valueOf(String.valueOf(infosObj.get(InfosKeyConstant.PRODUCT_DATE)))); // 生产日期/出厂日期 年/月/日
|
|
|
+ hydomcAsset.setCgrq(Date.valueOf(String.valueOf(infosObj.get(InfosKeyConstant.PURCHASE_DATE)))); // 采购日期
|
|
|
+ hydomcAsset.setAzdate(Date.valueOf(String.valueOf(infosObj.get(InfosKeyConstant.INSTALL_DATE)))); // 安装日期
|
|
|
+ hydomcAsset.setInstalldate(Date.valueOf(String.valueOf(infosObj.get(InfosKeyConstant.ENABLE_DATE)))); // 启用日期
|
|
|
+ hydomcAsset.setZbksrq(Date.valueOf(String.valueOf(infosObj.get(InfosKeyConstant.WARRANTY_START_DATE)))); // 质保开始日期
|
|
|
+ hydomcAsset.setZbjsrq(Date.valueOf(String.valueOf(infosObj.get(InfosKeyConstant.WARRANTY_END_DATE)))); // 质保结束日期
|
|
|
+ hydomcAsset.setZxzq(Integer.valueOf(String.valueOf(infosObj.get(InfosKeyConstant.MEDIUM_REPAIR_CYCLE)))); // 中修周期 单位为月
|
|
|
+ hydomcAsset.setDxzq(Integer.valueOf(String.valueOf(infosObj.get(InfosKeyConstant.OVERHAUL_CYCLE)))); // 大修周期 单位为月
|
|
|
+ hydomcAsset.setWylx(String.valueOf(infosObj.get(InfosKeyConstant.PROPERTY_TYPE))); // 物业类型 自持/销售/合作方
|
|
|
+ hydomcAsset.setSbglgs(String.valueOf(infosObj.get(InfosKeyConstant.EQUIPMENT_MANAGE_OWNERSHIP))); // 设备管理归属 商管/百货/大歌星/超市/影院/大酒楼/其他
|
|
|
+ hydomcAsset.setHysbbm(String.valueOf(infosObj.get(InfosKeyConstant.WISDOM_CLOUD_LOCAL_CODE))); // 慧云设备编码
|
|
|
+ hydomcAsset.setSfhysy(String.valueOf(infosObj.get(InfosKeyConstant.WISDOM_CLOUD_USE))); // 是否慧云使用 是/否 缺省为 是
|
|
|
+ hydomcAsset.setSfzld(String.valueOf(infosObj.get(InfosKeyConstant.MAIN_STORE))); // 是否是主力店 缺省为 否
|
|
|
+ hydomcAsset.setMark(String.valueOf(infosObj.get(InfosKeyConstant.REMARK))); // 备注 wD_beizhu
|
|
|
+ }
|
|
|
+ hydomcAsset.setSiteid(wdProjectId); // 项目唯一id,可采用租赁系统广场id,同步后不可更改
|
|
|
+ hydomcAsset.setDatastatus(valid == 0 ? SwitchConstant.IS_DELETE : SwitchConstant.IS_UPDATE); // 数据状态 update/delete 当数据状态为delete时,设备状态需改为报废
|
|
|
+ hydomcAsset.setChangedate(updateTime); // 数据更新时间 增量字段
|
|
|
+ if (isInsert) {
|
|
|
+ return this.hydomcAssetMapper.insert(hydomcAsset);
|
|
|
+ } else {
|
|
|
+ return this.hydomcAssetMapper.updateById(hydomcAsset);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param primaryKey 万达设备信息主表主键
|
|
|
+ * @return com.persagy.transfer.pojo.dto.HydomcAsset
|
|
|
+ * @author YangWanYi
|
|
|
+ * @describe 根据主键获取万达设备信息
|
|
|
+ * @date 2021/9/16 15:31
|
|
|
+ */
|
|
|
+ @DS(value = SwitchConstant.DS_MASTER_2)
|
|
|
+ private HydomcAsset getHydomcAssetByPKey(String primaryKey) {
|
|
|
+ return this.hydomcAssetMapper.selectById(primaryKey);
|
|
|
+ }
|
|
|
+
|
|
|
}
|