package com.ann.demo.interfaces.impl; import com.ann.demo.entity.filing.ArchiveMaster; import com.ann.demo.interfaces.HomepageDictionary; import com.ann.demo.service.ArchiveDetailService; import com.ann.demo.service.ArchiveMasterService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import javax.jws.WebService; import java.util.*; /** * @Author: LeiJiaXin * @Date: 2019/6/11 17:01 */ @WebService(serviceName = "HomepageDictionary", // 与接口中指定的name一致 targetNamespace = "http://interfaces.demo.ann.com/", // 与接口中的命名空间一致,一般是接口的包名倒 endpointInterface = "com.ann.demo.interfaces.HomepageDictionary"// 接口地址 ) public class HomepageDictionaryImpl implements HomepageDictionary { private static final Logger logger = LoggerFactory.getLogger(HomepageDictionaryImpl.class); @Autowired private ArchiveDetailService archiveDetailService; @Autowired private ArchiveMasterService archiveMasterService; public static String mustCheckData; @Value("${mustCheckData}") public void setMustCheckData(String mustCheckData) { HomepageDictionaryImpl.mustCheckData = mustCheckData; } public static String deathMustCheckData; @Value("${deathMustCheckData}") public void setBabyMustCheckData(String deathMustCheckData) { HomepageDictionaryImpl.deathMustCheckData = deathMustCheckData; } @Override public String CheckData(String masterId) { StringBuffer sb = new StringBuffer(); try { Optional archiveMaster = archiveMasterService.findById(masterId); if (!archiveMaster.isPresent()) { return "没有该患者信息!"; } // 必须检查类型 sb = new StringBuffer(); //判断是否是死亡病例 if(StringUtils.isNoneBlank(archiveMaster.get().getDischargeDisposition())){ if (archiveMaster.get().getDischargeDisposition().equalsIgnoreCase("5")){ if (!deathMustCheckData.equals("")) { String[] mustCheckDataArray = deathMustCheckData.split(","); List types = Arrays.asList(mustCheckDataArray); String typeIsExits = archiveDetailService.getTypeNotExits(types, masterId); if (typeIsExits != null) { sb.append(typeIsExits + "缺失"); } } } else { if (!mustCheckData.equals("")) { String[] mustCheckDataArray = mustCheckData.split(","); List types = Arrays.asList(mustCheckDataArray); String typeIsExits = archiveDetailService.getTypeNotExits(types, masterId); if (typeIsExits != null) { sb.append(typeIsExits + "缺失"); } } } }else{ if (!mustCheckData.equals("")) { String[] mustCheckDataArray = mustCheckData.split(","); List types = Arrays.asList(mustCheckDataArray); String typeIsExits = archiveDetailService.getTypeNotExits(types, masterId); if (typeIsExits != null) { sb.append(typeIsExits + "缺失"); } } } //最后 if (sb.length() == 0) { sb.append("完整"); } } catch (Exception e) { sb.setLength(0); sb.append("服务器正忙"); logger.error("出错了:", e); } return sb + ""; } }