Browse Source

feat(system):优化系统公告逻辑并调整删除标记类型- 将SysAnnouncement实体的delFlag字段类型由String改为Integer
- 使用@TableLogic注解标记delFlag为逻辑删除字段
- 统一设置delFlag值时不再使用toString()方法
- 删除公告时调用removeById方法替代手动设置delFlag- 查询未读消息时增加sendStatus条件过滤
-修正多处delFlag赋值逻辑,确保数据一致性

wzq 3 weeks ago
parent
commit
b400b4f959

+ 10 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/controller/commercial/CommercialController.java

@@ -112,7 +112,16 @@ public class CommercialController {
         List<AppCoursesVerificationRecord> verificationRecords =
                 appCoursesVerificationRecordService.courseQueryUsersList( form.getCoursePriceRulesId(),form.getOrPostpone(), form.getVerifyStatus());
         List<AppCoursesVerificationRecord> temporaryCourseList =
-                appCoursesVerificationRecordService.list(Wrappers.lambdaQuery(AppCoursesVerificationRecord.class).eq(AppCoursesVerificationRecord::getOrTemporaryCourse, CommonConstant.NUMBER_1));
+                appCoursesVerificationRecordService.list(Wrappers.lambdaQuery(AppCoursesVerificationRecord.class)
+                                .eq(AppCoursesVerificationRecord::getCoursesPriceRuleId, form.getCoursePriceRulesId())
+                                .eq(ObjectUtil.isNotEmpty(form.getOrPostpone()),AppCoursesVerificationRecord::getOrPostpone, form.getOrPostpone())
+                                .eq(ObjectUtil.isNotEmpty(form.getVerifyStatus()),AppCoursesVerificationRecord::getVerifyStatus, form.getVerifyStatus())
+                                .and(wrapper ->wrapper
+                                        .eq(AppCoursesVerificationRecord::getOrTemporaryCourse, CommonConstant.NUMBER_1)
+                                        .or()
+                                        .eq(AppCoursesVerificationRecord::getCoursesType, CommonConstant.NUMBER_1)
+                                )
+                        );
         verificationRecords.addAll(temporaryCourseList);
         List<AppCoursesVerificationRecord> list = verificationRecords.stream()
                 .collect(Collectors.collectingAndThen(

+ 34 - 34
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/OrderServiceImpl.java

@@ -1857,40 +1857,40 @@ public class OrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> impl
         List<String> refundOrderProInfoIds = new ArrayList<>(Arrays.asList(refundOrderForm.getOrderProInfoIds().split(",")));
         List<AppOrderProInfo> appOrderProInfoList = new ArrayList<>();
         if (ObjectUtil.isNotEmpty(appOrder)) {
-            if (appOrder.getProfitSharingStatus() > CommonConstant.NUMBER_0) {
-                throw new JeecgBootException("当前订单无法进行退款,请联系客服处理!");
-            }
-            if(!Objects.equals(appOrder.getOrderType(), CommonConstant.ORDER_PRO_INFO_TYPE_1) && !appOrder.getOrderType().equals(CommonConstant.ORDER_PRO_INFO_TYPE_2)){
-                throw new JeecgBootException("当前订单类型不支持退款!");
-            }
-            if (Objects.equals(appOrder.getOrderStatus(), CommonConstant.ORDER_STATUS_2)) {
-                throw new JeecgBootException("订单商品已使用,无法进行退款!");
-            }
-            //通过订单查询门店退款规则,判断是否可以进行退款
-            String s = appOrder.getProductIds().split(",")[0];
-            String priceRuleId = s.split("\\|")[0];
-            AppSitePriceRules appSitePriceRules =
-                    appSitePriceRulesMapper.selectOne(Wrappers.<AppSitePriceRules>lambdaQuery().eq(AppSitePriceRules::getId, priceRuleId).last("limit 1"));
-            String sitePlaceId = appSitePriceRules.getSitePlaceId();
-            AppSitePlace appSitePlace = appSitePlaceMapper.selectById(sitePlaceId);
-            if (Objects.equals(appOrder.getOrderType(), CommonConstant.ORDER_PRO_INFO_TYPE_2) && Objects.equals(appSitePlace.getRefundType(),
-                    CommonConstant.NUMBER_2)) {
-                throw new JeecgBootException("当前门店不支持退款!");
-            }
-            if (Objects.equals(appSitePlace.getRefundType(), CommonConstant.NUMBER_1)) {
-
-                for (String refundOrderProInfoId : refundOrderProInfoIds) {
-                    AppOrderProInfo appOrderProInfo = appOrderProInfoMapper.selectById(refundOrderProInfoId);
-                    String productId = appOrderProInfo.getProductId();
-                    AppSitePriceRules sitePriceRules = appSitePriceRulesMapper.selectById(productId);
-                    Instant originalInstant  = sitePriceRules.getStartTime().toInstant();
-                    Instant time = originalInstant.minusSeconds(appSitePlace.getEarlyRefundTime() * 60);
-                    Instant now = Instant.now();
-                    if (!now.isBefore(time)) {
-                        throw new JeecgBootException("商品:"+ appOrderProInfo.getProductName() +" 已超过可退时间,无法进行退款!");
-                    }
-                }
-            }
+//            if (appOrder.getProfitSharingStatus() > CommonConstant.NUMBER_0) {
+//                throw new JeecgBootException("当前订单无法进行退款,请联系客服处理!");
+//            }
+//            if(!Objects.equals(appOrder.getOrderType(), CommonConstant.ORDER_PRO_INFO_TYPE_1) && !appOrder.getOrderType().equals(CommonConstant.ORDER_PRO_INFO_TYPE_2)){
+//                throw new JeecgBootException("当前订单类型不支持退款!");
+//            }
+//            if (Objects.equals(appOrder.getOrderStatus(), CommonConstant.ORDER_STATUS_2)) {
+//                throw new JeecgBootException("订单商品已使用,无法进行退款!");
+//            }
+//            //通过订单查询门店退款规则,判断是否可以进行退款
+//            String s = appOrder.getProductIds().split(",")[0];
+//            String priceRuleId = s.split("\\|")[0];
+//            AppSitePriceRules appSitePriceRules =
+//                    appSitePriceRulesMapper.selectOne(Wrappers.<AppSitePriceRules>lambdaQuery().eq(AppSitePriceRules::getId, priceRuleId).last("limit 1"));
+//            String sitePlaceId = appSitePriceRules.getSitePlaceId();
+//            AppSitePlace appSitePlace = appSitePlaceMapper.selectById(sitePlaceId);
+//            if (Objects.equals(appOrder.getOrderType(), CommonConstant.ORDER_PRO_INFO_TYPE_2) && Objects.equals(appSitePlace.getRefundType(),
+//                    CommonConstant.NUMBER_2)) {
+//                throw new JeecgBootException("当前门店不支持退款!");
+//            }
+//            if (Objects.equals(appSitePlace.getRefundType(), CommonConstant.NUMBER_1)) {
+//
+//                for (String refundOrderProInfoId : refundOrderProInfoIds) {
+//                    AppOrderProInfo appOrderProInfo = appOrderProInfoMapper.selectById(refundOrderProInfoId);
+//                    String productId = appOrderProInfo.getProductId();
+//                    AppSitePriceRules sitePriceRules = appSitePriceRulesMapper.selectById(productId);
+//                    Instant originalInstant  = sitePriceRules.getStartTime().toInstant();
+//                    Instant time = originalInstant.minusSeconds(appSitePlace.getEarlyRefundTime() * 60);
+//                    Instant now = Instant.now();
+//                    if (!now.isBefore(time)) {
+//                        throw new JeecgBootException("商品:"+ appOrderProInfo.getProductName() +" 已超过可退时间,无法进行退款!");
+//                    }
+//                }
+//            }
 
             //退款金额统计(不为保险的子订单)
             for (String refundOrderProInfoId : refundOrderProInfoIds) {

+ 8 - 6
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppOrderServiceImpl.java

@@ -339,7 +339,14 @@ public class AppOrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> i
                     throw new JeecgBootException("当前账号无权限核销赛事券号,请切换平台账号进行核验!");
                 }
             }
+            //券号状态
+            appIsin.setIsinStatus(CommonConstant.ISIN_STATUS_1);
+            appIsin.setVerifyUserId(loginUser.getId());
+            appIsin.setVerifyUserName(loginUser.getUsername());
+            appIsin.setUseTime(DateUtils.getDate());
+            appIsinMapper.updateById(appIsin);
 
+            //修改订单状态
             if (!Objects.equals(appOrderProInfo.getType(), CommonConstant.ORDER_PRO_INFO_TYPE_5)){
                 appOrderProInfo.setOrderStatus(CommonConstant.ORDER_STATUS_2);
                 appOrderProInfoMapper.updateById(appOrderProInfo);
@@ -348,18 +355,13 @@ public class AppOrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> i
                 AppOrder appOrder = appOrderMapper.selectById(orderId);
                 int x = appIsinMapper.selectList(Wrappers.<AppIsin>lambdaQuery().eq(AppIsin::getOrderId, appOrder.getId()).eq(AppIsin::getIsinStatus, 0)).size();
                 int y = appOrderProInfoMapper.selectList(Wrappers.<AppOrderProInfo>lambdaQuery().eq(AppOrderProInfo::getOrderId, appOrder.getId()).eq(AppOrderProInfo::getOrderStatus, 0)).size();
-                if (ObjectUtil.isNotEmpty(appOrder) && x == 1 && y == 0){
+                if (ObjectUtil.isNotEmpty(appOrder) && x == 0 && y == 0){
                     if(!Objects.equals(appOrder.getOrderStatus(), CommonConstant.ORDER_STATUS_2)){
                         appOrder.setOrderStatus(CommonConstant.ORDER_STATUS_2);
                         appOrderMapper.updateById(appOrder);
                     }
                 }
             }
-            appIsin.setIsinStatus(CommonConstant.ISIN_STATUS_1);
-            appIsin.setVerifyUserId(loginUser.getId());
-            appIsin.setVerifyUserName(loginUser.getUsername());
-            appIsin.setUseTime(DateUtils.getDate());
-            appIsinMapper.updateById(appIsin);
         }
         return Boolean.TRUE;
     }