Commit bb0cb3f8 authored by 刘凡's avatar 刘凡

新增:升级多数据源3.4.1

parent 95fdb43e
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<dependency> <dependency>
<groupId>com.baomidou</groupId> <groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId> <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>3.1.0</version> <version>3.4.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -32,6 +32,7 @@ import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderUnitMapper; ...@@ -32,6 +32,7 @@ import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderUnitMapper;
import java.util.List; import java.util.List;
@Component @Component
@DS("tzs")
public class SyncCylinderDataService public class SyncCylinderDataService
{ {
/** /**
......
...@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service; ...@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingCheckDto; import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingCheckDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingDto; import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingDto;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -37,7 +38,8 @@ public class TmCylinderFillingCheckService extends BaseService<TmCylinderFilling ...@@ -37,7 +38,8 @@ public class TmCylinderFillingCheckService extends BaseService<TmCylinderFilling
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
@Autowired @Autowired
private SyncCylinderDataService syncCylinderDataService; private SyncCylinderDataService syncCylinderDataService;
@Transactional(rollbackFor= {Exception.class})
@DSTransactional
public String createCylinderFillingAfter(List<TmCylinderFillingCheckModel> model) { public String createCylinderFillingAfter(List<TmCylinderFillingCheckModel> model) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
// if (ValidationUtil.isEmpty(model)) // if (ValidationUtil.isEmpty(model))
......
...@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service; ...@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.yeejoin.amos.api.openapi.face.model.TmCylinderUnitModel; import com.yeejoin.amos.api.openapi.face.model.TmCylinderUnitModel;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingExamineDto; import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingExamineDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto; import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto;
...@@ -42,7 +43,7 @@ public class TmCylinderFillingExamineService extends BaseService<TmCylinderFilli ...@@ -42,7 +43,7 @@ public class TmCylinderFillingExamineService extends BaseService<TmCylinderFilli
private SyncCylinderDataService syncCylinderDataService; private SyncCylinderDataService syncCylinderDataService;
@Transactional(rollbackFor= {Exception.class}) @DSTransactional
public String createCylinderFillingExamine(List<TmCylinderFillingExamineModel> model) { public String createCylinderFillingExamine(List<TmCylinderFillingExamineModel> model) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
if (ValidationUtil.isEmpty(model)) if (ValidationUtil.isEmpty(model))
......
...@@ -8,6 +8,7 @@ import java.util.List; ...@@ -8,6 +8,7 @@ import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.yeejoin.amos.api.openapi.face.orm.dao.ESCylinderFillingRecordRepository; import com.yeejoin.amos.api.openapi.face.orm.dao.ESCylinderFillingRecordRepository;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.cylinder.api.entity.ESCylinderFillingRecordDto; import com.yeejoin.amos.boot.module.cylinder.api.entity.ESCylinderFillingRecordDto;
...@@ -55,7 +56,7 @@ public class TmCylinderFillingRecordService extends BaseService<TmCylinderFillin ...@@ -55,7 +56,7 @@ public class TmCylinderFillingRecordService extends BaseService<TmCylinderFillin
@Autowired @Autowired
private SyncCylinderDataService syncCylinderDataService; private SyncCylinderDataService syncCylinderDataService;
@Transactional(rollbackFor= {Exception.class}) @DSTransactional
public String createCylinderFilling(List<TmCylinderFillingRecordModel> model) { public String createCylinderFilling(List<TmCylinderFillingRecordModel> model) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
// if (ValidationUtil.isEmpty(model)) // if (ValidationUtil.isEmpty(model))
...@@ -73,6 +74,7 @@ public class TmCylinderFillingRecordService extends BaseService<TmCylinderFillin ...@@ -73,6 +74,7 @@ public class TmCylinderFillingRecordService extends BaseService<TmCylinderFillin
return "OK"; return "OK";
} }
@DS("tzs")
private void syncCylinderFilling(List<TmCylinderFillingRecordModel> model) { private void syncCylinderFilling(List<TmCylinderFillingRecordModel> model) {
syncCylinderDataService.syncCylinderFillingRecord(model); syncCylinderDataService.syncCylinderFillingRecord(model);
} }
......
...@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service; ...@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.yeejoin.amos.api.openapi.face.model.TmCylinderUnitModel; import com.yeejoin.amos.api.openapi.face.model.TmCylinderUnitModel;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingDto; import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto; import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto;
...@@ -40,7 +41,7 @@ public class TmCylinderFillingService extends BaseService<TmCylinderFillingModel ...@@ -40,7 +41,7 @@ public class TmCylinderFillingService extends BaseService<TmCylinderFillingModel
@Autowired @Autowired
private SyncCylinderDataService syncCylinderDataService; private SyncCylinderDataService syncCylinderDataService;
@Transactional(rollbackFor= {Exception.class}) @DSTransactional
public String createCylinderFillingBefore(List<TmCylinderFillingModel> model) { public String createCylinderFillingBefore(List<TmCylinderFillingModel> model) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
// if (ValidationUtil.isEmpty(model)) // if (ValidationUtil.isEmpty(model))
......
...@@ -6,6 +6,7 @@ import java.util.ArrayList; ...@@ -6,6 +6,7 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.api.openapi.face.model.TmCylinderUnitModel; import com.yeejoin.amos.api.openapi.face.model.TmCylinderUnitModel;
import com.yeejoin.amos.api.openapi.face.orm.dao.ESCylinderInfoRepository; import com.yeejoin.amos.api.openapi.face.orm.dao.ESCylinderInfoRepository;
...@@ -58,7 +59,7 @@ public class TmCylinderInfoService extends BaseService<TmCylinderInfoModel, TmCy ...@@ -58,7 +59,7 @@ public class TmCylinderInfoService extends BaseService<TmCylinderInfoModel, TmCy
@Autowired @Autowired
ESCylinderInfoRepository esCylinderInfoRepository; ESCylinderInfoRepository esCylinderInfoRepository;
@Transactional(rollbackFor= {Exception.class}) @DSTransactional
public String createCylinderInfo(List<TmCylinderInfoModel> model) { public String createCylinderInfo(List<TmCylinderInfoModel> model) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
if (ValidationUtil.isEmpty(model)) if (ValidationUtil.isEmpty(model))
......
...@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service; ...@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInspectionDto; import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInspectionDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto; import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -39,7 +40,8 @@ public class TmCylinderInspectionService extends BaseService<TmCylinderInspectio ...@@ -39,7 +40,8 @@ public class TmCylinderInspectionService extends BaseService<TmCylinderInspectio
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
@Autowired @Autowired
private SyncCylinderDataService syncCylinderDataService; private SyncCylinderDataService syncCylinderDataService;
@Transactional(rollbackFor= {Exception.class})
@DSTransactional
public String createCylinderInspection(List<TmCylinderInspectionModel> model) { public String createCylinderInspection(List<TmCylinderInspectionModel> model) {
if (ValidationUtil.isEmpty(model)) if (ValidationUtil.isEmpty(model))
throw new BadRequest("气瓶检验信息为空."); throw new BadRequest("气瓶检验信息为空.");
......
...@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service; ...@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInspectionDto; import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInspectionDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderTagsDto; import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderTagsDto;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -40,7 +41,7 @@ public class TmCylinderTagsService extends BaseService<TmCylinderTagsModel, TmCy ...@@ -40,7 +41,7 @@ public class TmCylinderTagsService extends BaseService<TmCylinderTagsModel, TmCy
@Autowired @Autowired
private SyncCylinderDataService syncCylinderDataService; private SyncCylinderDataService syncCylinderDataService;
@Transactional(rollbackFor= {Exception.class}) @DSTransactional
public String createCylinderTag(List<TmCylinderTagsModel> model) { public String createCylinderTag(List<TmCylinderTagsModel> model) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
if (ValidationUtil.isEmpty(model)) if (ValidationUtil.isEmpty(model))
......
...@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service; ...@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -39,7 +40,8 @@ public class TmCylinderUnitService extends BaseService<TmCylinderUnitModel, TmCy ...@@ -39,7 +40,8 @@ public class TmCylinderUnitService extends BaseService<TmCylinderUnitModel, TmCy
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
@Autowired @Autowired
private SyncCylinderDataService syncCylinderDataService; private SyncCylinderDataService syncCylinderDataService;
@Transactional(rollbackFor= {Exception.class})
@DSTransactional
public String createCylinderUnit(List<TmCylinderUnitModel> model) { public String createCylinderUnit(List<TmCylinderUnitModel> model) {
if (ValidationUtil.isEmpty(model)) if (ValidationUtil.isEmpty(model))
throw new BadRequest("气瓶企业信息数据为空."); throw new BadRequest("气瓶企业信息数据为空.");
......
...@@ -34,7 +34,7 @@ public interface CylCylinderFillingCheckMapper extends BaseMapper<CylinderFillin ...@@ -34,7 +34,7 @@ public interface CylCylinderFillingCheckMapper extends BaseMapper<CylinderFillin
boolean updataSyncFilling(@Param("ids") List<Long> appIds); boolean updataSyncFilling(@Param("ids") List<Long> appIds);
boolean saveAndBatchInsert(@Param("list") List<CylinderFilling> list); void saveAndBatchInsert(@Param("list") List<CylinderFilling> list);
Long selectCountTotal(); Long selectCountTotal();
......
...@@ -55,5 +55,6 @@ public interface CylinderUnitMapper extends BaseMapper<CylinderUnit> { ...@@ -55,5 +55,6 @@ public interface CylinderUnitMapper extends BaseMapper<CylinderUnit> {
* @return list * @return list
*/ */
List<CityCylinderInfoDto> getCylinderDataByLevel(@Param("level") String level); List<CityCylinderInfoDto> getCylinderDataByLevel(@Param("level") String level);
void saveOrUpdateBatch(@Param("list") List<CylinderUnit> list); void saveOrUpdateBatch(@Param("list") List<CylinderUnit> list);
} }
...@@ -141,10 +141,8 @@ ...@@ -141,10 +141,8 @@
LIMIT 1000 LIMIT 1000
</select> </select>
<insert id="saveAndBatchInsert"> <insert id="saveAndBatchInsert" parameterType="com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderFillingRecord">
INSERT INTO "tz_cylinder_filling" INSERT INTO tz_cylinder_filling( sequence_nbr,
(
sequence_nbr,
filling_before_id, filling_before_id,
filling_unit_name, filling_unit_name,
sequence_code, sequence_code,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment