Commit 38dee045 authored by tangwei's avatar tangwei

修改巡检隐患bug

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