Commit a736e4e4 by 宋祥

1.项目来源优先根据小代码进行匹配

parent b8643c38
......@@ -6,6 +6,7 @@ import com.baosight.hggp.core.extapp.decheng.api.DcOpenApi;
import com.baosight.hggp.core.extapp.decheng.model.DcContract;
import com.baosight.hggp.core.extapp.decheng.model.DcContractList;
import com.baosight.hggp.core.model.Pager;
import com.baosight.hggp.core.tools.CodeValueTools;
import com.baosight.hggp.core.utils.ThreadUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
......@@ -232,8 +233,19 @@ public class ServiceHGSC101 extends ServiceEPBase {
* @return
*/
private String getProjectSource(String name) {
ProjectSourceEnum projectSourceEnum = ProjectSourceEnum.getByName(name);
return projectSourceEnum == null ? ProjectSourceEnum.OTHER.getCode() : projectSourceEnum.getCode();
List<Map> codesetMaps = CodeValueTools.getCodeValues("app.sc.projectSource");
if (CollectionUtils.isEmpty(codesetMaps)) {
ProjectSourceEnum projectSourceEnum = ProjectSourceEnum.getByName(name);
return projectSourceEnum == null ? ProjectSourceEnum.OTHER.getCode() : projectSourceEnum.getCode();
}
for (Map codesetMap : codesetMaps) {
String value = MapUtils.getString(codesetMap, "value");
String text = MapUtils.getString(codesetMap, "label");
if (text.equals(name)) {
return value;
}
}
return ProjectSourceEnum.OTHER.getCode();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment