代码修改
This commit is contained in:
@@ -61,6 +61,9 @@ public class WorkorderDto implements Serializable {
|
|||||||
/** 回传MES状态 */
|
/** 回传MES状态 */
|
||||||
private String passback_status;
|
private String passback_status;
|
||||||
|
|
||||||
|
/** 设备编码 */
|
||||||
|
private String device_code;
|
||||||
|
|
||||||
/** 外部标识 */
|
/** 外部标识 */
|
||||||
private String ext_id;
|
private String ext_id;
|
||||||
|
|
||||||
|
|||||||
@@ -113,6 +113,12 @@ public class WorkorderServiceImpl implements WorkordeService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void create(WorkorderDto dto) {
|
public void create(WorkorderDto dto) {
|
||||||
|
Long device_id = dto.getDevice_id();
|
||||||
|
if (ObjectUtil.isNotEmpty(device_id)) {
|
||||||
|
WQLObject deviceTab = WQLObject.getWQLObject("PDM_BI_Device");
|
||||||
|
JSONObject object = deviceTab.query("device_id = '" + device_id + "'").uniqueResult(0);
|
||||||
|
dto.setDevice_code(object.getString("device_code"));
|
||||||
|
}
|
||||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
@@ -121,7 +127,6 @@ public class WorkorderServiceImpl implements WorkordeService {
|
|||||||
String newCode = CodeUtil.getNewCode("PDM_SHIFTORDER");
|
String newCode = CodeUtil.getNewCode("PDM_SHIFTORDER");
|
||||||
dto.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextId());
|
dto.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||||
dto.setWorkorder_code(newCode);
|
dto.setWorkorder_code(newCode);
|
||||||
dto.setOrder_status("1");
|
|
||||||
dto.setCreate_id(currentUserId);
|
dto.setCreate_id(currentUserId);
|
||||||
dto.setCreate_time(now);
|
dto.setCreate_time(now);
|
||||||
dto.setCreate_name(nickName);
|
dto.setCreate_name(nickName);
|
||||||
|
|||||||
@@ -51,16 +51,15 @@ public class CpOutTask extends AbstractAcsTask {
|
|||||||
throw new BadRequestException("已完成不能取消!");
|
throw new BadRequestException("已完成不能取消!");
|
||||||
}
|
}
|
||||||
String point_code2 = taskObj.getString("point_code2");
|
String point_code2 = taskObj.getString("point_code2");
|
||||||
String point_code3 = taskObj.getString("point_code3");
|
JSONObject point2Obj = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||||
//说明未二次申请过
|
|
||||||
if (ObjectUtil.isEmpty(point_code3)) {
|
|
||||||
JSONObject json = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0);
|
|
||||||
json.put("lock_type", "1");
|
|
||||||
pointTab.update(json);
|
|
||||||
}
|
|
||||||
taskObj.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
taskObj.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||||
taskObj.put("remark", "已取消");
|
taskObj.put("remark", "任务已取消");
|
||||||
taskTab.update(taskObj);
|
taskTab.update(taskObj);
|
||||||
|
// 释放终点点位
|
||||||
|
point2Obj.put("lock_type", "1");
|
||||||
|
point2Obj.put("point_status", "1");
|
||||||
|
pointTab.update(point2Obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("1".equals(status)) {
|
if ("1".equals(status)) {
|
||||||
@@ -228,5 +227,9 @@ public class CpOutTask extends AbstractAcsTask {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cancel(String task_id) {
|
public void cancel(String task_id) {
|
||||||
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
|
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(taskObj))
|
||||||
|
this.updateTaskStatus(taskObj,"0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,6 +168,22 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="工单状态">
|
||||||
|
<el-select
|
||||||
|
v-model="form.order_status"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
size="mini"
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 200px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.pdm_workorder_status"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="所属工序">
|
<el-form-item label="所属工序">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.workorder_procedure"
|
v-model="form.workorder_procedure"
|
||||||
|
|||||||
@@ -136,7 +136,7 @@
|
|||||||
v-permission="['admin','instruction:edit','instruction:del']"
|
v-permission="['admin','instruction:edit','instruction:del']"
|
||||||
fixed="right"
|
fixed="right"
|
||||||
label="操作"
|
label="操作"
|
||||||
width="120px"
|
width="160px"
|
||||||
align="center"
|
align="center"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -150,6 +150,11 @@
|
|||||||
icon="el-icon-success"
|
icon="el-icon-success"
|
||||||
@click="doOperate(scope.row, 'a')"
|
@click="doOperate(scope.row, 'a')"
|
||||||
>完成</el-button>
|
>完成</el-button>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-error"
|
||||||
|
@click="doOperate(scope.row, 'b')"
|
||||||
|
>取消</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|||||||
Reference in New Issue
Block a user