Commit 4856d24c authored by suhuiguang's avatar suhuiguang

1.es 分片

2.定时任务与controller调用的service拆分为两个,原因,controller调用也会进行枷锁
parent 89133bb1
...@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.elevator.api.dto; ...@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.elevator.api.dto;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.annotations.FieldType;
...@@ -15,7 +14,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -15,7 +14,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "idx_biz_view_jg_all", type = "idx_biz_view_jg_all", shards = 1, replicas = 0) @Document(indexName = "idx_biz_view_jg_all", shards = 6, replicas = 2)
public class ESEquipmentCategoryDto { public class ESEquipmentCategoryDto {
@Id @Id
......
...@@ -21,7 +21,7 @@ import java.util.Date; ...@@ -21,7 +21,7 @@ import java.util.Date;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "tzs", type = "tzsAlertCalled", shards = 1, replicas = 0) @Document(indexName = "tzs", shards = 6, replicas = 2)
public class ESAlertCalled { public class ESAlertCalled {
/** 主键 */ /** 主键 */
......
...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "cylinder_filling", type = "tzs_cylinder_filling", shards = 1, replicas = 0) @Document(indexName = "cylinder_filling", shards = 6, replicas = 2)
public class ESCylinderFillingRecordDto { public class ESCylinderFillingRecordDto {
@Id @Id
......
...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "cylinder_info", type = "tzs_cylinder_info", shards = 1, replicas = 0) @Document(indexName = "cylinder_info", shards = 6, replicas = 2)
public class ESCylinderInfoDto { public class ESCylinderInfoDto {
@Id @Id
......
...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField; ...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "cylinder", replicas = 0) @Document(indexName = "cylinder", shards = 6, replicas = 2)
public class EsCylinder { public class EsCylinder {
/** /**
......
...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField; ...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "elev", type = "tzsElevator", shards = 1, replicas = 0) @Document(indexName = "elev", shards = 6, replicas = 2)
public class EsElevator { public class EsElevator {
......
...@@ -14,7 +14,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -14,7 +14,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "idx_biz_view_jg_all", type = "idx_biz_view_jg_all", shards = 1, replicas = 0) @Document(indexName = "idx_biz_view_jg_all", shards = 6, replicas = 2)
public class ESEquipmentCategoryDto { public class ESEquipmentCategoryDto {
@Id @Id
......
...@@ -21,7 +21,7 @@ import java.util.Date; ...@@ -21,7 +21,7 @@ import java.util.Date;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "tzs", type = "tzsAlertCalled", shards = 1, replicas = 0) @Document(indexName = "tzs", shards = 6, replicas = 2)
public class ESAlertCalled { public class ESAlertCalled {
/** 主键 */ /** 主键 */
......
...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "cylinder_filling", type = "tzs_cylinder_filling", shards = 1, replicas = 0) @Document(indexName = "cylinder_filling", shards = 6, replicas = 2)
public class ESCylinderFillingRecordDto { public class ESCylinderFillingRecordDto {
@Id @Id
......
...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "cylinder_info", type = "tzs_cylinder_info", shards = 1, replicas = 0) @Document(indexName = "cylinder_info", shards = 6, replicas = 2)
public class ESCylinderInfoDto { public class ESCylinderInfoDto {
@Id @Id
......
...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField; ...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "cylinder", replicas = 0) @Document(indexName = "cylinder", shards = 6, replicas = 2)
public class EsCylinder { public class EsCylinder {
/** /**
......
...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField; ...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "elev", type = "tzsElevator", shards = 1, replicas = 0) @Document(indexName = "elev", shards = 6, replicas = 2)
public class EsElevator { public class EsElevator {
......
...@@ -41,7 +41,9 @@ public interface ICylinderInfoService { ...@@ -41,7 +41,9 @@ public interface ICylinderInfoService {
void synUnitIntegrityData(); void synUnitIntegrityData();
void synUnitFillingCheckData(); void synUnitFillingCheckDataJob();
void fillingCheckDataSynHandler();
void synFillingUnloadUnitData(); void synFillingUnloadUnitData();
......
...@@ -21,10 +21,10 @@ public class FillingRecordSyncListener extends EmqxListener { ...@@ -21,10 +21,10 @@ public class FillingRecordSyncListener extends EmqxListener {
CylinderInfoServiceImpl cylinderInfoService; CylinderInfoServiceImpl cylinderInfoService;
@Override @Override
public void processMessage(String topic, MqttMessage message) throws Exception { public void processMessage(String topic, MqttMessage message) {
System.out.println(message); System.out.println(message);
if (!ValidationUtil.isEmpty(message.toString())) { if (!ValidationUtil.isEmpty(message.toString())) {
cylinderInfoService.synUnitFillingCheckData(); cylinderInfoService.synUnitFillingCheckDataJob();
} }
} }
} }
...@@ -1103,7 +1103,7 @@ public class CylinderInfoController extends BaseController { ...@@ -1103,7 +1103,7 @@ public class CylinderInfoController extends BaseController {
@GetMapping(value = "/synUnitFillingCheckData") @GetMapping(value = "/synUnitFillingCheckData")
@ApiOperation(httpMethod = "GET", value = "气瓶充装检查情况同步", notes = "气瓶充装检查情况同步") @ApiOperation(httpMethod = "GET", value = "气瓶充装检查情况同步", notes = "气瓶充装检查情况同步")
public ResponseModel<Boolean> synUnitFillingCheckData() { public ResponseModel<Boolean> synUnitFillingCheckData() {
cylinderInfoServiceImpl.synUnitFillingCheckData(); cylinderInfoServiceImpl.fillingCheckDataSynHandler();
return ResponseHelper.buildResponse(true); return ResponseHelper.buildResponse(true);
} }
...@@ -1222,7 +1222,7 @@ public class CylinderInfoController extends BaseController { ...@@ -1222,7 +1222,7 @@ public class CylinderInfoController extends BaseController {
cylinderInfoServiceImpl.synUnitCylinderFillingData(); cylinderInfoServiceImpl.synUnitCylinderFillingData();
cylinderInfoServiceImpl.synUnitCylinderTagsData(); cylinderInfoServiceImpl.synUnitCylinderTagsData();
cylinderInfoServiceImpl.synUnitIntegrityData(); cylinderInfoServiceImpl.synUnitIntegrityData();
cylinderInfoServiceImpl.synUnitFillingCheckData(); cylinderInfoServiceImpl.fillingCheckDataSynHandler();
cylinderInfoServiceImpl.synFillingUnloadUnitData(); cylinderInfoServiceImpl.synFillingUnloadUnitData();
} }
}).start(); }).start();
......
...@@ -50,7 +50,7 @@ public class EnterpriseStatisticController extends BaseController { ...@@ -50,7 +50,7 @@ public class EnterpriseStatisticController extends BaseController {
@ApiOperation(value = "创建表格数据") @ApiOperation(value = "创建表格数据")
@GetMapping(value = "/createTableInfoPage") @GetMapping(value = "/createTableInfoPage")
public ResponseModel createTableInfoPage() { public ResponseModel createTableInfoPage() {
cylinderDateInfoService.fixedDelayJob(); cylinderDateInfoService.fixedDelayPageData();
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
......
...@@ -166,7 +166,12 @@ public class CylinderDateInfoServiceImpl extends BaseService<CylinderDateInfoDto ...@@ -166,7 +166,12 @@ public class CylinderDateInfoServiceImpl extends BaseService<CylinderDateInfoDto
*/ */
@Scheduled(cron = "0 0 2 * * ?") @Scheduled(cron = "0 0 2 * * ?")
@SchedulerLock(name="fixedDelayJobCylinderDataTask",lockAtMostFor = "PT6H") @SchedulerLock(name="fixedDelayJobCylinderDataTask",lockAtMostFor = "PT6H")
public void fixedDelayJob() { public void fixedDelayPageDataJob() {
this.fixedDelayPageData();
}
public void fixedDelayPageData() {
// 每天更新或者添加昨天的数据 // 每天更新或者添加昨天的数据
//取时间 //取时间
Date date = new Date(); Date date = new Date();
......
...@@ -197,12 +197,16 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -197,12 +197,16 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/** /**
* 按单位统计 * 按单位统计
*/ */
@Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 2 * * ?") @Scheduled(cron = "0 0 2 * * ?")
@SchedulerLock(name = "synFillingUnloadDataTask", lockAtMostFor = "PT6H") @SchedulerLock(name = "synFillingUnloadDataTask", lockAtMostFor = "PT6H")
public void synFillingUnloadDataJob() {
this.synFillingUnloadData();
}
@Override
public void synFillingUnloadData() { public void synFillingUnloadData() {
cylinderFillingUnloadDataServiceImpl.remove(new LambdaQueryWrapper<CylinderFillingUnloadData>()); cylinderFillingUnloadDataServiceImpl.remove(new LambdaQueryWrapper<>());
countByRegion(regionModel -> { countByRegion(regionModel -> {
Calendar now = Calendar.getInstance(); Calendar now = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
...@@ -225,12 +229,16 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -225,12 +229,16 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/** /**
* 按区域统计 * 按区域统计
*/ */
@Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 2 * * ?") @Scheduled(cron = "0 0 2 * * ?")
@SchedulerLock(name = "synAreaDataTask", lockAtMostFor = "PT60M") @SchedulerLock(name = "synAreaDataTask", lockAtMostFor = "PT60M")
public void synAreaDataJob() {
this.synAreaData();
}
@Override
public void synAreaData() { public void synAreaData() {
cylinderAreaDataServiceImpl.remove(new LambdaQueryWrapper<CylinderAreaData>()); cylinderAreaDataServiceImpl.remove(new LambdaQueryWrapper<>());
countByRegion(regionModel -> { countByRegion(regionModel -> {
CylinderAreaDataDto temp = new CylinderAreaDataDto(); CylinderAreaDataDto temp = new CylinderAreaDataDto();
temp.setAreaName(regionModel.getRegionName()); temp.setAreaName(regionModel.getRegionName());
...@@ -263,6 +271,11 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -263,6 +271,11 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "* * 2 * * ?") @Scheduled(cron = "* * 2 * * ?")
@SchedulerLock(name = "addIntegrityDataTask", lockAtMostFor = "PT60M") @SchedulerLock(name = "addIntegrityDataTask", lockAtMostFor = "PT60M")
public void addIntegrityDataJob() {
this.addIntegrityData();
}
@Override
public void addIntegrityData() { public void addIntegrityData() {
System.out.println("====================数据完整性开始============================"); System.out.println("====================数据完整性开始============================");
cylinderIntegrityDataServiceImpl.remove(new LambdaQueryWrapper<CylinderIntegrityData>()); cylinderIntegrityDataServiceImpl.remove(new LambdaQueryWrapper<CylinderIntegrityData>());
...@@ -325,12 +338,17 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -325,12 +338,17 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/** /**
* 企业总量按区域统计 * 企业总量按区域统计
*/ */
@Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 2 * * ?") @Scheduled(cron = "0 0 2 * * ?")
@SchedulerLock(name = "cylinderUnitInfoTask", lockAtMostFor = "PT60M") @SchedulerLock(name = "cylinderUnitInfoTask", lockAtMostFor = "PT60M")
public void getCylinderUnitInfoJob() {
this.getCylinderUnitInfo();
}
@Override
public void getCylinderUnitInfo() { public void getCylinderUnitInfo() {
cylinderUnitDataServiceImpl.remove(new LambdaQueryWrapper<CylinderUnitData>()); cylinderUnitDataServiceImpl.remove(new LambdaQueryWrapper<>());
countByRegion(regionModel -> { countByRegion(regionModel -> {
String regionCode = String.valueOf(regionModel.getRegionCode()); String regionCode = String.valueOf(regionModel.getRegionCode());
Integer cylinderUnitTotal = cylinderUnitServiceImpl.getUnitTotalByRegionCode(regionCode); Integer cylinderUnitTotal = cylinderUnitServiceImpl.getUnitTotalByRegionCode(regionCode);
...@@ -361,10 +379,14 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -361,10 +379,14 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/** /**
* 气瓶总量按区域统计 * 气瓶总量按区域统计
*/ */
@Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 2 * * ?") @Scheduled(cron = "0 0 2 * * ?")
@SchedulerLock(name = "cylinderInfoTask", lockAtMostFor = "PT6H") @SchedulerLock(name = "cylinderInfoTask", lockAtMostFor = "PT6H")
public void getCylinderInfoJob() {
this.getCylinderInfo();
}
@Override
public void getCylinderInfo() { public void getCylinderInfo() {
cylinderInfoDataServiceImpl.remove(new LambdaQueryWrapper<>()); cylinderInfoDataServiceImpl.remove(new LambdaQueryWrapper<>());
countByRegion(regionModel -> { countByRegion(regionModel -> {
...@@ -395,12 +417,16 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -395,12 +417,16 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/** /**
* 按单位统计 * 按单位统计
*/ */
@Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 2 * * ?") @Scheduled(cron = "0 0 2 * * ?")
@SchedulerLock(name = "synUnitCylinderInfoDataTask", lockAtMostFor = "PT6H") @SchedulerLock(name = "synUnitCylinderInfoDataTask", lockAtMostFor = "PT6H")
public void synUnitCylinderInfoDataJob() {
this.synUnitCylinderInfoData();
}
@Override
public void synUnitCylinderInfoData() { public void synUnitCylinderInfoData() {
cylinderInfoDataUnitServiceImpl.remove(new LambdaQueryWrapper<CylinderInfoDataUnit>()); cylinderInfoDataUnitServiceImpl.remove(new LambdaQueryWrapper<>());
countByUnit(cylinderUnit -> { countByUnit(cylinderUnit -> {
CylinderInfoDataUnitDto temp = new CylinderInfoDataUnitDto(); CylinderInfoDataUnitDto temp = new CylinderInfoDataUnitDto();
temp.setAppId(cylinderUnit.getAppId()); temp.setAppId(cylinderUnit.getAppId());
...@@ -429,12 +455,16 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -429,12 +455,16 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/** /**
* 充装量按单位和月统计 * 充装量按单位和月统计
*/ */
@Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 2 * * ?") @Scheduled(cron = "0 0 2 * * ?")
@SchedulerLock(name = "synUnitCylinderFillingDataTask", lockAtMostFor = "PT6H") @SchedulerLock(name = "synUnitCylinderFillingDataTask", lockAtMostFor = "PT6H")
public void synUnitCylinderFillingDataJob() {
this.synUnitCylinderFillingData();
}
@Override
public void synUnitCylinderFillingData() { public void synUnitCylinderFillingData() {
cylinderFillingDataUnitServiceImpl.remove(new LambdaQueryWrapper<CylinderFillingDataUnit>()); cylinderFillingDataUnitServiceImpl.remove(new LambdaQueryWrapper<>());
countByUnit(cylinderUnit -> { countByUnit(cylinderUnit -> {
// 按照月份 获取数据 取一年数据 // 按照月份 获取数据 取一年数据
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
...@@ -474,12 +504,16 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -474,12 +504,16 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/** /**
* 按单位统计 * 按单位统计
*/ */
@Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 2 * * ?") @Scheduled(cron = "0 0 2 * * ?")
@SchedulerLock(name = "synUnitCylinderTagsDataTask", lockAtMostFor = "PT6H") @SchedulerLock(name = "synUnitCylinderTagsDataTask", lockAtMostFor = "PT6H")
public void synUnitCylinderTagsDataJob() {
this.synUnitCylinderTagsData();
}
@Override
public void synUnitCylinderTagsData() { public void synUnitCylinderTagsData() {
cylinderTagsDataUnitServiceImpl.remove(new LambdaQueryWrapper<CylinderTagsDataUnit>()); cylinderTagsDataUnitServiceImpl.remove(new LambdaQueryWrapper<>());
countByUnit(cylinderUnit -> { countByUnit(cylinderUnit -> {
CylinderTagsDataUnitDto temp = new CylinderTagsDataUnitDto(); CylinderTagsDataUnitDto temp = new CylinderTagsDataUnitDto();
temp.setAppId(cylinderUnit.getAppId()); temp.setAppId(cylinderUnit.getAppId());
...@@ -507,12 +541,18 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -507,12 +541,18 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/** /**
* 按单位统计 * 按单位统计
*/ */
@Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 2 * * ?") @Scheduled(cron = "0 0 2 * * ?")
@SchedulerLock(name = "synUnitIntegrityDataTask", lockAtMostFor = "PT6H") @SchedulerLock(name = "synUnitIntegrityDataTask", lockAtMostFor = "PT6H")
public void synUnitIntegrityDataJob(){
this.synUnitIntegrityData();
}
@Override
public void synUnitIntegrityData() { public void synUnitIntegrityData() {
cylinderIntegrityDataUnitServiceImpl.remove(new LambdaQueryWrapper<CylinderIntegrityDataUnit>()); cylinderIntegrityDataUnitServiceImpl.remove(new LambdaQueryWrapper<>());
countByUnit(cylinderUnit -> { countByUnit(cylinderUnit -> {
// 企业信息 // 企业信息
CylinderIntegrityDataUnitDto uninInfo = new CylinderIntegrityDataUnitDto(); CylinderIntegrityDataUnitDto uninInfo = new CylinderIntegrityDataUnitDto();
...@@ -572,8 +612,12 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -572,8 +612,12 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 2 * * ?") @Scheduled(cron = "0 0 2 * * ?")
@SchedulerLock(name = "synUnitFillingCheckDataTask", lockAtMostFor = "PT6H") @SchedulerLock(name = "synUnitFillingCheckDataTask", lockAtMostFor = "PT6H")
public void synUnitFillingCheckData() { public void synUnitFillingCheckDataJob() {
// cylinderFillingCheckDataUnitServiceImpl.remove(new LambdaQueryWrapper<CylinderFillingCheckDataUnit>()); this.fillingCheckDataSynHandler();
}
@Override
public void fillingCheckDataSynHandler() {
countByUnit(cylinderUnit -> { countByUnit(cylinderUnit -> {
List<CylinderFillingCheckDataUnitDto> allCylinderFillingCheckDataList = List<CylinderFillingCheckDataUnitDto> allCylinderFillingCheckDataList =
cylinderFillingCheckDataUnitServiceImpl.queryCylinderFillingCheckListByParam(cylinderUnit.getAppId(), null); cylinderFillingCheckDataUnitServiceImpl.queryCylinderFillingCheckListByParam(cylinderUnit.getAppId(), null);
...@@ -669,12 +713,16 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -669,12 +713,16 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/** /**
* 充装量、卸液量按单位统计 * 充装量、卸液量按单位统计
*/ */
@Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 2 * * ?") @Scheduled(cron = "0 0 2 * * ?")
@SchedulerLock(name = "synFillingUnloadUnitDataTask", lockAtMostFor = "PT6H") @SchedulerLock(name = "synFillingUnloadUnitDataTask", lockAtMostFor = "PT6H")
public void synFillingUnloadUnitDataJob() {
this.synFillingUnloadUnitData();
}
@Override
public void synFillingUnloadUnitData() { public void synFillingUnloadUnitData() {
cylinderFillingUnloadDataUnitServiceImpl.remove(new LambdaQueryWrapper<CylinderFillingUnloadDataUnit>()); cylinderFillingUnloadDataUnitServiceImpl.remove(new LambdaQueryWrapper<>());
countByUnit(cylinderUnit -> { countByUnit(cylinderUnit -> {
Calendar now = Calendar.getInstance(); Calendar now = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
......
...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "idx_biz_view_jg_all", type = "idx_biz_view_jg_all", shards = 1, replicas = 0) @Document(indexName = "idx_biz_view_jg_all", shards = 6, replicas = 2)
public class ESEquipmentCategoryDto { public class ESEquipmentCategoryDto {
@Id @Id
......
...@@ -21,7 +21,7 @@ import java.util.Date; ...@@ -21,7 +21,7 @@ import java.util.Date;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "tzs", type = "tzsAlertCalled", shards = 1, replicas = 0) @Document(indexName = "tzs", shards = 6, replicas = 2)
public class ESAlertCalled { public class ESAlertCalled {
/** 主键 */ /** 主键 */
......
...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "cylinder_filling", type = "tzs_cylinder_filling", shards = 1, replicas = 0) @Document(indexName = "cylinder_filling", shards = 6, replicas = 2)
public class ESCylinderFillingRecordDto { public class ESCylinderFillingRecordDto {
@Id @Id
......
...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "cylinder_info", type = "tzs_cylinder_info", shards = 1, replicas = 0) @Document(indexName = "cylinder_info", shards = 6, replicas = 2)
public class ESCylinderInfoDto { public class ESCylinderInfoDto {
@Id @Id
......
...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField; ...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "cylinder", replicas = 0) @Document(indexName = "cylinder", shards = 6, replicas = 2)
public class EsCylinder { public class EsCylinder {
/** /**
......
...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField; ...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "elev", type = "tzsElevator", shards = 1, replicas = 0) @Document(indexName = "elev", shards = 6, replicas = 2)
public class EsElevator { public class EsElevator {
......
...@@ -14,7 +14,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -14,7 +14,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "idx_biz_view_jg_all", type = "idx_biz_view_jg_all", shards = 1, replicas = 0) @Document(indexName = "idx_biz_view_jg_all", shards = 6, replicas = 2)
public class ESEquipmentCategoryDto { public class ESEquipmentCategoryDto {
@Id @Id
......
...@@ -21,7 +21,7 @@ import java.util.Date; ...@@ -21,7 +21,7 @@ import java.util.Date;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "tzs", type = "tzsAlertCalled", shards = 1, replicas = 0) @Document(indexName = "tzs", shards = 6, replicas = 2)
public class ESAlertCalled { public class ESAlertCalled {
/** 主键 */ /** 主键 */
......
...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "cylinder_filling", type = "tzs_cylinder_filling", shards = 1, replicas = 0) @Document(indexName = "cylinder_filling", shards = 6, replicas = 2)
public class ESCylinderFillingRecordDto { public class ESCylinderFillingRecordDto {
@Id @Id
......
...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "cylinder_info", type = "tzs_cylinder_info", shards = 1, replicas = 0) @Document(indexName = "cylinder_info", shards = 6, replicas = 2)
public class ESCylinderInfoDto { public class ESCylinderInfoDto {
@Id @Id
......
...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField; ...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "cylinder", replicas = 0) @Document(indexName = "cylinder", shards = 6, replicas = 2)
public class EsCylinder { public class EsCylinder {
/** /**
......
...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField; ...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "elev", type = "tzsElevator", shards = 1, replicas = 0) @Document(indexName = "elev", shards = 6, replicas = 2)
public class EsElevator { public class EsElevator {
......
...@@ -14,7 +14,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -14,7 +14,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "idx_biz_view_jg_all", type = "idx_biz_view_jg_all", shards = 1, replicas = 0) @Document(indexName = "idx_biz_view_jg_all", shards = 6, replicas = 2)
public class ESEquipmentCategoryDto { public class ESEquipmentCategoryDto {
@Id @Id
......
...@@ -21,7 +21,7 @@ import java.util.Date; ...@@ -21,7 +21,7 @@ import java.util.Date;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "tzs", type = "tzsAlertCalled", shards = 1, replicas = 0) @Document(indexName = "tzs", shards = 6, replicas = 2)
public class ESAlertCalled { public class ESAlertCalled {
/** 主键 */ /** 主键 */
......
...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "cylinder_filling", type = "tzs_cylinder_filling", shards = 1, replicas = 0) @Document(indexName = "cylinder_filling", shards = 6, replicas = 2)
public class ESCylinderFillingRecordDto { public class ESCylinderFillingRecordDto {
@Id @Id
......
...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -10,7 +10,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "cylinder_info", type = "tzs_cylinder_info", shards = 1, replicas = 0) @Document(indexName = "cylinder_info", shards = 6, replicas = 2)
public class ESCylinderInfoDto { public class ESCylinderInfoDto {
@Id @Id
......
...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField; ...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "cylinder", replicas = 0) @Document(indexName = "cylinder", shards = 6, replicas = 2)
public class EsCylinder { public class EsCylinder {
/** /**
......
...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField; ...@@ -15,7 +15,7 @@ import org.springframework.data.elasticsearch.annotations.GeoPointField;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Document(indexName = "elev", type = "tzsElevator", shards = 1, replicas = 0) @Document(indexName = "elev", shards = 6, replicas = 2)
public class EsElevator { public class EsElevator {
......
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