Commit 42c7c3cb authored by 吴江's avatar 吴江

规则修改

parent 4e81a21f
...@@ -23,7 +23,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; ...@@ -23,7 +23,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.fas.business.action.result.ActionResult; import com.yeejoin.amos.fas.business.action.result.ActionResult;
import com.yeejoin.amos.fas.business.action.result.BubbleTipResult; import com.yeejoin.amos.fas.business.action.result.BubbleTipResult;
import com.yeejoin.amos.fas.business.action.result.message.ActionResultMessage; import com.yeejoin.amos.fas.business.action.result.message.ActionResultMessage;
import com.yeejoin.amos.fas.business.service.impl.FireStrengthServiceImpl; import com.yeejoin.amos.fas.business.service.impl.RuleRunigSnapshotServiceImpl;
import com.yeejoin.amos.fas.business.service.intfc.FireStengthService; import com.yeejoin.amos.fas.business.service.intfc.FireStengthService;
import com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance; import com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance;
import com.yeejoin.amos.fas.business.service.model.ContingencyRo; import com.yeejoin.amos.fas.business.service.model.ContingencyRo;
...@@ -77,8 +77,8 @@ public class ContingencyAction implements CustomerAction { ...@@ -77,8 +77,8 @@ public class ContingencyAction implements CustomerAction {
Date now = new Date(); Date now = new Date();
String time = sdf.format(now); String time = sdf.format(now);
List<FireStrength> strengths =null;
//fireStrengthService. List<FireStrength> strengths = fireStrengthService.queryForStrengthList(time);
// List<FireStrength> strengths = iStrengthRepository.queryForStrengthList(time); // List<FireStrength> strengths = iStrengthRepository.queryForStrengthList(time);
if (!CollectionUtils.isEmpty(strengths)) if (!CollectionUtils.isEmpty(strengths))
...@@ -424,8 +424,8 @@ public class ContingencyAction implements CustomerAction { ...@@ -424,8 +424,8 @@ public class ContingencyAction implements CustomerAction {
private void stopSnapshop(ContingencyRo contingencyRo) { private void stopSnapshop(ContingencyRo contingencyRo) {
// if (RuleRunigSnapshotServiceImpl.getReplayBatchNo() != null && !RuleRunigSnapshotServiceImpl.getReplayBatchNo().equals(contingencyRo.getBatchNo())) if (RuleRunigSnapshotServiceImpl.getReplayBatchNo() != null && !RuleRunigSnapshotServiceImpl.getReplayBatchNo().equals(contingencyRo.getBatchNo()))
// RuleRunigSnapshotServiceImpl.setReplayBatchNoToNull(); RuleRunigSnapshotServiceImpl.setReplayBatchNoToNull();
} }
} }
package com.yeejoin.amos.fas.business.dao.mapper; package com.yeejoin.amos.fas.business.dao.mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.fas.dao.entity.FireStrength;
public interface FireStrengthMapper extends BaseMapper { public interface FireStrengthMapper extends BaseMapper {
Map queryOne(@Param("id") Long id); Map queryOne(@Param("id") Long id);
List<Map> queryForPage(@Param("username") String username, @Param("code") String code, @Param("start") long start, @Param("length") Integer length); List<Map> queryForPage(@Param("username") String username, @Param("code") String code, @Param("start") long start, @Param("length") Integer length);
Long queryCountForPage(@Param("username") String username, @Param("code") String code); Long queryCountForPage(@Param("username") String username, @Param("code") String code);
List<FireStrength> queryForStrengthList(@Param("time")String time);
} }
...@@ -17,57 +17,46 @@ import java.util.Optional; ...@@ -17,57 +17,46 @@ import java.util.Optional;
@Service("fireStengthService") @Service("fireStengthService")
public class FireStrengthServiceImpl implements FireStengthService { public class FireStrengthServiceImpl implements FireStengthService {
@Autowired @Autowired
private FireStrengthPointDao fireStrengthPointDao; private FireStrengthPointDao fireStrengthPointDao;
@Autowired @Autowired
private FireStrengthMapper fireStrengthMapper; private FireStrengthMapper fireStrengthMapper;
public FireStrength savePoint(FireStrength fireEquipmentPoint) {
public FireStrength savePoint(FireStrength fireEquipmentPoint)
{
return fireStrengthPointDao.save(fireEquipmentPoint); return fireStrengthPointDao.save(fireEquipmentPoint);
} }
public Map queryOne(Long id) {
public Map queryOne(Long id)
{
return fireStrengthMapper.queryOne(id); return fireStrengthMapper.queryOne(id);
} }
public String [] deletePoint(String []idArray) throws Exception public String[] deletePoint(String[] idArray) throws Exception {
{ for (String id : idArray) {
for(String id:idArray)
{
Optional<FireStrength> fireEquipmentPoint1 = fireStrengthPointDao.findById(Long.parseLong(id)); Optional<FireStrength> fireEquipmentPoint1 = fireStrengthPointDao.findById(Long.parseLong(id));
FireStrength fireEquipmentPoint =null; FireStrength fireEquipmentPoint = null;
if(fireEquipmentPoint1.isPresent()){ if (fireEquipmentPoint1.isPresent()) {
fireEquipmentPoint=fireEquipmentPoint1.get(); fireEquipmentPoint = fireEquipmentPoint1.get();
} }
if(fireEquipmentPoint != null) if (fireEquipmentPoint != null) {
{
this.fireStrengthPointDao.deleteById(Long.parseLong(id)); this.fireStrengthPointDao.deleteById(Long.parseLong(id));
}else } else {
{ throw new Exception("找不到指定的监测点:" + id);
throw new Exception("找不到指定的监测点:"+id);
} }
} }
return idArray; return idArray;
} }
public Page queryByFireEquimt(String username, String code, CommonPageable pageable) {
public Page queryByFireEquimt(String username,String code, CommonPageable pageable) Long total = fireStrengthMapper.queryCountForPage(username, code);
{ List<Map> content = fireStrengthMapper.queryForPage(username, code, pageable.getOffset(),
Long total = fireStrengthMapper.queryCountForPage(username,code); pageable.getPageSize());
List<Map> content = fireStrengthMapper.queryForPage(username,code,pageable.getOffset(),pageable.getPageSize()); Page result = new PageImpl(content, pageable, total);
Page result = new PageImpl(content,pageable,total);
return result; return result;
} }
public List<FireStrength> queryForStrengthList(String time) {
return fireStrengthMapper.queryForStrengthList(time);
}
} }
package com.yeejoin.amos.fas.business.service.intfc; package com.yeejoin.amos.fas.business.service.intfc;
import java.util.List;
import java.util.Map; import java.util.Map;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
...@@ -41,4 +42,5 @@ public interface FireStengthService { ...@@ -41,4 +42,5 @@ public interface FireStengthService {
Page queryByFireEquimt(String username,String code, CommonPageable pageable); Page queryByFireEquimt(String username,String code, CommonPageable pageable);
List<FireStrength> queryForStrengthList(String time);
} }
...@@ -15,5 +15,4 @@ public interface IRuleRunningSnapshotService ...@@ -15,5 +15,4 @@ public interface IRuleRunningSnapshotService
void replay(String batchNo) throws Exception; void replay(String batchNo) throws Exception;
} }
...@@ -62,5 +62,15 @@ ...@@ -62,5 +62,15 @@
<select id="queryForStrengthList" resultType="com.yeejoin.amos.fas.business.service.model.FireStrength">
SELECT
*
FROM
f_fire_strength t
WHERE
TIME_TO_SEC(#{time}) &gt;= TIME_TO_SEC( t.day_begin )
AND TIME_TO_SEC(#{time}) &lt;= TIME_TO_SEC(
t.day_end)
</select>
</mapper> </mapper>
\ No newline at end of file
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