1.添加pms暂态算法季表
2.添加pms暂态算法年表
This commit is contained in:
@@ -39,6 +39,9 @@ public class MeasurementExecutor extends BaseExecutor {
|
|||||||
private final RMpMonitorEvaluateDService rMpMonitorEvaluateDService;
|
private final RMpMonitorEvaluateDService rMpMonitorEvaluateDService;
|
||||||
private final RMpEventDetailService rMpEventDetailService;
|
private final RMpEventDetailService rMpEventDetailService;
|
||||||
private final RMpEventDetailDService rMpEventDetailDService;
|
private final RMpEventDetailDService rMpEventDetailDService;
|
||||||
|
private final RMpEventDetailQService rMpEventDetailQService;
|
||||||
|
|
||||||
|
private final RMpEventDetailYService rMpEventDetailYService;
|
||||||
private final DayDataService dayDataService;
|
private final DayDataService dayDataService;
|
||||||
private final RStatAbnormalDService rStatAbnormalDService;
|
private final RStatAbnormalDService rStatAbnormalDService;
|
||||||
private final ROperatingMonitorService rOperatingMonitorService;
|
private final ROperatingMonitorService rOperatingMonitorService;
|
||||||
@@ -105,6 +108,18 @@ public class MeasurementExecutor extends BaseExecutor {
|
|||||||
//月表
|
//月表
|
||||||
rMpEventDetailDService.handleMonth(calculatedParam);
|
rMpEventDetailDService.handleMonth(calculatedParam);
|
||||||
}
|
}
|
||||||
|
} else if (tag.equalsIgnoreCase("r_mp_event_detail_q")) {
|
||||||
|
//数据补招不执行非日表算法
|
||||||
|
if (!calculatedParam.isRepair()) {
|
||||||
|
//季表
|
||||||
|
rMpEventDetailQService.handleQuarter(calculatedParam);
|
||||||
|
}
|
||||||
|
} else if (tag.equalsIgnoreCase("r_mp_event_detail_y")) {
|
||||||
|
//数据补招不执行非日表算法
|
||||||
|
if (!calculatedParam.isRepair()) {
|
||||||
|
//年表
|
||||||
|
rMpEventDetailYService.handleYear(calculatedParam);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
package com.njcn.prepare.harmonic.mapper.mysql.line;
|
package com.njcn.prepare.harmonic.mapper.mysql.line;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||||
|
import com.njcn.harmonic.pojo.po.RMpEventDetailMPO;
|
||||||
import com.njcn.harmonic.pojo.po.RMpEventDetailQPO;
|
import com.njcn.harmonic.pojo.po.RMpEventDetailQPO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,4 +20,10 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface RMpEventDetailQMapper extends MppBaseMapper<RMpEventDetailQPO> {
|
public interface RMpEventDetailQMapper extends MppBaseMapper<RMpEventDetailQPO> {
|
||||||
|
|
||||||
|
|
||||||
|
List<RMpEventDetailQPO> handleQuarter(@Param("lineIds") List<String> lineIds, @Param("dataDate") String dataDate, @Param("beginQuarter") DateTime beginQuarter, @Param("endQuarter") DateTime endQuarter);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,13 @@
|
|||||||
package com.njcn.prepare.harmonic.mapper.mysql.line;
|
package com.njcn.prepare.harmonic.mapper.mysql.line;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||||
|
import com.njcn.harmonic.pojo.po.RMpEventDetailQPO;
|
||||||
import com.njcn.harmonic.pojo.po.RMpEventDetailYPO;
|
import com.njcn.harmonic.pojo.po.RMpEventDetailYPO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,4 +20,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface RMpEventDetailYMapper extends MppBaseMapper<RMpEventDetailYPO> {
|
public interface RMpEventDetailYMapper extends MppBaseMapper<RMpEventDetailYPO> {
|
||||||
|
|
||||||
|
List<RMpEventDetailYPO> handleYear(@Param("lineIds") List<String> lineIds, @Param("dataDate") String dataDate, @Param("beginYear") DateTime beginYear, @Param("endYear") DateTime endYear);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -14,4 +14,28 @@
|
|||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
measurement_point_id, data_date, swell_times, sag_times, interrupt_times
|
measurement_point_id, data_date, swell_times, sag_times, interrupt_times
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="handleQuarter" resultType="com.njcn.harmonic.pojo.po.RMpEventDetailQPO">
|
||||||
|
SELECT
|
||||||
|
#{dataDate} dataDate,
|
||||||
|
measurement_point_id measurement_point_id,
|
||||||
|
sum(sag_times) AS sagTimes,
|
||||||
|
sum(swell_times) AS swellTimes,
|
||||||
|
sum(interrupt_times) AS interruptTimes
|
||||||
|
FROM
|
||||||
|
r_mp_event_detail_m r_mp_event_detail_m
|
||||||
|
where
|
||||||
|
r_mp_event_detail_m.data_date between #{beginQuarter} and #{endQuarter}
|
||||||
|
AND
|
||||||
|
r_mp_event_detail_m.measurement_point_id IN
|
||||||
|
<foreach collection="lineIds" item="lineId" separator="," open="(" close=")">
|
||||||
|
#{lineId}
|
||||||
|
</foreach>
|
||||||
|
GROUP BY
|
||||||
|
measurement_point_id
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -14,4 +14,26 @@
|
|||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
measurement_point_id, data_date, swell_times, sag_times, interrupt_times
|
measurement_point_id, data_date, swell_times, sag_times, interrupt_times
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="handleYear" resultType="com.njcn.harmonic.pojo.po.RMpEventDetailYPO">
|
||||||
|
SELECT
|
||||||
|
#{beginYear} dataDate,
|
||||||
|
measurement_point_id measurement_point_id,
|
||||||
|
sum(sag_times) AS sagTimes,
|
||||||
|
sum(swell_times) AS swellTimes,
|
||||||
|
sum(interrupt_times) AS interruptTimes
|
||||||
|
FROM
|
||||||
|
r_mp_event_detail_q r_mp_event_detail_q
|
||||||
|
where
|
||||||
|
r_mp_event_detail_q.data_date between #{beginYear} and #{endYear}
|
||||||
|
AND
|
||||||
|
r_mp_event_detail_q.measurement_point_id IN
|
||||||
|
<foreach collection="lineIds" item="lineId" separator="," open="(" close=")">
|
||||||
|
#{lineId}
|
||||||
|
</foreach>
|
||||||
|
GROUP BY
|
||||||
|
measurement_point_id
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,10 +1,20 @@
|
|||||||
package com.njcn.prepare.harmonic.service.mysql.Impl.line;
|
package com.njcn.prepare.harmonic.service.mysql.Impl.line;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
|
import com.njcn.harmonic.pojo.po.RMpEventDetailMPO;
|
||||||
import com.njcn.harmonic.pojo.po.RMpEventDetailQPO;
|
import com.njcn.harmonic.pojo.po.RMpEventDetailQPO;
|
||||||
import com.njcn.prepare.harmonic.mapper.mysql.line.RMpEventDetailQMapper;
|
import com.njcn.prepare.harmonic.mapper.mysql.line.RMpEventDetailQMapper;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam;
|
||||||
import com.njcn.prepare.harmonic.service.mysql.line.RMpEventDetailQService;
|
import com.njcn.prepare.harmonic.service.mysql.line.RMpEventDetailQService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.collections4.ListUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -15,6 +25,22 @@ import org.springframework.stereotype.Service;
|
|||||||
* @version V1.0.0
|
* @version V1.0.0
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class RMpEventDetailQServiceImpl extends MppServiceImpl<RMpEventDetailQMapper, RMpEventDetailQPO> implements RMpEventDetailQService{
|
public class RMpEventDetailQServiceImpl extends MppServiceImpl<RMpEventDetailQMapper, RMpEventDetailQPO> implements RMpEventDetailQService{
|
||||||
|
|
||||||
|
|
||||||
|
private final RMpEventDetailQMapper rMpEventDetailQMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleQuarter(CalculatedParam calculatedParam) {
|
||||||
|
List<String> lineIds = calculatedParam.getIdList();
|
||||||
|
//以尺寸1000分片
|
||||||
|
List<List<String>> pendingIds = ListUtils.partition(lineIds, 1000);
|
||||||
|
DateTime beginQuarter = DateUtil.beginOfQuarter(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
||||||
|
DateTime endQuarter = DateUtil.endOfQuarter(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
||||||
|
for (List<String> pendingId : pendingIds) {
|
||||||
|
List<RMpEventDetailQPO> rMpEventDetailQPOList = rMpEventDetailQMapper.handleQuarter(pendingId, DateUtil.format(beginQuarter, DatePattern.NORM_DATE_PATTERN), beginQuarter, endQuarter);
|
||||||
|
this.saveOrUpdateBatchByMultiId(rMpEventDetailQPOList);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,21 @@
|
|||||||
package com.njcn.prepare.harmonic.service.mysql.Impl.line;
|
package com.njcn.prepare.harmonic.service.mysql.Impl.line;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
|
import com.njcn.harmonic.pojo.po.RMpEventDetailQPO;
|
||||||
import com.njcn.harmonic.pojo.po.RMpEventDetailYPO;
|
import com.njcn.harmonic.pojo.po.RMpEventDetailYPO;
|
||||||
|
import com.njcn.prepare.harmonic.mapper.mysql.line.RMpEventDetailQMapper;
|
||||||
import com.njcn.prepare.harmonic.mapper.mysql.line.RMpEventDetailYMapper;
|
import com.njcn.prepare.harmonic.mapper.mysql.line.RMpEventDetailYMapper;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam;
|
||||||
import com.njcn.prepare.harmonic.service.mysql.line.RMpEventDetailYService;
|
import com.njcn.prepare.harmonic.service.mysql.line.RMpEventDetailYService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.collections4.ListUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -15,6 +26,22 @@ import org.springframework.stereotype.Service;
|
|||||||
* @version V1.0.0
|
* @version V1.0.0
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class RMpEventDetailYServiceImpl extends MppServiceImpl<RMpEventDetailYMapper, RMpEventDetailYPO> implements RMpEventDetailYService{
|
public class RMpEventDetailYServiceImpl extends MppServiceImpl<RMpEventDetailYMapper, RMpEventDetailYPO> implements RMpEventDetailYService{
|
||||||
|
|
||||||
|
private final RMpEventDetailYMapper rMpEventDetailYMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleYear(CalculatedParam calculatedParam) {
|
||||||
|
List<String> lineIds = calculatedParam.getIdList();
|
||||||
|
//以尺寸1000分片
|
||||||
|
List<List<String>> pendingIds = ListUtils.partition(lineIds, 1000);
|
||||||
|
DateTime beginYear = DateUtil.beginOfYear(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
||||||
|
DateTime endYear = DateUtil.endOfYear(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
||||||
|
for (List<String> pendingId : pendingIds) {
|
||||||
|
List<RMpEventDetailYPO> rMpEventDetailYPOList = rMpEventDetailYMapper.handleYear(pendingId, DateUtil.format(beginYear, DatePattern.NORM_DATE_PATTERN), beginYear, endYear);
|
||||||
|
this.saveOrUpdateBatchByMultiId(rMpEventDetailYPOList);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.njcn.prepare.harmonic.service.mysql.line;
|
|||||||
|
|
||||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||||
import com.njcn.harmonic.pojo.po.RMpEventDetailQPO;
|
import com.njcn.harmonic.pojo.po.RMpEventDetailQPO;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,4 +16,7 @@ import com.njcn.harmonic.pojo.po.RMpEventDetailQPO;
|
|||||||
public interface RMpEventDetailQService extends IMppService<RMpEventDetailQPO> {
|
public interface RMpEventDetailQService extends IMppService<RMpEventDetailQPO> {
|
||||||
|
|
||||||
|
|
||||||
|
void handleQuarter(CalculatedParam calculatedParam);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.njcn.prepare.harmonic.service.mysql.line;
|
|||||||
|
|
||||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||||
import com.njcn.harmonic.pojo.po.RMpEventDetailYPO;
|
import com.njcn.harmonic.pojo.po.RMpEventDetailYPO;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.bo.CalculatedParam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -14,5 +15,5 @@ import com.njcn.harmonic.pojo.po.RMpEventDetailYPO;
|
|||||||
*/
|
*/
|
||||||
public interface RMpEventDetailYService extends IMppService<RMpEventDetailYPO> {
|
public interface RMpEventDetailYService extends IMppService<RMpEventDetailYPO> {
|
||||||
|
|
||||||
|
void handleYear(CalculatedParam calculatedParam);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user