Commit d1585633 authored by 温志超's avatar 温志超

更新打印以及删除报工逻辑

parent c7d343ea
......@@ -319,10 +319,6 @@ public class ProTask extends BaseEntity {
@ApiModelProperty("超报标识")
private Boolean surpassState;
private String expectStartDateString;
private String requestDateString;
public String getStatusName() {
return TaskStatusEnum.getStatusCn(this.getStatus());
}
......
......@@ -4,5 +4,9 @@ import lombok.Data;
@Data
public class TaskProPrintData extends ProTask{
private String beginAndEndDate;
private String expectStartDateString;
private String requestDateString;
}
......@@ -358,8 +358,6 @@ public class ProFeedbackServiceImpl implements IProFeedbackService {
public int deleteProFeedbackByRecordIds(Long[] recordIds) {
List<ProFeedback> proFeedbacks = proFeedbackMapper.selectListByQw(new QueryWrapper<ProFeedback>().in("record_id", Arrays.asList(recordIds)));
for (ProFeedback proFeedback : proFeedbacks) {
BigDecimal quantityFeedback = proFeedback.getQuantityFeedback();
ProTask proTask = proTaskService.selectProTaskByTaskId(proFeedback.getTaskId());
ExceptionUtil.checkTrueThrowException(proTask.getIsLastProcess() == 1, MessageUtils.message("pro.feedback.error.cannot.delete.last.process"));
......@@ -373,7 +371,8 @@ public class ProFeedbackServiceImpl implements IProFeedbackService {
proTaskWorkunit.setQuantityUnqualify(proTaskWorkunit.getQuantityUnqualify().subtract(proFeedback.getQuantityUnqualify()));
proTaskWorkunit.setQuantityQualify(proTaskWorkunit.getQuantityQualify().subtract(proFeedback.getQuantityQualify()));
proTaskWorkunit.setQuantityProduced(proTaskWorkunit.getQuantityProduced().subtract(proFeedback.getQuantityFeedback()));
if (proTaskWorkunit.getQuantityProduced().doubleValue() < proTaskWorkunit.getQuantity().doubleValue()) {
if (proTask.getQuantityWait().compareTo(BigDecimal.ZERO) > 0
&& proTaskWorkunit.getStatus().equals(TaskWorkunitStatusEnum.FINISHED.getStatus())) {
proTaskWorkunit.setStatus(TaskWorkunitStatusEnum.BEGINNING.getStatus());
proTask.setTaskWorkunitId(proTaskWorkunit.getTaskWorkunitId());
proTask.setWorkunitId(proTaskWorkunit.getWorkunitId());
......@@ -383,7 +382,7 @@ public class ProFeedbackServiceImpl implements IProFeedbackService {
proTaskWorkunitService.updateProTaskWorkunit(proTaskWorkunit);
ProTask nextProTask = proTaskService.getNextTaskByTaskId(proFeedback.getTaskId());
if (nextProTask != null) {
BigDecimal subtract = nextProTask.getQuantityWait().subtract(quantityFeedback);
BigDecimal subtract = nextProTask.getQuantityWait().subtract(proFeedback.getQuantityQualify());
ExceptionUtil.checkTrueThrowException(subtract.doubleValue() < 0, MessageUtils.message("pro.feedback.error.error1"));
nextProTask.setQuantityWait(subtract);
proTaskService.updateProTask(nextProTask);
......@@ -679,7 +678,7 @@ public class ProFeedbackServiceImpl implements IProFeedbackService {
ProFeedback oldFeedback = proFeedbacks.get(0);
proFeedback.setFeedbackCode(oldFeedback.getFeedbackCode());
// BigDecimal feedbackQuantitySubtract = quantityFeedback.subtract(oldFeedback.getQuantityFeedback());
//
// if (feedbackQuantitySubtract.doubleValue() == 0) {
// return 1;
// }
......@@ -796,7 +795,7 @@ public class ProFeedbackServiceImpl implements IProFeedbackService {
proTaskService.updateProTask(thisProTask);
proTaskService.updateProTask(nextProTask);
if (thisTaskWait.compareTo(BigDecimal.ZERO) > 0 && !proTaskWorkunit.getStatus().equals(TaskWorkunitStatusEnum.BEGINNING.getStatus())) {
if (thisTaskWait.compareTo(BigDecimal.ZERO) > 0 && proTaskWorkunit.getStatus().equals(TaskWorkunitStatusEnum.FINISHED.getStatus())) {
proTaskWorkunit.setStatus(TaskWorkunitStatusEnum.BEGINNING.getStatus());
thisProTask.setTaskWorkunitId(proTaskWorkunit.getTaskWorkunitId());
thisProTask.setWorkunitId(proTaskWorkunit.getWorkunitId());
......
......@@ -795,18 +795,15 @@ public class ProTaskServiceImpl implements IProTaskService {
ProTask task = this.selectProTaskByTaskId(feedback.getTaskId());
BigDecimal taskQuantityWaitConst = task.getQuantityWait();
double taskQuantityWaitDouConst = taskQuantityWaitConst.doubleValue();
double feedbackQualityDouConst = feedbackQualifyConst.doubleValue();
BigDecimal quantityWaitVal = BigDecimal.ZERO;
BigDecimal feedbackQualityVal = BigDecimal.valueOf(feedbackQualityDouConst);
Long workorderId = feedback.getWorkorderId();
QueryWrapper<ProWorkorder> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("t1.workorder_code", task.getArrangeCode());
queryWrapper.notIn("t1.status", Arrays.asList(WorkorderStatusEnum.CLOSE.getValue(), WorkorderStatusEnum.CANCEL.getValue(), WorkorderStatusEnum.CANCELED.getValue()));
List<ProWorkorder> proWorkorders = proWorkorderService.selectListByQw(queryWrapper);
double maxWorkunitQuantityConst = taskWorkunit.getQuantity().doubleValue();
//检查该工单绑定的生产版本是否允许超报,PS只有首工序允许
if(taskQuantityWaitConst.compareTo(feedbackQualifyConst.add(fuantityUnqualify)) < 0){
if(task.getOrdinal() == 1){
......
......@@ -579,31 +579,29 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
List<ProTask> taskBatchTasks = proTaskMapper.selectByTaskBatch(taskBatch);
if(taskBatchTasks.size() > 0){
List<TaskProPrintData> taskProPrintDatas = new ArrayList<>();
Map<String,Object> value = new HashMap<>();
valueList.add( value);
ProWorkorder proWorkorder = proWorkorderMapper.selectProWorkorderWorderCode(taskBatchTasks.get(0).getArrangeCode());
TaskProWorkorderPrintData taskProWorkorderPrintData = new TaskProWorkorderPrintData();
BeanUtil.copyProperties(proWorkorder,taskProWorkorderPrintData);
value.put("header",taskProWorkorderPrintData);
value.put("detail",taskBatchTasks);
value.put("detail",taskProPrintDatas);
if(taskProWorkorderPrintData.getExpectStartDate() != null || taskProWorkorderPrintData.getRequestDate() != null){
for (ProTask proTask : taskBatchTasks){
TaskProPrintData taskProPrintData = new TaskProPrintData();
BeanUtil.copyProperties(proTask,taskProPrintData);
String begin = taskProWorkorderPrintData.getExpectStartDate() != null ? simpleDateFormat1.format(taskProWorkorderPrintData.getExpectStartDate()) : "空";
String end = taskProWorkorderPrintData.getRequestDate() != null ? simpleDateFormat1.format(taskProWorkorderPrintData.getRequestDate()) : "空";
proTask.setExpectStartDateString(begin);
proTask.setRequestDateString(end);
taskProPrintData.setExpectStartDateString(begin);
taskProPrintData.setRequestDateString(end);
taskProPrintDatas.add(taskProPrintData);
}
}
taskProWorkorderPrintData.setSize(i++);
taskProWorkorderPrintData.setDate(simpleDateFormat.format(new Date()));
taskProWorkorderPrintData.setQuantity(taskBatchTasks.get(0).getQuantity());
// if(proWorkorder.getOrderCode() != null && proWorkorder.getProductId() != null){
// OdSalesOrderDetail odSalesOrderDetail = odSalesOrderDetailMapper.getByOrderCodeAndproductId(proWorkorder.getOrderCode(),proWorkorder.getProductId());
// if(odSalesOrderDetail != null){
// taskProWorkorderPrintData.setClientItemNo(odSalesOrderDetail.getClientItemNo());
// taskProWorkorderPrintData.setPoOrderNo(odSalesOrderDetail.getPoOrderNo());
// }
// }
}
}
return printData;
......
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