|
@@ -34,10 +34,7 @@ import com.fs.hospital580.service.Hospital580PrescriptionMedicineScrmService;
|
|
|
import com.fs.hospital580.service.Hospital580PrescriptionScrmService;
|
|
import com.fs.hospital580.service.Hospital580PrescriptionScrmService;
|
|
|
import com.fs.hospital580.service.Hospital580Service;
|
|
import com.fs.hospital580.service.Hospital580Service;
|
|
|
import com.fs.hospital580.util.ThumbnailatorWatermark;
|
|
import com.fs.hospital580.util.ThumbnailatorWatermark;
|
|
|
-import com.fs.hospital580.vo.MedicineSyncVo;
|
|
|
|
|
-import com.fs.hospital580.vo.PrescriptionMedicineScrmVo;
|
|
|
|
|
-import com.fs.hospital580.vo.RefusePrescriptionVo;
|
|
|
|
|
-import com.fs.hospital580.vo.ReviewPrescriptionVo;
|
|
|
|
|
|
|
+import com.fs.hospital580.vo.*;
|
|
|
import com.fs.hospital580.vo.req.DiseaseReq;
|
|
import com.fs.hospital580.vo.req.DiseaseReq;
|
|
|
import com.fs.hospital580.vo.req.Prescription580Req;
|
|
import com.fs.hospital580.vo.req.Prescription580Req;
|
|
|
import com.fs.hospital580.vo.req.PrescriptionListReq;
|
|
import com.fs.hospital580.vo.req.PrescriptionListReq;
|
|
@@ -55,9 +52,7 @@ import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.Period;
|
|
import java.time.Period;
|
|
|
import java.time.ZoneId;
|
|
import java.time.ZoneId;
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
-import java.util.Optional;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
@@ -111,6 +106,20 @@ public class Hospital580FacadeServiceImpl implements Hospital580FacadeService {
|
|
|
if(storeScrm == null){
|
|
if(storeScrm == null){
|
|
|
throw new FSException("操作失败,店铺信息不存在!");
|
|
throw new FSException("操作失败,店铺信息不存在!");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //过滤商品信息
|
|
|
|
|
+ AnswerDataVo answerDataVo= vo.getBeforeAiDataList().stream().filter(item -> item.getTitle().equals("居民用药信息选择")).findFirst().orElse(null);
|
|
|
|
|
+ if(answerDataVo == null){
|
|
|
|
|
+ throw new FSException("操作失败,请选择用药信息!");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ AnswerDataVo fileDataVo = filterProduct(answerDataVo);
|
|
|
|
|
+ List<AnswerDataVo> newList = vo.getBeforeAiDataList().stream()
|
|
|
|
|
+ .filter(item -> !item.getTitle().equals("居民用药信息选择"))
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ newList.add(fileDataVo);
|
|
|
|
|
+ vo.setBeforeAiDataList(newList);
|
|
|
|
|
+
|
|
|
// 保存问诊信息
|
|
// 保存问诊信息
|
|
|
Hospital580PrescriptionScrmEntity order = new Hospital580PrescriptionScrmEntity();
|
|
Hospital580PrescriptionScrmEntity order = new Hospital580PrescriptionScrmEntity();
|
|
|
BeanUtil.copyProperties(vo, order);
|
|
BeanUtil.copyProperties(vo, order);
|
|
@@ -369,4 +378,31 @@ public class Hospital580FacadeServiceImpl implements Hospital580FacadeService {
|
|
|
}
|
|
}
|
|
|
return value;
|
|
return value;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 过滤非处方商品
|
|
|
|
|
+ * **/
|
|
|
|
|
+ private AnswerDataVo filterProduct(AnswerDataVo dataVo){
|
|
|
|
|
+ List<Long> ids=new LinkedList<>();
|
|
|
|
|
+ JSONArray jsonArray = JSONUtil.parseArray(dataVo.getAnswerMedicine());
|
|
|
|
|
+ Map<Long,Object> numMap = new HashMap<>();
|
|
|
|
|
+ for (Object o:jsonArray){
|
|
|
|
|
+ JSONObject jsonObject = JSONUtil.parseObj(o);
|
|
|
|
|
+ ids.add(jsonObject.getLong("medicineId"));
|
|
|
|
|
+ numMap.put(jsonObject.getLong("medicineId"),jsonObject.getInt("number"));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //获取商品信息
|
|
|
|
|
+ JSONArray array = new JSONArray();
|
|
|
|
|
+ List<FsStoreProductScrm> fsStoreProductScrms = productScrmService.getStoreProductInProductIds(ids);
|
|
|
|
|
+
|
|
|
|
|
+ fsStoreProductScrms.stream().filter(f-> f.getProductType() == 2).forEach(f->{
|
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
|
+ jsonObject.set("medicineId", f.getProductId());
|
|
|
|
|
+ jsonObject.set("number", numMap.get(f.getProductId()));
|
|
|
|
|
+ array.add(jsonObject);
|
|
|
|
|
+ });
|
|
|
|
|
+ dataVo.setAnswerMedicine(array.toString());
|
|
|
|
|
+ return dataVo;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|