|
|
|
|
@ -68,6 +68,8 @@ import org.springblade.system.feign.IDictClient; |
|
|
|
|
import org.springblade.system.feign.IUserClient; |
|
|
|
|
import org.springblade.system.pojo.entity.User; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.context.ApplicationContext; |
|
|
|
|
import org.springframework.context.ApplicationContextAware; |
|
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
@ -91,7 +93,7 @@ import static com.fasterxml.jackson.databind.type.LogicalType.DateTime; |
|
|
|
|
@EqualsAndHashCode(callSuper = true) |
|
|
|
|
@Slf4j |
|
|
|
|
public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMapper, InspectionTask> |
|
|
|
|
implements IInspectionTaskService { |
|
|
|
|
implements IInspectionTaskService , ApplicationContextAware { |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private IInspectionItemService itemService; |
|
|
|
|
@ -1377,7 +1379,8 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap |
|
|
|
|
task.setCheckDate(LocalDateTime.now()); |
|
|
|
|
this.computeOrderQty(wp, wo, sumCheckQ, sumTestQty, sumLossQty, 0); |
|
|
|
|
// this.qualified(wp, wc, wo);
|
|
|
|
|
|
|
|
|
|
IWorkOrderService workOrderService = context.getBean(IWorkOrderService.class); |
|
|
|
|
workOrderService.qualified(wp,wo); |
|
|
|
|
} else if (countNA == itemList.size()) { // 全部item NA
|
|
|
|
|
checkResult = InspectionTaskConst.CHECK_RESULT_NA; |
|
|
|
|
} else if (countNO >= 0 && countNO <= itemList.size()) { // 不合格
|
|
|
|
|
@ -1404,7 +1407,12 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap |
|
|
|
|
return task; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private ApplicationContext context; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void setApplicationContext(ApplicationContext context) { |
|
|
|
|
this.context = context; |
|
|
|
|
} |
|
|
|
|
public void computeOrderQty(WorkPlan wp, WorkOrder wo, int checkQ, int testQty, int lossQty, int scrapQty) { |
|
|
|
|
|
|
|
|
|
if (wo != null) { |
|
|
|
|
|