|
@@ -11,6 +11,7 @@ import com.diagbot.service.impl.SysSetServiceImpl;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.EntityUtil;
|
|
import com.diagbot.util.EntityUtil;
|
|
import com.diagbot.util.StringUtil;
|
|
import com.diagbot.util.StringUtil;
|
|
|
|
+import com.diagbot.vo.HospSetVO;
|
|
import com.diagbot.vo.SysSetVO;
|
|
import com.diagbot.vo.SysSetVO;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -27,25 +28,25 @@ import java.util.stream.Collectors;
|
|
*/
|
|
*/
|
|
@Component
|
|
@Component
|
|
public class SysSetFacade extends SysSetServiceImpl {
|
|
public class SysSetFacade extends SysSetServiceImpl {
|
|
- public List<SysSetDTO> getSysSet(SysSetVO sysSetVO){
|
|
|
|
- if (null != sysSetVO && StringUtil.isBlank(sysSetVO.getHospitalCode())){
|
|
|
|
|
|
+ public List<SysSetDTO> getSysSet(SysSetVO sysSetVO) {
|
|
|
|
+ if (null != sysSetVO && StringUtil.isBlank(sysSetVO.getHospitalCode())) {
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "医院编码不能为空!");
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "医院编码不能为空!");
|
|
}
|
|
}
|
|
QueryWrapper<SysSet> sysSetQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<SysSet> sysSetQueryWrapper = new QueryWrapper<>();
|
|
sysSetQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
sysSetQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
- .eq("hospital_code",sysSetVO.getHospitalCode());
|
|
|
|
|
|
+ .eq("hospital_code", sysSetVO.getHospitalCode());
|
|
List<SysSet> sysSetList = this.list(sysSetQueryWrapper);
|
|
List<SysSet> sysSetList = this.list(sysSetQueryWrapper);
|
|
List<SysSetDTO> res = BeanUtil.listCopyTo(sysSetList, SysSetDTO.class);
|
|
List<SysSetDTO> res = BeanUtil.listCopyTo(sysSetList, SysSetDTO.class);
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- public List<SysSetProHosResDTO> getPositon(){
|
|
|
|
|
|
+ public List<SysSetProHosResDTO> getPositon() {
|
|
List<SysSetProHosResDTO> res = new ArrayList<>();
|
|
List<SysSetProHosResDTO> res = new ArrayList<>();
|
|
QueryWrapper<SysSet> sysSetQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<SysSet> sysSetQueryWrapper = new QueryWrapper<>();
|
|
sysSetQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
sysSetQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
- .eq("code","imgUrl")
|
|
|
|
- .ne("province","")
|
|
|
|
|
|
+ .eq("code", "imgUrl")
|
|
|
|
+ .ne("province", "")
|
|
.orderByAsc("province");
|
|
.orderByAsc("province");
|
|
List<SysSet> sysSetList = this.list(sysSetQueryWrapper);
|
|
List<SysSet> sysSetList = this.list(sysSetQueryWrapper);
|
|
Map<String, List<SysSet>> map = EntityUtil.makeEntityListMap(sysSetList, "province");
|
|
Map<String, List<SysSet>> map = EntityUtil.makeEntityListMap(sysSetList, "province");
|
|
@@ -58,4 +59,28 @@ public class SysSetFacade extends SysSetServiceImpl {
|
|
}
|
|
}
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public SysSet getHospSet(HospSetVO hospSetVO) {
|
|
|
|
+ QueryWrapper<SysSet> sysSetQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ sysSetQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("code", hospSetVO.getCode())
|
|
|
|
+ .eq("hospital_code", hospSetVO.getHospitalCode());
|
|
|
|
+ SysSet sysSet = this.getOne(sysSetQueryWrapper, false);
|
|
|
|
+ return sysSet;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public Boolean isCover(String hospitalCode) {
|
|
|
|
+ HospSetVO hospSetVO = new HospSetVO();
|
|
|
|
+ hospSetVO.setCode("isCover");
|
|
|
|
+ hospSetVO.setHospitalCode(hospitalCode);
|
|
|
|
+ SysSet sysSet = getHospSet(hospSetVO);
|
|
|
|
+ if (null == sysSet) {
|
|
|
|
+ return false;
|
|
|
|
+ } else {
|
|
|
|
+ if ("1".equals(sysSet.getValue())) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
}
|
|
}
|