Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhangzhiqiang
2023-06-13 08:56:07 +08:00
30 changed files with 1014 additions and 417 deletions

View File

@@ -130,4 +130,28 @@ public class IStivtlostorivnCpInController {
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }
@PostMapping("/delTask")
@Log("删除任务")
@ApiOperation("删除任务")
public ResponseEntity<Object> delTask(@RequestBody JSONObject whereJson){
iStIvtIostorinvCpService.delTask(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/sendTask")
@Log("下发任务")
@ApiOperation("下发任务")
public ResponseEntity<Object> sendTask(@RequestBody JSONObject whereJson){
iStIvtIostorinvCpService.sendTask(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/confirmTask")
@Log("标识完成任务")
@ApiOperation("标识完成任务")
public ResponseEntity<Object> confirmTask(@RequestBody JSONObject whereJson){
iStIvtIostorinvCpService.confirmTask(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
} }

View File

@@ -117,5 +117,29 @@ public class IStivtlostorivnCpOutController {
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }
@PostMapping("/delTask")
@Log("删除任务")
@ApiOperation("删除任务")
public ResponseEntity<Object> delTask(@RequestBody JSONObject whereJson){
iStIvtIostorinvCpOutService.delTask(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/sendTask")
@Log("下发任务")
@ApiOperation("下发任务")
public ResponseEntity<Object> sendTask(@RequestBody JSONObject whereJson){
iStIvtIostorinvCpOutService.sendTask(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/confirmTask")
@Log("标识完成任务")
@ApiOperation("标识完成任务")
public ResponseEntity<Object> confirmTask(@RequestBody JSONObject whereJson){
iStIvtIostorinvCpOutService.confirmTask(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
} }

View File

@@ -151,4 +151,31 @@ public interface IStIvtIostorinvCpOutService extends IService<StIvtIostorinvCp>
* } * }
*/ */
void taskOperate(JSONObject whereJson); void taskOperate(JSONObject whereJson);
/**
* 删除任务
* @param whereJson
* {
* iostorinvdis_id 分配明细标识
* }
*/
void delTask(JSONObject whereJson);
/**
* 下发任务
* @param whereJson
* {
* task_id 任务标识
* }
*/
void sendTask(JSONObject whereJson);
/**
* 标识完成任务
* @param whereJson
* {
* task_id 任务标识
* }
*/
void confirmTask(JSONObject whereJson);
} }

View File

@@ -163,4 +163,30 @@ public interface IStIvtIostorinvCpService extends IService<StIvtIostorinvCp> {
*/ */
void taskOperate(JSONObject whereJson); void taskOperate(JSONObject whereJson);
/**
* 删除任务
* @param whereJson
* {
* iostorinvdis_id 分配明细标识
* }
*/
void delTask(JSONObject whereJson);
/**
* 下发任务
* @param whereJson
* {
* task_id 任务标识
* }
*/
void sendTask(JSONObject whereJson);
/**
* 标识完成任务
* @param whereJson
* {
* task_id 任务标识
* }
*/
void confirmTask(JSONObject whereJson);
} }

View File

@@ -4,6 +4,8 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -20,6 +22,8 @@ import org.nl.common.utils.IdUtil;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil; import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.masterdata_manage.MasterEnum; import org.nl.wms.masterdata_manage.MasterEnum;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbBucketrecordService; import org.nl.wms.masterdata_manage.service.vehicle.IMdPbBucketrecordService;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleextService; import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleextService;
@@ -584,6 +588,52 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
} }
} }
@Override
@Transactional(rollbackFor = Exception.class)
public void delTask(JSONObject whereJson) {
StIvtIostorinvdisCp disDao = iostorinvdisCpService.getById(whereJson.getString("iostorinvdis_id"));
// 1.删除任务
iSchBaseTaskService.update(
new UpdateWrapper<SchBaseTask>().lambda()
.set(SchBaseTask::getTask_status,TaskStatusEnum.CANCEL.getCode())
.eq(SchBaseTask::getTask_id, disDao.getTask_id())
);
// 2.更新分配
disDao.setTask_id("");
disDao.setPoint_code("");
disDao.setPoint_id("");
disDao.setPoint_name("");
disDao.setWork_status(IOSEnum.WORK_STATUS.code("未生成"));
iostorinvdisCpService.updateById(disDao);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void sendTask(JSONObject whereJson) {
SchBaseTask taskDao = iSchBaseTaskService.getById(whereJson.getString("task_id"));
JSONArray paramArr = new JSONArray();
paramArr.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao)));
// 1.下发任务
WmsToAcsService bean = SpringContextHolder.getBean(WmsToAcsService.class);
bean.issueTaskToAcs2(paramArr);
// 2.更新任务状态
taskDao.setTask_status(TaskStatusEnum.ISSUE.getCode());
iSchBaseTaskService.updateById(taskDao);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void confirmTask(JSONObject whereJson) {
whereJson.put("status", AcsTaskEnum.STATUS_FINISH.getCode());
taskOperate(whereJson);
}
@NotNull @NotNull
private StIvtIostorinvCp packageMstForm(StIvtIostorinvCp stIvtIostorinvCp,JSONObject whereJson,Boolean isUpdate) { private StIvtIostorinvCp packageMstForm(StIvtIostorinvCp stIvtIostorinvCp,JSONObject whereJson,Boolean isUpdate) {
JSONArray rows = whereJson.getJSONArray("tableData"); JSONArray rows = whereJson.getJSONArray("tableData");

View File

@@ -4,6 +4,8 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -17,10 +19,13 @@ import org.nl.common.domain.query.PageQuery;
import org.nl.common.enums.AcsTaskEnum; import org.nl.common.enums.AcsTaskEnum;
import org.nl.common.publish.BussEventMulticaster; import org.nl.common.publish.BussEventMulticaster;
import org.nl.common.publish.event.PointEvent; import org.nl.common.publish.event.PointEvent;
import org.nl.common.utils.AcsUtil;
import org.nl.common.utils.IdUtil; import org.nl.common.utils.IdUtil;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil; import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.masterdata_manage.MasterEnum; import org.nl.wms.masterdata_manage.MasterEnum;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbBucketrecordService; import org.nl.wms.masterdata_manage.service.vehicle.IMdPbBucketrecordService;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleextService; import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleextService;
@@ -707,6 +712,51 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
} }
} }
@Override
@Transactional(rollbackFor = Exception.class)
public void delTask(JSONObject whereJson) {
StIvtIostorinvdisCp disDao = iostorinvdisCpService.getById(whereJson.getString("iostorinvdis_id"));
// 1.删除任务
iSchBaseTaskService.update(
new UpdateWrapper<SchBaseTask>().lambda()
.set(SchBaseTask::getTask_status,TaskStatusEnum.CANCEL.getCode())
.eq(SchBaseTask::getTask_id, disDao.getTask_id())
);
// 2.更新分配
disDao.setTask_id("");
disDao.setPoint_code("");
disDao.setPoint_id("");
disDao.setPoint_name("");
disDao.setWork_status(IOSEnum.WORK_STATUS.code("未生成"));
iostorinvdisCpService.updateById(disDao);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void sendTask(JSONObject whereJson) {
SchBaseTask taskDao = iSchBaseTaskService.getById(whereJson.getString("task_id"));
JSONArray paramArr = new JSONArray();
paramArr.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao)));
// 1.下发任务
WmsToAcsService bean = SpringContextHolder.getBean(WmsToAcsService.class);
bean.issueTaskToAcs2(paramArr);
// 2.更新任务状态
taskDao.setTask_status(TaskStatusEnum.ISSUE.getCode());
iSchBaseTaskService.updateById(taskDao);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void confirmTask(JSONObject whereJson) {
whereJson.put("status", AcsTaskEnum.STATUS_FINISH.getCode());
taskOperate(whereJson);
}
@NotNull @NotNull
private StIvtIostorinvCp packageMstForm(StIvtIostorinvCp stIvtIostorinvCp,JSONObject whereJson,Boolean isUpdate) { private StIvtIostorinvCp packageMstForm(StIvtIostorinvCp stIvtIostorinvCp,JSONObject whereJson,Boolean isUpdate) {
JSONArray rows = whereJson.getJSONArray("tableData"); JSONArray rows = whereJson.getJSONArray("tableData");

View File

@@ -1,228 +1,261 @@
import request from '@/utils/request' import request from '@/utils/request'
export function add(data) { export function add(data) {
return request({ return request({
url: 'api/productOut', url: 'api/semiProductOut',
method: 'post', method: 'post',
data data
}) })
} }
export function del(ids) { export function del(ids) {
return request({ return request({
url: 'api/productOut/', url: 'api/semiProductOut/',
method: 'delete', method: 'delete',
data: ids data: ids
}) })
} }
export function edit(data) { export function edit(data) {
return request({ return request({
url: 'api/productOut', url: 'api/semiProductOut',
method: 'put', method: 'put',
data data
}) })
} }
export function getOutBillDtl(data) { export function getOutBillDtl(data) {
return request({ return request({
url: '/api/productOut/getOutBillDtl', url: '/api/semiProductOut/getOutBillDtl',
method: 'post', method: 'post',
data data
}) })
} }
export function getOutBillDis(data) { export function getOutBillDis(data) {
return request({ return request({
url: '/api/productOut/getOutBillDis', url: '/api/semiProductOut/getOutBillDis',
method: 'post', method: 'post',
data data
}) })
} }
export function getOutBillDisDtl(params) { export function getOutBillDisDtl(params) {
return request({ return request({
url: '/api/productOut/getOutBillDisDtl', url: '/api/semiProductOut/getOutBillDisDtl',
method: 'get', method: 'get',
params params
}) })
} }
export function getOutBillTask(params) { export function getOutBillTask(params) {
return request({ return request({
url: '/api/productOut/getOutBillTask', url: '/api/semiProductOut/getOutBillTask',
method: 'get', method: 'get',
params params
}) })
} }
export function getInvTypes() { export function getInvTypes() {
return request({ return request({
url: '/api/productOut/getInvTypes', url: '/api/semiProductOut/getInvTypes',
method: 'get' method: 'get'
}) })
} }
export function insertDtl(data) { export function insertDtl(data) {
return request({ return request({
url: '/api/productOut/insertDtl', url: '/api/semiProductOut/insertDtl',
method: 'post', method: 'post',
data data
}) })
} }
export function allDiv(data) { export function allDiv(data) {
return request({ return request({
url: '/api/productOut/allDiv', url: '/api/semiProductOut/allDiv',
method: 'post', method: 'post',
data data
}) })
} }
export function allDivOne(data) { export function allDivOne(data) {
return request({ return request({
url: '/api/productOut/allDivOne', url: '/api/semiProductOut/allDivOne',
method: 'post', method: 'post',
data data
}) })
} }
export function allCancel(data) { export function allCancel(data) {
return request({ return request({
url: '/api/productOut/allCancel', url: '/api/semiProductOut/allCancel',
method: 'post', method: 'post',
data data
}) })
} }
export function oneCancel(data) { export function oneCancel(data) {
return request({ return request({
url: '/api/productOut/oneCancel', url: '/api/semiProductOut/oneCancel',
method: 'post', method: 'post',
data data
}) })
} }
export function setPoint(data) { export function setPoint(data) {
return request({
url: '/api/productOut/setPoint', return request({
method: 'post', url: '/api/semiProductOut/setPoint',
data method: 'post',
}) data
})
} }
export function oneSetPoint(data) { export function oneSetPoint(data) {
return request({ return request({
url: '/api/productOut/oneSetPoint', url: '/api/semiProductOut/oneSetPoint',
method: 'post', method: 'post',
data data
}) })
} }
export function getStructIvt(params) { export function getStructIvt(params) {
return request({ return request({
url: '/api/productOut/getStructIvt', url: '/api/semiProductOut/getStructIvt',
method: 'get', method: 'get',
params params
}) })
} }
export function manualDiv(data) { export function manualDiv(data) {
return request({ return request({
url: '/api/productOut/manualDiv', url: '/api/semiProductOut/manualDiv',
method: 'post', method: 'post',
data data
}) })
} }
export function confirm(data) { export function confirm(data) {
return request({ return request({
url: '/api/productOut/confirm', url: '/api/semiProductOut/confirm',
method: 'post', method: 'post',
data data
}) })
} }
export function issueTask(data) { export function issueTask(data) {
return request({ return request({
url: '/api/productOut/issueTask', url: '/api/semiProductOut/issueTask',
method: 'post', method: 'post',
data data
}) })
} }
export function finishTask(data) { export function finishTask(data) {
return request({ return request({
url: '/api/productOut/finishTask', url: '/api/semiProductOut/finishTask',
method: 'post', method: 'post',
data data
}) })
} }
export function cancleTaskfinish(data) { export function cancleTaskfinish(data) {
return request({ return request({
url: '/api/productOut/cancleTaskfinish', url: '/api/semiProductOut/cancleTaskfinish',
method: 'post', method: 'post',
data data
}) })
} }
export function paramByCodeType(data) { export function paramByCodeType(data) {
return request({ return request({
url: '/api/productOut/paramByCodeType', url: '/api/semiProductOut/paramByCodeType',
method: 'post', method: 'post',
data data
}) })
} }
export function schAreaType(data) { export function schAreaType(data) {
return request({ return request({
url: '/api/productOut/schAreaType', url: '/api/semiProductOut/schAreaType',
method: 'post', method: 'post',
data data
}) })
} }
export function backConfirm(data) { export function backConfirm(data) {
return request({ return request({
url: '/api/productOut/backConfirm', url: '/api/semiProductOut/backConfirm',
method: 'post', method: 'post',
data data
}) })
} }
export function getType() { export function getType() {
return request({ return request({
url: '/api/productOut/getType', url: '/api/semiProductOut/getType',
method: 'get' method: 'get'
}) })
} }
export function moneySubmit(data) { export function moneySubmit(data) {
return request({ return request({
url: '/api/productOut/moneySubmit', url: '/api/semiProductOut/moneySubmit',
method: 'post', method: 'post',
data data
}) })
} }
export function getDisNum(data) { export function getDisNum(data) {
return request({ return request({
url: '/api/productOut/getDisNum', url: '/api/semiProductOut/getDisNum',
method: 'post', method: 'post',
data data
}) })
} }
export function queryBox(data) { export function queryBox(data) {
return request({ return request({
url: '/api/productOut/queryBox', url: '/api/semiProductOut/queryBox',
method: 'post', method: 'post',
data data
}) })
} }
export function getOutBillTask2(data) { export function getOutBillTask2(data) {
return request({ return request({
url: '/api/productOut/getOutBillTask2', url: '/api/semiProductOut/getOutBillTask2',
method: 'post', method: 'post',
data data
}) })
} }
export function cancelTask(data) { export function cancelTask(data) {
return request({ return request({
url: '/api/productOut/cancelTask', url: '/api/semiProductOut/cancelTask',
method: 'post', method: 'post',
data data
}) })
} }
export function allSetPoint(data) { export function allSetPoint(data) {
return request({ return request({
url: '/api/productOut/allSetPoint', url: '/api/semiProductOut/allSetPoint',
method: 'post', method: 'post',
data data
}) })
} }
export function oneSetPoint2(data) { export function oneSetPoint2(data) {
return request({ return request({
url: '/api/productOut/oneSetPoint2', url: '/api/semiProductOut/oneSetPoint2',
method: 'post', method: 'post',
data data
}) })
}
export default {
add,
edit,
del,
allDiv,
allCancel,
getOutBillDtl,
getOutBillDis,
setPoint,
oneSetPoint,
getOutBillTask,
getStructIvt,
manualDiv,
confirm,
issueTask,
finishTask,
cancleTaskfinish,
getInvTypes,
paramByCodeType,
schAreaType,
backConfirm,
getOutBillDisDtl,
getType,
allDivOne,
moneySubmit,
getDisNum,
queryBox,
getOutBillTask2,
oneCancel,
cancelTask,
allSetPoint,
oneSetPoint2
} }
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint, oneSetPoint2 }

View File

@@ -35,51 +35,34 @@
@row-click="clcikRow" @row-click="clcikRow"
> >
<el-table-column show-overflow-tooltip type="index" label="序号" align="center" /> <el-table-column show-overflow-tooltip type="index" label="序号" align="center" />
<el-table-column show-overflow-tooltip prop="bill_code" label="单据号" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" /> <el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" /> <el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" align="center" /> <el-table-column show-overflow-tooltip prop="pcsn" label="批次" align="center" />
<el-table-column show-overflow-tooltip prop="sap_pcsn" label="SAP批次" align="center" />
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" /> <el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
<el-table-column <el-table-column show-overflow-tooltip prop="assign_qty" :formatter="crud.formatNum3" label="已分配数量" align="center" />
show-overflow-tooltip
prop="assign_qty"
:formatter="crud.formatNum3"
label="已分配数量"
align="center"
/>
<el-table-column show-overflow-tooltip prop="unassign_qty" :formatter="crud.formatNum3" label="未分配数量" align="center" /> <el-table-column show-overflow-tooltip prop="unassign_qty" :formatter="crud.formatNum3" label="未分配数量" align="center" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位" align="center" /> <el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位" align="center" />
</el-table> </el-table>
</el-card> </el-card>
<el-card class="box-card" shadow="never" :body-style="{padding:'20px 20px 0 20px'}"> <!-- <el-card class="box-card" shadow="never" :body-style="{padding:'20px 20px 0 20px'}">
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini"> <el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini">
<el-form-item prop="checked"> <el-form-item prop="checked">
<el-checkbox v-model="form.checked" true-label="1" false-label="0" @change="checkedChange()">仅显示未完成的任务</el-checkbox> <el-checkbox v-model="form.checked" true-label="1" false-label="0" @change="checkedChange()">仅显示未完成的任务</el-checkbox>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>-->
<div class="crud-opts2"> <div class="crud-opts2">
<span class="role-span">入库单据任务项</span> <span class="role-span">入库单据任务项</span>
<span class="crud-opts-right2"> <span class="crud-opts-right2">
<!--左侧插槽--> <!--左侧插槽-->
<slot name="left" /> <slot name="left" />
<!-- <el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="updateTask()"
>
修改
</el-button>-->
<el-button <el-button
slot="left" slot="left"
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
:disabled="dis_del"
@click="delTask()" @click="delTask()"
> >
删除 删除
@@ -90,7 +73,8 @@
type="warning" type="warning"
icon="el-icon-check" icon="el-icon-check"
size="mini" size="mini"
@click="reIssueTask()" :disabled="dis_send"
@click="sendTask()"
> >
下发 下发
</el-button> </el-button>
@@ -100,20 +84,11 @@
type="warning" type="warning"
icon="el-icon-check" icon="el-icon-check"
size="mini" size="mini"
:disabled="dis_confirm"
@click="confirmTask()" @click="confirmTask()"
> >
标识完成 标识完成
</el-button> </el-button>
<!-- <el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="cancelTask()"
>
取消完成
</el-button>-->
</span> </span>
</div> </div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}"> <el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
@@ -130,33 +105,30 @@
@row-click="clcikDisRow" @row-click="clcikDisRow"
> >
<el-table-column width="60" prop="seq_no" label="序号" align="center" /> <el-table-column width="60" prop="seq_no" label="序号" align="center" />
<el-table-column width="150" prop="material_code" label="物料编码" align="center" /> <el-table-column show-overflow-tooltip width="150" prop="material_code" label="物料编码" align="center" />
<el-table-column width="150" prop="material_name" label="物料名称" align="center" /> <el-table-column show-overflow-tooltip width="150" prop="material_name" label="物料名称" align="center" />
<el-table-column width="170" prop="pcsn" label="子卷号" align="center" /> <el-table-column show-overflow-tooltip width="170" prop="pcsn" label="批次" align="center" />
<el-table-column width="120" prop="sap_pcsn" label="SAP批次" align="center" />
<el-table-column width="230" prop="box_no" label="木箱码" align="center" />
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" /> <el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
<el-table-column show-overflow-tooltip prop="struct_code" label="分配货位" align="center" /> <el-table-column show-overflow-tooltip prop="point_code1" label="起始位置" align="center" />
<el-table-column show-overflow-tooltip prop="work_status" label="指令状态" :formatter="statusFormat" align="center" /> <el-table-column show-overflow-tooltip prop="point_code2" label="目的位置" align="center" />
<el-table-column show-overflow-tooltip prop="task_code" label="指令操作号" align="center" /> <el-table-column show-overflow-tooltip prop="task_code" label="任务号" align="center" />
<el-table-column show-overflow-tooltip prop="point_code" label="入库点位编码" align="center" /> <el-table-column show-overflow-tooltip prop="task_status" label="任务状态" align="center" :formatter="formatStatus"/>
<el-table-column show-overflow-tooltip prop="point_name" label="入库点位名称" align="center" /> <el-table-column show-overflow-tooltip prop="task_type" label="任务类型" align="center" width="150px" :formatter="formatType"/>
</el-table> </el-table>
</el-card> </el-card>
<StructUpdateDiv :dialog-show.sync="structShow" :sect-prop="sectProp" :bucket-form="bucketForm" @updateCommit="updateCommit" />
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import CRUD, { crud } from '@crud/crud' import CRUD, { crud } from '@crud/crud'
import crudProductIn from '@/views/wms/storage_manage/product/productIn/productin'
export default { export default {
name: 'TaskDialog', name: 'TaskDialog',
components: { StructUpdateDiv }, components: {},
mixins: [crud()], mixins: [crud()],
dicts: ['io_bill_status', 'task_status'], dicts: ['SCH_TASK_TYPE_DTL', 'task_status'],
props: { props: {
dialogShow: { dialogShow: {
type: Boolean, type: Boolean,
@@ -173,23 +145,16 @@ export default {
data() { data() {
return { return {
dialogVisible2: false, dialogVisible2: false,
tableDtl: [],
stor_id: '',
sect_id: '',
sectProp: null,
structShow: false,
sects: [],
dis_row: null, dis_row: null,
dis_del: true,
dis_send: true,
dis_confirm: true,
fullscreenLoading: false, fullscreenLoading: false,
bucketParam: null,
bucketForm: null,
bucketDtlShow: false,
form: { form: {
tableMater: [], tableMater: [],
dtl_row: null, dtl_row: null,
checked: '1' checked: '1'
}, },
storlist: [],
rules: { rules: {
} }
} }
@@ -209,154 +174,81 @@ export default {
this.form.dtl_row = null this.form.dtl_row = null
this.$emit('AddChanged') this.$emit('AddChanged')
}, },
clcikRow(row) {
this.form.dtl_row = row
this.queryTableDdis()
},
clcikDisRow(row) {
debugger
this.dis_row = row
if (this.dis_row.task_status < 5) {
this.dis_del = false
this.dis_send = false
} else {
this.dis_del = true
this.dis_send = true
}
if (this.dis_row.task_status < 7) {
this.dis_confirm = false
} else {
this.dis_confirm = true
}
},
delTask() { delTask() {
if (!this.dis_row) {
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.dis_row.work_status !== '04') {
this.crud.notify('只能对状态为生成的任务进行删除!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.fullscreenLoading = true this.fullscreenLoading = true
crudRawAssist.delTask(this.dis_row).then(res => { crudProductIn.delTask({ 'iostorinvdis_id': this.dis_row.iostorinvdis_id }).then(res => {
this.crud.notify('删除成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.fullscreenLoading = false this.fullscreenLoading = false
crudRawAssist.queryTask(this.form.dtl_row).then(res => { this.queryTableDdis()
this.form.tableMater = res this.initFlag()
}).catch(() => {
this.fullscreenLoading = false
})
crudRawAssist.getIODtl({ 'bill_code': this.currentRow.bill_code, 'open_flag': '2' }).then(res => {
this.openParam = res
this.dis_row = null
this.crud.notify('删除任务成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
this.fullscreenLoading = false
})
}).catch(() => { }).catch(() => {
this.fullscreenLoading = false this.fullscreenLoading = false
}) })
}, },
statusFormat(row, column) { sendTask() {
return this.dict.label.task_status[row.work_status] this.fullscreenLoading = true
crudProductIn.sendTask({ 'task_id': this.dis_row.task_id }).then(res => {
this.crud.notify('下发成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.fullscreenLoading = false
this.queryTableDdis()
this.initFlag()
}).catch(() => {
this.fullscreenLoading = false
})
}, },
confirmTask() { confirmTask() {
if (!this.dis_row) {
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.dis_row.work_status === '99' || this.dis_row.work_status === '00') {
this.crud.notify('只能已生成或下发进行中的任务完成!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.fullscreenLoading = true this.fullscreenLoading = true
crudRawAssist.confirmTask(this.dis_row).then(res => { crudProductIn.confirmTask({ 'task_id': this.dis_row.task_id }).then(res => {
crudRawAssist.queryTask(this.form.dtl_row).then(res2 => { this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.form.tableMater = res2 this.fullscreenLoading = false
this.fullscreenLoading = false this.queryTableDdis()
this.crud.notify('强制确认任务成功!', CRUD.NOTIFICATION_TYPE.SUCCESS) this.initFlag()
}).catch(() => {
this.fullscreenLoading = false
})
}).catch(() => { }).catch(() => {
this.fullscreenLoading = false this.fullscreenLoading = false
}) })
}, },
cancelTask() {
if (!this.dis_row) {
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.dis_row.work_status !== '99') {
this.crud.notify('只能对状态为完成的任务进行取消!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.fullscreenLoading = true
crudRawAssist.cancelTask(this.dis_row).then(res => {
this.fullscreenLoading = false
crudRawAssist.queryTask(this.form.dtl_row).then(res2 => {
this.form.tableMater = res2
this.crud.notify('取消确认任务成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
this.fullscreenLoading = false
})
}).catch(() => {
this.fullscreenLoading = false
})
},
reIssueTask() {
if (!this.dis_row) {
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.dis_row.work_status !== '04') {
this.crud.notify('只能对状态为生成的任务进行下发!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.fullscreenLoading = true
crudRawAssist.reIssueTask(this.dis_row).then(res => {
this.fullscreenLoading = false
crudRawAssist.queryTask(this.form.dtl_row).then(res2 => {
this.form.tableMater = res2
this.crud.notify('下发任务成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
}).catch(() => {
this.fullscreenLoading = false
})
crudRawAssist.queryTask(this.form.dtl_row).then(res => {
this.form.tableMater = res
})
},
updateTask() {
if (!this.dis_row) {
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
return
}
debugger
if (this.dis_row.work_status !== '01') {
this.crud.notify('只能对状态为生成的任务进行修改!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.structShow = true
this.bucketForm = this.dis_row
},
updateCommit() {
crudRawAssist.queryTask(this.form.dtl_row).then(res => {
this.form.tableMater = res
this.crud.notify('修改任务成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
},
checkedChange(val) {
this.form.dtl_row.checked = this.form.checked
crudRawAssist.queryTask(this.form.dtl_row).then(res => {
this.form.tableMater = res
})
},
clcikRow(row, column, event) {
this.form.dtl_row = row
row.checked = this.form.checked
crudRawAssist.queryTask(row).then(res => {
this.form.tableMater = res
})
},
clcikDisRow(row, column, event) {
this.dis_row = row
},
assignFormat(row, column) {
if (!row.assign_qty) {
return '0'
} else {
return row.assign_qty
}
},
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
row.index = rowIndex row.index = rowIndex
}, },
bucketDtl(row) { queryTableDdis() {
crudRawAssist.bucketDtl(row).then(res => { if (this.form.dtl_row !== null) {
this.bucketParam = res crudProductIn.getIosInvDis({ 'iostorinvdtl_id': this.form.dtl_row.iostorinvdtl_id }).then(res => {
this.bucketDtlShow = true this.form.tableMater = res
}) }).catch(() => {
this.form.tableMater = []
})
}
},
formatStatus(row) {
return this.dict.label.task_status[row.task_status]
},
formatType(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.task_type]
},
initFlag() {
this.dis_del = true
this.dis_send = true
this.dis_confirm = true
} }
} }
} }

View File

@@ -141,17 +141,17 @@
> >
分配 分配
</el-button> </el-button>
<!-- <el-button <el-button
slot="right" slot="right"
class="filter-item" class="filter-item"
type="success" type="success"
:disabled="dis_flag" icon="el-icon-position"
icon="el-icon-position" size="mini"
size="mini" :disabled="task_flag"
@click="divOpen" @click="taskOpen"
> >
作业任务 作业任务
</el-button>--> </el-button>
<el-button <el-button
slot="right" slot="right"
class="filter-item" class="filter-item"
@@ -220,6 +220,7 @@
<AddDialog @AddChanged="querytable" /> <AddDialog @AddChanged="querytable" />
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" /> <ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
<DivDialog :dialog-show.sync="divShow" :stor-id="storId" :open-param="openParam" @AddChanged="querytable" /> <DivDialog :dialog-show.sync="divShow" :stor-id="storId" :open-param="openParam" @AddChanged="querytable" />
<TaskDialog :dialog-show.sync="taskShow" :open-param="taskOpenParam" />
</div> </div>
</template> </template>
@@ -237,10 +238,11 @@ import DivDialog from '@/views/wms/storage_manage/product/productIn/DivDialog'
import ViewDialog from '@/views/wms/storage_manage/product/productIn/ViewDialog' import ViewDialog from '@/views/wms/storage_manage/product/productIn/ViewDialog'
import crudStorattr, { getStor } from '@/views/wms/storage_manage/basedata/basedata' import crudStorattr, { getStor } from '@/views/wms/storage_manage/basedata/basedata'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import TaskDialog from '@/views/wms/storage_manage/product/productIn/TaskDialog'
export default { export default {
name: 'ProductIn', name: 'ProductIn',
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker, DivDialog }, components: { TaskDialog, ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker, DivDialog },
cruds() { cruds() {
return CRUD({ return CRUD({
title: '', title: '',
@@ -258,15 +260,18 @@ export default {
height: document.documentElement.clientHeight - 180 + 'px;', height: document.documentElement.clientHeight - 180 + 'px;',
permission: {}, permission: {},
dis_flag: true, dis_flag: true,
task_flag: true,
confirm_flag: true, confirm_flag: true,
disShow: false, disShow: false,
viewShow: false, viewShow: false,
mstrow: {}, mstrow: {},
divShow: false, divShow: false,
openParam: [], openParam: [],
taskOpenParam: [],
currentRow: null, currentRow: null,
storlist: [], storlist: [],
storId: null storId: null,
taskShow: false
} }
}, },
computed: { computed: {
@@ -320,12 +325,18 @@ export default {
} else { } else {
this.confirm_flag = true this.confirm_flag = true
} }
if (currentRow.bill_status !== '99') {
this.task_flag = false
} else {
this.task_flag = true
}
} }
}, },
handleCurrentChange(currentRow) { handleCurrentChange(currentRow) {
if (currentRow === null) { if (currentRow === null) {
this.dis_flag = true this.dis_flag = true
this.confirm_flag = true this.confirm_flag = true
this.task_flag = true
this.currentRow = {} this.currentRow = {}
} }
}, },
@@ -357,6 +368,12 @@ export default {
this.divShow = true this.divShow = true
}) })
}, },
taskOpen() {
crudProductIn.getIosInvDtl({ 'bill_code': this.currentRow.bill_code }).then(res => {
this.taskOpenParam = res
})
this.taskShow = true
},
querytable() { querytable() {
this.onSelectAll() this.onSelectAll()
this.crud.toQuery() this.crud.toQuery()

View File

@@ -104,6 +104,30 @@ export function cancelConfirmvehicle(data) {
}) })
} }
export function delTask(data) {
return request({
url: '/api/productIn/delTask',
method: 'post',
data
})
}
export function sendTask(data) {
return request({
url: '/api/productIn/sendTask',
method: 'post',
data
})
}
export function confirmTask(data) {
return request({
url: '/api/productIn/confirmTask',
method: 'post',
data
})
}
export default { export default {
add, add,
edit, edit,
@@ -117,5 +141,8 @@ export default {
unDivStruct, unDivStruct,
setPoint, setPoint,
confirm, confirm,
cancelConfirmvehicle cancelConfirmvehicle,
delTask,
sendTask,
confirmTask
} }

View File

@@ -0,0 +1,281 @@
<template>
<el-dialog
v-loading.fullscreen.lock="fullscreenLoading"
append-to-body
:visible.sync="dialogVisible2"
destroy-on-close
:show-close="false"
fullscreen
@close="close"
>
<span slot="title" class="dialog-footer">
<div class="crud-opts2">
<span class="el-dialog__title2">入库单任务操作</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button slot="left" type="info" @click="dialogVisible2 = false">关闭</el-button>
</span>
</div>
</span>
<div class="crud-opts2">
<span class="role-span">入库单据明细项</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table"
:data="this.openParam"
style="width: 100%;"
max-height="300"
border
highlight-current-row
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@row-click="clcikRow"
>
<el-table-column show-overflow-tooltip type="index" label="序号" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="pcsn" label="批次" align="center" />
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
<el-table-column show-overflow-tooltip prop="assign_qty" :formatter="crud.formatNum3" label="已分配数量" align="center" />
<el-table-column show-overflow-tooltip prop="unassign_qty" :formatter="crud.formatNum3" label="未分配数量" align="center" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位" align="center" />
</el-table>
</el-card>
<!-- <el-card class="box-card" shadow="never" :body-style="{padding:'20px 20px 0 20px'}">
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini">
<el-form-item prop="checked">
<el-checkbox v-model="form.checked" true-label="1" false-label="0" @change="checkedChange()">仅显示未完成的任务</el-checkbox>
</el-form-item>
</el-form>
</el-card>-->
<div class="crud-opts2">
<span class="role-span">入库单据任务项</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
:disabled="dis_del"
@click="delTask()"
>
删除
</el-button>
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
:disabled="dis_send"
@click="sendTask()"
>
下发
</el-button>
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
:disabled="dis_confirm"
@click="confirmTask()"
>
标识完成
</el-button>
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="disTable"
:data="form.tableMater"
style="width: 100%;"
max-height="300"
:row-class-name="tableRowClassName"
highlight-current-row
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@row-click="clcikDisRow"
>
<el-table-column width="60" prop="seq_no" label="序号" align="center" />
<el-table-column show-overflow-tooltip width="150" prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip width="150" prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip width="170" prop="pcsn" label="批次" align="center" />
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
<el-table-column show-overflow-tooltip prop="point_code1" label="起始位置" align="center" />
<el-table-column show-overflow-tooltip prop="point_code2" label="目的位置" align="center" />
<el-table-column show-overflow-tooltip prop="task_code" label="任务号" align="center" />
<el-table-column show-overflow-tooltip prop="task_status" label="任务状态" align="center" :formatter="formatStatus"/>
<el-table-column show-overflow-tooltip prop="task_type" label="任务类型" align="center" width="150px" :formatter="formatType"/>
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import crudProductOut from '@/views/wms/storage_manage/product/productOut/productout'
export default {
name: 'TaskDialog',
components: {},
mixins: [crud()],
dicts: ['SCH_TASK_TYPE_DTL', 'task_status'],
props: {
dialogShow: {
type: Boolean,
default: false
},
bussConfig: {
type: Object
},
openParam: {
type: Array,
default: () => { return [] }
}
},
data() {
return {
dialogVisible2: false,
dis_row: null,
dis_del: true,
dis_send: true,
dis_confirm: true,
fullscreenLoading: false,
form: {
tableMater: [],
dtl_row: null,
checked: '1'
},
rules: {
}
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible2 = newValue
}
}
},
methods: {
close() {
this.$emit('update:dialogShow', false)
this.form.tableMater = []
this.form.checked = '1'
this.form.dtl_row = null
this.$emit('AddChanged')
},
clcikRow(row) {
this.form.dtl_row = row
this.queryTableDdis()
},
clcikDisRow(row) {
debugger
this.dis_row = row
if (this.dis_row.task_status < 5) {
this.dis_del = false
this.dis_send = false
} else {
this.dis_del = true
this.dis_send = true
}
if (this.dis_row.task_status < 7) {
this.dis_confirm = false
} else {
this.dis_confirm = true
}
},
delTask() {
this.fullscreenLoading = true
crudProductOut.delTask({ 'iostorinvdis_id': this.dis_row.iostorinvdis_id }).then(res => {
this.crud.notify('删除成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.fullscreenLoading = false
this.queryTableDdis()
this.initFlag()
}).catch(() => {
this.fullscreenLoading = false
})
},
sendTask() {
this.fullscreenLoading = true
crudProductOut.sendTask({ 'task_id': this.dis_row.task_id }).then(res => {
this.crud.notify('下发成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.fullscreenLoading = false
this.queryTableDdis()
this.initFlag()
}).catch(() => {
this.fullscreenLoading = false
})
},
confirmTask() {
this.fullscreenLoading = true
crudProductOut.confirmTask({ 'task_id': this.dis_row.task_id }).then(res => {
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.fullscreenLoading = false
this.queryTableDdis()
this.initFlag()
}).catch(() => {
this.fullscreenLoading = false
})
},
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
},
queryTableDdis() {
if (this.form.dtl_row !== null) {
crudProductOut.getIosInvDis({ 'iostorinvdtl_id': this.form.dtl_row.iostorinvdtl_id }).then(res => {
this.form.tableMater = res
}).catch(() => {
this.form.tableMater = []
})
}
},
formatStatus(row) {
return this.dict.label.task_status[row.task_status]
},
formatType(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.task_type]
},
initFlag() {
this.dis_del = true
this.dis_send = true
this.dis_confirm = true
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size:20px;
color:#303133;
}
.crud-opts2 .role-span {
padding: 10px 0px 10px 0px;
}
.crud-opts2 .crud-opts-form {
padding: 10px 0px 0px 20px;
}
.input-with-select {
background-color: #fff;
}
</style>

View File

@@ -101,6 +101,17 @@
> >
分配 分配
</el-button> </el-button>
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
:disabled="task_flag"
@click="taskOpen"
>
作业任务
</el-button>
<el-button <el-button
slot="right" slot="right"
class="filter-item" class="filter-item"
@@ -170,6 +181,7 @@
<AddDialog @AddChanged="querytable" /> <AddDialog @AddChanged="querytable" />
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" /> <ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
<DivDialog :dialog-show.sync="divShow" :open-array="openParam" :stor-id="storId" :row-mst="mstrow" @DivChanged="querytable" /> <DivDialog :dialog-show.sync="divShow" :open-array="openParam" :stor-id="storId" :row-mst="mstrow" @DivChanged="querytable" />
<TaskDialog :dialog-show.sync="taskShow" :open-param="taskOpenParam" />
</div> </div>
</template> </template>
@@ -184,10 +196,11 @@ import AddDialog from '@/views/wms/storage_manage/product/productOut/AddDialog'
import DivDialog from '@/views/wms/storage_manage/product/productOut/DivDialog' import DivDialog from '@/views/wms/storage_manage/product/productOut/DivDialog'
import ViewDialog from '@//views/wms/storage_manage/product/productOut/ViewDialog' import ViewDialog from '@//views/wms/storage_manage/product/productOut/ViewDialog'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata' import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
import TaskDialog from '@/views/wms/storage_manage/product/productOut/TaskDialog'
export default { export default {
name: 'ProductOut', name: 'ProductOut',
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DivDialog }, components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DivDialog, TaskDialog },
cruds() { cruds() {
return CRUD({ title: '用户', idField: 'iostorinv_id', url: 'api/productOut', crudMethod: { ...productOut }, return CRUD({ title: '用户', idField: 'iostorinv_id', url: 'api/productOut', crudMethod: { ...productOut },
optShow: { optShow: {
@@ -209,10 +222,12 @@ export default {
edit: ['admin', 'checkoutbill:edit'], edit: ['admin', 'checkoutbill:edit'],
del: ['admin', 'checkoutbill:del'] del: ['admin', 'checkoutbill:del']
}, },
task_flag: true,
openMoneyDialog: false, openMoneyDialog: false,
loadingConfirm: false, loadingConfirm: false,
divShow: false, divShow: false,
taskShow: false, taskShow: false,
taskOpenParam: [],
dis_flag: true, dis_flag: true,
work_flag: true, work_flag: true,
confirm_flag: true, confirm_flag: true,
@@ -281,6 +296,11 @@ export default {
} else { } else {
this.confirm_flag = true this.confirm_flag = true
} }
if (current.bill_status !== '99') {
this.task_flag = false
} else {
this.task_flag = true
}
} }
}, },
stateFormat(row, column) { stateFormat(row, column) {
@@ -294,6 +314,7 @@ export default {
this.dis_flag = true this.dis_flag = true
this.confirm_flag = true this.confirm_flag = true
this.work_flag = true this.work_flag = true
this.task_flag = true
this.currentRow = {} this.currentRow = {}
} }
}, },
@@ -308,6 +329,12 @@ export default {
this.mstrow = this.currentRow this.mstrow = this.currentRow
}) })
}, },
taskOpen() {
productOut.getIosInvDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
this.taskOpenParam = res
})
this.taskShow = true
},
confirm() { confirm() {
this.loadingConfirm = true this.loadingConfirm = true
productOut.confirm({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => { productOut.confirm({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {

View File

@@ -88,6 +88,30 @@ export function manualDiv(data) {
}) })
} }
export function delTask(data) {
return request({
url: '/api/productOut/delTask',
method: 'post',
data
})
}
export function sendTask(data) {
return request({
url: '/api/productOut/sendTask',
method: 'post',
data
})
}
export function confirmTask(data) {
return request({
url: '/api/productOut/confirmTask',
method: 'post',
data
})
}
export default { export default {
add, add,
edit, edit,
@@ -99,5 +123,8 @@ export default {
setPoint, setPoint,
confirm, confirm,
getStructIvt, getStructIvt,
manualDiv manualDiv,
delTask,
sendTask,
confirmTask
} }

View File

@@ -0,0 +1,11 @@
package org.nl.acs.device_driver.basedriver.hailiang_one;
import org.nl.acs.instruction.service.dto.Instruction;
/**
* @author: geng by
* @createDate: 2023/6/9
*/
public interface RemoveDevicePhase {
public void set(int agvphase, int index, Instruction inst);
}

View File

@@ -15,6 +15,7 @@ import org.nl.acs.agv.server.impl.NDCAgvServiceImpl;
import org.nl.acs.auto.run.NDCSocketConnectionAutoRun; import org.nl.acs.auto.run.NDCSocketConnectionAutoRun;
import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.RemoveDevicePhase;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
@@ -41,7 +42,7 @@ import java.util.*;
@Slf4j @Slf4j
@Data @Data
@RequiredArgsConstructor @RequiredArgsConstructor
public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, RemoveDevicePhase {
protected ItemProtocol itemProtocol = new ItemProtocol(this); protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired @Autowired
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);

View File

@@ -12,8 +12,11 @@ import org.nl.acs.auto.run.NDCSocketConnectionAutoRun;
import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.MonitoringLargeScreenData; import org.nl.acs.device_driver.basedriver.hailiang_one.MonitoringLargeScreenData;
import org.nl.acs.device_driver.basedriver.hailiang_one.RemoveDevicePhase;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService; import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.dto.DeviceErrorLogDto; import org.nl.acs.history.service.dto.DeviceErrorLogDto;
@@ -39,7 +42,7 @@ import java.util.Map;
@Slf4j @Slf4j
@Data @Data
@RequiredArgsConstructor @RequiredArgsConstructor
public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, RemoveDevicePhase {
protected ItemProtocol itemProtocol = new ItemProtocol(this); protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired @Autowired
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
@@ -51,6 +54,8 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
@Autowired @Autowired
TaskService taskserver = SpringContextHolder.getBean(TaskService.class); TaskService taskserver = SpringContextHolder.getBean(TaskService.class);
@Autowired
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);
int mode = 0; int mode = 0;
//储料仓运行中 //储料仓运行中
@@ -140,10 +145,14 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
logServer.deviceExecuteLog(this.device_code, "", "", "信号is_open" + last_is_open + "->" + is_open); logServer.deviceExecuteLog(this.device_code, "", "", "信号is_open" + last_is_open + "->" + is_open);
} }
if (silo_weight != last_silo_weight) { if (silo_weight != last_silo_weight) {
Map<String, Integer> feedNumMap = new HashMap<>(); if (is_open == 1) {
feedNumMap.put("qty", this.getFull_number()); Map<String, Integer> feedNumMap = new HashMap<>();
feedNumMap.put("weight", this.getSilo_weight()); feedNumMap.put("qty", this.getFull_number());
MonitoringLargeScreenData.deviceNumData.put(this.device_code, feedNumMap); feedNumMap.put("weight", this.getSilo_weight());
Map<String, Map<String, Integer>> fm = new HashMap<>();
fm.put(this.device_code, feedNumMap);
acsToWmsService.feedDeviceNum2(fm);
}
logServer.deviceExecuteLog(this.device_code, "", "", "信号silo_weight" + last_silo_weight + "->" + silo_weight); logServer.deviceExecuteLog(this.device_code, "", "", "信号silo_weight" + last_silo_weight + "->" + silo_weight);
} }
if (full_number != last_full_number) { if (full_number != last_full_number) {
@@ -162,16 +171,16 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
//this.setIserror(true); //this.setIserror(true);
message = "信号量同步异常"; message = "信号量同步异常";
//未联机 //未联机
} /*else if (mode == 0) { } else if (mode == 0) {
message = "未联机"; message = "未联机";
} */ else { } else {
this.setIsonline(true); //this.setIsonline(true);
this.setIserror(false); //this.setIserror(false);
message = null; message = null;
//agv到达倒料点 //agv到达倒料点
if (agvphase == 0x0B || agvphase == 0x0F) { if (agvphase == 0x0B || agvphase == 0x0F) {
//判断储料仓联机、无故障、agv执行执行物料编号和上次倒料编号一致或者上次物料清空才允许倒料 //判断储料仓联机、无故障、agv执行执行物料编号和上次倒料编号一致或者上次物料清空才允许倒料
if (ObjectUtil.isNotEmpty(inst)) { if (mode == 1 && ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status(InstActionEnum.EXECUTE_TO_PUT_FALL_SEND_FULL.getCode()); inst.setExecute_status(InstActionEnum.EXECUTE_TO_PUT_FALL_SEND_FULL.getCode());
instructionService.update(inst); instructionService.update(inst);
byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0); byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0);
@@ -182,6 +191,9 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
logServer.deviceExecuteLog(device_code, "", "", this.messageInfo(agvphase)); logServer.deviceExecuteLog(device_code, "", "", this.messageInfo(agvphase));
} else { } else {
String notFeedAgvMessage = ""; String notFeedAgvMessage = "";
if (mode != 1) {
notFeedAgvMessage += "设备未联机,";
}
if (inst == null) { if (inst == null) {
notFeedAgvMessage += "AGV指令为空,"; notFeedAgvMessage += "AGV指令为空,";
} }
@@ -191,7 +203,7 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
//agv倒料完成 //agv倒料完成
if (agvphase == 0x0D || agvphase == 0x11) { if (agvphase == 0x0D || agvphase == 0x11) {
if (ObjectUtil.isNotEmpty(inst)) { if (mode == 1 && ObjectUtil.isNotEmpty(inst)) {
//下发储料仓倒料数量及开始称重 //下发储料仓倒料数量及开始称重
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("to_dumping_num", inst.getQuantity()); map.put("to_dumping_num", inst.getQuantity());
@@ -215,6 +227,9 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
logServer.deviceExecuteLog(device_code, "", "", this.messageInfo(agvphase)); logServer.deviceExecuteLog(device_code, "", "", this.messageInfo(agvphase));
} else { } else {
String notFeedAgvMessage = ""; String notFeedAgvMessage = "";
if (mode != 1) {
notFeedAgvMessage += "设备未联机,";
}
if (inst == null) { if (inst == null) {
notFeedAgvMessage += "AGV指令为空,"; notFeedAgvMessage += "AGV指令为空,";
} }

View File

@@ -17,6 +17,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.ApplyTaskTime; import org.nl.acs.device_driver.basedriver.hailiang_one.ApplyTaskTime;
import org.nl.acs.device_driver.basedriver.hailiang_one.IssuedDeviceOrderInfo; import org.nl.acs.device_driver.basedriver.hailiang_one.IssuedDeviceOrderInfo;
import org.nl.acs.device_driver.basedriver.hailiang_one.MonitoringLargeScreenData; import org.nl.acs.device_driver.basedriver.hailiang_one.MonitoringLargeScreenData;
import org.nl.acs.device_driver.basedriver.hailiang_one.RemoveDevicePhase;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
@@ -52,7 +53,7 @@ import java.util.concurrent.TimeUnit;
@Slf4j @Slf4j
@Data @Data
@RequiredArgsConstructor @RequiredArgsConstructor
public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, IssuedDeviceOrderInfo { public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, IssuedDeviceOrderInfo, RemoveDevicePhase {
protected ItemProtocol itemProtocol = new ItemProtocol(this); protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired @Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");

View File

@@ -140,8 +140,10 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
logServer.deviceExecuteLog(this.device_code, "", "", "信号order" + last_order + "->" + order); logServer.deviceExecuteLog(this.device_code, "", "", "信号order" + last_order + "->" + order);
} }
if (now_order_prod_num != last_now_order_prod_num) { if (now_order_prod_num != last_now_order_prod_num) {
if (mode == 1 && order > 0) { if (mode == 1 && order > 0 && order_prod_allnum > 0) {
MonitoringLargeScreenData.orderData.put(String.valueOf(order), now_order_prod_num); if (produceshiftorderService.findByCodeFromCache(String.valueOf(order)) != null) {
MonitoringLargeScreenData.orderData.put(String.valueOf(order), now_order_prod_num);
}
} }
logServer.deviceExecuteLog(this.device_code, "", "", "信号now_order_prod_num" + last_now_order_prod_num + "->" + now_order_prod_num); logServer.deviceExecuteLog(this.device_code, "", "", "信号now_order_prod_num" + last_now_order_prod_num + "->" + now_order_prod_num);
} }
@@ -329,8 +331,8 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
} else { } else {
map.put("to_confirm_finished", "1"); map.put("to_confirm_finished", "1");
} }
//map.put("to_order", "0"); map.put("to_order", "0");
//map.put("to_clear", "1"); map.put("to_clear", "1");
this.writing(map); this.writing(map);
} }

View File

@@ -11,6 +11,7 @@ import org.nl.acs.agv.server.impl.NDCAgvServiceImpl;
import org.nl.acs.auto.run.NDCSocketConnectionAutoRun; import org.nl.acs.auto.run.NDCSocketConnectionAutoRun;
import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.RemoveDevicePhase;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.ErrorUtil;
@@ -36,7 +37,7 @@ import java.util.HashMap;
@Slf4j @Slf4j
@Data @Data
@RequiredArgsConstructor @RequiredArgsConstructor
public class HailiangOldSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { public class HailiangOldSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, RemoveDevicePhase {
protected ItemProtocol itemProtocol = new ItemProtocol(this); protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired @Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");

View File

@@ -14,6 +14,7 @@ import org.nl.acs.auto.run.NDCSocketConnectionAutoRun;
import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.ApplyTaskTime; import org.nl.acs.device_driver.basedriver.hailiang_one.ApplyTaskTime;
import org.nl.acs.device_driver.basedriver.hailiang_one.RemoveDevicePhase;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
@@ -47,7 +48,7 @@ import java.util.concurrent.TimeUnit;
@Slf4j @Slf4j
@Data @Data
@RequiredArgsConstructor @RequiredArgsConstructor
public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, RemoveDevicePhase {
protected ItemProtocol itemProtocol = new ItemProtocol(this); protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired @Autowired
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
@@ -287,9 +288,9 @@ public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDevice
redisUtils.setExpire(this.device_code, null, ApplyTaskTime.APPLY_TIME, TimeUnit.SECONDS); redisUtils.setExpire(this.device_code, null, ApplyTaskTime.APPLY_TIME, TimeUnit.SECONDS);
//判断是否需要AGV搬运 需要就申请任务 不需要不申请 //判断是否需要AGV搬运 需要就申请任务 不需要不申请
ProduceshiftorderDto produceshiftorderDto = produceshiftorderService.findByCodeFromCache(String.valueOf(this.getOrder())); ProduceshiftorderDto produceshiftorderDto = produceshiftorderService.findByCodeFromCache(String.valueOf(this.getOrder()));
if (produceshiftorderDto == null) { // if (produceshiftorderDto == null) {
produceshiftorderDto = produceshiftorderService.findByCode(String.valueOf(this.getOrder())); // produceshiftorderDto = produceshiftorderService.findByCode(String.valueOf(this.getOrder()));
} // }
if (produceshiftorderDto != null && StrUtil.equals(produceshiftorderDto.getIs_needmove(), StatusEnum.NEED_MOVE.getCode())) { if (produceshiftorderDto != null && StrUtil.equals(produceshiftorderDto.getIs_needmove(), StatusEnum.NEED_MOVE.getCode())) {
JSONObject reqParam = new JSONObject(); JSONObject reqParam = new JSONObject();
reqParam.put("device_code", this.getDevice_code()); reqParam.put("device_code", this.getDevice_code());

View File

@@ -15,6 +15,7 @@ import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.ApplyTaskTime; import org.nl.acs.device_driver.basedriver.hailiang_one.ApplyTaskTime;
import org.nl.acs.device_driver.basedriver.hailiang_one.MonitoringLargeScreenData; import org.nl.acs.device_driver.basedriver.hailiang_one.MonitoringLargeScreenData;
import org.nl.acs.device_driver.basedriver.hailiang_one.RemoveDevicePhase;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
@@ -49,7 +50,7 @@ import java.util.concurrent.TimeUnit;
@Slf4j @Slf4j
@Data @Data
@RequiredArgsConstructor @RequiredArgsConstructor
public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, RemoveDevicePhase {
protected ItemProtocol itemProtocol = new ItemProtocol(this); protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired @Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");

View File

@@ -18,6 +18,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.ApplyTaskTime; import org.nl.acs.device_driver.basedriver.hailiang_one.ApplyTaskTime;
import org.nl.acs.device_driver.basedriver.hailiang_one.IssuedDeviceOrderInfo; import org.nl.acs.device_driver.basedriver.hailiang_one.IssuedDeviceOrderInfo;
import org.nl.acs.device_driver.basedriver.hailiang_one.MonitoringLargeScreenData; import org.nl.acs.device_driver.basedriver.hailiang_one.MonitoringLargeScreenData;
import org.nl.acs.device_driver.basedriver.hailiang_one.RemoveDevicePhase;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
@@ -53,7 +54,7 @@ import java.util.concurrent.TimeUnit;
@Slf4j @Slf4j
@Data @Data
@RequiredArgsConstructor @RequiredArgsConstructor
public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, IssuedDeviceOrderInfo { public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, IssuedDeviceOrderInfo, RemoveDevicePhase {
protected ItemProtocol itemProtocol = new ItemProtocol(this); protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired @Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");

View File

@@ -53,6 +53,8 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
@Autowired @Autowired
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl"); LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl");
int heartbeat = 0;
int mode = 0; int mode = 0;
int error = 0; int error = 0;
int now_one_box_num = 0; int now_one_box_num = 0;
@@ -63,6 +65,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
int order = 0; int order = 0;
int order_prod_allnum = 0; int order_prod_allnum = 0;
int last_heartbeat = 0;
int last_mode = 0; int last_mode = 0;
int last_error = 0; int last_error = 0;
int last_finish = 0; int last_finish = 0;
@@ -97,6 +100,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
public synchronized void execute() { public synchronized void execute() {
try { try {
device_code = this.getDeviceCode(); device_code = this.getDeviceCode();
heartbeat = this.itemProtocol.getHeartbeat();
error = this.itemProtocol.getError(); error = this.itemProtocol.getError();
order = this.itemProtocol.getOrder(); order = this.itemProtocol.getOrder();
mode = this.itemProtocol.getItem_mode(); mode = this.itemProtocol.getItem_mode();
@@ -137,6 +141,13 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
} }
if (order_compel_finish != last_order_compel_finish) { if (order_compel_finish != last_order_compel_finish) {
if (order_compel_finish == 1) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_confirm_finished", "1");
map.put("to_clear", "1");
map.put("to_order", "0");
this.writing(map);
}
luceneExecuteLogService.deviceExecuteLog(new LuceneLogDto(this.getDevice().getOpc_server_code(), this.getDevice().getOpc_plc_code(), this.device_code, ItemProtocol.item_order_compel_finish, String.valueOf(this.last_order_compel_finish), String.valueOf(this.order_compel_finish))); luceneExecuteLogService.deviceExecuteLog(new LuceneLogDto(this.getDevice().getOpc_server_code(), this.getDevice().getOpc_plc_code(), this.device_code, ItemProtocol.item_order_compel_finish, String.valueOf(this.last_order_compel_finish), String.valueOf(this.order_compel_finish)));
logServer.deviceExecuteLog(this.device_code, "", "", "信号order_compel_finish" + last_order_compel_finish + "->" + order_compel_finish); logServer.deviceExecuteLog(this.device_code, "", "", "信号order_compel_finish" + last_order_compel_finish + "->" + order_compel_finish);
} }
@@ -145,8 +156,10 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
logServer.deviceExecuteLog(this.device_code, "", "", "信号order" + last_order + "->" + order); logServer.deviceExecuteLog(this.device_code, "", "", "信号order" + last_order + "->" + order);
} }
if (now_order_prod_num != last_now_order_prod_num) { if (now_order_prod_num != last_now_order_prod_num) {
if (mode == 1 && order > 0) { if (mode == 1 && order > 0 && order_prod_allnum > 0) {
MonitoringLargeScreenData.orderData.put(String.valueOf(order), now_order_prod_num); if (produceshiftorderService.findByCodeFromCache(String.valueOf(order)) != null) {
MonitoringLargeScreenData.orderData.put(String.valueOf(order), now_order_prod_num);
}
} }
luceneExecuteLogService.deviceExecuteLog(new LuceneLogDto(this.getDevice().getOpc_server_code(), this.getDevice().getOpc_plc_code(), this.device_code, ItemProtocol.item_now_order_prod_num, String.valueOf(this.last_now_order_prod_num), String.valueOf(this.now_order_prod_num))); luceneExecuteLogService.deviceExecuteLog(new LuceneLogDto(this.getDevice().getOpc_server_code(), this.getDevice().getOpc_plc_code(), this.device_code, ItemProtocol.item_now_order_prod_num, String.valueOf(this.last_now_order_prod_num), String.valueOf(this.now_order_prod_num)));
logServer.deviceExecuteLog(this.device_code, "", "", "信号now_order_prod_num" + last_now_order_prod_num + "->" + now_order_prod_num); logServer.deviceExecuteLog(this.device_code, "", "", "信号now_order_prod_num" + last_now_order_prod_num + "->" + now_order_prod_num);
@@ -171,6 +184,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
feedDeviceStatusFlag = false; feedDeviceStatusFlag = false;
logServer.deviceExecuteLog(this.device_code, "", "", "信号isonline" + last_isonline + "->" + isonline); logServer.deviceExecuteLog(this.device_code, "", "", "信号isonline" + last_isonline + "->" + isonline);
} }
if (!this.itemProtocol.getIsonline() && !feedDeviceStatusFlag) { if (!this.itemProtocol.getIsonline() && !feedDeviceStatusFlag) {
JSONObject chm = new JSONObject(); JSONObject chm = new JSONObject();
chm.put("device_code", this.getDevice_code()); chm.put("device_code", this.getDevice_code());
@@ -189,7 +203,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
chm.put("error_code", String.valueOf(error)); chm.put("error_code", String.valueOf(error));
acsToWmsService.feedDeviceStatusType(chm); acsToWmsService.feedDeviceStatusType(chm);
feedDeviceStatusFlag = true; feedDeviceStatusFlag = true;
} else if (this.itemProtocol.getIsonline() && mode == 1 && order > 0 && !feedDeviceStatusFlag) { } else if (this.itemProtocol.getIsonline() && mode == 1 && order > 0 && order_prod_allnum > 0 && !feedDeviceStatusFlag) {
JSONObject chm = new JSONObject(); JSONObject chm = new JSONObject();
chm.put("device_code", this.getDevice_code()); chm.put("device_code", this.getDevice_code());
//设备生产中 //设备生产中
@@ -198,7 +212,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
chm.put("error_code", "0"); chm.put("error_code", "0");
acsToWmsService.feedDeviceStatusType(chm); acsToWmsService.feedDeviceStatusType(chm);
feedDeviceStatusFlag = true; feedDeviceStatusFlag = true;
} else if (this.itemProtocol.getIsonline() && mode == 0 && order > 0 && !feedDeviceStatusFlag) { } else if (this.itemProtocol.getIsonline() && mode == 0 && order > 0 && order_prod_allnum > 0 && !feedDeviceStatusFlag) {
JSONObject chm = new JSONObject(); JSONObject chm = new JSONObject();
chm.put("device_code", this.getDevice_code()); chm.put("device_code", this.getDevice_code());
//设备待生产 //设备待生产
@@ -230,7 +244,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
} }
//修改工单状态为自动完成 //修改工单状态为自动完成
if (mode == 1 && finish != last_finish && finish == 1 && order > 0 && now_order_prod_num == order_prod_allnum) { if (mode == 1 && finish != last_finish && finish == 1 && order_compel_finish != 1 && order > 0 && now_order_prod_num == order_prod_allnum) {
ProduceshiftorderDto pdto = produceshiftorderService.findByCodeFromCache(String.valueOf(order)); ProduceshiftorderDto pdto = produceshiftorderService.findByCodeFromCache(String.valueOf(order));
if (pdto != null) { if (pdto != null) {
if (pdto.getOrder_status().equals(WorkerOrderEnum.PRODUCTING.getCode())) { if (pdto.getOrder_status().equals(WorkerOrderEnum.PRODUCTING.getCode())) {
@@ -269,6 +283,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
last_line_stock_num = line_stock_num; last_line_stock_num = line_stock_num;
last_order_prod_allnum = order_prod_allnum; last_order_prod_allnum = order_prod_allnum;
last_isonline = isonline; last_isonline = isonline;
last_heartbeat = heartbeat;
} }
@@ -299,12 +314,12 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) { if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
map.put("to_order_compel_finished", "1"); map.put("to_order_compel_finished", "1");
map.put("to_confirm_finished", "1"); //map.put("to_confirm_finished", "1");
} else { } else {
map.put("to_confirm_finished", "1"); map.put("to_confirm_finished", "1");
map.put("to_order", "0");
map.put("to_clear", "1");
} }
//map.put("to_order", "0");
//map.put("to_clear", "1");
this.writing(map); this.writing(map);
} }

View File

@@ -11,6 +11,7 @@ import org.nl.acs.agv.server.impl.NDCAgvServiceImpl;
import org.nl.acs.auto.run.NDCSocketConnectionAutoRun; import org.nl.acs.auto.run.NDCSocketConnectionAutoRun;
import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.RemoveDevicePhase;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.ErrorUtil;
@@ -35,7 +36,7 @@ import java.util.HashMap;
@Slf4j @Slf4j
@Data @Data
@RequiredArgsConstructor @RequiredArgsConstructor
public class HailiangSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { public class HailiangSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, RemoveDevicePhase {
protected ItemProtocol itemProtocol = new ItemProtocol(this); protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired @Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");

View File

@@ -14,6 +14,7 @@ import org.nl.acs.auto.run.NDCSocketConnectionAutoRun;
import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.ApplyTaskTime; import org.nl.acs.device_driver.basedriver.hailiang_one.ApplyTaskTime;
import org.nl.acs.device_driver.basedriver.hailiang_one.RemoveDevicePhase;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
@@ -47,7 +48,7 @@ import java.util.concurrent.TimeUnit;
@Slf4j @Slf4j
@Data @Data
@RequiredArgsConstructor @RequiredArgsConstructor
public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, RemoveDevicePhase {
protected ItemProtocol itemProtocol = new ItemProtocol(this); protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired @Autowired
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
@@ -291,9 +292,9 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
//判断是否需要AGV搬运 需要就申请任务 不需要不申请 //判断是否需要AGV搬运 需要就申请任务 不需要不申请
JSONObject reqParam = new JSONObject(); JSONObject reqParam = new JSONObject();
ProduceshiftorderDto produceshiftorderDto = produceshiftorderService.findByCodeFromCache(String.valueOf(this.getOrder())); ProduceshiftorderDto produceshiftorderDto = produceshiftorderService.findByCodeFromCache(String.valueOf(this.getOrder()));
if (produceshiftorderDto == null) { // if (produceshiftorderDto == null) {
produceshiftorderDto = produceshiftorderService.findByCode(String.valueOf(this.getOrder())); // produceshiftorderDto = produceshiftorderService.findByCode(String.valueOf(this.getOrder()));
} // }
if (produceshiftorderDto != null && StrUtil.equals(produceshiftorderDto.getIs_needmove(), StatusEnum.NEED_MOVE.getCode())) { if (produceshiftorderDto != null && StrUtil.equals(produceshiftorderDto.getIs_needmove(), StatusEnum.NEED_MOVE.getCode())) {
reqParam.put("type", StatusEnum.FULL_REQ.getCode()); reqParam.put("type", StatusEnum.FULL_REQ.getCode());
reqParam.put("device_code", this.getDevice_code()); reqParam.put("device_code", this.getDevice_code());

View File

@@ -15,6 +15,7 @@ import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.ApplyTaskTime; import org.nl.acs.device_driver.basedriver.hailiang_one.ApplyTaskTime;
import org.nl.acs.device_driver.basedriver.hailiang_one.MonitoringLargeScreenData; import org.nl.acs.device_driver.basedriver.hailiang_one.MonitoringLargeScreenData;
import org.nl.acs.device_driver.basedriver.hailiang_one.RemoveDevicePhase;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
@@ -49,7 +50,7 @@ import java.util.concurrent.TimeUnit;
@Slf4j @Slf4j
@Data @Data
@RequiredArgsConstructor @RequiredArgsConstructor
public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, RemoveDevicePhase {
protected ItemProtocol itemProtocol = new ItemProtocol(this); protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired @Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");

View File

@@ -54,6 +54,14 @@ public interface AcsToWmsService {
*/ */
HttpResponse feedDeviceNum(Map<String, Map<String,Integer>> map); HttpResponse feedDeviceNum(Map<String, Map<String,Integer>> map);
/**
* 反馈储料仓料口数量
*
* @param map
* @return
*/
HttpResponse feedDeviceNum2(Map<String, Map<String,Integer>> map);
/** /**
* 申请扫码器任务 * 申请扫码器任务

View File

@@ -201,6 +201,33 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} }
} }
@Override
public HttpResponse feedDeviceNum2(Map<String, Map<String, Integer>> map) {
try {
MDC.put(log_file_type, log_type);
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
log.info("acs开始向mes反馈储料仓重量和数量,请求参数:{}", JSON.toJSONString(map));
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("feedDeviceNum2");
String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url;
HttpResponse result = null;
try {
result = HttpRequest.post(url)
.body(JSON.toJSONString(map))
.execute();
log.info("acs向mes反馈储料仓重量和数量成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, JSON.toJSONString(result));
} catch (Exception e) {
log.error("acs向mes反馈储料仓重量和数量失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(map), url, e.getMessage());
}
return result;
}
return null;
} finally {
MDC.remove(log_file_type);
}
}
@Override @Override
public HttpResponse applyScannerTask(JSONObject map) { public HttpResponse applyScannerTask(JSONObject map) {
try { try {

View File

@@ -18,6 +18,7 @@ import org.nl.acs.agv.server.XianGongAgvService;
import org.nl.acs.auto.initial.ApplicationAutoInitial; import org.nl.acs.auto.initial.ApplicationAutoInitial;
import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device.service.impl.DeviceServiceImpl; import org.nl.acs.device.service.impl.DeviceServiceImpl;
import org.nl.acs.device_driver.basedriver.hailiang_one.RemoveDevicePhase;
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_auto_cache_line.HailiangAutoCacheLineDeviceDriver; import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_auto_cache_line.HailiangAutoCacheLineDeviceDriver;
import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver;
import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver;
@@ -1431,20 +1432,24 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
Device start_device = deviceAppService.findDeviceByCode(start_point_code); Device start_device = deviceAppService.findDeviceByCode(start_point_code);
Device next_device = deviceAppService.findDeviceByCode(next_point_code); Device next_device = deviceAppService.findDeviceByCode(next_point_code);
Device put_device = deviceAppService.findDeviceByCode(put_point_code); Device put_device = deviceAppService.findDeviceByCode(put_point_code);
HailiangAutoCacheLineDeviceDriver hailiangAutoCacheLineDeviceDriver; RemoveDevicePhase removeDevicePhase;
if (put_device != null && put_device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { if (put_device != null && put_device.getDeviceDriver() instanceof RemoveDevicePhase) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) put_device.getDeviceDriver(); removeDevicePhase = (RemoveDevicePhase) put_device.getDeviceDriver();
hailiangAutoCacheLineDeviceDriver.set(0, 0, null); removeDevicePhase.set(0, 0, null);
if (hailiangAutoCacheLineDeviceDriver.getTask() != 0 && hailiangAutoCacheLineDeviceDriver.getTask() == Integer.parseInt(dto.getInstruction_code())) { // if (hailiangAutoCacheLineDeviceDriver.getTask() != 0 && hailiangAutoCacheLineDeviceDriver.getTask() == Integer.parseInt(dto.getInstruction_code())) {
hailiangAutoCacheLineDeviceDriver.writing("to_task_finish", "1"); // hailiangAutoCacheLineDeviceDriver.writing("to_task_finish", "1");
} // }
} }
if (start_device != null && next_device != null && start_device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver && next_device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { if (start_device != null && start_device.getDeviceDriver() instanceof RemoveDevicePhase) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) start_device.getDeviceDriver(); removeDevicePhase = (RemoveDevicePhase) start_device.getDeviceDriver();
hailiangAutoCacheLineDeviceDriver.set(0, 0, null); removeDevicePhase.set(0, 0, null);
if (hailiangAutoCacheLineDeviceDriver.getTask() != 0 && hailiangAutoCacheLineDeviceDriver.getTask() == Integer.parseInt(dto.getInstruction_code())) { // if (hailiangAutoCacheLineDeviceDriver.getTask() != 0 && hailiangAutoCacheLineDeviceDriver.getTask() == Integer.parseInt(dto.getInstruction_code())) {
hailiangAutoCacheLineDeviceDriver.writing("to_task_finish", "1"); // hailiangAutoCacheLineDeviceDriver.writing("to_task_finish", "1");
} // }
}
if (next_device != null && next_device.getDeviceDriver() instanceof RemoveDevicePhase) {
removeDevicePhase = (RemoveDevicePhase) put_device.getDeviceDriver();
removeDevicePhase.set(0, 0, null);
} }
} }
} }

View File

@@ -94,7 +94,7 @@ public class AutoCreateInst {
Device device = deviceAppService.findDeviceByCode(put_device_code); Device device = deviceAppService.findDeviceByCode(put_device_code);
if (device != null && device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { if (device != null && device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver(); hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
if (hailiangAutoCacheLineDeviceDriver.getTask() != 0 || instructionService.findInstByDeviceCode(put_device_code) != null) { if (hailiangAutoCacheLineDeviceDriver.getMode() != 1 || hailiangAutoCacheLineDeviceDriver.getTask() != 0 || instructionService.findInstByDeviceCode(put_device_code) != null) {
continue; continue;
} }
} }
@@ -105,7 +105,7 @@ public class AutoCreateInst {
Device device = deviceAppService.findDeviceByCode(start_device_code); Device device = deviceAppService.findDeviceByCode(start_device_code);
if (device != null && device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { if (device != null && device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver(); hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
if (hailiangAutoCacheLineDeviceDriver.getTask() != 0 || instructionService.findInstByDeviceCode(start_device_code) != null) { if (hailiangAutoCacheLineDeviceDriver.getMode() != 1 || hailiangAutoCacheLineDeviceDriver.getTask() != 0 || instructionService.findInstByDeviceCode(start_device_code) != null) {
continue; continue;
} }
} }
@@ -143,7 +143,7 @@ public class AutoCreateInst {
Device device = deviceAppService.findDeviceByCode(taskDto1.getPut_device_code()); Device device = deviceAppService.findDeviceByCode(taskDto1.getPut_device_code());
if (device != null && device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { if (device != null && device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver(); hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
if (hailiangAutoCacheLineDeviceDriver.getTask() != 0 || instructionService.findInstByDeviceCode(taskDto1.getPut_device_code()) != null) { if (hailiangAutoCacheLineDeviceDriver.getMode() != 1 || hailiangAutoCacheLineDeviceDriver.getTask() != 0 || instructionService.findInstByDeviceCode(taskDto1.getPut_device_code()) != null) {
continue; continue;
} }
} }