|
@@ -16,7 +16,6 @@ import java.util.stream.Collectors;
|
|
|
import java.util.stream.IntStream;
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
-import com.factory.web.entity.vo.req.ExportInitialPlanDetailsReq;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -85,10 +84,12 @@ import com.factory.web.entity.fa.res.FaPlanListForPadRes;
|
|
|
import com.factory.web.entity.fa.res.FaPlanListRes;
|
|
|
import com.factory.web.entity.fa.res.FaPlanRes;
|
|
|
import com.factory.web.entity.fa.res.FaTaskRes;
|
|
|
+import com.factory.web.entity.fa.res.FaTaskResForPad;
|
|
|
import com.factory.web.entity.fa.res.FaWorkshopNoGoListRes;
|
|
|
import com.factory.web.entity.fa.res.UserListRes;
|
|
|
import com.factory.web.entity.pm.ApprovalRule;
|
|
|
import com.factory.web.entity.pm.OnsiteApprovalPlan;
|
|
|
+import com.factory.web.entity.vo.req.ExportInitialPlanDetailsReq;
|
|
|
import com.factory.web.mapper.fa.FirstArticleMapper;
|
|
|
import com.factory.web.mapper.pm.ApprovalRuleMapper;
|
|
|
import com.factory.web.service.BentelerPlanService;
|
|
@@ -597,7 +598,7 @@ public class FirstArticleServiceImpl extends ServiceImpl<FirstArticleMapper, Ben
|
|
|
* @return 工作站
|
|
|
*/
|
|
|
@Override
|
|
|
- public ResponseBean<List<FirstArticleWorkshop>> getFaWorkshopListForPad(SearchFaWorkshopListForPadReq req) {
|
|
|
+ public ResponseBean<List<FirstArticleWorkshop>> getFaWorkshopListForPad(SearchFaWorkshopListForPadReq req) throws Exception{
|
|
|
/* 取得task信息 */
|
|
|
SearchFaTaskInfoReq searchFaTaskInfoReq = new SearchFaTaskInfoReq();
|
|
|
searchFaTaskInfoReq.setBentelerPlanId(req.getBentelerPlanId());
|
|
@@ -660,7 +661,7 @@ public class FirstArticleServiceImpl extends ServiceImpl<FirstArticleMapper, Ben
|
|
|
* @return 巡检项目
|
|
|
*/
|
|
|
@Override
|
|
|
- public ResponseBean<List<FaItemListForPadRes>> getFaItemListForPad(SearchFaItemListForPadReq req) {
|
|
|
+ public ResponseBean<List<FaItemListForPadRes>> getFaItemListForPad(SearchFaItemListForPadReq req) throws Exception{
|
|
|
/* 取得task信息 */
|
|
|
SearchFaTaskInfoReq searchFaTaskInfoReq = new SearchFaTaskInfoReq();
|
|
|
searchFaTaskInfoReq.setBentelerPlanId(req.getBentelerPlanId());
|
|
@@ -992,6 +993,7 @@ public class FirstArticleServiceImpl extends ServiceImpl<FirstArticleMapper, Ben
|
|
|
.valDesc(editFaItemResult.getValDesc())
|
|
|
.result(editFaItemResult.getResult())
|
|
|
.prefix(editFaItemResult.getPrefix())
|
|
|
+ .result(0)
|
|
|
.sno(editFaItemResult.getSno())
|
|
|
.toolDesc(editFaItemResult.getToolDesc())
|
|
|
.abnormal(editFaItemResult.getAbnormal())
|
|
@@ -1074,13 +1076,34 @@ public class FirstArticleServiceImpl extends ServiceImpl<FirstArticleMapper, Ben
|
|
|
|
|
|
/**
|
|
|
* 查询中断最新的task
|
|
|
+ * 如果没有未完成创建一个未完成的
|
|
|
*
|
|
|
* @param req
|
|
|
* @return 任务
|
|
|
*/
|
|
|
@Override
|
|
|
- public FirstArticleTask getFaTaskInfoCatchLatest(SearchFaTaskInfoReq req) {
|
|
|
+ public FirstArticleTask getFaTaskInfoCatchLatest(SearchFaTaskInfoReq req) throws Exception{
|
|
|
+ //最新未完成的
|
|
|
FirstArticleTask firstArticleTask = firstArticleMapper.getFaTaskInfoCatchLatest(req);
|
|
|
+ if(firstArticleTask==null) {
|
|
|
+
|
|
|
+ FirstArticleCalendar calendar = firstArticleCalendarService.lambdaQuery()
|
|
|
+ .eq(FirstArticleCalendar::getBentelerPlanId, req.getBentelerPlanId()).last("limit 1").one();
|
|
|
+ if(calendar==null||!calendar.getTypeFlag().contains("2")) {
|
|
|
+ log.warn("当前计划不支持中断{}",req);
|
|
|
+ throw new Exception("当前计划不支持中断");
|
|
|
+ }
|
|
|
+ //TODO 新建一个任务
|
|
|
+ firstArticleTask = FirstArticleTask.builder()
|
|
|
+ .firstArticleCalendarId(calendar.getId())
|
|
|
+ .typeFlag(2)
|
|
|
+ .taskTime(LocalDate.now())
|
|
|
+ .status(0)
|
|
|
+ .remindNoworkFlag(0)
|
|
|
+ .remindTaskFlag(0)
|
|
|
+ .build();
|
|
|
+
|
|
|
+ }
|
|
|
return firstArticleTask;
|
|
|
}
|
|
|
|
|
@@ -1284,10 +1307,17 @@ public class FirstArticleServiceImpl extends ServiceImpl<FirstArticleMapper, Ben
|
|
|
* @return 取得用户列表
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<UserListRes> getUserList() {
|
|
|
+ public List<UserListRes> getUserList(List<Long> roleIds) {
|
|
|
SearchUserListReq searchUserListReq = new SearchUserListReq();
|
|
|
- searchUserListReq.setRoleId(ROLE_ID);
|
|
|
+ searchUserListReq.setRoleIds(new ArrayList<>());
|
|
|
+ if(roleIds!=null) {
|
|
|
+ searchUserListReq.getRoleIds().addAll(roleIds);
|
|
|
+ }
|
|
|
+ if(roleIds==null||!roleIds.contains(ROLE_ID)) {
|
|
|
+ searchUserListReq.getRoleIds().add(ROLE_ID);
|
|
|
+ }
|
|
|
List<UserListRes> userList = firstArticleMapper.getUserList(searchUserListReq);
|
|
|
+
|
|
|
return userList;
|
|
|
}
|
|
|
|
|
@@ -1538,7 +1568,14 @@ public class FirstArticleServiceImpl extends ServiceImpl<FirstArticleMapper, Ben
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
+ @Override
|
|
|
+ public List<FaTaskResForPad> getFaBreakTaskForPad(SearchFaWorkshopListForPadReq req) {
|
|
|
+ List<FaTaskResForPad> listRes = firstArticleMapper.getFaBreakTaskForPad(req);
|
|
|
+ return listRes;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
* Object转成byte[]
|
|
|
*
|
|
|
* @param obj
|