ソースを参照

Fix 小程序活动互助查询问题修复

Yue 2 年 前
コミット
53dac131c6

+ 3 - 3
SERVER/YanZhongXYH/xyh-system/src/main/java/cn/xyh/amActivity/controller/AmActivityController.java

@@ -230,12 +230,12 @@ public class AmActivityController extends BaseController {
      * 查询我报名的活动
      * 查询我报名的活动
      */
      */
     @SaCheckPermission(PermissionName.AmActivityActivityQuery)
     @SaCheckPermission(PermissionName.AmActivityActivityQuery)
-    @GetMapping("/myJoinActivity")
-    public TableDataInfo<AmActivityVo> getMyJoinActivities(AmActivityBo bo, PageQuery pageQuery) {
+    @GetMapping("/myJoinActivity/{amId}")
+    public TableDataInfo<AmActivityVo> getMyJoinActivities(AmActivityBo bo, PageQuery pageQuery, @PathVariable Long amId) {
         if (!isAlumnus()) {
         if (!isAlumnus()) {
             return TableDataInfo.fail("您不是校友用户,请更换账号后再试");
             return TableDataInfo.fail("您不是校友用户,请更换账号后再试");
         }
         }
-        Long amId = getAmId();
+        amId = amId == null || amId == 0L ? getAmId() : amId;
         return amActivityService.queryMyJoinActivities(amId, bo, pageQuery);
         return amActivityService.queryMyJoinActivities(amId, bo, pageQuery);
     }
     }
 
 

+ 12 - 10
SERVER/YanZhongXYH/xyh-system/src/main/java/cn/xyh/amActivity/service/impl/AmActivityServiceImpl.java

@@ -128,6 +128,7 @@ public class AmActivityServiceImpl implements IAmActivityService {
         lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), AmActivity::getAuditStatus, bo.getAuditStatus());
         lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), AmActivity::getAuditStatus, bo.getAuditStatus());
         lqw.eq(StringUtils.isNotBlank(bo.getIsClose()), AmActivity::getIsClose, bo.getIsClose());
         lqw.eq(StringUtils.isNotBlank(bo.getIsClose()), AmActivity::getIsClose, bo.getIsClose());
         lqw.orderBy(true, false, AmActivity::getIsHead)
         lqw.orderBy(true, false, AmActivity::getIsHead)
+                .orderBy(true, true, AmActivity::getIsClose)
                 .orderBy(true, false, AmActivity::getIsHot)
                 .orderBy(true, false, AmActivity::getIsHot)
                 .orderBy(true, false, AmActivity::getCreateTime);
                 .orderBy(true, false, AmActivity::getCreateTime);
         return lqw;
         return lqw;
@@ -247,16 +248,17 @@ public class AmActivityServiceImpl implements IAmActivityService {
     @Override
     @Override
     public TableDataInfo<AmActivityVo> queryMyJoinActivities(Long amId, AmActivityBo bo, PageQuery pageQuery) {
     public TableDataInfo<AmActivityVo> queryMyJoinActivities(Long amId, AmActivityBo bo, PageQuery pageQuery) {
         LambdaQueryWrapper<AmActivity> lqw = buildQueryWrapper(bo);
         LambdaQueryWrapper<AmActivity> lqw = buildQueryWrapper(bo);
-        lqw.and(w -> {
-            List<AmActivityApply> applyList = baseApplyMapper.selectList(new LambdaQueryWrapper<AmActivityApply>()
-                    .eq(AmActivityApply::getAmId, amId)
-                    .eq(AmActivityApply::getAuditStatus, AuditStatusEnum.PASS.getValue())
-                    .select(AmActivityApply::getActivityId)
-            );
-            List<String> ids = StreamUtils.toList(applyList, AmActivityApply::getActivityId);
-            w.in(AmActivity::getActivityId, ids);
-        });
-        lqw.orderByDesc(AmActivity::getCreateTime);
+        List<AmActivityApply> applyList = baseApplyMapper.selectList(new LambdaQueryWrapper<AmActivityApply>()
+                .eq(AmActivityApply::getAmId, amId)
+                .eq(AmActivityApply::getAuditStatus, AuditStatusEnum.PASS.getValue())
+                .select(AmActivityApply::getActivityId)
+        );
+        List<String> ids = StreamUtils.toList(applyList, AmActivityApply::getActivityId);
+        if (ids.isEmpty()) {
+            ids.add("");
+        }
+        lqw.in(AmActivity::getActivityId, ids);
+
         Page<AmActivityVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
         Page<AmActivityVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
         return TableDataInfo.build(result);
         return TableDataInfo.build(result);
     }
     }

+ 2 - 8
SERVER/YanZhongXYH/xyh-system/src/main/java/cn/xyh/amActivity/service/impl/AmHelpServiceImpl.java

@@ -109,14 +109,8 @@ public class AmHelpServiceImpl implements IAmHelpService {
         lqw.eq(StringUtils.isNotBlank(bo.getIsSys()), AmHelp::getIsSys, bo.getIsSys());
         lqw.eq(StringUtils.isNotBlank(bo.getIsSys()), AmHelp::getIsSys, bo.getIsSys());
         lqw.eq(StringUtils.isNotBlank(bo.getIsClose()), AmHelp::getIsClose, bo.getIsClose());
         lqw.eq(StringUtils.isNotBlank(bo.getIsClose()), AmHelp::getIsClose, bo.getIsClose());
         lqw.eq(StringUtils.isNotBlank(bo.getCreateBy()), AmHelp::getCreateBy, bo.getCreateBy());
         lqw.eq(StringUtils.isNotBlank(bo.getCreateBy()), AmHelp::getCreateBy, bo.getCreateBy());
-        lqw.orderBy(true, false, AmHelp::getIsHead);
-        //.orderBy(StringUtils.isNotBlank(bo.getIsHot()) && bo.getIsHot().equals("1"), false, AmHelp::getIsHot)
-        //.orderBy(StringUtils.isNotBlank(bo.getCreateBy()), false, AmHelp::getCreateTime);
-        //if (StringUtils.isNotBlank(bo.getIsHot()) && bo.getIsHot().equals("1")) {
-        //}
-        //lqw.orderByDesc(AmHelp::getIsHot);
-        //
-        //lqw.orderByDesc(AmHelp::getCreateTime);
+        lqw.orderBy(true, false, AmHelp::getIsHead)
+                .orderBy(true, true, AmHelp::getIsClose);
 
 
         return lqw;
         return lqw;
     }
     }

+ 3 - 2
SERVER/YanZhongXYH/xyh-system/src/main/java/cn/xyh/amActivity/service/impl/AmNewsServiceImpl.java

@@ -94,8 +94,9 @@ public class AmNewsServiceImpl implements IAmNewsService {
         //lqw.eq(StringUtils.isNotBlank(bo.getIsHot()), AmNews::getIsHot, bo.getIsHot());
         //lqw.eq(StringUtils.isNotBlank(bo.getIsHot()), AmNews::getIsHot, bo.getIsHot());
         //lqw.eq(StringUtils.isNotBlank(bo.getIsClose()), AmNews::getIsClose, bo.getIsClose());
         //lqw.eq(StringUtils.isNotBlank(bo.getIsClose()), AmNews::getIsClose, bo.getIsClose());
         lqw.eq(StringUtils.isNotBlank(bo.getImages()), AmNews::getImages, bo.getImages());
         lqw.eq(StringUtils.isNotBlank(bo.getImages()), AmNews::getImages, bo.getImages());
-        lqw.orderByDesc(AmNews::getIsHead);
-       
+        lqw.orderBy(true, false, AmNews::getIsHead)
+                .orderBy(true, true, AmNews::getIsClose);
+
         return lqw;
         return lqw;
     }
     }
 
 

+ 2 - 2
UI/XYH.APP/src/api/amActivity/_activity.ts

@@ -144,9 +144,9 @@ class activityApi {
     })
     })
   }
   }
   // 查询我参加的活动信息列表
   // 查询我参加的活动信息列表
-  myJoinActivity = (query: any) => {
+  myJoinActivity = (query: any, amId?: number) => {
     return Rs.get({
     return Rs.get({
-      url: "/amActivity/activity/myJoinActivity",
+      url: `/amActivity/activity/myJoinActivity/${amId ?? 0}`,
       params: query,
       params: query,
       loading: false,
       loading: false,
     })
     })

+ 2 - 2
UI/XYH.APP/src/components/listCard.vue

@@ -63,7 +63,7 @@ const date = computed(() => {
   return dayjs(new Date(props.item[props.map.date])).format("YYYY-MM-DD ddd")
   return dayjs(new Date(props.item[props.map.date])).format("YYYY-MM-DD ddd")
 })
 })
 const statusClass = computed(() => {
 const statusClass = computed(() => {
-  if (props.item.close == "1" || props.item.auditStatus == "2") {
+  if (props.item.isClose == "1" || props.item.auditStatus == "2") {
     return "bg-danger"
     return "bg-danger"
   }
   }
   if (dayjs(props.item.expiryDate).isBefore(new Date())) {
   if (dayjs(props.item.expiryDate).isBefore(new Date())) {
@@ -78,7 +78,7 @@ const statusClass = computed(() => {
   return ""
   return ""
 })
 })
 const statusName = computed(() => {
 const statusName = computed(() => {
-  if (props.item.close == "1") {
+  if (props.item.isClose == "1") {
     return "已结束"
     return "已结束"
   }
   }
   if (dayjs(props.item.expiryDate).isBefore(new Date())) {
   if (dayjs(props.item.expiryDate).isBefore(new Date())) {

+ 7 - 2
UI/XYH.APP/src/pages-sub/activity/edit.vue

@@ -288,8 +288,13 @@ function onApplyAudit() {
   route.navigate("activityApplyAudit", params)
   route.navigate("activityApplyAudit", params)
 }
 }
 function onCloseActivity() {
 function onCloseActivity() {
-  apis.amActivity.activityApi.closeActivity(activityId.value).then(() => {
-    message.msgSuccess("关闭成功")
+  message.confirm(`确认关闭活动吗?`).then((res: any) => {
+    if (res.confirm) {
+      apis.amActivity.activityApi.closeActivity(activityId.value).then(() => {
+        loadActivity()
+        message.msgSuccess("关闭成功")
+      })
+    }
   })
   })
 }
 }
 
 

+ 9 - 7
UI/XYH.APP/src/pages-sub/activity/myActivity.vue

@@ -17,9 +17,7 @@
     ></SearchBar>
     ></SearchBar>
     <vb-list
     <vb-list
       custom-class="mx-15 pt-15"
       custom-class="mx-15 pt-15"
-      :query-fun="
-        queryType == 0 ? apis.amActivity.activityApi.myCreateActivity : apis.amActivity.activityApi.myJoinActivity
-      "
+      :query-fun="queryType == 0 ? apis.amActivity.activityApi.myCreateActivity : myJoinActivity"
       :query-params="queryParams"
       :query-params="queryParams"
       :height="listHeight"
       :height="listHeight"
     >
     >
@@ -43,8 +41,12 @@ dayjs.locale("zh-cn") // 使用本地化语言
 
 
 const params = route.getRouteParams("myActivity")
 const params = route.getRouteParams("myActivity")
 
 
+const isMine = computed(() => {
+  return params && params.userName ? false : true
+})
+
 const itemType = computed(() => {
 const itemType = computed(() => {
-  return queryType.value == 0 ? "activityEdit" : "activityDetail"
+  return queryType.value == 0 && isMine.value ? "activityEdit" : "activityDetail"
 })
 })
 
 
 const userName = computed(() => {
 const userName = computed(() => {
@@ -59,9 +61,6 @@ const amId = computed(() => {
   }
   }
   return appStore.authStore.getUser().amId
   return appStore.authStore.getUser().amId
 })
 })
-const isMine = computed(() => {
-  return params && params.userName ? false : true
-})
 
 
 const wHeight = uni.getWindowInfo().windowHeight
 const wHeight = uni.getWindowInfo().windowHeight
 const topHeight = ref(130)
 const topHeight = ref(130)
@@ -114,6 +113,9 @@ const searchTabList = computed(() => {
   return arr
   return arr
 })
 })
 
 
+const myJoinActivity = (query: any) => {
+  return apis.amActivity.activityApi.myJoinActivity(query, amId.value)
+}
 function onSearch() {
 function onSearch() {
   search()
   search()
 }
 }

+ 11 - 7
UI/XYH.APP/src/pages-sub/mine/profile/edit.vue

@@ -403,13 +403,17 @@ onLoad(() => {
         </uni-forms-item>
         </uni-forms-item>
       </vb-cell-group>
       </vb-cell-group>
     </uni-forms>
     </uni-forms>
-    <view class="d-flex">
-      <view style="width: 50%; margin-right: 10px">
-        <vb-button v-if="isAudit" block plain @click="onBack">返回</vb-button>
-      </view>
-      <view style="width: 50%">
-        <vb-button block @click="onSubmit">提交</vb-button>
+    <vb-cell-group>
+      <view class="d-fcv">
+        <view
+          v-if="isAudit"
+          class="bg-white text-vb border border-1 border-vb w-100 text-center py-8 br-8 me-15"
+          @click="onBack"
+        >
+          返回
+        </view>
+        <view class="bg-vb text-white w-100 text-center py-8 br-8" @click="onSubmit">提交</view>
       </view>
       </view>
-    </view>
+    </vb-cell-group>
   </view>
   </view>
 </template>
 </template>