|
@@ -23,6 +23,7 @@ import com.factory.base.entity.aggregates.ResponseBean;
|
|
|
import com.factory.base.entity.enumPo.PlanType;
|
|
|
import com.factory.base.entity.po.benteler.BentelerPlan;
|
|
|
import com.factory.base.util.res.ResponseBeanBuilder;
|
|
|
+import com.factory.web.entity.fa.FirstArticleWorkshop;
|
|
|
import com.factory.web.entity.pm.OnsiteApprovalPlan;
|
|
|
import com.factory.web.entity.pm.OnsiteApprovalTask;
|
|
|
import com.factory.web.entity.pm.OnsiteCalendar;
|
|
@@ -44,6 +45,8 @@ import com.factory.web.entity.pm.req.OnsiteCalendarReq;
|
|
|
import com.factory.web.entity.pm.req.OnsiteItemReq;
|
|
|
import com.factory.web.entity.pm.req.OnsiteWorkshopReq;
|
|
|
import com.factory.web.entity.pm.req.PmPlanPauseFlagReq;
|
|
|
+import com.factory.web.entity.pm.req.SearchAbnormalListReq;
|
|
|
+import com.factory.web.entity.pm.req.SearchAbnormalReq;
|
|
|
import com.factory.web.entity.pm.req.SearchAllWorkshopReq;
|
|
|
import com.factory.web.entity.pm.req.SearchApprovalUserReq;
|
|
|
import com.factory.web.entity.pm.req.SearchCheckRecordReq;
|
|
@@ -59,6 +62,10 @@ import com.factory.web.entity.pm.req.SearchPmWorkshopNoGoListReq;
|
|
|
import com.factory.web.entity.pm.req.SearchPmWsAllCheckFlagReq;
|
|
|
import com.factory.web.entity.pm.req.SearchTaskReq;
|
|
|
import com.factory.web.entity.pm.req.SearchWorkshopReq;
|
|
|
+import com.factory.web.entity.pm.res.AbnormalItemRes;
|
|
|
+import com.factory.web.entity.pm.res.AbnormalItemResultRes;
|
|
|
+import com.factory.web.entity.pm.res.AbnormalTaskInfoRes;
|
|
|
+import com.factory.web.entity.pm.res.AbnormalWorkshopRes;
|
|
|
import com.factory.web.entity.pm.res.ApprovalUserRes;
|
|
|
import com.factory.web.entity.pm.res.PmAllCheckFlagRes;
|
|
|
import com.factory.web.entity.pm.res.PmAllWorkshopListRes;
|
|
@@ -76,6 +83,7 @@ import com.factory.web.entity.pm.res.PmTaskRes;
|
|
|
import com.factory.web.entity.pm.res.PmWorkshopNoGoListRes;
|
|
|
import com.factory.web.mapper.pm.PreventMistakeMapper;
|
|
|
import com.factory.web.service.BentelerPlanService;
|
|
|
+import com.factory.web.service.fa.FirstArticleWorkshopService;
|
|
|
import com.factory.web.service.pm.OnsiteApprovalPlanService;
|
|
|
import com.factory.web.service.pm.OnsiteApprovalTaskService;
|
|
|
import com.factory.web.service.pm.OnsiteCalendarService;
|
|
@@ -88,6 +96,8 @@ import com.factory.web.service.pm.OnsiteTitleBlobService;
|
|
|
import com.factory.web.service.pm.OnsiteWorkshopService;
|
|
|
import com.factory.web.service.pm.PreventMistakeService;
|
|
|
|
|
|
+import io.swagger.annotations.ApiModelProperty;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 防错计划
|
|
@@ -134,6 +144,9 @@ public class PreventMistakeServiceImpl extends ServiceImpl<PreventMistakeMapper,
|
|
|
|
|
|
@Autowired
|
|
|
private OnsiteTaskHisBlobService onsiteTaskHisBlobService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FirstArticleWorkshopService firstArticleWorkshopService;
|
|
|
|
|
|
/**
|
|
|
* 新建防错计划
|
|
@@ -994,6 +1007,129 @@ public class PreventMistakeServiceImpl extends ServiceImpl<PreventMistakeMapper,
|
|
|
|
|
|
return pmAllCheckFlagRes;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 取得异常列表
|
|
|
+ *
|
|
|
+ * @param req
|
|
|
+ * @return 异常列表
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseBean<List<AbnormalTaskInfoRes>> getAbnormalList(SearchAbnormalListReq req) {
|
|
|
+ /* 防错 */
|
|
|
+ SearchAbnormalReq searchReq = new SearchAbnormalReq();
|
|
|
+ searchReq.setCheckDate(req.getCheckDate());
|
|
|
+ List<AbnormalTaskInfoRes> pmReleaseList = preventMistakeMapper.getPmReleaseList(searchReq);
|
|
|
+ List<AbnormalTaskInfoRes> pmRepeatList = preventMistakeMapper.getPmRepeatList(searchReq);
|
|
|
+ List<AbnormalTaskInfoRes> pmList = new ArrayList<AbnormalTaskInfoRes>();
|
|
|
+ for (AbnormalTaskInfoRes pmRelease : pmReleaseList) {
|
|
|
+ pmList.add(pmRelease);
|
|
|
+ }
|
|
|
+ for (AbnormalTaskInfoRes pmRepeat : pmRepeatList) {
|
|
|
+ pmList.add(pmRepeat);
|
|
|
+ }
|
|
|
+ for (AbnormalTaskInfoRes pmInfo : pmList) {
|
|
|
+ List<OnsiteWorkshop> onsiteWorkshopList = onsiteWorkshopService.list(Wrappers.<OnsiteWorkshop>lambdaQuery()
|
|
|
+ .eq(OnsiteWorkshop::getBentelerPlanId, pmInfo.getBentelerPlanId()));
|
|
|
+
|
|
|
+ List<AbnormalWorkshopRes> abnormalWorkshopList = new ArrayList<AbnormalWorkshopRes>();
|
|
|
+ AbnormalWorkshopRes abnormalWorkshop = null;
|
|
|
+ for (OnsiteWorkshop workshop : onsiteWorkshopList) {
|
|
|
+ abnormalWorkshop = new AbnormalWorkshopRes();
|
|
|
+ abnormalWorkshop.setWorkshopId(workshop.getId());
|
|
|
+ abnormalWorkshop.setWsName(workshop.getWsName());
|
|
|
+ abnormalWorkshopList.add(abnormalWorkshop);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (AbnormalWorkshopRes abnormalWorkshopInfo : abnormalWorkshopList) {
|
|
|
+ searchReq = new SearchAbnormalReq();
|
|
|
+ searchReq.setWorkshopId(abnormalWorkshopInfo.getWorkshopId());
|
|
|
+ searchReq.setTaskId(pmInfo.getTaskId());
|
|
|
+ List<AbnormalItemRes> abnormalItemList = preventMistakeMapper.getPmAbnormalItemList(searchReq);
|
|
|
+ abnormalWorkshopInfo.setAbnormalItemList(abnormalItemList);
|
|
|
+ }
|
|
|
+
|
|
|
+ pmInfo.setAbnormalWorkshopList(abnormalWorkshopList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 首件 */
|
|
|
+ searchReq = new SearchAbnormalReq();
|
|
|
+ searchReq.setCheckDate(req.getCheckDate());
|
|
|
+ List<AbnormalTaskInfoRes> faReleaseList = preventMistakeMapper.getFaReleaseList(searchReq);
|
|
|
+ List<AbnormalTaskInfoRes> faRepeatList = preventMistakeMapper.getFaRepeatList(searchReq);
|
|
|
+
|
|
|
+ List<AbnormalTaskInfoRes> faList = new ArrayList<AbnormalTaskInfoRes>();
|
|
|
+ for (AbnormalTaskInfoRes faRelease : faReleaseList) {
|
|
|
+ faList.add(faRelease);
|
|
|
+ }
|
|
|
+ for (AbnormalTaskInfoRes faRepeat : faRepeatList) {
|
|
|
+ faList.add(faRepeat);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (AbnormalTaskInfoRes faInfo : faList) {
|
|
|
+ List<FirstArticleWorkshop> firstArticleWorkshopList = firstArticleWorkshopService.list(Wrappers.<FirstArticleWorkshop>lambdaQuery()
|
|
|
+ .eq(FirstArticleWorkshop::getBentelerPlanId, faInfo.getBentelerPlanId()));
|
|
|
+
|
|
|
+ List<AbnormalWorkshopRes> abnormalWorkshopList = new ArrayList<AbnormalWorkshopRes>();
|
|
|
+ AbnormalWorkshopRes abnormalWorkshop = null;
|
|
|
+ for (FirstArticleWorkshop workshop : firstArticleWorkshopList) {
|
|
|
+ abnormalWorkshop = new AbnormalWorkshopRes();
|
|
|
+ abnormalWorkshop.setWorkshopId(workshop.getId());
|
|
|
+ abnormalWorkshop.setWsName(workshop.getWsName());
|
|
|
+ abnormalWorkshopList.add(abnormalWorkshop);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (AbnormalWorkshopRes abnormalWorkshopInfo : abnormalWorkshopList) {
|
|
|
+ searchReq = new SearchAbnormalReq();
|
|
|
+ searchReq.setWorkshopId(abnormalWorkshopInfo.getWorkshopId());
|
|
|
+ List<AbnormalItemRes> abnormalItemList = preventMistakeMapper.getFaAbnormalItemList(searchReq);
|
|
|
+
|
|
|
+ for (AbnormalItemRes abnormalItemInfo : abnormalItemList) {
|
|
|
+ List<AbnormalItemResultRes> firstItemResultList = this.getAbnormalItemResultList(faInfo.getTaskId(), abnormalItemInfo.getItemId(), 0);
|
|
|
+ abnormalItemInfo.setFirstItemResultList(firstItemResultList);
|
|
|
+
|
|
|
+ List<AbnormalItemResultRes> twoHundredItemResultList = this.getAbnormalItemResultList(faInfo.getTaskId(), abnormalItemInfo.getItemId(), 1);
|
|
|
+ abnormalItemInfo.setTwoHundredItemResultList(twoHundredItemResultList);
|
|
|
+
|
|
|
+ List<AbnormalItemResultRes> catchItemResultList = this.getAbnormalItemResultList(faInfo.getTaskId(), abnormalItemInfo.getItemId(), 2);
|
|
|
+ abnormalItemInfo.setCatchItemResultList(catchItemResultList);
|
|
|
+ }
|
|
|
+
|
|
|
+ abnormalWorkshopInfo.setAbnormalItemList(abnormalItemList);
|
|
|
+ }
|
|
|
+
|
|
|
+ faInfo.setAbnormalWorkshopList(abnormalWorkshopList);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<AbnormalTaskInfoRes> abnormalList = new ArrayList<AbnormalTaskInfoRes>();
|
|
|
+ for (AbnormalTaskInfoRes pm : pmList) {
|
|
|
+ abnormalList.add(pm);
|
|
|
+ }
|
|
|
+ for (AbnormalTaskInfoRes fa : faList) {
|
|
|
+ abnormalList.add(fa);
|
|
|
+ }
|
|
|
+
|
|
|
+ return ResponseBeanBuilder.ok(abnormalList, Function.identity());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 取得检查结果
|
|
|
+ *
|
|
|
+ * @param taskId
|
|
|
+ * @param itemId
|
|
|
+ * @param typeFlag 0表示首件 1表示200件 2表示中断
|
|
|
+ * @return 检查结果
|
|
|
+ */
|
|
|
+ private List<AbnormalItemResultRes> getAbnormalItemResultList(long taskId, long itemId, int typeFlag) {
|
|
|
+ SearchAbnormalReq searchReq = new SearchAbnormalReq();
|
|
|
+ searchReq.setTaskId(taskId);
|
|
|
+ searchReq.setItemId(itemId);
|
|
|
+ searchReq.setTypeFlag(typeFlag);
|
|
|
+ List<AbnormalItemResultRes> abnormalItemResultList = preventMistakeMapper.getFaAbnormalItemResultList(searchReq);
|
|
|
+ return abnormalItemResultList;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/**
|