Selaa lähdekoodia

1. 商城商品新增ERP类型 2.优化看课统计销售昵称筛选 3.优化信息采集支付0元业务流程

wjj 4 viikkoa sitten
vanhempi
commit
68d827f52e

+ 4 - 0
fs-service/src/main/java/com/fs/his/mapper/FsPackageMapper.java

@@ -133,8 +133,12 @@ public interface FsPackageMapper
             "<if test = 'maps.appId == null or maps.appId == \"\"'> " +
             "and (app_ids is null or app_ids = '')" +
             "</if>" +
+            "<if test = 'maps.isCollection != null '> " +
+            " and (p.product_type = 1 or p.product_type = 2 or p.product_type = 3 ) " +
+            "</if>" +
             " order by p.sort desc,package_id  "+
             "</script>"})
+
     List<FsPackageListUVO> selectFsPackageListUVO(@Param("maps") FsPackageListUParam param);
     @Select("select count(order_id) from fs_package_order WHERE user_id=#{userId} AND package_id=#{packageId} AND `status`>=0")
     int selectFsPackageListByUser(@Param("userId")Long userId,@Param("packageId")Long packageId);

+ 1 - 0
fs-service/src/main/java/com/fs/his/param/FsPackageListUParam.java

@@ -7,6 +7,7 @@ import java.io.Serializable;
 
 @Data
 public class FsPackageListUParam  implements Serializable {
+    private Integer isCollection;
     private Integer diseaseType;
     private Integer privateType;
     private Integer isShow;

+ 14 - 14
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -943,9 +943,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
             if (prescribeId != null) {
                 redisCache.setCacheObject("collectionPrescribeId:" + prescribeId, collection);
             }
+            FsPrescribe prescribe = prescribeMapper.selectFsPrescribeByPrescribeId(prescribeId);
             if (collection.getIsPackage() == 1 && Arrays.asList(1, 2, 3).contains(fsPackage.getProductType())) {
-                FsPrescribe prescribe = prescribeMapper.selectFsPrescribeByPrescribeId(prescribeId);
-
                 DoctorMsg msg = new DoctorMsg();
                 String name = collection.getUserName() != null ? collection.getUserName() : "-";
                 msg.setTitle("用户信息采集开方");
@@ -959,19 +958,20 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
                 }
                 msg.setCreateTime(DateUtils.getNowDate());
                 doctorMsgMapper.insertDoctorMsg(msg);
-                //更新任务订单号
-                FsUserInformationCollectionSchedule schedule = scheduleMapper.selectCollectionScheduleByCollectionId(collection.getId());
-                if (schedule != null) {
-                    FsUserInformationCollectionSchedule map = new FsUserInformationCollectionSchedule();
-                    map.setId(schedule.getId());
-                    map.setOrderCode(packageOrder.getOrderSn());
-                    map.setCurrentStep(PrescriptionTaskStepEnum.WAITING_PRESCRIBE.getCode());
-                    if (prescribe != null) {
-                        map.setDoctorId(prescribe.getDoctorId());
-                        map.setDrugDoctorId(prescribe.getDrugDoctorId());
-                    }
-                    informationCollectionScheduleMapper.updateFsUserInformationCollectionSchedule(map);
+
+            }
+            //更新任务订单号
+            FsUserInformationCollectionSchedule schedule = scheduleMapper.selectCollectionScheduleByCollectionId(collection.getId());
+            if (schedule != null) {
+                FsUserInformationCollectionSchedule map = new FsUserInformationCollectionSchedule();
+                map.setId(schedule.getId());
+                map.setOrderCode(packageOrder.getOrderSn());
+                map.setCurrentStep(PrescriptionTaskStepEnum.WAITING_PRESCRIBE.getCode());
+                if (prescribe != null) {
+                    map.setDoctorId(prescribe.getDoctorId());
+                    map.setDrugDoctorId(prescribe.getDrugDoctorId());
                 }
+                informationCollectionScheduleMapper.updateFsUserInformationCollectionSchedule(map);
             }
         }
         order.setStatus(2);

+ 1 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsUserInformationCollectionParam.java

@@ -47,4 +47,5 @@ public class FsUserInformationCollectionParam {
 
     /** 公司id */
     private Long companyId;
+
 }

+ 26 - 1
fs-service/src/main/java/com/fs/hisStore/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -215,6 +215,12 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
     public Long insertFsUserInformationCollection(FsUserInformationCollectionParam param)
     {
         FsUserInformationCollection fsUserInformationCollection = getFsUserInformationCollection(param);
+        if (param.getIsPackage() == 1) {
+            FsPackage fsPackage = packageMapper.selectFsPackageByPackageId(param.getPackageId());
+            if (fsPackage != null && !(fsPackage.getProductType() == 1 || fsPackage.getProductType() == 2 || fsPackage.getProductType() ==3)) {
+                throw new CustomException("该套餐不支持用户信息采集");
+            }
+        }
         fsUserInformationCollection.setCreateTime(DateUtils.getNowDate());
         baseMapper.insertFsUserInformationCollection(fsUserInformationCollection);
         //新增用户信息采集表的同时记录用户信息采集进度
@@ -252,6 +258,12 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         if (collection.getUserConfirm() == 1 && collection.getUserConfirm2() == 0) {
             throw new CustomException("确认中,暂无法修改");
         }
+        if (param.getIsPackage() == 1) {
+            FsPackage fsPackage = packageMapper.selectFsPackageByPackageId(param.getPackageId());
+            if (fsPackage != null && !(fsPackage.getProductType() == 1 || fsPackage.getProductType() == 2 || fsPackage.getProductType() ==3)) {
+                throw new CustomException("该疗法不支持用户信息采集");
+            }
+        }
         //编辑用户信息采集信息时,同时新增采集进度数据(先中止再新增)
         //获取当前用户正在运行的信息采集进度
         FsUserInformationCollectionSchedule schedule = scheduleMapper.selectCollectionScheduleRunningByCollectionId(collection.getId());
@@ -349,6 +361,10 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
             } else {
                 vo.setAnswers(JSON.parseArray(fsUserInformationCollection.getJsonInfo(), AnswerVO.class));
             }
+            FsUserInformationCollectionSchedule schedule = scheduleMapper.selectPendingSchedule(fsUserInformationCollection.getId());
+            if (schedule != null) {
+                vo.setIsShare(1);
+            }
         }
         if (questionId != null) {
             vo.setQuestionId(questionId);
@@ -663,6 +679,13 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         if (!Objects.equals(collection.getUserId(), param.getUserId())) {
             return R.error("用户信息不匹配,无法确认");
         }
+        if (collection.getIsPackage() == 1) {
+            FsPackage fsPackage = packageMapper.selectFsPackageByPackageId(collection.getPackageId());
+            if (fsPackage != null && !(fsPackage.getProductType() == 1 || fsPackage.getProductType() == 2 || fsPackage.getProductType() ==3)) {
+                return R.error("该套餐包不支持用户确认");
+            }
+        }
+
 
         FsUserInformationCollection map = new FsUserInformationCollection();
         map.setId(param.getId());
@@ -671,7 +694,9 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         //用户信息采集表id
         Long collectionId = collection.getId();
         FsUserInformationCollectionSchedule schedule = scheduleMapper.selectCollectionScheduleByCollectionId(collectionId);
-        if (schedule != null&&(schedule.getStatus() == 2||schedule.getStatus() == 3)) {
+
+        //支付0元的创建订单就是待开方
+        if (schedule != null&&(schedule.getStatus() == 2||schedule.getStatus() == 3) && collection.getAmount().compareTo(new BigDecimal(0))==1) {
             return R.error("用户采集信息已更新,请扫描最新二维码确认");
         }
         if (collection.getStatus() == 1) {

+ 2 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsUserInformationCollectionVO.java

@@ -44,4 +44,6 @@ public class FsUserInformationCollectionVO {
     //医生建议
     private String doctorAdvice;
 
+    private Integer isShare;
+
 }

+ 3 - 0
fs-service/src/main/java/com/fs/qw/mapper/FsUserInformationCollectionScheduleMapper.java

@@ -100,4 +100,7 @@ public interface FsUserInformationCollectionScheduleMapper extends BaseMapper<Fs
      * 根据订单编号列表查询用户信息采集进度列表
      * */
     List<FsUserInformationCollectionSchedule> selectCollectionScheduleListByOrderCodeList(@Param("orderCodes") List<String> orderCodes);
+
+    @Select("SELECT * FROM fs_user_information_collection_schedule  WHERE collection_id = #{collectionId} AND `status` = 1 LIMIT 1")
+    FsUserInformationCollectionSchedule selectPendingSchedule(Long collectionId);
 }

+ 6 - 6
fs-user-app/src/main/java/com/fs/app/controller/UserInfoCollectionController.java

@@ -80,9 +80,9 @@ public class UserInfoCollectionController extends AppBaseController {
     @PostMapping("/add")
     public R add(@RequestBody FsUserInformationCollectionParam fsUserInformationCollection)
     {
-        FsUser user=userService.selectFsUserByUserId(Long.parseLong(getUserId()));
-        fsUserInformationCollection.setCompanyUserId(user.getCompanyUserId());
-        fsUserInformationCollection.setCompanyId(user.getCompanyId());
+//        FsUser user=userService.selectFsUserByUserId(Long.parseLong(getUserId()));
+//        fsUserInformationCollection.setCompanyUserId(user.getCompanyUserId());
+//        fsUserInformationCollection.setCompanyId(user.getCompanyId());
         Long l = userInformationCollectionService.insertFsUserInformationCollection(fsUserInformationCollection);
         if (l > 0) {
             return R.ok();
@@ -100,9 +100,9 @@ public class UserInfoCollectionController extends AppBaseController {
     @PutMapping("/edit")
     public R edit(@RequestBody FsUserInformationCollectionParam fsUserInformationCollection)
     {
-        FsUser user=userService.selectFsUserByUserId(Long.parseLong(getUserId()));
-        fsUserInformationCollection.setCompanyUserId(user.getCompanyUserId());
-        fsUserInformationCollection.setCompanyId(user.getCompanyId());
+//        FsUser user=userService.selectFsUserByUserId(Long.parseLong(getUserId()));
+//        fsUserInformationCollection.setCompanyUserId(user.getCompanyUserId());
+//        fsUserInformationCollection.setCompanyId(user.getCompanyId());
         Long l = userInformationCollectionService.updateFsUserInformationCollection(fsUserInformationCollection);
         if (l > 0) {
             return R.ok();