From 86d9ac606fc9963d7e1709fff2c771c58d0393f5 Mon Sep 17 00:00:00 2001 From: Jone <515616805@qq.com> Date: Thu, 12 Sep 2024 13:56:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C2021=E5=B9=B4=E6=9C=BA=E6=9E=84ID=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E8=BD=AC=E6=8D=A2=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/UpdateDeptIdController.java | 190 --------------------- .../equipment/service/IUpdateDeptIdService.java | 16 -- .../service/impl/BladexUpdateDataServiceImpl.java | 9 - .../service/impl/DutyUpdateDeptIdServiceImpl.java | 9 - .../impl/EquipmentUpdateDeptIdServiceImpl.java | 16 -- .../service/impl/HzimsUpdateDeptIdServiceImpl.java | 9 - .../impl/InspectUpdateDeptIdServiceImpl.java | 10 -- .../impl/MessageUpdateDeptIdServiceImpl.java | 9 - .../service/impl/OperationUpdateIdServiceImpl.java | 9 - .../impl/RealMonitorUpdateDeptIdServiceImpl.java | 10 -- .../service/impl/UpdateDeptIdServiceImpl.java | 164 ------------------ .../src/main/resources/template/template.yml | 14 +- 12 files changed, 1 insertion(+), 464 deletions(-) delete mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/UpdateDeptIdController.java delete mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IUpdateDeptIdService.java delete mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/BladexUpdateDataServiceImpl.java delete mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/DutyUpdateDeptIdServiceImpl.java delete mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EquipmentUpdateDeptIdServiceImpl.java delete mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/HzimsUpdateDeptIdServiceImpl.java delete mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/InspectUpdateDeptIdServiceImpl.java delete mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/MessageUpdateDeptIdServiceImpl.java delete mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/OperationUpdateIdServiceImpl.java delete mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/RealMonitorUpdateDeptIdServiceImpl.java delete mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/UpdateDeptIdServiceImpl.java diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/UpdateDeptIdController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/UpdateDeptIdController.java deleted file mode 100644 index eeb04d0..0000000 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/UpdateDeptIdController.java +++ /dev/null @@ -1,190 +0,0 @@ -package com.hnac.hzims.equipment.controller; - -import com.hnac.hzims.equipment.service.IUpdateDeptIdService; -import io.swagger.annotations.Api; -import lombok.AllArgsConstructor; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; - -@RestController -@AllArgsConstructor -@RequestMapping("/db/dataUpdate") -@Api(value = "更新所有业务数据机构ID和租户ID字段", tags = "更新所有业务数据机构ID和租户ID字段") -public class UpdateDeptIdController { - - @Resource(name="equipmentUpdateDeptIdService") - private IUpdateDeptIdService equipmentUpdateDeptIdService; - - @Resource(name="inspectUpdateDeptIdService") - private IUpdateDeptIdService inspectUpdateDeptIdService; - - @Resource(name="operationUpdateDeptIdService") - private IUpdateDeptIdService operationUpdateDeptIdService; - - @Resource(name="hzimsUpdateDeptIdService") - private IUpdateDeptIdService hzimsUpdateDeptIdService; - - @Resource(name="dutyUpdateDeptIdService") - private IUpdateDeptIdService dutyUpdateDeptIdService; - - @Resource(name="messageUpdateDeptIdService") - private IUpdateDeptIdService messageUpdateDeptIdService; - - @Resource(name="realMonitorUpdateDeptIdService") - private IUpdateDeptIdService realMonitorUpdateDeptIdService; - - @Resource(name="bladexUpdateDataService") - private IUpdateDeptIdService bladexUpdateDataService; - - -// @PostMapping("/updateDeptId") -// @ApiOperationSupport(order = 4) -// @ApiOperation(value = "更新所有业务数据部门机构字段", notes = "传入数据库相关信息") -// public R updateDeptId(@RequestBody UpdateDeptVo updateDeptVo) { -// if(StringUtils.isBlank(updateDeptVo.getDbName())) { -// return R.fail("请输入数据库名"); -// } -// if(null == updateDeptVo.getDataMappingList() || updateDeptVo.getDataMappingList().isEmpty()) { -// return R.fail("请输入机构ID映射信息"); -// } -// boolean result = false; -// switch (updateDeptVo.getDbName()) { -// case "equipment" : -// // 设备管理 -// result = equipmentUpdateDeptIdService.updateDeptId(updateDeptVo); -// break; -// case "hzims_inspect": -// // 巡检管理 -// result = inspectUpdateDeptIdService.updateDeptId(updateDeptVo); -// break; -// case "hzims_operation": -// result = operationUpdateDeptIdService.updateDeptId(updateDeptVo); -// break; -// case "hzims": -// result = hzimsUpdateDeptIdService.updateDeptId(updateDeptVo); -// break; -// case "duty": -// result = dutyUpdateDeptIdService.updateDeptId(updateDeptVo); -// break; -// case "message": -// result = messageUpdateDeptIdService.updateDeptId(updateDeptVo); -// break; -// case "realmonitor": -// result = realMonitorUpdateDeptIdService.updateDeptId(updateDeptVo); -// break; -// case "bladex": -// result = bladexUpdateDataService.updateDeptId(updateDeptVo); -// break; -// default: -// break; -// -// } -// if(result) { -// return R.success("成功"); -// } else { -// return R.fail("更新失败"); -// } -// } -// -// @PostMapping("/updateTenantId") -// @ApiOperationSupport(order = 5) -// @ApiOperation(value = "更新所有业务数据租户ID字段", notes = "传入数据库相关信息") -// public R updateTenantId(@RequestBody UpdateTenantVo updateTenantVo) { -// if(StringUtils.isBlank(updateTenantVo.getDbName())) { -// return R.fail("请输入数据库名"); -// } -// if(null == updateTenantVo.getDataMappingList() || updateTenantVo.getDataMappingList().isEmpty()) { -// return R.fail("请输入机构ID映射信息"); -// } -// boolean result = false; -// switch (updateTenantVo.getDbName()) { -// case "equipment" : -// // 设备管理 -// result = equipmentUpdateDeptIdService.updateTenantId(updateTenantVo); -// break; -// case "hzims_inspect": -// // 巡检管理 -// result = inspectUpdateDeptIdService.updateTenantId(updateTenantVo); -// break; -// case "hzims_operation": -// result = operationUpdateDeptIdService.updateTenantId(updateTenantVo); -// break; -// case "hzims": -// result = hzimsUpdateDeptIdService.updateTenantId(updateTenantVo); -// break; -// case "duty": -// result = dutyUpdateDeptIdService.updateTenantId(updateTenantVo); -// break; -// case "message": -// result = messageUpdateDeptIdService.updateTenantId(updateTenantVo); -// break; -// case "realmonitor": -// result = realMonitorUpdateDeptIdService.updateTenantId(updateTenantVo); -// break; -// case "bladex" : -// result = bladexUpdateDataService.updateTenantId(updateTenantVo); -// break; -// default: -// break; -// -// } -// if(result) { -// return R.success("成功"); -// } else { -// return R.fail("更新失败"); -// } -// } -// -// @PostMapping("/updateDeptIdByTenantId") -// @ApiOperationSupport(order = 5) -// @ApiOperation(value = "根据租户ID更新机构ID", notes = "传入数据库相关信息") -// public R updateDeptIdByTenantId(@RequestBody UpdateDeptIdByTenantIdVO updateDeptIdByTenantIdVO) { -// if(StringUtils.isBlank(updateDeptIdByTenantIdVO.getDbName())) { -// return R.fail("请输入数据库名"); -// } -// if(null == updateDeptIdByTenantIdVO.getDeptAndTenantIdList() || updateDeptIdByTenantIdVO.getDeptAndTenantIdList().isEmpty()) { -// return R.fail("请输入机构ID映射信息"); -// } -// boolean result = false; -// -// switch (updateDeptIdByTenantIdVO.getDbName()) { -// case "equipment" : -// // 设备管理 -// result = equipmentUpdateDeptIdService.updateDeptIdByTenantId(updateDeptIdByTenantIdVO); -// break; -// case "hzims_inspect": -// // 巡检管理 -// result = inspectUpdateDeptIdService.updateDeptIdByTenantId(updateDeptIdByTenantIdVO); -// break; -// case "hzims_operation": -// result = operationUpdateDeptIdService.updateDeptIdByTenantId(updateDeptIdByTenantIdVO); -// break; -// case "hzims": -// result = hzimsUpdateDeptIdService.updateDeptIdByTenantId(updateDeptIdByTenantIdVO); -// break; -// case "duty": -// result = dutyUpdateDeptIdService.updateDeptIdByTenantId(updateDeptIdByTenantIdVO); -// break; -// case "message": -// result = messageUpdateDeptIdService.updateDeptIdByTenantId(updateDeptIdByTenantIdVO); -// break; -// case "realmonitor": -// result = realMonitorUpdateDeptIdService.updateDeptIdByTenantId(updateDeptIdByTenantIdVO); -// break; -// case "bladex" : -// result = bladexUpdateDataService.updateDeptIdByTenantId(updateDeptIdByTenantIdVO); -// break; -// default: -// break; -// -// } -// if(result) { -// return R.success("成功"); -// } else { -// return R.fail("更新失败"); -// } -// } - -} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IUpdateDeptIdService.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IUpdateDeptIdService.java deleted file mode 100644 index 193bc57..0000000 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IUpdateDeptIdService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.hnac.hzims.equipment.service; - -import com.hnac.hzims.equipment.vo.UpdateDeptIdByTenantIdVO; -import com.hnac.hzims.equipment.vo.UpdateDeptVo; -import com.hnac.hzims.equipment.vo.UpdateTenantVo; - -import java.util.List; - -public interface IUpdateDeptIdService { - - boolean updateDeptId(UpdateDeptVo updateDeptVo); - - boolean updateTenantId(UpdateTenantVo updateTenantVo); - - boolean updateDeptIdByTenantId(UpdateDeptIdByTenantIdVO updateDeptIdByTenantIdVO); -} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/BladexUpdateDataServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/BladexUpdateDataServiceImpl.java deleted file mode 100644 index 3126f6d..0000000 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/BladexUpdateDataServiceImpl.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.hnac.hzims.equipment.service.impl; - -import com.baomidou.dynamic.datasource.annotation.DS; -import org.springframework.stereotype.Service; - -@Service("bladexUpdateDataService") -@DS("bladex") -public class BladexUpdateDataServiceImpl extends UpdateDeptIdServiceImpl { -} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/DutyUpdateDeptIdServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/DutyUpdateDeptIdServiceImpl.java deleted file mode 100644 index 80633db..0000000 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/DutyUpdateDeptIdServiceImpl.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.hnac.hzims.equipment.service.impl; - -import com.baomidou.dynamic.datasource.annotation.DS; -import org.springframework.stereotype.Service; - -@Service("dutyUpdateDeptIdService") -@DS("duty") -public class DutyUpdateDeptIdServiceImpl extends UpdateDeptIdServiceImpl { -} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EquipmentUpdateDeptIdServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EquipmentUpdateDeptIdServiceImpl.java deleted file mode 100644 index e905d4e..0000000 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EquipmentUpdateDeptIdServiceImpl.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.hnac.hzims.equipment.service.impl; - -import com.baomidou.dynamic.datasource.annotation.DS; -import com.hnac.hzims.equipment.entity.EmInfoEntity; -import com.hnac.hzims.equipment.mapper.UpdateDeptIdMapper; -import com.hnac.hzims.equipment.service.IUpdateDeptIdService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.context.annotation.Primary; -import org.springframework.stereotype.Service; - -@Service("equipmentUpdateDeptIdService") -@Primary -@DS("equipment") -public class EquipmentUpdateDeptIdServiceImpl extends UpdateDeptIdServiceImpl { - -} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/HzimsUpdateDeptIdServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/HzimsUpdateDeptIdServiceImpl.java deleted file mode 100644 index 09e5ee4..0000000 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/HzimsUpdateDeptIdServiceImpl.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.hnac.hzims.equipment.service.impl; - -import com.baomidou.dynamic.datasource.annotation.DS; -import org.springframework.stereotype.Service; - -@Service("hzimsUpdateDeptIdService") -@DS("hzims") -public class HzimsUpdateDeptIdServiceImpl extends UpdateDeptIdServiceImpl{ -} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/InspectUpdateDeptIdServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/InspectUpdateDeptIdServiceImpl.java deleted file mode 100644 index 93a26e1..0000000 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/InspectUpdateDeptIdServiceImpl.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.hnac.hzims.equipment.service.impl; - - -import com.baomidou.dynamic.datasource.annotation.DS; -import org.springframework.stereotype.Service; - -@Service("inspectUpdateDeptIdService") -@DS("inspect") -public class InspectUpdateDeptIdServiceImpl extends UpdateDeptIdServiceImpl { -} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/MessageUpdateDeptIdServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/MessageUpdateDeptIdServiceImpl.java deleted file mode 100644 index 0b87855..0000000 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/MessageUpdateDeptIdServiceImpl.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.hnac.hzims.equipment.service.impl; - -import com.baomidou.dynamic.datasource.annotation.DS; -import org.springframework.stereotype.Service; - -@Service("messageUpdateDeptIdService") -@DS("message") -public class MessageUpdateDeptIdServiceImpl extends UpdateDeptIdServiceImpl { -} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/OperationUpdateIdServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/OperationUpdateIdServiceImpl.java deleted file mode 100644 index b0337fb..0000000 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/OperationUpdateIdServiceImpl.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.hnac.hzims.equipment.service.impl; - -import com.baomidou.dynamic.datasource.annotation.DS; -import org.springframework.stereotype.Service; - -@Service("operationUpdateDeptIdService") -@DS("operation") -public class OperationUpdateIdServiceImpl extends UpdateDeptIdServiceImpl { -} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/RealMonitorUpdateDeptIdServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/RealMonitorUpdateDeptIdServiceImpl.java deleted file mode 100644 index 6f97720..0000000 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/RealMonitorUpdateDeptIdServiceImpl.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.hnac.hzims.equipment.service.impl; - -import com.baomidou.dynamic.datasource.annotation.DS; -import org.springframework.context.annotation.Primary; -import org.springframework.stereotype.Service; - -@Service("realMonitorUpdateDeptIdService") -@DS("realMonitor") -public class RealMonitorUpdateDeptIdServiceImpl extends UpdateDeptIdServiceImpl { -} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/UpdateDeptIdServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/UpdateDeptIdServiceImpl.java deleted file mode 100644 index d3c4efd..0000000 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/UpdateDeptIdServiceImpl.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.hnac.hzims.equipment.service.impl; - -import com.google.common.base.Joiner; -import com.hnac.hzims.common.logs.utils.StringUtils; -import com.hnac.hzims.equipment.entity.EmInfoEntity; -import com.hnac.hzims.equipment.mapper.UpdateDeptIdMapper; -import com.hnac.hzims.equipment.service.IUpdateDeptIdService; -import com.hnac.hzims.equipment.vo.DataMappingVo; -import com.hnac.hzims.equipment.vo.UpdateDeptIdByTenantIdVO; -import com.hnac.hzims.equipment.vo.UpdateDeptVo; -import com.hnac.hzims.equipment.vo.UpdateTenantVo; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; - -public class UpdateDeptIdServiceImpl extends ServiceImpl implements IUpdateDeptIdService { - @Override - @Transactional(rollbackFor = Exception.class) - public boolean updateDeptId(UpdateDeptVo updateDeptVo) { - Map map = new HashMap<>(); - if(StringUtils.isNotBlank(updateDeptVo.getTableName())) { - // 更新具体的表的字段 - if("blade_user".equals(updateDeptVo.getTableName())){ - List> list = baseMapper.getBladeUserList(); - if(null != list && !list.isEmpty()) { - for(Map mapTemp : list) { - String deptIds = (String)mapTemp.get("dept_ids"); - deptIds = searchDeptId(deptIds, updateDeptVo.getDataMappingList()); - mapTemp.put("dept_ids", deptIds); - String deptId = (String)mapTemp.get("dept_id"); - deptId = searchDeptId(deptId, updateDeptVo.getDataMappingList()); - map.put("dept_id", deptId); - baseMapper.updateBladeUserDeptIds(mapTemp); - } - } - } else { - map.put("tableName", updateDeptVo.getTableName()); - map.put("columnName", updateDeptVo.getColumnName()); - updateDeptVo.getDataMappingList().stream().forEach(item -> { - map.put("oldDeptId", item.getOldId()); - map.put("newDeptId", item.getNewId()); - baseMapper.updateTableDeptId(map); - }); - } - - } else { - // 更新整个库的create_dept字段 - List> tableList = baseMapper.getTablesList(); - if(null != tableList && !tableList.isEmpty()) { - for(Map item : tableList) { - map.put("tableName", item.get("TABLE_NAME")); - map.put("columnName", "create_dept"); - if(item.get("TABLE_NAME").toString().toLowerCase().indexOf("log") >= 0 || item.get("TABLE_NAME").toString().toLowerCase().indexOf("copy1") >= 0) { - continue; - } - List> tableColumns = baseMapper.getTableColumnList(item); - boolean flag = false; - if(null != tableColumns && !tableColumns.isEmpty()) { - for(Map columnMap : tableColumns) { - if("create_dept".equalsIgnoreCase(columnMap.get("COLUMN_NAME").toString())) { - flag = true; - break; - } - } - } - if(flag) { - updateDeptVo.getDataMappingList().stream().forEach(item1 -> { - map.put("oldDeptId", item1.getOldId()); - map.put("newDeptId", item1.getNewId()); - baseMapper.updateTableDeptId(map); - }); - } - } - } - } - return true; - } - - private String searchDeptId(String deptIds, List dataMappingList) { - if(StringUtils.isNotBlank(deptIds)) { - String[] deptIdsArr =deptIds.split(","); - for(int i = 0; i< deptIdsArr.length; i++) { - for(DataMappingVo dataMappingVo : dataMappingList) { - if(deptIdsArr[i].equals(dataMappingVo.getOldId().toString())) { - deptIdsArr[i] = dataMappingVo.getNewId().toString(); - break; - } - } - } - return Joiner.on(',').join(deptIdsArr); - } - return null; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public boolean updateTenantId(UpdateTenantVo updateTenantVo) { - Map map = new HashMap<>(); - List> tableList = baseMapper.getTablesList(); - if(null != tableList && !tableList.isEmpty()) { - for(Map item : tableList) { - if(item.get("TABLE_NAME").toString().toLowerCase().indexOf("log") >= 0 || item.get("TABLE_NAME").toString().toLowerCase().indexOf("copy1") >= 0) { - continue; - } - map.put("tableName", item.get("TABLE_NAME")); - map.put("columnName", "tenant_id"); - List> tableColumns = baseMapper.getTableColumnList(item); - boolean flag = false; - if(null != tableColumns && !tableColumns.isEmpty()) { - for(Map columnMap : tableColumns) { - if("tenant_id".equalsIgnoreCase(columnMap.get("COLUMN_NAME").toString())) { - flag = true; - break; - } - } - } - if(flag) { - updateTenantVo.getDataMappingList().stream().forEach(item1 -> { - map.put("oldTenantId", item1.getOldId()); - map.put("newTenantId", item1.getNewId()); - baseMapper.updateTableTenantId(map); - }); - } - } - } - return true; - } - - @Override - public boolean updateDeptIdByTenantId(UpdateDeptIdByTenantIdVO updateDeptIdByTenantIdVO) { - Map map = new HashMap<>(); - List> tableList = baseMapper.getTablesList(); - if(null != tableList && !tableList.isEmpty()) { - for(Map item : tableList) { - if(item.get("TABLE_NAME").toString().toLowerCase().indexOf("log") >= 0 || item.get("TABLE_NAME").toString().toLowerCase().indexOf("copy1") >= 0) { - continue; - } - map.put("tableName", item.get("TABLE_NAME")); - List> tableColumns = baseMapper.getTableColumnList(item); - int hasColumnCount = 0; - if(null != tableColumns && !tableColumns.isEmpty()) { - for(Map columnMap : tableColumns) { - if("tenant_id".equalsIgnoreCase(columnMap.get("COLUMN_NAME").toString())) { - hasColumnCount++; - } - if("create_dept".equalsIgnoreCase(columnMap.get("COLUMN_NAME").toString())) { - hasColumnCount++; - } - } - } - if(hasColumnCount == 2) { - updateDeptIdByTenantIdVO.getDeptAndTenantIdList().stream().forEach(item1 -> { - map.put("tenantId", item1.getTenantId()); - map.put("deptId", item1.getDeptId()); - baseMapper.updateDeptIdByTenantId(map); - }); - } - } - } - return true; - } - -} diff --git a/hzims-service/equipment/src/main/resources/template/template.yml b/hzims-service/equipment/src/main/resources/template/template.yml index 03de46d..5ab4b6f 100644 --- a/hzims-service/equipment/src/main/resources/template/template.yml +++ b/hzims-service/equipment/src/main/resources/template/template.yml @@ -19,18 +19,6 @@ spring: url: jdbc:mysql://${hzinfo.db.busines.ip}:${hzinfo.db.busines.port}/equipment?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true username: ${hzinfo.db.busines.username} password: ${hzinfo.db.busines.password} - inspect: - url: jdbc:mysql://${hzinfo.db.busines.ip}:${hzinfo.db.busines.port}/hzims-inspect?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true - username: ${hzinfo.db.busines.username} - password: ${hzinfo.db.busines.password} - hzims: - url: jdbc:mysql://${hzinfo.db.busines.ip}:${hzinfo.db.busines.port}/hzims?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true - username: ${hzinfo.db.busines.username} - password: ${hzinfo.db.busines.password} - bladex: - url: jdbc:mysql://${hzinfo.db.busines.ip}:${hzinfo.db.busines.port}/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true - username: ${hzinfo.db.busines.username} - password: ${hzinfo.db.busines.password} #oss配置 oss: @@ -159,4 +147,4 @@ url: deLianUrl: http://iot.delianfa.com:8081/api/Docking/DockingData deLian: hostId: 400184 - passWord: 654321 \ No newline at end of file + passWord: 654321