Commit bb47c8dd authored by 刘凡's avatar 刘凡

新增:气瓶标数据es保存

parent f2d9eafe
......@@ -61,6 +61,10 @@ public class TmCylinderFillingRecordService extends BaseService<TmCylinderFillin
// if (ValidationUtil.isEmpty(model))
// throw new BadRequest("气瓶标签信息为空.");
syncCylinderFilling(model);
ArrayList<ESCylinderFillingRecordDto> models = Bean.toModels(model, ESCylinderFillingRecordDto.class);
createCylinderFillingRecord(models);
for (TmCylinderFillingRecordModel cylinderFillingRecordModel : model) {
cylinderFillingRecordModel.setRecDate(new Date());
cylinderFillingRecordModel.setAppId(getAppId());
......
......@@ -64,9 +64,13 @@ public class TmCylinderInfoService extends BaseService<TmCylinderInfoModel, TmCy
if (ValidationUtil.isEmpty(model))
throw new BadRequest("气瓶基本信息数据为空.");
syncCylinderInfo(model);
for (TmCylinderInfoModel cylinderInfoModel : model) {
cylinderInfoModel.setRecDate(new Date());
cylinderInfoModel.setAppId(getAppId());
createCylinderInfo2ES(cylinderInfoModel);
this.createWithModel(cylinderInfoModel);
}
return "OK";
......@@ -82,7 +86,8 @@ public class TmCylinderInfoService extends BaseService<TmCylinderInfoModel, TmCy
}
public void createCylinderInfo2ES(CylinderInfoDto cylinderInfoDto) {
public void createCylinderInfo2ES(TmCylinderInfoModel cylinderInfoModel) {
CylinderInfoDto cylinderInfoDto = Bean.toModel(cylinderInfoModel, new CylinderInfoDto());
List<ESCylinderInfoDto> esCylinderInfoDto = new ArrayList<>();
ESCylinderInfoDto esCylinderInfo = new ESCylinderInfoDto();
BeanUtils.copyProperties(cylinderInfoDto, esCylinderInfo);
......
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