安庆巡检_工艺巡检
一. 工艺配置
二. 点检计划
三. 点检任务
四. 复检任务
1. 复检列表
1.1 页面展示
2. 复检任务下发
2.1 操作说明
在异常管理页面操作栏中,可点击下发按钮弹出下发弹窗,选择复检人以及截止时间,确定后生成对应的复检任务
注意事项
1.下发按钮在任务复检已下发或者任务异常审核后变灰不可点击,复检已下发在复检人完成复检后解除灰色限制
2.下发的截止时间说明,超过截止时间后只会在告警通知生成逾期提醒,没有其他业务限制
2.2 业务说明
请求url
请求网址:
http://60.167.89.69:20186/prod-api/check/taskabnormal/recheckTask
请求方法:
POST
请求参数:
{
//ps_task_parameter点检任务参数表的id,该表记录了该参数点检值
"id": "38c9dbe0-20ab-4eff-b6fb-392a989c6f00",
"taskCode": "DJRW24082925990262",
"processId": "87e7eb15f98a4b09b9ca20be0636583b",
"parameterId": "048f2f8a-8bee-41c9-9a34-4ba42b590277",
"checkResult": "120",
"checkConclusion": 0,
"handleStatus": 0,
"status": 0,
"recordTime": "2024-08-29 14:33:26",
"recorder": "deng",
"processName": "半成品焊接",
"parameterName": "焊接参数",
"techId": "39e89ebe6fd74b8fbdaeae799404d0ce",
"techName": "焊接",//
//点检人nick的Name
"recorderName": "邓志雄",
//复检人的userName
"executor": "yuhai",
"contentDesc": "点检",
//复检任务截止时间,注意这是美国时间,有八小时差
"dueDate": "2024-09-06T00:59:48.000Z",
"type": 0
}
/**
* 工艺点检下发
*/
@ApiOperation("工艺点检异任务下发")
@RequiresPermissions("check:taskabnormal:send")
@Log(title = "工艺点检下发", businessType = BusinessType.UPDATE)
@PostMapping("/recheckTask")
public AjaxResult recheckTaskAbnormal(@RequestBody Map<String, Object> map) {
return toAjax(taskAbnormalService.recheckTaskAbnormal(map));
}
/**
* 下发任务
*
* @param map 工艺点检异常项
* @return 结果
*/
@Override
@Transactional
public int recheckTaskAbnormal(Map<String, Object> map) {
/**
* 1.获取基本信息
*/
//获取复检人userName
String executor = (String) map.get("executor");
//获取工艺参数点检详情的id
String taskParameterId = (String) map.get("id");
//获取复检截止时间
Date dueDate = DateUtils.dealDateFormat(map.get("dueDate"));
/**
* 2.判断该工艺参数点检是否已有下发的复检任务
*
*/
Integer taskAbnormals = taskAbnormalMapper.selectCountById(taskParameterId);
if (taskAbnormals > 0) {
throw new BaseException("无法重复下发");
}
/**
* 3. 构建复检任务
*/
//复检任务对象
RecheckTask recheckTask = new RecheckTask();
recheckTask.setId(UUID.randomUUID().toString());
recheckTask.setStatus(1);//0.待下发,未进行;1.已下发,进行中;2复检跳过;3复检完成
recheckTask.setStartDate(DateUtils.getNowDate());
recheckTask.setDueDate(dueDate);
recheckTask.setCreateBy(SecurityUtils.getUsername());
recheckTask.setTaskParameterId(taskParameterId);//关联工艺工序参数的点检详情id
recheckTask.setExecutor(executor);//复检人
//增加检测点、参数和任务编码
TaskAbnormal abnormal = taskAbnormalMapper.selectTaskAbnormalById(taskParameterId);
recheckTask.setTaskCode(abnormal.getTaskCode());//关联点检任务taskCode
recheckTask.setProcessId(abnormal.getProcessId());//关联 ps_process 工艺工序_详情表的id
recheckTask.setParameterId(abnormal.getParameterId());//关联 ps_parameter 工艺工序参数_详情表的id
recheckTaskMapper.insertRecheckTask(recheckTask);
/**
* 4.复检任务逾期提醒
*/
quartzService.recheckStartJob(recheckTask, SecurityConstants.INNER);
/**
* 5.下发消息
*/
MessagePush messagePush = new MessagePush();
messagePush.setPushUser(SecurityUtils.getUsername());
messagePush.setHandleUser(executor);
String content = "复检任务:" + abnormal.getProcessName() + "。截止时间:" + map.get("dueDate");
messagePush.setContent(content);
messagePush.setType("3");
messagePush.setTitle("复检任务");
messagePushService.insertMessagePush(messagePush);
return 1;
}
<select id="selectCountById" resultType="java.lang.Integer">
select count(1) from ps_recheck_task prt
left join ps_task_parameter ptp on prt.task_parameter_id = ptp.id
where prt.status=1 and ptp.id=#{id};
</select>
<select id="selectTaskAbnormalById" parameterType="String" resultMap="TaskAbnormalResult">
select a1.id,
a1.task_code,
a1.process_id,
a1.parameter_id,
a1.check_result,
a1.check_certificate,
a1.check_conclusion,
a1.remark,
a1.handle_status,
a1.handle_info,
a1.handler,
a1.handle_date,
a1.record_time,
a1.recorder,
a2.name processName,
a3.name parameterName,
a3.standard_value,
a4.name techName,
u1.nick_name handlerName,
u2.nick_name recorderName,
a3.check_type checkType,
pct.type type
from ps_task_parameter a1 -- 工艺参数点检详情
left join ps_process a2 on a1.process_id = a2.id
left join ps_parameter a3 on a1.parameter_id = a3.id
left join ps_tech a4 on a3.tech_id = a4.id
left join sys_user u1 on a1.handler = u1.user_name
left join sys_user u2 on a1.recorder = u2.user_name
left join ps_check_task pct on a1.task_code = pct.task_code
where a1.id = #{id}
</select>
<insert id="insertRecheckTask" parameterType="com.cjxjy.system.api.pojo.domain.RecheckTask">
insert into ps_recheck_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="taskCode != null">task_code,</if>
<if test="executor != null">executor,</if>
<if test="status != null">status,</if>
<if test="startDate != null">start_date,</if>
<if test="endDate != null">end_date,</if>
<if test="dueDate != null">due_date,</if>
<if test="createBy != null">create_by,</if>
<if test="taskParameterId != null">task_parameter_id,</if>
<if test="parameterId != null">parameter_id,</if>
<if test="processId != null">process_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="taskCode != null">#{taskCode},</if>
<if test="executor != null">#{executor},</if>
<if test="status != null">#{status},</if>
<if test="startDate != null">#{startDate},</if>
<if test="endDate != null">#{endDate},</if>
<if test="dueDate != null">#{dueDate},</if>
<if test="createBy != null">#{createBy},</if>
<if test="taskParameterId != null">#{taskParameterId},</if>
<if test="parameterId != null">#{parameterId},</if>
<if test="processId != null">#{processId},</if>
</trim>
</insert>
2.3 表关联说明
ps_task_parameter a1 -- 工艺工序参数_点检详情表
left join ps_process a2 --工艺工序参数_详情表
on a1.process_id = a2.id
left join ps_parameter a3 -- 工艺工序_详情表
on a1.parameter_id = a3.id
left join ps_tech a4 -- 工艺_详情表
on a3.tech_id = a4.id
left join ps_check_task pct --工艺点检表
on a1.task_code = pct.task_code
ps_task_parameter工艺工序参数_点检详情表
ps_process工艺工序_详情表
ps_parameter工艺工序参数_详情表
ps_tech工艺_详情表
ps_check_task工艺点检任务表
ps_recheck_task工艺工序参数_复检详情表
3. 复检详情
2.1 获取参数点检详情
请求网址:
http://10.168.2.118:8095/prod-api/check/taskabnormal/ce0f7367-2dd9-4580-b093-a5866fecf4fa
请求方法:
GET
参数说明:ps_task_parameter工艺工序参数点检表的id
2.2 获取复检详情列表
请求网址:
http://10.168.2.118:8095/prod-api/check/recheckParameter/recheck?id=a3ae1534-57b7-4763-b80d-6bfb4c1f9f6a
请求方法:
GET
参数说明
id为ps_task_parameter点检任务参数表的id
4. app端复检任务提交
4.1 请求
请求网址:
http://60.167.89.69:20051/check/recheckParameter
请求方法:
POST
请求参数
{
//ps_task_parameter点检参数表id
"taskParameterId": "13e3f229-aced-4270-b8b2-a957a89700aa",
//ps_recheck_task复检任务表id
"retaskId": "582642b9-6487-4d7f-b81b-d8b091aae9d1",
//复检任务状态,设置为3:已完成
"status": 3,
//点检参数录入值
"checkResult": "0.9",
//点检图片
"checkCertificate": "http://10.168.0.210:20003/jiuyuan-dongnan/recheck/2024/09/05/4ac3cc377d354b20b47e2bdf20e1ceb6.webp"
}
4.2 业务说明
/**
* 新增复检结果
*/
@ApiOperation("新增复检结果")
@RequiresPermissions("check:taskabnormal:add")
@Log(title = "复检结果", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody RetaskParameter retaskParameter) {
return toAjax(retaskParameterService.insertRetaskParameter(retaskParameter));
}