Commit acca8a3e authored by lilongyang's avatar lilongyang

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

parents e778e8b3 3a296cd3
...@@ -178,7 +178,7 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe ...@@ -178,7 +178,7 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
@Override @Override
public void customerInfoList() { public void customerInfoList() {
try { try {
String startDate = LocalDate.now().minusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String startDate = LocalDate.now().minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
String endDate = LocalDate.now().plusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String endDate = LocalDate.now().plusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
log.info("-------碳银同步项目信息开始: {} ------- ", sdf.format(new Date())); log.info("-------碳银同步项目信息开始: {} ------- ", sdf.format(new Date()));
Map<String, Object> params = MapBuilder.<String, Object>create() Map<String, Object> params = MapBuilder.<String, Object>create()
...@@ -465,7 +465,12 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe ...@@ -465,7 +465,12 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
if (jpInverter == null || StringUtils.isEmpty(jpInverter.getSnCode())) { if (jpInverter == null || StringUtils.isEmpty(jpInverter.getSnCode())) {
return; return;
} }
String startDate = LocalDate.now().minusWeeks(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String startDate;
if (jpInverter.getUpdateTime() != null) {
startDate = new SimpleDateFormat("yyyy-MM-dd").format(jpInverter.getUpdateTime());
} else {
startDate = LocalDate.now().minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
}
String endDate = LocalDate.now().plusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String endDate = LocalDate.now().plusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
Map<String, Object> params = MapBuilder.<String, Object>create() Map<String, Object> params = MapBuilder.<String, Object>create()
.put("sn", jpInverter.getSnCode()) .put("sn", jpInverter.getSnCode())
...@@ -474,11 +479,19 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe ...@@ -474,11 +479,19 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
.put("startDate", startDate) .put("startDate", startDate)
.put("endDate", endDate).build(); .put("endDate", endDate).build();
PageInfo<TanYinAlramInfo> tanYinInveterInfo = tanYinApiUtils.postPage("电站逆变器故障信息", apiUrl + TanYinConstant.inverterAlramUrl, JSON.toJSONString(params), null, TanYinAlramInfo.class); PageInfo<TanYinAlramInfo> tanYinInveterInfo = tanYinApiUtils.postPage("电站逆变器故障信息", apiUrl + TanYinConstant.inverterAlramUrl, JSON.toJSONString(params), null, TanYinAlramInfo.class);
List<TanYinAlramInfo> tanYinAlramInfos = tanYinInveterInfo.getList(); if (tanYinInveterInfo == null || CollectionUtils.isEmpty(tanYinInveterInfo.getList())) {
if (CollectionUtils.isEmpty(tanYinAlramInfos)) {
log.warn("-------碳银同步电站逆变器故障信息结束: 未获取到逆变器故障信息 ------- "); log.warn("-------碳银同步电站逆变器故障信息结束: 未获取到逆变器故障信息 ------- ");
return; return;
} }
List<TanYinAlramInfo> tanYinAlramInfos = new ArrayList<>();
tanYinAlramInfos.addAll(tanYinInveterInfo.getList());
if (tanYinInveterInfo.getPages() > 1) {
for (int pageNum = 2; pageNum < tanYinInveterInfo.getPages(); pageNum++) {
params.put("pageNo", pageNum);
PageInfo<TanYinAlramInfo> tanYinInveterInfoPage = tanYinApiUtils.postPage("电站逆变器故障信息", apiUrl + TanYinConstant.inverterAlramUrl, JSON.toJSONString(params), null, TanYinAlramInfo.class);
tanYinAlramInfos.addAll(tanYinInveterInfoPage.getList());
}
}
for (TanYinAlramInfo tanYinAlramInfo : tanYinAlramInfos) { for (TanYinAlramInfo tanYinAlramInfo : tanYinAlramInfos) {
tanYinAlramInfo.setCreateTime(System.currentTimeMillis()); tanYinAlramInfo.setCreateTime(System.currentTimeMillis());
tanYinAlramInfoMapper.insert(tanYinAlramInfo); tanYinAlramInfoMapper.insert(tanYinAlramInfo);
...@@ -486,7 +499,9 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe ...@@ -486,7 +499,9 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
HYGFJPInverterWarn hygfjpInverterWarn = hygfjpInverterWarnMapper HYGFJPInverterWarn hygfjpInverterWarn = hygfjpInverterWarnMapper
.selectOne(new QueryWrapper<HYGFJPInverterWarn>().eq("sn_code", tanYinAlramInfo.getSn()) .selectOne(new QueryWrapper<HYGFJPInverterWarn>().eq("sn_code", tanYinAlramInfo.getSn())
.eq("warn_id", tanYinAlramInfo.getId()) .eq("warn_id", tanYinAlramInfo.getId())
.eq("third_station_id", String.valueOf(tanYinAlramInfo.getProjectNo()))); .eq("third_station_id", String.valueOf(tanYinAlramInfo.getProjectNo()))
.orderByDesc("created_time").last("limit 1")
);
if (com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isEmpty(hygfjpInverterWarn)) { if (com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isEmpty(hygfjpInverterWarn)) {
hygfjpInverterWarn = new HYGFJPInverterWarn(); hygfjpInverterWarn = new HYGFJPInverterWarn();
} }
...@@ -500,7 +515,6 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe ...@@ -500,7 +515,6 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
hygfjpInverterWarn.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode()); hygfjpInverterWarn.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpInverterWarn.setStationName(jpStation.getName()); hygfjpInverterWarn.setStationName(jpStation.getName());
hygfjpInverterWarn.setStationState(jpStation.getState()); hygfjpInverterWarn.setStationState(jpStation.getState());
hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis());
hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.TANYIN.getCode()); hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.TANYIN.getCode());
hygfjpInverterWarn.setContent(tanYinAlramInfo.getContent()); hygfjpInverterWarn.setContent(tanYinAlramInfo.getContent());
hygfjpInverterWarn.setTreatment(tanYinAlramInfo.getSolution()); hygfjpInverterWarn.setTreatment(tanYinAlramInfo.getSolution());
...@@ -515,7 +529,7 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe ...@@ -515,7 +529,7 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
} }
hygfjpInverterWarn.setTimeLong(null); hygfjpInverterWarn.setTimeLong(null);
if ((!ObjectUtils.isEmpty(tanYinAlramInfo.getFaultOccurTime())) && (!ObjectUtils.isEmpty(tanYinAlramInfo.getFaultEndTime()))) { if ((!ObjectUtils.isEmpty(tanYinAlramInfo.getFaultOccurTime())) && (!ObjectUtils.isEmpty(tanYinAlramInfo.getFaultEndTime()))) {
hygfjpInverterWarn.setTimeLong(this.convertDate(hygfjpInverterWarn.getRecoverTime()) - this.convertDate(hygfjpInverterWarn.getStartTime())); hygfjpInverterWarn.setTimeLong(this.convertDate(hygfjpInverterWarn.getRecoverTime()) - this.convertDate(hygfjpInverterWarn.getStartTime()));
} }
if (ObjectUtils.isEmpty(hygfjpInverterWarn.getCreatedTime())) { if (ObjectUtils.isEmpty(hygfjpInverterWarn.getCreatedTime())) {
hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis()); hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis());
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
count( 1 ) as value count( 1 ) as value
FROM FROM
sjgl_zsj_zsbtz a sjgl_zsj_zsbtz a
INNER JOIN privilege_company b on a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' LEFT JOIN privilege_company b on a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
<where> <where>
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
b.ORG_CODE like concat(#{parentCode},'%') b.ORG_CODE like concat(#{parentCode},'%')
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
count(1) as value count(1) as value
FROM FROM
fdgl_job_main a fdgl_job_main a
INNER JOIN privilege_company b on a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' LEFT JOIN privilege_company b on a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
<where> <where>
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
b.ORG_CODE like concat(#{parentCode},'%') b.ORG_CODE like concat(#{parentCode},'%')
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
else 3 end) as sort else 3 end) as sort
FROM FROM
sjgl_zsj_zsbtz a sjgl_zsj_zsbtz a
INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
<where> <where>
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
AND b.ORG_CODE like concat(#{parentCode},'%') AND b.ORG_CODE like concat(#{parentCode},'%')
...@@ -122,9 +122,9 @@ ...@@ -122,9 +122,9 @@
AND a.QRCODE_COLOR = #{qrCodeColor} AND a.QRCODE_COLOR = #{qrCodeColor}
</if> </if>
<if test="ne != null and ne != ''"> <if test="ne != null and ne != ''">
AND a.QRCODE_COLOR != #{ne}
</if> </if>
</where> </where>
AND a.QRCODE_COLOR != #{ne}
ORDER BY sort asc, a.UPDATE_STAMP DESC ORDER BY sort asc, a.UPDATE_STAMP DESC
limit #{current},#{size} limit #{current},#{size}
</select> </select>
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
count(1) count(1)
FROM FROM
sjgl_zsj_zsbtz a sjgl_zsj_zsbtz a
INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
<where> <where>
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
AND b.ORG_CODE like concat(#{parentCode},'%') AND b.ORG_CODE like concat(#{parentCode},'%')
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
else 3 end as sort else 3 end as sort
FROM FROM
fdgl_job_main a fdgl_job_main a
INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
left join sjgl_zsj_zsbtz c on a.EQUIP_DBID = c.DBID left join sjgl_zsj_zsbtz c on a.EQUIP_DBID = c.DBID
<where> <where>
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
count(1) count(1)
FROM FROM
fdgl_job_main a fdgl_job_main a
INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
<where> <where>
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
AND b.ORG_CODE like concat(#{parentCode},'%') AND b.ORG_CODE like concat(#{parentCode},'%')
......
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