Commit 976157f3 authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents e25c8326 728e8c80
......@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import com.alibaba.fastjson.JSONObject;
@FeignClient(name = "AMOS-API-WORKFLOW", path = "workflow", configuration = { CommonMultipartSupportConfig.class })
@FeignClient(name = "AMOS-API-WORKFLOW-CJHENHAO", path = "workflow", configuration = { CommonMultipartSupportConfig.class })
public interface WorkflowFeignService {
/**
* 发起流程
......@@ -62,12 +62,12 @@ public interface WorkflowFeignService {
JSONObject getTasksNoAuth(@RequestParam(value="processDefinitionKey", required=false) String processDefinitionKey,
@RequestParam(value="userId", required=false) String userId) ;
/**
* 流程实例-分页
* 流程信息
* @param processDefinitionKey
* @param userId
* @return
*/
@RequestMapping(value = "/activitiHistory/processes", method = RequestMethod.GET)
JSONObject getInstance(@RequestParam(value="name", required=false) String name) ;
@RequestMapping(value = "/activitiHistory/processes/historytasks/list/{processInstanceId}", method = RequestMethod.GET)
JSONObject queryHistoryTaskListByProcessId(@PathVariable("processInstanceId") String processInstanceId);
}
......@@ -101,9 +101,5 @@ public class FailureDetails extends BaseEntity {
*/
@TableField("process_id")
private String processId;
@TableField ("current_role")
private String currentRole;
}
......@@ -26,6 +26,22 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
public class Point extends BasicEntity {
private static final long serialVersionUID = 1L;
public String getBuildingId() {
return buildingId;
}
public void setBuildingId(String buildingId) {
this.buildingId = buildingId;
}
public String getBuildingName() {
return buildingName;
}
public void setBuildingName(String buildingName) {
this.buildingName = buildingName;
}
/**
* 参考地址
*/
......@@ -143,6 +159,18 @@ public class Point extends BasicEntity {
@Column(name="point_no")
private String pointNo;
/**
* 所在建筑
*/
private String buildingId;
/**
* 所在建筑名称
*/
private String buildingName;
public String getEquipmentId() {
return equipmentId;
}
......
package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 警情查询DTO
*/
@Data
@ApiModel(value="AlertCalledDto", description="警情接警填报记录")
public class AlertCalledQueryDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "工单编号", index = 0)
@ApiModelProperty(value = "工单编号")
private String workOrderNumber;
@ExcelProperty(value = "接警人", index = 1)
@ApiModelProperty(value = "接警人")
private String creator;
@ExcelProperty(value = "求援人", index = 2)
@ApiModelProperty(value = "求援人")
private String emergency;
@ExcelProperty(value = "求援时间", index = 3)
@ApiModelProperty(value = "求援时间")
private Date emergencyTime;
@ExcelIgnore
@ApiModelProperty(value = "求援时间开始")
private Date emergencyTimeStart;
@ExcelIgnore
@ApiModelProperty(value = "求援时间结束")
private Date emergencyTimeEnd;
@ExcelProperty(value = "求援电话", index = 4)
@ApiModelProperty(value = "求援电话")
private String emergencyCall;
@ExcelProperty(value = "电梯识别码", index = 5)
@ApiModelProperty(value = "电梯识别码")
private String deviceId;
@ExcelProperty(value = "电梯地址", index = 6)
@ApiModelProperty(value = "电梯地址")
private String elevatorAddress;
@ExcelProperty(value = "所属区域", index = 7)
@ApiModelProperty(value = "所属区域")
private String address;
@ExcelProperty(value = "警情类型", index = 8)
@ApiModelProperty(value = "警情类型")
private String alertType;
@ExcelProperty(value = "警情来源", index = 9)
@ApiModelProperty(value = "警情来源")
private String alertSource;
@ExcelProperty(value = "处置环节", index = 10)
@ApiModelProperty(value = "处置环节")
private String alertStage;
@ExcelProperty(value = "完成状态", index = 11)
@ApiModelProperty(value = "完成状态")
private String alertStatus;
@ExcelIgnore
@ApiModelProperty(value = "页码")
private Integer pageNum;
@ExcelIgnore
@ApiModelProperty(value = "条数")
private Integer pageSize;
}
package com.yeejoin.amos.boot.module.tzs.api.mapper;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
......@@ -26,4 +28,11 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
@Param("orgCode") String orgCode,
@Param("recUserId") String recUserId
);
/**
* 根据查询条件返回警情记录
* @param alertCalledQueryDto
* @return
*/
List<AlertCalledQueryDto> queryAlertListByQueryDto(@Param("alertCalledQueryDto") AlertCalledQueryDto alertCalledQueryDto);
}
......@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import java.util.List;
/**
* 警情接警填报记录接口类
......@@ -24,4 +27,19 @@ public interface IAlertCalledService {
*
* **/
AlertCalledFormDto selectAlertCalledByIdNoCache(Long id);
/**
* 根据查询条件返回警情记录
* @param alertCalledQueryDto
* @return
*/
List<AlertCalledQueryDto> queryAlertListByQueryDto(AlertCalledQueryDto alertCalledQueryDto);
/**
* 根据警情id 更新警情状态
* @param alertId
* @param alertStage
* @return
*/
Boolean updateAlertStageByAlertId(Long alertId, String alertStage);
}
......@@ -23,4 +23,83 @@
or rec_user_id = #{recUserId}
</if>
</select>
<select id="queryAlertListByQueryDto" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto">
SELECT
a.work_order_number AS workOrderNumber,
a.rec_user_name AS creator,
a.emergency_person AS emergency,
a.call_time AS emergencyTime,
a.emergency_call AS emergencyCall,
a.device_id AS deviceId,
e.address AS elevatorAddress,
a.region_code AS address,
a.alarm_type AS alertType,
a.alert_source AS alertSource,
a.alert_stage AS alertStage,
CASE a.alert_status
WHEN 0 THEN
'未完成'
WHEN 1 THEN
'完成'
ELSE
''
END AS alertStatus
FROM
tz_alert_called a
LEFT JOIN tcb_elevator e ON e.rescue_code = a.device_id
WHERE 1=1
<if test="alertCalledQueryDto.workOrderNumber != null and alertCalledQueryDto.workOrderNumber != ''">
AND a.work_order_number like CONCAT(CONCAT('%',#{alertCalledQueryDto.workOrderNumber}),'%')
</if>
<if test="alertCalledQueryDto.creator != null and alertCalledQueryDto.creator != ''">
AND a.rec_user_name like CONCAT(CONCAT('%',#{alertCalledQueryDto.creator}),'%')
</if>
<if test="alertCalledQueryDto.emergency != null and alertCalledQueryDto.emergency != ''">
AND a.emergency_person like CONCAT(CONCAT('%',#{alertCalledQueryDto.emergency}),'%')
</if>
<if test="alertCalledQueryDto.emergencyTimeStart != null ">
and #{alertCalledQueryDto.emergencyTimeStart} <![CDATA[ <= ]]> a.call_time
</if>
<if test="alertCalledQueryDto.emergencyTimeEnd != null ">
and a.call_time <![CDATA[ <= ]]> #{alertCalledQueryDto.emergencyTimeEnd}
</if>
<if test="alertCalledQueryDto.workOrderNumber != null and alertCalledQueryDto.workOrderNumber != ''">
and call_time <![CDATA[ <= ]]> #{endDate}
</if>
<if test="alertCalledQueryDto.emergencyCall != null and alertCalledQueryDto.emergencyCall != ''">
AND a.emergency_call like CONCAT(CONCAT('%',#{alertCalledQueryDto.emergencyCall}),'%')
</if>
<if test="alertCalledQueryDto.deviceId != null and alertCalledQueryDto.deviceId != ''">
AND a.device_id like CONCAT(CONCAT('%',#{alertCalledQueryDto.deviceId}),'%')
</if>
<if test="alertCalledQueryDto.elevatorAddress != null and alertCalledQueryDto.elevatorAddress != ''">
AND e.address like CONCAT(CONCAT('%',#{alertCalledQueryDto.elevatorAddress}),'%')
</if>
<if test="alertCalledQueryDto.address != null and alertCalledQueryDto.address != ''">
AND a.region_code like CONCAT(CONCAT('%',#{alertCalledQueryDto.address}),'%')
</if>
<if test="alertCalledQueryDto.alertType != null and alertCalledQueryDto.alertType != ''">
AND a.alarm_type_code = #{alertCalledQueryDto.alertType}
</if>
<if test="alertCalledQueryDto.alertSource != null and alertCalledQueryDto.alertSource != ''">
AND a.alert_source_code = #{alertCalledQueryDto.alertSource}
</if>
<if test="alertCalledQueryDto.alertStage != null and alertCalledQueryDto.alertStage != ''">
AND a.alert_stage_code = #{alertCalledQueryDto.alertStage}
</if>
<if test="alertCalledQueryDto.alertStatus != null and alertCalledQueryDto.alertStatus != ''">
AND a.alert_status = #{alertCalledQueryDto.alertStatus}
</if>
ORDER BY a.rec_date
<if test="alertCalledQueryDto.pageNum != null and alertCalledQueryDto.pageSize != ''">
limit #{alertCalledQueryDto.pageNum},#{alertCalledQueryDto.pageSize}
</if>
</select>
</mapper>
......@@ -183,5 +183,10 @@ public class FailureDetailsController extends BaseController {
String userId = getUserInfo().getUserId();
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForPage(page,userId));
}*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "流程信息", notes = "流程信息")
@GetMapping(value = "/processHistory")
public ResponseModel<Object> selectHistoryt(@RequestParam Long sequenceNbr) {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.getCurrentProcessHistoryTask(sequenceNbr));
}
}
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Random;
......@@ -36,6 +38,8 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService;
import com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import rx.internal.util.LinkedArrayList;
/**
* 服务实现类
*
......@@ -221,7 +225,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public boolean excuteTask(Long sequenceNbr, ReginParams userInfo, String condition) {
HashMap<String, Object> conditionMap = new HashMap<String, Object>();
conditionMap.put("condition", condition);
conditionMap.put("condition", Integer.parseInt(condition));
Map<String, Object> map = checkExcuteTaskAuthMap(sequenceNbr, userInfo);
try {
if (Boolean.parseBoolean(map.get("checkFlag").toString())) {
......@@ -363,8 +367,23 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public Object getCurrentProcessHistoryTask(Long id) {
FailureDetailsDto failureDetailsDto = this.queryBySeq(id);
String processId = failureDetailsDto.getProcessId();
return logger;
JSONObject object= workflowFeignService.queryHistoryTaskListByProcessId(processId);
JSONArray datArray=null;
if(ObjectUtils.isNotEmpty(object)) {
datArray=object.getJSONArray("data");
}
List<Object> list = new ArrayList<Object>();
if(datArray!=null) {
datArray.stream().forEach(i->{
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(i));
if(detail.containsKey("operator") && !detail.getString("name").equals("维修中")) {
//从流程记录表中拿到处理人的名称
detail.replace("operator", null);
list.add(object);
}
});
}
return list;
}
public static String buildOrderNo() {
......
package com.yeejoin.amos.maintenance.business.controller;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -33,11 +8,7 @@ import com.yeejoin.amos.maintenance.business.param.PlanTaskPageParam;
import com.yeejoin.amos.maintenance.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.maintenance.business.service.intfc.IPointService;
import com.yeejoin.amos.maintenance.business.service.intfc.IRouteService;
import com.yeejoin.amos.maintenance.business.util.CommonResponse;
import com.yeejoin.amos.maintenance.business.util.CommonResponseUtil;
import com.yeejoin.amos.maintenance.business.util.FileHelper;
import com.yeejoin.amos.maintenance.business.util.PlanTaskPageParamUtil;
import com.yeejoin.amos.maintenance.business.util.Toke;
import com.yeejoin.amos.maintenance.business.util.*;
import com.yeejoin.amos.maintenance.business.vo.CodeOrderVo;
import com.yeejoin.amos.maintenance.business.vo.PlanTaskVo;
import com.yeejoin.amos.maintenance.business.vo.PointInputItemVo;
......@@ -52,10 +23,23 @@ import com.yeejoin.amos.maintenance.dao.entity.Point;
import com.yeejoin.amos.maintenance.dao.entity.PointClassify;
import com.yeejoin.amos.maintenance.exception.YeeException;
import com.yeejoin.amos.maintenance.feign.RemoteSecurityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@RestController
@RequestMapping(value = "/api/planTask")
......@@ -74,7 +58,6 @@ public class PlanTaskController extends AbstractBaseController {
@Autowired
private RemoteSecurityService remoteSecurityService;
private String loginOrgCode;
/**
* 计划执行查询
......@@ -259,12 +242,11 @@ public class PlanTaskController extends AbstractBaseController {
@ApiParam(value = "巡检点编号", required = true) @RequestParam(required = true) String serial,
@ApiParam(value = "参数", required = false) @RequestParam(required = false) Long planTaskId) {
try {
HashMap<String, Object> params = new HashMap<String, Object>();
HashMap<String, Object> params = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
params.put("orgCode", loginOrgCode);
String pointNo = serial;
params.put("pointNo", pointNo);
params.put("pointNo", serial);
Point point = pointService.queryPointByPointNo(params);
// 1.通用校验
if (point == null) {
......@@ -454,32 +436,23 @@ public class PlanTaskController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据计划任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)", notes = "根据计划任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)")
@RequestMapping(value = "/queryPlanTaskById", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
@RequestMapping(value = "/point/{planTaskId}/list", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse qryPlanTaskById(
@ApiParam(value = "巡检计划任务ID", required = true) @RequestParam(required = true) Long planTaskId) {
try {
Map<String, Object> response = new HashMap<String, Object>();
Map task = planTaskService.queryPlanTaskById(planTaskId);
if (ObjectUtils.isEmpty(task) || ObjectUtils.isEmpty(task.get("planTaskId"))) {
return CommonResponseUtil.failure("该计划已刷新,请重新选择!!!");
}
List points = planTaskService.getPlanTaskPoints(planTaskId);
// SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
// task.put("checkDate", task.get("checkDate").toString());
String[] userIds = task.get("userId").toString().split(",");
for (String userId : userIds) {
task.put("userId", userId);
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
task.put("checkDate", sdf.format(task.get("checkDate") != null ? sdf.parse(task.get("checkDate").toString()) : new Date()));
response.put("planTask", task);
response.put("points", points);
return CommonResponseUtil.success(response);
} catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage());
}
@ApiParam(value = "巡检计划任务ID", required = true) @PathVariable Long planTaskId,
@ApiParam(value = "建筑id", required = true) @RequestParam(value = "buildingId",required = false) String buildingId,
@ApiParam(value = "维保状态", required = true) @RequestParam(value = "isFinish",required = false) String isFinish,
@ApiParam(value = "消防系统id", required = true) @RequestParam(value = "systemId",required = false) String systemId,
@ApiParam(value = "设备编号", required = true) @RequestParam(value = "pointNo",required = false) String pointNo,
@ApiParam(value = "设备名称", required = true) @RequestParam(value = "pointName",required = false) String pointName
) {
Map<String,Object> param = new HashMap<>();
param.put("planTaskId",planTaskId);
param.put("buildingId",buildingId);
param.put("isFinish",isFinish);
param.put("systemId",systemId);
param.put("pointNo",pointNo);
param.put("pointName",pointName);
return CommonResponseUtil.success(planTaskService.getPlanTaskPoints(param));
}
/**
......@@ -489,7 +462,7 @@ public class PlanTaskController extends AbstractBaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保任务查询-mobile", notes = "根据用户条件查询所有计划任务")
@ApiOperation(value = "维保任务查询-mobile", notes = "根据用户条件查询所有计划任务-mobile")
@RequestMapping(value = "/queryPlanTask", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse qryLoginUserPlanTask(
@ApiParam(value = "人员") @RequestParam(value = "userId", required = false) Long userId,
......@@ -500,7 +473,7 @@ public class PlanTaskController extends AbstractBaseController {
@ApiParam(value = "业主单位") @RequestParam(value = "companyId", required = false) String companyId,
@ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber,
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) throws Exception {
HashMap<String, Object> params = new HashMap<String, Object>();
HashMap<String, Object> params = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity());
......@@ -513,11 +486,7 @@ public class PlanTaskController extends AbstractBaseController {
params.put("finishStatus", finishStatus);
params.put("orderBy", OrderByEnum.getEumByCode(orderBy).getOderBy());
CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
try {
return CommonResponseUtil.success(planTaskService.getPlanTasks(params, pageable));
} catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage());
}
return CommonResponseUtil.success(planTaskService.getPlanTasks(params, pageable));
}
......@@ -687,4 +656,14 @@ public class PlanTaskController extends AbstractBaseController {
return CommonResponseUtil.failure(e.getMessage());
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询维保设施,检查内容详情")
@GetMapping(value = "/task-point-detail")
public CommonResponse planTaskPointDetail(
@RequestParam(value = "routePointId") String routePointId,
@RequestParam(value = "id") String planTaskDetailId
){
return CommonResponseUtil.success(planTaskService.planTaskPointDetail(planTaskDetailId,routePointId));
}
}
......@@ -32,4 +32,6 @@ public interface InputItemMapper {
List<PointInputItemVo> queryCustomInputItemByPointId(@Param("pointId") Long pointId, @Param("equipmentId") String equipmentName);
Integer insertList(List<InputItem> list);
List<Map<String, Object>> queryInputItemInRountPoint(String routePointId);
}
......@@ -77,10 +77,10 @@ public interface PlanTaskMapper extends BaseMapper {
Map queryPlanTaskById(@Param(value="planTaskId") Long planTaskId);
/**
* 通过计划任务Id获取任务所有点信息
* @param planTaskId
* @param param
* @return
*/
List getPlanTaskPoints(@Param(value="planTaskId") Long planTaskId);
List<Map<String,Object>> getPlanTaskPoints(Map<String, Object> param);
/**
* 获取用户当前所有可以做的任务个数
* @param userId
......
......@@ -15,8 +15,6 @@ public interface IRoutePointDao extends BaseDao<RoutePoint, Long> {
@Query(value = "SELECT COUNT( point_id ) FROM `p_route_point` where route_id = ?1", nativeQuery = true)
int countRoutePoint(Long routeId);
@Query(value = "SELECT * FROM `p_route_point` where point_id = ?1", nativeQuery = true)
List<RoutePoint> queryByPointId(Long pointId);
@Query(value = "SELECT IfNULL(max(order_no),0) FROM `p_route_point` where route_id = ?1", nativeQuery = true)
int maxRoutePointOrderNo(Long routeId);
......@@ -38,11 +36,6 @@ public interface IRoutePointDao extends BaseDao<RoutePoint, Long> {
@Query(value = "select point_id from p_route_point WHERE route_id = ?1", nativeQuery = true)
List<Long> findAllByRouteId(Long routeId);
@Modifying
@Transactional
@Query(value = "delete from p_route_point WHERE point_id in (?1)", nativeQuery = true)
void delRoutePointByPointId(List<Long> pointIds);
@Query(value = "SELECT id FROM p_route_point WHERE point_id IN (?1)", nativeQuery = true)
List<BigInteger> queryRoutePointByPointId(List<Long> pointIds);
......
......@@ -7,13 +7,13 @@ import com.google.common.base.Joiner;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskDetailMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.maintenance.business.dao.repository.*;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckChkExListBo;
import com.yeejoin.amos.maintenance.business.entity.mybatis.PointCheckDetailBo;
import com.yeejoin.amos.maintenance.business.feign.Business;
import com.yeejoin.amos.maintenance.business.feign.EquipFeign;
import com.yeejoin.amos.maintenance.business.param.CheckPtListPageParam;
import com.yeejoin.amos.maintenance.business.param.PlanTaskPageParam;
......@@ -30,15 +30,13 @@ import com.yeejoin.amos.maintenance.core.common.response.AppCheckInputRespone;
import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.maintenance.core.util.DateUtil;
import com.yeejoin.amos.maintenance.core.util.StringUtil;
import com.yeejoin.amos.maintenance.dao.entity.Check;
import com.yeejoin.amos.maintenance.dao.entity.Plan;
import com.yeejoin.amos.maintenance.dao.entity.PlanTask;
import com.yeejoin.amos.maintenance.dao.entity.PlanTaskDetail;
import com.yeejoin.amos.maintenance.dao.entity.*;
import com.yeejoin.amos.maintenance.exception.YeeException;
import com.yeejoin.amos.maintenance.feign.RemoteSecurityService;
import com.yeejoin.amos.maintenance.quartz.IJobService;
import org.apache.commons.collections.CollectionUtils;
import org.assertj.core.util.Lists;
import org.omg.CORBA.OBJ_ADAPTER;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -85,10 +83,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
private ICheckService checkService;
@Autowired
private Business business;
private EquipFeign equipFeign;
@Autowired
private EquipFeign equipFeign;
IPointDao iPointDao;
@Autowired
IPlanTaskDetailDao iPlanTaskDetailDao;
@Autowired
InputItemMapper inputItemMapper;
@Override
public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) {
......@@ -582,8 +586,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
@Override
public List getPlanTaskPoints(Long planTaskId) {
return planTaskMapper.getPlanTaskPoints(planTaskId);
public List getPlanTaskPoints(Map<String, Object> param) {
return planTaskMapper.getPlanTaskPoints(param);
}
@Override
......@@ -1009,4 +1013,34 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
return result;
}
@Override
public Map<String, Object> planTaskPointDetail(String planTaskDetailId, String routePointId) {
Map<String,Object> result = new LinkedHashMap<>();
Optional<RoutePoint> rOp = iRoutePointDao.findById(Long.parseLong(routePointId));
RoutePoint routePoint = rOp.orElseThrow(()->new RuntimeException("计划清单不存在该点"));
Point point = iPointDao.findById(routePoint.getPointId()).orElseThrow(()->new RuntimeException("维保项不存在"));
PlanTaskDetail planTaskDetail = iPlanTaskDetailDao.findById(Long.parseLong(planTaskDetailId)).orElseThrow(()->new RuntimeException("任务不存在"));
PlanTask planTask = iplanTaskDao.findById(planTaskDetail.getTaskNo()).orElseThrow(()->new RuntimeException("主任务不存在"));
Map<String,Object> facility = this.buildFacilityDetail(point,planTask);
List<Map<String, Object>> itemList = this.buildCheckInputItem(routePointId);
result.put("facility",facility);
result.put("itemList",itemList);
return result;
}
private List<Map<String, Object>> buildCheckInputItem(String routePointId) {
return inputItemMapper.queryInputItemInRountPoint(routePointId);
}
private Map<String, Object> buildFacilityDetail(Point point, PlanTask planTask) {
Map<String,Object> facility = new LinkedHashMap<>();
facility.put("name",point.getName());
facility.put("pointId",point.getId());
facility.put("point_no",point.getPointNo());
facility.put("position",point.getBuildingName() + point.getAddress());
facility.put("userName",planTask.getUserName());
facility.put("riskAndManage",point.getRemark());
return facility;
}
}
......@@ -91,10 +91,10 @@ public interface IPlanTaskService {
/**
* 根据计划ID获取所有的 任务计划巡检点
* @param planTaskId
* @param param
* @return
*/
List getPlanTaskPoints(Long planTaskId);
List getPlanTaskPoints(Map<String, Object> param);
/**
* 获取用户当前所有有的计划任务
......@@ -149,4 +149,13 @@ public interface IPlanTaskService {
List<Map<String,Object>> queryPlanTaskTimeAxis(Long userId,Integer createDate);
List<Map<String,Object>> queryTimeAxis(Long userId,Integer createDate);
/**
* 任务点详情
*
* @param planTaskDetailId 子表id
* @param routePointId 关系表id
* @return Map<String, Object>
*/
Map<String, Object> planTaskPointDetail(String planTaskDetailId, String routePointId);
}
......@@ -9,11 +9,15 @@ import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.ExcelUtils;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonExcelDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCallInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
......@@ -28,13 +32,16 @@ import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.openxml4j.opc.internal.FileHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -44,6 +51,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Field;
import java.text.ParseException;
import java.util.Arrays;
......@@ -341,4 +349,30 @@ public class AlertCalledController extends BaseController {
}
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询警情事件记录", notes = "查询警情事件记录")
@PostMapping("/selectRecord")
public ResponseModel<Page<AlertCalledQueryDto>> queryAlertCalledByPager(@RequestBody AlertCalledQueryDto alertCalledQueryDto) {
List<AlertCalledQueryDto> list = iAlertCalledService.queryAlertListByQueryDto(alertCalledQueryDto);
Page<AlertCalledQueryDto> result = new Page<AlertCalledQueryDto>(alertCalledQueryDto.getPageNum(), alertCalledQueryDto.getPageSize());
long totle = list.size();
result.setRecords(list);
result.setTotal(totle);
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出警情事件记录", notes = "导出警情事件记录")
@PostMapping("/exportSelectRecord")
public void exportAlertCalled(@RequestBody AlertCalledQueryDto alertCalledQueryDto, HttpServletResponse response) {
List<AlertCalledQueryDto> list = iAlertCalledService.queryAlertListByQueryDto(alertCalledQueryDto);
String fileName = "警情事件记录" + new Date().getTime();
ExcelUtil.createTemplate(response, fileName, "警情事件记录", list,
AlertCalledQueryDto.class, null, false);
}
}
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
......@@ -9,13 +12,17 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.FormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.ESAlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.RepairConsult;
import com.yeejoin.amos.boot.module.tzs.api.entity.Template;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStatusEnum;
import com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils;
......@@ -23,14 +30,22 @@ import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.SearchHit;
import org.springframework.data.elasticsearch.core.SearchHits;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
......@@ -62,9 +77,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
private ElevatorServiceImpl iElevatorService;
@Autowired
private RepairConsultServiceImpl repairConsultService;
@Autowired
AlertCalledMapper alertCalledMapper;
@Autowired
......@@ -151,6 +163,22 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return alertCalledFormVo;
}
@Override
public List<AlertCalledQueryDto> queryAlertListByQueryDto(AlertCalledQueryDto alertCalledQueryDto) {
List<AlertCalledQueryDto> list = alertCalledMapper.queryAlertListByQueryDto(alertCalledQueryDto);
return list;
}
@Override
public Boolean updateAlertStageByAlertId(Long alertId, String alertStage) {
UpdateWrapper<AlertCalled> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("sequence_nbr",alertId);
AlertStageEnums stage = AlertStageEnums.getEnumByCode(alertStage);
updateWrapper.set("alert_stage_code",stage.getId());
updateWrapper.set("alert_stage",stage.getValue());
return this.update(updateWrapper);
}
/**
*
......
......@@ -198,7 +198,8 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
rescueProcessDto.setDispatchTime(dispatchPaper.getDispatchTime());
rescueProcessServiceImpl.updateByAlertId(rescueProcessDto,null);
}
// 修改警情到派遣阶段
alertCalledServiceImpl.updateAlertStageByAlertId(alertId,"PQ");
return dispatchPaperFormDto;
}
......@@ -317,6 +318,8 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
if(alertFormValue.getFieldValue() == null ) {
// 坐席回访
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchSaveFeedbackDto.getAlertId(),"JYHF",null,user);
// 修改警情到救援反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchSaveFeedbackDto.getAlertId(),"JYHF");
}
alertFormValue.setFieldValue(sdf.format(dispatchSaveFeedbackDto.getSaveFeedbackTime()));
}
......@@ -366,6 +369,8 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
throw new BadRequest("未找到反馈任务单");
}
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchSaveFeedbackDto.getAlertId(),"WXFK",taskId,user);
// 修改警情到维修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchSaveFeedbackDto.getAlertId(),"WXFK");
}
dispatchPaper.setFeedbackTime(dispatchSaveFeedbackDto.getFeedbackTime());
// 保存动态表单数据
......@@ -505,6 +510,8 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到报修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchRepairFeedbackDto.getAlertId(),"BXFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchRepairFeedbackDto.getAlertId(),"BXFK",taskId,user);
}
alertFormValue.setFieldValue(sdf.format(dispatchRepairFeedbackDto.getFixFeedbackTime()));
......@@ -572,6 +579,8 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到维修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchRepairFeedbackDto.getAlertId(),"WXFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchRepairFeedbackDto.getAlertId(),"WXFK",taskId,user);
}
dispatchPaper.setFeedbackTime(dispatchRepairFeedbackDto.getFeedbackTime());
......@@ -708,6 +717,8 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到投诉人反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchConsultFeedbackDto.getAlertId(),"TSRFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchConsultFeedbackDto.getAlertId(),"TSRFK",taskId,user);
}
alertFormValue.setFieldValue(sdf.format(dispatchConsultFeedbackDto.getConsultFeedbackTime()));
......@@ -762,6 +773,8 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到维修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchConsultFeedbackDto.getAlertId(),"WXFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchConsultFeedbackDto.getAlertId(),"WXFK-TS",taskId,user);
}
dispatchPaper.setFeedbackTime(dispatchConsultFeedbackDto.getFeedbackTime());
......
......@@ -200,12 +200,13 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
String createTime = sdf.format(alertCalledDto.getCallTime());
String rescueCode = alertCalledDto.getDeviceId();
String emergencyCall = alertCalledDto.getEmergencyCall();
String contactPhone = alertCalledDto.getContactPhone();
String emergencyCall = alertCalledDto.getEmergencyCall() == null ? "" : alertCalledDto.getEmergencyCall();
String contactPhone = alertCalledDto.getContactPhone() == null ? "" : alertCalledDto.getContactPhone();
// 电梯数据
Elevator elevator = elevatorServiceImpl.selectByAlertId(alertId);
String address = elevator.getAddress();
String useSiteCategory = elevator.getUseSiteCategory();
String address = elevator.getAddress() == null ? "" : elevator.getAddress();
String useSiteCategory = elevator.getUseSiteCategory() == null ? "" : elevator.getUseSiteCategory() ;
String useUnit = elevator.getUseUnit();
content = content.replace("$call_time",createTime).replace("$address",address).replace("$rescue_code",rescueCode).replace("$use_site_category",useSiteCategory);
String typeCode = "";
......@@ -230,22 +231,22 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
switch(alertTypeCode) {
case "KRJY" : // 困人救援
dispatchTaskDto.setIsSaveTask(true);
String trappedNum = dynamicParms.get("trapped_num");
String trappedFloorNum = dynamicParms.get("trapped_floor_num");
String isLight = dynamicParms.get("is_light");
String trappedTime = dynamicParms.get("trapped_time");
String trappedNum = dynamicParms.get("trapped_num") == null ? "" : dynamicParms.get("trapped_num");
String trappedFloorNum = dynamicParms.get("trapped_floor_num") == null ? "" : dynamicParms.get("trapped_floor_num");
String isLight = dynamicParms.get("is_light") == null ? "" : dynamicParms.get("is_light");
String trappedTime = dynamicParms.get("trapped_time") == null ? "" : dynamicParms.get("trapped_time");
content = content.replace("$trapped_num",trappedNum).replace("$trapped_floor_num",trappedFloorNum);
content = content.replace("$emergency_call",emergencyCall).replace("$contact_phone",contactPhone);
content = content.replace("$is_light",isLight).replace("$trapped_time",trappedTime);
break;
case "GZWX" : // 故障维修
dispatchTaskDto.setIsSaveTask(false);
desc = dynamicParms.get("desc");
desc = dynamicParms.get("desc") == null ? "" : dynamicParms.get("desc");
content = content.replace("$use_unit",useUnit).replace("$desc",desc);
break;
case "TSZX" : // 投诉咨询
dispatchTaskDto.setIsSaveTask(false);
desc = dynamicParms.get("desc");
desc = dynamicParms.get("desc") == null ? "" : dynamicParms.get("desc");
content = content.replace("$emergency_call",emergencyCall).replace("$contact_phone",contactPhone);
content = content.replace("$use_unit",useUnit).replace("$desc",desc);
break;
......
......@@ -93,11 +93,18 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
String emergency_call = alertCalledVo.getEmergencyCall();
String area = alertCalledVo.getAddress();
String alertType = alertCalledVo.getAlarmType();
if(createUser == null)
throw new BadRequest("坐席人缺失");
if(emergency_call == null)
throw new BadRequest("求援人缺失");
if(area == null)
throw new BadRequest("区域缺失");
if(alertType == null)
throw new BadRequest("警情类型缺失");
content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$call",emergency_call);
content = content.replace("$area",area).replace("$alertType",alertType);
} else if("PQ".equals(type)) {
String createUser = user.getUserName();
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String unit = dispatchTask.getResponseOrgName();
String person = dispatchTask.getResponseUserName();
......@@ -161,6 +168,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
}
});
content = content.replace("$FKFS",dispatchPaper.getFeedbackType()).replace("$fixResult",tempMap.get("fixResult"));
type = "WXFK";
} else if("BXFK".equals(type)) {
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName();
......@@ -192,7 +200,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
});
content = content.replace("$FKFS",tempMap.get("FKFS")).replace("$feedbackResult",tempMap.get("action_result"));
}
repairConsult.setType(type);
repairConsult.setType(AlertStageEnums.getEnumByCode(type).getId());
repairConsult.setAlertStageCode(AlertStageEnums.getEnumByCode(type).getId());
repairConsult.setAlertStatus(AlertStageEnums.getEnumByCode(type).getValue());
repairConsult.setDescription(content);
......
......@@ -16,4 +16,26 @@
ALTER TABLE p_point ADD COLUMN `last_check_id` varchar(32) DEFAULT NULL COMMENT '最近检查记录(漏检不算)' AFTER `original_id`;
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1628747347004-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point" columnName="building_id"/>
</not>
</preConditions>
<comment>p_point ADD COLUMN building_id 需求变更</comment>
<sql>
ALTER TABLE p_point ADD COLUMN `building_id` varchar(32) DEFAULT NULL COMMENT '所在建筑' AFTER `address`;
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1628747347004-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point" columnName="building_name"/>
</not>
</preConditions>
<comment>p_point ADD COLUMN building_name 需求变更</comment>
<sql>
ALTER TABLE p_point ADD COLUMN `building_name` varchar(255) DEFAULT NULL COMMENT '所在建筑名称' AFTER `building_id`;
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -230,6 +230,26 @@
and org_Code = #{orgCode}
</if>
</select>
<select id="queryInputItemInRountPoint" resultType="java.util.Map">
SELECT
pii.id,
pii.`name` inputName,
pii.item_type itemType,
pii.test_requirement testRequirement,
pii.data_json dataJson,
pii.is_must isMust,
pii.picture_json pictureJson,
pii.order_no orderNo,
prpi.id as routePointItemId
FROM
p_route_point_item prpi
LEFT JOIN p_point_inputitem ppii ON ppii.id = prpi.point_input_item_id
LEFT JOIN p_input_item pii ON pii.id = ppii.input_item_id
WHERE
prpi.route_point_id = #{routePointId}
ORDER BY
prpi.order_no
</select>
<insert id="insertList" parameterType="java.util.List">
INSERT INTO p_input_item (
`org_code`, `name`, `item_type`,
......
......@@ -336,28 +336,32 @@
where 1 = 1
<if test="planTaskId != null and planTaskId >0 "> and a.planTaskId = #{planTaskId} </if>
</select>
<select id="getPlanTaskPoints" resultType="Map">
SELECT
ptd.id,
p.name,
p.id pointId,
p.point_no pointNO,
p.offline,
p.point_no pointNo,
concat_ws(' ',p.building_name,p.address) as position,
p.belong_system_name as belongSystemName,
ptd.status,
ptd.is_finish finish,
p.is_fixed isFixed,
pt.route_id routeId,
ptd.is_finish as isFinish,
pt.route_id as routeId,
c.id checkId,
prp.order_no orderNo
prp.order_no orderNo,
prp.id as routePointId
FROM
p_plan_task_detail ptd
LEFT JOIN p_plan_task pt ON pt.id = ptd.task_no
LEFT JOIN p_point p ON p.id = ptd.point_id
LEFT JOIN p_check c ON c.plan_task_detail_id = ptd.id
LEFT JOIN p_route_point prp ON prp.point_id = ptd.point_id AND prp.route_id = pt.route_id
LEFT JOIN p_plan_task pt ON pt.id = ptd.task_no
LEFT JOIN p_point p ON p.id = ptd.point_id
LEFT JOIN p_check c ON c.plan_task_detail_id = ptd.id
LEFT JOIN p_route_point prp ON prp.point_id = ptd.point_id AND prp.route_id = pt.route_id
WHERE
p.is_delete = 0
<if test="planTaskId != null and planTaskId > 0 ">and pt.id = #{planTaskId}</if>
p.is_delete = 0 and pt.id = #{planTaskId}
<if test="buildingId != null and buildingId != ''">and find_in_set(p.building_id,#{buildingId})</if>
<if test="isFinish != null and isFinish != ''">and ptd.is_finish = #{isFinish}</if>
<if test="systemId != null and systemId != ''">and p.belong_system_id = #{systemId}</if>
<if test="pointNo != null and pointNo != ''">and p.point_no = #{pointNo}</if>
<if test="pointName != null and pointName != ''">and p.name like CONCAT ('%',#{pointName},'%')</if>
ORDER BY orderNo
</select>
......@@ -712,100 +716,6 @@
<if test="routeId != null">prp.route_id = #{routeId}</if>
<if test="pointId != null">and prp.point_id = #{pointId}</if>
</where>
<!--
SELECT
ii.*, pii.classify_ids, group_concat(ppc.name) classifyNames
FROM
p_input_item ii
LEFT JOIN p_point_inputitem pii ON pii.input_item_id = ii.id
LEFT JOIN p_point_classify ppc on pii.classify_ids REGEXP CONCAT(
'^',
ppc.id,
',|,',
ppc.id,
',|,',
ppc.id,
'$',
'|^',
ppc.id,
'$'
)
LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = pii.id,
(
SELECT
id AS route_point_id
FROM
p_route_point rp
<where>
<if test="routeId != null">route_id = #{routeId}</if>
<if test="pointId != null">and point_id = #{pointId}</if>
</where>
) prp
WHERE
prp.route_point_id = prpi.route_point_id
GROUP BY ii.id,
ii.org_code,
ii.name,
ii.order_no,
ii.item_type,
ii.is_must,
ii.is_score,
ii.default_value,
ii.is_multiline,
ii.catalog_id,
ii.input_json,
ii.data_json,
ii.remark,
ii.picture_json,
ii.create_by,
ii.create_date,
ii.is_delete,
ii.level
, pii.classify_ids
SELECT
*
FROM
p_point_inputitem
WHERE
id IN (
SELECT
point_input_item_id
FROM
p_route_point_item prpi,
(
SELECT
id AS route_point_id
FROM
p_route_point
<where>
<if test="routeId != null">route_id = #{routeId}</if>
<if test="pointId != null">and point_id = #{pointId}</if>
</where>
) prp
WHERE
prp.route_point_id = prpi.route_point_id
) -->
</select>
<select id="queryPointClassifyByRouteIdAndPointId" resultType="Map">
SELECT
ppc.id,
ppc.point_id pointId,
ppc.`name`,
ppc.order_no orderNo
FROM
`p_route_point_item` prpi
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id
LEFT JOIN p_point_classify ppc ON ppc.id = prpi.point_classify_id
WHERE
prp.route_id = #{routeId}
AND prp.point_id = #{pointId}
GROUP BY
ppc.id,
ppc.point_id,
ppc.`name`,
ppc.order_no
</select>
<select id="queryLeavePlanTask" resultMap="LeavePlanTaskMap">
......
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