|
@@ -678,9 +678,13 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
|
|
|
FsUserAddress address = null;
|
|
FsUserAddress address = null;
|
|
|
FsUser user=userService.selectFsUserByUserId(param.getUserId());
|
|
FsUser user=userService.selectFsUserByUserId(param.getUserId());
|
|
|
if(user.getStatus()!=1){
|
|
if(user.getStatus()!=1){
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return R.error("非法用户操作");
|
|
return R.error("非法用户操作");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //处理信息采集业务
|
|
|
FsUserInformationCollection collection = userInformationCollectionMapper.selectFsUserInformationCollectionById(param.getCollectionId());
|
|
FsUserInformationCollection collection = userInformationCollectionMapper.selectFsUserInformationCollectionById(param.getCollectionId());
|
|
|
|
|
+ logger.info("用户id:{},信息采集信息:{}",param.getUserId(),JSON.toJSONString(collection));
|
|
|
if (collection != null) {
|
|
if (collection != null) {
|
|
|
|
|
|
|
|
if (collection.getIsPackage() == 1 && !(collection.getAmount().compareTo(new BigDecimal(0))==1) && collection.getPayType() == 2) {
|
|
if (collection.getIsPackage() == 1 && !(collection.getAmount().compareTo(new BigDecimal(0))==1) && collection.getPayType() == 2) {
|
|
@@ -697,6 +701,8 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
FsPatient patient=null;
|
|
FsPatient patient=null;
|
|
|
FsDoctor doctor=null;
|
|
FsDoctor doctor=null;
|
|
|
FsPackage fsPackage=fsPackageMapper.selectFsPackageByPackageId(param.getPackageId());
|
|
FsPackage fsPackage=fsPackageMapper.selectFsPackageByPackageId(param.getPackageId());
|
|
@@ -705,9 +711,11 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
|
|
|
if(param.getPatientId()!=null){
|
|
if(param.getPatientId()!=null){
|
|
|
patient=fsPatientMapper.selectFsPatientByPatientId(param.getPatientId());
|
|
patient=fsPatientMapper.selectFsPatientByPatientId(param.getPatientId());
|
|
|
if (patient==null){
|
|
if (patient==null){
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return R.error("请提交患者信息");
|
|
return R.error("请提交患者信息");
|
|
|
}
|
|
}
|
|
|
}else {
|
|
}else {
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return R.error("请提交患者信息");
|
|
return R.error("请提交患者信息");
|
|
|
}
|
|
}
|
|
|
logger.info("是否是中药或者西药{},{}",fsPackage.getProductType(),fsPackage.getProductType() == 1 || fsPackage.getProductType() == 2);
|
|
logger.info("是否是中药或者西药{},{}",fsPackage.getProductType(),fsPackage.getProductType() == 1 || fsPackage.getProductType() == 2);
|
|
@@ -720,24 +728,29 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
|
|
|
if(param.getDoctorId()!=null){
|
|
if(param.getDoctorId()!=null){
|
|
|
doctor=doctorMapper.selectFsDoctorByDoctorId(param.getDoctorId());
|
|
doctor=doctorMapper.selectFsDoctorByDoctorId(param.getDoctorId());
|
|
|
if(doctor==null||doctor.getStatus().equals(0)){
|
|
if(doctor==null||doctor.getStatus().equals(0)){
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return R.error("此医生已停用");
|
|
return R.error("此医生已停用");
|
|
|
}
|
|
}
|
|
|
Integer orderCount=inquiryOrderMapper.checkAcceptOrder(param.getDoctorId(),param.getUserId());
|
|
Integer orderCount=inquiryOrderMapper.checkAcceptOrder(param.getDoctorId(),param.getUserId());
|
|
|
if(orderCount>0){
|
|
if(orderCount>0){
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return R.error("您正在咨询此医生,请先结束当前订单");
|
|
return R.error("您正在咨询此医生,请先结束当前订单");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if(fsPackage.getStatus().equals(0)){
|
|
if(fsPackage.getStatus().equals(0)){
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return R.error("套餐名已下架");
|
|
return R.error("套餐名已下架");
|
|
|
}
|
|
}
|
|
|
//私域下套餐包(可覆盖医生信息 使用销售绑定的医生信息)
|
|
//私域下套餐包(可覆盖医生信息 使用销售绑定的医生信息)
|
|
|
if (fsPackage.getIsShow()==0){
|
|
if (fsPackage.getIsShow()==0){
|
|
|
if (param.getCompanyId()==null||param.getCompanyUserId()==null){
|
|
if (param.getCompanyId()==null||param.getCompanyUserId()==null){
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return R.error("商品信息过期");
|
|
return R.error("商品信息过期");
|
|
|
}
|
|
}
|
|
|
CompanyUser companyUser = companyUserMapper.selectCompanyUserById(param.getCompanyUserId());
|
|
CompanyUser companyUser = companyUserMapper.selectCompanyUserById(param.getCompanyUserId());
|
|
|
if (companyUser==null){
|
|
if (companyUser==null){
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return R.error("商品信息过期");
|
|
return R.error("商品信息过期");
|
|
|
}
|
|
}
|
|
|
//获取销售绑定医生
|
|
//获取销售绑定医生
|
|
@@ -752,6 +765,7 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
|
|
|
if (num!=0){
|
|
if (num!=0){
|
|
|
int i = fsPackageMapper.selectFsPackageListByUser(param.getUserId(), fsPackage.getPackageId());
|
|
int i = fsPackageMapper.selectFsPackageListByUser(param.getUserId(), fsPackage.getPackageId());
|
|
|
if (i>=num){
|
|
if (i>=num){
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return R.error("超过限购次数");
|
|
return R.error("超过限购次数");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -759,6 +773,7 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
|
|
|
FsPackageOrder order=new FsPackageOrder();
|
|
FsPackageOrder order=new FsPackageOrder();
|
|
|
String orderSn = OrderCodeUtils.getOrderSn();
|
|
String orderSn = OrderCodeUtils.getOrderSn();
|
|
|
if(StringUtils.isEmpty(orderSn)){
|
|
if(StringUtils.isEmpty(orderSn)){
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return R.error("订单生成失败,请重试");
|
|
return R.error("订单生成失败,请重试");
|
|
|
}
|
|
}
|
|
|
order.setPayType(param.getPayType());
|
|
order.setPayType(param.getPayType());
|
|
@@ -878,6 +893,7 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return R.error("用户信息采集错误,创建失败");
|
|
return R.error("用户信息采集错误,创建失败");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -887,6 +903,7 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
|
|
|
return R.ok().put("order",order).put("storeOrder",fsStoreOrder);
|
|
return R.ok().put("order",order).put("storeOrder",fsStoreOrder);
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return R.error("创建失败");
|
|
return R.error("创建失败");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|