|
|
@@ -24,10 +24,7 @@ import com.fs.his.domain.*;
|
|
|
import com.fs.his.dto.FsUserInformationCollectionDTO;
|
|
|
import com.fs.his.enums.FsStoreOrderStatusEnum;
|
|
|
import com.fs.his.mapper.*;
|
|
|
-import com.fs.his.param.CollectionInfoConfirmParam;
|
|
|
-import com.fs.his.param.FsInquiryOrderCreateParam;
|
|
|
-import com.fs.his.param.FsUserInformationCollectionListDParam;
|
|
|
-import com.fs.his.param.FsUserInformationCollectionParam;
|
|
|
+import com.fs.his.param.*;
|
|
|
import com.fs.his.service.*;
|
|
|
import com.fs.his.utils.ConfigUtil;
|
|
|
import com.fs.his.vo.*;
|
|
|
@@ -176,6 +173,12 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
return baseMapper.selectFsUserInformationCollectionList(fsUserInformationCollection);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<FsUserInformationCollection> selectFsUserInformationCollectionByDoctorType2(UserInformationDoctorType2Param userInformationDoctorType2Param) {
|
|
|
+ return fsUserInformationCollectionMapper.selectFsUserInformationCollectionByDoctorType2(userInformationDoctorType2Param);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 新增用户信息采集
|
|
|
*
|
|
|
@@ -467,6 +470,10 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
map.setDoctorConfirm(1);
|
|
|
//医生确认时间
|
|
|
map.setDoctorConfirmTime(DateUtils.getNowDate());
|
|
|
+ //写入医生签名
|
|
|
+ FsDoctor fsDoctor = doctorMapper.selectFsDoctorByDoctorId(fsUserInformationCollection.getDoctorId());
|
|
|
+ map.setDoctorSign(fsDoctor.getSignUrl());
|
|
|
+ map.setDoctorAdvice(collection.getDoctorAdvice());
|
|
|
if (answerVOS != null && !answerVOS.isEmpty()) {
|
|
|
map.setJsonInfo(JSON.toJSONString(answerVOS));
|
|
|
}
|
|
|
@@ -503,22 +510,76 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
if (fsUserInformationCollectionMapper.updateFsUserInformationCollection(map) > 0) {
|
|
|
|
|
|
//更新医生确认信息
|
|
|
- FsDoctorConfirm doctorConfirm = redisCache.getCacheObject("doctorConfirm:" + collection.getId());
|
|
|
- if(doctorConfirm == null) {
|
|
|
- return R.error("没有医生确认信息");
|
|
|
- }
|
|
|
- doctorConfirm.setDoctorEndTime(DateUtils.getNowDate());
|
|
|
- Long seconds = DateUtil.between(doctorConfirm.getStartTime(), doctorConfirm.getDoctorEndTime(), DateUnit.SECOND);
|
|
|
- doctorConfirm.setConfirmSecond(seconds);
|
|
|
- doctorConfirmService.updateFsDoctorConfirm(doctorConfirm);
|
|
|
- redisCache.deleteObject("doctorConfirm:" + collection.getId());
|
|
|
-
|
|
|
+// FsDoctorConfirm doctorConfirm = redisCache.getCacheObject("doctorConfirm:" + collection.getId());
|
|
|
+// if(doctorConfirm == null) {
|
|
|
+// return R.error("没有医生确认信息");
|
|
|
+// }
|
|
|
+// doctorConfirm.setDoctorEndTime(DateUtils.getNowDate());
|
|
|
+// Long seconds = DateUtil.between(doctorConfirm.getStartTime(), doctorConfirm.getDoctorEndTime(), DateUnit.SECOND);
|
|
|
+// doctorConfirm.setConfirmSecond(seconds);
|
|
|
+// doctorConfirmService.updateFsDoctorConfirm(doctorConfirm);
|
|
|
+// redisCache.deleteObject("doctorConfirm:" + collection.getId());
|
|
|
|
|
|
+ openIMService.doctorSendMsgToUser(collection.getUserId(),collection.getDoctorId());
|
|
|
return R.ok();
|
|
|
}
|
|
|
return R.error("医生确认失败");
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public R doctorType2Confirm(FsUserInformationCollection collection) {
|
|
|
+ FsUserInformationCollection fsUserInformationCollection = fsUserInformationCollectionMapper.selectFsUserInformationCollectionById(collection.getId());
|
|
|
+ if (fsUserInformationCollection == null) {
|
|
|
+ return R.error("没有用户采集信息");
|
|
|
+ }
|
|
|
+ if (fsUserInformationCollection.getUserConfirm() == 0){
|
|
|
+ return R.error("用户未确认");
|
|
|
+ }
|
|
|
+ if (fsUserInformationCollection.getDoctorType2Confirm() == 1){
|
|
|
+ return R.error("药师已确认");
|
|
|
+ }
|
|
|
+ if (fsUserInformationCollection.getDoctorConfirm() != 1) {
|
|
|
+ return R.error("医生未签字无法确认");
|
|
|
+ }
|
|
|
+ if(StringUtils.isEmpty(fsUserInformationCollection.getPackageOrderCode())){
|
|
|
+ return R.error("用户未下单,无需确认");
|
|
|
+ }
|
|
|
+ List<AnswerVO> answerVOS = null;
|
|
|
+ //医生确认确认状态为true(用于封档)
|
|
|
+ if (StringUtils.isNotEmpty(fsUserInformationCollection.getJsonInfo()) ){
|
|
|
+ answerVOS = JSONArray.parseArray(fsUserInformationCollection.getJsonInfo(), AnswerVO.class);
|
|
|
+ answerVOS.forEach(answerVO -> {
|
|
|
+ answerVO.setFlag(true);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ FsUserInformationCollection map = new FsUserInformationCollection();
|
|
|
+ map.setId(collection.getId());
|
|
|
+ map.setDoctorType2Confirm(1);
|
|
|
+ //医生确认时间
|
|
|
+ map.setDoctorConfirmTime(DateUtils.getNowDate());
|
|
|
+ //写入药师签名
|
|
|
+ FsDoctor fsDoctor = doctorMapper.selectFsDoctorByDoctorId(fsUserInformationCollection.getDoctorType2Id());
|
|
|
+ map.setDoctorType2Sign(fsDoctor.getSignUrl());
|
|
|
+ map.setDoctorAdvice(collection.getDoctorAdvice());
|
|
|
+ if (answerVOS != null && !answerVOS.isEmpty()) {
|
|
|
+ map.setJsonInfo(JSON.toJSONString(answerVOS));
|
|
|
+ }
|
|
|
+//
|
|
|
+
|
|
|
+ if (fsUserInformationCollectionMapper.updateFsUserInformationCollection(map) > 0) {
|
|
|
+ FsPackageOrder fsPackageOrder = packageOrderMapper.selectFsPackageOrderByOrderSn(collection.getPackageOrderCode());
|
|
|
+ if(fsPackageOrder.getStoreOrderId()==null||fsPackageOrder.getStoreOrderId()==0){
|
|
|
+ return R.error("用户未支付,无需确认");
|
|
|
+ }
|
|
|
+ FsStoreOrder fsStoreOrder = storeOrderService.selectFsStoreOrderByOrderId(fsPackageOrder.getStoreOrderId());
|
|
|
+ fsStoreOrder.setDoctorType2Confirm(1);
|
|
|
+ storeOrderService.updateFsStoreOrder(fsStoreOrder);
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+ return R.error("药师确认失败");
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public FsUserInfoCollectionUVO info(Long id, Long userId) {
|
|
|
FsUserInfoCollectionUVO vo = new FsUserInfoCollectionUVO();
|
|
|
@@ -609,6 +670,10 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
map.setId(param.getId());
|
|
|
map.setUserConfirm(1);
|
|
|
map.setUserAdvice(param.getUserAdvice());
|
|
|
+ if (param.getPatientId() == null|| param.getPatientId() == 0) {
|
|
|
+ return R.error("请提交就诊人信息");
|
|
|
+ }
|
|
|
+ map.setPatientId(param.getPatientId());
|
|
|
if (collection.getStatus() == 1) {
|
|
|
|
|
|
openIMService.sendUserInformation(collection.getUserId(),collection.getDoctorId(),collection.getId());
|
|
|
@@ -865,6 +930,11 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
return fsUserInformationCollectionMapper.selectFsUserInformationCollectionDTOById(id);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public int updatePackageOrderCode(FsUserInformationCollection fsUserInformationCollection) {
|
|
|
+ return fsUserInformationCollectionMapper.updateFsUserInformationCollection(fsUserInformationCollection);
|
|
|
+ }
|
|
|
+
|
|
|
private List<AnswerVO> getAnswerVOs(List<AnswerVO> target,List<AnswerVO> source) {
|
|
|
target.addAll(source);
|
|
|
return target.stream()
|
|
|
@@ -914,6 +984,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
//随机获取医生id
|
|
|
doctorId = iFsDoctorService.selectFsDoctorDoctorByPackage();
|
|
|
}
|
|
|
+ doctorId = 324l;
|
|
|
fsUserInformationCollection.setDoctorId(doctorId);
|
|
|
|
|
|
return fsUserInformationCollection;
|