add 工单功能打印功能完善
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,4 +17,10 @@ public interface TemplateService extends IService<Template> {
|
||||
|
||||
|
||||
IPage<Template> query(Map param, PageQuery page);
|
||||
|
||||
/**
|
||||
* 删除单个或多个模板
|
||||
* @param ids
|
||||
*/
|
||||
void deleteBatchByIds(String[] ids);
|
||||
}
|
||||
|
||||
@@ -54,4 +54,8 @@ public class Template {
|
||||
@TableField(value = "false")
|
||||
private String printElements;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
}
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user