|
|
@@ -11,6 +11,7 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fs.common.BeanCopyUtils;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
@@ -56,7 +57,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
/**
|
|
|
* 用户信息采集Service业务层处理
|
|
|
- *
|
|
|
+ *
|
|
|
* @author fs
|
|
|
* @date 2025-10-14
|
|
|
*/
|
|
|
@@ -104,7 +105,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
|
|
|
/**
|
|
|
* 查询用户信息采集
|
|
|
- *
|
|
|
+ *
|
|
|
* @param id 用户信息采集主键
|
|
|
* @return 用户信息采集
|
|
|
*/
|
|
|
@@ -116,7 +117,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
|
|
|
/**
|
|
|
* 查询用户信息采集列表
|
|
|
- *
|
|
|
+ *
|
|
|
* @param fsUserInformationCollection 用户信息采集
|
|
|
* @return 用户信息采集
|
|
|
*/
|
|
|
@@ -128,7 +129,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
|
|
|
/**
|
|
|
* 新增用户信息采集
|
|
|
- *
|
|
|
+ *
|
|
|
* @param param 用户信息采集
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@@ -143,7 +144,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
|
|
|
/**
|
|
|
* 修改用户信息采集
|
|
|
- *
|
|
|
+ *
|
|
|
* @param param 用户信息采集
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@@ -167,7 +168,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
|
|
|
/**
|
|
|
* 批量删除用户信息采集
|
|
|
- *
|
|
|
+ *
|
|
|
* @param ids 需要删除的用户信息采集主键
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@@ -179,7 +180,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
|
|
|
/**
|
|
|
* 删除用户信息采集信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @param id 用户信息采集主键
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@@ -340,15 +341,26 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
map.setDoctorConfirm(1);
|
|
|
//插入生成处方签定时任务数据
|
|
|
if(fsUserInformationCollection.getPackageOrderCode() != null) {
|
|
|
- FsStoreOrder fsStoreOrder = storeOrderService.selectFsStoreOrderByOrderCode(fsUserInformationCollection.getPackageOrderCode());
|
|
|
- if (fsStoreOrder != null && fsStoreOrder.getIsPay() == 1) {
|
|
|
- if (fsStoreOrder.getPrescribeId() != null) {
|
|
|
- FsPrescribeParam fsPrescribeParam = new FsPrescribeParam();
|
|
|
- fsPrescribeParam.setPrescribeId(fsStoreOrder.getPrescribeId());
|
|
|
- prescribeService.confirmPrescribe(fsPrescribeParam);
|
|
|
+ //套餐包订单
|
|
|
+ FsPackageOrder fsPackageOrder = packageOrderMapper.selectByOderCode(fsUserInformationCollection.getPackageOrderCode());
|
|
|
+ if (fsPackageOrder != null && fsPackageOrder.getIsPay() == 1) {
|
|
|
+ //套餐包信息
|
|
|
+ FsPackage fsPackage = JSON.parseObject(fsPackageOrder.getPackageJson(), FsPackage.class);
|
|
|
+
|
|
|
+ //套餐包为药品生成处方信息
|
|
|
+ if(fsPackage != null && (fsPackage.getProductType() == 1 || fsPackage.getProductType() == 2)) {
|
|
|
+ FsStoreOrder fsStoreOrder = storeOrderService.selectFsStoreOrderByOrderCode(fsUserInformationCollection.getPackageOrderCode());
|
|
|
+ if (fsStoreOrder != null && fsStoreOrder.getIsPay() == 1 ) {
|
|
|
+ if (fsStoreOrder.getPrescribeId() != null) {
|
|
|
+ FsPrescribeParam fsPrescribeParam = new FsPrescribeParam();
|
|
|
+ fsPrescribeParam.setPrescribeId(fsStoreOrder.getPrescribeId());
|
|
|
+ prescribeService.confirmPrescribe(fsPrescribeParam);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new CustomException("生成处方信息中......");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
} else {
|
|
|
//没有关联套餐包医生确认清空所有状态
|
|
|
@@ -382,9 +394,9 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
|
|
|
if (collection != null) {
|
|
|
|
|
|
- if (!Objects.equals(collection.getUserId(), userId)) {
|
|
|
- return vo;
|
|
|
- }
|
|
|
+// if (!Objects.equals(collection.getUserId(), userId)) {
|
|
|
+// return vo;
|
|
|
+// }
|
|
|
if (collection.getIsPackage() == 1) {
|
|
|
vo.setPackageId(collection.getPackageId());
|
|
|
vo.setPayType(collection.getPayType());
|
|
|
@@ -438,6 +450,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public R userConfirm(CollectionInfoConfirmParam param) {
|
|
|
+
|
|
|
if (param.getId() == null) {
|
|
|
return R.error("参数错误");
|
|
|
}
|
|
|
@@ -450,6 +463,9 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
return R.error("用户已确认");
|
|
|
}
|
|
|
}
|
|
|
+ if (!Objects.equals(collection.getUserId(), param.getUserId())) {
|
|
|
+ return R.error("用户信息不匹配,无法确认");
|
|
|
+ }
|
|
|
FsUserInformationCollection map = new FsUserInformationCollection();
|
|
|
map.setId(param.getId());
|
|
|
map.setUserConfirm(1);
|
|
|
@@ -460,7 +476,8 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
//第一次确认
|
|
|
if (collection.getStatus() == 1) {
|
|
|
map.setStatus(2);
|
|
|
- } else if (collection.getStatus() == 2) {
|
|
|
+ }
|
|
|
+ else if (collection.getStatus() == 2) {
|
|
|
//清空订单号
|
|
|
fsUserInformationCollectionMapper.collectionOderCodeNULL(collection.getId());
|
|
|
map.setStatus(1);
|