Commit 2d73c1b8 authored by kinky2014's avatar kinky2014

增加气瓶单位数据

parent f442a167
...@@ -8,6 +8,7 @@ import com.baomidou.dynamic.datasource.annotation.DS; ...@@ -8,6 +8,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnit; import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnit;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto; import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnitVideo; import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnitVideo;
...@@ -28,4 +29,8 @@ public class SyncCylinderDataService ...@@ -28,4 +29,8 @@ public class SyncCylinderDataService
List<CylinderUnit> cylinderUnitList = Bean.toModels(cylinderUnitDto,CylinderUnit.class); List<CylinderUnit> cylinderUnitList = Bean.toModels(cylinderUnitDto,CylinderUnit.class);
cylinderUnitMapper.saveOrUpdateBatch(cylinderUnitList); cylinderUnitMapper.saveOrUpdateBatch(cylinderUnitList);
} }
public void syncCylinderInfo(final List<CylinderInfoDto> cylinderInfoDto) {
}
} }
...@@ -7,10 +7,12 @@ import java.util.Date; ...@@ -7,10 +7,12 @@ import java.util.Date;
import java.util.List; import java.util.List;
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.orm.dao.ESCylinderInfoRepository; import com.yeejoin.amos.api.openapi.face.orm.dao.ESCylinderInfoRepository;
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.ESCylinderInfoDto; import com.yeejoin.amos.boot.module.cylinder.api.entity.ESCylinderInfoDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto; import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderInfoMapper; import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderInfoMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -22,6 +24,7 @@ import org.springframework.util.ObjectUtils; ...@@ -22,6 +24,7 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StopWatch; import org.springframework.util.StopWatch;
import org.typroject.tyboot.component.cache.Redis; import org.typroject.tyboot.component.cache.Redis;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...@@ -50,7 +53,8 @@ public class TmCylinderInfoService extends BaseService<TmCylinderInfoModel, TmCy ...@@ -50,7 +53,8 @@ public class TmCylinderInfoService extends BaseService<TmCylinderInfoModel, TmCy
@Autowired @Autowired
CylinderInfoMapper cylinderInfoMapper; CylinderInfoMapper cylinderInfoMapper;
@Autowired
private SyncCylinderDataService syncCylinderDataService;
@Autowired @Autowired
ESCylinderInfoRepository esCylinderInfoRepository; ESCylinderInfoRepository esCylinderInfoRepository;
...@@ -67,6 +71,11 @@ public class TmCylinderInfoService extends BaseService<TmCylinderInfoModel, TmCy ...@@ -67,6 +71,11 @@ public class TmCylinderInfoService extends BaseService<TmCylinderInfoModel, TmCy
} }
return "OK"; return "OK";
} }
@Transactional(rollbackFor= {Exception.class})
private void syncCylinderUnitModel(List<TmCylinderInfoModel> model ) {
List<CylinderInfoDto> cylinderInfoDto = Bean.toModels(model,CylinderInfoDto.class);
syncCylinderDataService.syncCylinderInfo(cylinderInfoDto);
}
private String getAppId() { private String getAppId() {
String tokenKey = Redis.genKey(Constant.TOKEN_PREFIX,RequestContext.getToken()); String tokenKey = Redis.genKey(Constant.TOKEN_PREFIX,RequestContext.getToken());
BizTokenModel bizTokenModel = (BizTokenModel) redisTemplate.opsForValue().get(tokenKey); BizTokenModel bizTokenModel = (BizTokenModel) redisTemplate.opsForValue().get(tokenKey);
......
...@@ -83,10 +83,10 @@ ...@@ -83,10 +83,10 @@
#{item.recUserId}, #{item.recUserId},
#{item.syncDate}, #{item.syncDate},
#{item.syncState}, #{item.syncState},
#{item.appId}), #{item.appId},
#{item.securityAdm}, #{item.securityAdm},
#{item.securityAdmPhone}, #{item.securityAdmPhone},
#{item.regionName} #{item.regionName})
</foreach> </foreach>
on conflict (app_id) do update set on conflict (app_id) do update set
"unit_id" = EXCLUDED."unit_id", "unit_id" = EXCLUDED."unit_id",
......
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