质量校验代码

This commit is contained in:
zhal 2022-07-04 23:03:34 +08:00
parent 8d953fc8d6
commit 34f9eae515
3 changed files with 12 additions and 28 deletions

View File

@ -1,6 +1,5 @@
package com.actionsoft.apps.coe.pal.datamigration.aris.web; package com.actionsoft.apps.coe.pal.datamigration.aris.web;
import com.actionsoft.apps.coe.pal.batch.cache.BatchCache;
import com.actionsoft.apps.coe.pal.constant.CoEConstant; import com.actionsoft.apps.coe.pal.constant.CoEConstant;
import com.actionsoft.apps.coe.pal.datamigration.aris.constant.ArisConstant; import com.actionsoft.apps.coe.pal.datamigration.aris.constant.ArisConstant;
import com.actionsoft.apps.coe.pal.datamigration.aris.model.*; import com.actionsoft.apps.coe.pal.datamigration.aris.model.*;

View File

@ -874,24 +874,6 @@ public class DesignerRelationShapeWeb extends ActionWeb {
} }
return jsonArray.toString(); return jsonArray.toString();
} }
/**
* 获取第二级及其以下目录
*
* @param pid
* @return
*/
public String getTwoNodeJson(String pid, String wsId,String method, String ruuid) {
List<PALRepositoryModel> coeProcessLevelModels = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getCoeProcessLevelByPid(pid, wsId);
JSONArray jsonArray = new JSONArray();
for (int i = 0; i < coeProcessLevelModels.size(); i++) {
PALRepositoryModel coeProcessLevelModel = coeProcessLevelModels.get(i);
if (coeProcessLevelModel != null) {
JSONObject json = getJSon(coeProcessLevelModel);
jsonArray.add(json);
}
}
return jsonArray.toString();
}
protected String getRootJson(String wsuuid, String category, String type, String methodScope,String ruuid) { protected String getRootJson(String wsuuid, String category, String type, String methodScope,String ruuid) {
JSONArray jsonArray = new JSONArray(); JSONArray jsonArray = new JSONArray();

View File

@ -8278,8 +8278,10 @@ public class CoeProcessLevelWeb extends ActionWeb {
propertys.sort((p1, p2) -> (sortAttrMap.containsKey(p1.getPropertyId()) ? sortAttrMap.get(p1.getPropertyId()) : 0) - (sortAttrMap.containsKey(p2.getPropertyId()) ? sortAttrMap.get(p2.getPropertyId()) : 0)); propertys.sort((p1, p2) -> (sortAttrMap.containsKey(p1.getPropertyId()) ? sortAttrMap.get(p1.getPropertyId()) : 0) - (sortAttrMap.containsKey(p2.getPropertyId()) ? sortAttrMap.get(p2.getPropertyId()) : 0));
Boolean flag1=false;
Boolean flag2=false;
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("<span>文件属性<span><br/>"); sb.append("<span>质量校验<span><br/>");
for (PALRepositoryPropertyModel property : propertys) { for (PALRepositoryPropertyModel property : propertys) {
String id = property.getPropertyId(); String id = property.getPropertyId();
if (!attributeModelMap.containsKey(id) || !attributeModelMap.get(id).getUse()) { if (!attributeModelMap.containsKey(id) || !attributeModelMap.get(id).getUse()) {
@ -8392,16 +8394,17 @@ public class CoeProcessLevelWeb extends ActionWeb {
if (isRequired) { if (isRequired) {
if(UtilString.isEmpty(inputValue)){ if(UtilString.isEmpty(inputValue)){
sb.append(attributeModel.getTitle()+"<span>必填项为空,请检查必填字段!</span><br/>"); sb.append(attributeModel.getTitle()).append(",");
flag1=true;
} }
} }
} }
StringBuffer sb2=new StringBuffer(); StringBuffer sb2=new StringBuffer();
/***************************************************数据属性校验*************************************************/ /***************************************************数据属性校验*************************************************/
sb2.append("<span>数据属性<span><br/>");
JSONObject elementJsonobject=JSONObject.parseObject(obj).getJSONObject("elements"); JSONObject elementJsonobject=JSONObject.parseObject(obj).getJSONObject("elements");
Iterator<String> sIterator = elementJsonobject.keySet().iterator(); Iterator<String> sIterator = elementJsonobject.keySet().iterator();
@ -8425,7 +8428,8 @@ public class CoeProcessLevelWeb extends ActionWeb {
if(Boolean.parseBoolean(isRequired)==true){ if(Boolean.parseBoolean(isRequired)==true){
String inputvalue = attributesJsonArray.getJSONObject(k).getString("value"); String inputvalue = attributesJsonArray.getJSONObject(k).getString("value");
if(UtilString.isEmpty(inputvalue)){ if(UtilString.isEmpty(inputvalue)){
sb2.append(attributesJsonArray.getJSONObject(k).getString("name")+"<span>必填项为空,请检查必填字段!</span><br/>"); sb.append(attributesJsonArray.getJSONObject(k).getString("name")).append(",");
flag2=true;
} }
} }
@ -8437,13 +8441,12 @@ public class CoeProcessLevelWeb extends ActionWeb {
} }
} }
int sb2index=sb2.indexOf("必填项为空"); if(flag1==true || flag2==true){
if(sb2index!=-1){ sb.append("未填写,请检查!");
sb.append(sb2);
} }
int sb1indexOf=sb.indexOf("必填项为空"); int sb1indexOf=sb.indexOf("未填写");
if(sb1indexOf==-1 && sb2index==-1){ if(sb1indexOf==-1 ){
ro.put("result","ok"); ro.put("result","ok");
}else{ }else{
ro.put("result","error"); ro.put("result","error");