|
@@ -9,10 +9,7 @@ import com.persagy.fm.sop.model.dto.*;
|
|
|
import com.persagy.fm.sop.model.vo.*;
|
|
|
import com.persagy.fm.sop.service.*;
|
|
|
import com.persagy.old.cache.OrderTypeCache;
|
|
|
-import com.persagy.old.common.CommonConst;
|
|
|
-import com.persagy.old.common.DateUtil;
|
|
|
-import com.persagy.old.common.SopConst;
|
|
|
-import com.persagy.old.common.StringUtil;
|
|
|
+import com.persagy.old.common.*;
|
|
|
import com.persagy.old.dao.DBConst;
|
|
|
import com.persagy.old.dao.DBConst.Result;
|
|
|
import com.persagy.old.service.EquipModelServiceI;
|
|
@@ -59,8 +56,39 @@ public class GroupSopServiceImpl implements GroupSopService {
|
|
|
private SopEquipModelRelService sopEquipModelRelService;
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ @Override
|
|
|
+ public JSONObject queryPublishedSopList(QuerySopListForSelVo sopListForSelVo) throws Exception {
|
|
|
+ String projectId = sopListForSelVo.getProjectId();
|
|
|
+ //1.根据update和项目id查询
|
|
|
+ List<Sop> sops = queryPublishedSopsByProjectIdAndUpdatetime(sopListForSelVo, projectId);
|
|
|
+ /*
|
|
|
+ //========2.移除待修订状态sop=======
|
|
|
+ //如果不是集团的sop的查询
|
|
|
+ if (!jsonObject.getString("project_id").equals(CommonConst.group_sop_id)) {
|
|
|
+ //移除待修订z状态的sop
|
|
|
+ removeGroupReviseSop(sops);
|
|
|
+ String rootProjFuncType = objectService.queryRootProjFuncTypeById(jsonObject.getString("project_id"));
|
|
|
+ removeWithoutProJFuncType(sops, rootProjFuncType);
|
|
|
+ }
|
|
|
+ */
|
|
|
+ //=========3.筛选SOP========
|
|
|
+ //根据 sign_codes 进行筛选
|
|
|
+ sops = filterSopBySignCodes(sopListForSelVo.getSign_codes(), sops, projectId);
|
|
|
+ sops = filterSopByFitScope(sopListForSelVo, sops);
|
|
|
+ //=========4设置返回字段======
|
|
|
+ //这里有两种类型的1-查询发布 2-查询可复制引用
|
|
|
+ List<SopInfoVo> sopInfoVos = additionalSopDetail(sops,projectId,"1");
|
|
|
+ //------------设置过滤项-----
|
|
|
+ JSONObject item = new JSONObject();
|
|
|
+ if (sopListForSelVo.isNeed_return_criteria()) {
|
|
|
+ Map<String, Object> criteria = getSopListCriteria(sops, sopInfoVos);
|
|
|
+ item.put("criteria", criteria);
|
|
|
+ }
|
|
|
+ //在此进行格式转化返回给前端
|
|
|
+ item.put("content", sopInfoVos);
|
|
|
+ item.put("count", sopInfoVos.size());
|
|
|
+ return item;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -453,12 +481,13 @@ public class GroupSopServiceImpl implements GroupSopService {
|
|
|
//=========3设置返回字段======
|
|
|
|
|
|
List<SopInfoVo> sopInfoVos = additionalSopDetail(sops,projectId,"2");
|
|
|
+
|
|
|
JSONObject item = new JSONObject();
|
|
|
- //------------设置过滤项-----
|
|
|
if (sopListForSelVo.isNeed_return_criteria()) {
|
|
|
Map<String, Object> criteria = getSopListCriteria(sops, sopInfoVos);
|
|
|
item.put("criteria", criteria);
|
|
|
}
|
|
|
+
|
|
|
//JSONArray content = new JSONArray();
|
|
|
/* for (Object object : sops) {
|
|
|
content.add(JSONUtil.getJsonObjectWithKeys((JSONObject)object, querySopListForSel_keys));
|