Commit cd145c4f authored by 张森's avatar 张森

巡检报告问题处理

parent 1e1c6b71
...@@ -309,12 +309,18 @@ public interface PlanTaskMapper extends BaseMapper { ...@@ -309,12 +309,18 @@ public interface PlanTaskMapper extends BaseMapper {
long countData(@Param(value="param") PlanTaskPageParam param); long countData(@Param(value="param") PlanTaskPageParam param);
long planTaskPageCount(@Param(value="param") PlanTaskPageParam param);
List<HashMap<String, Object>> planTaskByPage(@Param(value="param") PlanTaskPageParam param);
List<HashMap<String, Object>> planTaskPage(@Param(value="param") PlanTaskPageParam param); List<HashMap<String, Object>> planTaskPage(@Param(value="param") PlanTaskPageParam param);
Map<String, Object> getPlanTaskBasicInfo(@Param(value="taskDetailId") String taskDetailId); Map<String, Object> getPlanTaskBasicInfo(@Param(value="taskDetailId") String taskDetailId);
Map<String, Object> getPlanTaskExecuteInfo(@Param(value="taskDetailId") String taskDetailId); Map<String, Object> getPlanTaskExecuteInfo(@Param(value="taskDetailId") String taskDetailId);
Map<String, Object> getPlanTaskExecuteInfoByTaskId(@Param(value="taskId") String taskId);
List<String> getDefinitionObjCode(@Param(value="taskDetailId") String taskDetailId); List<String> getDefinitionObjCode(@Param(value="taskDetailId") String taskDetailId);
Map<String, Object> getDefectEquipInfo(@Param(value="id") String id); Map<String, Object> getDefectEquipInfo(@Param(value="id") String id);
...@@ -328,7 +334,16 @@ public interface PlanTaskMapper extends BaseMapper { ...@@ -328,7 +334,16 @@ public interface PlanTaskMapper extends BaseMapper {
List<Map<String, Object>> getCheckNotQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId); List<Map<String, Object>> getCheckNotQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId);
String getCheckIdByDetailId(@Param(value="taskDetailId") String taskDetailId);
List<String> getCheckIdByDetailId(@Param(value="taskDetailId") String taskDetailId);
List<Map<String, Object>> getCheckMissedPointInfo(@Param(value="taskDetailId") String taskDetailId);
List<String> getUserIdByTaskIds(@Param(value="taskDetailId") String taskDetailId);
List<Map<String, Object>> getCheckPointInfo(@Param(value="taskDetailId") String taskDetailId, @Param(value="status") String status);
String queryByCompanyCode(@Param("companyCode") String companyCode); String queryByCompanyCode(@Param("companyCode") String companyCode);
......
...@@ -90,4 +90,6 @@ public class DefectVo { ...@@ -90,4 +90,6 @@ public class DefectVo {
private String batchId; private String batchId;
@ApiModelProperty(value = "设备code") @ApiModelProperty(value = "设备code")
private String defectEquipmentCode; private String defectEquipmentCode;
@ApiModelProperty(value = "巡检检查记录ID")
private String checkId;
} }
...@@ -53,6 +53,23 @@ public class RemoteSecurityService { ...@@ -53,6 +53,23 @@ public class RemoteSecurityService {
@Autowired @Autowired
private IAMOSSecurityServer iAmosSecurityServer; private IAMOSSecurityServer iAmosSecurityServer;
//用户id批量获取用户信息
public List<AgencyUserModel> listUserByUserIdsAgencyUser(String userIds) {
Toke serverToken = getServerToken();
RequestContext.setAppKey(serverToken.getAppKey());
RequestContext.setProduct(serverToken.getProduct());
RequestContext.setToken(serverToken.getToke());
List<AgencyUserModel> agencyUserModel = null;
FeignClientResult feignClientResult;
try {
feignClientResult = Privilege.agencyUserClient.queryByIds(userIds, Boolean.TRUE);
agencyUserModel = (List<AgencyUserModel>) feignClientResult.getResult();
} catch (InnerInvokException e) {
e.printStackTrace();
}
return agencyUserModel;
}
//根据公司名称获取公司人 //根据公司名称获取公司人
public List<CompanyModel> listCompanyTree(String toke, String product, String appKey, String companyName) { public List<CompanyModel> listCompanyTree(String toke, String product, String appKey, String companyName) {
......
...@@ -1196,6 +1196,16 @@ ...@@ -1196,6 +1196,16 @@
</where> </where>
</select> </select>
<select id="getPlanTaskExecuteInfoByTaskId" resultType="java.util.Map">
SELECT
count(`status` = '1' or null) as qualified_equip_num,
count(`status` = '2' or null) as not_qualified_equip_num,
count(`status` = '3' or null) as missed_equip_num
FROM
p_plan_task_detail
where task_no = #{taskId}
</select>
<select id="getPlanTaskExecuteInfo" resultType="Map"> <select id="getPlanTaskExecuteInfo" resultType="Map">
SELECT SELECT
(SELECT (SELECT
...@@ -1338,7 +1348,45 @@ ...@@ -1338,7 +1348,45 @@
</select> </select>
<select id="getCheckIdByDetailId" resultType="java.lang.String"> <select id="getCheckIdByDetailId" resultType="java.lang.String">
select id from p_check where plan_task_detail_id = #{taskDetailId} limit 1 select id from p_check where plan_task_id = #{taskDetailId}
</select>
<select id="getCheckMissedPointInfo" resultType="Map">
SELECT
'漏检' AS result,
b.`name` as equipName,
b.area_name as equipPosition,
c.data_source_name AS remark
FROM
p_plan_task_detail a
left join p_point b on a.point_id = b.id
left join p_point_classify c on b.id = c.point_id
where a.task_no = #{taskDetailId}
and a.`status` = '3'
</select>
<select id="getUserIdByTaskIds" resultType="java.lang.String">
select DISTINCT(executor_id) from p_plan_task_detail where task_no = #{taskDetailId} and executor_id is not null and executor_id != ''
</select>
<select id="getCheckPointInfo" resultType="java.util.Map">
SELECT
'合格' AS result,
b.`name` as equipName,
b.area_name as equipPosition,
GROUP_CONCAT(d.`name`) as checkItem,
a.executor_date as checkDate,
a.executor_id as executorId,
e.id as checkId
FROM
p_plan_task_detail a
left join p_point b on a.point_id = b.id
left join p_point_inputitem c on a.point_id = c.point_id
left join p_input_item d on d.id = c.input_item_id
left join p_check e on a.id = e.plan_task_detail_id
where
a.task_no = #{taskDetailId}
and a.`status` = #{status}
group by a.id
</select> </select>
<select id="getStatics" resultType="java.util.Map"> <select id="getStatics" resultType="java.util.Map">
...@@ -1862,4 +1910,51 @@ ...@@ -1862,4 +1910,51 @@
GROUP BY GROUP BY
LEFT(t.org_code, 18) LEFT(t.org_code, 18)
</select> </select>
<select id="planTaskByPage" resultType="java.util.HashMap">
SELECT
a.plan_name AS taskName,
b.`name` AS routeName,
CAST(a.begin_time AS CHAR) AS beginTime,
CAST(a.end_time AS CHAR) AS endTime,
a.point_num AS checkedNum,
a.finish_num AS finishedNum,
( CASE a.finish_status WHEN 0 THEN '未开始' WHEN 1 THEN '进行中' WHEN 2 THEN '已结束' WHEN 3 THEN '已超时' END ) AS execution,
a.user_name AS executor,
CAST(a.id AS CHAR) AS taskDetailId,
CAST(a.id AS CHAR) AS planTaskId
FROM
`p_plan_task` a
LEFT JOIN p_route b ON b.id = a.route_id
<where>
<if test="param.beginDate != null and param.beginDate != '' "> and a.begin_time <![CDATA[>=]]> #{param.beginDate} </if>
<if test="param.endDate != null and param.endDate != ''"> and a.end_time <![CDATA[<=]]> #{param.endDate} </if>
<if test="param.taskName != null and param.taskName != ''"> and a.plan_name like concat('%',#{param.taskName},'%') </if>
<if test="param.status != null"> and a.`status` = #{param.status} </if>
<if test="param.routeId != null"> and a.route_id = #{param.routeId} </if>
<if test="param.bizOrgCode != null"> and a.org_code like concat(#{param.bizOrgCode},'%') </if>
</where>
ORDER BY
a.begin_time DESC
<choose>
<when test="param.pageSize==-1"></when>
<when test="param.pageSize!=-1">limit #{param.pageNumber}, #{param.pageSize}</when>
</choose>
</select>
<select id="planTaskPageCount" resultType="long">
SELECT
count(1)
FROM
`p_plan_task` a
LEFT JOIN p_route b ON b.id = a.route_id
<where>
<if test="param.beginDate != null and param.beginDate != '' "> and a.begin_time <![CDATA[>=]]> #{param.beginDate} </if>
<if test="param.endDate != null and param.endDate != ''"> and a.end_time <![CDATA[<=]]> #{param.endDate} </if>
<if test="param.taskName != null and param.taskName != ''"> and a.plan_name like concat('%',#{param.taskName},'%') </if>
<if test="param.status != null"> and a.`status` = #{param.status} </if>
<if test="param.routeId != null"> and a.route_id = #{param.routeId} </if>
<if test="param.bizOrgCode != null"> and a.org_code like concat(#{param.bizOrgCode},'%') </if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
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