Commit 57583781 authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://36.40.66.175:5000/moa/amos-boot-biz into developer

parents 5f93fb15 8ec4cb71
......@@ -2,6 +2,9 @@ package com.yeejoin.amos.api.householdapi.face.orm.mapper.hygf;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpInverter;
import org.apache.ibatis.annotations.Select;
public interface JpInverterMapper extends BaseMapper<JpInverter> {
@Select("SELECT sum(current_power) FROM hygf_jp_inverter WHERE third_code='HW'")
Double getHuaWeiStationCurrentPower();
}
......@@ -269,6 +269,9 @@ public class ImasterDataServiceImpl implements ImasterDataService {
for (ImasterInverterListDetails imasterInverterListDetails : result4) {
active_power = active_power + (imasterInverterListDetails.getActive_power() != null ? imasterInverterListDetails.getActive_power() : 0.0);
}
if(active_power<= 0){
active_power = jpInverterMapper.getHuaWeiStationCurrentPower();
}
jpStation.setRealTimePower(active_power);
jpStation.setAccumulatedPower(imasterStationDetail.getTotal_power());
......
......@@ -286,9 +286,17 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
StdUserEmpower stdUserEmpower= userEmpowerMapper.selectOne(uo);
lisk.add(publicAgencyUser.getAmosOrgCode());
lisk.add(re.getRegionalCompaniesCode());
stdUserEmpower.setAmosUserId(publicAgencyUser.getAmosUserId());
stdUserEmpower.setAmosOrgCode(lisk);
userEmpowerMapper.updateById(stdUserEmpower);
if(stdUserEmpower!=null){
stdUserEmpower.setAmosUserId(publicAgencyUser.getAmosUserId());
stdUserEmpower.setAmosOrgCode(lisk);
userEmpowerMapper.updateById(stdUserEmpower);
}else{
stdUserEmpower=new StdUserEmpower();
stdUserEmpower.setAmosUserId(publicAgencyUser.getAmosUserId());
stdUserEmpower.setAmosOrgCode(lisk);
userEmpowerMapper.insert(stdUserEmpower);
}
......@@ -362,14 +370,38 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
uo.eq(StdUserEmpower::getAmosUserId,publicAgencyUsex.getAmosUserId());
StdUserEmpower stdUserEmpower= userEmpowerMapper.selectOne(uo);
li=stdUserEmpower.getAmosOrgCode();
stdUserEmpower.setAmosOrgCode(null);
userEmpowerMapper.updateById(stdUserEmpower);
if(stdUserEmpower!=null){
stdUserEmpower.setAmosOrgCode(null);
userEmpowerMapper.updateById(stdUserEmpower);
}else{
stdUserEmpower=new StdUserEmpower();
stdUserEmpower.setAmosOrgCode(null);
userEmpowerMapper.insert(stdUserEmpower);
}
//新管理员新增
LambdaQueryWrapper<StdUserEmpower> uo1=new LambdaQueryWrapper();
uo1.eq(StdUserEmpower::getAmosUserId,publicAgencyUse.getAmosUserId());
StdUserEmpower stdUserEmpower1= userEmpowerMapper.selectOne(uo1);
stdUserEmpower1.setAmosOrgCode(li);
userEmpowerMapper.updateById(stdUserEmpower1);
if(stdUserEmpower1!=null){
stdUserEmpower1.setAmosOrgCode(li);
userEmpowerMapper.updateById(stdUserEmpower1);
}else{
stdUserEmpower1=new StdUserEmpower();
stdUserEmpower1.setAmosOrgCode(li);
userEmpowerMapper.insert(stdUserEmpower1);
}
UserMessage userMessage= new UserMessage( TaskTypeStationEnum.设置管理员.getCode(), personnelBusines.getSequenceNbr() , publicAgencyUse.getAmosUserId(), new Date(), "您已成为单位管理员。", personnelBusines.getAmosUnitOrgCode());
......
......@@ -396,18 +396,24 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
try {
Map<String, Object> flowLoggerMap = workflowFeignClient.getFlowLogger(processInstanceId).getResult();
List<LinkedHashMap> flowLogger = (List<LinkedHashMap>) flowLoggerMap.get("flowLogger");
flowLogger = flowLogger.stream().map(i -> {
i.put("approvalStatue",i.get("approvalStatue").toString().equals("0")?"通过":"驳回");
//审核意见
List<LinkedHashMap> approvalSuggestion = (List<LinkedHashMap>)i.get("approvalSuggestion");
if(approvalSuggestion!=null&&!approvalSuggestion.isEmpty()){
i.put("approvalSuggestion",approvalSuggestion.get(0).get("message"));
List<LinkedHashMap> flowLoggernew =new ArrayList<>();
for (LinkedHashMap linkedHashMap : flowLogger) {
if(linkedHashMap.get("operateDate")!=null&&!linkedHashMap.get("operateDate").toString().isEmpty()){
LinkedHashMap linke=new LinkedHashMap();
linke.put("approvalStatue",linkedHashMap.get("approvalStatue").toString().equals("0")?"通过":"驳回");
//审核意见
List<LinkedHashMap> approvalSuggestion = (List<LinkedHashMap>)linkedHashMap.get("approvalSuggestion");
if(approvalSuggestion!=null&&!approvalSuggestion.isEmpty()){
linke.put("approvalSuggestion",approvalSuggestion.get(0).get("message"));
}
linke.put("taskName",linkedHashMap.get("taskName").toString());
linke.put("operator",linkedHashMap.get("operator").toString());
linke.put("operateDate",linkedHashMap.get("operateDate").toString());
flowLoggernew.add(linke);
}
}
return i;
}).collect(Collectors.toList());
LoggerDto loggerDto =new LoggerDto();
loggerDto.setLogger(flowLogger);
loggerDto.setLogger(flowLoggernew);
surveyInfoAllDto.setOrderTracking(loggerDto);
} catch (Exception e){
e.printStackTrace();
......
......@@ -760,9 +760,17 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
uo.eq(StdUserEmpower::getAmosUserId,unitInfo.getAdminUserId());
StdUserEmpower stdUserEmpower= userEmpowerMapper.selectOne(uo);
lisk.add(unitInfo.getAmosCompanyCode());
stdUserEmpower.setAmosUserId(unitInfo.getAdminUserId());
stdUserEmpower.setAmosOrgCode(lisk);
userEmpowerMapper.updateById(stdUserEmpower);
if(stdUserEmpower!=null){
stdUserEmpower.setAmosUserId(unitInfo.getAdminUserId());
stdUserEmpower.setAmosOrgCode(lisk);
userEmpowerMapper.updateById(stdUserEmpower);
}else{
stdUserEmpower=new StdUserEmpower();
stdUserEmpower.setAmosUserId(unitInfo.getAdminUserId());
stdUserEmpower.setAmosOrgCode(lisk);
userEmpowerMapper.insert(stdUserEmpower);
}
return true;
}
......
......@@ -23,4 +23,5 @@ public class BizMessage {
*/
String dataSource;
private String traceId2;
private String extAttr2;
}
......@@ -203,22 +203,48 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
Integer isOver = 0;
CertificationInfo personCertificate = model.getPersonCertificate();
// 过期的证书
List<String> overCertificateList = new ArrayList<>();
// 临期证书
List<String> inMonthCertificateList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(personCertificate.getCertificationInfo())) {
for (PersonCertificate item : personCertificate.getCertificationInfo()) {
int validPeriod = StringUtils.isEmpty(item.getValidPeriod()) ? 3 : Integer.parseInt(item.getValidPeriod());
Date date = DateUtils.dateAddYears(item.getCertificateTime(), validPeriod);
if (list.contains(item.getCertificateName()) &&
DateUtils.dateCompare(date, new Date()) == -1) {
isOver = 1;
}
if (list.contains(item.getCertificateName()) &&
DateUtils.dateBetweenIncludeToday(new Date(), date) < Integer.valueOf(certificatesMap.get(item.getCertificateName())) &&
DateUtils.dateCompare(date, new Date()) == 1) {
isInMonth = 1;
if (StringUtils.isNotEmpty(item.getValidPeriod()) && !Objects.isNull(item.getCertificateTime())) {
int validPeriod = StringUtils.isEmpty(item.getValidPeriod()) ? 3 : Integer.parseInt(item.getValidPeriod());
Date date = DateUtils.dateAddYears(item.getCertificateTime(), validPeriod);
if (list.contains(item.getCertificateName()) &&
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());
}
}
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) + ")";
}
if (CollectionUtils.isEmpty(list) && isInMonth == 0 && isOver == 0) {
personBasic.setQrcodeColor(QrcodeColorEnum.GREEN.getCode());
personBasic.setQrcodeDesc("证书齐全");
......@@ -252,6 +278,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
RiskBizInfoVo riskBizInfoVo = fetchData(personBasic, personAccount);
bizMessage.setBizInfo(riskBizInfoVo);
bizMessage.setTraceId(String.valueOf(personBasic.getSequenceNbr()));
bizMessage.setExtAttr2(join);
try {
emqKeeper.getMqttClient().publish(RYFM_DATA_MQTT_TOPIC, JSON.toJSONString(bizMessage).getBytes(StandardCharsets.UTF_8), 2, false);
} catch (MqttException e) {
......@@ -397,24 +424,51 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
//人员资质信息
Integer isInMonth = 0;
Integer isOver = 0;
// 过期的证书
List<String> overCertificateList = new ArrayList<>();
// 临期证书
List<String> inMonthCertificateList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(personCertificate.getCertificationInfo())) {
for (PersonCertificate item : personCertificate.getCertificationInfo()) {
int validPeriod = StringUtils.isEmpty(item.getValidPeriod()) ? 3 : Integer.parseInt(item.getValidPeriod());
Date date = DateUtils.dateAddYears(item.getCertificateTime(), validPeriod);
if (list.contains(item.getCertificateName()) &&
DateUtils.dateCompare(date, new Date()) == -1) {
isOver = 1;
if (StringUtils.isNotEmpty(item.getValidPeriod()) && !Objects.isNull(item.getCertificateTime())) {
int validPeriod = StringUtils.isEmpty(item.getValidPeriod()) ? 3 : Integer.parseInt(item.getValidPeriod());
Date date = DateUtils.dateAddYears(item.getCertificateTime(), validPeriod);
if (list.contains(item.getCertificateName()) &&
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<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) + ")";
}
CompanyModel companyModel = new CompanyModel();
//单位
companyModel = this.getCompanyModel(personAccount.getProjectId());
......@@ -508,6 +562,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
RiskBizInfoVo riskBizInfoVo = fetchData(personBasic, personAccount);
bizMessage.setBizInfo(riskBizInfoVo);
bizMessage.setDataSource("人员赋码");
bizMessage.setExtAttr2(join);
try {
emqKeeper.getMqttClient().publish(PersonBasicServiceImpl.RYFM_DATA_MQTT_TOPIC, JSON.toJSONString(bizMessage).getBytes(StandardCharsets.UTF_8), 2, false);
} 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