Commit 54aa0665 authored by tangwei's avatar tangwei

解决冲突

parents a5135ae7 b62055b0
...@@ -185,4 +185,7 @@ public class JpInverter implements Serializable { ...@@ -185,4 +185,7 @@ public class JpInverter implements Serializable {
*/ */
@TableField("addr") @TableField("addr")
private String addr; private String addr;
@TableField("sn_name")
private String name;
} }
...@@ -142,5 +142,6 @@ public class TdHYGFInverterDayGenerate implements Serializable { ...@@ -142,5 +142,6 @@ public class TdHYGFInverterDayGenerate implements Serializable {
private Double income; private Double income;
private Double fullhour; private Double fullhour;
private String name;
} }
...@@ -40,5 +40,6 @@ public class TdHYGFInverterMonthGenerate implements Serializable { ...@@ -40,5 +40,6 @@ public class TdHYGFInverterMonthGenerate implements Serializable {
*/ */
private Double fullhour; private Double fullhour;
private Double income; private Double income;
private String name;
} }
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine; package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
...@@ -40,5 +41,6 @@ public class TdHYGFInverterTotalGenerate implements Serializable { ...@@ -40,5 +41,6 @@ public class TdHYGFInverterTotalGenerate implements Serializable {
*/ */
private Double fullhour; private Double fullhour;
private Double income; private Double income;
private String name;
} }
...@@ -40,5 +40,7 @@ public class TdHYGFInverterYearGenerate implements Serializable { ...@@ -40,5 +40,7 @@ public class TdHYGFInverterYearGenerate implements Serializable {
*/ */
private Double fullhour; private Double fullhour;
private Double income; private Double income;
private String name;
} }
...@@ -461,6 +461,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -461,6 +461,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
if (ObjectUtils.isEmpty(jpInverter)) { if (ObjectUtils.isEmpty(jpInverter)) {
jpInverter = new JpInverter(); jpInverter = new JpInverter();
} }
jpInverter.setName(inverterDetailDto.getStationName());
jpInverter.setSnCode(inverterDetailDto.getSn().trim()); jpInverter.setSnCode(inverterDetailDto.getSn().trim());
jpInverter.setState(golangRequestUtil.getInverterState(inverterDetailDto.getCurrentState(), inverterDetailDto.getDataTimestamp())); jpInverter.setState(golangRequestUtil.getInverterState(inverterDetailDto.getCurrentState(), inverterDetailDto.getDataTimestamp()));
jpInverter.setCollectorId(String.valueOf(inverterDetailDto.getCollectorId())); jpInverter.setCollectorId(String.valueOf(inverterDetailDto.getCollectorId()));
...@@ -582,6 +583,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -582,6 +583,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
//-----------------------户用光伏日报表---------------------- //-----------------------户用光伏日报表----------------------
TdHYGFInverterDayGenerate tdHYGFInverterDayGenerate = new TdHYGFInverterDayGenerate(); TdHYGFInverterDayGenerate tdHYGFInverterDayGenerate = new TdHYGFInverterDayGenerate();
tdHYGFInverterDayGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterDayGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterDayGenerate.setName(jpInverter.getName());
tdHYGFInverterDayGenerate.setThirdStationId(String.valueOf(jpInverter.getThirdStationId())); tdHYGFInverterDayGenerate.setThirdStationId(String.valueOf(jpInverter.getThirdStationId()));
tdHYGFInverterDayGenerate.setSnCode(jpInverter.getSnCode().trim()); tdHYGFInverterDayGenerate.setSnCode(jpInverter.getSnCode().trim());
tdHYGFInverterDayGenerate.setWorkStatus(jpInverter.getState()); tdHYGFInverterDayGenerate.setWorkStatus(jpInverter.getState());
...@@ -635,6 +637,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -635,6 +637,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
} }
tdHYGFInverterMonthGenerate.setThirdStationId(jpInverter.getThirdStationId()); tdHYGFInverterMonthGenerate.setThirdStationId(jpInverter.getThirdStationId());
tdHYGFInverterMonthGenerate.setSnCode(jpInverter.getSnCode().trim()); tdHYGFInverterMonthGenerate.setSnCode(jpInverter.getSnCode().trim());
tdHYGFInverterMonthGenerate.setName(jpInverter.getName());
tdHYGFInverterMonthGenerate.setDayTime(DateUtil.format(today1, "yyyy-MM-dd")); tdHYGFInverterMonthGenerate.setDayTime(DateUtil.format(today1, "yyyy-MM-dd"));
tdHYGFInverterMonthGenerate.setYearMonth(DateUtil.format(today1, "yyyy-MM")); tdHYGFInverterMonthGenerate.setYearMonth(DateUtil.format(today1, "yyyy-MM"));
tdHYGFInverterMonthGenerate.setGenerate(jpInverter.getDayPowerGeneration()); tdHYGFInverterMonthGenerate.setGenerate(jpInverter.getDayPowerGeneration());
...@@ -661,7 +664,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -661,7 +664,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
tdHYGFInverterYearGenerate.setYear(DateUtil.format(today1, "yyyy")); tdHYGFInverterYearGenerate.setYear(DateUtil.format(today1, "yyyy"));
tdHYGFInverterYearGenerate.setGenerate(jpInverter.getMonthPowerGeneration()); tdHYGFInverterYearGenerate.setGenerate(jpInverter.getMonthPowerGeneration());
tdHYGFInverterYearGenerate.setFullhour(jpInverter.getMonthPowerGeneration() / jpInverter.getCapacity()); tdHYGFInverterYearGenerate.setFullhour(jpInverter.getMonthPowerGeneration() / jpInverter.getCapacity());
tdHYGFInverterYearGenerate.setName(jpInverter.getName());
if (ObjectUtils.isEmpty(tdHYGFInverterYearGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFInverterYearGenerate.getCreatedTime())) {
tdHYGFInverterYearGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterYearGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterYearGenerateMapper.insert(tdHYGFInverterYearGenerate); tdHYGFInverterYearGenerateMapper.insert(tdHYGFInverterYearGenerate);
...@@ -678,6 +681,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -678,6 +681,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
tdHYGFInverterTotalGenerate = new TdHYGFInverterTotalGenerate(); tdHYGFInverterTotalGenerate = new TdHYGFInverterTotalGenerate();
} }
tdHYGFInverterTotalGenerate.setThirdStationId(jpInverter.getThirdStationId()); tdHYGFInverterTotalGenerate.setThirdStationId(jpInverter.getThirdStationId());
tdHYGFInverterTotalGenerate.setName(jpInverter.getName());
tdHYGFInverterTotalGenerate.setSnCode(jpInverter.getSnCode().trim()); tdHYGFInverterTotalGenerate.setSnCode(jpInverter.getSnCode().trim());
tdHYGFInverterTotalGenerate.setYearTime(DateUtil.format(today1, "yyyy")); tdHYGFInverterTotalGenerate.setYearTime(DateUtil.format(today1, "yyyy"));
tdHYGFInverterTotalGenerate.setYear(DateUtil.format(today1, "yyyy")); tdHYGFInverterTotalGenerate.setYear(DateUtil.format(today1, "yyyy"));
......
...@@ -604,7 +604,7 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -604,7 +604,7 @@ public class ImasterDataServiceImpl implements ImasterDataService {
jpInverter.setState(ImasterConstant.inverterStaus.get(String.valueOf(inverterDetailDto.getRun_state()))); jpInverter.setState(ImasterConstant.inverterStaus.get(String.valueOf(inverterDetailDto.getRun_state())));
jpInverter.setTotalPowerGeneration(inverterDetailDto.getTotal_cap()); jpInverter.setTotalPowerGeneration(inverterDetailDto.getTotal_cap());
jpInverter.setCurrentPower(inverterDetailDto.getActive_power()); jpInverter.setCurrentPower(inverterDetailDto.getActive_power());
jpInverter.setName(imasterInverterList.getDevName().trim());
Long currentTime = System.currentTimeMillis(); Long currentTime = System.currentTimeMillis();
Long monthStart = CalendarAdjust.getMonthStartTime(currentTime, "GMT+8:00"); Long monthStart = CalendarAdjust.getMonthStartTime(currentTime, "GMT+8:00");
......
...@@ -547,7 +547,6 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -547,7 +547,6 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
jpInverter.setCollectorId(ksolarStationCollectList.getCollectId().trim()); jpInverter.setCollectorId(ksolarStationCollectList.getCollectId().trim());
jpInverter.setCollectorSnCode(ksolarStationCollectList.getCollectId().trim()); jpInverter.setCollectorSnCode(ksolarStationCollectList.getCollectId().trim());
jpInverter.setUpdateTime(new Date()); jpInverter.setUpdateTime(new Date());
jpInverter.setCurrentPower(null); jpInverter.setCurrentPower(null);
jpInverter.setDayPowerGeneration(jpInverter.getDayPowerGeneration()); jpInverter.setDayPowerGeneration(jpInverter.getDayPowerGeneration());
jpInverter.setMonthPowerGeneration(jpInverter.getMonthPowerGeneration()); jpInverter.setMonthPowerGeneration(jpInverter.getMonthPowerGeneration());
...@@ -557,6 +556,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -557,6 +556,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
jpInverter.setVersion(jpInverter.getVersion()); jpInverter.setVersion(jpInverter.getVersion());
jpInverter.setThirdStationId(ksolarStationCollectList.getThirdStationId()); jpInverter.setThirdStationId(ksolarStationCollectList.getThirdStationId());
jpInverter.setThirdCode(PVProducerInfoEnum.KSOLAR.getCode()); jpInverter.setThirdCode(PVProducerInfoEnum.KSOLAR.getCode());
jpInverter.setName(ksolarStationCollectList.getCollectName());
jpInverter.setStationName(ksolarStationCollectList.getStationName()); jpInverter.setStationName(ksolarStationCollectList.getStationName());
jpInverter.setAddr(ksolarStationCollectList.getAddress()); jpInverter.setAddr(ksolarStationCollectList.getAddress());
jpInverter.setRecDate(new Date()); jpInverter.setRecDate(new Date());
...@@ -749,6 +749,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -749,6 +749,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
jpInverter.setVersion(ksolarStationCollectData.getVersion()); jpInverter.setVersion(ksolarStationCollectData.getVersion());
jpInverter.setThirdStationId(ksolarStationCollectList.getThirdStationId()); jpInverter.setThirdStationId(ksolarStationCollectList.getThirdStationId());
jpInverter.setThirdCode(PVProducerInfoEnum.KSOLAR.getCode()); jpInverter.setThirdCode(PVProducerInfoEnum.KSOLAR.getCode());
jpInverter.setName(ksolarStationCollectList.getCollectName());
jpInverter.setStationName(ksolarStationCollectList.getStationName()); jpInverter.setStationName(ksolarStationCollectList.getStationName());
jpInverter.setAddr(ksolarStationCollectList.getAddress()); jpInverter.setAddr(ksolarStationCollectList.getAddress());
if (!ObjectUtils.isEmpty(jpInverter.getSequenceNbr())) { if (!ObjectUtils.isEmpty(jpInverter.getSequenceNbr())) {
......
...@@ -112,9 +112,13 @@ public class JpInverterDto extends BaseDto { ...@@ -112,9 +112,13 @@ public class JpInverterDto extends BaseDto {
@ApiModelProperty(value = "所属电站名称") @ApiModelProperty(value = "所属电站名称")
private String name; private String name;
private String snName;
@ApiModelProperty(value = "筛选用 最小值") @ApiModelProperty(value = "筛选用 最小值")
private Double minValue; private Double minValue;
@ApiModelProperty(value = "筛选用 最大值") @ApiModelProperty(value = "筛选用 最大值")
private Double maxValue; private Double maxValue;
} }
...@@ -104,4 +104,6 @@ public class JpInverterDtoNew extends BaseDto { ...@@ -104,4 +104,6 @@ public class JpInverterDtoNew extends BaseDto {
@ApiModelProperty(value = "电站类型") @ApiModelProperty(value = "电站类型")
private String stationType; private String stationType;
private String snName;
} }
...@@ -172,4 +172,6 @@ public class JpInverter extends BaseEntity { ...@@ -172,4 +172,6 @@ public class JpInverter extends BaseEntity {
@TableField("addr") @TableField("addr")
private String addr; private String addr;
@TableField("sn_name")
private String snName;
} }
...@@ -183,5 +183,7 @@ public class TdHYGFInverterDayGenerate implements Serializable { ...@@ -183,5 +183,7 @@ public class TdHYGFInverterDayGenerate implements Serializable {
private Double income; private Double income;
@ExcelIgnore @ExcelIgnore
private Double fullhour; private Double fullhour;
@ExcelIgnore
private String name;
} }
...@@ -18,6 +18,8 @@ public class TdHYGFInverterMonthGenerate implements Serializable { ...@@ -18,6 +18,8 @@ public class TdHYGFInverterMonthGenerate implements Serializable {
*/ */
@ExcelIgnore @ExcelIgnore
private Long createdTime; private Long createdTime;
@ExcelIgnore
private String name;
/** /**
* 第三方场站id * 第三方场站id
*/ */
......
package com.yeejoin.amos.boot.module.hygf.api.entity; package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
...@@ -19,6 +20,8 @@ public class TdHYGFInverterTotalGenerate implements Serializable { ...@@ -19,6 +20,8 @@ public class TdHYGFInverterTotalGenerate implements Serializable {
* 第三方场站id * 第三方场站id
*/ */
private String thirdStationId; private String thirdStationId;
@ExcelIgnore
private String name;
/** /**
* sncode * sncode
*/ */
......
...@@ -18,6 +18,8 @@ public class TdHYGFInverterYearGenerate implements Serializable { ...@@ -18,6 +18,8 @@ public class TdHYGFInverterYearGenerate implements Serializable {
*/ */
@ExcelIgnore @ExcelIgnore
private Long createdTime; private Long createdTime;
@ExcelIgnore
private String name;
/** /**
* 第三方场站id * 第三方场站id
*/ */
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
hjc.third_code, hjc.third_code,
hjc.station_name, hjc.station_name,
hjc.addr, hjc.addr,
hjc.sn_name as snName,
sta.type as stationType, sta.type as stationType,
(select COMPANY_NAME from privilege_company where ORG_CODE = sta.regional_companies_code ) as companyName (select COMPANY_NAME from privilege_company where ORG_CODE = sta.regional_companies_code ) as companyName
from from
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="dateTime!=null"> <if test="dateTime!=null and dateTime != ''">
and day_time = #{dateTime} and day_time = #{dateTime}
</if> </if>
</where> </where>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="dateTime!=null"> <if test="dateTime!=null and dateTime != ''">
and month_time = #{dateTime} and month_time = #{dateTime}
</if> </if>
</where> </where>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="dateTime!=null"> <if test="dateTime!=null and dateTime != ''">
and year = #{dateTime} and year = #{dateTime}
</if> </if>
......
...@@ -439,7 +439,7 @@ public class JpInverterController extends BaseController { ...@@ -439,7 +439,7 @@ public class JpInverterController extends BaseController {
jpInverterDto.setZL(collect.get("直流")); jpInverterDto.setZL(collect.get("直流"));
jpInverterDto.setJL(collect.get("交流")); jpInverterDto.setJL(collect.get("交流"));
jpInverterDto.setSnName(jpInverter.getSnName());
jpInverterDto.setDirectCurrent(collect.get("直流")); jpInverterDto.setDirectCurrent(collect.get("直流"));
jpInverterDto.setInterflow(collect.get("交流")); jpInverterDto.setInterflow(collect.get("交流"));
......
...@@ -569,6 +569,39 @@ public class JpStationController extends BaseController { ...@@ -569,6 +569,39 @@ public class JpStationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "电站统计", notes = "电站统计")
@GetMapping(value = "/getcountJpStationNum")
public ResponseModel<List<Map<String,Object>>> getcountJpStationNum(JpStationDto reviewDto) {
List<Map<String,Object>> itemList =new ArrayList<>();
Map<String,Object> collector =new HashMap<>();
collector.put("在线",0);
collector.put("离线",0);
collector.put("报警",0);
List<Map<String,Object>> list= jpStationServiceImpl.getcountState(reviewDto);
if(list!=null&&!list.isEmpty()){
for (Map<String, Object> map : list) {
if(ZX.equals(map.get("state").toString())){
collector.put("正常",Integer.valueOf(map.get("num").toString()));
}else if(LX.equals(map.get("state").toString())){
collector.put("离线",Integer.valueOf(map.get("num").toString()));
}else if(BJ.equals(map.get("state").toString())){
collector.put("报警",Integer.valueOf(map.get("num").toString()));
}
}
}
for (String s : collector.keySet()) {
Map<String,Object> result = new HashMap<>();
result.put("name",s);
result.put("value",collector.get(s));
itemList.add(result);
}
return ResponseHelper.buildResponse(itemList);
}
......
...@@ -23,4 +23,5 @@ public class BizMessage { ...@@ -23,4 +23,5 @@ public class BizMessage {
*/ */
String dataSource; String dataSource;
private String traceId2; private String traceId2;
private String extAttr2;
} }
...@@ -167,4 +167,10 @@ public class PersonBasic extends BaseEntity { ...@@ -167,4 +167,10 @@ public class PersonBasic extends BaseEntity {
*/ */
@TableField("qrcode_date") @TableField("qrcode_date")
private Date qrcodeDate; private Date qrcodeDate;
/**
* 缺少/过期的证书
*/
@TableField("missing_certificate")
private String missingCertificate;
} }
...@@ -203,22 +203,52 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -203,22 +203,52 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
Integer isOver = 0; Integer isOver = 0;
CertificationInfo personCertificate = model.getPersonCertificate(); CertificationInfo personCertificate = model.getPersonCertificate();
// 过期的证书
List<String> overCertificateList = new ArrayList<>();
// 临期证书
List<String> inMonthCertificateList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(personCertificate.getCertificationInfo())) { if (CollectionUtils.isNotEmpty(personCertificate.getCertificationInfo())) {
for (PersonCertificate item : personCertificate.getCertificationInfo()) { for (PersonCertificate item : personCertificate.getCertificationInfo()) {
int validPeriod = StringUtils.isEmpty(item.getValidPeriod()) ? 3 : Integer.parseInt(item.getValidPeriod()); if (StringUtils.isNotEmpty(item.getValidPeriod()) && !Objects.isNull(item.getCertificateTime())) {
Date date = DateUtils.dateAddYears(item.getCertificateTime(), validPeriod); int validPeriod = StringUtils.isEmpty(item.getValidPeriod()) ? 3 : Integer.parseInt(item.getValidPeriod());
if (list.contains(item.getCertificateName()) && Date date = DateUtils.dateAddYears(item.getCertificateTime(), validPeriod);
DateUtils.dateCompare(date, new Date()) == -1) { if (list.contains(item.getCertificateName()) &&
isOver = 1; DateUtils.dateCompare(date, new Date()) == -1) {
} isOver = 1;
if (list.contains(item.getCertificateName()) && overCertificateList.add(item.getCertificateName());
DateUtils.dateBetweenIncludeToday(new Date(), date) < Integer.valueOf(certificatesMap.get(item.getCertificateName())) && }
DateUtils.dateCompare(date, new Date()) == 1) { if (list.contains(item.getCertificateName()) &&
isInMonth = 1; DateUtils.dateBetweenIncludeToday(new Date(), date) < Integer.valueOf(certificatesMap.get(item.getCertificateName())) &&
DateUtils.dateCompare(date, new Date()) == 1) {
isInMonth = 1;
inMonthCertificateList.add(item.getCertificateName());
}
} }
list.remove(item.getCertificateName()); list.remove(item.getCertificateName());
} }
} }
// 缺证
List<String> noCertificateList = new ArrayList<>(list);
List<String> strings = new ArrayList<>();
if (CollectionUtils.isNotEmpty(overCertificateList)) {
strings.add("过期证书:" + String.join("," , overCertificateList));
}
if (CollectionUtils.isNotEmpty(inMonthCertificateList)) {
strings.add("临期证书:" + String.join("," , inMonthCertificateList));
}
if (CollectionUtils.isNotEmpty(noCertificateList)) {
strings.add("缺少证书:" + String.join("," , noCertificateList));
}
String join = "";
if (CollectionUtils.isNotEmpty(strings)) {
join = "(" + String.join(";", strings) + ")";
}
List<String> missCerList = new ArrayList<>();
missCerList.addAll(noCertificateList);
missCerList.addAll(overCertificateList);
String missCerStrings = String.join(",", missCerList);
personBasic.setMissingCertificate(missCerStrings);
if (CollectionUtils.isEmpty(list) && isInMonth == 0 && isOver == 0) { if (CollectionUtils.isEmpty(list) && isInMonth == 0 && isOver == 0) {
personBasic.setQrcodeColor(QrcodeColorEnum.GREEN.getCode()); personBasic.setQrcodeColor(QrcodeColorEnum.GREEN.getCode());
personBasic.setQrcodeDesc("证书齐全"); personBasic.setQrcodeDesc("证书齐全");
...@@ -252,6 +282,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -252,6 +282,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
RiskBizInfoVo riskBizInfoVo = fetchData(personBasic, personAccount); RiskBizInfoVo riskBizInfoVo = fetchData(personBasic, personAccount);
bizMessage.setBizInfo(riskBizInfoVo); bizMessage.setBizInfo(riskBizInfoVo);
bizMessage.setTraceId(String.valueOf(personBasic.getSequenceNbr())); bizMessage.setTraceId(String.valueOf(personBasic.getSequenceNbr()));
bizMessage.setExtAttr2(join);
try { try {
emqKeeper.getMqttClient().publish(RYFM_DATA_MQTT_TOPIC, JSON.toJSONString(bizMessage).getBytes(StandardCharsets.UTF_8), 2, false); emqKeeper.getMqttClient().publish(RYFM_DATA_MQTT_TOPIC, JSON.toJSONString(bizMessage).getBytes(StandardCharsets.UTF_8), 2, false);
} catch (MqttException e) { } catch (MqttException e) {
...@@ -397,24 +428,56 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -397,24 +428,56 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
//人员资质信息 //人员资质信息
Integer isInMonth = 0; Integer isInMonth = 0;
Integer isOver = 0; Integer isOver = 0;
// 过期的证书
List<String> overCertificateList = new ArrayList<>();
// 临期证书
List<String> inMonthCertificateList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(personCertificate.getCertificationInfo())) { if (CollectionUtils.isNotEmpty(personCertificate.getCertificationInfo())) {
for (PersonCertificate item : personCertificate.getCertificationInfo()) { for (PersonCertificate item : personCertificate.getCertificationInfo()) {
int validPeriod = StringUtils.isEmpty(item.getValidPeriod()) ? 3 : Integer.parseInt(item.getValidPeriod()); if (StringUtils.isNotEmpty(item.getValidPeriod()) && !Objects.isNull(item.getCertificateTime())) {
Date date = DateUtils.dateAddYears(item.getCertificateTime(), validPeriod); int validPeriod = StringUtils.isEmpty(item.getValidPeriod()) ? 3 : Integer.parseInt(item.getValidPeriod());
if (list.contains(item.getCertificateName()) && Date date = DateUtils.dateAddYears(item.getCertificateTime(), validPeriod);
DateUtils.dateCompare(date, new Date()) == -1) { if (list.contains(item.getCertificateName()) &&
isOver = 1; DateUtils.dateCompare(date, new Date()) == -1) {
isOver = 1;
overCertificateList.add(item.getCertificateName());
}
if (list.contains(item.getCertificateName()) &&
DateUtils.dateBetweenIncludeToday(new Date(), date) < Integer.valueOf(certificatesMap.get(item.getCertificateName())) &&
DateUtils.dateCompare(date, new Date()) == 1) {
isInMonth = 1;
inMonthCertificateList.add(item.getCertificateName());
}
item.setPersonId(personBasic.getSequenceNbr());
personCertificateService.save(item);
} }
if (list.contains(item.getCertificateName()) &&
DateUtils.dateBetweenIncludeToday(new Date(), date) < Integer.valueOf(certificatesMap.get(item.getCertificateName())) &&
DateUtils.dateCompare(date, new Date()) == 1) {
isInMonth = 1;
}
item.setPersonId(personBasic.getSequenceNbr());
personCertificateService.save(item);
list.remove(item.getCertificateName()); list.remove(item.getCertificateName());
} }
} }
// 缺证
List<String> noCertificateList = new ArrayList<>(list);
List<String> strings = new ArrayList<>();
if (CollectionUtils.isNotEmpty(overCertificateList)) {
strings.add("过期证书:" + String.join("," , overCertificateList));
}
if (CollectionUtils.isNotEmpty(inMonthCertificateList)) {
strings.add("临期证书:" + String.join("," , inMonthCertificateList));
}
if (CollectionUtils.isNotEmpty(noCertificateList)) {
strings.add("缺少证书:" + String.join("," , noCertificateList));
}
String join = "";
if (CollectionUtils.isNotEmpty(strings)) {
join = "(" + String.join(";", strings) + ")";
}
List<String> missCerList = new ArrayList<>();
missCerList.addAll(noCertificateList);
missCerList.addAll(overCertificateList);
String missCerStrings = String.join(",", missCerList);
personBasic.setMissingCertificate(missCerStrings);
CompanyModel companyModel = new CompanyModel(); CompanyModel companyModel = new CompanyModel();
//单位 //单位
companyModel = this.getCompanyModel(personAccount.getProjectId()); companyModel = this.getCompanyModel(personAccount.getProjectId());
...@@ -508,6 +571,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -508,6 +571,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
RiskBizInfoVo riskBizInfoVo = fetchData(personBasic, personAccount); RiskBizInfoVo riskBizInfoVo = fetchData(personBasic, personAccount);
bizMessage.setBizInfo(riskBizInfoVo); bizMessage.setBizInfo(riskBizInfoVo);
bizMessage.setDataSource("人员赋码"); bizMessage.setDataSource("人员赋码");
bizMessage.setExtAttr2(join);
try { try {
emqKeeper.getMqttClient().publish(PersonBasicServiceImpl.RYFM_DATA_MQTT_TOPIC, JSON.toJSONString(bizMessage).getBytes(StandardCharsets.UTF_8), 2, false); emqKeeper.getMqttClient().publish(PersonBasicServiceImpl.RYFM_DATA_MQTT_TOPIC, JSON.toJSONString(bizMessage).getBytes(StandardCharsets.UTF_8), 2, false);
} catch (MqttException e) { } catch (MqttException e) {
......
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