opt:任务优先级

This commit is contained in:
zhangzhiqiang
2023-08-16 11:51:08 +08:00
parent 17fe0e6447
commit f23bb88d63
12 changed files with 112 additions and 54 deletions

View File

@@ -33,6 +33,11 @@ public class MpsSaleOrderIcExt implements Serializable {
*/ */
private String sale_id; private String sale_id;
/**
* 销售单编号
*/
private String sale_code;
/** /**
* 明细序号 * 明细序号
*/ */

View File

@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List; import java.util.List;
/** /**
@@ -46,6 +47,15 @@ public class MpsSaleOrderIcExtController {
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }
@PostMapping("/getQuery")
@Log("新增订单扩展表")
//("新增订单扩展表")
public ResponseEntity<Object> query(@RequestBody JSONObject whereJson) {
MpsSaleOrderIcExt one = extService.getOne(new QueryWrapper<MpsSaleOrderIcExt>()
.eq("sale_id", whereJson.getString("sale_id")).eq("material_code", whereJson.getString("material_code")));
return new ResponseEntity<>(one,HttpStatus.OK);
}
@PostMapping("/getExtList") @PostMapping("/getExtList")
@Log("根据工单获取条码") @Log("根据工单获取条码")
//("根据工单获取条码") //("根据工单获取条码")
@@ -62,13 +72,14 @@ public class MpsSaleOrderIcExtController {
}else { }else {
print_no = one.getPrint_no(); print_no = one.getPrint_no();
} }
List<String> barCodes = new ArrayList<>(); LinkedList<String> barCodes = new LinkedList<>();
for (int i =0;i<whereJson.getInteger("print_num");i++){ for (int i =0;i<whereJson.getInteger("print_num");i++){
String bar_code = whereJson.getString("workorder_code") + whereJson.getString("is_flip") + whereJson.getString("target_roadway") + String.format("%05d", print_no + i+1); String bar_code = whereJson.getString("workorder_code") + whereJson.getString("is_flip") + whereJson.getString("target_roadway") + String.format("%05d", print_no + i+1);
barCodes.add(bar_code); barCodes.add(bar_code);
} }
one.setPrint_no(print_no+whereJson.getInteger("print_num")); one.setPrint_no(print_no+whereJson.getInteger("print_num"));
one.setBar_code(barCodes.getLast());
if (one.getOrderext_id() == null){ if (one.getOrderext_id() == null){
one.setOrderext_id(IdUtil.getStringId()); one.setOrderext_id(IdUtil.getStringId());
extService.save(one); extService.save(one);
@@ -78,13 +89,5 @@ public class MpsSaleOrderIcExtController {
return new ResponseEntity<>(barCodes,HttpStatus.OK); return new ResponseEntity<>(barCodes,HttpStatus.OK);
} }
public static void main(String[] args) {
int print_no = 0;
for (int i =0;i<5;i++){
String bar_code = String.format("%05d", print_no + i+1);
System.out.println(bar_code);
}
System.out.println(print_no + 5);
}
} }

View File

@@ -120,7 +120,7 @@ public class EngraveSendEmpTask extends AbstractAcsTask {
task.put("is_send", true); task.put("is_send", true);
task.put("create_name", SecurityUtils.getCurrentNickName()); task.put("create_name", SecurityUtils.getCurrentNickName());
task.put("create_time", DateUtil.now()); task.put("create_time", DateUtil.now());
task.put("priority", "1"); task.put("priority", "7");
task.put("finished_type", "1"); task.put("finished_type", "1");
task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode()); task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode());
SchBaseTask schBaseTask = task.toJavaObject(SchBaseTask.class); SchBaseTask schBaseTask = task.toJavaObject(SchBaseTask.class);

View File

@@ -167,7 +167,7 @@ public class PlotterCallEmptyTask extends AbstractAcsTask {
task.put("update_name", SecurityUtils.getCurrentNickName()); task.put("update_name", SecurityUtils.getCurrentNickName());
task.put("create_time", DateUtil.now()); task.put("create_time", DateUtil.now());
task.put("update_time", DateUtil.now()); task.put("update_time", DateUtil.now());
task.put("priority", "1"); task.put("priority", "7");
task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode()); task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode());
task.put("table_fk_id", fk); task.put("table_fk_id", fk);
return task; return task;

View File

@@ -146,7 +146,7 @@ public class PlotterSendMaterialTask extends AbstractAcsTask {
task.put("is_send", true); task.put("is_send", true);
task.put("create_name", SecurityUtils.getCurrentNickName()); task.put("create_name", SecurityUtils.getCurrentNickName());
task.put("create_time", DateUtil.now()); task.put("create_time", DateUtil.now());
task.put("priority", "1"); task.put("priority", "7");
task.put("finished_type", "1"); task.put("finished_type", "1");
task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode()); task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode());
task.put("table_fk_id",order.getWorkorder_code()); task.put("table_fk_id",order.getWorkorder_code());

View File

@@ -168,7 +168,7 @@ public class WashCallEmptyTask extends AbstractAcsTask {
task.put("update_name", SecurityUtils.getCurrentNickName()); task.put("update_name", SecurityUtils.getCurrentNickName());
task.put("create_time", DateUtil.now()); task.put("create_time", DateUtil.now());
task.put("update_time", DateUtil.now()); task.put("update_time", DateUtil.now());
task.put("priority", "1"); task.put("priority", "8");
task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode()); task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode());
return task; return task;
} }

View File

@@ -137,7 +137,7 @@ public class WashMachineryTask extends AbstractAcsTask {
task.put("create_name", SecurityUtils.getCurrentNickName()); task.put("create_name", SecurityUtils.getCurrentNickName());
task.put("create_time", DateUtil.now()); task.put("create_time", DateUtil.now());
task.put("is_auto_issue", false); task.put("is_auto_issue", false);
task.put("priority", "1"); task.put("priority", "8");
task.put("task_step", 1); task.put("task_step", 1);
task.put("material_id",devices.get(0).getMaterial_id()); task.put("material_id",devices.get(0).getMaterial_id());
task.put("material_qty",devices.stream().mapToInt(a->a.getDeviceinstor_weight().intValue()).sum()); task.put("material_qty",devices.stream().mapToInt(a->a.getDeviceinstor_weight().intValue()).sum());

View File

@@ -133,7 +133,7 @@ public class WashSendMaterialQZTask extends AbstractAcsTask {
task.put("create_time", DateUtil.now()); task.put("create_time", DateUtil.now());
task.put("is_send",true); task.put("is_send",true);
task.put("is_auto_issue",false); task.put("is_auto_issue",false);
task.put("priority", "1"); task.put("priority", "8");
task.put("finished_type", "1"); task.put("finished_type", "1");
task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode()); task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode());
task.put("table_fk_id",washTask!=null?washTask.getTask_id():""); task.put("table_fk_id",washTask!=null?washTask.getTask_id():"");

View File

@@ -478,6 +478,7 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
SchBaseTask taskDao = iSchBaseTaskService.getById(task_id); SchBaseTask taskDao = iSchBaseTaskService.getById(task_id);
JSONArray param = new JSONArray(); JSONArray param = new JSONArray();
taskDao.setPriority("7");
param.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao))); param.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao)));
// 1.下发任务 // 1.下发任务
WmsToAcsService bean = SpringContextHolder.getBean(WmsToAcsService.class); WmsToAcsService bean = SpringContextHolder.getBean(WmsToAcsService.class);

View File

@@ -448,6 +448,7 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
SchBaseTask taskDao = iSchBaseTaskService.getById(task_id); SchBaseTask taskDao = iSchBaseTaskService.getById(task_id);
JSONArray param = new JSONArray(); JSONArray param = new JSONArray();
taskDao.setPriority("8");
param.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao))); param.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao)));
// 1.下发任务 // 1.下发任务

View File

@@ -17,7 +17,6 @@
v-model="query.one_box_package_qty" v-model="query.one_box_package_qty"
clearable clearable
size="small" size="small"
precision="0"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -26,7 +25,6 @@
<el-input-number <el-input-number
v-model="query.one_package_qty" v-model="query.one_package_qty"
clearable clearable
precision="0"
size="small" size="small"
/> />
</el-form-item> </el-form-item>
@@ -37,7 +35,6 @@
v-model="query.tray_full_num" v-model="query.tray_full_num"
clearable clearable
size="small" size="small"
precision="0"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -47,7 +44,6 @@
v-model="query.box_type" v-model="query.box_type"
clearable clearable
size="mini" size="mini"
placeholder="箱型"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -62,7 +58,6 @@
placeholder="请选择" placeholder="请选择"
class="filter-item" class="filter-item"
style="width: 180px;" style="width: 180px;"
@change="hand"
> >
<el-option <el-option
v-for="item in roadList" v-for="item in roadList"
@@ -81,7 +76,6 @@
placeholder="请选择" placeholder="请选择"
class="filter-item" class="filter-item"
style="width: 180px;" style="width: 180px;"
@change="hand"
> >
<el-option <el-option
v-for="item in dict.IS_OR_NOT" v-for="item in dict.IS_OR_NOT"
@@ -113,6 +107,7 @@
type="success" type="success"
icon="el-icon-printer" icon="el-icon-printer"
size="mini" size="mini"
:disabled="confirm_flag"
@click="print" @click="print"
> >
打印 打印
@@ -164,7 +159,6 @@
style="width: 200px;" style="width: 200px;"
:options="sects" :options="sects"
clearable clearable
@change="sectChange"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -268,6 +262,37 @@
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> <el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog
title="订单箱标签打印"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="400px"
:show-close="true"
@open="printFormm()"
@close="close()"
>
<el-form>
<el-form-item label="订单号" prop="pwd">
<el-input v-model="printForm.sale_code" type="text" style="width: 200px" />
</el-form-item>
<el-form-item label="物料编号" prop="pwd">
<el-input v-model="printForm.material_code" type="text" style="width: 200px" />
</el-form-item>
<el-form-item label="当前箱标签" prop="pwd">
<el-input v-model="printForm.bar_code" type="text" style="width: 200px" />
</el-form-item>
<el-form-item label="当前打印箱号" prop="pwd">
<el-input v-model="printForm.print_no" type="text" style="width: 100px" />
<el-button type="primary" @click="submit">重置箱号</el-button>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submit">确 定</el-button>
</span>
</el-dialog>
<!--表格渲染--> <!--表格渲染-->
<el-table <el-table
ref="table" ref="table"
@@ -351,7 +376,7 @@ import pagination from '@crud/Pagination'
import crudSectattr from '@/api/wms/basedata/st/sectattr' import crudSectattr from '@/api/wms/basedata/st/sectattr'
import crudProduceshiftorder from '@/views/wms/product_manage/workorder/produceshiftorder' import crudProduceshiftorder from '@/views/wms/product_manage/workorder/produceshiftorder'
import {getLodop} from '@/assets/js/lodop/LodopFuncs' import {getLodop} from '@/assets/js/lodop/LodopFuncs'
import orderExt from '@/views/wms/product_manage/workorder/orderExt' import orderExt from '@/views/wms/old_manage/old_package/orderExt'
const defaultForm = { const defaultForm = {
struct_id: null, struct_id: null,
@@ -435,6 +460,8 @@ export default {
} }
} }
return { return {
dialogVisible: false,
printForm: {},
sects: [], sects: [],
currentRow: null, currentRow: null,
invtypelist: [], invtypelist: [],
@@ -461,6 +488,7 @@ export default {
val[1] = form.sect_id val[1] = form.sect_id
form.cascader = val form.cascader = val
}, },
submit() {},
handleSelectionChange(val, row) { handleSelectionChange(val, row) {
if (val.length > 1) { if (val.length > 1) {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
@@ -508,7 +536,6 @@ export default {
this.crud.notify('缺少开工必要参数,保证输入框内不能为空!', CRUD.NOTIFICATION_TYPE.INFO) this.crud.notify('缺少开工必要参数,保证输入框内不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
return return
} }
debugger
this.currentRow.extra_map = this.crud.query this.currentRow.extra_map = this.crud.query
this.currentRow.extra_map.package_qty = Math.ceil(this.currentRow.plan_qty / this.currentRow.extra_map.one_package_qty) this.currentRow.extra_map.package_qty = Math.ceil(this.currentRow.plan_qty / this.currentRow.extra_map.one_package_qty)
this.currentRow.extra_map.box_num = Math.ceil(this.currentRow.extra_map.package_qty / this.currentRow.extra_map.one_box_package_qty) this.currentRow.extra_map.box_num = Math.ceil(this.currentRow.extra_map.package_qty / this.currentRow.extra_map.one_box_package_qty)
@@ -551,36 +578,49 @@ export default {
this.crud.notify('保存成功', CRUD.NOTIFICATION_TYPE.SUCCESS) this.crud.notify('保存成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}) })
}, },
print() { printFormm(){
debugger const param ={"sale_id":this.form.sale_id,"material_code":this.form.material_code}
if (!this.currentRow.workorder_code) { orderExt.getQuery(param).then(res => {
this.crud.notify('请选择一条工单记录进行打印', CRUD.NOTIFICATION_TYPE.INFO) if (res.length == 0 || !res) {
return this.crud.notify('该工单需要打印的箱数为0', CRUD.NOTIFICATION_TYPE.INFO)
} return
orderExt.getExtList(this.currentRow).then(res => { }
if (res.length == 0 || !res) {
this.crud.notify('该工单需要打印的箱数为0', CRUD.NOTIFICATION_TYPE.INFO)
return
}
res.forEach((item) => {
const LODOP = getLodop()
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
// 打印纸张大小设置https://www.it610.com/article/2094844.html
LODOP.SET_PRINT_PAGESIZE(1, '80mm', '50mm', '')
// LODOP.ADD_PRINT_RECT('0mm', '0mm', '48mm', '28mm', 0, 1)
LODOP.ADD_PRINT_BARCODE('10mm', '12mm', '60mm', '25mm', '128Auto', item.bar_code)
LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
LODOP.ADD_PRINT_TEXT('35mm', '22mm', '40mm', '20mm', item.bar_code.substring(0, 9))
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 20)
LODOP.ADD_PRINT_TEXT('42mm', '25mm', '40mm', '20mm', item.bar_code.substring(9, 16))
console.log(item.barcode)
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 20)
LODOP.PRINT()// 打印
// LODOP.PREVIEW()
})
}) })
this.crud.notify('打印成功', CRUD.NOTIFICATION_TYPE.SUCCESS) },
this.crud.toQuery() close(){
this.printForm = {},
this.dialogVisible =false
},
print(){
this.dialogVisible =true
// if (!this.currentRow.workorder_code) {
// this.crud.notify('请选择一条工单记录进行打印', CRUD.NOTIFICATION_TYPE.INFO)
// return
// }
// orderExt.getExtList(this.currentRow).then(res => {
// if (res.length == 0 || !res) {
// this.crud.notify('该工单需要打印的箱数为0', CRUD.NOTIFICATION_TYPE.INFO)
// return
// }
// res.forEach((item) => {
// const LODOP = getLodop()
// LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
// // 打印纸张大小设置https://www.it610.com/article/2094844.html
// LODOP.SET_PRINT_PAGESIZE(1, '80mm', '50mm', '')
// // LODOP.ADD_PRINT_RECT('0mm', '0mm', '48mm', '28mm', 0, 1)
// LODOP.ADD_PRINT_BARCODE('10mm', '12mm', '60mm', '25mm', '128Auto', item.bar_code)
// LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
// LODOP.ADD_PRINT_TEXT('35mm', '22mm', '40mm', '20mm', item.bar_code.substring(0, 9))
// LODOP.SET_PRINT_STYLEA(0, 'FontSize', 20)
// LODOP.ADD_PRINT_TEXT('42mm', '25mm', '40mm', '20mm', item.bar_code.substring(9, 16))
// console.log(item.barcode)
// LODOP.SET_PRINT_STYLEA(0, 'FontSize', 20)
// LODOP.PRINT()// 打印
// // LODOP.PREVIEW()
// })
// })
// this.crud.notify('打印成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
// this.crud.toQuery()
}, },
// 改变状态 // 改变状态
format_is_used(is_used) { format_is_used(is_used) {

View File

@@ -16,4 +16,12 @@ export function getExtList(data) {
}) })
} }
export default { add, getExtList } export function getQuery(data) {
return request({
url: 'api/mpsSaleOrderIcExt/getQuery',
method: 'post',
data
})
}
export default { add, getExtList, getQuery }