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
@Override
public void customerInfoList() {
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"));
log.info("-------碳银同步项目信息开始: {} ------- ", sdf.format(new Date()));
Map<String, Object> params = MapBuilder.<String, Object>create()
......@@ -465,7 +465,12 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
if (jpInverter == null || StringUtils.isEmpty(jpInverter.getSnCode())) {
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"));
Map<String, Object> params = MapBuilder.<String, Object>create()
.put("sn", jpInverter.getSnCode())
......@@ -474,11 +479,19 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
.put("startDate", startDate)
.put("endDate", endDate).build();
PageInfo<TanYinAlramInfo> tanYinInveterInfo = tanYinApiUtils.postPage("电站逆变器故障信息", apiUrl + TanYinConstant.inverterAlramUrl, JSON.toJSONString(params), null, TanYinAlramInfo.class);
List<TanYinAlramInfo> tanYinAlramInfos = tanYinInveterInfo.getList();
if (CollectionUtils.isEmpty(tanYinAlramInfos)) {
if (tanYinInveterInfo == null || CollectionUtils.isEmpty(tanYinInveterInfo.getList())) {
log.warn("-------碳银同步电站逆变器故障信息结束: 未获取到逆变器故障信息 ------- ");
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) {
tanYinAlramInfo.setCreateTime(System.currentTimeMillis());
tanYinAlramInfoMapper.insert(tanYinAlramInfo);
......@@ -486,7 +499,9 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
HYGFJPInverterWarn hygfjpInverterWarn = hygfjpInverterWarnMapper
.selectOne(new QueryWrapper<HYGFJPInverterWarn>().eq("sn_code", tanYinAlramInfo.getSn())
.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)) {
hygfjpInverterWarn = new HYGFJPInverterWarn();
}
......@@ -500,7 +515,6 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
hygfjpInverterWarn.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpInverterWarn.setStationName(jpStation.getName());
hygfjpInverterWarn.setStationState(jpStation.getState());
hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis());
hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.TANYIN.getCode());
hygfjpInverterWarn.setContent(tanYinAlramInfo.getContent());
hygfjpInverterWarn.setTreatment(tanYinAlramInfo.getSolution());
......
......@@ -73,7 +73,7 @@
count( 1 ) as value
FROM
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>
<if test="parentCode != null and parentCode != ''">
b.ORG_CODE like concat(#{parentCode},'%')
......@@ -89,7 +89,7 @@
count(1) as value
FROM
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>
<if test="parentCode != null and parentCode != ''">
b.ORG_CODE like concat(#{parentCode},'%')
......@@ -110,7 +110,7 @@
else 3 end) as sort
FROM
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>
<if test="parentCode != null and parentCode != ''">
AND b.ORG_CODE like concat(#{parentCode},'%')
......@@ -122,9 +122,9 @@
AND a.QRCODE_COLOR = #{qrCodeColor}
</if>
<if test="ne != null and ne != ''">
AND a.QRCODE_COLOR != #{ne}
</if>
</where>
AND a.QRCODE_COLOR != #{ne}
ORDER BY sort asc, a.UPDATE_STAMP DESC
limit #{current},#{size}
</select>
......@@ -134,7 +134,7 @@
count(1)
FROM
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>
<if test="parentCode != null and parentCode != ''">
AND b.ORG_CODE like concat(#{parentCode},'%')
......@@ -165,7 +165,7 @@
else 3 end as sort
FROM
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
<where>
<if test="parentCode != null and parentCode != ''">
......@@ -190,7 +190,7 @@
count(1)
FROM
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>
<if test="parentCode != null and 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