Browse Source

add 工单功能打印功能完善

master
周俊杰 1 month ago
parent
commit
4a04171237
  1. 7
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/primary_device/PrimaryDeviceConveyorDeviceDriver.java
  2. 8
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/template/TemplateController.java
  3. 6
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/template/TemplateService.java
  4. 4
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/template/dto/Template.java
  5. 10
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/template/impl/TemplateServiceImpl.java
  6. 28
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/tickets/dto/Tickets.java
  7. 41
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/tickets/impl/TicketsServiceImpl.java
  8. 28
      acs/nladmin-ui/src/api/acs/order/template.js
  9. 8
      acs/nladmin-ui/src/views/acs/order/app.vue
  10. 159
      acs/nladmin-ui/src/views/acs/order/index.vue
  11. 1
      acs/nladmin-ui/src/views/acs/order/template.vue

7
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/primary_device/PrimaryDeviceConveyorDeviceDriver.java

@ -222,13 +222,6 @@ public class PrimaryDeviceConveyorDeviceDriver extends AbstractOpcDeviceDriver i
putAction(list,map2, "to_qty", tickets.getPlanned_quantity());
Map map3 = new HashMap();
putAction(list,map3, "to_material_code", tickets.getProduction_materials());
if(StrUtil.isNotEmpty(tickets.getLabeling_qty()) && "1".equals(tickets.getLabeling_qty())){
Map map4 = new HashMap();
putAction(list,map4, "to_labeling", tickets.getLabeling_qty());
}else if(StrUtil.isNotEmpty(tickets.getLabeling_qty()) && "2".equals(tickets.getLabeling_qty())){
Map map5 = new HashMap();
putAction(list,map5, "to_labeling1", tickets.getLabeling_qty());
}
Map map6 = new HashMap();
putAction(list,map6, "to_ice", tickets.getIs_ice());
Map map7 = new HashMap();

8
acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/template/TemplateController.java

@ -53,4 +53,12 @@ public class TemplateController {
public ResponseEntity<Object> queryAll(@RequestParam Map param, PageQuery page) {
return new ResponseEntity<>(TableDataInfo.build(templateService.query(param, page)),HttpStatus.OK);
}
@DeleteMapping
@Log("删除模板")
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
templateService.deleteBatchByIds(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
}

6
acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/template/TemplateService.java

@ -17,4 +17,10 @@ public interface TemplateService extends IService<Template> {
IPage<Template> query(Map param, PageQuery page);
/**
* 删除单个或多个模板
* @param ids
*/
void deleteBatchByIds(String[] ids);
}

4
acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/template/dto/Template.java

@ -54,4 +54,8 @@ public class Template {
@TableField(value = "false")
private String printElements;
/**
* 是否删除
*/
private String is_delete;
}

10
acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/template/impl/TemplateServiceImpl.java

@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.nl.common.domain.query.PageQuery;
@ -17,6 +18,7 @@ import org.nl.common.utils.SecurityUtils;
import org.nl.system.service.template.TemplateService;
import org.nl.system.service.template.dto.Template;
import org.nl.system.service.template.dto.mapper.TemplateMapper;
import org.nl.system.service.tickets.dto.Tickets;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -68,4 +70,12 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> i
Page<Template> templatePage = this.page(new Page<>(page.getPage() + 1, page.getSize()), wrapper);
return templatePage;
}
@Override
public void deleteBatchByIds(String[] ids) {
if(ObjectUtil.isNotEmpty(ids)){
for (String id : ids) {
update(Wrappers.lambdaUpdate(Template.class).eq(Template::getTemplate_id,id).set(Template::getIs_delete,"0"));
}
}
}
}

28
acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/tickets/dto/Tickets.java

@ -70,9 +70,9 @@ public class Tickets {
*/
private String actual_end_time;
/**
* 贴标数量
* 纸箱装瓶数量
*/
private String labeling_qty;
private String carton_qty;
/**
* 所属客户
*/
@ -80,7 +80,24 @@ public class Tickets {
/**
* 是否装冰
*/
private String is_ice;
private Boolean is_ice;
/**
* 是否人工贴标
*/
private Boolean is_labeling;
/**
* 瓶身号
*/
private String bottle_number;
/**
* 纸箱号
*/
private String carton_number;
/**
* 纸箱类型
*/
private String carton_form;
/**
* 创建者
*/
@ -103,6 +120,9 @@ public class Tickets {
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private String update_time;
/**
* 贴标信息
*/
private String labeling_message;
}

41
acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/tickets/impl/TicketsServiceImpl.java

@ -89,13 +89,18 @@ public class TicketsServiceImpl extends ServiceImpl<TicketsMapper, Tickets> impl
String device_code = (String)param.get("device_code");
String production_orders = (String)param.get("production_orders");
String production_materials = (String)param.get("production_materials");
String labeling_message=(String)param.get("labeling_message");
String bottle_number=(String)param.get("bottle_number");
String carton_number=(String)param.get("carton_number");
String carton_form=(String)param.get("carton_form");
String carton_qty=(String)param.get("carton_qty");
String ticket_status=(String)param.get("ticket_status");
String planned_quantity = (String)param.get("planned_quantity");
String labeling_qty = (String)param.get("labeling_qty");
String customer = (String)param.get("customer");
if(StrUtil.isBlank(ticket_id) || StrUtil.isBlank(device_code) || StrUtil.isBlank(production_orders) || StrUtil.isNotEmpty((String)param.get("weight_ok")) ||
StrUtil.isBlank(production_materials) || StrUtil.isBlank(planned_quantity) || StrUtil.isBlank(labeling_qty) || StrUtil.isBlank(customer)){
throw new BadRequestException("参数不能为空");
}
// if(StrUtil.isBlank(ticket_id) || StrUtil.isBlank(device_code) || StrUtil.isBlank(production_orders) || StrUtil.isNotEmpty((String)param.get("weight_ok")) ||
// StrUtil.isBlank(production_materials) || StrUtil.isBlank(planned_quantity) || StrUtil.isBlank(planned_quantity) || StrUtil.isBlank(customer)){
// throw new BadRequestException("参数不能为空");
// }
Tickets tickets = BeanUtil.copyProperties(param, Tickets.class);
DateTime parse = DateUtil.parse(tickets.getStart_time());
DateTime startTime = parse.setTimeZone(TimeZone.getTimeZone(ZoneId.of("Asia/Shanghai")));
@ -107,21 +112,17 @@ public class TicketsServiceImpl extends ServiceImpl<TicketsMapper, Tickets> impl
tickets.setCreate_by(SecurityUtils.getCurrentUsername());
tickets.setCreate_time(DateUtil.now());
ticketsMapper.insert(tickets);
Param link_tickets = paramService.findByCode("link_tickets");
if(ObjectUtil.isEmpty(link_tickets))throw new BadRequestException("请在系统参数中添加工单号");
link_tickets.setValue(tickets.getTicket_code());
paramService.update(link_tickets);
String device_code1 = paramService.findByCode("device_code").getValue();
if(StrUtil.isNotBlank(device_code1)){
Device device = deviceAppService.findDeviceByCode(device_code1);
if(ObjectUtil.isEmpty(device))throw new BadRequestException("请在系统参数中添加设备");
if(device.getDeviceDriver() instanceof PrimaryDeviceConveyorDeviceDriver){
PrimaryDeviceConveyorDeviceDriver primary = (PrimaryDeviceConveyorDeviceDriver) device.getDeviceDriver();
if(primary.getMode() == 2 && primary.getStatus() == 1 && primary.getError() == 0){
primary.setSignal(tickets);
}
}
}
// String device_code1 = paramService.findByCode("device_code").getValue();
// if(StrUtil.isNotBlank(device_code1)){
// Device device = deviceAppService.findDeviceByCode(device_code1);
// if(ObjectUtil.isEmpty(device))throw new BadRequestException("请在系统参数中添加设备");
// if(device.getDeviceDriver() instanceof PrimaryDeviceConveyorDeviceDriver){
// PrimaryDeviceConveyorDeviceDriver primary = (PrimaryDeviceConveyorDeviceDriver) device.getDeviceDriver();
// if(primary.getMode() == 2 && primary.getStatus() == 1 && primary.getError() == 0){
// primary.setSignal(tickets);
// }
// }
// }
}
}

28
acs/nladmin-ui/src/api/acs/order/template.js

@ -1,18 +1,26 @@
import request from '@/utils/request'
export function savePdf(data) {
return request({
url: 'api/template',
method: 'post',
data
})
return request({
url: 'api/template',
method: 'post',
data
})
}
export function see(id) {
return request({
url: 'api/template/id?id=' + id,
method: 'get'
})
return request({
url: 'api/template/id?id=' + id,
method: 'get'
})
}
export default { savePdf, see }
export function del(ids) {
return request({
url: 'api/template/',
method: 'delete',
data: ids
})
}
export default { savePdf, see }

8
acs/nladmin-ui/src/views/acs/order/app.vue

@ -81,7 +81,7 @@
<el-table-column prop="template_status" label="模板状态" width="100px" />
<el-table-column prop="create_by" :label="$t('task.select.Creator')" :min-width="flexWidth('create_by',crud.data,$t('task.select.Creator'))" />
<el-table-column prop="create_time" :label="$t('task.select.Create_time')" :min-width="flexWidth('create_time',crud.data,$t('task.select.Create_time'))" />
<el-table-column v-permission="['admin','task:edit','task:del']" :label="$t('task.select.Operation')" width="80px" align="center" fixed="right">
<el-table-column v-permission="['admin','task:edit','task:del']" :label="$t('task.select.Operation')" width="80px" align="center" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
@ -91,7 +91,7 @@
修改
</el-button>
</template>
</el-table-column>
</el-table-column>
</el-table>
<pagination />
</div>
@ -131,8 +131,8 @@ export default {
data() {
return {
isModalVisible: false, //
modalWidth: 800, //
modalHeight: 600, //
modalWidth: 1100, //
modalHeight: 1000, //
printElements: [],
permission: {
add: ['admin', 'task:add'],

159
acs/nladmin-ui/src/views/acs/order/index.vue

@ -57,6 +57,22 @@
<el-form-item label="计划数量" prop="planned_quantity">
<el-input v-model="form.planned_quantity" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="贴标信息" prop="labeling_message">
<el-input v-model="form.labeling_message" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="瓶身号" prop="bottle_number">
<el-input v-model="form.bottle_number" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="纸箱号" prop="carton_number">
<el-input v-model="form.carton_number" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="纸箱类型" prop="carton_form">
<el-input v-model="form.carton_form" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="纸箱装瓶数量" prop="carton_qty">
<el-input v-model="form.carton_qty" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="计划开始时间">
<el-date-picker
v-model="form.start_time"
@ -84,15 +100,24 @@
<el-form-item label="实际结束时间">
<el-input v-model="form.device_code" style="width: 370px;" @change="isDisabled=false" />
</el-form-item> -->
<el-form-item label="贴标数量" prop="labeling_qty">
<!-- <el-form-item label="贴标数量" prop="labeling_qty">
<el-input v-model="form.labeling_qty" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
</el-form-item> -->
<el-form-item label="所属客户" prop="customer">
<el-input v-model="form.customer" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="是否装冰" prop="is_ice">
<el-input v-model="form.is_ice" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="是否加冰" prop="is_ice">
<el-radio-group v-model="form.is_ice" style="width: 240px">
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否人工贴标" prop="is_labeling">
<el-radio-group v-model="form.is_labeling" style="width: 240px">
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="合格重量" prop="weight_ok">
<el-input v-model="input1" placeholder="合格重量(g)" style="width: 170px;" @change="updateIsIce" />
<el-input v-model="input2" placeholder="误差范围(g)" style="width: 170px;" @change="updateIsIce" />
@ -136,6 +161,21 @@
</el-form-item>
<el-form-item label="计划数量" prop="planned_quantity">
<el-input v-model="form1.planned_quantity" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="贴标信息" prop="labeling_message">
<el-input v-model="form.labeling_message" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="瓶身号" prop="bottle_number">
<el-input v-model="form1.bottle_number" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="纸箱号" prop="carton_number">
<el-input v-model="form1.carton_number" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="纸箱类型" prop="carton_form">
<el-input v-model="form1.carton_form" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="纸箱装瓶数量" prop="carton_qty">
<el-input v-model="form1.carton_qty" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="计划开始时间">
<el-input v-model="form1.start_time" disabled style="width: 370px;" @change="isDisabled=false" />
@ -143,15 +183,24 @@
<el-form-item label="计划结束时间">
<el-input v-model="form1.end_time" disabled style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="贴标数量" prop="labeling_qty">
<!-- <el-form-item label="贴标数量" prop="labeling_qty">
<el-input v-model="form1.labeling_qty" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
</el-form-item> -->
<el-form-item label="所属客户" prop="customer">
<el-input v-model="form1.customer" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="是否装冰" prop="is_ice">
<el-input v-model="form1.is_ice" style="width: 370px;" @change="isDisabled=false" />
</el-form-item>
<el-form-item label="是否加冰" prop="is_ice">
<el-radio-group v-model="form.is_ice" style="width: 240px">
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否人工贴标" prop="is_labeling">
<el-radio-group v-model="form.is_labeling" style="width: 240px">
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="合格重量" prop="weight_ok">
<el-input v-model="input3" placeholder="合格重量(g)" style="width: 170px;" @change="updateIsIce1" />
<el-input v-model="input4" placeholder="误差范围(g)" style="width: 170px;" @change="updateIsIce1" />
@ -185,6 +234,11 @@
<el-table-column prop="device_code" label="设备" width="100px" />
<el-table-column prop="production_orders" label="生产订单" :min-width="flexWidth('production_orders',crud.data,'生产订单')" />
<el-table-column prop="production_materials" label="生产物料" :min-width="flexWidth('production_materials',crud.data,'生产物料')" />
<el-table-column prop="labeling_message" label="贴标信息" :min-width="flexWidth('labeling_message',crud.data,'贴标信息')" />
<el-table-column prop="bottle_number" label="瓶身号" :min-width="flexWidth('bottle_number',crud.data,'瓶身号')" />
<el-table-column prop="carton_number" label="纸箱号" :min-width="flexWidth('carton_number',crud.data,'纸箱号')" />
<el-table-column prop="carton_form" label="纸箱类型" :min-width="flexWidth('carton_form',crud.data,'纸箱类型')" />
<el-table-column prop="carton_qty" label="纸箱装瓶数量" :min-width="flexWidth('carton_qty',crud.data,'纸箱装瓶数量')" />
<el-table-column prop="ticket_status" label="状态" width="80px">
<template slot-scope="scope">
{{ getAgvSystemLabel(scope.row.ticket_status) }}
@ -196,9 +250,26 @@
<el-table-column prop="finish_qty" label="实际完成数量" :min-width="flexWidth('finish_qty',crud.data,'实际完成数量')" />
<el-table-column prop="actual_start_time" label="实际开始时间" :min-width="flexWidth('actual_start_time',crud.data,'实际开始时间')" />
<el-table-column prop="actual_end_time" label="实际结束时间" :min-width="flexWidth('actual_end_time',crud.data,'实际结束时间')" />
<el-table-column prop="labeling_qty" label="贴标数量" width="80px" />
<!-- <el-table-column prop="labeling_qty" label="贴标数量" width="80px" /> -->
<el-table-column prop="customer" label="所属客户" width="80px" />
<el-table-column prop="is_ice" label="是否装冰" width="80px" />
<el-table-column
prop="is_ice"
label="是否加冰"
:min-width="flexWidth('is_needmove',crud.data,'是否加冰')"
>
<template slot-scope="scope">
{{ scope.row.is_ice ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column
prop="is_labeling"
label="是否加冰"
:min-width="flexWidth('is_labeling',crud.data,'是否加冰')"
>
<template slot-scope="scope">
{{ scope.row.is_ice ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column prop="create_by" :label="$t('task.select.Creator')" :min-width="flexWidth('create_by',crud.data,$t('task.select.Creator'))" />
<el-table-column prop="create_time" :label="$t('task.select.Create_time')" :min-width="flexWidth('create_time',crud.data,$t('task.select.Create_time'))" />
<el-table-column v-permission="['admin','task:edit','task:del']" :label="$t('task.select.Operation')" width="80px" align="center" fixed="right">
@ -335,26 +406,37 @@ export default {
production_orders: null,
production_materials: null,
planned_quantity: null,
bottle_number: null,
carton_number: null,
carton_form: null,
carton_qty: null,
start_time: null,
end_time: null,
labeling_qty: null,
labeling_message: null,
customer: null,
is_ice: null,
is_labeling: null,
weight_ok: null,
ticket_status: null
},
form1: {
ticket_id: null,
ticket_code: null,
device_code: null,
production_orders: null,
production_materials: null,
planned_quantity: null,
bottle_number: null,
carton_number: null,
carton_form: null,
carton_qty: null,
start_time: null,
end_time: null,
labeling_qty: null,
labeling_message: null,
customer: null,
is_ice: null,
is_labeling: null,
weight_ok: null,
ticket_status: null
},
@ -386,9 +468,25 @@ export default {
planned_quantity: [
{ required: true, message: '计划数量不能为空', trigger: 'blur' }
],
labeling_qty: [
{ required: true, message: '贴标数量不能为空', trigger: 'blur' }
bottle_number: [
{ required: true, message: '瓶身号不能为空', trigger: 'blur' }
],
carton_number: [
{ required: true, message: '纸箱号不能为空', trigger: 'blur' }
],
carton_form: [
{ required: true, message: '纸箱类型不能为空', trigger: 'blur' }
],
carton_qty: [
{ required: true, message: '纸箱装瓶数量不能为空', trigger: 'blur' }
],
labeling_message: [
{ required: true, message: '贴标信息不能为空', trigger: 'blur' }
],
// labeling_qty: [
// { required: true, message: '', trigger: 'blur' }
// ],
customer: [
{ required: true, message: '所属客户不能为空', trigger: 'blur' }
]
@ -497,19 +595,24 @@ export default {
this.formDia = false
this.isDisabled = true
this.form = {
ticket_id: null,
ticket_code: null,
device_code: null,
production_orders: null,
production_materials: null,
planned_quantity: null,
start_time: null,
end_time: null,
labeling_qty: null,
customer: null,
is_ice: null,
weight_ok: null,
ticket_status: null
ticket_id: null,
device_code: null,
production_orders: null,
production_materials: null,
planned_quantity: null,
bottle_number: null,
carton_number: null,
carton_form: null,
carton_qty: null,
start_time: null,
end_time: null,
labeling_qty: null,
labeling_message: null,
customer: null,
is_ice: null,
is_labeling: null,
weight_ok: null,
ticket_status: null
}
})
this.extension = [{

1
acs/nladmin-ui/src/views/acs/order/template.vue

@ -161,6 +161,7 @@ export default {
this.hiprintTemplate = new hiprint.PrintTemplate({
settingContainer: '#PrintElementOptionSetting' //
})
this.hiprintTemplate.addPrintPanel({ width: 200, height: 300, paperFooter: 340, paperHeader: 10 });
//
this.hiprintTemplate.design('#hiprint-printTemplate')
//

Loading…
Cancel
Save