瀏覽代碼

完善社团预约功能

xianwait 2 年之前
父節點
當前提交
2159a0c4d0
共有 36 個文件被更改,包括 2177 次插入479 次删除
  1. 50 3
      willalp-admin/src/main/java/com/willalp/web/controller/app/AppThreeController.java
  2. 37 16
      willalp-admin/src/main/java/com/willalp/web/controller/clockingin/HsEventController.java
  3. 127 0
      willalp-admin/src/main/java/com/willalp/web/controller/clockingin/HsEventImgController.java
  4. 10 13
      willalp-admin/src/main/java/com/willalp/web/controller/system/SysConfigController.java
  5. 5 3
      willalp-admin/src/main/resources/application-dev.yml
  6. 3 1
      willalp-admin/src/main/resources/application-prod.yml
  7. 24 11
      willalp-admin/src/test/java/com/willalp/CanteenTest.java
  8. 33 0
      willalp-admin/src/test/java/com/willalp/NewClass.java
  9. 98 55
      willalp-clocking-in/src/main/java/com/willalp/event/domain/HsActivityAppoint.java
  10. 29 10
      willalp-clocking-in/src/main/java/com/willalp/event/domain/HsEvent.java
  11. 120 0
      willalp-clocking-in/src/main/java/com/willalp/event/domain/HsEventImg.java
  12. 18 10
      willalp-clocking-in/src/main/java/com/willalp/event/domain/vo/AppActivityAppointRecordVo.java
  13. 23 0
      willalp-clocking-in/src/main/java/com/willalp/event/mapper/HsEventImgMapper.java
  14. 1 3
      willalp-clocking-in/src/main/java/com/willalp/event/mapper/HsEventMapper.java
  15. 27 20
      willalp-clocking-in/src/main/java/com/willalp/event/mapper/xml/HsActivityAppointMapper.xml
  16. 54 0
      willalp-clocking-in/src/main/java/com/willalp/event/mapper/xml/HsEventImgMapper.xml
  17. 10 4
      willalp-clocking-in/src/main/java/com/willalp/event/mapper/xml/HsEventMapper.xml
  18. 23 0
      willalp-clocking-in/src/main/java/com/willalp/event/service/IHsEventImgService.java
  19. 35 0
      willalp-clocking-in/src/main/java/com/willalp/event/service/impl/HsEventImgServiceImpl.java
  20. 8 1
      willalp-clocking-in/src/main/java/com/willalp/event/service/impl/HsEventServiceImpl.java
  21. 1 1
      willalp-clocking-in/src/main/java/com/willalp/files/mapper/xml/HsOrgPersonnelFilesMapper.xml
  22. 20 0
      willalp-clocking-in/src/main/java/com/willalp/flow/service/TriggerService.java
  23. 24 0
      willalp-clocking-in/src/main/java/com/willalp/flow/service/impl/TriggerServiceImpl.java
  24. 1 0
      willalp-clocking-in/src/main/java/com/willalp/salary/service/impl/HsSalarySlipServiceImpl.java
  25. 22 25
      willalp-common/src/main/java/com/willalp/common/utils/spring/SpringUtils.java
  26. 53 0
      willalp-ui/src/api/event/img.js
  27. 13 13
      willalp-ui/src/components/ImageUpload/index.vue
  28. 1 1
      willalp-ui/src/views/canteen/gift/index.vue
  29. 7 2
      willalp-ui/src/views/canteen/place/index.vue
  30. 381 0
      willalp-ui/src/views/components/addUsers/index.vue
  31. 111 143
      willalp-ui/src/views/event/appoint/index.vue
  32. 103 69
      willalp-ui/src/views/event/associations/index.vue
  33. 314 0
      willalp-ui/src/views/event/img/index.vue
  34. 389 73
      willalp-ui/src/views/eventConfig/event/index.vue
  35. 1 1
      willalp-ui/src/views/login.vue
  36. 1 1
      willalp-ui/src/views/register.vue

+ 50 - 3
willalp-admin/src/main/java/com/willalp/web/controller/app/AppThreeController.java

@@ -7,17 +7,21 @@
 package com.willalp.web.controller.app;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.willalp.common.config.WillalpConfig;
 import com.willalp.common.core.controller.BaseController;
 import com.willalp.common.core.domain.AjaxResult;
 import com.willalp.common.core.domain.entity.SysUser;
 import com.willalp.common.core.page.TableDataInfo;
 import com.willalp.common.utils.StringUtils;
+import com.willalp.common.utils.file.FileUploadUtils;
 import com.willalp.erms.service.IHsGoodsStorageService;
 import com.willalp.erms.service.IHsGoodsTypeService;
 import com.willalp.event.domain.HsActivityAppoint;
 import com.willalp.event.domain.HsEvent;
+import com.willalp.event.domain.HsEventImg;
 import com.willalp.event.service.IHsActivityAppointService;
 import com.willalp.event.service.IHsAssociationsInfoService;
+import com.willalp.event.service.IHsEventImgService;
 import com.willalp.event.service.IHsEventService;
 import com.willalp.files.service.IHsOrgPersonnelFilesService;
 import com.willalp.flow.service.IHsFlowCcService;
@@ -26,9 +30,12 @@ import com.willalp.system.service.ISysPostService;
 import io.swagger.annotations.Api;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
@@ -71,6 +78,9 @@ public class AppThreeController extends BaseController {
     @Resource
     private IHsActivityAppointService activityAppointService;
 
+    @Resource
+    private IHsEventImgService eventImgService;
+
 
     @RequestMapping("/getOpfInfo")
     public AjaxResult getOpfInfo(@RequestParam String opfUserPhone) {
@@ -122,6 +132,45 @@ public class AppThreeController extends BaseController {
         return getDataTable(eventService.appGetEvents(associationsInfoId));
     }
 
+
+    @Value("${imgServer.url}")
+    public String baseUrl;
+
+    /**
+     * 活动风采上传
+     */
+    @PostMapping("/eventImg/upload")
+    public AjaxResult uploadFile(MultipartFile file, HttpServletRequest request) throws Exception {
+        try {
+            // 上传文件路径
+            String filePath = WillalpConfig.getUploadPath();
+            // 上传并返回新文件名称
+            String fileName = file.getOriginalFilename();
+            String url = FileUploadUtils.upload(filePath, file);
+            AjaxResult ajax = AjaxResult.success();
+            ajax.put("fileName", fileName);
+            ajax.put("url", baseUrl + url);
+            HsEventImg eventImg = new HsEventImg();
+            eventImg.setEventId(request.getHeader("eventId"));
+            eventImg.setType(fileName.split("\\.")[1]);
+            eventImg.setUrl(baseUrl + url);
+            eventImgService.save(eventImg);
+            return ajax;
+        } catch (Exception e) {
+            return AjaxResult.error(e.getMessage());
+        }
+    }
+
+    @RequestMapping("/eventsImg")
+    public AjaxResult eventsImg(String eventId) {
+        if (StringUtils.isBlank(eventId)) {
+            return AjaxResult.error();
+        }
+        return AjaxResult.success(eventImgService.getBaseMapper().selectList(new QueryWrapper<HsEventImg>()
+                .eq("event_id", eventId)));
+    }
+
+
     @RequestMapping("/eventOrders")
     public TableDataInfo eventOrders() {
         startPage();
@@ -142,7 +191,6 @@ public class AppThreeController extends BaseController {
         if (hsEvent == null) {
             return AjaxResult.error("活动不存在或已经结束");
         }
-
         //限额验证
         Integer count = Math.toIntExact(activityAppointService.getBaseMapper().selectCount(new QueryWrapper<HsActivityAppoint>()
                 .eq("activity_id", eventId)
@@ -186,11 +234,10 @@ public class AppThreeController extends BaseController {
             Date eventEndTime = hsEvent.getEventEndTime();
             //禁止取消预约时限
             Integer banCancelSubscribeTimeLimit = hsEvent.getBanCancelSubscribeTimeLimit();
-            Integer limitNum = hsEvent.getLimitNum();
             long msTime = banCancelSubscribeTimeLimit * (1000 * 60 * 60);
             long timeMillis = System.currentTimeMillis();
             msTime = eventEndTime.getTime() - msTime;
-            if (timeMillis < msTime && hsEvent.getLimitNum() > 0) {
+            if (timeMillis < msTime) {
                 return toAjax(activityAppointService.removeById(id));
             } else {
                 return AjaxResult.error("已过可退时间");

+ 37 - 16
willalp-admin/src/main/java/com/willalp/web/controller/clockingin/HsEventController.java

@@ -1,5 +1,7 @@
 package com.willalp.web.controller.clockingin;
 
+import com.willalp.canteen.domain.HsCanteenDiningPlace;
+import com.willalp.canteen.service.IHsCanteenDiningPlaceService;
 import com.willalp.common.annotation.Log;
 import com.willalp.common.core.controller.BaseController;
 import com.willalp.common.core.domain.AjaxResult;
@@ -7,6 +9,7 @@ import com.willalp.common.core.page.TableDataInfo;
 import com.willalp.common.enums.BusinessType;
 import com.willalp.common.utils.DateUtils;
 import com.willalp.common.utils.SecurityUtils;
+import com.willalp.common.utils.StringUtils;
 import com.willalp.common.utils.poi.ExcelUtil;
 import com.willalp.event.domain.HsEvent;
 import com.willalp.event.service.IHsEventService;
@@ -25,8 +28,7 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/eventConfig/event")
-public class HsEventController extends BaseController
-{
+public class HsEventController extends BaseController {
     @Resource
     private IHsEventService hsEventService;
 
@@ -35,8 +37,7 @@ public class HsEventController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('eventConfig:event:list')")
     @GetMapping("/list")
-    public TableDataInfo list(HsEvent hsEvent)
-    {
+    public TableDataInfo list(HsEvent hsEvent) {
         startPage();
         List<HsEvent> list = hsEventService.selectHsEventList(hsEvent);
         return getDataTable(list);
@@ -48,8 +49,7 @@ public class HsEventController extends BaseController
     @PreAuthorize("@ss.hasPermi('eventConfig:event:export')")
     @Log(title = "活动配置", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(HsEvent hsEvent)
-    {
+    public AjaxResult export(HsEvent hsEvent) {
         List<HsEvent> list = hsEventService.selectHsEventList(hsEvent);
         ExcelUtil<HsEvent> util = new ExcelUtil<HsEvent>(HsEvent.class);
         return util.exportExcel(list, "活动配置数据");
@@ -60,22 +60,36 @@ public class HsEventController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('eventConfig:event:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") String id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") String id) {
         return AjaxResult.success(hsEventService.getById(id));
     }
 
+    @Resource
+    private IHsCanteenDiningPlaceService placeService;
+
     /**
      * 新增活动配置
      */
     @PreAuthorize("@ss.hasPermi('eventConfig:event:add')")
     @Log(title = "活动配置", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody HsEvent hsEvent)
-    {
+    public AjaxResult add(@RequestBody HsEvent hsEvent) {
+        if (hsEvent == null) {
+            return AjaxResult.error();
+        }
         hsEvent.setCreateBy(SecurityUtils.getUsername());
         hsEvent.setCreateTime(DateUtils.getNowDate());
-        return toAjax(hsEventService.save(hsEvent));
+        if (hsEvent.getEventStartTime() != null) {
+            String dateToStr = DateUtils.parseDateToStr("yyyy-MM-dd", hsEvent.getEventStartTime());
+            if (StringUtils.isNotBlank(hsEvent.getEventPlace())) {
+                HsCanteenDiningPlace canteenDiningPlace = placeService.getById(hsEvent.getEventPlace());
+                if (canteenDiningPlace != null) {
+                    hsEvent.setEventName(dateToStr + canteenDiningPlace.getPlaceName());
+                    return toAjax(hsEventService.save(hsEvent));
+                }
+            }
+        }
+        return AjaxResult.error();
     }
 
     /**
@@ -84,10 +98,18 @@ public class HsEventController extends BaseController
     @PreAuthorize("@ss.hasPermi('eventConfig:event:edit')")
     @Log(title = "活动配置", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody HsEvent hsEvent)
-    {
+    public AjaxResult edit(@RequestBody HsEvent hsEvent) {
         hsEvent.setUpdateBy(SecurityUtils.getUsername());
         hsEvent.setUpdateTime(DateUtils.getNowDate());
+        if (hsEvent.getEventStartTime() != null) {
+            String dateToStr = DateUtils.parseDateToStr("yyyy-MM-dd", hsEvent.getEventStartTime());
+            if (StringUtils.isNotBlank(hsEvent.getEventPlace())) {
+                HsCanteenDiningPlace canteenDiningPlace = placeService.getById(hsEvent.getEventPlace());
+                if (canteenDiningPlace != null) {
+                    hsEvent.setEventName(dateToStr + canteenDiningPlace.getPlaceName());
+                }
+            }
+        }
         return toAjax(hsEventService.updateById(hsEvent));
     }
 
@@ -96,9 +118,8 @@ public class HsEventController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('eventConfig:event:remove')")
     @Log(title = "活动配置", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable String[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids) {
         return toAjax(hsEventService.removeByIds(Arrays.asList(ids)));
     }
 }

+ 127 - 0
willalp-admin/src/main/java/com/willalp/web/controller/clockingin/HsEventImgController.java

@@ -0,0 +1,127 @@
+package com.willalp.web.controller.clockingin;
+
+import com.willalp.common.annotation.Log;
+import com.willalp.common.config.WillalpConfig;
+import com.willalp.common.core.controller.BaseController;
+import com.willalp.common.core.domain.AjaxResult;
+import com.willalp.common.core.page.TableDataInfo;
+import com.willalp.common.enums.BusinessType;
+import com.willalp.common.utils.DateUtils;
+import com.willalp.common.utils.SecurityUtils;
+import com.willalp.common.utils.file.FileUploadUtils;
+import com.willalp.common.utils.poi.ExcelUtil;
+import com.willalp.event.domain.HsEventImg;
+import com.willalp.event.service.IHsEventImgService;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 事件(活动)图片信息Controller
+ *
+ * @author willalp
+ * @date 2023-04-10
+ */
+@RestController
+@RequestMapping("/event/img")
+public class HsEventImgController extends BaseController {
+    @Resource
+    private IHsEventImgService hsEventImgService;
+
+    /**
+     * 查询事件(活动)图片信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('event:img:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(HsEventImg hsEventImg) {
+        startPage();
+        List<HsEventImg> list = hsEventImgService.selectHsEventImgList(hsEventImg);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出事件(活动)图片信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('event:img:export')")
+    @Log(title = "事件(活动)图片信息", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(HsEventImg hsEventImg) {
+        List<HsEventImg> list = hsEventImgService.selectHsEventImgList(hsEventImg);
+        ExcelUtil<HsEventImg> util = new ExcelUtil<HsEventImg>(HsEventImg.class);
+        return util.exportExcel(list, "事件(活动)图片信息数据");
+    }
+
+    /**
+     * 获取事件(活动)图片信息详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('event:img:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id) {
+        return AjaxResult.success(hsEventImgService.getById(id));
+    }
+
+    @Value("${imgServer.url}")
+    public String baseUrl;
+
+    /**
+     * 活动风采上传
+     */
+    @PostMapping("/upload")
+    public AjaxResult uploadFile(MultipartFile file, HttpServletRequest request) throws Exception {
+        try {
+            // 上传文件路径
+            String filePath = WillalpConfig.getUploadPath();
+            // 上传并返回新文件名称
+            String fileName = file.getOriginalFilename();
+            String url = FileUploadUtils.upload(filePath, file);
+            AjaxResult ajax = AjaxResult.success();
+            ajax.put("fileName", fileName);
+            ajax.put("url", baseUrl + url);
+            ajax.put("type", fileName.split("\\.")[1]);
+            ajax.put("eventId", request.getHeader("eventId"));
+            return ajax;
+        } catch (Exception e) {
+            return AjaxResult.error(e.getMessage());
+        }
+    }
+
+    /**
+     * 新增事件(活动)图片信息
+     */
+    @PreAuthorize("@ss.hasPermi('event:img:add')")
+    @Log(title = "事件(活动)图片信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody HsEventImg hsEventImg) {
+        hsEventImg.setCreateBy(SecurityUtils.getUsername());
+        hsEventImg.setCreateTime(DateUtils.getNowDate());
+        return toAjax(hsEventImgService.save(hsEventImg));
+    }
+
+    /**
+     * 修改事件(活动)图片信息
+     */
+    @PreAuthorize("@ss.hasPermi('event:img:edit')")
+    @Log(title = "事件(活动)图片信息", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody HsEventImg hsEventImg) {
+        hsEventImg.setUpdateBy(SecurityUtils.getUsername());
+        hsEventImg.setUpdateTime(DateUtils.getNowDate());
+        return toAjax(hsEventImgService.updateById(hsEventImg));
+    }
+
+    /**
+     * 删除事件(活动)图片信息
+     */
+    @PreAuthorize("@ss.hasPermi('event:img:remove')")
+    @Log(title = "事件(活动)图片信息", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids) {
+        return toAjax(hsEventImgService.removeByIds(Arrays.asList(ids)));
+    }
+}

+ 10 - 13
willalp-admin/src/main/java/com/willalp/web/controller/system/SysConfigController.java

@@ -1,17 +1,5 @@
 package com.willalp.web.controller.system;
 
-import java.util.List;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 import com.willalp.common.annotation.Log;
 import com.willalp.common.annotation.RepeatSubmit;
 import com.willalp.common.constant.UserConstants;
@@ -22,6 +10,12 @@ import com.willalp.common.enums.BusinessType;
 import com.willalp.common.utils.poi.ExcelUtil;
 import com.willalp.system.domain.SysConfig;
 import com.willalp.system.service.ISysConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 参数配置 信息操作处理
@@ -73,7 +67,10 @@ public class SysConfigController extends BaseController
     @GetMapping(value = "/configKey/{configKey}")
     public AjaxResult getConfigKey(@PathVariable String configKey)
     {
-        return AjaxResult.success(configService.selectConfigByKey(configKey));
+        AjaxResult success = AjaxResult.success(configService.selectConfigByKey(configKey));
+        SysConfig sysConfig = configService.selectConfigInfoByKey(configKey);
+        success.put("data", sysConfig);
+        return success;
     }
 
     /**

+ 5 - 3
willalp-admin/src/main/resources/application-dev.yml

@@ -9,8 +9,8 @@ willalp:
   # 实例演示开关
   demoEnabled: true
   # 文件路径 示例( Windows配置D:/willalp/uploadPath,Linux配置 /home/willalp/uploadPath)
-#  profile: /home/willalp/ml/uploadPath
-  profile: D:/home/willalp/ml/uploadPath
+  profile: /home/willalp/ml/uploadPath
+#  profile: D:/home/willalp/ml/uploadPath
   # 获取ip地址开关
   addressEnabled: false
   # 验证码类型 math 数组计算 char 字符验证
@@ -146,4 +146,6 @@ uniapp:
 masterServer:
   host: localhost
   port: 3010
-  path: /api
+  path: /api
+imgServer:
+  url: https://ts.willalp.com:3005

+ 3 - 1
willalp-admin/src/main/resources/application-prod.yml

@@ -142,4 +142,6 @@ uniapp:
 masterServer:
   host: 114.115.142.166
   port: 3010
-  path: /api
+  path: /api
+imgServer:
+  url: https://hzl.willalp.com:3005

+ 24 - 11
willalp-admin/src/test/java/com/willalp/CanteenTest.java

@@ -7,6 +7,7 @@
 package com.willalp;
 
 import com.willalp.canteen.service.IHsGiftService;
+import com.willalp.common.utils.spring.SpringUtils;
 import com.willalp.msg.service.IHsAppUserMsgService;
 import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
@@ -30,24 +31,36 @@ public class CanteenTest {
 
     @Autowired
     private IHsAppUserMsgService appUserMsgService;
+
+    //    @Test
+//    public void test() {
+//        //测试积分兑换是否会超卖
+//        for (int i = 0; i < 200; i++) {
+//            new Thread(() -> {
+//                int i1 = (int) (1 + Math.random() * (10 - 1 + 1));
+//                if (giftService.checkAndReduceGiftInventory(i1, "1601029390240735234") > 0) {
+//                    log.info("线程[" + Thread.currentThread().getName() + "] - 购买【" + i1 + "】个成功!");
+//                } else {
+//                    log.info("线程[" + Thread.currentThread().getName() + "] - 购买【" + i1 + "】个失败~");
+//                }
+//            }).start();
+//        }
+//    }
     @Test
     public void test() {
-        //测试积分兑换是否会超卖
-        for (int i = 0; i < 200; i++) {
-            new Thread(() -> {
-                int i1 = (int) (1 + Math.random() * (10 - 1 + 1));
-                if (giftService.checkAndReduceGiftInventory(i1, "1601029390240735234") > 0) {
-                    log.info("线程[" + Thread.currentThread().getName() + "] - 购买【" + i1 + "】个成功!");
-                } else {
-                    log.info("线程[" + Thread.currentThread().getName() + "] - 购买【" + i1 + "】个失败~");
-                }
-            }).start();
-        }
+
+    }
+
+    public static void main(String[] args) {
+        NewClass newClass = new NewClass();
+        SpringUtils.doMethod(newClass, "say", new Class[]{String.class}, "Hi~");
+        SpringUtils.doMethod(newClass, "wqxRun", new Class[]{Integer.class}, 100);
     }
 
     @Test
     public void test1() {
         appUserMsgService.pushMsgSum();
     }
+
 }
  

+ 33 - 0
willalp-admin/src/test/java/com/willalp/NewClass.java

@@ -0,0 +1,33 @@
+package com.willalp;
+
+import com.alibaba.fastjson.JSON;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+@Slf4j
+public class NewClass {
+    public String doTest(Object obj, String methodName, Class[] clazzs, Object... args) {
+        try {
+            return (String) obj.getClass().getMethod(methodName, clazzs).invoke(obj, args);
+        } catch (Exception e) {
+            log.info("[doMethod] Exception methodName:{}, args:{}", methodName, JSON.toJSONString(args), e);
+        }
+        return StringUtils.EMPTY;
+    }
+
+    public String say(String msg) {
+        System.out.println("say: " + msg);
+        return "success";
+    }
+
+    public String run(Integer distance) {
+        System.out.println("run: " + distance);
+        return "success";
+    }
+    public String wqxRun(Integer distance) {
+        System.out.println("wqxRun: " + distance);
+        return "success";
+    }
+}
+
+

+ 98 - 55
willalp-clocking-in/src/main/java/com/willalp/event/domain/HsActivityAppoint.java

@@ -1,5 +1,6 @@
 package com.willalp.event.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -19,19 +20,13 @@ import java.util.Date;
  */
 
 @TableName("hs_activity_appoint")
-public class HsActivityAppoint extends BaseEntity
-{
+public class HsActivityAppoint extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
     /** 主键 */
     @TableId
     private String id;
 
-    /** 活动日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Excel(name = "活动日期", width = 30, dateFormat = "yyyy-MM-dd")
-    private Date activityTime;
-
     /** 姓名 */
     @Excel(name = "姓名")
     private String appointeeName;
@@ -45,8 +40,33 @@ public class HsActivityAppoint extends BaseEntity
     @Excel(name = "预约时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date appointmentTime;
 
+    /** 项目名称 */
+    @Excel(name = "类型")
+    @TableField(exist = false)
+    private String projectName;
+
+    /** 事件名称 */
+    @Excel(name = "名称")
+    @TableField(exist = false)
+    private String eventName;
+
+    /** 事件开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+    @Excel(name = "活动开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @TableField(exist = false)
+    private Date eventStartTime;
+
+    /** 事件结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+    @Excel(name = "活动结束时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @TableField(exist = false)
+    private Date eventEndTime;
+
+    /** 活动日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date activityTime;
+
     /** 活动ID */
-    @Excel(name = "活动ID")
     private String activityId;
 
     /** 操作 */
@@ -56,95 +76,118 @@ public class HsActivityAppoint extends BaseEntity
     @TableLogic
     private Integer isDelete;
 
-    public void setId(String id)
-    {
+    public void setId(String id) {
         this.id = id;
     }
 
-    public String getId()
-    {
+    public String getId() {
         return id;
     }
-    public void setActivityTime(Date activityTime)
-    {
+
+    public void setActivityTime(Date activityTime) {
         this.activityTime = activityTime;
     }
 
-    public Date getActivityTime()
-    {
+    public Date getActivityTime() {
         return activityTime;
     }
-    public void setAppointeeName(String appointeeName)
-    {
+
+    public void setAppointeeName(String appointeeName) {
         this.appointeeName = appointeeName;
     }
 
-    public String getAppointeeName()
-    {
+    public String getAppointeeName() {
         return appointeeName;
     }
-    public void setAppointeePhone(String appointeePhone)
-    {
+
+    public void setAppointeePhone(String appointeePhone) {
         this.appointeePhone = appointeePhone;
     }
 
-    public String getAppointeePhone()
-    {
+    public String getAppointeePhone() {
         return appointeePhone;
     }
-    public void setAppointmentTime(Date appointmentTime)
-    {
+
+    public void setAppointmentTime(Date appointmentTime) {
         this.appointmentTime = appointmentTime;
     }
 
-    public Date getAppointmentTime()
-    {
+    public Date getAppointmentTime() {
         return appointmentTime;
     }
-    public void setActivityId(String activityId)
-    {
+
+    public void setActivityId(String activityId) {
         this.activityId = activityId;
     }
 
-    public String getActivityId()
-    {
+    public String getActivityId() {
         return activityId;
     }
-    public void setOperation(String operation)
-    {
+
+    public void setOperation(String operation) {
         this.operation = operation;
     }
 
-    public String getOperation()
-    {
+    public String getOperation() {
         return operation;
     }
-    public void setIsDelete(Integer isDelete)
-    {
+
+    public void setIsDelete(Integer isDelete) {
         this.isDelete = isDelete;
     }
 
-    public Integer getIsDelete()
-    {
+    public Integer getIsDelete() {
         return isDelete;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("activityTime", getActivityTime())
-            .append("appointeeName", getAppointeeName())
-            .append("appointeePhone", getAppointeePhone())
-            .append("appointmentTime", getAppointmentTime())
-            .append("activityId", getActivityId())
-            .append("remark", getRemark())
-            .append("operation", getOperation())
-            .append("createTime", getCreateTime())
-            .append("createBy", getCreateBy())
-            .append("updateTime", getUpdateTime())
-            .append("updateBy", getUpdateBy())
-            .append("isDelete", getIsDelete())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("activityTime", getActivityTime())
+                .append("appointeeName", getAppointeeName())
+                .append("appointeePhone", getAppointeePhone())
+                .append("appointmentTime", getAppointmentTime())
+                .append("activityId", getActivityId())
+                .append("remark", getRemark())
+                .append("operation", getOperation())
+                .append("createTime", getCreateTime())
+                .append("createBy", getCreateBy())
+                .append("updateTime", getUpdateTime())
+                .append("updateBy", getUpdateBy())
+                .append("isDelete", getIsDelete())
+                .toString();
+    }
+
+    public Date getEventEndTime() {
+        return eventEndTime;
+    }
+
+    public void setEventEndTime(Date eventEndTime) {
+        this.eventEndTime = eventEndTime;
+    }
+
+    public Date getEventStartTime() {
+        return eventStartTime;
+    }
+
+    public void setEventStartTime(Date eventStartTime) {
+        this.eventStartTime = eventStartTime;
+    }
+
+    public String getEventName() {
+        return eventName;
+    }
+
+    public void setEventName(String eventName) {
+        this.eventName = eventName;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
     }
 }

+ 29 - 10
willalp-clocking-in/src/main/java/com/willalp/event/domain/HsEvent.java

@@ -9,7 +9,9 @@ import com.willalp.common.annotation.Excel;
 import com.willalp.common.core.domain.BaseEntity;
 import org.springframework.format.annotation.DateTimeFormat;
 
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 活动配置对象 hs_event
@@ -35,6 +37,18 @@ public class HsEvent extends BaseEntity
     @Excel(name = "事件名称")
     private String eventName;
 
+    /** 事件开始时间 */
+    @DateTimeFormat
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @Excel(name = "事件开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date eventStartTime;
+
+    /** 事件结束时间 */
+    @DateTimeFormat
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @Excel(name = "事件结束时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date eventEndTime;
+
     /** 开始时间 */
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@@ -47,16 +61,6 @@ public class HsEvent extends BaseEntity
     @Excel(name = "事件时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date eventTime;
 
-    /** 事件开始时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
-    @Excel(name = "事件开始时间", width = 30, dateFormat = "yyyy-MM-dd")
-    private Date eventStartTime;
-
-    /** 事件结束时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
-    @Excel(name = "事件结束时间", width = 30, dateFormat = "yyyy-MM-dd")
-    private Date eventEndTime;
-
     /** 结束时间 */
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@@ -73,6 +77,9 @@ public class HsEvent extends BaseEntity
     @TableField(exist = false)
     public String eventPlaceSite;
 
+    @TableField(exist = false)
+    public List<HsEventImg> eventImgUrls = new ArrayList<>();
+
     @TableField(exist = false)
     public String eventImgUrl;
 
@@ -84,6 +91,10 @@ public class HsEvent extends BaseEntity
     @Excel(name = "禁止取消预约时限")
     private Integer banCancelSubscribeTimeLimit;
 
+    /** 当前数量 */
+    @Excel(name = "当前数量")
+    private Integer nowNum;
+
     /** 数量限制 */
     @Excel(name = "数量限制")
     private Integer limitNum;
@@ -252,4 +263,12 @@ public class HsEvent extends BaseEntity
     public void setActivityTypeId(String activityTypeId) {
         this.activityTypeId = activityTypeId;
     }
+
+    public Integer getNowNum() {
+        return nowNum;
+    }
+
+    public void setNowNum(Integer nowNum) {
+        this.nowNum = nowNum;
+    }
 }

+ 120 - 0
willalp-clocking-in/src/main/java/com/willalp/event/domain/HsEventImg.java

@@ -0,0 +1,120 @@
+package com.willalp.event.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.willalp.common.annotation.Excel;
+import com.willalp.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.math.BigDecimal;
+
+/**
+ * 事件(活动)图片信息对象 hs_event_img
+ *
+ * @author willalp
+ * @date 2023-04-10
+ */
+
+@TableName("hs_event_img")
+public class HsEventImg extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    @TableId
+    private String id;
+
+    /** 事件(活动)表ID */
+    @Excel(name = "事件", readConverterExp = "活=动")
+    private String eventId;
+
+    /** 图片地址 */
+    @Excel(name = "图片地址")
+    private String url;
+
+    /** 大小 */
+    @Excel(name = "大小")
+    private BigDecimal size;
+
+    /** 图片格式 */
+    @Excel(name = "图片格式")
+    private String type;
+
+    /** 是否删除(0.未删除;1.已删除) */
+    @TableLogic
+    private Integer isDelete;
+
+    public void setId(String id)
+    {
+        this.id = id;
+    }
+
+    public String getId()
+    {
+        return id;
+    }
+    public void setEventId(String eventId)
+    {
+        this.eventId = eventId;
+    }
+
+    public String getEventId()
+    {
+        return eventId;
+    }
+    public void setUrl(String url)
+    {
+        this.url = url;
+    }
+
+    public String getUrl()
+    {
+        return url;
+    }
+    public void setSize(BigDecimal size)
+    {
+        this.size = size;
+    }
+
+    public BigDecimal getSize()
+    {
+        return size;
+    }
+    public void setType(String type)
+    {
+        this.type = type;
+    }
+
+    public String getType()
+    {
+        return type;
+    }
+    public void setIsDelete(Integer isDelete)
+    {
+        this.isDelete = isDelete;
+    }
+
+    public Integer getIsDelete()
+    {
+        return isDelete;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("eventId", getEventId())
+            .append("url", getUrl())
+            .append("size", getSize())
+            .append("type", getType())
+            .append("isDelete", getIsDelete())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 18 - 10
willalp-clocking-in/src/main/java/com/willalp/event/domain/vo/AppActivityAppointRecordVo.java

@@ -1,6 +1,5 @@
 package com.willalp.event.domain.vo;
 
-import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.willalp.common.annotation.Excel;
 
@@ -12,7 +11,7 @@ import java.util.Date;
  * @author willalp
  * @date 2023-01-29*/
 
-public class AppActivityAppointRecordVo{
+public class AppActivityAppointRecordVo {
 
     /** 主键 */
     private String id;
@@ -29,23 +28,24 @@ public class AppActivityAppointRecordVo{
     @Excel(name = "事件类型")
     private String eventType;
 
-    public void setId(String id)
-    {
+    /** 事件类型 */
+    @Excel(name = "预约时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
+    private Date createTime;
+
+    public void setId(String id) {
         this.id = id;
     }
 
-    public String getId()
-    {
+    public String getId() {
         return id;
     }
 
-    public void setEventName(String eventName)
-    {
+    public void setEventName(String eventName) {
         this.eventName = eventName;
     }
 
-    public String getEventName()
-    {
+    public String getEventName() {
         return eventName;
     }
 
@@ -64,4 +64,12 @@ public class AppActivityAppointRecordVo{
     public void setEventType(String eventType) {
         this.eventType = eventType;
     }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
 }

+ 23 - 0
willalp-clocking-in/src/main/java/com/willalp/event/mapper/HsEventImgMapper.java

@@ -0,0 +1,23 @@
+package com.willalp.event.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.willalp.event.domain.HsEventImg;
+
+import java.util.List;
+
+/**
+ * 事件(活动)图片信息Mapper接口
+ *
+ * @author willalp
+ * @date 2023-04-10
+ */
+public interface HsEventImgMapper extends BaseMapper<HsEventImg>
+{
+    /**
+     * 查询事件(活动)图片信息列表
+     *
+     * @param hsEventImg 事件(活动)图片信息
+     * @return 事件(活动)图片信息集合
+     */
+    List<HsEventImg> selectHsEventImgList(HsEventImg hsEventImg);
+}

+ 1 - 3
willalp-clocking-in/src/main/java/com/willalp/event/mapper/HsEventMapper.java

@@ -13,8 +13,7 @@ import java.util.List;
  * @author willalp
  * @date 2023-01-29
  */
-public interface HsEventMapper extends BaseMapper<HsEvent>
-{
+public interface HsEventMapper extends BaseMapper<HsEvent> {
     /**
      * 查询活动配置列表
      *
@@ -39,7 +38,6 @@ public interface HsEventMapper extends BaseMapper<HsEvent>
      */
     List<HsEvent> getFormerlyEventList(HsEvent hsEvent);
 
-
     /**
      * app获取活动集
      *

+ 27 - 20
willalp-clocking-in/src/main/java/com/willalp/event/mapper/xml/HsActivityAppointMapper.xml

@@ -21,26 +21,32 @@
     </resultMap>
 
     <sql id="selectHsActivityAppointVo">
-        select id,
-               activity_time,
-               appointee_name,
-               appointee_phone,
-               appointment_time,
-               activity_id,
-               remark,
-               operation,
-               create_time,
-               create_by,
-               update_time,
-               update_by,
-               is_delete
-        from hs_activity_appoint
+        select haa.id,
+               he.event_name,
+               he.event_start_time,
+               he.event_end_time,
+               hai.project_name,
+               haa.activity_time,
+               haa.appointee_name,
+               haa.appointee_phone,
+               haa.appointment_time,
+               haa.activity_id,
+               haa.remark,
+               haa.operation,
+               haa.create_time,
+               haa.create_by,
+               haa.update_time,
+               haa.update_by,
+               haa.is_delete
+        from hs_activity_appoint haa
+                 left join hs_event he on haa.activity_id = he.id
+                 left join hs_associations_info hai on hai.id = he.activity_type_id
     </sql>
 
     <select id="selectHsActivityAppointList" parameterType="HsActivityAppoint" resultMap="HsActivityAppointResult">
         <include refid="selectHsActivityAppointVo"/>
         <where>
-            is_delete = 0
+            haa.is_delete = 0
             <if test="activityTime != null ">
                 and activity_time = #{activityTime}
             </if>
@@ -48,13 +54,13 @@
                 and appointee_name like concat('%', #{appointeeName}, '%')
             </if>
             <if test="appointeePhone != null  and appointeePhone != ''">
-                and appointee_phone = #{appointeePhone}
+                and appointee_phone like concat('%', #{appointeePhone}, '%')
             </if>
             <if test="appointmentTime != null ">
-                and appointment_time = #{appointmentTime}
+                and SUBSTR( appointment_time, 1, 10 ) = SUBSTR(#{appointmentTime} , 1, 10 )
             </if>
             <if test="activityId != null ">
-                and activity_id = #{activityId}
+                and haa.activity_id = #{activityId}
             </if>
         </where>
     </select>
@@ -62,11 +68,12 @@
         select haa.id              id,
                he.event_name       eventName,
                he.event_start_time eventTime,
-               hai.project_name    eventType
+               hai.project_name    eventType,
+               hai.create_time
         from hs_activity_appoint haa
                  left join hs_event he on haa.activity_id = he.id
                  left join hs_associations_info hai on hai.id = he.activity_type_id
         WHERE haa.is_delete = 0
-          AND he.create_by = #{userCode}
+          AND haa.create_by = #{userCode}
     </select>
 </mapper>

+ 54 - 0
willalp-clocking-in/src/main/java/com/willalp/event/mapper/xml/HsEventImgMapper.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.willalp.event.mapper.HsEventImgMapper">
+
+    <resultMap type="com.willalp.event.domain.HsEventImg" id="HsEventImgResult">
+        <result property="id" column="id"/>
+        <result property="eventId" column="event_id"/>
+        <result property="url" column="url"/>
+        <result property="size" column="size"/>
+        <result property="type" column="type"/>
+        <result property="isDelete" column="is_delete"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+
+    <sql id="selectHsEventImgVo">
+        select id,
+               event_id,
+               url,
+               size,
+               type,
+               is_delete,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from hs_event_img
+    </sql>
+
+    <select id="selectHsEventImgList" parameterType="HsEventImg" resultMap="HsEventImgResult">
+        <include refid="selectHsEventImgVo"/>
+        <where>
+            is_delete = 0
+            <if test="eventId != null  and eventId != ''">
+                and event_id = #{eventId}
+            </if>
+            <if test="url != null  and url != ''">
+                and url = #{url}
+            </if>
+            <if test="size != null ">
+                and size = #{size}
+            </if>
+            <if test="type != null  and type != ''">
+                and type = #{type}
+            </if>
+        </where>
+    </select>
+</mapper>

+ 10 - 4
willalp-clocking-in/src/main/java/com/willalp/event/mapper/xml/HsEventMapper.xml

@@ -11,6 +11,7 @@
         <result property="startTime" column="start_time"/>
         <result property="banCancelSubscribeTimeLimit" column="ban_cancel_subscribe_time_limit"/>
         <result property="eventTime" column="event_time"/>
+        <result property="nowNum" column="now_num"/>
         <result property="limitNum" column="limit_num"/>
         <result property="eventType" column="event_type"/>
         <result property="endTime" column="end_time"/>
@@ -31,6 +32,7 @@
 
     <sql id="selectHsEventVo">
         select id,
+               now_num,
                limit_num,
                event_start_time,
                event_end_time,
@@ -108,16 +110,20 @@
                limit_num,
                event_start_time,
                event_end_time,
-               hcdp.place_name                                                              event_place,
-               hcdp.place_site                                                              eventPlaceSite,
-               hcdp.place_img_url                                                           eventImgUrl,
-               (SELECT count(1) FROM hs_activity_appoint haa WHERE he.id = haa.activity_id) alreadyHave
+               hcdp.place_name           event_place,
+               hcdp.place_site           eventPlaceSite,
+               hcdp.place_img_url        eventImgUrl,
+               (SELECT count(1)
+                FROM hs_activity_appoint haa
+                WHERE he.id = haa.activity_id
+                  AND haa.is_delete = 0) alreadyHave
         FROM hs_event he
                  LEFT JOIN hs_canteen_dining_place hcdp ON he.event_place = hcdp.place_id
             AND hcdp.place_type = 4
             AND hcdp.is_delete = 0
         WHERE he.is_delete = 0
           AND he.activity_type_id = #{associationsInfoId}
+          AND (he.event_status = '2' or he.event_status = '3')
     </select>
     <select id="appGetMoreById" resultType="com.willalp.event.domain.vo.ClubActivityMoreVo">
         SELECT he.id,

+ 23 - 0
willalp-clocking-in/src/main/java/com/willalp/event/service/IHsEventImgService.java

@@ -0,0 +1,23 @@
+package com.willalp.event.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.willalp.event.domain.HsEventImg;
+
+import java.util.List;
+
+/**
+ * 事件(活动)图片信息Service接口
+ *
+ * @author willalp
+ * @date 2023-04-10
+ */
+public interface IHsEventImgService extends IService<HsEventImg>
+{
+    /**
+     * 查询事件(活动)图片信息列表
+     *
+     * @param hsEventImg 事件(活动)图片信息
+     * @return 事件(活动)图片信息集合
+     */
+    public List<HsEventImg> selectHsEventImgList(HsEventImg hsEventImg);
+}

+ 35 - 0
willalp-clocking-in/src/main/java/com/willalp/event/service/impl/HsEventImgServiceImpl.java

@@ -0,0 +1,35 @@
+package com.willalp.event.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.willalp.event.domain.HsEventImg;
+import com.willalp.event.mapper.HsEventImgMapper;
+import com.willalp.event.service.IHsEventImgService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 事件(活动)图片信息Service业务层处理
+ *
+ * @author willalp
+ * @date 2023-04-10
+ */
+@Service
+public class HsEventImgServiceImpl extends ServiceImpl<HsEventImgMapper, HsEventImg>  implements IHsEventImgService
+{
+    @Resource
+    private HsEventImgMapper hsEventImgMapper;
+
+    /**
+     * 查询事件(活动)图片信息列表
+     *
+     * @param hsEventImg 事件(活动)图片信息
+     * @return 事件(活动)图片信息
+     */
+    @Override
+    public List<HsEventImg> selectHsEventImgList(HsEventImg hsEventImg)
+    {
+        return hsEventImgMapper.selectHsEventImgList(hsEventImg);
+    }
+}

+ 8 - 1
willalp-clocking-in/src/main/java/com/willalp/event/service/impl/HsEventServiceImpl.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.willalp.common.utils.StringUtils;
 import com.willalp.event.domain.HsEvent;
 import com.willalp.event.domain.HsEventBusinessRelation;
+import com.willalp.event.domain.HsEventImg;
 import com.willalp.event.domain.vo.ClubActivityMoreVo;
 import com.willalp.event.mapper.HsEventMapper;
 import com.willalp.event.service.IHsAssociationsInfoService;
@@ -33,6 +34,9 @@ public class HsEventServiceImpl extends ServiceImpl<HsEventMapper, HsEvent> impl
     @Resource
     private HsEventMapper hsEventMapper;
 
+    @Resource
+    private HsEventImgServiceImpl eventImgService;
+
     /**
      * 查询活动配置列表
      *
@@ -41,7 +45,10 @@ public class HsEventServiceImpl extends ServiceImpl<HsEventMapper, HsEvent> impl
      */
     @Override
     public List<HsEvent> selectHsEventList(HsEvent hsEvent) {
-        return hsEventMapper.selectHsEventList(hsEvent);
+        List<HsEvent> hsEvents = hsEventMapper.selectHsEventList(hsEvent);
+        hsEvents.forEach(item -> item.eventImgUrls.addAll(eventImgService.getBaseMapper().selectList(new QueryWrapper<HsEventImg>()
+                .eq("event_id", item.getId()))));
+        return hsEvents;
     }
 
     @Override

+ 1 - 1
willalp-clocking-in/src/main/java/com/willalp/files/mapper/xml/HsOrgPersonnelFilesMapper.xml

@@ -69,7 +69,7 @@
             resultMap="HsOrgPersonnelFilesResult">
         <include refid="selectHsOrgPersonnelFilesVo"/>
         <where>
-            is_delete = 0 AND now_status = '1'
+            is_delete = 0 AND now_status != '1'
             And suo.organization_code = 'G00000007'
             <if test="userType != null  and userType != ''">
                 and suo.user_type = #{userType}

+ 20 - 0
willalp-clocking-in/src/main/java/com/willalp/flow/service/TriggerService.java

@@ -0,0 +1,20 @@
+/**
+ * @projectName willalp-pns-ml
+ * @package com.willalp.flow.service
+ * @className com.willalp.flow.service.TriggerService
+ * @copyright Copyright 2019 HuiShan, Inc All rights reserved.
+ */
+package com.willalp.flow.service;
+
+/**
+ * TriggerService
+ * @description 流程触发器
+ * @author hs
+ * @date 2023/4/11 16:40
+ * @version 1.0
+ */
+
+public interface TriggerService {
+
+    void doTest(int count);
+}

+ 24 - 0
willalp-clocking-in/src/main/java/com/willalp/flow/service/impl/TriggerServiceImpl.java

@@ -0,0 +1,24 @@
+/**
+ * @projectName willalp-pns-ml
+ * @package com.willalp.flow.service
+ * @className com.willalp.flow.service.impl.TriggerServiceImpl
+ * @copyright Copyright 2019 HuiShan, Inc All rights reserved.
+ */
+package com.willalp.flow.service.impl;
+
+import com.willalp.flow.service.TriggerService;
+
+/**
+ * TriggerServiceImpl
+ * @description
+ * @author hs
+ * @date 2023/4/11 16:41
+ * @version 1.0
+ */
+public class TriggerServiceImpl implements TriggerService {
+    @Override
+    public void doTest(int count) {
+
+    }
+}
+ 

+ 1 - 0
willalp-clocking-in/src/main/java/com/willalp/salary/service/impl/HsSalarySlipServiceImpl.java

@@ -161,6 +161,7 @@ public class HsSalarySlipServiceImpl extends ServiceImpl<HsSalarySlipMapper, HsS
                     }
                     //生成消息
                     HsAppUserMsg aum = new HsAppUserMsg();
+                    aum.setMsgTitle(iSp.getPayDate());
                     aum.setUserCode(userCode);
                     aum.setMsgType("3");
                     aum.setMsgContent("您的" + iSp.getPayDate() + "工资条已发送,请查看核对");

+ 22 - 25
willalp-common/src/main/java/com/willalp/common/utils/spring/SpringUtils.java

@@ -1,5 +1,7 @@
 package com.willalp.common.utils.spring;
 
+import com.willalp.common.exception.base.BaseException;
+import com.willalp.common.utils.StringUtils;
 import org.springframework.aop.framework.AopContext;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.NoSuchBeanDefinitionException;
@@ -8,7 +10,6 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
 import org.springframework.stereotype.Component;
-import com.willalp.common.utils.StringUtils;
 
 /**
  * spring工具类 方便在非spring管理环境中获取bean
@@ -16,22 +17,27 @@ import com.willalp.common.utils.StringUtils;
  * @author willalp
  */
 @Component
-public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware
-{
+public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware {
     /** Spring应用上下文环境 */
     private static ConfigurableListableBeanFactory beanFactory;
 
     private static ApplicationContext applicationContext;
 
+    public static String doMethod(Object obj, String methodName, Class[] clazzs, Object... args) {
+        try {
+            return (String) obj.getClass().getMethod(methodName, clazzs).invoke(obj, args);
+        } catch (Exception e) {
+           throw new BaseException("[doMethod] Exception methodName:{}, args:{}" + methodName + e);
+        }
+    }
+
     @Override
-    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
-    {
+    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
         SpringUtils.beanFactory = beanFactory;
     }
 
     @Override
-    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
-    {
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
         SpringUtils.applicationContext = applicationContext;
     }
 
@@ -44,8 +50,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
      *
      */
     @SuppressWarnings("unchecked")
-    public static <T> T getBean(String name) throws BeansException
-    {
+    public static <T> T getBean(String name) throws BeansException {
         return (T) beanFactory.getBean(name);
     }
 
@@ -57,8 +62,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
      * @throws org.springframework.beans.BeansException
      *
      */
-    public static <T> T getBean(Class<T> clz) throws BeansException
-    {
+    public static <T> T getBean(Class<T> clz) throws BeansException {
         T result = (T) beanFactory.getBean(clz);
         return result;
     }
@@ -69,8 +73,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
      * @param name
      * @return boolean
      */
-    public static boolean containsBean(String name)
-    {
+    public static boolean containsBean(String name) {
         return beanFactory.containsBean(name);
     }
 
@@ -82,8 +85,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
      * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
      *
      */
-    public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException
-    {
+    public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
         return beanFactory.isSingleton(name);
     }
 
@@ -93,8 +95,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
      * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
      *
      */
-    public static Class<?> getType(String name) throws NoSuchBeanDefinitionException
-    {
+    public static Class<?> getType(String name) throws NoSuchBeanDefinitionException {
         return beanFactory.getType(name);
     }
 
@@ -106,8 +107,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
      * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
      *
      */
-    public static String[] getAliases(String name) throws NoSuchBeanDefinitionException
-    {
+    public static String[] getAliases(String name) throws NoSuchBeanDefinitionException {
         return beanFactory.getAliases(name);
     }
 
@@ -118,8 +118,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
      * @return
      */
     @SuppressWarnings("unchecked")
-    public static <T> T getAopProxy(T invoker)
-    {
+    public static <T> T getAopProxy(T invoker) {
         return (T) AopContext.currentProxy();
     }
 
@@ -128,8 +127,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
      *
      * @return 当前的环境配置
      */
-    public static String[] getActiveProfiles()
-    {
+    public static String[] getActiveProfiles() {
         return applicationContext.getEnvironment().getActiveProfiles();
     }
 
@@ -138,8 +136,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
      *
      * @return 当前的环境配置
      */
-    public static String getActiveProfile()
-    {
+    public static String getActiveProfile() {
         final String[] activeProfiles = getActiveProfiles();
         return StringUtils.isNotEmpty(activeProfiles) ? activeProfiles[0] : null;
     }

+ 53 - 0
willalp-ui/src/api/event/img.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询事件(活动)图片信息列表
+export function listImg(query) {
+  return request({
+    url: '/event/img/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询事件(活动)图片信息详细
+export function getImg(id) {
+  return request({
+    url: '/event/img/' + id,
+    method: 'get'
+  })
+}
+
+// 新增事件(活动)图片信息
+export function addImg(data) {
+  return request({
+    url: '/event/img',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改事件(活动)图片信息
+export function updateImg(data) {
+  return request({
+    url: '/event/img',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除事件(活动)图片信息
+export function delImg(id) {
+  return request({
+    url: '/event/img/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出事件(活动)图片信息
+export function exportImg(query) {
+  return request({
+    url: '/event/img/export',
+    method: 'get',
+    params: query
+  })
+}

+ 13 - 13
willalp-ui/src/components/ImageUpload/index.vue

@@ -3,17 +3,17 @@
     <el-upload
       :action="uploadImgUrl"
       list-type="picture-card"
-      :on-success="handleUploadSuccess"
       :before-upload="handleBeforeUpload"
       :limit="limit"
-      :on-error="handleUploadError"
       :on-exceed="handleExceed"
       name="file"
+      :on-error="handleUploadError"
+      :on-success="handleUploadSuccess"
       :on-remove="handleRemove"
-      :show-file-list="true"
+      :on-preview="handlePictureCardPreview"
       :headers="headers"
       :file-list="fileList"
-      :on-preview="handlePictureCardPreview"
+      :show-file-list="true"
       :class="{hide: this.fileList.length >= this.limit}"
     >
       <i class="el-icon-plus"></i>
@@ -127,6 +127,13 @@ export default {
       this.fileList.push({ name: res.fileName, url: res.url });
       this.$emit("input", this.listToString(this.fileList));
       this.loading.close();
+    },  // 上传失败
+    handleUploadError() {
+      this.$message({
+        type: "error",
+        message: "上传失败",
+      });
+      this.loading.close();
     },
     // 上传前loading加载
     handleBeforeUpload(file) {
@@ -168,14 +175,7 @@ export default {
     handleExceed() {
       this.$message.error(`上传文件数量不能超过 ${this.limit} 个!`);
     },
-    // 上传失败
-    handleUploadError() {
-      this.$message({
-        type: "error",
-        message: "上传失败",
-      });
-      this.loading.close();
-    },
+
     // 预览
     handlePictureCardPreview(file) {
       this.dialogImageUrl = file.url;
@@ -188,7 +188,7 @@ export default {
       for (let i in list) {
         strs += list[i].url.replace(this.baseUrl, "") + separator;
       }
-      return strs != '' ? strs.substr(0, strs.length - 1) : '';
+      return strs !== '' ? strs.substr(0, strs.length - 1) : '';
     }
   }
 };

+ 1 - 1
willalp-ui/src/views/canteen/gift/index.vue

@@ -506,7 +506,7 @@ export default {
     eventShow() {
       this.eventForm.open = true
       setTimeout(() => {
-        this.$refs.event.queryParams.eventType = '1'
+        this.$refs.event.queryParams.eventType = '2'
         this.$refs.event.getList()
       }, 100)
     },

+ 7 - 2
willalp-ui/src/views/canteen/place/index.vue

@@ -37,9 +37,12 @@
       default-expand-all
       :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
     >
-      <el-table-column label="父id" prop="parentId" v-if="false"/>
-      <el-table-column label="祖级列表" align="center" prop="ancestors" v-if="false"/>
       <el-table-column label="地点" align="center" prop="placeName"/>
+      <el-table-column label="地点" align="center" prop="placeName">
+        <template slot-scope="scope">
+          <el-image :src="baseUrl+scope.row.placeImgUrl" style="width: 100%; height: 100px"></el-image>
+        </template>
+      </el-table-column>
       <el-table-column label="位置类型" align="center" prop="placeType">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.place_type" :value="scope.row.placeType"/>
@@ -137,6 +140,7 @@ export default {
   },
   data() {
     return {
+      baseUrl: process.env.VUE_APP_BASE_API,
       // 遮罩层
       loading: true,
       // 显示搜索条件
@@ -162,6 +166,7 @@ export default {
     }
   },
   created() {
+    this.queryParams.placeType = this.$root._route.query.placeType
     this.getList()
   },
   methods: {

+ 381 - 0
willalp-ui/src/views/components/addUsers/index.vue

@@ -0,0 +1,381 @@
+<template>
+  <div style="display: inline-block;padding: 0px;">
+    <div>
+      <el-button
+        type="text"
+        size="mini"
+        @click="openAddUser"
+      >{{ title }}
+      </el-button>
+    </div>
+    <div>
+      <el-dialog :title="title" :visible.sync="open" width="1800px" append-to-body @cancel="cancel">
+        <el-row :gutter="5" class="mb8">
+          <el-col :span="12">
+            <el-card>
+              <el-row :gutter="10" class="mb8">
+                <el-col :span="1.5">
+                  未添加列表
+                </el-col>
+              </el-row>
+              <el-form :model="filesListDialog" ref="filesListDialog" :inline="true">
+                <el-row :gutter="10" class="mb8">
+                  <el-col :span="1.5">
+                    <el-form-item label="姓名" prop="userName">
+                      <el-input
+                        v-model="filesListDialog.userName"
+                        placeholder="请输入姓名"
+                        clearable
+                        size="small"
+                        @keyup.enter.native="handleQuery"
+                      />
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="1.5">
+                    <el-form-item label="工号" prop="userCode">
+                      <el-input
+                        v-model="filesListDialog.userCode"
+                        placeholder="请输入工号"
+                        clearable
+                        size="small"
+                        @keyup.enter.native="handleQuery"
+                      />
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="1.5">
+                    <div class="grid-content bg-purple">
+                      <el-form-item label="操作">
+                        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索
+                        </el-button>
+                      </el-form-item>
+                    </div>
+                  </el-col>
+                </el-row>
+              </el-form>
+              <el-row :gutter="10" class="mb8">
+                <el-col :span="1.5">
+                  <el-button
+                    type="primary"
+                    plain
+                    icon="el-icon-plus"
+                    size="mini"
+                    @click="addGroupUser"
+                  >添加
+                  </el-button>
+                </el-col>
+                <right-toolbar :showSearch.sync="showSearch" @queryTable="getUserDialogList"></right-toolbar>
+              </el-row>
+              <el-row :gutter="10">
+                <!--部门数据-->
+                <el-col :span="10" :xs="24">
+                  <div class="head-container">
+                    <el-input
+                      v-model="deptName"
+                      placeholder="请输入部门名称"
+                      clearable
+                      size="small"
+                      prefix-icon="el-icon-search"
+                      style="margin-bottom: 20px"
+                    />
+                  </div>
+                  <div class="head-container">
+                    <el-tree
+                      :data="deptOptions"
+                      :props="defaultProps"
+                      :expand-on-click-node="false"
+                      :filter-node-method="filterNode"
+                      ref="tree"
+                      default-expand-all
+                      @node-click="handleNodeClick"
+                    />
+                  </div>
+                </el-col>
+                <el-col :span="12" :xs="24">
+                  <el-table :title="titleText" v-loading="filesListDialog.loading" :data="filesList" @cancel="cancel"
+                            @selection-change="addConfigUser" height="507">
+                    <el-table-column type="selection" width="55" align="center"/>
+                    <el-table-column label="工号" align="center" prop="userCode"/>
+                    <el-table-column label="姓名" align="center" prop="userName"/>
+                  </el-table>
+                  <div style="width: 620px">
+                    <pagination
+                      :total="filesListDialog.total"
+                      :page.sync="filesListDialog.pageNum"
+                      :limit.sync="filesListDialog.pageSize"
+                      @pagination="getUserDialogList"
+                    />
+                  </div>
+
+                </el-col>
+              </el-row>
+            </el-card>
+          </el-col>
+          <el-col :span="12">
+            <el-card>
+              <div>
+                <el-row :gutter="10" class="mb8">
+                  <el-col :span="1.5">
+                    未添加列表
+                  </el-col>
+                </el-row>
+                <el-form :model="filesListDialog" ref="filesListDialog" :inline="true">
+                  <el-row :gutter="10" class="mb8">
+                    <el-col :span="1.5">
+                      <el-form-item label="姓名" prop="userName">
+                        <el-input
+                          v-model="usersPage.userName"
+                          placeholder="请输入姓名"
+                          clearable
+                          size="small"
+                          @keyup.enter.native="handleQuery"
+                        />
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="1.5">
+                      <el-form-item label="工号" prop="userCode">
+                        <el-input
+                          v-model="usersPage.userCode"
+                          placeholder="请输入工号"
+                          clearable
+                          size="small"
+                          @keyup.enter.native="handleQuery"
+                        />
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="1.5">
+                      <div class="grid-content bg-purple">
+                        <el-form-item label="操作">
+                          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryBinding">搜索
+                          </el-button>
+                        </el-form-item>
+                      </div>
+                    </el-col>
+                  </el-row>
+                </el-form>
+                <el-table :title="titleText" v-loading="usersPage.loading" :data="userActualList" @cancel="cancel"
+                          height="545">
+                  <el-table-column label="工号" align="center" prop="userCode"/>
+                  <el-table-column label="姓名" align="center" prop="userName"/>
+                  <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                    <template slot-scope="scope">
+                      <el-button
+                        size="mini"
+                        type="text"
+                        icon="el-icon-delete"
+                        @click="deletePostUser(scope.row,scope.$index)"
+                      >删除
+                      </el-button>
+                    </template>
+                  </el-table-column>
+                </el-table>
+                <pagination
+                  :total="usersPage.total"
+                  :page.sync="usersPage.pageNum"
+                  :limit.sync="usersPage.pageSize"
+                  @pagination="getUsersData"
+                />
+              </div>
+            </el-card>
+          </el-col>
+        </el-row>
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script>
+
+import { listFiles } from '@/api/files/files'
+import { treeselect } from '@/api/system/dept'
+import Treeselect from '@riophae/vue-treeselect'
+
+export default {
+  name: 'index',
+  components: { Treeselect },
+  props: {
+    data: {
+      type: Object,
+      default: undefined
+    },
+    title: {
+      type: String,
+      default: '管理'
+    },
+    propsName: {
+      type: String,
+      default: 'users'
+    }
+  },
+  data() {
+    return {
+      // 部门树选项
+      deptOptions: undefined,
+      deptName: '',
+      defaultProps: {
+        children: 'children',
+        label: 'label'
+      },
+      open: false,
+      showSearch: false,
+      titleText: undefined,
+      userActualListData: [],
+      userActualList: [],
+      filesList: [],
+      filesListDialog: {
+        userName: '',
+        userCode: '',
+        department: '',
+        open: false,
+        total: 0,
+        loading: true,
+        pageNum: 1,
+        pageSize: 10
+      },
+      usersPage: {
+        total: 0,
+        pageNum: 1,
+        pageSize: 10,
+        loading: true,
+        userName: '',
+        userCode: ''
+      }
+    }
+  },
+  created() {
+    this.getTreeselect()
+  },
+  methods: {
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.filesListDialog.pageNum = 1
+      this.getUserDialogList()
+    },
+    handleQueryBinding() {
+      this.getUsersData()
+    },
+    openAddUser() {
+      this.open = true
+      this.getUserDialogList()
+      this.setUserActualList()
+    },
+    getUsersData() {
+      this.usersPage.loading = true
+      let i = (this.usersPage.pageNum - 1) * this.usersPage.pageSize
+      let copyList = []
+      for (let j = i; j < i + this.usersPage.pageSize; j++) {
+        if (this.userActualListData[j]) {
+          if (!this.usersPage.userName && !this.usersPage.userCode) {
+            copyList.push(this.userActualListData[j])
+          } else if (this.usersPage.userName === this.userActualListData[j].userName) {
+            copyList.push(this.userActualListData[j])
+          } else if (this.usersPage.userCode === this.userActualListData[j].userCode) {
+            copyList.push(this.userActualListData[j])
+          }
+        }
+      }
+      this.userActualList = copyList
+      this.usersPage.total = this.userActualListData.length
+      this.usersPage.loading = false
+    },
+    /** 添加用户按钮 */
+    addGroupUser() {
+      var itemToString = this.ids.toString()
+      if (this.data[this.propsName]) {
+        this.data[this.propsName] += ',' + itemToString
+      } else {
+        this.data[this.propsName] = itemToString
+      }
+      this.setUserActualList()
+      this.$emit('addGroupUser', this.data)
+    },
+    deletePostUser(item, index) {
+      let reg = ''
+      if (index > 0) {
+        reg = new RegExp(',' + item.userName + item.userCode)
+      } else if (index === 0 && this.userActualList.length === 1) {
+        reg = new RegExp(item.userName + item.userCode)
+      } else {
+        reg = new RegExp(item.userName + item.userCode + ',')
+      }
+      this.data[this.propsName] = this.data[this.propsName].replace(reg, '')
+      this.setUserActualList()
+      this.$emit('deletePostUser', this.data)
+    },
+    setUserActualList() {
+      this.userActualListData = []
+      this.userActualList = []
+      if (this.data[this.propsName]) {
+        let ay = this.data[this.propsName].split(',')
+        this.getConfigKey('user_no_prefix').then(result => {
+          if (result.code === 200) {
+            let prefix = result.msg
+            if (ay) {
+              for (let i = 0; i < ay.length; i++) {
+                let of = ay[i].indexOf(prefix)
+                if (of !== -1) {
+                  this.userActualListData.push({
+                    userName: ay[i].substring(0, of),
+                    userCode: ay[i].substring(of)
+                  })
+                } else {
+                  of = ay[i].indexOf('admin')
+                  if (of !== -1) {
+                    this.userActualListData.push({
+                      userName: 'WILLALP',
+                      userCode: 'admin'
+                    })
+                  }
+                }
+              }
+
+              this.getUsersData()
+            }
+          }
+        })
+      }
+      this.usersPage.total = 0
+      this.usersPage.loading = false
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data
+      })
+    },
+    // 筛选节点
+    filterNode(value, data) {
+      if (!value) return true
+      return data.label.indexOf(value) !== -1
+    },
+    // 节点单击事件
+    handleNodeClick(data) {
+      this.filesListDialog.department = data.id
+      this.handleQuery()
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+    },
+    // 多选框选中数据
+    addConfigUser(selection) {
+      this.ids = selection.map(item => item.userName + item.userCode)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 查询机构人员档案列表 */
+    getUserDialogList() {
+      this.filesListDialog.loading = true
+      listFiles(this.filesListDialog).then(response => {
+        this.filesList = response.rows
+        this.filesListDialog.total = response.total
+        this.filesListDialog.loading = false
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 111 - 143
willalp-ui/src/views/event/appoint/index.vue

@@ -1,13 +1,15 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
-      <el-form-item label="活动日期" prop="activityTime">
-        <el-date-picker clearable size="small"
-          v-model="queryParams.activityTime"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择活动日期">
-        </el-date-picker>
+      <el-form-item label="活动" prop="activityId">
+        <el-select v-model="queryParams.activityId" placeholder="请选择活动">
+          <el-option
+            v-for="dict in eventList"
+            :key="dict.id"
+            :label="dict.eventName"
+            :value="dict.id"
+          ></el-option>
+        </el-select>
       </el-form-item>
       <el-form-item label="姓名" prop="appointeeName">
         <el-input
@@ -29,21 +31,12 @@
       </el-form-item>
       <el-form-item label="预约时间" prop="appointmentTime">
         <el-date-picker clearable size="small"
-          v-model="queryParams.appointmentTime"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择预约时间">
+                        v-model="queryParams.appointmentTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择预约时间">
         </el-date-picker>
       </el-form-item>
-      <el-form-item label="活动ID" prop="activityId">
-        <el-input
-          v-model="queryParams.activityId"
-          placeholder="请输入活动ID"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -59,7 +52,8 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['event:appoint:add']"
-        >新增</el-button>
+        >新增
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -70,7 +64,8 @@
           :disabled="single"
           @click="handleUpdate"
           v-hasPermi="['event:appoint:edit']"
-        >修改</el-button>
+        >修改
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -81,7 +76,8 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['event:appoint:remove']"
-        >删除</el-button>
+        >删除
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -92,28 +88,25 @@
           :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['event:appoint:export']"
-        >导出</el-button>
+        >导出
+        </el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="appointList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="主键" align="center" prop="id" />
-      <el-table-column label="活动日期" align="center" prop="activityTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.activityTime, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="姓名" align="center" prop="appointeeName" />
-      <el-table-column label="手机号" align="center" prop="appointeePhone" />
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="姓名" align="center" prop="appointeeName"/>
+      <el-table-column label="手机号" align="center" prop="appointeePhone"/>
       <el-table-column label="预约时间" align="center" prop="appointmentTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.appointmentTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="活动ID" align="center" prop="activityId" />
-      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="类型" align="center" prop="projectName"/>
+      <el-table-column label="名称" align="center" prop="eventName"/>
+      <el-table-column label="活动开始时间" align="center" prop="eventStartTime"/>
+      <el-table-column label="活动结束时间" align="center" prop="eventEndTime"/>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -122,14 +115,16 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['event:appoint:edit']"
-          >修改</el-button>
+          >修改
+          </el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['event:appoint:remove']"
-          >删除</el-button>
+          >删除
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -144,34 +139,33 @@
 
     <!-- 添加或修改活动预约列对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" >
-        <el-form-item label="活动日期" prop="activityTime">
-          <el-date-picker clearable size="small"
-            v-model="form.activityTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择活动日期">
-          </el-date-picker>
+      <el-form ref="form" :model="form" :rules="rules">
+        <el-form-item label="活动" prop="activityId">
+          <el-select v-model="form.activityId" placeholder="请选择活动">
+            <el-option
+              v-for="dict in eventList"
+              :key="dict.id"
+              :label="dict.eventName"
+              :value="dict.id"
+            ></el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="姓名" prop="appointeeName">
-          <el-input v-model="form.appointeeName" placeholder="请输入姓名" />
+          <el-input v-model="form.appointeeName" placeholder="请输入姓名"/>
         </el-form-item>
         <el-form-item label="手机号" prop="appointeePhone">
-          <el-input v-model="form.appointeePhone" placeholder="请输入手机号" />
+          <el-input v-model="form.appointeePhone" placeholder="请输入手机号"/>
         </el-form-item>
         <el-form-item label="预约时间" prop="appointmentTime">
           <el-date-picker clearable size="small"
-            v-model="form.appointmentTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择预约时间">
+                          v-model="form.appointmentTime"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="选择预约时间">
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="活动ID" prop="activityId">
-          <el-input v-model="form.activityId" placeholder="请输入活动ID" />
-        </el-form-item>
         <el-form-item label="备注" prop="remark">
-          <el-input v-model="form.remark" placeholder="请输入备注" />
+          <el-input v-model="form.remark" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -183,10 +177,11 @@
 </template>
 
 <script>
-import { listAppoint, getAppoint, delAppoint, addAppoint, updateAppoint, exportAppoint } from "@/api/event/appoint";
+import { listAppoint, getAppoint, delAppoint, addAppoint, updateAppoint, exportAppoint } from '@/api/event/appoint'
+import { listEvent } from '@/api/eventConfig/event'
 
 export default {
-  name: "Appoint",
+  name: 'Appoint',
   data() {
     return {
       // 遮罩层
@@ -205,8 +200,9 @@ export default {
       total: 0,
       // 活动预约列表格数据
       appointList: [],
+      eventList: [],
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
       // 查询参数
@@ -217,68 +213,38 @@ export default {
         appointeeName: null,
         appointeePhone: null,
         appointmentTime: null,
-        activityId: null,
+        activityId: null
       },
       // 表单参数
       form: {},
       // 表单校验
-      rules: {
-        activityTime: [
-          { required: true, message: "活动日期不能为空", trigger: "blur" }
-        ],
-        appointeeName: [
-          { required: true, message: "姓名不能为空", trigger: "blur" }
-        ],
-        appointeePhone: [
-          { required: true, message: "手机号不能为空", trigger: "blur" }
-        ],
-        appointmentTime: [
-          { required: true, message: "预约时间不能为空", trigger: "blur" }
-        ],
-        activityId: [
-          { required: true, message: "活动ID不能为空", trigger: "blur" }
-        ],
-        remark: [
-          { required: true, message: "备注不能为空", trigger: "blur" }
-        ],
-        operation: [
-          { required: true, message: "操作不能为空", trigger: "blur" }
-        ],
-        createTime: [
-          { required: true, message: "创建时间不能为空", trigger: "blur" }
-        ],
-        createBy: [
-          { required: true, message: "创建人不能为空", trigger: "blur" }
-        ],
-        updateTime: [
-          { required: true, message: "最后一次修改时间不能为空", trigger: "blur" }
-        ],
-        updateBy: [
-          { required: true, message: "修改人不能为空", trigger: "blur" }
-        ],
-        isDelete: [
-          { required: true, message: "是否删除不能为空", trigger: "blur" }
-        ]
-      }
-    };
+      rules: {}
+    }
   },
   created() {
-    this.getList();
+    this.getList()
   },
   methods: {
     /** 查询活动预约列列表 */
     getList() {
-      this.loading = true;
+      this.loading = true
       listAppoint(this.queryParams).then(response => {
-        this.appointList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
+        this.appointList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
+      let queryParams = {
+        eventType: '1'
+      }
+      listEvent(queryParams).then(response => {
+        this.eventList = response.rows
+      })
     },
+
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.reset();
+      this.open = false
+      this.reset()
     },
     // 表单重置
     reset() {
@@ -296,82 +262,84 @@ export default {
         updateTime: null,
         updateBy: null,
         isDelete: null
-      };
-      this.resetForm("form");
+      }
+      this.resetForm('form')
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
+      this.queryParams.pageNum = 1
+      this.getList()
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
+      this.resetForm('queryForm')
+      this.handleQuery()
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
+      this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加活动预约列";
+      this.reset()
+      this.open = true
+      this.title = '添加活动预约列'
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset();
+      this.reset()
       const id = row.id || this.ids
       getAppoint(id).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改活动预约列";
-      });
+        this.form = response.data
+        this.open = true
+        this.title = '修改活动预约列'
+      })
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
+      this.$refs['form'].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
             updateAppoint(this.form).then(() => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
+              this.$modal.msgSuccess('修改成功')
+              this.open = false
+              this.getList()
+            })
           } else {
             addAppoint(this.form).then(() => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
+              this.$modal.msgSuccess('新增成功')
+              this.open = false
+              this.getList()
+            })
           }
         }
-      });
+      })
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const ids = row.id || this.ids;
+      const ids = row.id || this.ids
       this.$modal.confirm('是否确认删除活动预约列编号为"' + ids + '"的数据项?').then(function() {
-        return delAppoint(ids);
+        return delAppoint(ids)
       }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+        this.getList()
+        this.$modal.msgSuccess('删除成功')
+      }).catch(() => {
+      })
     },
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
+      const queryParams = this.queryParams
       this.$modal.confirm('是否确认导出所有活动预约列数据项?').then(() => {
-        this.exportLoading = true;
-        return exportAppoint(queryParams);
+        this.exportLoading = true
+        return exportAppoint(queryParams)
       }).then(response => {
-        this.$download.name(response.msg);
-        this.exportLoading = false;
-      }).catch(() => {});
+        this.$download.name(response.msg)
+        this.exportLoading = false
+      }).catch(() => {
+      })
     }
   }
-};
+}
 </script>

+ 103 - 69
willalp-ui/src/views/event/associations/index.vue

@@ -34,7 +34,8 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['event:associations:add']"
-        >新增</el-button>
+        >新增
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -45,7 +46,8 @@
           :disabled="single"
           @click="handleUpdate"
           v-hasPermi="['event:associations:edit']"
-        >修改</el-button>
+        >修改
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -56,7 +58,8 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['event:associations:remove']"
-        >删除</el-button>
+        >删除
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -67,18 +70,24 @@
           :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['event:associations:export']"
-        >导出</el-button>
+        >导出
+        </el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="associationsList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="主键ID" align="center" prop="id" />
-      <el-table-column label="项目名称" align="center" prop="projectName" />
-      <el-table-column label="社团名称" align="center" prop="associationsName" />
-      <el-table-column label="成员" align="center" prop="users" />
-      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="主键ID" align="center" prop="id"/>
+      <el-table-column label="项目名称" align="center" prop="projectName"/>
+      <el-table-column label="社团名称" align="center" prop="associationsName"/>
+      <el-table-column label="成员" align="center" prop="users">
+        <template slot-scope="scope">
+          <addUsers ref="adu" :data="scope.row" @addGroupUser="addGroupUser"
+                    @deletePostUser="deletePostUser"></addUsers>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" prop="remark"/>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -87,14 +96,16 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['event:associations:edit']"
-          >修改</el-button>
+          >修改
+          </el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['event:associations:remove']"
-          >删除</el-button>
+          >删除
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -109,21 +120,21 @@
 
     <!-- 添加或修改社团信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" >
+      <el-form ref="form" :model="form" :rules="rules">
         <el-form-item label="项目名称" prop="projectName">
-          <el-input v-model="form.projectName" placeholder="请输入项目名称" />
+          <el-input v-model="form.projectName" placeholder="请输入项目名称"/>
         </el-form-item>
         <el-form-item label="社团名称" prop="associationsName">
-          <el-input v-model="form.associationsName" placeholder="请输入社团名称" />
+          <el-input v-model="form.associationsName" placeholder="请输入社团名称"/>
         </el-form-item>
         <el-form-item label="成员" prop="users">
-          <el-input v-model="form.users" type="textarea" placeholder="请输入内容" />
+          <el-input v-model="form.users" type="textarea" placeholder="请输入内容"/>
         </el-form-item>
         <el-form-item label="风采">
           <editor v-model="form.mien" :min-height="192"/>
         </el-form-item>
         <el-form-item label="备注" prop="remark">
-          <el-input v-model="form.remark" placeholder="请输入备注" />
+          <el-input v-model="form.remark" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -135,10 +146,20 @@
 </template>
 
 <script>
-import { listAssociations, getAssociations, delAssociations, addAssociations, updateAssociations, exportAssociations } from "@/api/event/associations";
+import {
+  listAssociations,
+  getAssociations,
+  delAssociations,
+  addAssociations,
+  updateAssociations,
+  exportAssociations
+} from '@/api/event/associations'
+
+import addUsers from '@/views/components/addUsers/index'
 
 export default {
-  name: "Associations",
+  name: 'Associations',
+  components: { addUsers },
   data() {
     return {
       // 遮罩层
@@ -158,7 +179,7 @@ export default {
       // 社团信息表格数据
       associationsList: [],
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
       // 查询参数
@@ -168,32 +189,43 @@ export default {
         projectName: null,
         associationsName: null,
         users: null,
-        mien: null,
+        mien: null
       },
       // 表单参数
       form: {},
       // 表单校验
-      rules: {
-      }
-    };
+      rules: {}
+    }
   },
   created() {
-    this.getList();
+    this.getList()
   },
   methods: {
+    addGroupUser(data) {
+      updateAssociations(data).then(response => {
+        this.$modal.msgSuccess('添加成功')
+        this.getList()
+      })
+    },
+    deletePostUser(data) {
+      updateAssociations(data).then(response => {
+        this.$modal.msgSuccess('删除成功')
+        this.getList()
+      })
+    },
     /** 查询社团信息列表 */
     getList() {
-      this.loading = true;
+      this.loading = true
       listAssociations(this.queryParams).then(response => {
-        this.associationsList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
+        this.associationsList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
     },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.reset();
+      this.open = false
+      this.reset()
     },
     // 表单重置
     reset() {
@@ -209,82 +241,84 @@ export default {
         updateBy: null,
         updateTime: null,
         remark: null
-      };
-      this.resetForm("form");
+      }
+      this.resetForm('form')
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
+      this.queryParams.pageNum = 1
+      this.getList()
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
+      this.resetForm('queryForm')
+      this.handleQuery()
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
+      this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加社团信息";
+      this.reset()
+      this.open = true
+      this.title = '添加社团信息'
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset();
+      this.reset()
       const id = row.id || this.ids
       getAssociations(id).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改社团信息";
-      });
+        this.form = response.data
+        this.open = true
+        this.title = '修改社团信息'
+      })
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
+      this.$refs['form'].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
             updateAssociations(this.form).then(() => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
+              this.$modal.msgSuccess('修改成功')
+              this.open = false
+              this.getList()
+            })
           } else {
             addAssociations(this.form).then(() => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
+              this.$modal.msgSuccess('新增成功')
+              this.open = false
+              this.getList()
+            })
           }
         }
-      });
+      })
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const ids = row.id || this.ids;
+      const ids = row.id || this.ids
       this.$modal.confirm('是否确认删除社团信息编号为"' + ids + '"的数据项?').then(function() {
-        return delAssociations(ids);
+        return delAssociations(ids)
       }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+        this.getList()
+        this.$modal.msgSuccess('删除成功')
+      }).catch(() => {
+      })
     },
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
+      const queryParams = this.queryParams
       this.$modal.confirm('是否确认导出所有社团信息数据项?').then(() => {
-        this.exportLoading = true;
-        return exportAssociations(queryParams);
+        this.exportLoading = true
+        return exportAssociations(queryParams)
       }).then(response => {
-        this.$download.name(response.msg);
-        this.exportLoading = false;
-      }).catch(() => {});
+        this.$download.name(response.msg)
+        this.exportLoading = false
+      }).catch(() => {
+      })
     }
   }
-};
+}
 </script>

+ 314 - 0
willalp-ui/src/views/event/img/index.vue

@@ -0,0 +1,314 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
+      <el-form-item label="活动" prop="eventId">
+        <el-select v-model="queryParams.eventId" placeholder="请选择活动">
+          <el-option
+            v-for="dict in eventList"
+            :key="dict.id"
+            :label="dict.eventName"
+            :value="dict.id"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="大小" prop="size">
+        <el-input
+          v-model="queryParams.size"
+          placeholder="请输入大小"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="图片格式" prop="type">
+        <el-select v-model="queryParams.type" placeholder="请选择图片格式" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['event:img:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['event:img:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['event:img:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['event:img:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="imgList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="主键" align="center" prop="id" />
+      <el-table-column label="事件" align="center" prop="eventId" />
+      <el-table-column label="图片地址" align="center" prop="url" />
+      <el-table-column label="大小" align="center" prop="size" />
+      <el-table-column label="图片格式" align="center" prop="type" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['event:img:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['event:img:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改事件(活动)图片信息对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" >
+        <el-form-item label="活动" prop="eventId">
+          <el-select v-model="form.eventId" placeholder="请选择活动">
+            <el-option
+              v-for="dict in eventList"
+              :key="dict.id"
+              :label="dict.eventName"
+              :value="dict.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="图片地址" prop="url">
+          <el-input v-model="form.url" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="大小" prop="size">
+          <el-input v-model="form.size" placeholder="请输入大小" />
+        </el-form-item>
+        <el-form-item label="图片格式" prop="type">
+          <el-select v-model="form.type" placeholder="请选择图片格式">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listImg, getImg, delImg, addImg, updateImg, exportImg } from "@/api/event/img";
+import { listEvent } from '@/api/eventConfig/event'
+
+export default {
+  name: "Img",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 事件(活动)图片信息表格数据
+      imgList: [],
+      eventList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        eventId: null,
+        url: null,
+        size: null,
+        type: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询事件(活动)图片信息列表 */
+    getList() {
+      this.loading = true;
+      listImg(this.queryParams).then(response => {
+        this.imgList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+      let queryParams = {
+        eventType: '1'
+      }
+      listEvent(queryParams).then(response => {
+        this.eventList = response.rows
+      })
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        eventId: null,
+        url: null,
+        size: null,
+        type: null,
+        isDelete: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加事件(活动)图片信息";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getImg(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改事件(活动)图片信息";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateImg(this.form).then(() => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addImg(this.form).then(() => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除事件(活动)图片信息编号为"' + ids + '"的数据项?').then(function() {
+        return delImg(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$modal.confirm('是否确认导出所有事件(活动)图片信息数据项?').then(() => {
+        this.exportLoading = true;
+        return exportImg(queryParams);
+      }).then(response => {
+        this.$download.name(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {});
+    }
+  }
+};
+</script>

+ 389 - 73
willalp-ui/src/views/eventConfig/event/index.vue

@@ -29,20 +29,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="执行时间" prop="eventTime">
+      <el-form-item label="执行" prop="eventTime">
         <el-date-picker
           clearable size="small"
           v-model="queryParams.eventTime"
           type="datetime"
           value-format="yyyy-MM-dd HH:mm:ss"
-          placeholder="选择执行时间">
+          placeholder="选择执行">
         </el-date-picker>
       </el-form-item>
-      <!--      <el-form-item label="地点" prop="eventPlace">-->
-      <!--        <el-select v-model="queryParams.eventPlace" placeholder="请选择地点" clearable size="small">-->
-      <!--          <el-option label="请选择字典生成" value="" />-->
-      <!--        </el-select>-->
-      <!--      </el-form-item>-->
       <el-form-item label="事件状态" prop="eventStatus">
         <el-select v-model="queryParams.eventStatus" placeholder="请选择事件状态" clearable size="small">
           <el-option
@@ -107,60 +102,159 @@
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :loading="exportLoading"
+          @click="noticeShow"
+        >预约公告
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <div style="padding: 5px">
+          <el-switch
+            @change="setNoticeStatus"
+            v-model="noticeForm.openStatus"
+            active-text="打开公告"
+            inactive-text="关闭公告">
+          </el-switch>
+        </div>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="eventList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center"/>
-      <!--      <el-table-column label="主键" align="center" prop="id" />-->
-      <el-table-column label="事件编号" align="center" prop="eventNo"/>
-      <el-table-column label="事件名称" align="center" prop="eventName"/>
-      <el-table-column label="禁止取消预约时限" align="center" prop="banCancelSubscribeTimeLimit"/>
-      <el-table-column label="活动开始前多久提示" align="center" prop="howLongRemind"/>
+
+    <!--社团活动-->
+    <el-table v-if="queryParams.eventType === '1'" v-loading="loading" :data="eventList"
+              @selection-change="handleSelectionChange"
+              @expand-change="unfoldTable">
+      <el-table-column type="expand">
+        <template slot-scope="props">
+          <el-upload
+            :action="uploadImgUrl"
+            list-type="picture-card"
+            :before-upload="handleBeforeUpload"
+            :on-error="handleUploadError"
+            :on-success="handleUploadSuccess"
+            :on-remove="handleRemove"
+            :on-preview="handlePictureCardPreview"
+            :headers="{
+               eventId:props.row.id,
+               Authorization: 'Bearer ' + token
+            }"
+            :file-list="props.row.eventImgUrls">
+            <i class="el-icon-plus"></i>
+          </el-upload>
+          <el-dialog :visible.sync="dialogVisible">
+            <img width="100%" :src="dialogImageUrl" alt="">
+          </el-dialog>
+        </template>
+      </el-table-column>
+      <el-table-column type="selection" width="30" align="center"/>
+      <el-table-column label="编码" align="center" prop="eventNo"/>
+      <el-table-column label="事件类型" align="center" prop="eventType">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.event_type" :value="scope.row.eventType"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="事件类型" align="center" prop="activityTypeId">
+        <template slot-scope="scope">
+          <el-select v-model="scope.row.activityTypeId" disabled>
+            <el-option v-for="item in associationsList"
+                       :label="item.projectName"
+                       :value="item.id"
+                       :key="item.id"
+            />
+          </el-select>
+        </template>
+      </el-table-column>
+      <el-table-column label="名称" align="center" prop="eventName"/>
+      <el-table-column label="地点" align="center" prop="eventPlace" v-if="queryParams.eventStatus !== '1'" width="150">
+        <template slot-scope="scope">
+          <treeselect v-model="scope.row.eventPlace" :options="placeOptions" :normalizer="normalizer"
+                      placeholder="请选择地点"
+                      disabled/>
+        </template>
+      </el-table-column>
       <el-table-column label="数量限制" align="center" prop="limitNum"/>
-      <el-table-column label="事件开始时间" align="center" prop="eventStartTime" width="180">
+      <el-table-column label="禁止取消预约时限" align="center" prop="banCancelSubscribeTimeLimit"/>
+      <el-table-column label="开始前提醒时限" align="center" prop="howLongRemind"/>
+      <el-table-column label="活动开始于" align="center" prop="eventStartTime" width="90">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.eventStartTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+          <span>{{ parseTime(scope.row.eventStartTime, '{y}-{m}-{d} {h}:{i}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="事件结束时间" align="center" prop="eventEndTime" width="180">
+      <el-table-column label="活动结束于" align="center" prop="eventEndTime" width="90">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.eventEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+          <span>{{ parseTime(scope.row.eventEndTime, '{y}-{m}-{d} {h}:{i}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="开始时间" align="center" prop="startTime" width="180">
+      <el-table-column label="事件开始于" align="center" prop="startTime" width="90">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="执行时间" align="center" prop="eventTime" width="180">
+      <el-table-column label="事件结束于" align="center" prop="endTime" width="90">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="事件状态" align="center" prop="eventStatus">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.eventTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+          <dict-tag :options="dict.type.event_status" :value="scope.row.eventStatus"/>
         </template>
       </el-table-column>
-      <el-table-column label="结束时间" align="center" prop="endTime" width="180">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['eventConfig:event:edit']"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['eventConfig:event:remove']"
+          >删除
+          </el-button>
         </template>
       </el-table-column>
+    </el-table>
+
+    <!--积分兑换-->
+    <el-table v-if="queryParams.eventType === '2'" v-loading="loading" :data="eventList"
+              @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="编码" align="center" prop="eventNo"/>
       <el-table-column label="事件类型" align="center" prop="eventType">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.event_type" :value="scope.row.eventType"/>
         </template>
       </el-table-column>
-      <el-table-column label="地点" align="center" prop="eventPlace" v-if="queryParams.eventStatus !== '1'">
+      <el-table-column label="名称" align="center" prop="eventName"/>
+      <el-table-column label="兑换开始于" align="center" prop="startTime">
         <template slot-scope="scope">
-          <treeselect v-model="scope.row.eventPlace" :options="placeOptions" :normalizer="normalizer" placeholder="请选择地点"
-                      disabled/>
+          <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="兑换结束于" align="center" prop="endTime">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="事件描述" align="center" prop="eventDescribe" v-if="queryParams.eventStatus !== '1'"/>
       <el-table-column label="事件状态" align="center" prop="eventStatus">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.event_status" :value="scope.row.eventStatus"/>
         </template>
       </el-table-column>
-      <el-table-column label="备注" align="center" prop="remark" v-if="queryParams.eventStatus !== '1'"/>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -199,71 +293,125 @@
     />
 
     <!-- 添加或修改活动配置对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
+    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules">
-        <el-form-item label="事件编号" prop="eventNo">
-          <el-input v-model="form.eventNo" placeholder="请输入事件编号"/>
-        </el-form-item>
-        <el-form-item label="事件名称" prop="eventName">
-          <el-input v-model="form.eventName" placeholder="请输入事件名称"/>
-        </el-form-item>
-        <el-form-item label="事件项目" prop="eventName">
-          <el-input v-model="form.activityTypeId" placeholder="请输入事件名称"/>
-        </el-form-item>
-        <el-form-item label="禁止取消预约时限" prop="banCancelSubscribeTimeLimit">
-          <el-input v-model="form.banCancelSubscribeTimeLimit" placeholder="请输入禁止取消预约时限"/>
-        </el-form-item>
-        <el-form-item label="数量限制" prop="limitNum">
-          <el-input v-model="form.limitNum" placeholder="请输入数量限制"/>
+        <el-row :gutter="50">
+          <el-col :span="12">
+            <el-form-item label="编码" prop="eventNo">
+              <el-input v-model="form.eventNo" placeholder="请输入事件编号"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="事件名称" prop="eventName">
+              <el-input v-model="form.eventName" placeholder="请输入事件名称" disabled/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="项目" prop="eventName">
+          <el-select v-model="form.activityTypeId">
+            <el-option v-for="item in associationsList"
+                       :label="item.projectName"
+                       :value="item.id"
+                       :key="item.id"
+            />
+          </el-select>
         </el-form-item>
-        <el-form-item label="活动开始前多久提示" prop="howLongRemind">
-          <el-input v-model="form.howLongRemind" placeholder="请输入活动开始前多久提示"/>
+        <el-form-item label="地点" prop="eventPlace" v-if="queryParams.eventStatus !== '1'">
+          <treeselect v-model="form.eventPlace" :options="placeOptions" :normalizer="normalizer"
+                      placeholder="请选择地点"/>
         </el-form-item>
-        <el-form-item label="活动开始时间" prop="startTime">
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="数量限制" prop="limitNum">
+              <el-row>
+                <el-col :span="18">
+                  <el-input v-model="form.limitNum" placeholder="请输入数量限制"/>
+                </el-col>
+                <el-col :span="1">
+                  <div style="padding: 0.5px">
+
+                  </div>
+                </el-col>
+                <el-col :span="4"> 名</el-col>
+              </el-row>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="禁止取消预约时限" prop="banCancelSubscribeTimeLimit">
+              <el-row>
+                <el-col :span="18">
+                  <el-input v-model="form.banCancelSubscribeTimeLimit" placeholder="请输入禁止取消预约时限"/>
+                </el-col>
+                <el-col :span="1">
+                  <div style="padding: 0.5px">
+
+                  </div>
+                </el-col>
+                <el-col :span="4">小时</el-col>
+              </el-row>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="活动开始前多久提示" prop="howLongRemind">
+              <el-row>
+                <el-col :span="19">
+                  <el-input v-model="form.howLongRemind" placeholder="请输入活动开始前多久提示"/>
+                </el-col>
+                <el-col :span="1">
+                  <div style="padding: 0.5px">
+
+                  </div>
+                </el-col>
+                <el-col :span="4">小时</el-col>
+              </el-row>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="活动开始于" prop="eventStartTime">
           <el-date-picker
             clearable size="small"
             v-model="form.eventStartTime"
             type="datetime"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            placeholder="选择开始时间">
+            value-format="yyyy-MM-dd HH:mm"
+            placeholder="选择开始">
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="活动结束时间" prop="startTime">
+        <el-form-item label="活动结束于" prop="eventEndTime">
           <el-date-picker
             clearable size="small"
             v-model="form.eventEndTime"
             type="datetime"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            placeholder="选择开始时间">
+            value-format="yyyy-MM-dd HH:mm"
+            placeholder="选择开始">
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="预约开始时间" prop="startTime">
+        <el-form-item label="预约开始" prop="startTime">
           <el-date-picker
             clearable size="small"
             v-model="form.startTime"
             type="datetime"
             value-format="yyyy-MM-dd HH:mm:ss"
-            placeholder="选择开始时间">
+            placeholder="选择开始">
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="预约结束时间" prop="endTime">
+        <el-form-item label="预约结束" prop="endTime">
           <el-date-picker
             clearable size="small"
             v-model="form.endTime"
             type="datetime"
             value-format="yyyy-MM-dd HH:mm:ss"
-            placeholder="选择结束时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="执行时间" prop="eventTime">
-          <el-date-picker
-            clearable size="small"
-            v-model="form.eventTime"
-            type="datetime"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            placeholder="选择执行时间">
+            placeholder="选择结束于">
           </el-date-picker>
         </el-form-item>
+        <!-- <el-form-item label="执行于" prop="eventTime">-->
+        <!--   <el-date-picker-->
+        <!--     clearable size="small"-->
+        <!--     v-model="form.eventTime"-->
+        <!--     type="datetime"-->
+        <!--     value-format="yyyy-MM-dd HH:mm:ss"-->
+        <!--     placeholder="选择执行于">-->
+        <!--   </el-date-picker>-->
+        <!-- </el-form-item>-->
         <el-form-item label="事件类型" prop="eventType">
           <el-select v-model="form.eventType" placeholder="请选择事件类型">
             <el-option
@@ -274,10 +422,6 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="地点" prop="eventPlace" v-if="queryParams.eventStatus !== '1'">
-          <treeselect v-model="form.eventPlace" :options="placeOptions" :normalizer="normalizer"
-                      placeholder="请选择地点"/>
-        </el-form-item>
         <el-form-item label="事件描述" v-if="queryParams.eventStatus !== '1'">
           <editor v-model="form.eventDescribe" :min-height="192"/>
         </el-form-item>
@@ -300,15 +444,27 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+    <!-- 设置公告对话框 -->
+    <el-dialog title="设置公告" :visible.sync="noticeForm.open" width="600px" append-to-body>
+      <el-input v-model="noticeForm.text" placeholder="请输入公告"/>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="updateNotice()" prevent-re-click>确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import { listEvent, getEvent, delEvent, addEvent, updateEvent, exportEvent } from '@/api/eventConfig/event'
+import { addImg } from '@/api/event/img'
 import { listPlace } from '@/api/canteen/place'
 import user from '@/store/modules/user'
 import Treeselect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import { listAssociations } from '@/api/event/associations'
+import { addConfig, getConfigKey, updateConfig } from '@/api/system/config'
+import { getToken } from '@/utils/auth'
 
 export default {
   name: 'Event',
@@ -318,11 +474,11 @@ export default {
   dicts: ['event_type', 'event_status'],
   data() {
     return {
-
       // 地点树选项
       placeOptions: [],
       // 遮罩层
       loading: true,
+      loadingImg: true,
       // 导出遮罩层
       exportLoading: false,
       // 选中数组
@@ -337,17 +493,29 @@ export default {
       total: 0,
       // 活动配置表格数据
       eventList: [],
+      associationsList: [],
       id: '',
       // 弹出层标题
       title: '',
       // 是否显示弹出层
       open: false,
+      dialogImageUrl: '',
+      dialogVisible: false,
+      hideUpload: false,
+      uploadImgUrl: process.env.VUE_APP_BASE_API + '/event/img/upload', // 上传的图片服务器地址
+      headers: {
+        Authorization: 'Bearer ' + getToken()
+      },
+      token: getToken(),
+      fileList: [],
       // 查询参数
       queryParams: {
         pageNum: 1,
         pageSize: 10,
         eventNo: null,
         eventName: null,
+        eventStartTime: null,
+        eventEndTime: null,
         startTime: null,
         eventTime: null,
         endTime: null,
@@ -357,16 +525,151 @@ export default {
         eventStatus: null,
         isDelete: null
       },
+      noticeForm: {
+        open: false,
+        text: '',
+        openStatus: false,
+        openStatusKey: 'club_notice_open',
+        openStatusData: {},
+        key: 'club_notice',
+        data: {}
+      },
       // 表单参数
       form: {},
       // 表单校验
       rules: {}
     }
   },
+  watch: {
+    value: {
+      handler(val) {
+        if (val) {
+          // 首先将值转为数组
+          const list = Array.isArray(val) ? val : this.value.split(',')
+          // 然后将数组转为对象数组
+          this.fileList = list.map(item => {
+            if (typeof item === 'string') {
+              if (item.indexOf(this.baseUrl) === -1) {
+                item = { name: this.baseUrl + item, url: this.baseUrl + item }
+              } else {
+                item = { name: item, url: item }
+              }
+            }
+            return item
+          })
+        } else {
+          this.fileList = []
+          return []
+        }
+      },
+      deep: true,
+      immediate: true
+    }
+  },
   created() {
-    // this.getList();
+    this.queryParams.eventType = this.$root._route.query.eventType
+    this.getNoticeStatus()
+    this.getNotice()
+    this.getTreeselect()
+    this.getAssList()
+    this.getList()
   },
   methods: {
+    // 删除图片
+    handleRemove(file, fileList) {
+      const findex = this.fileList.map(f => f.name).indexOf(file.name)
+      if (findex > -1) {
+        this.fileList.splice(findex, 1)
+      }
+    },
+    // 上传成功回调
+    handleUploadSuccess(res) {
+      let data = {
+        name: res.fileName,
+        url: res.url,
+        type: res.type,
+        eventId: res.eventId
+      }
+      this.fileList.push(data)
+      addImg(data).then(res => {
+        if (res.code === 200) {
+          this.$message({
+            type: 'success',
+            message: '上传成功'
+          })
+        } else {
+          this.$message({
+            type: 'error',
+            message: '上传失败'
+          })
+        }
+      })
+      this.loadingImg.close()
+    },  // 上传失败
+    handleUploadError() {
+      this.$message({
+        type: 'error',
+        message: '上传失败'
+      })
+      this.loadingImg.close()
+    },
+    // 上传前loading加载
+    handleBeforeUpload(file) {
+      this.loadingImg = this.$loading({
+        lock: true,
+        text: '上传中',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
+    },
+    handlePictureCardPreview(file) {
+      this.dialogImageUrl = file.url
+      this.dialogVisible = true
+    },
+    noticeShow() {
+      this.noticeForm.open = true
+    },
+    updateNotice() {
+      this.noticeForm.data.configValue = this.noticeForm.text
+      updateConfig(this.noticeForm.data).then(re => {
+        this.$modal.msgSuccess('修改成功')
+        this.getNotice()
+        this.noticeForm.open = false
+      })
+    },
+    getNotice() {
+      getConfigKey(this.noticeForm.key).then(re => {
+        if (!re.data) {
+          addConfig({
+            configKey: this.noticeForm.key,
+            configValue: ''
+          })
+        } else {
+          this.noticeForm.text = re.msg
+          this.noticeForm.data = re.data
+        }
+      })
+    },
+    setNoticeStatus() {
+      this.noticeForm.openStatusData.configValue = this.noticeForm.openStatus ? 'true' : 'false'
+      updateConfig(this.noticeForm.openStatusData).then(re => {
+        this.getNoticeStatus()
+        this.$modal.msgSuccess('更新成功')
+      })
+    },
+    getNoticeStatus() {
+      getConfigKey(this.noticeForm.openStatusKey).then(re => {
+        if (!re.msg) {
+          addConfig({
+            configKey: this.noticeForm.openStatusKey,
+            configValue: 'false'
+          })
+          this.noticeForm.openStatus = false
+        } else {
+          this.noticeForm.openStatus = re.msg !== 'false'
+          this.noticeForm.openStatusData = re.data
+        }
+      })
+    },
     /** 查询活动配置列表 */
     getList() {
       this.loading = true
@@ -379,16 +682,21 @@ export default {
     getEventId() {
       return this.id
     },
+    /** 查询社团信息列表 */
+    getAssList() {
+      listAssociations().then(response => {
+        this.associationsList = response.rows
+      })
+    },
     /** 查询地点下拉树结构 */
     getTreeselect() {
-      listPlace({ jgid: user.state.organ }).then(response => {
+      listPlace({ jgid: user.state.organ, placeType: 4 }).then(response => {
         this.placeOptions = []
-        const data = { placeId: 0, placeName: '顶级节点', children: [] }
+        const data = { placeId: 0, placeName: '最上级', children: [] }
         data.children = this.handleTree(response.data, 'placeId', 'parentId')
         this.placeOptions.push(data)
       })
     },
-
     /** 转换地点数据结构 */
     normalizer(node) {
       if (node.children && !node.children.length) {
@@ -403,6 +711,9 @@ export default {
     // 取消按钮
     cancel() {
       this.open = false
+      this.noticeForm.open = false
+      this.eventGiftForm.open = false
+      this.noticeForm.text = ''
       this.reset()
     },
     // 表单重置
@@ -444,6 +755,9 @@ export default {
       this.ids = selection.map(item => item.id)
       this.single = selection.length !== 1
       this.multiple = !selection.length
+    },
+    unfoldTable(row, expandedRows) {
+
     },
     /** 新增按钮操作 */
     handleAdd() {
@@ -472,6 +786,8 @@ export default {
               this.getList()
             })
           } else {
+            let date = this.parseTime(this.form.eventStartTime, '{y}-{m}-{d}')
+            console.log(this.form)
             addEvent(this.form).then(() => {
               this.$modal.msgSuccess('新增成功')
               this.open = false

+ 1 - 1
willalp-ui/src/views/login.vue

@@ -51,7 +51,7 @@
     </el-form>
     <!--  底部  -->
     <div class="el-login-footer">
-      <span>Copyright © 2019-2021 willalp.com All Rights Reserved.</span>
+      <span>Copyright © 2019-2023 willalp.com All Rights Reserved.</span>
     </div>
   </div>
 </template>

+ 1 - 1
willalp-ui/src/views/register.vue

@@ -61,7 +61,7 @@
     </el-form>
     <!--  底部  -->
     <div class="el-register-footer">
-      <span>Copyright © 2019-2021 willalp.com All Rights Reserved.</span>
+      <span>Copyright © 2019-2023 willalp.com All Rights Reserved.</span>
     </div>
   </div>
 </template>