Commit 38dee045 authored by tangwei's avatar tangwei

修改巡检隐患bug

parent 552b98df
...@@ -273,6 +273,7 @@ public class CheckController extends AbstractBaseController { ...@@ -273,6 +273,7 @@ public class CheckController extends AbstractBaseController {
//数字换流站页面刷新 //数字换流站页面刷新
try { try {
webMqttComponent.publish(patrolTopic, ""); webMqttComponent.publish(patrolTopic, "");
}catch (Exception e){ }catch (Exception e){
log.error("数字换流站页面推送失败-----------"+e.getMessage()); log.error("数字换流站页面推送失败-----------"+e.getMessage());
} }
......
...@@ -139,6 +139,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -139,6 +139,7 @@ public class LatentDangerController extends AbstractBaseController {
} }
return iLatentDangerService.detail(id, user.getUserId(),isFinish); return iLatentDangerService.detail(id, user.getUserId(),isFinish);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
return CommonResponseUtil.failure("系统繁忙,请稍后再试"); return CommonResponseUtil.failure("系统繁忙,请稍后再试");
} }
} }
......
...@@ -48,4 +48,7 @@ public class LatentDangerPatrolBo extends LatentDangerPatrolBoExtend { ...@@ -48,4 +48,7 @@ public class LatentDangerPatrolBo extends LatentDangerPatrolBoExtend {
* 记录修改时间 * 记录修改时间
*/ */
private Date updateDate; private Date updateDate;
//input id
private Long inputId;
} }
...@@ -16,6 +16,7 @@ import javax.annotation.Resource; ...@@ -16,6 +16,7 @@ import javax.annotation.Resource;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel; import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.amos.patrol.dao.entity.Plan; import com.yeejoin.amos.patrol.dao.entity.Plan;
...@@ -218,6 +219,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -218,6 +219,7 @@ public class CheckServiceImpl implements ICheckService {
PlanTask planTask = null; PlanTask planTask = null;
Check check = new Check(); Check check = new Check();
HashMap<String, Object> routeParam = new HashMap<String, Object>(); HashMap<String, Object> routeParam = new HashMap<String, Object>();
Map detail = null; Map detail = null;
Boolean isOffline = requestParam.getIsOffline(); Boolean isOffline = requestParam.getIsOffline();
...@@ -350,7 +352,15 @@ public class CheckServiceImpl implements ICheckService { ...@@ -350,7 +352,15 @@ public class CheckServiceImpl implements ICheckService {
}else{ }else{
check.setScore(Integer.parseInt(XJConstant.POINT_NOT_SCORE)); check.setScore(Integer.parseInt(XJConstant.POINT_NOT_SCORE));
} }
check = checkDao.save(check); // check = checkDao.save(check);
try {
check = checkDao.save(check);
}catch (Exception e) {
e.printStackTrace();
}
List<CheckShot> imgList = new ArrayList<>(); List<CheckShot> imgList = new ArrayList<>();
...@@ -433,14 +443,19 @@ public class CheckServiceImpl implements ICheckService { ...@@ -433,14 +443,19 @@ public class CheckServiceImpl implements ICheckService {
} }
} }
private void updateTaskStatus(Long id, String userId){ private void updateTaskStatus(Long id, String userId){
MessageModel model = new MessageModel(); try {
model.setRelationId(String.valueOf(id)); MessageModel model = new MessageModel();
model.setIsRead(true); model.setRelationId(String.valueOf(id));
model.setMsgType("patrolSystem"); model.setIsRead(true);
if (!ObjectUtils.isEmpty(userId)){ model.setMsgType("patrolSystem");
model.setUserId(userId); if (!ObjectUtils.isEmpty(userId)){
} model.setUserId(userId);
Systemctl.messageClient.update(model); }
FeignClientResult<MessageModel> update = Systemctl.messageClient.update(model);
}catch (Exception e) {
e.printStackTrace();
}
} }
@Override @Override
public void delCheckById(List<Long> list) { public void delCheckById(List<Long> list) {
......
...@@ -835,6 +835,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -835,6 +835,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
// detailVo.setCurrentUserCanExcute(true); // detailVo.setCurrentUserCanExcute(true);
// } // }
// } // }
detailVo.setCurrentFlowRecordId(latentDangerBo.getCurrentFlowRecordId()); detailVo.setCurrentFlowRecordId(latentDangerBo.getCurrentFlowRecordId());
detailVo.setCurrentFlowRecordIdWeb(String.valueOf(latentDangerBo.getCurrentFlowRecordId())); detailVo.setCurrentFlowRecordIdWeb(String.valueOf(latentDangerBo.getCurrentFlowRecordId()));
if (!StringUtils.isEmpty(latentDangerBo.getReformJson())) { if (!StringUtils.isEmpty(latentDangerBo.getReformJson())) {
...@@ -851,8 +852,8 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -851,8 +852,8 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
} }
private void buildOfDifferentDangerType(LatentDangerBo latentDangerBo, LatentDangerDetailVo detailVo) { private void buildOfDifferentDangerType(LatentDangerBo latentDangerBo, LatentDangerDetailVo detailVo) {
if (latentDangerBo.getDangerType().equals(LatentDangerTypeEnum.计划检查.getCode()) if (latentDangerBo.getDangerType().equals(LatentDangerTypeEnum.计划检查.getCode().toString())
|| latentDangerBo.getDangerType().equals(LatentDangerTypeEnum.无计划检查.getCode())) { || latentDangerBo.getDangerType().equals(LatentDangerTypeEnum.无计划检查.getCode().toString())) {
LatentDangerPatrolBo patrolBo = latentDangerPatrolMapper.getByDangerId(latentDangerBo.getId()); LatentDangerPatrolBo patrolBo = latentDangerPatrolMapper.getByDangerId(latentDangerBo.getId());
if (patrolBo != null) { if (patrolBo != null) {
LatentDangerDetailRiskVo riskVo = new LatentDangerDetailRiskVo(); LatentDangerDetailRiskVo riskVo = new LatentDangerDetailRiskVo();
...@@ -870,19 +871,23 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -870,19 +871,23 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
if (StringUtil.isNotEmpty(checkUser)) { if (StringUtil.isNotEmpty(checkUser)) {
riskVo.setCheckUser(checkUser.getRealName()); riskVo.setCheckUser(checkUser.getRealName());
} }
RiskFactorBo riskFactorBo = StringUtil.isNotEmpty(patrolBo.getClassifyOriginalId()) ? riskFactorMapper.getById(Long.valueOf(patrolBo.getClassifyOriginalId())) : null; // RiskFactorBo riskFactorBo = StringUtil.isNotEmpty(patrolBo.getClassifyOriginalId()) ? riskFactorMapper.getById(Long.valueOf(patrolBo.getClassifyOriginalId())) : null;
if (riskFactorBo != null && riskFactorBo.getEquipmentDepartmentId() != null) { // if (riskFactorBo != null && riskFactorBo.getEquipmentDepartmentId() != null) {
DepartmentModel department = remoteSecurityService.getDepartmentByDeptId(RequestContext.getToken(), getProduct(),RequestContext.getAppKey(),riskFactorBo.getEquipmentDepartmentId().toString()); // DepartmentModel department = remoteSecurityService.getDepartmentByDeptId(RequestContext.getToken(), getProduct(),RequestContext.getAppKey(),riskFactorBo.getEquipmentDepartmentId().toString());
if (department != null) { // if (department != null) {
riskVo.setBelongDepartmentName(department.getDepartmentName()); // riskVo.setBelongDepartmentName(department.getDepartmentName());
} // }
} // }
// List<CheckShot> checkShots = iCheckShotDao.findAllByCheckIdAndCheckInputId(patrolBo.getCheckId(),
// latentDangerBo.getBizId());
List<CheckShot> checkShots = iCheckShotDao.findAllByCheckIdAndCheckInputId(patrolBo.getCheckId(), List<CheckShot> checkShots = iCheckShotDao.findAllByCheckIdAndCheckInputId(patrolBo.getCheckId(),
latentDangerBo.getBizId()); patrolBo.getInputId());
if (!CollectionUtils.isEmpty(checkShots)) { if (!CollectionUtils.isEmpty(checkShots)) {
List<String> photos = Lists.transform(checkShots, e -> { List<String> photos = Lists.transform(checkShots, e -> {
if (e != null) { if (e != null) {
return fileServerAddress + e.getPhotoData().replaceAll("\\\\", "/"); // return fileServerAddress + e.getPhotoData().replaceAll("\\\\", "/");
return e.getPhotoData().replaceAll("\\\\", "/");
} else { } else {
return ""; return "";
} }
......
...@@ -127,8 +127,9 @@ ...@@ -127,8 +127,9 @@
</delete> </delete>
<select id="getByDangerId" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.extend.LatentDangerPatrolBo"> <select id="getByDangerId" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.extend.LatentDangerPatrolBo">
select select
a.*, pci.check_id,
pci.input_id,
b.name as itemName, b.name as itemName,
b.original_id as itemOriginalId, b.original_id as itemOriginalId,
b.basis_json as itemBasis, b.basis_json as itemBasis,
...@@ -139,32 +140,38 @@ ...@@ -139,32 +140,38 @@
c.charge_dept_id as pointDepartMentId, c.charge_dept_id as pointDepartMentId,
c.original_id as pointOriginalId, c.original_id as pointOriginalId,
d.name as routeName, d.name as routeName,
e.check_time as checkTime, pc.check_time as checkTime,
e.user_id as checkUserId, pc.user_id as checkUserId,
e.dep_id as checkDepartmentId, pc.dep_id as checkDepartmentId,
f.name as planName, f.name as planName,
f.plan_type as planType, f.plan_type as planType,
f.execute_rate as executeRate, f.execute_rate as executeRate,
g.original_id as classifyOriginalId, g.original_id as classifyOriginalId,
g.name as classifyName g.name as classifyName
from from
p_latent_danger_patrol as a p_latent_danger as a
left join
p_input_item as b on a.item_id = b.id
LEFT JOIN p_check_input pci ON pci.id = a.biz_id
LEFT JOIN p_check pc ON pci.check_id = pc.id
left join left join
p_point as c on a.point_id = c.id p_input_item as b on pci.input_id = b.id
left join left join
p_route as d on a.route_id = d.id p_point as c on pc.point_id = c.id
left join left join
p_check as e on a.check_id = e.id p_route as d on pc.route_id = d.id
left join left join
p_plan as f on e.plan_id = f.id p_plan as f on pc.plan_id = f.id
left join left join
p_point_classify as g on a.point_classify_id = g.id p_point_classify as g on pc.point_id= g.point_id
where where
a.deleted = 0 a.deleted = 0
and and
a.latent_danger_id = #{dangerId} a.id= #{dangerId}
</select> </select>
<select id="listByMap" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.extend.LatentDangerPatrolBo"> <select id="listByMap" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.extend.LatentDangerPatrolBo">
......
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