Commit c396881e authored by zhengjiawei's avatar zhengjiawei

bug

parent b2e1de00
...@@ -99,6 +99,8 @@ public interface RiskSourceMapper extends BaseMapper { ...@@ -99,6 +99,8 @@ public interface RiskSourceMapper extends BaseMapper {
void updateRpn(RiskSource riskSource); void updateRpn(RiskSource riskSource);
void updateRpnForNull(RiskSource riskSource);
List<RegionTreeResponse> getRegionList(String channelType,String orgCode); List<RegionTreeResponse> getRegionList(String channelType,String orgCode);
HashMap<String, Object> findRegionById(@Param("id")Long id,@Param("orgCode")String orgCode,@Param("channelType")String channelType); HashMap<String, Object> findRegionById(@Param("id")Long id,@Param("orgCode")String orgCode,@Param("channelType")String channelType);
......
...@@ -1652,7 +1652,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1652,7 +1652,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSource.setRiskLevelId(null); riskSource.setRiskLevelId(null);
riskSource.setFlickerFrequency(0); riskSource.setFlickerFrequency(0);
//1.更新fmea对应风险点rpn、rpni、level //1.更新fmea对应风险点rpn、rpni、level
riskSourceMapper.updateRpn(riskSource); riskSourceMapper.updateRpnForNull(riskSource);
//2.记录风险点rpn变化流水 //2.记录风险点rpn变化流水
this.saveRpnLog(riskSource.getId(), fmeaId, resetValue, resetValue, notifyType); this.saveRpnLog(riskSource.getId(), fmeaId, resetValue, resetValue, notifyType);
...@@ -1818,6 +1818,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1818,6 +1818,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
List<Fmea> fmeas = fmeaMapper.listByRiskSourceIds(ids); List<Fmea> fmeas = fmeaMapper.listByRiskSourceIds(ids);
RpnCalculationBo rpnValueBo = RpnUtils.calRpnAndRpni(fmeas); RpnCalculationBo rpnValueBo = RpnUtils.calRpnAndRpni(fmeas);
if (rpnValueBo.isEmpty()) { if (rpnValueBo.isEmpty()) {
riskSource.setRpn(null);
riskSource.setRpni(null);
riskSource.setRiskLevelId(null);
iRiskSourceDao.save(riskSource);
return; return;
} }
BigDecimal rpn = rpnValueBo.getRpn(); BigDecimal rpn = rpnValueBo.getRpn();
......
...@@ -701,6 +701,15 @@ ...@@ -701,6 +701,15 @@
parent_id = #{riskSourceId} parent_id = #{riskSourceId}
</select> </select>
<update id="updateRpnForNull">
update f_risk_source
set
rpn = null,
rpni = null,
risk_level_id = null,
flicker_frequency = null
where id = #{id}
</update>
<update id="updateRpn"> <update id="updateRpn">
update f_risk_source update f_risk_source
<set> <set>
......
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