Commit 5392ff01 authored by 温志超's avatar 温志超

更新打印

parent 1a31ae75
package com.ximai.mes.pro.domain.task;
import com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class TaskProWorkorderPrintData extends ProWorkorder {
private int size;
private String date;
private BigDecimal quantity;
}
......@@ -270,6 +270,8 @@ public class ProWorkorderServiceImpl implements IProWorkorderService {
} else {
Long workorderId = proWorkorderVo.getWorkorderId();
ProWorkorderVo workorder = proWorkorderService.selectProWorkorderByWorkorderId(workorderId);
ExceptionUtil.checkTrueThrowException(workorder.getStatus().equals(WorkorderStatusEnum.PUBLISHED.getValue()), MessageUtils.message("pro.workOrder.status.published.error"));
int ret = proWorkorderService.updateProWorkorderWithBomAndProcess(proWorkorderVo);
//判断bom和工序是否有主键id,有则修改,无则新增
......
......@@ -429,8 +429,8 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
query.le(proTaskWorkunit.getScheduleEndDateTo() != null, "ptw.schedule_start_date", proTaskWorkunit.getScheduleEndDateTo());
query.eq(StringUtils.isNotEmpty(proTaskWorkunit.getArrangeCode()), "t.arrange_code", proTaskWorkunit.getArrangeCode());
query.eq(proTaskWorkunit.getOutsourced()!=null, "ptw.outsourced", proTaskWorkunit.getOutsourced());
query.eq(proTaskWorkunit.getCustomerProjectNo()!=null, "wo.customer_project_no", proTaskWorkunit.getCustomerProjectNo());
query.eq(proTaskWorkunit.getOrderCode()!=null, "wo.order_code", proTaskWorkunit.getOrderCode());
query.eq(StringUtils.isNotEmpty(proTaskWorkunit.getCustomerProjectNo()), "wo.customer_project_no", proTaskWorkunit.getCustomerProjectNo());
query.eq(StringUtils.isNotEmpty(proTaskWorkunit.getOrderCode()), "wo.order_code", proTaskWorkunit.getOrderCode());
query.gt("ptw.quantity",0);
query.orderByAsc("schedule_start_date");
List<ProTaskWorkunit> list = proTaskWorkunitService.selectTaskWorkUnitJoinTask(query);
......@@ -538,9 +538,9 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
public void outsourceConfirm(List<Long> taskWorkunitIds) {
taskWorkunitIds.forEach(id->{
ProTaskWorkunit taskWorkunit = this.selectProTaskWorkunitByTaskWorkunitId(id);
if(taskWorkunit.getVendorId()==null){
throw new ServiceException(MessageUtils.message("pro.schedule.error.not.null.vendor"));
}
// if(taskWorkunit.getVendorId()==null){
// throw new ServiceException(MessageUtils.message("pro.schedule.error.not.null.vendor"));
// }
if(ObjectUtil.equal(taskWorkunit.getOutsourced(), 1)){
throw new ServiceException(MessageUtils.message("basic.error.repeat.confirm"));
}
......@@ -576,13 +576,13 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
Map<String,Object> value = new HashMap<>();
valueList.add( value);
ProWorkorder proWorkorder = proWorkorderMapper.selectProWorkorderWorderCode(taskBatchTasks.get(0).getArrangeCode());
value.put("header",proWorkorder);
TaskProWorkorderPrintData taskProWorkorderPrintData = new TaskProWorkorderPrintData();
BeanUtil.copyProperties(proWorkorder,taskProWorkorderPrintData);
value.put("header",taskProWorkorderPrintData);
value.put("detail",taskBatchTasks);
Map<String,Object> value1 = new HashMap<>();
value.put("additional",value1);
value1.put("size",i++);
value1.put("date",simpleDateFormat.format(new Date()));
value1.put("quantity",taskBatchTasks.get(0).getQuantity());
taskProWorkorderPrintData.setSize(i++);
taskProWorkorderPrintData.setDate(simpleDateFormat.format(new Date()));
taskProWorkorderPrintData.setQuantity(taskBatchTasks.get(0).getQuantity());
}
}
return printData;
......
......@@ -192,6 +192,7 @@
t.create_time,
t.update_by,
t.update_time,
t.idx,
ptw.task_workunit_id,
ptw.quantity,
ptw.quantity_produced,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment