|
@@ -6,6 +6,7 @@ import java.util.List;
|
|
|
import com.cirs.biz.domain.TVerificationTask;
|
|
|
import com.cirs.biz.domain.VerificationData;
|
|
|
import com.cirs.biz.mapper.TVerificationTaskMapper;
|
|
|
+import com.cirs.biz.service.ITElectronComponentService;
|
|
|
import com.cirs.common.exception.ServiceException;
|
|
|
import com.cirs.common.utils.DateUtils;
|
|
|
import com.cirs.common.utils.StringUtils;
|
|
@@ -13,6 +14,7 @@ import com.cirs.common.utils.bean.BeanValidators;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.cirs.biz.mapper.TVerificationTaskDetailMapper;
|
|
|
import com.cirs.biz.domain.TVerificationTaskDetail;
|
|
@@ -38,6 +40,9 @@ public class TVerificationTaskDetailServiceImpl implements ITVerificationTaskDet
|
|
|
@Autowired
|
|
|
private TVerificationTaskMapper tVerificationTaskMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ITElectronComponentService tElectronComponentService;//之前写在元器件接口不太方便
|
|
|
+
|
|
|
@Autowired
|
|
|
protected Validator validator;
|
|
|
|
|
@@ -226,4 +231,46 @@ public class TVerificationTaskDetailServiceImpl implements ITVerificationTaskDet
|
|
|
public List<TVerificationTaskDetail> selectTrainDetailByTaskIds(List<Long> taskids) {
|
|
|
return tVerificationTaskDetailMapper.selectTrainDetailByTaskIds(taskids);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Async
|
|
|
+ public String updateDetails(List<VerificationData> dataset) {
|
|
|
+ String returnValue = "";
|
|
|
+ try {
|
|
|
+ for (VerificationData verificationData : dataset) {
|
|
|
+
|
|
|
+ TVerificationTaskDetail detail = this.selectTVerificationTaskDetailById(verificationData.getId());
|
|
|
+
|
|
|
+ detail.setCalculate1Id(verificationData.getCalculate1Id());
|
|
|
+ detail.setCalculate2Id(verificationData.getCalculate2Id());
|
|
|
+ detail.setCalculate3Id(verificationData.getCalculate3Id());
|
|
|
+ detail.setCalculate4Id(verificationData.getCalculate4Id());
|
|
|
+ detail.setCalculate5Id(verificationData.getCalculate5Id());
|
|
|
+
|
|
|
+ detail.setCalculate1(getDetailInfoById(detail.getCalculate1Id()));
|
|
|
+ detail.setCalculate2(getDetailInfoById(detail.getCalculate2Id()));
|
|
|
+ detail.setCalculate3(getDetailInfoById(detail.getCalculate3Id()));
|
|
|
+ detail.setCalculate4(getDetailInfoById(detail.getCalculate4Id()));
|
|
|
+ detail.setCalculate5(getDetailInfoById(detail.getCalculate5Id()));
|
|
|
+ detail.setTrained(verificationData.getTrained());
|
|
|
+ detail.setTested(verificationData.getTested());
|
|
|
+
|
|
|
+ this.updateTVerificationTaskDetail(detail);
|
|
|
+ }
|
|
|
+
|
|
|
+ return returnValue;
|
|
|
+ } catch (Exception e){
|
|
|
+ returnValue = "加载数据出错";
|
|
|
+ log.error(returnValue, e);
|
|
|
+ return returnValue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getDetailInfoById(Long id) {
|
|
|
+ if(id==null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return tElectronComponentService.getDetailById(id);
|
|
|
+ }
|
|
|
+
|
|
|
}
|