瀏覽代碼

修改礼品业务分类菜单,修改活动绑定,修改积分下单抵扣库存逻辑

xianwait 2 年之前
父節點
當前提交
1ef867d0b3
共有 68 個文件被更改,包括 2018 次插入443 次删除
  1. 6 0
      pom.xml
  2. 4 0
      willalp-admin/src/main/java/com/willalp/WillalpApplication.java
  3. 20 10
      willalp-admin/src/main/java/com/willalp/web/controller/app/AppController.java
  4. 12 24
      willalp-admin/src/main/java/com/willalp/web/controller/app/AppTwoController.java
  5. 17 18
      willalp-admin/src/main/java/com/willalp/web/controller/canteen/HsCanteenDiningPlaceController.java
  6. 23 0
      willalp-admin/src/main/java/com/willalp/web/controller/canteen/HsCanteenOrderController.java
  7. 10 0
      willalp-admin/src/main/java/com/willalp/web/controller/canteen/HsGiftController.java
  8. 1 1
      willalp-admin/src/main/java/com/willalp/web/controller/canteen/HsGiftOrderController.java
  9. 30 0
      willalp-admin/src/main/java/com/willalp/web/controller/canteen/HsGiftOrderDetailController.java
  10. 4 8
      willalp-admin/src/main/java/com/willalp/web/controller/clockingin/FileApprovalController.java
  11. 0 4
      willalp-admin/src/main/java/com/willalp/web/controller/clockingin/HsOrgPersonnelFilesController.java
  12. 1 1
      willalp-admin/src/main/resources/application-dev.yml
  13. 45 0
      willalp-admin/src/test/java/com/willalp/CanteenTest.java
  14. 8 0
      willalp-canteen/pom.xml
  15. 10 0
      willalp-canteen/src/main/java/com/willalp/canteen/domain/HsGift.java
  16. 52 16
      willalp-canteen/src/main/java/com/willalp/canteen/domain/HsGiftOrder.java
  17. 10 0
      willalp-canteen/src/main/java/com/willalp/canteen/domain/req/GiftCustomPayReq.java
  18. 52 0
      willalp-canteen/src/main/java/com/willalp/canteen/domain/resp/ShopOrderStatExcel.java
  19. 5 0
      willalp-canteen/src/main/java/com/willalp/canteen/domain/vo/HsCanteenOrderInfoVo.java
  20. 47 0
      willalp-canteen/src/main/java/com/willalp/canteen/domain/vo/LiveUseMoneyMonthStatExcel.java
  21. 12 0
      willalp-canteen/src/main/java/com/willalp/canteen/mapper/HsCanteenOrderMapper.java
  22. 17 0
      willalp-canteen/src/main/java/com/willalp/canteen/mapper/HsGiftMapper.java
  23. 20 2
      willalp-canteen/src/main/java/com/willalp/canteen/mapper/xml/HsCanteenOrderMapper.xml
  24. 26 12
      willalp-canteen/src/main/java/com/willalp/canteen/mapper/xml/HsGiftMapper.xml
  25. 34 6
      willalp-canteen/src/main/java/com/willalp/canteen/mapper/xml/HsGiftOrderMapper.xml
  26. 6 2
      willalp-canteen/src/main/java/com/willalp/canteen/mapper/xml/HsUserShopCarMapper.xml
  27. 10 0
      willalp-canteen/src/main/java/com/willalp/canteen/service/IHsCanteenOrderService.java
  28. 8 0
      willalp-canteen/src/main/java/com/willalp/canteen/service/IHsGiftOrderDetailService.java
  29. 8 0
      willalp-canteen/src/main/java/com/willalp/canteen/service/IHsGiftOrderService.java
  30. 19 4
      willalp-canteen/src/main/java/com/willalp/canteen/service/IHsGiftService.java
  31. 15 2
      willalp-canteen/src/main/java/com/willalp/canteen/service/impl/HsCanteenOrderServiceImpl.java
  32. 40 5
      willalp-canteen/src/main/java/com/willalp/canteen/service/impl/HsGiftOrderDetailServiceImpl.java
  33. 29 3
      willalp-canteen/src/main/java/com/willalp/canteen/service/impl/HsGiftOrderServiceImpl.java
  34. 11 2
      willalp-canteen/src/main/java/com/willalp/canteen/service/impl/HsGiftServiceImpl.java
  35. 21 0
      willalp-canteen/src/main/java/com/willalp/canteen/service/impl/HsGiftTypeServiceImpl.java
  36. 12 0
      willalp-clocking-in/src/main/java/com/willalp/event/mapper/HsEventBusinessRelationMapper.java
  37. 8 2
      willalp-clocking-in/src/main/java/com/willalp/event/mapper/HsEventMapper.java
  38. 16 9
      willalp-clocking-in/src/main/java/com/willalp/event/mapper/xml/HsEventMapper.xml
  39. 10 2
      willalp-clocking-in/src/main/java/com/willalp/event/service/IHsEventBusinessRelationService.java
  40. 8 3
      willalp-clocking-in/src/main/java/com/willalp/event/service/IHsEventService.java
  41. 15 6
      willalp-clocking-in/src/main/java/com/willalp/event/service/impl/HsEventBusinessRelationServiceImpl.java
  42. 49 4
      willalp-clocking-in/src/main/java/com/willalp/event/service/impl/HsEventServiceImpl.java
  43. 1 1
      willalp-clocking-in/src/main/java/com/willalp/flow/service/impl/HsFlowEngineServiceImpl.java
  44. 3 3
      willalp-common/src/main/java/com/willalp/common/utils/DateUtils.java
  45. 11 0
      willalp-quartz/src/main/java/com/willalp/quartz/task/RyTask.java
  46. 1 1
      willalp-system/src/main/java/com/willalp/number/service/IHsSysNumberRuleService.java
  47. 3 3
      willalp-system/src/main/java/com/willalp/number/service/impl/HsSysNumberRuleServiceImpl.java
  48. 0 53
      willalp-ui/public/api/flow/leavenImg.js
  49. 9 0
      willalp-ui/src/api/canteen/gift.js
  50. 16 0
      willalp-ui/src/api/canteen/giftDetail.js
  51. 1 1
      willalp-ui/src/api/canteen/giftType.js
  52. 18 0
      willalp-ui/src/api/canteen/order.js
  53. 9 1
      willalp-ui/src/api/canteen/place.js
  54. 1 1
      willalp-ui/src/components/FileUpload/index.vue
  55. 280 0
      willalp-ui/src/views/canteen/gift/giftType/index.vue
  56. 124 113
      willalp-ui/src/views/canteen/gift/index.vue
  57. 515 0
      willalp-ui/src/views/canteen/gift/indexLive.vue
  58. 16 16
      willalp-ui/src/views/canteen/gift/order/detail/index.vue
  59. 144 62
      willalp-ui/src/views/canteen/gift/order/index.vue
  60. 1 1
      willalp-ui/src/views/canteen/order/index.vue
  61. 95 8
      willalp-ui/src/views/canteen/order/jcdMonthlyStat.vue
  62. 1 1
      willalp-ui/src/views/canteen/order/jcdStat.vue
  63. 2 2
      willalp-ui/src/views/clockingin/time/index.vue
  64. 6 6
      willalp-ui/src/views/eventConfig/event/index.vue
  65. 0 17
      willalp-ui/src/views/files/files/index.vue
  66. 8 7
      willalp-ui/src/views/integral/integral/change.vue
  67. 1 0
      willalp-ui/src/views/leave/leave/index.vue
  68. 1 0
      willalp-ui/src/views/leave/leave/indexPre.vue

+ 6 - 0
pom.xml

@@ -51,6 +51,12 @@
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
+            <!-- SpringBoot单元测试-->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-test</artifactId>
+                <version>2.5.5</version>
+            </dependency>
             <!-- 阿里数据库连接池 -->
             <dependency>
                 <groupId>com.alibaba</groupId>

+ 4 - 0
willalp-admin/src/main/java/com/willalp/WillalpApplication.java

@@ -16,6 +16,8 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Primary;
 import org.springframework.core.task.TaskExecutor;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 
 import javax.annotation.Resource;
@@ -26,6 +28,8 @@ import javax.annotation.Resource;
  * @author willalp
  */
 
+@EnableScheduling
+@EnableAsync
 @MapperScan(basePackages = {"com.willalp.**.mapper"})
 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,})
 public class WillalpApplication extends SpringBootServletInitializer implements CommandLineRunner {

+ 20 - 10
willalp-admin/src/main/java/com/willalp/web/controller/app/AppController.java

@@ -261,7 +261,6 @@ public class AppController extends BaseController {
     /**
      * 下单
      *
-     * @param appOrderPaymentReq
      * @return
      */
     @RequestMapping("/order")
@@ -291,16 +290,24 @@ public class AppController extends BaseController {
         }
         user = userList.get(0);
         //生成消费记录
-        integral.setId(IdWorker.getIdStr());//积分主键
-        integral.setRechargeEquipmentCode(appOrderPaymentReq.getDeviceNumber());//设备编号
-        integral.setRechargeEquipmentName(appOrderPaymentReq.getDeviceName());//设备名称
-        integral.setLoginName(appOrderPaymentReq.getUserNumber());//账号编号
-        integral.setRechargeTime(appOrderPaymentReq.getPaytime());//支付时间
-        integral.setRechargeIntegral(appOrderPaymentReq.getOrderTotal().negate());//积分(负数)
-        integral.setIsDelete(0);//有效标志
+        integral.setId(IdWorker.getIdStr());
+        //设备编号
+        integral.setRechargeEquipmentCode(appOrderPaymentReq.getDeviceNumber());
+        //设备名称
+        integral.setRechargeEquipmentName(appOrderPaymentReq.getDeviceName());
+        //账号编号
+        integral.setLoginName(appOrderPaymentReq.getUserNumber());
+        //支付时间
+        integral.setRechargeTime(appOrderPaymentReq.getPaytime());
+        //积分(负数)
+        integral.setRechargeIntegral(appOrderPaymentReq.getOrderTotal().negate());
+        //有效标志
+        integral.setIsDelete(0);
         integral.setNickName(user.getNickName());
-        integral.setOrganizationCode(appOrderPaymentReq.getJgid());//机构代码
-        if (appOrderPaymentReq.getPatternId() == PartternIdEnum.RESERVE.getValue()) {//预定消费模式扣减积分
+        //机构代码
+        integral.setOrganizationCode(appOrderPaymentReq.getJgid());
+        //预定消费模式扣减积分
+        if (appOrderPaymentReq.getPatternId().equals(PartternIdEnum.RESERVE.getValue())) {
             if (user.getIntegral().compareTo(appOrderPaymentReq.getOrderTotal()) < 0) {
                 return AjaxResult.error("账户积分不足");
             }
@@ -329,6 +336,9 @@ public class AppController extends BaseController {
         numberRuleReq.setInput(String.valueOf(DateUtil.year(appOrderPaymentReq.getPaytime())).substring(2, 4));
         String number = hsSysNumberRuleService.getNumber(numberRuleReq);
         hsCanteenOrder.setOrderNumber(number);
+        //默认字符 0
+        hsCanteenOrder.setDeviceName("0");
+        hsCanteenOrder.setDeviceNumber("0");
         //订单详情
         if (appOrderPaymentReq.getDetails() == null) {
             return AjaxResult.error("订单明细不能为空");

+ 12 - 24
willalp-admin/src/main/java/com/willalp/web/controller/app/AppTwoController.java

@@ -1,6 +1,5 @@
 package com.willalp.web.controller.app;
 
-import cn.hutool.core.collection.CollectionUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.willalp.canteen.domain.HsGift;
@@ -336,7 +335,7 @@ public class AppTwoController extends BaseController {
         //消费标志
         HsGiftOrder hsGiftOrder = new HsGiftOrder();
         hsGiftOrder.setConsumeSign(0);
-        hsGiftOrder.setZfbz(1);
+        hsGiftOrder.setZfbz(req.getOrderType());
         hsGiftOrder.setUserNumber(req.getUserNumber());
         hsGiftOrder.setUserName(req.getUserName());
         hsGiftOrder.setPhone(req.getPhone());
@@ -360,23 +359,17 @@ public class AppTwoController extends BaseController {
         String data = httpUtils.sendGet(httpUtils.HTTPS + httpUtils.host + ":" + httpUtils.port + httpUtils.path + "/get/onb");
         hsGiftOrder.setOrderNumber(data);
         appUserMsg.setRemark(data);
-        for (HsGiftOrderDetail o : req.getHsGifts()) {
-            HsGift gift = new HsGift();
-            gift.setGiftNumber(o.getGiftNumber());
-            gift.setJgid(o.getJgid());
-            List<HsGift> temp = hsGiftService.selectHsGiftList(gift);
-            if (CollectionUtil.isEmpty(temp)) {
-                return AjaxResult.error(o.getCuisineName() + "礼品不存在");
-            }
-            gift = temp.get(0);
-            if (gift.getAmount() < o.getAmount()) {
-                return AjaxResult.error(gift.getGiftName() + "数量不足");
+        //抵扣库存
+        for (HsGiftOrderDetail gift : req.getHsGifts()) {
+            String giftId = gift.getGiftId();
+            Integer amount = gift.getAmount();
+            if (hsGiftService.checkAndReduceGiftInventory(amount, giftId) < 0) {
+                throw new BaseException(gift.getGiftName() + "库存不足,下单失败");
             }
             nameStr.append("【").append(gift.getGiftName()).append("】");
-            gift.setAmount(gift.getAmount() - o.getAmount());
-            hsGifts.add(gift);
-            o.setDetailId(IdWorker.getIdStr());
-            o.setOrderNumber(data);
+            gift.setAmount(gift.getAmount());
+            gift.setDetailId(IdWorker.getIdStr());
+            gift.setOrderNumber(data);
         }
         //消费积分
         sysUserOrganization.setIntegral(sysUserOrganization.getIntegral().subtract(req.getOrderTotal()));
@@ -385,16 +378,11 @@ public class AppTwoController extends BaseController {
             for (HsGiftOrderDetail o : req.getHsGifts()) {
                 userShopCarService.deleteJson(o.getGiftId(), req.getUserNumber());
             }
+            //更新DB数据
             sysUserOrganizationService.updateById(sysUserOrganization);//更新账户信息
             canteenOrderService.save(hsGiftOrder);//订单主表
             canteenOrderDetailServic.saveBatch(req.getHsGifts());//订单明细
-            hsGiftService.updateBatchById(hsGifts);
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw new BaseException("保存失败");
-        }
-
-        try {
+            //发送微信订阅通知
             wxMsgTemplateInExcSuccess.setThing3(wxUtils.getFormat(String.valueOf(req.getOrderTotal())));
             wxMsgTemplateInExcSuccess.setThing6(wxUtils.getFormat(String.valueOf(sysUserOrganization.getIntegral())));
             wxMsgTemplateInExcSuccess.setThing4(wxUtils.getFormat(nameStr.toString()));

+ 17 - 18
willalp-admin/src/main/java/com/willalp/web/controller/canteen/HsCanteenDiningPlaceController.java

@@ -1,29 +1,22 @@
 package com.willalp.web.controller.canteen;
 
-import java.util.List;
-
+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;
+import com.willalp.common.enums.BusinessType;
 import com.willalp.common.enums.NumberRuleEnum;
 import com.willalp.common.utils.DateUtils;
 import com.willalp.common.utils.SecurityUtils;
+import com.willalp.common.utils.poi.ExcelUtil;
 import com.willalp.number.domain.req.NumberRuleReq;
 import com.willalp.number.service.IHsSysNumberRuleService;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-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.core.controller.BaseController;
-import com.willalp.common.core.domain.AjaxResult;
-import com.willalp.common.enums.BusinessType;
-import com.willalp.canteen.domain.HsCanteenDiningPlace;
-import com.willalp.canteen.service.IHsCanteenDiningPlaceService;
-import com.willalp.common.utils.poi.ExcelUtil;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 就餐地Controller
@@ -53,6 +46,12 @@ public class HsCanteenDiningPlaceController extends BaseController
         return AjaxResult.success(list);
     }
 
+
+    @GetMapping("/integralExchangeGetPlace")
+    public AjaxResult integralExchangeGetPlace(){
+        return AjaxResult.success(hsCanteenDiningPlaceService.getPlaceByConfigKey(IHsCanteenDiningPlaceService.GIFT_PLACE_CONFIG_KEY));
+    }
+
     /**
      * 导出就餐地列表
      */

+ 23 - 0
willalp-admin/src/main/java/com/willalp/web/controller/canteen/HsCanteenOrderController.java

@@ -3,6 +3,7 @@ package com.willalp.web.controller.canteen;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+import com.willalp.canteen.domain.vo.LiveUseMoneyMonthStatExcel;
 import com.willalp.common.annotation.Log;
 import com.willalp.common.core.controller.BaseController;
 import com.willalp.common.core.domain.AjaxResult;
@@ -75,6 +76,28 @@ public class HsCanteenOrderController extends BaseController {
                 hsCanteenOrderService.jcdMonthStat(year, month));
     }
 
+    /**
+     * 查询食堂订单统计采购列表
+     */
+    @GetMapping("/useMoneyMonthTj")
+    public AjaxResult useMoneyMonthTj(int year,int month) {
+        return AjaxResult.success(
+                hsCanteenOrderService.liveUseMoneyMonthStat(year, month));
+    }
+
+    /**
+     * 导出食堂订单统计采购列表
+     */
+    @PreAuthorize("@ss.hasPermi('canteen:order:export')")
+    @Log(title = "食堂订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/useMoneyMonthTjExport")
+    public AjaxResult useMoneyMonthTjExport(int year,int month) {
+        List<LiveUseMoneyMonthStatExcel> list = hsCanteenOrderService.liveUseMoneyMonthStat(year, month);
+        ExcelUtil<LiveUseMoneyMonthStatExcel> util = new ExcelUtil<>(LiveUseMoneyMonthStatExcel.class);
+        return util.exportExcel(list, "【" + "现场消费月度统计表" + "】");
+    }
+
+
     /**
      * 导出食堂订单统计采购列表
      */

+ 10 - 0
willalp-admin/src/main/java/com/willalp/web/controller/canteen/HsGiftController.java

@@ -99,6 +99,16 @@ public class HsGiftController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 查询礼品登记列表
+     */
+    @GetMapping("/bindingList")
+    public TableDataInfo bindingList(HsGift hsGift) {
+        startPage();
+        List<HsGift> list = hsGiftService.bindingList(hsGift);
+        return getDataTable(list);
+    }
+
     /**
      * 导出礼品登记列表
      */

+ 1 - 1
willalp-admin/src/main/java/com/willalp/web/controller/canteen/HsGiftOrderController.java

@@ -78,7 +78,7 @@ public class HsGiftOrderController extends BaseController {
     @Log(title = "礼品订单", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(HsGiftOrder hsGiftOrder) {
-        List<HsGiftOrder> list = hsCanteenOrderService.selectHsCanteenOrderList(hsGiftOrder);
+        List<HsGiftOrder> list = hsCanteenOrderService.exportSelectGiftOrderList(hsGiftOrder);
         ExcelUtil<HsGiftOrder> util = new ExcelUtil<HsGiftOrder>(HsGiftOrder.class);
         return util.exportExcel(list, "礼品订单数据");
     }

+ 30 - 0
willalp-admin/src/main/java/com/willalp/web/controller/canteen/HsGiftOrderDetailController.java

@@ -3,6 +3,7 @@ package com.willalp.web.controller.canteen;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.willalp.canteen.domain.HsGiftOrderDetail;
 import com.willalp.canteen.domain.resp.OrderResp;
+import com.willalp.canteen.domain.resp.ShopOrderStatExcel;
 import com.willalp.canteen.service.IHsGiftOrderDetailService;
 import com.willalp.common.annotation.Log;
 import com.willalp.common.core.controller.BaseController;
@@ -10,10 +11,12 @@ 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.poi.ExcelUtil;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
@@ -29,6 +32,14 @@ public class HsGiftOrderDetailController extends BaseController {
     @Autowired
     private IHsGiftOrderDetailService hsCanteenOrderDetailService;
 
+    /**
+     * 查询订购统计列表
+     */
+    @GetMapping("/shopOrder/stat")
+    public AjaxResult shopOrderStat(@RequestParam("eventId") String eventId) {
+        return AjaxResult.success(hsCanteenOrderDetailService.shopOrderStatList(eventId));
+    }
+
     /**
      * 查询订单明细列表
      */
@@ -39,6 +50,25 @@ public class HsGiftOrderDetailController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 导出订购统计列表
+     */
+    @Log(title = "订购统计", businessType = BusinessType.EXPORT)
+    @GetMapping("/shopOrderStatExport")
+    public AjaxResult shopOrderStatExport(@RequestParam("eventId") String eventId) {
+        List<HsGiftOrderDetail> hsGiftOrderDetails = hsCanteenOrderDetailService.shopOrderStatList(eventId);
+        List<ShopOrderStatExcel> list = new ArrayList<>();
+        if (hsGiftOrderDetails.size() > 0) {
+            hsGiftOrderDetails.forEach(item -> {
+                ShopOrderStatExcel shopOrderStatExcel = new ShopOrderStatExcel();
+                BeanUtils.copyProperties(item, shopOrderStatExcel);
+                list.add(shopOrderStatExcel);
+            });
+        }
+        ExcelUtil<ShopOrderStatExcel> util = new ExcelUtil<>(ShopOrderStatExcel.class);
+        return util.exportExcel(list, "订单明细数据");
+    }
+
     /**
      * 导出订单明细列表
      */

+ 4 - 8
willalp-admin/src/main/java/com/willalp/web/controller/clockingin/FileApprovalController.java

@@ -16,8 +16,7 @@ import com.willalp.flow.domain.vo.FileApprovalVo;
 import com.willalp.flow.service.HsFlowEngineService;
 import com.willalp.flow.service.IFileApprovalService;
 import com.willalp.msg.service.IHsAppUserMsgService;
-import com.willalp.wx.service.WxMsgService;
-import com.willalp.wx.utils.WxUtils;
+import com.willalp.system.service.ISysConfigService;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -40,10 +39,7 @@ public class FileApprovalController extends BaseController {
     private HsFlowEngineService flowEngineService;
 
     @Resource
-    private WxMsgService wxMsgService;
-
-    @Resource
-    private WxUtils wxUtils;
+    private ISysConfigService sysConfigService;
 
     @Resource
     private IHsAppUserMsgService userMsgService;
@@ -95,7 +91,7 @@ public class FileApprovalController extends BaseController {
         fileApproval.setCreateTime(DateUtils.getNowDate());
         String idStr = IdWorker.getIdStr();
         fileApproval.setId(idStr);
-        flowEngineService.submitATask(new HsFlowTask(idStr, idStr, "1600773666636759041"), fileApproval.getParams());
+        flowEngineService.submitATask(new HsFlowTask(idStr, idStr, sysConfigService.selectConfigByKey("file_approval_flow_run_key")), fileApproval.getParams());
         StringBuffer content = new StringBuffer();
         content.append("<p>标题:").append(fileApproval.getTitle()).append("</p>")
                 .append("<p>申请人:").append(fileApproval.getApplyUserName()).append("</p>");
@@ -106,7 +102,7 @@ public class FileApprovalController extends BaseController {
         return toAjax(fileApprovalService.save(fileApproval));
     }
 
-    /**
+    /**f
      * 修改文件审批业务
      */
     @Log(title = "文件审批业务", businessType = BusinessType.UPDATE)

+ 0 - 4
willalp-admin/src/main/java/com/willalp/web/controller/clockingin/HsOrgPersonnelFilesController.java

@@ -60,10 +60,6 @@ public class HsOrgPersonnelFilesController extends BaseController {
         return util.exportExcel(list, "【人员档案数据】");
     }
 
-    public static void main(String[] args) {
-        String[] a = new String[9];
-        Arrays.fill(a, "");
-    }
     @Log(title = "工资条基础", businessType = BusinessType.IMPORT)
     @PostMapping("/importData")
     public AjaxResult importData(MultipartFile file) throws Exception {

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

@@ -57,7 +57,7 @@ spring:
       # 最小连接池数量
       minIdle: 10
       # 最大连接池数量
-      maxActive: 20
+      maxActive: 200
       # 配置获取连接等待超时的时间
       maxWait: 60000
       # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒

+ 45 - 0
willalp-admin/src/test/java/com/willalp/CanteenTest.java

@@ -0,0 +1,45 @@
+/**
+ * @projectName willalp-pns-ml
+ * @package com.willalp.test
+ * @className com.willalp.test.CanteenTest
+ * @copyright Copyright 2019 HuiShan, Inc All rights reserved.
+ */
+package com.willalp;
+
+import com.willalp.canteen.service.IHsGiftService;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+/**
+ * CanteenTest
+ * @description 模块单元测试类
+ * @author hs
+ * @date 2023/2/3 14:57
+ * @version 1.0
+ */
+@SpringBootTest(classes = WillalpApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+public class CanteenTest {
+    private static final Logger log = LoggerFactory.getLogger(CanteenTest.class);
+
+    @Autowired
+    private IHsGiftService giftService;
+
+    @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();
+        }
+    }
+}
+ 

+ 8 - 0
willalp-canteen/pom.xml

@@ -41,6 +41,14 @@
             <groupId>com.willalp</groupId>
             <artifactId>willalp-device</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.willalp</groupId>
+            <artifactId>willalp-clocking-in</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+        </dependency>
     </dependencies>
 
 </project>

+ 10 - 0
willalp-canteen/src/main/java/com/willalp/canteen/domain/HsGift.java

@@ -72,6 +72,8 @@ public class HsGift extends BaseEntity {
     @Excel(name = "礼品类型")
     private String giftType;
 
+    private String giftEventType;
+
     /**
      * 选择数量
      */
@@ -252,4 +254,12 @@ public class HsGift extends BaseEntity {
     public void setGiftType(String giftType) {
         this.giftType = giftType;
     }
+
+    public String getGiftEventType() {
+        return giftEventType;
+    }
+
+    public void setGiftEventType(String giftEventType) {
+        this.giftEventType = giftEventType;
+    }
 }

+ 52 - 16
willalp-canteen/src/main/java/com/willalp/canteen/domain/HsGiftOrder.java

@@ -42,7 +42,7 @@ public class HsGiftOrder {
     private String userNumber;
 
 
-    @Excel(name = "账户名称")
+    @Excel(name = "姓名")
     private String userName;
 
     /**
@@ -52,6 +52,15 @@ public class HsGiftOrder {
     private String phone;
 
 
+    @TableField(exist = false)
+    @Excel(name = "活动名称")
+    private String eventName;
+
+    /**
+     * 订单类型
+     */
+    @Excel(name = "订单类型", readConverterExp = "1=预定兑换,2=现场兑换")
+    private Integer zfbz;
 
     /**
      * 订单总额
@@ -59,6 +68,24 @@ public class HsGiftOrder {
     @Excel(name = "订单总额")
     private BigDecimal orderTotal;
 
+    /**
+     * 下单时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
+    private Date paytime;
+
+    @Excel(name = "领取地点")
+    private String placeNumber;
+
+    @TableField(exist = false)
+    @Excel(name = "领取时间")
+    private String eventTime;
+
+    @TableField(exist = false)
+    @Excel(name = "商品", width = 100)
+    private String giftsAndNum;
+
     /**
      * 设备编号
      */
@@ -72,24 +99,12 @@ public class HsGiftOrder {
     @TableField(exist = false)
     private String eventId;
 
-    /**
-     * 付款时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @Excel(name = "付款时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
-    private Date paytime;
-
     /**
      * 接单时间
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date zfsj;
 
-    /**
-     * 是否接单
-     */
-    private Integer zfbz;
-
     private String jgid;
 
     /**
@@ -125,8 +140,6 @@ public class HsGiftOrder {
     @TableField(exist = false)
     private Integer patternId;
 
-    @Excel(name = "领取地点")
-    private String placeNumber;
 
     @TableField(exist = false)
     private String phonenumber;
@@ -140,13 +153,36 @@ public class HsGiftOrder {
     @TableField(exist = false)
     private List<String> loginName = new ArrayList<>();
 
-
     /**
      * 请求参数
      */
     @TableField(exist = false)
     private Map<String, Object> params;
 
+    public String getGiftsAndNum() {
+        return giftsAndNum;
+    }
+
+    public void setGiftsAndNum(String giftsAndNum) {
+        this.giftsAndNum = giftsAndNum;
+    }
+
+    public String getEventName() {
+        return eventName;
+    }
+
+    public void setEventName(String eventName) {
+        this.eventName = eventName;
+    }
+
+    public String getEventTime() {
+        return eventTime;
+    }
+
+    public void setEventTime(String eventTime) {
+        this.eventTime = eventTime;
+    }
+
     public String getEventId() {
         return eventId;
     }

+ 10 - 0
willalp-canteen/src/main/java/com/willalp/canteen/domain/req/GiftCustomPayReq.java

@@ -19,12 +19,22 @@ public class GiftCustomPayReq {
 
     private String deviceName;
 
+    private Integer orderType;
+
     private String placeNumber;
 
     private String jgid;
 
     private List<HsGiftOrderDetail> hsGifts;
 
+    public Integer getOrderType() {
+        return orderType;
+    }
+
+    public void setOrderType(Integer orderType) {
+        this.orderType = orderType;
+    }
+
     public String getUserNumber() {
         return userNumber;
     }

+ 52 - 0
willalp-canteen/src/main/java/com/willalp/canteen/domain/resp/ShopOrderStatExcel.java

@@ -0,0 +1,52 @@
+/**
+ * @projectName willalp-pns-ml
+ * @package com.willalp.canteen.domain.resp
+ * @className com.willalp.canteen.domain.resp.ShopOrderStatExcel
+ * @copyright Copyright 2019 HuiShan, Inc All rights reserved.
+ */
+package com.willalp.canteen.domain.resp;
+
+import com.willalp.common.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * ShopOrderStatExcel
+ * @description 订购统计Excel导出模板类
+ * @author hs
+ * @date 2023/1/31 11:34
+ * @version 1.0
+ */
+@Data
+public class ShopOrderStatExcel {
+    /**
+     * 礼品名称
+     */
+    @Excel(name = "物品名称")
+    private String giftName;
+
+    /** 礼品编号 */
+    @Excel(name = "物品编号")
+    private String giftNumber;
+
+    /**
+     * 数量
+     */
+    @Excel(name = "数量")
+    private Integer amount;
+
+    /**
+     * 单价
+     */
+    @Excel(name = "单价")
+    private BigDecimal price;
+
+    /**
+     * 总价
+     */
+    @Excel(name = "总价")
+    private BigDecimal total;
+
+}
+ 

+ 5 - 0
willalp-canteen/src/main/java/com/willalp/canteen/domain/vo/HsCanteenOrderInfoVo.java

@@ -46,6 +46,11 @@ public class HsCanteenOrderInfoVo {
 
     private String cuisineName;
 
+    /**
+     * y用户类型
+     */
+    private String userTypeTitle;
+
     /**
      * 数量
      */

+ 47 - 0
willalp-canteen/src/main/java/com/willalp/canteen/domain/vo/LiveUseMoneyMonthStatExcel.java

@@ -0,0 +1,47 @@
+/**
+ * @projectName willalp-pns-ml
+ * @package com.willalp.canteen.domain.vo
+ * @className com.willalp.canteen.domain.vo.LiveUseMoneyMonthStatExcel
+ * @copyright Copyright 2019 HuiShan, Inc All rights reserved.
+ */
+package com.willalp.canteen.domain.vo;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.willalp.common.annotation.Excel;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+/**
+ * LiveUseMoneyMonthStatExcel
+ * @description 现场消费月度统计ecxel模板类
+ * @author hs
+ * @date 2023/2/2 11:52
+ * @version 1.0
+ */
+@NoArgsConstructor
+@Data
+public class LiveUseMoneyMonthStatExcel {
+    @Excel(name = "用户编号")
+    @JsonProperty("userNumber")
+    private String userNumber;
+
+    @Excel(name = "姓名")
+    @JsonProperty("nickName")
+    private String nickName;
+
+    @Excel(name = "用户类型")
+    @JsonProperty("userTypeTitle")
+    private String userTypeTitle;
+
+    @Excel(name = "消费总数")
+    @JsonProperty("count")
+    private Integer count;
+
+    @Excel(name = "消费总额")
+    @JsonProperty("sumTotal")
+    private BigDecimal sumTotal;
+}
+
+ 

+ 12 - 0
willalp-canteen/src/main/java/com/willalp/canteen/mapper/HsCanteenOrderMapper.java

@@ -5,6 +5,7 @@ import com.willalp.canteen.domain.HsCanteenOrder;
 import com.willalp.canteen.domain.resp.CustomGetOrderResp;
 import com.willalp.canteen.domain.vo.CustomGetOrderVo;
 import com.willalp.canteen.domain.vo.HsCanteenOrderInfoVo;
+import com.willalp.canteen.domain.vo.LiveUseMoneyMonthStatExcel;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -27,6 +28,17 @@ public interface HsCanteenOrderMapper extends BaseMapper<HsCanteenOrder>
      */
     List<HsCanteenOrderInfoVo> getOrderDataBasedOnMenu(@Param("menuCode") String menuCode);
 
+    /**
+     * 根据菜单编号获取订单信息
+     *
+     * @param menuCode
+     * @return
+     */
+    List<LiveUseMoneyMonthStatExcel> getOrderDataBasedOnMenuAndMonthStat(@Param("menuCode") String menuCode,
+                                                                         @Param("year") int year,
+                                                                         @Param("month") int month);
+
+
     /**
      * 查询食堂订单
      *

+ 17 - 0
willalp-canteen/src/main/java/com/willalp/canteen/mapper/HsGiftMapper.java

@@ -22,6 +22,14 @@ public interface HsGiftMapper extends BaseMapper<HsGift>
      */
     public List<HsGift> selectHsGiftList(HsGift hsGift);
 
+    /**
+     * 查询礼品登记列表
+     *
+     * @param hsGift 礼品登记
+     * @return 礼品登记集合
+     */
+    public List<HsGift> bindingList(HsGift hsGift);
+
     /**
      *
      * @param code
@@ -37,4 +45,13 @@ public interface HsGiftMapper extends BaseMapper<HsGift>
      * @param code2
      */
     List<HsGift> appSelectedHsGiftByEvent(@Param("code1") String code1,@Param("code2") String code2);
+
+    /**
+     * 积分兑换检查库存并实时抵扣
+     *
+     * @param num
+     * @param giftId
+     * @return
+     */
+    int checkAndReduceGiftInventory(@Param("num") int num, @Param("giftId") String giftId);
 }

+ 20 - 2
willalp-canteen/src/main/java/com/willalp/canteen/mapper/xml/HsCanteenOrderMapper.xml

@@ -40,7 +40,7 @@
                a.is_delete,
                b.nick_name,
                a.consume_sign,
-               c.pattern_id,
+#                c.pattern_id,
                a.place_number,
                a.zfsj,
                b.phonenumber,
@@ -48,7 +48,7 @@
                f.place_name
         from hs_canteen_order a
                  left join sys_user b on a.user_number = b.user_name
-                 left join hs_canteen_menu c on a.menu_number = c.menu_number
+#                  left join hs_canteen_menu c on a.menu_number = c.menu_number
                  left join sys_card_info d on a.user_number = d.user_id and a.jgid = d.organization_code
                  left join hs_canteen_dining_place f on a.place_number = f.place_number
     </sql>
@@ -221,5 +221,23 @@
         WHERE DATE(paytime) != SUBSTR(NOW(), 1, 9)
         GROUP BY user_number;
     </select>
+    <select id="getOrderDataBasedOnMenuAndMonthStat"
+            resultType="com.willalp.canteen.domain.vo.LiveUseMoneyMonthStatExcel">
+        SELECT count(1)             count,
+               hco.user_number,
+               SUM(hco.order_total) sumTotal,
+               su.nick_name,
+               sdd.dict_label       userTypeTitle
+        FROM hs_canteen_order hco
+                 LEFT JOIN sys_user su ON su.user_name = hco.user_number
+                 LEFT JOIN sys_user_organization suo ON suo.login_name = su.user_name
+                 LEFT JOIN sys_dict_data sdd ON sdd.dict_value = suo.user_type
+        WHERE hco.menu_number = #{menuCode}
+          AND hco.is_delete = 0
+          AND sdd.dict_type = 'user_type'
+          AND YEAR(hco.paytime) = #{year}
+          AND MONTH(hco.paytime) = #{month}
+        group by hco.user_number
+    </select>
 
 </mapper>

+ 26 - 12
willalp-canteen/src/main/java/com/willalp/canteen/mapper/xml/HsGiftMapper.xml

@@ -16,6 +16,7 @@
         <result property="jgid" column="jgid"/>
         <result property="isDelete" column="is_delete"/>
         <result property="giftType" column="gift_type"/>
+        <result property="giftEventType" column="gift_event_type"/>
         <result property="createBy" column="create_by"/>
         <result property="createTime" column="create_time"/>
         <result property="updateBy" column="update_by"/>
@@ -34,6 +35,7 @@
                qybz,
                jgid,
                gift_type,
+               gift_event_type,
                is_delete,
                create_by,
                create_time,
@@ -42,6 +44,15 @@
                remark
         from hs_gift hg
     </sql>
+    <update id="checkAndReduceGiftInventory">
+        update hs_gift
+        set amount = amount - #{num}
+        WHERE gift_id = #{giftId}
+          AND amount &gt; 0
+          AND amount &gt;= #{num}
+          AND qybz = 0
+          AND gift_event_type = '2'
+    </update>
 
     <select id="selectHsGiftList" parameterType="HsGift" resultMap="HsGiftResult">
         <include refid="selectHsGiftVo"/>
@@ -53,6 +64,9 @@
             <if test="qybz != null  and qybz != ''">
                 and qybz = #{qybz}
             </if>
+            <if test="giftEventType != null  and giftEventType != ''">
+                and gift_event_type = #{giftEventType}
+            </if>
             <if test="jgid != null and jgid !=''">
                 and jgid = #{jgid}
             </if>
@@ -91,22 +105,22 @@
         <where>
             hg.is_delete = 0 AND hg.qybz = '0'
             <if test="code1 != null and code1 != ''">
-                AND ght.parent_id = #{code1}
+                AND hebr.event_id = #{code1}
+                AND he.event_status = 3
+                AND hg.gift_event_type = '1'
             </if>
             <if test="code2 != null and code2 != ''">
                 AND hg.gift_type = #{code2}
+                AND hg.gift_event_type = '2'
             </if>
-            AND hebr.event_id IN (
-            SELECT
-            id
-            FROM
-            hs_event
-            WHERE
-            is_delete = 0
-            AND start_time &lt; NOW()
-            AND NOW() &lt; end_time
-            AND event_type='1'
-            )
+        </where>
+    </select>
+    <select id="bindingList" resultType="com.willalp.canteen.domain.HsGift">
+        <include refid="selectHsGiftVo"/>
+        <where>
+            hg.is_delete = 0
+            AND hg.gift_event_type = '1'
+            AND hg.gift_id not in( Select business_id from hs_event_business_relation)
         </where>
     </select>
 </mapper>

+ 34 - 6
willalp-canteen/src/main/java/com/willalp/canteen/mapper/xml/HsGiftOrderMapper.xml

@@ -38,6 +38,8 @@
                a.user_number,
                a.user_name,
                a.order_total,
+               he.event_name,
+               he.event_time,
                a.device_number,
                a.device_name,
                a.paytime,
@@ -50,17 +52,43 @@
                a.remark,
                a.status_text,
                a.is_news,
-               a.is_news_user
+               a.is_news_user,
+               b.event_id
         from hs_gift_order a
     </sql>
 
     <select id="selectHsCanteenOrderList" parameterType="HsGiftOrder" resultMap="HsCanteenOrderResult">
-        <include refid="selectHsCanteenOrderVo"/>
-        LEFT JOIN hs_gift_order_detail b on a.order_number = b.order_number
+        select
+        a.order_number,
+        a.order_id,
+        a.phone,
+        a.user_number,
+        a.user_name,
+        a.order_total,
+        he.event_name,
+        he.event_time,
+        a.device_number,
+        a.device_name,
+        a.paytime,
+        a.zfbz,
+        a.jgid,
+        a.is_delete,
+        a.consume_sign,
+        a.place_number,
+        a.zfsj,
+        a.remark,
+        a.status_text,
+        a.is_news,
+        a.is_news_user,
+        b.event_id
+        from hs_gift_order a
+        LEFT JOIN hs_gift_order_detail b ON a.order_number = b.order_number
+        LEFT JOIN hs_event he ON he.id = b.event_id
         <where>
-            a.is_delete = 0
+            a.is_delete = 0 AND b.is_delete = 0 AND he.is_delete = 0
             <if test="orderNumber != null  and orderNumber != ''">and a.order_number = #{orderNumber}</if>
             <if test="userNumber != null  and userNumber != ''">and a.user_number = #{userNumber}</if>
+            <if test="userName != null  and userName != ''">and a.user_name = #{userName}</if>
             <if test="deviceNumber != null  and deviceNumber != ''">and a.device_number = #{deviceNumber}</if>
             <if test="deviceName != null  and deviceName != ''">and a.device_name like concat('%', #{deviceName}, '%')
             </if>
@@ -68,12 +96,12 @@
             <if test="params.beginPaytime != null and params.beginPaytime != '' and params.endPaytime != null and params.endPaytime != ''">
                 and paytime between #{params.beginPaytime} and #{params.endPaytime}
             </if>
-            <if test="zfbz != null ">and a.zfbz = #{zfbz}</if>
+            <if test="zfbz > 0 ">and a.zfbz = #{zfbz}</if>
             <if test="eventId != null ">and b.event_id = #{eventId}</if>
             <if test="jgid != null and jgid != ''">and a.jgid = #{jgid}</if>
             <if test="placeNumber != null and placeNumber != ''">and a.place_number = #{placeNumber}</if>
         </where>
-        order by a.paytime desc
+        group by a.order_number
     </select>
     <select id="getSumpay" parameterType="HsGiftOrder" resultType="java.lang.String">
         select sum(order_total) as fee

+ 6 - 2
willalp-canteen/src/main/java/com/willalp/canteen/mapper/xml/HsUserShopCarMapper.xml

@@ -17,13 +17,17 @@
     <delete id="deleteJson">
         DELETE
         FROM hs_user_shop_car
-        WHERE json_data ->> '$.giftId' = #{id} AND user_code = #{userCode}
+        WHERE json_data ->> '$.giftId' = #{id}
+        <if test="userCode != null and userCode != ''">
+            AND user_code = #{userCode}
+        </if>
     </delete>
 
     <select id="countJson" resultType="java.lang.Integer">
         SELECT json_data ->> '$.num'
         FROM hs_user_shop_car
-        WHERE json_data ->> '$.giftId' = #{id} AND user_code = #{userCode}
+        WHERE json_data ->> '$.giftId' = #{id}
+          AND user_code = #{userCode}
     </select>
 
     <update id="addJsonNum">

+ 10 - 0
willalp-canteen/src/main/java/com/willalp/canteen/service/IHsCanteenOrderService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.willalp.canteen.domain.HsCanteenOrder;
 import com.willalp.canteen.domain.resp.CustomGetOrderResp;
 import com.willalp.canteen.domain.vo.CustomGetOrderVo;
+import com.willalp.canteen.domain.vo.LiveUseMoneyMonthStatExcel;
 import com.willalp.canteen.domain.vo.MenuCountVo;
 import com.willalp.common.core.domain.AjaxResult;
 
@@ -42,6 +43,15 @@ public interface IHsCanteenOrderService extends IService<HsCanteenOrder> {
      */
     Object jcdMonthStat(int year,int month);
 
+    /**
+     * 月度现场消费统计
+     *
+     * @return
+     * @param year
+     * @param month
+     */
+    List<LiveUseMoneyMonthStatExcel> liveUseMoneyMonthStat(int year, int month);
+
     /**
      * 获取该菜单每人菜品和数量
      *

+ 8 - 0
willalp-canteen/src/main/java/com/willalp/canteen/service/IHsGiftOrderDetailService.java

@@ -23,4 +23,12 @@ public interface IHsGiftOrderDetailService extends IService<HsGiftOrderDetail>
      */
     public List<OrderResp> selectHsCanteenOrderDetailList(HsGiftOrderDetail hsGiftOrderDetail);
 
+
+    /**
+     * 统计订购数量
+     *
+     * @param eventId
+     * @return
+     */
+    List<HsGiftOrderDetail> shopOrderStatList(String eventId);
 }

+ 8 - 0
willalp-canteen/src/main/java/com/willalp/canteen/service/IHsGiftOrderService.java

@@ -22,6 +22,14 @@ public interface IHsGiftOrderService extends IService<HsGiftOrder> {
      */
     public List<HsGiftOrder> selectHsCanteenOrderList(HsGiftOrder hsGiftOrder);
 
+    /**
+     * 导出查询礼品订单集合
+     *
+     * @param hsGiftOrder
+     * @return
+     */
+    List<HsGiftOrder> exportSelectGiftOrderList(HsGiftOrder hsGiftOrder);
+
     /**
      * 作废食堂订单
      *

+ 19 - 4
willalp-canteen/src/main/java/com/willalp/canteen/service/IHsGiftService.java

@@ -11,21 +11,36 @@ import java.util.List;
  * @author songyu
  * @date 2022-03-03
  */
-public interface IHsGiftService extends IService<HsGift>
-{
+public interface IHsGiftService extends IService<HsGift> {
     /**
      * 查询礼品登记列表
      *
      * @param hsGift 礼品登记
      * @return 礼品登记集合
      */
-    public List<HsGift> selectHsGiftList(HsGift hsGift);
+    List<HsGift> selectHsGiftList(HsGift hsGift);
 
+    /**
+     * 查询礼品登记列表
+     *
+     * @param hsGift 礼品登记
+     * @return 礼品登记集合
+     */
+    List<HsGift> bindingList(HsGift hsGift);
     /**
      *
      * @param type
      * @param code
      * @return
      */
-    public List<HsGift> appSelectedHsGiftList(int type, String code);
+    List<HsGift> appSelectedHsGiftList(int type, String code);
+
+    /**
+     * 积分兑换检查库存并实时抵扣
+     *
+     * @param num
+     * @param giftId
+     * @return
+     */
+    int checkAndReduceGiftInventory(int num, String giftId);
 }

+ 15 - 2
willalp-canteen/src/main/java/com/willalp/canteen/service/impl/HsCanteenOrderServiceImpl.java

@@ -10,6 +10,7 @@ import com.willalp.canteen.domain.*;
 import com.willalp.canteen.domain.resp.CustomGetOrderResp;
 import com.willalp.canteen.domain.vo.CustomGetOrderVo;
 import com.willalp.canteen.domain.vo.HsCanteenOrderInfoVo;
+import com.willalp.canteen.domain.vo.LiveUseMoneyMonthStatExcel;
 import com.willalp.canteen.domain.vo.MenuCountVo;
 import com.willalp.canteen.mapper.HsCanteenOrderMapper;
 import com.willalp.canteen.service.IHsCanteenDiningPlaceService;
@@ -30,6 +31,7 @@ import com.willalp.integral.service.IIntegralService;
 import com.willalp.number.domain.req.NumberRuleReq;
 import com.willalp.number.service.IHsSysNumberRuleService;
 import com.willalp.system.domain.SysUserOrganization;
+import com.willalp.system.service.ISysConfigService;
 import com.willalp.system.service.ISysUserOrganizationService;
 import com.willalp.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -190,6 +192,17 @@ public class HsCanteenOrderServiceImpl extends ServiceImpl<HsCanteenOrderMapper,
         return jcdTj(map, orders);
     }
 
+    @Override
+    public List<LiveUseMoneyMonthStatExcel> liveUseMoneyMonthStat(int year, int month) {
+        //获取现场消费订单信息
+        List<LiveUseMoneyMonthStatExcel> orders = baseMapper.getOrderDataBasedOnMenuAndMonthStat(
+                sysConfigService.selectConfigByKey("live_use_money_number_key"), year, month);
+        return orders;
+    }
+
+    @Resource
+    private ISysConfigService sysConfigService;
+
     private Map<String, Object> jcdTj(Map<String, Object> map, List<HsCanteenOrder> orders) {
         if (0 == orders.size()) {
             throw new BaseException("暂无统计数据");
@@ -197,7 +210,7 @@ public class HsCanteenOrderServiceImpl extends ServiceImpl<HsCanteenOrderMapper,
         List<HsCanteenDiningPlace> hsCanteenDiningPlaces = diningPlaceService.getBaseMapper().selectList(
                 new QueryWrapper<HsCanteenDiningPlace>()
                         .eq("jgid", SysOrgCodeEnum.MLHuiZhuLi.getCode())
-                        .notIn("parent_id", 0));
+                        .eq("parent_id", sysConfigService.selectConfigByKey("REPAST_PLACE_CONFIG_KEY")));
         if (0 == hsCanteenDiningPlaces.size()) {
             throw new BaseException("暂无统计数据");
         }
@@ -208,7 +221,7 @@ public class HsCanteenOrderServiceImpl extends ServiceImpl<HsCanteenOrderMapper,
         }
         List<Object> list = new ArrayList<>();
         for (HsCanteenDiningPlace hsCanteenDiningPlace : hsCanteenDiningPlaces) {
-            Map<String, Object> mapJcd = new HashMap<String, Object>();
+            Map<String, Object> mapJcd = new HashMap<>();
             mapJcd.put("placeName", hsCanteenDiningPlace.getPlaceName());
             //就餐地总数
             List<HsCanteenOrder> jdcSumList = orders.stream().filter(o ->

+ 40 - 5
willalp-canteen/src/main/java/com/willalp/canteen/service/impl/HsGiftOrderDetailServiceImpl.java

@@ -1,14 +1,22 @@
 package com.willalp.canteen.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.willalp.canteen.domain.HsGiftOrderDetail;
 import com.willalp.canteen.domain.resp.OrderResp;
 import com.willalp.canteen.mapper.HsGiftOrderDetailMapper;
 import com.willalp.canteen.service.IHsGiftOrderDetailService;
+import com.willalp.common.exception.base.BaseException;
+import com.willalp.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * 食堂订单明细Service业务层处理
@@ -17,12 +25,10 @@ import java.util.List;
  * @date 2021-12-03
  */
 @Service
-public class HsGiftOrderDetailServiceImpl extends ServiceImpl<HsGiftOrderDetailMapper, HsGiftOrderDetail>  implements IHsGiftOrderDetailService
-{
+public class HsGiftOrderDetailServiceImpl extends ServiceImpl<HsGiftOrderDetailMapper, HsGiftOrderDetail> implements IHsGiftOrderDetailService {
     @Autowired
     private HsGiftOrderDetailMapper hsGiftOrderDetailMapper;
 
-
     /**
      * 查询食堂订单明细列表
      *
@@ -30,9 +36,38 @@ public class HsGiftOrderDetailServiceImpl extends ServiceImpl<HsGiftOrderDetailM
      * @return 食堂订单明细
      */
     @Override
-    public List<OrderResp> selectHsCanteenOrderDetailList(HsGiftOrderDetail hsGiftOrderDetail)
-    {
+    public List<OrderResp> selectHsCanteenOrderDetailList(HsGiftOrderDetail hsGiftOrderDetail) {
         return hsGiftOrderDetailMapper.selectHsCanteenOrderDetailList(hsGiftOrderDetail);
     }
 
+    @Override
+    public List<HsGiftOrderDetail> shopOrderStatList(String eventId) {
+        if (StringUtils.isBlank(eventId)) {
+            throw new BaseException("请选择一个活动");
+        }
+        List<HsGiftOrderDetail> orderDetails = getBaseMapper().selectList(new QueryWrapper<HsGiftOrderDetail>()
+                .eq("event_id", eventId));
+        List<HsGiftOrderDetail> list = null;
+        if (orderDetails.size() != 0) {
+            Map<String, List<HsGiftOrderDetail>> mapStat = new HashMap<>();
+            orderDetails.forEach(detail -> mapStat.computeIfAbsent(detail.getGiftNumber(), k -> new ArrayList<>()));
+            if (0 != mapStat.size()) {
+                mapStat.forEach((key, details) -> details.addAll(orderDetails.stream().filter(detail -> StringUtils.isNotBlank(detail.getGiftNumber()) && detail.getGiftNumber().equals(key)).collect(Collectors.toList())));
+            }
+            list = new ArrayList<>();
+            List<HsGiftOrderDetail> finalList = list;
+            mapStat.forEach((key, details) -> {
+                HsGiftOrderDetail hsGiftOrderDetail = new HsGiftOrderDetail();
+                hsGiftOrderDetail.setGiftNumber(key);
+                hsGiftOrderDetail.setGiftName(details.get(0).getGiftName());
+                hsGiftOrderDetail.setPrice(details.get(0).getTotal());
+                hsGiftOrderDetail.setAmount(details.size());
+                BigDecimal size = new BigDecimal(details.size());
+                hsGiftOrderDetail.setTotal(details.get(0).getTotal().multiply(size));
+                finalList.add(hsGiftOrderDetail);
+            });
+        }
+        return list;
+    }
+
 }

+ 29 - 3
willalp-canteen/src/main/java/com/willalp/canteen/service/impl/HsGiftOrderServiceImpl.java

@@ -2,12 +2,14 @@ package com.willalp.canteen.service.impl;
 
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.willalp.common.core.domain.AjaxResult;
-import com.willalp.common.exception.base.BaseException;
 import com.willalp.canteen.domain.HsGiftOrder;
+import com.willalp.canteen.domain.HsGiftOrderDetail;
 import com.willalp.canteen.mapper.HsGiftOrderMapper;
 import com.willalp.canteen.service.IHsGiftOrderDetailService;
 import com.willalp.canteen.service.IHsGiftOrderService;
+import com.willalp.common.core.domain.AjaxResult;
+import com.willalp.common.exception.base.BaseException;
+import com.willalp.common.utils.StringUtils;
 import com.willalp.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -15,7 +17,9 @@ import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
+import java.util.Comparator;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 食堂订单Service业务层处理
@@ -43,7 +47,29 @@ public class HsGiftOrderServiceImpl extends ServiceImpl<HsGiftOrderMapper, HsGif
      */
     @Override
     public List<HsGiftOrder> selectHsCanteenOrderList(HsGiftOrder hsGiftOrder) {
-        return hsGiftOrderMapper.selectHsCanteenOrderList(hsGiftOrder);
+        return hsGiftOrderMapper.selectHsCanteenOrderList(hsGiftOrder).stream().sorted(Comparator.comparing(HsGiftOrder::getPaytime).reversed()).collect(Collectors.toList());
+    }
+
+    @Override
+    public List<HsGiftOrder> exportSelectGiftOrderList(HsGiftOrder hsGiftOrder) {
+        List<HsGiftOrder> giftOrders = hsGiftOrderMapper.selectHsCanteenOrderList(hsGiftOrder).stream().sorted(Comparator.comparing(HsGiftOrder::getPaytime).reversed()).collect(Collectors.toList());
+        List<HsGiftOrderDetail> orderResps = codService.getBaseMapper().selectList(null);
+        giftOrders.forEach(order -> {
+            String orderNumber = order.getOrderNumber();
+            if (StringUtils.isNotBlank(orderNumber)) {
+                List<HsGiftOrderDetail> collect = orderResps.stream().filter(item ->
+                        orderNumber.equals(item.getOrderNumber()) && StringUtils.isNotBlank(item.getGiftName()) && 0 != item.getAmount()
+                ).collect(Collectors.toList());
+                if (collect.size() > 0) {
+                    StringBuilder gifts = new StringBuilder();
+                    for (HsGiftOrderDetail detail : collect) {
+                        gifts.append("【").append(detail.getGiftName()).append(" * ").append(detail.getAmount()).append("】");
+                    }
+                    order.setGiftsAndNum(gifts.toString());
+                }
+            }
+        });
+        return giftOrders;
     }
 
     /**

+ 11 - 2
willalp-canteen/src/main/java/com/willalp/canteen/service/impl/HsGiftServiceImpl.java

@@ -26,6 +26,7 @@ public class HsGiftServiceImpl extends ServiceImpl<HsGiftMapper, HsGift> impleme
 
     @Resource
     private IHsGiftTypeService giftTypeService;
+
     @Resource
     private IHsEventService eventService;
 
@@ -40,13 +41,16 @@ public class HsGiftServiceImpl extends ServiceImpl<HsGiftMapper, HsGift> impleme
         return hsGiftMapper.selectHsGiftList(hsGift);
     }
 
+    @Override
+    public List<HsGift> bindingList(HsGift hsGift) {
+        return hsGiftMapper.bindingList(hsGift);
+    }
+
     @Override
     public List<HsGift> appSelectedHsGiftList(int type, String code) {
         QueryWrapper<HsGift> queryWrapper = new QueryWrapper<HsGift>()
                 .eq("jgid", SysOrgCodeEnum.HuiJiFen.getCode())
                 .eq("qybz", 0);
-        //List<HsEvent> nowEventList = eventService.getNowEventList(null);
-        //List<String> collect = nowEventList.stream().map(HsEvent::getId).collect(Collectors.toList());
         if (type == 1) {
             return baseMapper.appSelectedHsGiftByEvent(code, null);
         } else if (type == 2) {
@@ -54,4 +58,9 @@ public class HsGiftServiceImpl extends ServiceImpl<HsGiftMapper, HsGift> impleme
         }
         return null;
     }
+
+    @Override
+    public int checkAndReduceGiftInventory(int num, String giftId) {
+        return baseMapper.checkAndReduceGiftInventory(num, giftId);
+    }
 }

+ 21 - 0
willalp-canteen/src/main/java/com/willalp/canteen/service/impl/HsGiftTypeServiceImpl.java

@@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.willalp.canteen.domain.HsGiftType;
 import com.willalp.canteen.mapper.HsGiftTypeMapper;
 import com.willalp.canteen.service.IHsGiftTypeService;
+import com.willalp.common.utils.DateUtils;
+import com.willalp.event.domain.HsEvent;
+import com.willalp.event.service.IHsEventService;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -42,10 +46,27 @@ public class HsGiftTypeServiceImpl extends ServiceImpl<HsGiftTypeMapper, HsGiftT
         return baseMapper.selectHsGiftTypeList(hsGiftType);
     }
 
+    @Resource
+    private IHsEventService eventService;
+
     @Override
     public List<HsGiftType> appSelectHsGiftType() {
         List<HsGiftType> hsGiftTypeDb = baseMapper.selectHsGiftTypeList(null);
         List<HsGiftType> giftTypes = new ArrayList<>();
+        HsEvent hsEvent = new HsEvent();
+        hsEvent.setEventStatus("3");
+        List<HsEvent> hsEvents = eventService.selectHsEventList(hsEvent);
+        HsGiftType eventToParentGiftType = new HsGiftType();
+        eventToParentGiftType.setGiftTypeName("预定兑换");
+        List<HsGiftType> eventToParentGiftTypeChildList = new ArrayList<>();
+        for (HsEvent event : hsEvents) {
+            HsGiftType eventToGiftType = new HsGiftType();
+            eventToGiftType.setGiftTypeName(DateUtils.parseDateToStr("MM/dd", event.getEndTime()) + "前");
+            eventToGiftType.setId(event.getId());
+            eventToParentGiftTypeChildList.add(eventToGiftType);
+        }
+        eventToParentGiftType.setChildren(eventToParentGiftTypeChildList);
+        giftTypes.add(eventToParentGiftType);
         if (0 != hsGiftTypeDb.size()) {
             for (HsGiftType hsGiftType : hsGiftTypeDb) {
                 if ("0".equals(String.valueOf(hsGiftType.getParentId()))) {

+ 12 - 0
willalp-clocking-in/src/main/java/com/willalp/event/mapper/HsEventBusinessRelationMapper.java

@@ -2,6 +2,8 @@ package com.willalp.event.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.willalp.event.domain.HsEventBusinessRelation;
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -20,4 +22,14 @@ public interface HsEventBusinessRelationMapper extends BaseMapper<HsEventBusines
      * @return 事件相关业务关系集合
      */
     List<HsEventBusinessRelation> selectHsEventBusinessRelationList(HsEventBusinessRelation hsEventBusinessRelation);
+
+
+    /**
+     * 代理删除购物车已过期商品
+     *
+     * @param id
+     * @return
+     */
+    @Delete("DELETE FROM hs_user_shop_car  WHERE json_data ->> '$.giftId' = #{id}")
+    int agencyDeleteShopCar(@Param("id") String id);
 }

+ 8 - 2
willalp-clocking-in/src/main/java/com/willalp/event/mapper/HsEventMapper.java

@@ -22,12 +22,18 @@ public interface HsEventMapper extends BaseMapper<HsEvent>
     List<HsEvent> selectHsEventList(HsEvent hsEvent);
 
     /**
-     * 获取当前时间满足的事件
+     * 获取当前时间进行中的事件
      *
      * @param hsEvent
      * @return
      */
     List<HsEvent> getNowEventList(HsEvent hsEvent);
 
-
+    /**
+     * 获取当前时间结束或过期的事件
+     *
+     * @param hsEvent
+     * @return
+     */
+    List<HsEvent> getFormerlyEventList(HsEvent hsEvent);
 }

+ 16 - 9
willalp-clocking-in/src/main/java/com/willalp/event/mapper/xml/HsEventMapper.xml

@@ -40,7 +40,7 @@
                update_by,
                update_time,
                remark
-            from hs_event
+        from hs_event
     </sql>
 
     <select id="selectHsEventList" parameterType="HsEvent" resultMap="HsEventResult">
@@ -73,16 +73,23 @@
             </if>
         </where>
     </select>
+
     <select id="getNowEventList" resultType="com.willalp.event.domain.HsEvent">
         <include refid="selectHsEventVo"/>
-            WHERE
-            is_delete = 0
-            AND
-            end_time &gt; NOW()
-            AND
-            start_time &lt; NOW();
-            AND
-            event_type = '2'
+        WHERE
+        is_delete = 0
+        AND
+        end_time &gt; NOW()
+        AND
+        start_time &lt; NOW();
+    </select>
+
+    <select id="getFormerlyEventList" resultType="com.willalp.event.domain.HsEvent">
+        <include refid="selectHsEventVo"/>
+        WHERE
+        is_delete = 0
+        AND
+        end_time &lt; NOW()
     </select>
 </mapper>
 

+ 10 - 2
willalp-clocking-in/src/main/java/com/willalp/event/service/IHsEventBusinessRelationService.java

@@ -11,8 +11,7 @@ import java.util.List;
  * @author willalp
  * @date 2023-01-29
  */
-public interface IHsEventBusinessRelationService extends IService<HsEventBusinessRelation>
-{
+public interface IHsEventBusinessRelationService extends IService<HsEventBusinessRelation> {
     /**
      * 查询事件相关业务关系列表
      *
@@ -28,4 +27,13 @@ public interface IHsEventBusinessRelationService extends IService<HsEventBusines
      * @return
      */
     boolean doBindingRelation(HsEventBusinessRelation hsEventBusinessRelation);
+
+
+    /**
+     * 代理删除购物车已过期商品
+     *
+     * @param id
+     * @return
+     */
+    int agencyDeleteShopCar(String id);
 }

+ 8 - 3
willalp-clocking-in/src/main/java/com/willalp/event/service/IHsEventService.java

@@ -11,15 +11,15 @@ import java.util.List;
  * @author willalp
  * @date 2023-01-29
  */
-public interface IHsEventService extends IService<HsEvent>
-{
+public interface IHsEventService extends IService<HsEvent> {
     /**
      * 查询活动配置列表
      *
      * @param hsEvent 活动配置
      * @return 活动配置集合
      */
-    public List<HsEvent> selectHsEventList(HsEvent hsEvent);
+    List<HsEvent> selectHsEventList(HsEvent hsEvent);
+
     /**
      * 获取当前时间满足的事件
      *
@@ -27,4 +27,9 @@ public interface IHsEventService extends IService<HsEvent>
      * @return
      */
     List<HsEvent> getNowEventList(HsEvent hsEvent);
+
+    /**
+     * 定时更新事件状态
+     */
+    void timingUpdateEventStatus();
 }

+ 15 - 6
willalp-clocking-in/src/main/java/com/willalp/event/service/impl/HsEventBusinessRelationServiceImpl.java

@@ -1,7 +1,6 @@
 package com.willalp.event.service.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.willalp.common.exception.base.BaseException;
 import com.willalp.common.utils.StringUtils;
@@ -50,17 +49,22 @@ public class HsEventBusinessRelationServiceImpl extends ServiceImpl<HsEventBusin
         if (CollectionUtil.isEmpty(eventBusinessIds)) {
             throw new BaseException("业务IDs不能为空");
         }
-        List<HsEventBusinessRelation> relationList = getBaseMapper().selectList(new QueryWrapper<HsEventBusinessRelation>()
-                .eq("event_id", eventId));
+        List<HsEventBusinessRelation> relationList = getBaseMapper().selectList(null/*new QueryWrapper<HsEventBusinessRelation>()
+                .eq("event_id", eventId)*/);
         List<HsEventBusinessRelation> list = new ArrayList<>();
         for (String id : eventBusinessIds) {
             int count = 0;
             //去重
             for (HsEventBusinessRelation eventBusinessRelation : relationList) {
                 String businessId = eventBusinessRelation.getBusinessId();
-                if (StringUtils.isNotBlank(businessId) &&
-                        StringUtils.equals(businessId, id)) {
-                    count++;
+                if (StringUtils.isNotBlank(businessId)) {
+                    if (StringUtils.equals(businessId, id) &&
+                            StringUtils.isNotBlank(eventBusinessRelation.getEventId()) &&
+                            !StringUtils.equals(eventId, eventBusinessRelation.getEventId())) {
+                        throw new BaseException("有商品已绑定其他活动,请检查");
+                    } else if (StringUtils.equals(businessId, id)) {
+                        count++;
+                    }
                 }
             }
             if (count == 0) {
@@ -76,4 +80,9 @@ public class HsEventBusinessRelationServiceImpl extends ServiceImpl<HsEventBusin
         }
         return saveBatch(list);
     }
+
+    @Override
+    public int agencyDeleteShopCar(String id) {
+        return baseMapper.agencyDeleteShopCar(id);
+    }
 }

+ 49 - 4
willalp-clocking-in/src/main/java/com/willalp/event/service/impl/HsEventServiceImpl.java

@@ -1,13 +1,21 @@
 package com.willalp.event.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 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.mapper.HsEventMapper;
+import com.willalp.event.service.IHsEventBusinessRelationService;
 import com.willalp.event.service.IHsEventService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 活动配置Service业务层处理
@@ -16,8 +24,10 @@ import java.util.List;
  * @date 2023-01-29
  */
 @Service
-public class HsEventServiceImpl extends ServiceImpl<HsEventMapper, HsEvent>  implements IHsEventService
-{
+public class HsEventServiceImpl extends ServiceImpl<HsEventMapper, HsEvent> implements IHsEventService {
+
+    protected final static Logger logger = LoggerFactory.getLogger(HsEventServiceImpl.class);
+
     @Resource
     private HsEventMapper hsEventMapper;
 
@@ -28,8 +38,7 @@ public class HsEventServiceImpl extends ServiceImpl<HsEventMapper, HsEvent>  imp
      * @return 活动配置
      */
     @Override
-    public List<HsEvent> selectHsEventList(HsEvent hsEvent)
-    {
+    public List<HsEvent> selectHsEventList(HsEvent hsEvent) {
         return hsEventMapper.selectHsEventList(hsEvent);
     }
 
@@ -37,4 +46,40 @@ public class HsEventServiceImpl extends ServiceImpl<HsEventMapper, HsEvent>  imp
     public List<HsEvent> getNowEventList(HsEvent hsEvent) {
         return hsEventMapper.getNowEventList(hsEvent);
     }
+
+    @Resource
+    private IHsEventBusinessRelationService relationService;
+
+    @Override
+    public void timingUpdateEventStatus() {
+        logger.info("=============开始扫描事件状态=============");
+        //过期或结束
+        List<HsEvent> formerlyEventList = baseMapper.getFormerlyEventList(null);
+        //进行中
+        List<HsEvent> nowEventList = baseMapper.getNowEventList(null);
+        List<HsEvent> formerlyEvents = formerlyEventList.stream().filter(item -> StringUtils.isNotBlank(item.getEventStatus()) && !("4".equals(item.getEventStatus()))).collect(Collectors.toList());
+        List<HsEvent> nowEvents = nowEventList.stream().filter(item -> StringUtils.isNotBlank(item.getEventStatus()) && !("3".equals(item.getEventStatus()))).collect(Collectors.toList());
+        if (formerlyEvents.size() > 0) {
+            formerlyEvents.forEach(item -> item.setEventStatus("4"));
+        }
+        if (nowEvents.size() > 0) {
+            nowEvents.forEach(item -> item.setEventStatus("3"));
+        }
+        List<HsEvent> sumList = new ArrayList<>();
+        sumList.addAll(formerlyEvents);
+        sumList.addAll(nowEvents);
+        if (sumList.size() > 0) {
+            updateBatchById(sumList);
+            List<String> collect = sumList.stream().map(HsEvent::getId).collect(Collectors.toList());
+            List<HsEventBusinessRelation> relations = relationService.getBaseMapper().selectList(new QueryWrapper<HsEventBusinessRelation>()
+                    .in("event_id", collect));
+            relations.forEach(item -> {
+                relationService.agencyDeleteShopCar(item.getBusinessId());
+            });
+            //删除关系表数据
+            relationService.getBaseMapper().delete(new QueryWrapper<HsEventBusinessRelation>()
+                    .in("event_id", collect));
+            logger.info("事件状态更新成功 - 共【" + sumList.size() + "】条,开始进行【" + nowEvents.size() + "】条,已结束【" + formerlyEvents.size() + "】条 ==> 已删除相关数据");
+        }
+    }
 }

+ 1 - 1
willalp-clocking-in/src/main/java/com/willalp/flow/service/impl/HsFlowEngineServiceImpl.java

@@ -485,7 +485,7 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
                                 }
                                 //统一时间类型字段处理
                                 Set<String> strings = stringObjectMap.keySet();
-                                DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+                                DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
                                 strings.forEach(str -> {
                                     if (StringUtils.isNotBlank(str) && str.contains("time") || str.contains("date")) {
                                         if (stringObjectMap.get(str) instanceof LocalDateTime) {

+ 3 - 3
willalp-common/src/main/java/com/willalp/common/utils/DateUtils.java

@@ -135,9 +135,9 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
     }
 
     public static Boolean checkOverlap(Date begin1, Date end1, Date begin2, Date end2) {
-        if (DateUtil.isIn(begin1,begin2,end2) ||
-                DateUtil.isIn(end1,begin2,end2) ||
-                (begin1.compareTo(begin2) == -1 && end1.compareTo(end2) == 1)){
+        if (DateUtil.isIn(begin1, begin2, end2) ||
+                DateUtil.isIn(end1, begin2, end2) ||
+                (begin1.compareTo(begin2) == -1 && end1.compareTo(end2) == 1)) {
             return true;
         }
         return false;

+ 11 - 0
willalp-quartz/src/main/java/com/willalp/quartz/task/RyTask.java

@@ -16,17 +16,20 @@ import com.willalp.control.service.ControlService;
 import com.willalp.control.service.IHsControlDeviceInfoService;
 import com.willalp.control.service.IHsControlStatService;
 import com.willalp.control.service.IHsControlTimingService;
+import com.willalp.event.service.IHsEventService;
 import com.willalp.push.service.IHsAppPushService;
 import com.willalp.wx.domain.WxMsgTemplateAppointment;
 import com.willalp.wx.enums.WxTemplateKeyEnum;
 import com.willalp.wx.service.WxMsgService;
 import com.willalp.wx.utils.WxUtils;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.concurrent.TimeUnit;
 
 /**
  * 定时任务调度测试
@@ -62,6 +65,9 @@ public class RyTask {
     @Resource
     private IHsAppPushService pushService;
 
+    @Resource
+    private IHsEventService eventService;
+
     public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
         System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
     }
@@ -93,6 +99,11 @@ public class RyTask {
         controlService.asyncTimingStartOrEnd(nowWeekList, 1);
     }
 
+    @Scheduled(fixedRate = 1, timeUnit = TimeUnit.MINUTES)
+    public void timingUpdateEventStatus() {
+        eventService.timingUpdateEventStatus();
+    }
+
     /**
      * 定时更新设备运行信息
      *

+ 1 - 1
willalp-system/src/main/java/com/willalp/number/service/IHsSysNumberRuleService.java

@@ -69,5 +69,5 @@ public interface IHsSysNumberRuleService extends IService<HsSysNumberRule>
      * @param date
      * @return
      */
-    public String getNumber(NumberRuleReq numberRuleReq);
+    public String  getNumber(NumberRuleReq numberRuleReq);
 }

+ 3 - 3
willalp-system/src/main/java/com/willalp/number/service/impl/HsSysNumberRuleServiceImpl.java

@@ -108,7 +108,7 @@ public class HsSysNumberRuleServiceImpl extends ServiceImpl<HsSysNumberRuleMappe
 
     @Locked(value = {"getNumber_#[numberRuleReq.ruleId]"},block = 10,expire = 10)
     @Override
-    public String getNumber(NumberRuleReq numberRuleReq) {
+    public synchronized String getNumber(NumberRuleReq numberRuleReq) {
         //定义返回字符串
         StringBuffer number = new StringBuffer();
         //获取规则
@@ -161,8 +161,8 @@ public class HsSysNumberRuleServiceImpl extends ServiceImpl<HsSysNumberRuleMappe
                 }else if (e.getRuleId() == 3){//年月
                     Calendar calendar = Calendar.getInstance();
                     calendar.setTime(numberRuleReq.getDate());
-                    int year = calendar.get(calendar.YEAR);
-                    int month = calendar.get(calendar.MONTH);
+                    int year = calendar.get(Calendar.YEAR);
+                    int month = calendar.get(Calendar.MONTH);
                     //年月字典
                     List<SysDictData> yearList = sysDictDataMapper.selectDictDataByType("year_dic");
                     List<SysDictData> monthList = sysDictDataMapper.selectDictDataByType("month_dic");

+ 0 - 53
willalp-ui/public/api/flow/leavenImg.js

@@ -1,53 +0,0 @@
-import request from '@/utils/request'
-
-// 查询请假记录图像信息列表
-export function listLeavenImg(query) {
-  return request({
-    url: '/flow/leavenImg/list',
-    method: 'get',
-    params: query
-  })
-}
-
-// 查询请假记录图像信息详细
-export function getLeavenImg(id) {
-  return request({
-    url: '/flow/leavenImg/' + id,
-    method: 'get'
-  })
-}
-
-// 新增请假记录图像信息
-export function addLeavenImg(data) {
-  return request({
-    url: '/flow/leavenImg',
-    method: 'post',
-    data: data
-  })
-}
-
-// 修改请假记录图像信息
-export function updateLeavenImg(data) {
-  return request({
-    url: '/flow/leavenImg',
-    method: 'put',
-    data: data
-  })
-}
-
-// 删除请假记录图像信息
-export function delLeavenImg(id) {
-  return request({
-    url: '/flow/leavenImg/' + id,
-    method: 'delete'
-  })
-}
-
-// 导出请假记录图像信息
-export function exportLeavenImg(query) {
-  return request({
-    url: '/flow/leavenImg/export',
-    method: 'get',
-    params: query
-  })
-}

+ 9 - 0
willalp-ui/src/api/canteen/gift.js

@@ -9,6 +9,15 @@ export function listGift(query) {
   })
 }
 
+// 查询礼品登记列表
+export function bindingList(query) {
+  return request({
+    url: '/gift/gift/bindingList',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询礼品登记详细
 export function getGift(giftId) {
   return request({

+ 16 - 0
willalp-ui/src/api/canteen/giftDetail.js

@@ -1,5 +1,21 @@
 import request from '@/utils/request'
 
+// 查询食堂订单明细列表
+export function shopOrderStat(eventId) {
+  return request({
+    url: '/gift/detail/shopOrder/stat?eventId=' + eventId,
+    method: 'get'
+  })
+}
+
+// 查询食堂订单明细列表
+export function shopOrderStatExport(eventId) {
+  return request({
+    url: '/gift/detail/shopOrderStatExport?eventId=' + eventId,
+    method: 'get'
+  })
+}
+
 // 查询食堂订单明细列表
 export function listDetail(query) {
   return request({

+ 1 - 1
willalp-ui/src/api/canteen/giftType.js

@@ -20,7 +20,7 @@ export function getGiftType(id) {
 // 新增礼品类型
 export function addGiftType(data) {
   return request({
-    url: '/service/giftType',
+    url: 'aaaaservice/giftType',
     method: 'post',
     data: data
   })

+ 18 - 0
willalp-ui/src/api/canteen/order.js

@@ -35,6 +35,16 @@ export function jdcMonthTj(query) {
     params: query
   })
 }
+
+// 查询订单月度统计
+export function useMoneyMonthTj(query) {
+  return request({
+    url: '/canteen/order/useMoneyMonthTj',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询食堂订单列表
 export function listOrder(query) {
   return request({
@@ -104,6 +114,14 @@ export function tjdcExport(query) {
     params: query
   })
 }
+// 导出食堂订单
+export function useMoneyMonthTjExport(query) {
+  return request({
+    url: '/canteen/order/useMoneyMonthTjExport',
+    method: 'get',
+    params: query
+  })
+}
 
 // 导出食堂订单
 export function exportOrder(query) {

+ 9 - 1
willalp-ui/src/api/canteen/place.js

@@ -9,6 +9,14 @@ export function listPlace(query) {
   })
 }
 
+// 查询积分兑换领取地点列表
+export function integralExchangeGetPlace() {
+  return request({
+    url: '/canteen/place/integralExchangeGetPlace',
+    method: 'get'
+  })
+}
+
 // 查询就餐地详细
 export function getPlace(placeId) {
   return request({
@@ -50,4 +58,4 @@ export function exportPlace(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 1 - 1
willalp-ui/src/components/FileUpload/index.vue

@@ -195,4 +195,4 @@ export default {
 .ele-upload-list__item-content-action .el-link {
   margin-right: 10px;
 }
-</style>
+</style>

+ 280 - 0
willalp-ui/src/views/canteen/gift/giftType/index.vue

@@ -0,0 +1,280 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="礼品类型编号" prop="giftTypeNo">
+        <el-input
+          v-model="queryParams.giftTypeNo"
+          placeholder="请输入礼品类型编号"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="礼品类型名称" prop="giftTypeName">
+        <el-input
+          v-model="queryParams.giftTypeName"
+          placeholder="请输入礼品类型名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="父级ID" prop="parentId">
+        <el-input
+          v-model="queryParams.parentId"
+          placeholder="请输入父级ID"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="显示顺序" prop="orderNum">
+        <el-input
+          v-model="queryParams.orderNum"
+          placeholder="请输入显示顺序"
+          clearable
+          @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>
+      </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="['service:giftType:add']"
+        >新增</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table
+      v-loading="loading"
+      :data="giftTypeList"
+      row-key="id"
+      default-expand-all
+      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+    >
+      <el-table-column label="礼品类型编号" prop="giftTypeNo"/>
+      <el-table-column label="礼品类型名称" align="center" prop="giftTypeName" />
+<!--      <el-table-column label="父级ID" align="center" prop="parentId" />-->
+      <el-table-column label="显示顺序" align="center" prop="orderNum" />
+      <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="['service:giftType:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-plus"
+            @click="handleAdd(scope.row)"
+            v-hasPermi="['service:giftType:add']"
+          >新增</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['service:giftType:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 添加或修改礼品类型对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="礼品类型编号" prop="giftTypeNo">
+          <el-input v-model="form.giftTypeNo" placeholder="请输入礼品类型编号" />
+        </el-form-item>
+        <el-form-item label="礼品类型名称" prop="giftTypeName">
+          <el-input v-model="form.giftTypeName" placeholder="请输入礼品类型名称" />
+        </el-form-item>
+        <el-form-item label="父级ID" prop="parentId">
+          <treeselect v-model="form.parentId" :options="giftTypeOptions" :normalizer="normalizer" placeholder="请选择父级ID" />
+        </el-form-item>
+        <el-form-item label="显示顺序" prop="orderNum">
+          <el-input v-model="form.orderNum" placeholder="请输入显示顺序" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" 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 { listGiftType, getGiftType, delGiftType, addGiftType, updateGiftType } from "@/api/canteen/giftType";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  name: "GiftType",
+  components: {
+    Treeselect
+  },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 礼品类型表格数据
+      giftTypeList: [],
+      // 礼品类型树选项
+      giftTypeOptions: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        giftTypeNo: null,
+        giftTypeName: null,
+        parentId: null,
+        orderNum: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询礼品类型列表 */
+    getList() {
+      this.loading = true;
+      listGiftType(this.queryParams).then(response => {
+        this.giftTypeList = this.handleTree(response.data, "id", "parentId");
+        console.log(this.giftTypeList)
+        this.loading = false;
+      });
+    },
+    /** 转换礼品类型数据结构 */
+    normalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.id,
+        label: node.giftTypeName,
+        children: node.children
+      };
+    },
+	/** 查询礼品类型下拉树结构 */
+    getTreeselect() {
+      listGiftType().then(response => {
+        this.giftTypeOptions = [];
+        const data = { id: 0, giftTypeName: '顶级节点', children: [] };
+        data.children = this.handleTree(response.data, "id", "parentId");
+        this.giftTypeOptions.push(data);
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        giftTypeNo: null,
+        giftTypeName: null,
+        parentId: null,
+        orderNum: null,
+        isDelete: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 新增按钮操作 */
+    handleAdd(row) {
+      this.reset();
+      this.getTreeselect();
+      if (row != null && row.id) {
+        this.form.parentId = row.id;
+      } else {
+        this.form.parentId = 0;
+      }
+      this.open = true;
+      this.title = "添加礼品类型";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      this.getTreeselect();
+      if (row != null) {
+        this.form.parentId = row.id;
+      }
+      getGiftType(row.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) {
+            updateGiftType(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addGiftType(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      this.$modal.confirm('是否确认删除礼品类型编号为"' + row.id + '"的数据项?').then(function() {
+        return delGiftType(row.id);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    }
+  }
+};
+</script>

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

@@ -103,7 +103,7 @@
           size="mini"
           :loading="exportLoading"
           @click="eventShow"
-        >兑换事件配置
+        >活动事件配置
         </el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -191,19 +191,9 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="礼品类型" prop="giftType">
-          <treeselect v-model="form.giftType" :options="giftTypeOptions" :normalizer="normalizer"
-                      placeholder="请选择礼品类型"/>
-        </el-form-item>
-        <!--        <el-form-item label="机构代码" prop="orgCode">-->
-        <!--          <el-select v-model="form.jgid" placeholder="请选择机构代码">-->
-        <!--            <el-option-->
-        <!--              v-for="item in orgList"-->
-        <!--              :key="item.orgCode"-->
-        <!--              :label="item.orgName"-->
-        <!--              :value="item.orgCode"-->
-        <!--            ></el-option>-->
-        <!--          </el-select>-->
+        <!--        <el-form-item label="礼品类型" prop="giftType">-->
+        <!--          <treeselect v-model="form.giftType" :options="giftTypeOptions" :normalizer="normalizer"-->
+        <!--                      placeholder="请选择礼品类型"/>-->
         <!--        </el-form-item>-->
         <el-form-item label="详情内容" prop="remark">
           <editor v-model="form.giftContent" :min-height="192"/>
@@ -224,15 +214,15 @@
       </div>
     </el-dialog>
     <!-- 添加或修改礼品登记对话框 -->
-    <el-dialog title="兑换事件配置" :visible.sync="eventForm.open" width="1600px" append-to-body>
+    <el-dialog title="活动事件配置" :visible.sync="eventForm.open" width="1600px" append-to-body>
       <eventConfig ref="event" :id="eventGiftForm.eventId"></eventConfig>
     </el-dialog>
 
     <!-- 绑定活动礼品话框 -->
-    <el-dialog title="兑换事件配置" :visible.sync="eventGiftForm.open" width="1600px" append-to-body>
-      <el-table v-loading="loading" :data="giftList" @selection-change="handleSelectionChange2">
+    <el-dialog title="活动事件配置" :visible.sync="eventGiftForm.open" width="1600px" append-to-body>
+      <el-table v-loading="bindingQueryParams.loading " :data="giftBindingList"
+                @selection-change="handleSelectionChange2">
         <el-table-column type="selection" width="55" align="center"/>
-        <el-table-column label="礼品id" align="center" prop="giftId" v-if="false"/>
         <el-table-column label="礼品编号" align="center" prop="giftNumber"/>
         <el-table-column label="礼品名称" align="center" prop="giftName"/>
         <el-table-column label="礼品图片" align="center" prop="giftPictrue">
@@ -241,6 +231,7 @@
           </template>
         </el-table-column>
         <el-table-column label="礼品价格" align="center" prop="giftPrice"/>
+        <el-table-column label="库存数量" align="center" prop="amount"/>
         <el-table-column label="启用标志" align="center" prop="qybz">
           <template slot-scope="scope">
             <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.qybz"/>
@@ -248,11 +239,11 @@
         </el-table-column>
       </el-table>
       <pagination
-        v-show="total>0"
-        :total="total"
-        :page.sync="queryParams.pageNum"
-        :limit.sync="queryParams.pageSize"
-        @pagination="getList"
+        v-show="bindingQueryParams.total>0"
+        :total="bindingQueryParams.total"
+        :page.sync="bindingQueryParams.pageNum"
+        :limit.sync="bindingQueryParams.pageSize"
+        @pagination="getBindingList"
       />
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitBindingEventGifts()" v-prevent-re-click>确 定</el-button>
@@ -273,17 +264,18 @@ import {
   getNotice,
   notice,
   getNoticeStatus,
-  setNoticeStatus
-} from "@/api/canteen/gift";
-import {getMasterOrgInfos} from "@/api/master-api";
-import {listGiftType} from "@/api/canteen/giftType";
-import eventConfig from "@/views/eventConfig/event";
-import Treeselect from "@riophae/vue-treeselect";
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-import {submitBindingRelation} from "@/api/eventConfig/relation";
+  setNoticeStatus,
+  bindingList
+} from '@/api/canteen/gift'
+import { getMasterOrgInfos } from '@/api/master-api'
+import { listGiftType } from '@/api/canteen/giftType'
+import eventConfig from '@/views/eventConfig/event'
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import { submitBindingRelation } from '@/api/eventConfig/relation'
 
 export default {
-  name: "Gift",
+  name: 'Gift',
   dicts: ['sys_normal_disable'],
   components: {
     Treeselect, eventConfig
@@ -307,28 +299,29 @@ export default {
       total: 0,
       // 礼品登记表格数据
       giftList: [],
+      giftBindingList: [],
       orgList: [],
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
       noticeForm: {
         open: false,
-        text: "",
+        text: '',
         openStatus: false
       },
       eventForm: {
         open: false,
-        text: "",
+        text: '',
         openStatus: false
       },
       eventGiftForm: {
-        eventId: "",
+        eventId: '',
         eventBusinessIds: [],
         businessType: '1',
         open: false,
-        text: "",
-        openStatus: false,
+        text: '',
+        openStatus: false
       },
       // 礼品类型树选项
       giftTypeOptions: [],
@@ -337,37 +330,40 @@ export default {
         pageNum: 1,
         pageSize: 10,
         giftName: null,
-        qybz: null,
+        giftEventType: '1',
+        qybz: null
+      },
+      // 查询参数
+      bindingQueryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        total: 0,
+        loading: false
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
         giftName: [
-          {required: true, message: "礼品名称不能为空", trigger: "blur"}
+          { required: true, message: '礼品名称不能为空', trigger: 'blur' }
         ],
         qybz: [
-          {required: true, message: "启用标志 0-启用 1-禁用不能为空", trigger: "change"}
-        ],
+          { required: true, message: '启用标志 0-启用 1-禁用不能为空', trigger: 'change' }
+        ]
       }
-    };
+    }
   },
   created() {
-    this.getList();
-    this.getNotice();
-    this.getNoticeStatus();
+    this.getList()
+    this.getNotice()
+    this.getNoticeStatus()
   },
   methods: {
-    bindingGift() {
-      this.eventGiftForm.open = true
-      setTimeout(() => {
-        this.eventGiftForm.eventId = this.$refs.event.getEventId()
-      }, 100)
-    },
     submitBindingEventGifts() {
       submitBindingRelation(this.eventGiftForm).then(re => {
         if (re.code === 200) {
-          this.$modal.msgSuccess("绑定成功");
+          this.$modal.msgSuccess('绑定成功')
+          this.getBindingList()
         }
       })
     },
@@ -377,7 +373,7 @@ export default {
       }
       setNoticeStatus(data).then(re => {
         this.getNoticeStatus()
-        this.$modal.msgSuccess("更新成功");
+        this.$modal.msgSuccess('更新成功')
       })
     },
     getNoticeStatus() {
@@ -395,53 +391,66 @@ export default {
         'text': this.noticeForm.text
       }
       notice(params).then(re => {
-        this.$modal.msgSuccess("修改成功");
+        this.$modal.msgSuccess('修改成功')
         this.getNotice()
         this.noticeForm.open = false
       })
     },
     /** 查询礼品登记列表 */
     getList() {
-      this.loading = true;
+      this.loading = true
       getMasterOrgInfos().then(response => {
         this.orgList = response.data
       })
       listGift(this.queryParams).then(response => {
-        this.giftList = response.rows;
+        this.giftList = response.rows
         this.giftList.forEach(item => {
           item.orgCode = item.jgid
         })
-        this.total = response.total;
-        this.loading = false;
-      });
+        this.total = response.total
+        this.loading = false
+      })
+    },
+    /** 查询礼品登记列表 */
+    getBindingList() {
+      this.bindingQueryParams.loading = true
+      bindingList(this.bindingQueryParams).then(response => {
+        this.giftBindingList = response.rows
+        this.eventGiftForm.open = true
+        setTimeout(() => {
+          this.eventGiftForm.eventId = this.$refs.event.getEventId()
+        }, 10)
+        this.bindingQueryParams.total = response.total
+        this.bindingQueryParams.loading = false
+      })
     },
     /** 查询礼品类型下拉树结构 */
     getTreeselect() {
       listGiftType().then(response => {
-        this.giftTypeOptions = [];
-        const data = {id: 0, giftTypeName: '顶级分类', children: []};
-        data.children = this.handleTree(response.data, "id", "parentId");
-        this.giftTypeOptions.push(data);
-      });
+        this.giftTypeOptions = []
+        const data = { id: 0, giftTypeName: '顶级分类', children: [] }
+        data.children = this.handleTree(response.data, 'id', 'parentId')
+        this.giftTypeOptions.push(data)
+      })
     },
     /** 转换礼品类型数据结构 */
     normalizer(node) {
       if (node.children && !node.children.length) {
-        delete node.children;
+        delete node.children
       }
       return {
         id: node.id,
         label: node.giftTypeName,
         children: node.children
-      };
+      }
     },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.noticeForm.open = false;
-      this.eventGiftForm.open = false;
-      this.noticeForm.text = '';
-      this.reset();
+      this.open = false
+      this.noticeForm.open = false
+      this.eventGiftForm.open = false
+      this.noticeForm.text = ''
+      this.reset()
     },
     // 表单重置
     reset() {
@@ -460,18 +469,18 @@ 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) {
@@ -485,16 +494,17 @@ export default {
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.getTreeselect();
-      this.reset();
-      this.open = true;
-      this.title = "添加礼品登记";
+      this.getTreeselect()
+      this.reset()
+      this.open = true
+      this.title = '添加礼品登记'
+      this.form.giftEventType = '1'
     },
     noticeShow() {
-      this.noticeForm.open = true;
+      this.noticeForm.open = true
     },
     eventShow() {
-      this.eventForm.open = true;
+      this.eventForm.open = true
       setTimeout(() => {
         this.$refs.event.queryParams.eventType = '1'
         this.$refs.event.getList()
@@ -502,58 +512,59 @@ export default {
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.getTreeselect();
-      this.reset();
+      this.getTreeselect()
+      this.reset()
       const giftId = row.giftId || this.ids
       getGift(giftId).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改礼品登记";
-      });
+        this.form = response.data
+        this.form.giftEventType = '1'
+        this.open = true
+        this.title = '修改礼品登记'
+      })
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
+      this.$refs['form'].validate(valid => {
         if (valid) {
           if (this.form.giftId != null) {
             updateGift(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
+              this.$modal.msgSuccess('修改成功')
+              this.open = false
+              this.getList()
+            })
           } else {
             addGift(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
+              this.$modal.msgSuccess('新增成功')
+              this.open = false
+              this.getList()
+            })
           }
         }
-      });
+      })
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const giftIds = row.giftId || this.ids;
-      this.$modal.confirm('是否确认删除礼品登记编号为"' + giftIds + '"的数据项?').then(function () {
-        return delGift(giftIds);
+      const giftIds = row.giftId || this.ids
+      this.$modal.confirm('是否确认删除礼品登记编号为"' + giftIds + '"的数据项?').then(function() {
+        return delGift(giftIds)
       }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
+        this.getList()
+        this.$modal.msgSuccess('删除成功')
       }).catch(() => {
-      });
+      })
     },
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
+      const queryParams = this.queryParams
       this.$modal.confirm('是否确认导出所有礼品登记数据项?').then(() => {
-        this.exportLoading = true;
-        return exportGift(queryParams);
+        this.exportLoading = true
+        return exportGift(queryParams)
       }).then(response => {
-        this.$download.name(response.msg);
-        this.exportLoading = false;
+        this.$download.name(response.msg)
+        this.exportLoading = false
       }).catch(() => {
-      });
+      })
     }
   }
-};
+}
 </script>

+ 515 - 0
willalp-ui/src/views/canteen/gift/indexLive.vue

@@ -0,0 +1,515 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
+      <el-form-item label="礼品名称" prop="giftName">
+        <el-input
+          v-model="queryParams.giftName"
+          placeholder="请输入礼品名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <!--<el-form-item label="启用标志" prop="qybz">-->
+      <!--  <el-select v-model="queryParams.qybz" placeholder="请选择启用标志" clearable size="small">-->
+      <!--    <el-option-->
+      <!--      v-for="dict in dict.type.sys_yes_no"-->
+      <!--      :key="dict.value"-->
+      <!--      :label="dict.label"-->
+      <!--      :value="dict.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="['canteen:gift: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="['canteen:gift: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="['canteen:gift: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="['canteen:gift:export']"
+        >导出
+        </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="giftList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="礼品id" align="center" prop="giftId" v-if="false"/>
+      <el-table-column label="礼品编号" align="center" prop="giftNumber"/>
+      <el-table-column label="礼品名称" align="center" prop="giftName"/>
+      <el-table-column label="礼品图片" align="center" prop="giftPictrue">
+        <template slot-scope="scope">
+          <img style="width:80px;height:80px;border:none;" :src="baseUrl + scope.row.giftPictrue">
+        </template>
+      </el-table-column>
+      <el-table-column label="礼品价格" align="center" prop="giftPrice"/>
+      <el-table-column label="库存数量" align="center" prop="amount"/>
+      <el-table-column label="启用标志" align="center" prop="qybz">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.qybz"/>
+        </template>
+      </el-table-column>
+      <!--      <el-table-column label="机构代码" align="center" prop="orgCode">-->
+      <!--        <template slot-scope="scope">-->
+      <!--          <div v-for="item in orgList">-->
+      <!--            <el-tag v-if="item.orgCode === scope.row.orgCode">-->
+      <!--              {{ item.orgName }}-->
+      <!--            </el-tag>-->
+      <!--          </div>-->
+      <!--        </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
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['canteen:gift:edit']"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['canteen:gift: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="giftName">
+          <el-input v-model="form.giftName" placeholder="请输入礼品名称"/>
+        </el-form-item>
+        <el-form-item label="礼品图片" prop="giftPictrue">
+          <imageUpload v-model="form.giftPictrue"/>
+        </el-form-item>
+        <el-form-item label="礼品价格" prop="giftPrice">
+          <el-input v-model="form.giftPrice" placeholder="请输入礼品价格"/>
+        </el-form-item>
+        <el-form-item label="库存数量" prop="amount">
+          <el-input v-model="form.amount" placeholder="请输入库存数量"/>
+        </el-form-item>
+        <el-form-item label="启用标志" prop="qybz">
+          <el-select v-model="form.qybz" placeholder="请选择启用标志">
+            <el-option
+              v-for="dict in dict.type.sys_normal_disable"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="礼品类型" prop="giftType">
+          <treeselect v-model="form.giftType" :options="giftTypeOptions" :normalizer="normalizer"
+                      placeholder="请选择礼品类型"/>
+        </el-form-item>
+        <!--        <el-form-item label="机构代码" prop="orgCode">-->
+        <!--          <el-select v-model="form.jgid" placeholder="请选择机构代码">-->
+        <!--            <el-option-->
+        <!--              v-for="item in orgList"-->
+        <!--              :key="item.orgCode"-->
+        <!--              :label="item.orgName"-->
+        <!--              :value="item.orgCode"-->
+        <!--            ></el-option>-->
+        <!--          </el-select>-->
+        <!--        </el-form-item>-->
+        <el-form-item label="详情内容" prop="remark">
+          <editor v-model="form.giftContent" :min-height="192"/>
+        </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>
+
+    <!-- 添加或修改礼品登记对话框 -->
+    <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()" v-prevent-re-click>确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  listGift,
+  getGift,
+  delGift,
+  addGift,
+  updateGift,
+  exportGift,
+  getNotice,
+  notice,
+  getNoticeStatus,
+  setNoticeStatus
+} from '@/api/canteen/gift'
+import { getMasterOrgInfos } from '@/api/master-api'
+import { listGiftType } from '@/api/canteen/giftType'
+import eventConfig from '@/views/eventConfig/event'
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import { submitBindingRelation } from '@/api/eventConfig/relation'
+
+export default {
+  name: 'Gift',
+  dicts: ['sys_normal_disable'],
+  components: {
+    Treeselect, eventConfig
+  },
+  data() {
+    return {
+      baseUrl: process.env.VUE_APP_BASE_API,
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 礼品登记表格数据
+      giftList: [],
+      orgList: [],
+      // 弹出层标题
+      title: '',
+      // 是否显示弹出层
+      open: false,
+      noticeForm: {
+        open: false,
+        text: '',
+        openStatus: false
+      },
+      eventForm: {
+        open: false,
+        text: '',
+        openStatus: false
+      },
+      eventGiftForm: {
+        eventId: '',
+        eventBusinessIds: [],
+        businessType: '1',
+        open: false,
+        text: '',
+        openStatus: false
+      },
+      // 礼品类型树选项
+      giftTypeOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        giftName: null,
+        giftEventType: '2',
+        qybz: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        giftName: [
+          { required: true, message: '礼品名称不能为空', trigger: 'blur' }
+        ],
+        qybz: [
+          { required: true, message: '启用标志 0-启用 1-禁用不能为空', trigger: 'change' }
+        ]
+      }
+    }
+  },
+  created() {
+    this.getList()
+    this.getNotice()
+    this.getNoticeStatus()
+  },
+  methods: {
+    bindingGift() {
+      this.eventGiftForm.open = true
+      setTimeout(() => {
+        this.eventGiftForm.eventId = this.$refs.event.getEventId()
+      }, 100)
+    },
+    submitBindingEventGifts() {
+      submitBindingRelation(this.eventGiftForm).then(re => {
+        if (re.code === 200) {
+          this.$modal.msgSuccess('绑定成功')
+        }
+      })
+    },
+    setNoticeStatus() {
+      let data = {
+        'openStatus': this.noticeForm.openStatus ? 'true' : 'false'
+      }
+      setNoticeStatus(data).then(re => {
+        this.getNoticeStatus()
+        this.$modal.msgSuccess('更新成功')
+      })
+    },
+    getNoticeStatus() {
+      getNoticeStatus().then(re => {
+        this.noticeForm.openStatus = re.msg !== 'false'
+      })
+    },
+    getNotice() {
+      getNotice().then(re => {
+        this.noticeForm.text = re.msg
+      })
+    },
+    updateNotice() {
+      let params = {
+        'text': this.noticeForm.text
+      }
+      notice(params).then(re => {
+        this.$modal.msgSuccess('修改成功')
+        this.getNotice()
+        this.noticeForm.open = false
+      })
+    },
+    /** 查询礼品登记列表 */
+    getList() {
+      this.loading = true
+      getMasterOrgInfos().then(response => {
+        this.orgList = response.data
+      })
+      listGift(this.queryParams).then(response => {
+        this.giftList = response.rows
+        this.giftList.forEach(item => {
+          item.orgCode = item.jgid
+        })
+        this.total = response.total
+        this.loading = false
+      })
+    },
+    /** 查询礼品类型下拉树结构 */
+    getTreeselect() {
+      listGiftType().then(response => {
+        this.giftTypeOptions = []
+        const data = { id: 0, giftTypeName: '顶级分类', children: [] }
+        data.children = this.handleTree(response.data, 'id', 'parentId')
+        this.giftTypeOptions.push(data)
+      })
+    },
+    /** 转换礼品类型数据结构 */
+    normalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children
+      }
+      return {
+        id: node.id,
+        label: node.giftTypeName,
+        children: node.children
+      }
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false
+      this.noticeForm.open = false
+      this.eventGiftForm.open = false
+      this.noticeForm.text = ''
+      this.reset()
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        giftId: null,
+        giftNumber: null,
+        giftName: null,
+        giftPictrue: null,
+        giftPrice: null,
+        amount: null,
+        qybz: null,
+        jgid: 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.giftId)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    // 多选框选中数据
+    handleSelectionChange2(selection) {
+      this.eventGiftForm.eventBusinessIds = selection.map(item => item.giftId)
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.getTreeselect()
+      this.reset()
+      this.open = true
+      this.title = '添加礼品登记'
+      this.form.giftEventType = '2'
+    },
+    noticeShow() {
+      this.noticeForm.open = true
+    },
+    eventShow() {
+      this.eventForm.open = true
+      setTimeout(() => {
+        this.$refs.event.queryParams.eventType = '1'
+        this.$refs.event.getList()
+      }, 100)
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.getTreeselect()
+      this.reset()
+      const giftId = row.giftId || this.ids
+      getGift(giftId).then(response => {
+        this.form = response.data
+        this.form.giftEventType = '2'
+        this.open = true
+        this.title = '修改礼品登记'
+      })
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs['form'].validate(valid => {
+        if (valid) {
+          if (this.form.giftId != null) {
+            updateGift(this.form).then(response => {
+              this.$modal.msgSuccess('修改成功')
+              this.open = false
+              this.getList()
+            })
+          } else {
+            addGift(this.form).then(response => {
+              this.$modal.msgSuccess('新增成功')
+              this.open = false
+              this.getList()
+            })
+          }
+        }
+      })
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const giftIds = row.giftId || this.ids
+      this.$modal.confirm('是否确认删除礼品登记编号为"' + giftIds + '"的数据项?').then(function() {
+        return delGift(giftIds)
+      }).then(() => {
+        this.getList()
+        this.$modal.msgSuccess('删除成功')
+      }).catch(() => {
+      })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams
+      this.$modal.confirm('是否确认导出所有礼品登记数据项?').then(() => {
+        this.exportLoading = true
+        return exportGift(queryParams)
+      }).then(response => {
+        this.$download.name(response.msg)
+        this.exportLoading = false
+      }).catch(() => {
+      })
+    }
+  }
+}
+</script>

+ 16 - 16
willalp-ui/src/views/canteen/gift/order/detail/index.vue

@@ -1,20 +1,20 @@
 <template>
   <div class="app-container">
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          :loading="exportLoading"
-          @click="handleExport"
-          v-hasPermi="['canteen:detail:export']"
-        >导出
-        </el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
+<!--    <el-row :gutter="10" class="mb8">-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="warning"-->
+<!--          plain-->
+<!--          icon="el-icon-download"-->
+<!--          size="mini"-->
+<!--          :loading="exportLoading"-->
+<!--          @click="handleExport"-->
+<!--          v-hasPermi="['canteen:detail:export']"-->
+<!--        >导出-->
+<!--        </el-button>-->
+<!--      </el-col>-->
+<!--      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
+<!--    </el-row>-->
 
     <el-table v-loading="loading" :data="detailList" @selection-change="handleSelectionChange"
               :show-summary="true">
@@ -74,7 +74,7 @@
 </template>
 
 <script>
-import {listDetail, getDetail, delDetail, addDetail, updateDetail, exportDetail} from "@/api/canteen/giftDetail";
+import {listDetail, getDetail, delDetail, addDetail, updateDetail, exportDetail,shopOrderStat} from "@/api/canteen/giftDetail";
 
 export default {
   name: "Detail",

+ 144 - 62
willalp-ui/src/views/canteen/gift/order/index.vue

@@ -11,6 +11,26 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="订单类型" prop="placeNumber">
+        <el-select v-model="queryParams.zfbz" placeholder="请选择订单类型" clearable size="small">
+          <el-option
+            v-for="item in [{label:'预定兑换',id:1},{label:'现场兑换',id:2}]"
+            :key="item.id"
+            :label="item.label"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="领取地点" prop="placeNumber">
+        <el-select v-model="queryParams.placeNumber" placeholder="请选择领取地点" clearable size="small">
+          <el-option
+            v-for="item in placeList"
+            :key="item.placeName"
+            :label="item.placeName"
+            :value="item.placeName"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="订单编号" prop="orderNumber">
         <el-input
           v-model="queryParams.orderNumber"
@@ -20,16 +40,16 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <!--      <el-form-item label="用户姓名" prop="nickName">-->
-      <!--        <el-input-->
-      <!--          v-model="queryParams.nickName"-->
-      <!--          placeholder="请输入用户姓名"-->
-      <!--          clearable-->
-      <!--          size="small"-->
-      <!--          @keyup.enter.native="handleQuery"-->
-      <!--        />-->
-      <!--      </el-form-item>-->
-      <el-form-item label="付款时间">
+      <el-form-item label="姓名" prop="nickName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="下单时间">
         <el-date-picker
           v-model="daterangePaytime"
           size="small"
@@ -56,7 +76,7 @@
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
-    <el-row :gutter="10" class="mb8">
+    <el-row :gutter="5" class="mb8">
       <el-col :span="16">
         <el-card class="box-card">
           <el-row :gutter="10" class="mb8">
@@ -72,46 +92,45 @@
               >导出
               </el-button>
             </el-col>
+            <el-col :span="1.5">
+              <el-button
+                type="warning"
+                plain
+                icon="el-icon-sold-out"
+                size="mini"
+                :loading="exportLoading"
+                @click="shopOrderSata"
+              >订购统计
+              </el-button>
+            </el-col>
             <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
           </el-row>
           <el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange"
                     @row-click="openUpdaetText">
             <el-table-column type="selection" width="55" align="center"/>
             <el-table-column label="订单编号" align="center" prop="orderNumber" width="110"/>
-            <el-table-column label="用户编码" align="center" prop="userNumber"/>
-            <el-table-column label="交易时间" align="center" prop="paytime" width="95">
+            <el-table-column label="用户编号" align="center" prop="userNumber"/>
+            <el-table-column label="姓名" align="center" prop="userName"/>
+            <el-table-column label="手机号" align="center" prop="phone"/>
+            <el-table-column label="活动名称" align="center" prop="eventName"/>
+            <el-table-column label="订单类型" align="center" prop="bfbz">
               <template slot-scope="scope">
-                <span>{{ parseTime(scope.row.paytime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+                <span v-if="scope.row.zfbz === 1">
+                  预定兑换
+                </span>
+                <span v-if="scope.row.zfbz === 2">
+                  现场兑换
+                </span>
               </template>
             </el-table-column>
             <el-table-column label="订单总额" align="center" prop="orderTotal"/>
-            <el-table-column label="用户名称" align="center" prop="userName"/>
-            <el-table-column label="手机号" align="center" prop="phone"/>
-            <el-table-column label="地址" align="center" prop="placeNumber"/>
-            <el-table-column label="订单状态" align="center" prop="statusText"/>
-            <el-table-column label="" align="center" prop="isNewsUser">
+            <el-table-column label="下单时间" align="center" prop="paytime" width="95">
               <template slot-scope="scope">
-                <el-tag v-if="scope.row.isNewsUser === '1'" type="success">新消息</el-tag>
+                <span>{{ parseTime(scope.row.paytime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
               </template>
             </el-table-column>
-            <!--            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
-            <!--              <template slot-scope="scope">-->
-            <!--                <el-button v-if="scope.row.zfbz!==3"-->
-            <!--                           size="mini"-->
-            <!--                           type="text"-->
-            <!--                           icon="el-icon-circle-ok"-->
-            <!--                           @click="takeOrder(scope.row,'已接单')"-->
-            <!--                >接单-->
-            <!--                </el-button>-->
-            <!--                &lt;!&ndash;              <el-button v-if="scope.row.zfbz!==3"&ndash;&gt;-->
-            <!--                &lt;!&ndash;                         size="mini"&ndash;&gt;-->
-            <!--                &lt;!&ndash;                         type="text"&ndash;&gt;-->
-            <!--                &lt;!&ndash;                         icon="el-icon-circle-ok"&ndash;&gt;-->
-            <!--                &lt;!&ndash;                         &ndash;&gt;-->
-            <!--                &lt;!&ndash;              >进度记录&ndash;&gt;-->
-            <!--                &lt;!&ndash;              </el-button>&ndash;&gt;-->
-            <!--              </template>-->
-            <!--            </el-table-column>-->
+            <el-table-column label="领取地点" align="center" prop="placeNumber"/>
+            <el-table-column label="领取时间" align="center" prop="eventTime"/>
           </el-table>
           <pagination
             v-show="total>0"
@@ -130,7 +149,40 @@
         </el-card>
       </el-col>
     </el-row>
-    <el-dialog :title="title" :visible.sync="openText" width="800px" append-to-body @cancel="cancel">
+    <el-dialog :title="shopOrderSataForm.title" :visible.sync="shopOrderSataForm.open" width="800px" append-to-body
+               @cancel="cancel">
+      <el-row :gutter="10" class="mb8">
+        <el-col :span="1.5">
+          <el-select v-model="shopOrderSataForm.eventId" placeholder="请选择活动列表" clearable size="small">
+            <el-option
+              v-for="item in eventList"
+              :key="item.id"
+              :label="item.eventName"
+              :value="item.id"
+            />
+          </el-select>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleShopOrderQuery">查询</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button
+            type="warning"
+            plain
+            icon="el-icon-download"
+            size="mini"
+            :loading="shopOrderSataForm.exportLoading"
+            @click="doShopOrderStatExport"
+          >导出
+          </el-button>
+        </el-col>
+      </el-row>
+      <el-table v-loading="shopOrderSataForm.loading" :data="shopOrderSataForm.list">
+        <el-table-column label="礼品名称" align="center" prop="giftName" width="200"/>
+        <el-table-column label="数量" align="center" prop="amount"/>
+        <el-table-column label="单价" align="center" prop="price"/>
+        <el-table-column label="总价" align="center" prop="total"/>
+      </el-table>
     </el-dialog>
   </div>
 </template>
@@ -143,15 +195,17 @@ import {
   delOrder,
   updateOrder,
   exportOrder,
-  tjdcExport,
   backOrder,
   partbackOrder,
   payMiwp, takeOrder
 } from '@/api/canteen/giftOrder'
+import { integralExchangeGetPlace } from '@/api/canteen/place'
 
-import {listEvent} from "@/api/eventConfig/event";
+import { shopOrderStat, shopOrderStatExport } from '@/api/canteen/giftDetail'
+import { listEvent } from '@/api/eventConfig/event'
 // import OrderProcess from "../../service/orderProcess";
-import Detail from "./detail";
+import Detail from './detail'
+import result from '@/components/Crontab/result'
 
 export default {
   name: 'Order',
@@ -163,17 +217,20 @@ export default {
   data() {
     return {
       tableHeight: document.documentElement.scrollHeight - 345 + 'px',
-      tjdcOpen: false,
-      tjdc: {
-        tjdcMenuCode: '',
-        tjdcTiele: ''
+      shopOrderSataForm: {
+        open: false,
+        loading: false,
+        title: '订购统计信息',
+        exportLoading: false,
+        eventId: null,
+        list: []
       },
       eventList: [],
+      placeList: [],
       orderNo: '',
       openText: false,
       text: '',
       userList: [],
-      tjdcList: [],
       menus: [],
       wrong: false,
       search: '',
@@ -197,8 +254,6 @@ export default {
       title: '',
       // 是否显示弹出层
       open: false,
-      // 作废标志时间范围
-      daterangePaytime: [],
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -214,7 +269,7 @@ export default {
         // patternId: null,
         // consumerType: null,
         paytime: new Date(),
-        zfbz: null,
+        zfbz: 1,
         jgid: null,
         orderNo: ''
       },
@@ -233,15 +288,28 @@ export default {
   created() {
     this.getList()
     this.getListEvent()
+    this.getIntegralExchangeGetPlace()
     //this.getPlaceList()
     //this.queryNickName()
   },
   methods: {
+    getSOStat() {
+      this.shopOrderSataForm.loading = true
+      shopOrderStat(this.shopOrderSataForm.eventId).then(result => {
+        if (result.code === 200) {
+          this.shopOrderSataForm.list = result.data
+        }
+        this.shopOrderSataForm.loading = false
+      })
+    },
+    getIntegralExchangeGetPlace() {
+      integralExchangeGetPlace().then(result => {
+        this.placeList = result.data
+      })
+    },
     openUpdaetText(row, column, event) {
-      //this.openText = true
       this.orderNo = row.orderNumber
       setTimeout(() => {
-        // this.$refs.orderPro.getList()
         this.$refs.detail.getList()
       }, 200)
       row.isNewsUser = '0'
@@ -251,7 +319,7 @@ export default {
       this.form.cardCode = this.text
       takeOrder(this.form).then(re => {
         if (re.code === 200) {
-          this.$modal.msgSuccess('更新成功');
+          this.$modal.msgSuccess('更新成功')
           this.getList()
         }
       })
@@ -259,17 +327,17 @@ export default {
     },
     takeOrder(data, text) {
       if (data.zfbz === 2) {
-        this.$modal.msgError('请勿重复接单');
+        this.$modal.msgError('请勿重复接单')
         return
       }
-      this.$modal.confirm('确认是否接单?').then(function () {
+      this.$modal.confirm('确认是否接单?').then(function() {
         data.statusText = text
         return takeOrder(data)
       }).then(() => {
-        this.$modal.msgSuccess('接单成功');
+        this.$modal.msgSuccess('接单成功')
         this.getList()
       }).catch(() => {
-      });
+      })
     },
     jcdChang(val) {
       this.form.placeName = val.placeName
@@ -321,7 +389,7 @@ export default {
     // 取消按钮
     cancel() {
       this.open = false
-      this.openText = false;
+      this.openText = false
       this.wrong = false
       this.getList()
       this.reset()
@@ -346,6 +414,10 @@ export default {
       }
       this.resetForm('form')
     },
+    /** 查询订购统计按钮操作 */
+    handleShopOrderQuery() {
+      this.getSOStat()
+    },
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1
@@ -404,7 +476,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const orderIds = row.orderId || this.ids
-      this.$modal.confirm('是否确认删除食堂订单编号为"' + orderIds + '"的数据项?').then(function () {
+      this.$modal.confirm('是否确认删除食堂订单编号为"' + orderIds + '"的数据项?').then(function() {
         return delOrder(orderIds)
       }).then(() => {
         this.getList()
@@ -415,7 +487,7 @@ export default {
     /** 作废按钮操作 */
     handleBack(row) {
       const orderIds = row.orderId || this.ids
-      this.$modal.confirm('是否作废食堂订单编号为"' + orderIds + '"的数据项?').then(function () {
+      this.$modal.confirm('是否作废食堂订单编号为"' + orderIds + '"的数据项?').then(function() {
         return backOrder(row)
       }).then(() => {
         this.getList()
@@ -451,7 +523,17 @@ export default {
         }
       })
     },
-
+    shopOrderSata() {
+      this.shopOrderSataForm.open = true
+    },
+    doShopOrderStatExport() {
+      this.shopOrderSataForm.exportLoading = true
+      shopOrderStatExport(this.shopOrderSataForm.eventId).then(response => {
+        this.$download.name(response.msg)
+        this.shopOrderSataForm.exportLoading = false
+      }).catch(() => {
+      })
+    },
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams
@@ -463,7 +545,7 @@ export default {
         this.exportLoading = false
       }).catch(() => {
       })
-    },
+    }
     // orgFormatter(val) {
     //   let name = ''
     //     if (item.deptCode == val) {

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

@@ -425,7 +425,7 @@
       <jcdStat ref="jcdStat" :menuNumber="tjdc.tjdcMenuCode"></jcdStat>
     </el-dialog>
 
-    <el-dialog title="月度统计" :visible.sync="monthJctj" width="900px" append-to-body>
+    <el-dialog title="月度统计" :visible.sync="monthJctj" :fullscreen="true" append-to-body>
       <jcdMonthlyStat ref="jcdStat" :menuNumber="tjdc.tjdcMenuCode"></jcdMonthlyStat>
     </el-dialog>
   </div>

+ 95 - 8
willalp-ui/src/views/canteen/order/jcdMonthlyStat.vue

@@ -14,19 +14,56 @@
           placeholder="选择月">
         </el-date-picker>
       </div>
+      <el-row :gutter="20">
+        <el-col :span="1.5">
+          <el-card shadow="hover">
+            <el-table :data="list.place" v-loading="loading" :show-summary="true">
+              <el-table-column label="就餐地" align="center" prop="placeName" width="120"/>
+              <el-table-column label="订单总数" align="center" prop="count" width="95"/>
+              <el-table-column label="事业编群" align="center" prop="sybq" width="95"/>
+              <el-table-column label="非事业编群" align="center" prop="fsybq" width="95"/>
+              <el-table-column label="第三方劳务外包" align="center" prop="dsflwwb" width="120"/>
+            </el-table>
+          </el-card>
+        </el-col>
+        <el-col :span="1.5">
+          <el-card shadow="hover">
+            <div style="padding: 5px">
+              <el-button
+                type="warning"
+                plain
+                icon="el-icon-download"
+                size="mini"
+                :loading="exportLoading"
+                @click="download"
+              >导出
+              </el-button>
+            </div>
+            <div style="padding: 5px">
+              <el-table :data="list2" v-loading="loading2">
+                <el-table-column label="用户编号" align="center" prop="userNumber" width="95"/>
+                <el-table-column label="用户名" align="center" prop="nickName" width="95"/>
+                <el-table-column label="用户类型" align="center" prop="userTypeTitle" width="95"/>
+                <el-table-column label="订单总数" align="center" prop="count" width="95"/>
+                <el-table-column label="消费总额" align="center" prop="sumTotal" width="95"/>
+              </el-table>
+              <pagination
+                v-show="useMoneyParams.total>0"
+                :total="useMoneyParams.total"
+                :page.sync="useMoneyParams.pageNum"
+                :limit.sync="useMoneyParams.pageSize"
+                @pagination="getUseMoney"
+              />
+            </div>
+          </el-card>
+        </el-col>
+      </el-row>
     </div>
-    <el-table :data="list.place" v-loading="loading">
-      <el-table-column label="就餐地" align="center" prop="placeName"/>
-      <el-table-column label="订单总数" align="center" prop="count"/>
-      <el-table-column label="事业编群" align="center" prop="sybq"/>
-      <el-table-column label="非事业编群" align="center" prop="fsybq"/>
-      <el-table-column label="第三方劳务外包" align="center" prop="dsflwwb"/>
-    </el-table>
   </div>
 </template>
 
 <script>
-import { jdcMonthTj } from '@/api/canteen/order'
+import {jdcMonthTj, useMoneyMonthTj, useMoneyMonthTjExport} from '@/api/canteen/order'
 
 export default {
   name: 'jcdStat',
@@ -39,15 +76,45 @@ export default {
   data() {
     return {
       list: [],
+      list2: [],
+      list2Data: [],
+      useMoneyParams: {
+        total: 0,
+        pageNum: 1,
+        pageSize: 10
+      },
       loading: false,
+      loading2: false,
+      exportLoading: false,
       value2: ''
     }
   },
   create() {
   },
   methods: {
+    download() {
+      this.exportLoading = true
+      let params = {
+        year: 1900 + this.value2.getYear(),
+        month: (this.value2.getMonth() + 1)
+      }
+      useMoneyMonthTjExport(params).then(response => {
+        this.$download.name(response.msg)
+        this.exportLoading = false
+      }).catch(() => {
+      })
+    },
+    getUseMoney() {
+      let i = (this.useMoneyParams.pageNum - 1) * this.useMoneyParams.pageSize
+      let copyList = []
+      for (let j = i; j < i + this.useMoneyParams.pageSize; j++) {
+        copyList.push(this.list2Data[j])
+      }
+      this.list2 = copyList;
+    },
     getMonthJcdTj() {
       this.loading = true
+      this.loading2 = true
       let params = {
         year: 1900 + this.value2.getYear(),
         month: (this.value2.getMonth() + 1)
@@ -61,6 +128,26 @@ export default {
         } else {
           this.loading = false
         }
+      }).catch(() => {
+        this.loading = false
+      }).finally(() => {
+        this.loading = false
+      })
+      useMoneyMonthTj(params).then(result => {
+        if (result.code === 200) {
+          if (result.data) {
+            this.list2Data = result.data
+            this.useMoneyParams.total = this.list2Data.length
+            this.getUseMoney()
+            this.loading2 = false
+          }
+        } else {
+          this.loading2 = false
+        }
+      }).catch(error => {
+        this.loading2 = false
+      }).finally(() => {
+        this.loading2 = false
       })
     }
   }

+ 1 - 1
willalp-ui/src/views/canteen/order/jcdStat.vue

@@ -8,7 +8,7 @@
         {{ list.menuName }}
       </div>
     </div>
-    <el-table :data="list.place" v-loading="loading">
+    <el-table :data="list.place" v-loading="loading" :show-summary="true">
       <el-table-column label="就餐地" align="center" prop="placeName"/>
       <el-table-column label="订单总数" align="center" prop="count"/>
       <el-table-column label="事业编群" align="center" prop="sybq"/>

+ 2 - 2
willalp-ui/src/views/clockingin/time/index.vue

@@ -232,7 +232,7 @@
 </template>
 
 <script>
-import { listTime, getTime, delTime, addTime, updateTime, exportTime } from "@/api/clockingin/time";
+import { listTime, eventTime, delTime, addTime, updateTime, exportTime } from "@/api/clockingin/time";
 
 export default {
   name: "Time",
@@ -342,7 +342,7 @@ export default {
     handleUpdate(row) {
       this.reset();
       const vacateId = row.vacateId || this.ids
-      getTime(vacateId).then(response => {
+      eventTime(vacateId).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改请假时间记录";

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

@@ -29,13 +29,13 @@
           @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">-->
@@ -120,7 +120,7 @@
           <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="eventTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.eventTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
@@ -198,13 +198,13 @@
             placeholder="选择开始时间">
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="事件时间" prop="eventTime">
+        <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="endTime">
@@ -349,7 +349,7 @@ export default {
     },
     bindingGiftChild(row) {
       this.id = row.id;
-      this.$parent.$parent.bindingGift();
+      this.$parent.$parent.getBindingList();
     },
     /** 搜索按钮操作 */
     handleQuery() {

+ 0 - 17
willalp-ui/src/views/files/files/index.vue

@@ -92,15 +92,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="身份证号" prop="idCard">
-        <el-input
-          v-model="queryParams.idCard"
-          placeholder="请输入身份证号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
       <el-form-item label="取得职称" prop="jobTitle">
         <el-select v-model="queryParams.jobTitle" placeholder="请选择取得职称">
           <el-option
@@ -263,7 +254,6 @@
       <el-table-column label="籍贯" align="center" prop="origo"/>
       <el-table-column label="政治面貌" align="center" prop="politicsStatus"/>
       <el-table-column label="文化程度" align="center" prop="educationalLevel"/>
-      <el-table-column label="身份证号" align="center" prop="idCard"/>
       <el-table-column label="生日" align="center" prop="birthday" width="180"/>
       <el-table-column label="居住地" align="center" prop="residence"/>
       <el-table-column label="联系电话" align="center" prop="phone"/>
@@ -383,13 +373,6 @@
                 </el-form-item>
               </div>
             </el-col>
-            <el-col :span="6">
-              <div class="grid-content bg-purple">
-                <el-form-item label="身份证号" prop="idCard">
-                  <el-input v-model="form.idCard" placeholder="请输入身份证号"/>
-                </el-form-item>
-              </div>
-            </el-col>
             <el-col :span="6">
               <div class="grid-content bg-purple">
                 <el-form-item label="生日" prop="birthday">

+ 8 - 7
willalp-ui/src/views/integral/integral/change.vue

@@ -291,39 +291,40 @@ export default {
     orgFormatter(val) {
       let name = '';
       user.state.organDicts.forEach(item => {
-        if (item.deptCode == val) {
+        if (item.deptCode === val) {
           name = item.deptName;
         }
       })
       return name;
     },
     changeType(v) {
-      if (v == 1) {
+      if (v === '1') {
         this.handleImport();
         this.ifErrorReturn = false;
-      } else if (v == 5) {
+      } else if (v === '5') {
         this.ifErrorReturn = true;
         this.getFinishOrder()
       } else {
         this.ifErrorReturn = false;
       }
+      this.$forceUpdate()
     },
     cancelTemplate() {
       this.upload.open = false;
       this.form.moneyType = '2';
     },
     changeRadio(val) {
-      if (val == "1") {
+      if (val === "1") {
         this.selectArr = this.rechargeArr;
-        this.form.moneyType = null;
+        this.form.moneyType = '';
         this.ifErrorReturn = false;
       } else {
         this.selectArr = this.returnArr;
-        this.form.moneyType = null;
+        this.form.moneyType = '';
       }
     },
     getFinishOrder() {
-      if (this.form.moneyType == 5 && this.form.nickName != null && this.form.nickName != '') {
+      if (this.form.moneyType === 5 && this.form.nickName != null && this.form.nickName !== '') {
         getFinishOrder({userNumber: this.form.loginName, jgid: this.form.organizationCode}).then(response => {
           this.orderList = response.data;
         })

+ 1 - 0
willalp-ui/src/views/leave/leave/index.vue

@@ -58,6 +58,7 @@
         </template>
       </el-table-column>
       <el-table-column label="标题" align="center" prop="title" width="140"/>
+      <el-table-column label="天数" align="center" prop="totalTime"/>
       <el-table-column label="原因" align="center" prop="reason" width="120"/>
       <el-table-column label="开始时间" align="center" prop="leaveStartTime" width="120">
         <template slot-scope="scope">

+ 1 - 0
willalp-ui/src/views/leave/leave/indexPre.vue

@@ -60,6 +60,7 @@
           <span>{{ parseTime(scope.row.leaveEndTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
+      <el-table-column label="天数" align="center" prop="totalTime"/>
       <!--<el-table-column label="请假时长" align="center" prop="totalTime" />-->
       <!--      <el-table-column label="流程实例ID" align="center" prop="instanceId"/>-->
       <el-table-column label="申请人" align="center" prop="applyUserName"/>