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

规则修改

parent 4e81a21f
......@@ -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.BubbleTipResult;
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.IContingencyInstance;
import com.yeejoin.amos.fas.business.service.model.ContingencyRo;
......@@ -39,7 +39,7 @@ public class ContingencyAction implements CustomerAction {
@Autowired
private IContingencyInstance iContingencyInstance;
@Autowired
private FireStengthService fireStrengthService;
......@@ -77,8 +77,8 @@ public class ContingencyAction implements CustomerAction {
Date now = new Date();
String time = sdf.format(now);
List<FireStrength> strengths =null;
//fireStrengthService.
List<FireStrength> strengths = fireStrengthService.queryForStrengthList(time);
// List<FireStrength> strengths = iStrengthRepository.queryForStrengthList(time);
if (!CollectionUtils.isEmpty(strengths))
......@@ -424,8 +424,8 @@ public class ContingencyAction implements CustomerAction {
private void stopSnapshop(ContingencyRo contingencyRo) {
// if (RuleRunigSnapshotServiceImpl.getReplayBatchNo() != null && !RuleRunigSnapshotServiceImpl.getReplayBatchNo().equals(contingencyRo.getBatchNo()))
// RuleRunigSnapshotServiceImpl.setReplayBatchNoToNull();
if (RuleRunigSnapshotServiceImpl.getReplayBatchNo() != null && !RuleRunigSnapshotServiceImpl.getReplayBatchNo().equals(contingencyRo.getBatchNo()))
RuleRunigSnapshotServiceImpl.setReplayBatchNoToNull();
}
}
package com.yeejoin.amos.fas.business.dao.mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.fas.dao.entity.FireStrength;
public interface FireStrengthMapper extends BaseMapper {
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);
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;
@Service("fireStengthService")
public class FireStrengthServiceImpl implements FireStengthService {
@Autowired
private FireStrengthPointDao fireStrengthPointDao;
@Autowired
private FireStrengthMapper fireStrengthMapper;
public FireStrength savePoint(FireStrength fireEquipmentPoint)
{
public FireStrength savePoint(FireStrength fireEquipmentPoint) {
return fireStrengthPointDao.save(fireEquipmentPoint);
}
public Map queryOne(Long id)
{
public Map queryOne(Long id) {
return fireStrengthMapper.queryOne(id);
}
public String [] deletePoint(String []idArray) throws Exception
{
for(String id:idArray)
{
public String[] deletePoint(String[] idArray) throws Exception {
for (String id : idArray) {
Optional<FireStrength> fireEquipmentPoint1 = fireStrengthPointDao.findById(Long.parseLong(id));
FireStrength fireEquipmentPoint =null;
if(fireEquipmentPoint1.isPresent()){
fireEquipmentPoint=fireEquipmentPoint1.get();
FireStrength fireEquipmentPoint = null;
if (fireEquipmentPoint1.isPresent()) {
fireEquipmentPoint = fireEquipmentPoint1.get();
}
if(fireEquipmentPoint != null)
{
if (fireEquipmentPoint != null) {
this.fireStrengthPointDao.deleteById(Long.parseLong(id));
}else
{
throw new Exception("找不到指定的监测点:"+id);
} else {
throw new Exception("找不到指定的监测点:" + id);
}
}
return idArray;
}
public Page queryByFireEquimt(String username,String code, CommonPageable pageable)
{
Long total = fireStrengthMapper.queryCountForPage(username,code);
List<Map> content = fireStrengthMapper.queryForPage(username,code,pageable.getOffset(),pageable.getPageSize());
Page result = new PageImpl(content,pageable,total);
public Page queryByFireEquimt(String username, String code, CommonPageable pageable) {
Long total = fireStrengthMapper.queryCountForPage(username, code);
List<Map> content = fireStrengthMapper.queryForPage(username, code, pageable.getOffset(),
pageable.getPageSize());
Page result = new PageImpl(content, pageable, total);
return result;
}
public List<FireStrength> queryForStrengthList(String time) {
return fireStrengthMapper.queryForStrengthList(time);
}
}
package com.yeejoin.amos.fas.business.service.intfc;
import java.util.List;
import java.util.Map;
import org.springframework.data.domain.Page;
......@@ -40,5 +41,6 @@ public interface FireStengthService {
*/
Page queryByFireEquimt(String username,String code, CommonPageable pageable);
List<FireStrength> queryForStrengthList(String time);
}
......@@ -15,5 +15,4 @@ public interface IRuleRunningSnapshotService
void replay(String batchNo) throws Exception;
}
......@@ -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>
\ 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