|
@@ -21,6 +21,7 @@ import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
+import com.diagbot.vo.DVDetailVO;
|
|
|
import com.diagbot.vo.DeptVitalPageVO;
|
|
|
import com.diagbot.vo.DeptVitalVO;
|
|
|
import com.google.common.collect.Lists;
|
|
@@ -69,13 +70,14 @@ public class DeptVitalFacade extends DeptVitalServiceImpl {
|
|
|
|
|
|
//查找标签是否存在
|
|
|
QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
- questionInfoQueryWrapper.in("id", deptVitalVO.getVitalIds()).
|
|
|
+ List<Long> vitalIds = deptVitalVO.getDvDetailVOList().stream().map(deDetailVO -> deDetailVO.getVitalId()).collect(Collectors.toList());
|
|
|
+ questionInfoQueryWrapper.in("id", vitalIds).
|
|
|
eq("type", QuestionTypeEnum.Vital.getKey()).
|
|
|
eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
|
|
|
|
|
|
Map<Long, QuestionInfo> questionInfoMap = EntityUtil.makeEntityMap(questionInfoList, "id");
|
|
|
- for (Long vital : deptVitalVO.getVitalIds()) {
|
|
|
+ for (Long vital : vitalIds) {
|
|
|
if (questionInfoMap.get(vital) == null) {
|
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS, "id=" + vital + "的查体标签不存在");
|
|
|
}
|
|
@@ -85,10 +87,11 @@ public class DeptVitalFacade extends DeptVitalServiceImpl {
|
|
|
List<DeptVital> deptVitalList = Lists.newArrayList();
|
|
|
Date now = DateUtil.now();
|
|
|
String userId = UserUtils.getCurrentPrincipleID();
|
|
|
- for (Long vital : deptVitalVO.getVitalIds()) {
|
|
|
+ for (DVDetailVO dvDetailVO : deptVitalVO.getDvDetailVOList()) {
|
|
|
DeptVital deptVital = new DeptVital();
|
|
|
deptVital.setDeptId(deptVitalVO.getDeptId());
|
|
|
- deptVital.setVitalId(vital);
|
|
|
+ deptVital.setVitalId(dvDetailVO.getVitalId());
|
|
|
+ deptVital.setOrderNo(dvDetailVO.getOrderNo());
|
|
|
deptVital.setCreator(userId);
|
|
|
deptVital.setGmtCreate(now);
|
|
|
deptVital.setModifier(userId);
|
|
@@ -108,8 +111,9 @@ public class DeptVitalFacade extends DeptVitalServiceImpl {
|
|
|
*/
|
|
|
public Boolean delDeptVitalList(DeptVitalVO deptVitalVO) {
|
|
|
UpdateWrapper<DeptVital> deptVitalUpdateWrapper = new UpdateWrapper<>();
|
|
|
+ List<Long> vitalIds = deptVitalVO.getDvDetailVOList().stream().map(deDetailVO -> deDetailVO.getVitalId()).collect(Collectors.toList());
|
|
|
deptVitalUpdateWrapper.eq("dept_id", deptVitalVO.getDeptId()).
|
|
|
- in("vital_id", deptVitalVO.getVitalIds()).
|
|
|
+ in("vital_id", vitalIds).
|
|
|
eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
|
set("is_deleted", IsDeleteEnum.Y.getKey()).
|
|
|
set("modifier", UserUtils.getCurrentPrincipleID()).
|
|
@@ -154,7 +158,8 @@ public class DeptVitalFacade extends DeptVitalServiceImpl {
|
|
|
//已关联查体
|
|
|
QueryWrapper<DeptVital> deptVitalQueryWrapper = new QueryWrapper<>();
|
|
|
deptVitalQueryWrapper.eq("dept_id", deptId).
|
|
|
- eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+ eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
|
+ orderByAsc("order_no");
|
|
|
List<DeptVital> deptVitalList = this.list(deptVitalQueryWrapper);
|
|
|
List<Long> vitalIds = deptVitalList.stream()
|
|
|
.map(deptVitals -> deptVitals.getVitalId())
|