Bläddra i källkod

添加,预定订餐后台按菜单,按月份统计功能,导出所有用户实时余额

xianwait 2 år sedan
förälder
incheckning
d8293040db
27 ändrade filer med 520 tillägg och 168 borttagningar
  1. 1 0
      .gitignore
  2. 5 1
      willalp-admin/src/main/java/com/willalp/web/controller/app/AppController.java
  3. 18 0
      willalp-admin/src/main/java/com/willalp/web/controller/canteen/HsCanteenOrderController.java
  4. 0 7
      willalp-admin/src/main/java/com/willalp/web/controller/clockingin/FileApprovalController.java
  5. 1 1
      willalp-admin/src/main/java/com/willalp/web/controller/common/CommonController.java
  6. 15 2
      willalp-admin/src/main/java/com/willalp/web/controller/integral/IntegralController.java
  7. 2 0
      willalp-admin/src/main/java/com/willalp/web/controller/news/HsAppHomeDataController.java
  8. 1 1
      willalp-admin/src/main/resources/logback.xml
  9. 16 0
      willalp-canteen/src/main/java/com/willalp/canteen/service/IHsCanteenOrderService.java
  10. 98 3
      willalp-canteen/src/main/java/com/willalp/canteen/service/impl/HsCanteenOrderServiceImpl.java
  11. 14 14
      willalp-clocking-in/src/main/java/com/willalp/flow/mapper/xml/HsFlowRunningRecordMapper.xml
  12. 12 9
      willalp-clocking-in/src/main/java/com/willalp/flow/service/impl/HsFlowEngineServiceImpl.java
  13. 5 2
      willalp-clocking-in/src/main/java/com/willalp/msg/service/impl/HsAppUserMsgServiceImpl.java
  14. 41 0
      willalp-integral/src/main/java/com/willalp/integral/domain/excelVo/IntegralVo2.java
  15. 2 2
      willalp-integral/src/main/java/com/willalp/integral/mapper/IntegralMapper.java
  16. 2 1
      willalp-integral/src/main/java/com/willalp/integral/mapper/xml/IntegralMapper.xml
  17. 2 1
      willalp-integral/src/main/java/com/willalp/integral/service/IIntegralService.java
  18. 2 1
      willalp-integral/src/main/java/com/willalp/integral/service/impl/IntegralServiceImpl.java
  19. 16 0
      willalp-ui/src/api/canteen/order.js
  20. 7 0
      willalp-ui/src/api/integral/integral.js
  21. 1 1
      willalp-ui/src/components/Editor/index.vue
  22. 1 1
      willalp-ui/src/components/ImageUpload/index.vue
  23. 51 25
      willalp-ui/src/views/canteen/order/index.vue
  24. 72 0
      willalp-ui/src/views/canteen/order/jcdMonthlyStat.vue
  25. 58 0
      willalp-ui/src/views/canteen/order/jcdStat.vue
  26. 14 11
      willalp-ui/src/views/files/approval/index.vue
  27. 63 85
      willalp-ui/src/views/integral/integral/refundIndex.vue

+ 1 - 0
.gitignore

@@ -42,3 +42,4 @@ nbdist/
 !*/build/*.java
 !*/build/*.html
 !*/build/*.xml
+/package-lock.json

+ 5 - 1
willalp-admin/src/main/java/com/willalp/web/controller/app/AppController.java

@@ -515,7 +515,8 @@ public class AppController extends BaseController {
             consumeMaintain.setMenuNumber(order.getMenuNumber());
             List<ConsumeMaintain> cons = new ArrayList<>();
             cons = consumeMaintainService.selectConsumeMaintainList(consumeMaintain);
-            if (cons.size() > 0) {//有限制
+            //有限制
+            if (cons.size() > 0) {
                 consumeMaintain = cons.get(0);
                 String begin = DateUtils.parseDateToStr("yyyy-MM-dd", consumeMaintain.getSendTime()) + " " + consumeMaintain.getBeginDate() + ":00";
                 String end = DateUtils.parseDateToStr("yyyy-MM-dd", consumeMaintain.getSendTime()) + " " + consumeMaintain.getEndDate() + ":00";
@@ -523,6 +524,9 @@ public class AppController extends BaseController {
                     return AjaxResult.error("订单已过可退时间,请联系管理员");
                 }
             }
+//            else {
+//                throw new BaseException("未找到对应菜单信息");
+//            }
             //处理订单信息
             if (order.getZfbz() == 1) {
                 return AjaxResult.error("该订单已作废,不可重复作废");

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

@@ -57,6 +57,24 @@ public class HsCanteenOrderController extends BaseController {
                 hsCanteenOrderService.getTheMenuItemsAndQuantitiesPerPerson(tjdcMenuCode));
     }
 
+    /**
+     * 查询食堂订单统计采购列表
+     */
+    @GetMapping("/jdcTj")
+    public AjaxResult jdcTj(String menuCode) {
+        return AjaxResult.success(
+                hsCanteenOrderService.jcdStat(menuCode));
+    }
+
+    /**
+     * 查询食堂订单统计采购列表
+     */
+    @GetMapping("/jdcMonthTj")
+    public AjaxResult jdcMonthTj(int year,int month) {
+        return AjaxResult.success(
+                hsCanteenOrderService.jcdMonthStat(year, month));
+    }
+
     /**
      * 导出食堂订单统计采购列表
      */

+ 0 - 7
willalp-admin/src/main/java/com/willalp/web/controller/clockingin/FileApprovalController.java

@@ -18,7 +18,6 @@ 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 org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -53,7 +52,6 @@ public class FileApprovalController extends BaseController {
     /**
      * 查询文件审批业务列表
      */
-    @PreAuthorize("@ss.hasPermi('flow:accessory:list')")
     @GetMapping("/list")
     public TableDataInfo list(FileApproval fileApproval) {
         startPage();
@@ -64,7 +62,6 @@ public class FileApprovalController extends BaseController {
     /**
      * 导出文件审批业务列表
      */
-    @PreAuthorize("@ss.hasPermi('flow:accessory:export')")
     @Log(title = "文件审批业务", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(FileApproval fileApproval) {
@@ -76,7 +73,6 @@ public class FileApprovalController extends BaseController {
     /**
      * 获取文件审批业务详细信息
      */
-    @PreAuthorize("@ss.hasPermi('flow:accessory:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(fileApprovalService.getById(id));
@@ -85,7 +81,6 @@ public class FileApprovalController extends BaseController {
     /**
      * 新增文件审批业务
      */
-    @PreAuthorize("@ss.hasPermi('flow:accessory:add')")
     @Log(title = "文件审批业务", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody FileApprovalVo fileApprovalVo) {
@@ -114,7 +109,6 @@ public class FileApprovalController extends BaseController {
     /**
      * 修改文件审批业务
      */
-    @PreAuthorize("@ss.hasPermi('flow:accessory:edit')")
     @Log(title = "文件审批业务", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody FileApproval fileApproval) {
@@ -126,7 +120,6 @@ public class FileApprovalController extends BaseController {
     /**
      * 删除文件审批业务
      */
-    @PreAuthorize("@ss.hasPermi('flow:accessory:remove')")
     @Log(title = "文件审批业务", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable String[] ids) {

+ 1 - 1
willalp-admin/src/main/java/com/willalp/web/controller/common/CommonController.java

@@ -71,7 +71,7 @@ public class CommonController {
             String filePath = WillalpConfig.getUploadPath();
             // 上传并返回新文件名称
             String fileName = file.getOriginalFilename();
-            String url = serverConfig.getUrl() + FileUploadUtils.upload(filePath, file);
+            String url = FileUploadUtils.upload(filePath, file);
             AjaxResult ajax = AjaxResult.success();
             ajax.put("fileName", fileName);
             ajax.put("url", url);

+ 15 - 2
willalp-admin/src/main/java/com/willalp/web/controller/integral/IntegralController.java

@@ -1,5 +1,6 @@
 package com.willalp.web.controller.integral;
 
+import com.willalp.canteen.service.IIntegralSer2;
 import com.willalp.common.annotation.Log;
 import com.willalp.common.core.controller.BaseController;
 import com.willalp.common.core.domain.AjaxResult;
@@ -10,9 +11,9 @@ import com.willalp.common.enums.RechargeTypeEnum;
 import com.willalp.common.enums.ReturnEnum;
 import com.willalp.common.utils.DateUtils;
 import com.willalp.common.utils.poi.ExcelUtil;
-import com.willalp.canteen.service.IIntegralSer2;
 import com.willalp.integral.domain.Integral;
 import com.willalp.integral.domain.excelVo.IntegralVo;
+import com.willalp.integral.domain.excelVo.IntegralVo2;
 import com.willalp.integral.request.IntegralGroupQuery;
 import com.willalp.integral.service.IIntegralService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -136,10 +137,22 @@ public class IntegralController extends BaseController {
     @GetMapping("/groupList")
     public TableDataInfo groupList(IntegralGroupQuery integralGroupQuery) {
         startPage();
-        List<Integral> list = integralService.queryIntegralSum(integralGroupQuery);
+        List<IntegralVo2> list = integralService.queryIntegralSum(integralGroupQuery);
         return getDataTable(list);
     }
 
+    /**
+     * 导出所有用户余额
+     * */
+    @Log(title = "积分管理", businessType = BusinessType.EXPORT)
+    @GetMapping("/exportGroupList")
+    public AjaxResult exportGroupList(IntegralGroupQuery integralGroupQuery) {
+        List<IntegralVo2> list = integralService.queryIntegralSum(integralGroupQuery);
+        ExcelUtil<IntegralVo2> util = new ExcelUtil<>(IntegralVo2.class);
+        return util.exportExcel(list, "所有用户余额数据");
+    }
+
+
     @GetMapping("/getIntegralType")
     public AjaxResult getIntegralType() {
         Map result = new HashMap();

+ 2 - 0
willalp-admin/src/main/java/com/willalp/web/controller/news/HsAppHomeDataController.java

@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
+import java.util.Comparator;
 import java.util.List;
 
 /**
@@ -117,6 +118,7 @@ public class HsAppHomeDataController extends BaseController {
             }
             if (hsAppHomeDataService.removeByIds(ids)) {
                 JSONObject jsonObject1 = new JSONObject();
+                cacheList.sort(Comparator.comparing(HsAppHomeData::getUpdateTime).reversed());
                 jsonObject1.put("data", cacheList);
                 redisCache.setCacheObject(orgCode + "_HomeData", jsonObject1);
                 return AjaxResult.success();

+ 1 - 1
willalp-admin/src/main/resources/logback.xml

@@ -7,7 +7,7 @@
     <!-- 日志输出格式 -->
     <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
     <property name="CONSOLE_LOG_PATTERN"
-              value="%cyan([%thread]) %blue(%msg%n)"/>
+              value="%highlight(%date{yyyy-MM-dd HH:mm:ss.SSS}) %cyan([%thread]) %yellow(%-5level) %green(%logger{36}).%boldMagenta(%line) - %blue(%msg%n)"/>
     <!--value="%date{yyyy-MM-dd HH:mm:ss}|%highlight(%-5level)|%boldYellow(%thread)|%boldGreen(%logger)|%msg%n"/>
     %highlight(%date{yyyy-MM-dd HH:mm:ss.SSS}) %yellow(%-5level) %green(%logger{36}).%boldMagenta(%line) -->
 

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

@@ -26,6 +26,22 @@ public interface IHsCanteenOrderService extends IService<HsCanteenOrder> {
      */
     boolean payMiwp(HsCanteenOrder order);
 
+    /**
+     *
+     * @return
+     * @param menuCode
+     */
+    Object jcdStat(String menuCode);
+
+    /**
+     * 月度就餐地统计
+     *
+     * @return
+     * @param year
+     * @param month
+     */
+    Object jcdMonthStat(int year,int month);
+
     /**
      * 获取该菜单每人菜品和数量
      *

+ 98 - 3
willalp-canteen/src/main/java/com/willalp/canteen/service/impl/HsCanteenOrderServiceImpl.java

@@ -3,21 +3,23 @@ package com.willalp.canteen.service.impl;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.willalp.canteen.domain.HsCanteenCuisine;
-import com.willalp.canteen.domain.HsCanteenOrder;
-import com.willalp.canteen.domain.HsCanteenOrderDetail;
+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.MenuCountVo;
 import com.willalp.canteen.mapper.HsCanteenOrderMapper;
+import com.willalp.canteen.service.IHsCanteenDiningPlaceService;
+import com.willalp.canteen.service.IHsCanteenMenuService;
 import com.willalp.canteen.service.IHsCanteenOrderDetailService;
 import com.willalp.canteen.service.IHsCanteenOrderService;
 import com.willalp.common.core.domain.AjaxResult;
 import com.willalp.common.enums.ConsumeChangeEnum;
 import com.willalp.common.enums.NumberRuleEnum;
+import com.willalp.common.enums.SysOrgCodeEnum;
 import com.willalp.common.exception.base.BaseException;
 import com.willalp.common.utils.DateUtils;
 import com.willalp.common.utils.SecurityUtils;
@@ -65,6 +67,15 @@ public class HsCanteenOrderServiceImpl extends ServiceImpl<HsCanteenOrderMapper,
     @Autowired
     ISysUserOrganizationService sysUserOrganizationService;
 
+    @Resource
+    private IHsCanteenMenuService menuService;
+
+    @Resource
+    private IHsCanteenDiningPlaceService diningPlaceService;
+
+    @Resource
+    private ISysUserOrganizationService userOrganizationService;
+
 
     @Transactional(rollbackFor = Exception.class)
     @Override
@@ -158,6 +169,90 @@ public class HsCanteenOrderServiceImpl extends ServiceImpl<HsCanteenOrderMapper,
         return true;
     }
 
+    @Override
+    public Object jcdStat(String menuCode) {
+        if (StringUtils.isBlank(menuCode)) {
+            throw new BaseException("菜单编号不能为空");
+        }
+        Map<String, Object> map = new HashMap<>();
+        HsCanteenMenu canteenMenu = menuService.getBaseMapper().selectOne(new QueryWrapper<HsCanteenMenu>().eq("menu_number", menuCode));
+        map.put("menuName", canteenMenu.getMenuName());
+        List<HsCanteenOrder> orders = baseMapper.selectList(new QueryWrapper<HsCanteenOrder>().eq("menu_number", menuCode));
+        return jcdTj(map, orders);
+    }
+
+    @Override
+    public Object jcdMonthStat(int year, int month) {
+        Map<String, Object> map = new HashMap<>();
+        List<HsCanteenOrder> orders = baseMapper.selectList(new QueryWrapper<HsCanteenOrder>()
+                .eq("YEAR(paytime) ", year)
+                .eq("MONTH(paytime)", month));
+        return jcdTj(map, orders);
+    }
+
+    private Map<String, Object> jcdTj(Map<String, Object> map, List<HsCanteenOrder> orders) {
+        if (0 == orders.size()) {
+            throw new BaseException("暂无统计数据");
+        }
+        List<HsCanteenDiningPlace> hsCanteenDiningPlaces = diningPlaceService.getBaseMapper().selectList(
+                new QueryWrapper<HsCanteenDiningPlace>()
+                        .eq("jgid", SysOrgCodeEnum.MLHuiZhuLi.getCode())
+                        .notIn("parent_id", 0));
+        if (0 == hsCanteenDiningPlaces.size()) {
+            throw new BaseException("暂无统计数据");
+        }
+        List<SysUserOrganization> sysUserOrganizations = userOrganizationService.getBaseMapper().selectList(
+                new QueryWrapper<SysUserOrganization>().eq("organization_code", SysOrgCodeEnum.MLHuiZhuLi.getCode()));
+        if (0 == sysUserOrganizations.size()) {
+            throw new BaseException("暂无统计数据");
+        }
+        List<Object> list = new ArrayList<>();
+        for (HsCanteenDiningPlace hsCanteenDiningPlace : hsCanteenDiningPlaces) {
+            Map<String, Object> mapJcd = new HashMap<String, Object>();
+            mapJcd.put("placeName", hsCanteenDiningPlace.getPlaceName());
+            //就餐地总数
+            List<HsCanteenOrder> jdcSumList = orders.stream().filter(o ->
+                    null != o.getPlaceNumber() &&
+                            o.getZfbz() != 1 &&
+                            o.getPlaceNumber().equals(hsCanteenDiningPlace.getPlaceNumber())).collect(Collectors.toList());
+            mapJcd.put("count", jdcSumList.size());
+            //用户类型计算
+            int sybq = 0;
+            int fsybq = 0;
+            int dsflwwb = 0;
+            for (HsCanteenOrder hsCanteenOrder : jdcSumList) {
+                for (SysUserOrganization userOrganization : sysUserOrganizations) {
+                    if (hsCanteenOrder.getUserNumber().equals(userOrganization.getLoginName()) &&
+                            hsCanteenOrder.getZfbz() != 1) {
+                        switch (userOrganization.getUserType()) {
+                            case "1":
+                                //事业编群
+                                sybq++;
+                                break;
+                            case "2":
+                                //非事业编群
+                                fsybq++;
+                                break;
+                            case "3":
+                            case "4":
+                                //第三方劳务外包
+                                dsflwwb++;
+                                break;
+                            default:
+                                break;
+                        }
+                    }
+                }
+            }
+            mapJcd.put("sybq", sybq);
+            mapJcd.put("fsybq", fsybq);
+            mapJcd.put("dsflwwb", dsflwwb);
+            list.add(mapJcd);
+        }
+        map.put("place", list);
+        return map;
+    }
+
     @Override
     public List<MenuCountVo> getTheMenuItemsAndQuantitiesPerPerson(String menuCode) {
         if (StringUtils.isBlank(menuCode)) {

+ 14 - 14
willalp-clocking-in/src/main/java/com/willalp/flow/mapper/xml/HsFlowRunningRecordMapper.xml

@@ -20,20 +20,20 @@
     </resultMap>
 
     <sql id="selectHsFlowRunningRecordVo">
-        select hfrr.id,
-               task_id,
-               base_id,
-               yes_or_no,
-               comment,
-               hopf.user_name operator,
-               hfrr.is_delete,
-               hfrr.create_by,
-               hfrr.create_time,
-               hfrr.update_by,
-               hfrr.update_time,
-               hfrr.remark
-        from hs_flow_running_record hfrr
-                 left join hs_org_personnel_files hopf on hopf.user_code = hfrr.operator
+            select hfrr.id,
+                   task_id,
+                   base_id,
+                   yes_or_no,
+                   comment,
+                   hopf.user_name operator,
+                   hfrr.is_delete,
+                   hfrr.create_by,
+                   hfrr.create_time,
+                   hfrr.update_by,
+                   hfrr.update_time,
+                   hfrr.remark
+            from hs_flow_running_record hfrr
+                     left join hs_org_personnel_files hopf on hopf.user_code = hfrr.operator
     </sql>
 
     <select id="selectHsFlowRunningRecordList" parameterType="HsFlowRunningRecord"

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

@@ -105,25 +105,28 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
     @Transactional(rollbackFor = Exception.class)
     @Override
     public int nextStep(FLowReq flow) {
-        if (StringUtils.isBlank(flow.getBaseId())) {
-            throw new BaseException("FLOW_BASE_ID - IS_NULL");
-        }
         if (StringUtils.isBlank(flow.getTaskId())) {
             throw new BaseException("FLOW_TASK_ID - IS_NULL");
         }
         if (StringUtils.isBlank(flow.getResult())) {
-            throw new BaseException("FLOW_TASK_ID - IS_NULL");
-        }
-        //获取当前基础组件
-        HsFlowBase hsFlowBase = hsFlowBaseMapper.selectById(flow.getBaseId());
-        if (null == hsFlowBase) {
-            throw new BaseException("没有找到组件");
+            throw new BaseException("FLOW_RESULT - IS_NULL");
         }
         //获取任务实例
         HsFlowTask hsFlowTask = hsFlowTaskMapper.selectById(flow.getTaskId());
         if (null == hsFlowTask) {
             throw new BaseException("没有找到任务实例");
         }
+        if ("1".equals(hsFlowTask.getIsEnd())) {
+            throw new BaseException("任务已结束");
+        }
+        if (StringUtils.isBlank(flow.getBaseId())) {
+            throw new BaseException("FLOW_BASE_ID - IS_NULL");
+        }
+        //获取当前基础组件
+        HsFlowBase hsFlowBase = hsFlowBaseMapper.selectById(flow.getBaseId());
+        if (null == hsFlowBase) {
+            throw new BaseException("没有找到组件");
+        }
         if (!SecurityUtils.getUsername().equals(hsFlowTask.getOperator())) {
             throw new BaseException("无操作权限");
         }

+ 5 - 2
willalp-clocking-in/src/main/java/com/willalp/msg/service/impl/HsAppUserMsgServiceImpl.java

@@ -65,6 +65,11 @@ public class HsAppUserMsgServiceImpl extends ServiceImpl<HsAppUserMsgMapper, HsA
                     case "4":
                         l4.add(i);
                         break;
+                    case "5":
+                        l1.add(i);
+                        break;
+                    default:
+                        break;
                 }
             });
             JSONObject jsonObject = new JSONObject();
@@ -75,8 +80,6 @@ public class HsAppUserMsgServiceImpl extends ServiceImpl<HsAppUserMsgMapper, HsA
             jsonObject.put("t4", l4.size());
             return jsonObject;
         }
-
-
         return null;
     }
 

+ 41 - 0
willalp-integral/src/main/java/com/willalp/integral/domain/excelVo/IntegralVo2.java

@@ -0,0 +1,41 @@
+package com.willalp.integral.domain.excelVo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.willalp.common.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 积分管理对象 pns_integral
+ *
+ * @author willalp
+ */
+
+@Data
+public class IntegralVo2 {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 用户编码
+     */
+    @Excel(name = "用户编码")
+    private String loginName;
+
+    /**
+     * 账户名称
+     */
+    @Excel(name = "账户名称")
+    private String nickName;
+
+
+    @TableField(exist = false)
+    @Excel(name = "手机号")
+    private String phonenumber;
+
+    /**
+     * 充值积分
+     */
+    @Excel(name = "充值积分")
+    private BigDecimal rechargeIntegral;
+
+}

+ 2 - 2
willalp-integral/src/main/java/com/willalp/integral/mapper/IntegralMapper.java

@@ -1,9 +1,9 @@
 package com.willalp.integral.mapper;
 
 
-
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.willalp.integral.domain.Integral;
+import com.willalp.integral.domain.excelVo.IntegralVo2;
 import com.willalp.integral.request.IntegralGroupQuery;
 import org.apache.ibatis.annotations.Param;
 
@@ -38,5 +38,5 @@ public interface IntegralMapper extends BaseMapper<Integral> {
      * @param integralGroupQuery
      * @return
      */
-    List<Integral> userBalances(IntegralGroupQuery integralGroupQuery);
+    List<IntegralVo2> userBalances(IntegralGroupQuery integralGroupQuery);
 }

+ 2 - 1
willalp-integral/src/main/java/com/willalp/integral/mapper/xml/IntegralMapper.xml

@@ -226,9 +226,10 @@
           and a.recharge_id = #{recharge_id}
           and a.organization_code = #{organizationCode}
     </select>
-    <select id="userBalances" resultType="com.willalp.integral.domain.Integral">
+    <select id="userBalances" resultType="com.willalp.integral.domain.excelVo.IntegralVo2">
         select suo.login_name,
         su.nick_name,
+        su.phonenumber phonenumber,
         suo.integral rechargeIntegral
         from sys_user_organization suo
         left join sys_user su on su.user_name = suo.login_name

+ 2 - 1
willalp-integral/src/main/java/com/willalp/integral/service/IIntegralService.java

@@ -4,6 +4,7 @@ package com.willalp.integral.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.willalp.integral.domain.Integral;
 import com.willalp.integral.domain.excelVo.IntegralVo;
+import com.willalp.integral.domain.excelVo.IntegralVo2;
 import com.willalp.integral.request.IntegralGroupQuery;
 
 import java.util.List;
@@ -31,7 +32,7 @@ public interface IIntegralService extends IService<Integral> {
 
     String importData(List<Integral> list);
 
-    List<Integral> queryIntegralSum(IntegralGroupQuery integralGroupQuery);
+    List<IntegralVo2> queryIntegralSum(IntegralGroupQuery integralGroupQuery);
 
     List<Map<String,Object>> getIntegralReportList(Map<String,Object> req);
 

+ 2 - 1
willalp-integral/src/main/java/com/willalp/integral/service/impl/IntegralServiceImpl.java

@@ -18,6 +18,7 @@ import com.willalp.files.domain.HsOrgPersonnelFiles;
 import com.willalp.files.mapper.HsOrgPersonnelFilesMapper;
 import com.willalp.integral.domain.Integral;
 import com.willalp.integral.domain.excelVo.IntegralVo;
+import com.willalp.integral.domain.excelVo.IntegralVo2;
 import com.willalp.integral.mapper.IntegralMapper;
 import com.willalp.integral.request.IntegralGroupQuery;
 import com.willalp.integral.service.IIntegralService;
@@ -239,7 +240,7 @@ public class IntegralServiceImpl extends ServiceImpl<IntegralMapper, Integral> i
     }
 
     @Override
-    public List<Integral> queryIntegralSum(IntegralGroupQuery integralGroupQuery) {
+    public List<IntegralVo2> queryIntegralSum(IntegralGroupQuery integralGroupQuery) {
         return integralMapper.userBalances(integralGroupQuery);
     }
 

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

@@ -18,7 +18,23 @@ export function tjdcList(query) {
   })
 }
 
+// 查询订单菜单统计
+export function jdcTj(query) {
+  return request({
+    url: '/canteen/order/jdcTj',
+    method: 'get',
+    params: query
+  })
+}
 
+// 查询订单月度统计
+export function jdcMonthTj(query) {
+  return request({
+    url: '/canteen/order/jdcMonthTj',
+    method: 'get',
+    params: query
+  })
+}
 // 查询食堂订单列表
 export function listOrder(query) {
   return request({

+ 7 - 0
willalp-ui/src/api/integral/integral.js

@@ -74,3 +74,10 @@ export function integralGroupList(query) {
     params: query
   })
 }
+export function importGroupList(query) {
+  return request({
+    url: '/pns/integral/exportGroupList',
+    method: 'get',
+    params: query
+  })
+}

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

@@ -178,7 +178,7 @@ export default {
         let length = quill.getSelection().index;
         // 插入图片  res.url为服务器返回的图片地址
         console.log(process.env.VUE_APP_BASE_API)
-        quill.insertEmbed(length, "image", "https://hzl.willalp.com:3005" + res.fileName);
+        quill.insertEmbed(length, "image", "https://hzl.willalp.com:3005" + res.url);
         // 调整光标到最后
         quill.setSelection(length + 1);
       } else {

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

@@ -124,7 +124,7 @@ export default {
     },
     // 上传成功回调
     handleUploadSuccess(res) {
-      this.fileList.push({ name: res.fileName, url: res.fileName });
+      this.fileList.push({ name: res.fileName, url: res.url });
       this.$emit("input", this.listToString(this.fileList));
       this.loading.close();
     },

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

@@ -126,30 +126,6 @@
         >后台点餐
         </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:order: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:order:remove']"-->
-      <!--        >删除-->
-      <!--        </el-button>-->
-      <!--      </el-col>-->
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -186,6 +162,26 @@
         >统计导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-data-line"
+          size="mini"
+          @click="clickJctj"
+        >菜单统计
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-data-line"
+          size="mini"
+          @click="clickMonthJctj"
+        >月度统计
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -424,6 +420,14 @@
       </el-table>
     </el-dialog>
 
+
+    <el-dialog title="就餐统计" :visible.sync="jctj" width="900px" append-to-body>
+      <jcdStat ref="jcdStat" :menuNumber="tjdc.tjdcMenuCode"></jcdStat>
+    </el-dialog>
+
+    <el-dialog title="月度统计" :visible.sync="monthJctj" width="900px" append-to-body>
+      <jcdMonthlyStat ref="jcdStat" :menuNumber="tjdc.tjdcMenuCode"></jcdMonthlyStat>
+    </el-dialog>
   </div>
 </template>
 
@@ -447,9 +451,15 @@ import {
 import user from '@/store/modules/user'
 import {addCuisineforMenu, miwp, listRegister, menus} from '@/api/canteen/register'
 import {queryUser} from '@/api/system/user'
+import jcdStat from "@/views/canteen/order/jcdStat";
+import jcdMonthlyStat from "@/views/canteen/order/jcdMonthlyStat";
 
 export default {
   name: 'Order',
+  components: {
+    jcdStat: jcdStat,
+    jcdMonthlyStat: jcdMonthlyStat
+  },
   dicts: ['consumption_period', 'consumption_pattern', 'consumption_period', 'yes_or_no', 'order_type', 'sys_normal_disable'],
   data() {
     return {
@@ -463,6 +473,8 @@ export default {
       tjdcList: [],
       menus: [],
       wrong: false,
+      jctj: false,
+      monthJctj: false,
       search: '',
       // 遮罩层
       loading: true,
@@ -573,6 +585,20 @@ export default {
         this.tjdcList = re.data
       })
     },
+    clickJctj() {
+      this.jctj = true
+      console.log(this.$refs);
+      setTimeout(() => {
+        this.$refs.jcdStat.getJcdTj()
+      }, 100)
+    },
+    clickMonthJctj() {
+      this.monthJctj = true
+      // console.log(this.$refs);
+      // setTimeout(() => {
+      //   this.$refs.jcdStat.getJcdTj()
+      // }, 100)
+    },
     changeMenu(val) {
       console.dir(val)
       if (val !== '') {
@@ -605,7 +631,7 @@ export default {
       this.queryParams.jgid = user.state.organ
       this.loading = true
       this.queryParams.params = {}
-      if (null != this.daterangePaytime && '' != this.daterangePaytime) {
+      if (null != this.daterangePaytime && '' !== this.daterangePaytime) {
         this.queryParams.params['beginPaytime'] = this.daterangePaytime[0]
         this.queryParams.params['endPaytime'] = this.daterangePaytime[1]
       }

+ 72 - 0
willalp-ui/src/views/canteen/order/jcdMonthlyStat.vue

@@ -0,0 +1,72 @@
+<template>
+  <div>
+    <div style="padding: 10px">
+      <div style="display: inline-flex;font-weight: bold">
+        月份:
+      </div>
+      <div style="display: inline-flex;padding: 10px 20px;">
+        <el-date-picker
+          @change="getMonthJcdTj"
+          v-model="value2"
+          format="yyyy-MM"
+          :default-value="new Date()"
+          type="month"
+          placeholder="选择月">
+        </el-date-picker>
+      </div>
+    </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'
+
+export default {
+  name: 'jcdStat',
+  props: {
+    menuNumber: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      list: [],
+      loading: false,
+      value2: ''
+    }
+  },
+  create() {
+  },
+  methods: {
+    getMonthJcdTj() {
+      this.loading = true
+      let params = {
+        year: 1900 + this.value2.getYear(),
+        month: (this.value2.getMonth() + 1)
+      }
+      jdcMonthTj(params).then(result => {
+        if (result.code === 200) {
+          if (result.data) {
+            this.list = result.data
+            this.loading = false
+          }
+        } else {
+          this.loading = false
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

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

@@ -0,0 +1,58 @@
+<template>
+  <div>
+    <div style="padding: 10px">
+      <div style="display: inline-flex;font-weight: bold">
+        菜单名:
+      </div>
+      <div style="display: inline-flex;background: #f3eeee;padding: 10px 20px;border-radius: 10px;color: #737476">
+        {{ list.menuName }}
+      </div>
+    </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 {jdcTj} from "@/api/canteen/order";
+
+export default {
+  name: "jcdStat",
+  props: {
+    menuNumber: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      list: [],
+      loading: false
+    }
+  },
+  create() {
+    this.jdcTj()
+  },
+  methods: {
+    getJcdTj() {
+      this.loading = true
+      let params = {
+        menuCode: this.menuNumber
+      }
+      jdcTj(params).then(result => {
+        this.list = result.data
+        this.loading = false
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 14 - 11
willalp-ui/src/views/files/approval/index.vue

@@ -55,7 +55,7 @@
             <el-form-item label="部门负责人审批" prop="applyUserName">
               <el-cascader ref="apply" @change="handleChange" :options="pcTreeList"
                            :props="{label:'text'}"
-                           :style="{width: '100%'}" v-model="applyUserName" placeholder="请选择级联选择" clearable>
+                           :style="{width: '100%'}" v-model="applyUserName" placeholder="请选择部门负责人" clearable>
               </el-cascader>
             </el-form-item>
             <div>
@@ -124,9 +124,9 @@ import { delResult } from '@/api/yiqing/result'
 export default {
   data() {
     return {
-      // baseUrl: 'https://hzl.willalp.com:3005',
-      // uploadImgUrl: 'https://hzl.willalp.com:3005/common/upload', // 上传的图片服务器地址
-      uploadImgUrl:  process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
+      baseUrl: 'https://hzl.willalp.com:3005',
+      uploadImgUrl: 'https://hzl.willalp.com:3005/common/upload', // 上传的图片服务器地址
+      // uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
       headers: {
         Authorization: 'Bearer ' + getToken()
       },
@@ -219,25 +219,28 @@ export default {
     // 上传成功回调
     handleUploadSuccess(res, file) {
       this.$message.success('上传成功')
-      this.form.fileList.push({ url: res.url, name: res.fileName })
+      this.form.fileList.push({ url: this.baseUrl + res.url, name: res.fileName })
     },
     handleImgUploadSuccess(res, file) {
       this.$message.success('上传成功')
-      this.form.imgList.push({ url: res.url, name: res.fileName })
+      this.form.imgList.push({ url: this.baseUrl + res.url, name: res.fileName })
     },
     /** 提交按钮 */
     submitForm() {
-      if (this.form.fileList.length === 0) {
-        this.$modal.msgError('请上传文件')
+      if (!this.form.title) {
+        this.$modal.msgError('标题不能为空')
         return
       }
-      if (this.form.imgList.length === 0) {
-        this.$modal.msgError('请上传图片')
+      if (!this.form.params) {
+        this.$modal.msgError('请选择部门负责人审批')
+        return
+      }
+      if (this.form.fileList.length === 0 && this.form.imgList.length === 0) {
+        this.$modal.msgError('文件和图片请至少上传其中一个')
         return
       }
       // this.form.imgList = JSON.stringify(this.form.imgList)
       // this.form.fileList = JSON.stringify(this.form.fileList)
-
       this.$refs['form'].validate(valid => {
         addAccessory(this.form).then(() => {
           this.reset()

+ 63 - 85
willalp-ui/src/views/integral/integral/refundIndex.vue

@@ -1,24 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
-      <!--      <el-form-item label="充值设备编码" prop="rechargeEquipmentCode">-->
-      <!--        <el-input-->
-      <!--          v-model="queryParams.rechargeEquipmentCode"-->
-      <!--          placeholder="请输入充值设备编码"-->
-      <!--          clearable-->
-      <!--          size="small"-->
-      <!--          @keyup.enter.native="handleQuery"-->
-      <!--        />-->
-      <!--      </el-form-item>-->
-      <!--      <el-form-item label="充值设备名称" prop="rechargeEquipmentName">-->
-      <!--        <el-input-->
-      <!--          v-model="queryParams.rechargeEquipmentName"-->
-      <!--          placeholder="请输入充值设备名称"-->
-      <!--          clearable-->
-      <!--          size="small"-->
-      <!--          @keyup.enter.native="handleQuery"-->
-      <!--        />-->
-      <!--      </el-form-item>-->
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
       <el-form-item label="用户编码" prop="loginName">
         <el-input
           v-model="queryParams.loginName"
@@ -43,36 +25,27 @@
       </el-form-item>
     </el-form>
 
-    <!--    <el-row :gutter="10" class="mb8">-->
-    <!--      <el-col :span="1.5">-->
-    <!--          <el-button-->
-    <!--            type="danger"-->
-    <!--            plain-->
-    <!--            icon="el-icon-delete"-->
-    <!--            size="mini"-->
-    <!--            :disabled="multiple"-->
-    <!--            @click="handleReturnPoints"-->
-    <!--            v-hasPermi="['pns:integral:returnPoints']"-->
-    <!--          >退还</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"
+        >导出
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
 
     <el-table v-loading="loading" :data="integralList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center"/>
-      <!--      <el-table-column label="金额类型" align="center" prop="moneyType" :formatter="typeFormat"/>-->
       <el-table-column label="用户编码" align="center" prop="loginName" width="200px"/>
       <el-table-column label="用户名称" align="center" prop="nickName" width="200px"/>
-      <!--      <el-table-column label="卡片编号" align="center" prop="cardNumber" />-->
-      <!--      <el-table-column label="卡片名称" align="center" prop="cardName" />-->
+      <el-table-column label="手机号" align="center" prop="phonenumber" width="200px"/>
       <el-table-column label="当前余额" align="center" prop="rechargeIntegral"/>
-      <!--      <el-table-column label="充值设备编码" align="center" prop="rechargeEquipmentCode" />-->
-      <!--      <el-table-column label="充值设备名称" align="center" prop="rechargeEquipmentName" />-->
-      <!--      <el-table-column label="所属机构" align="center" prop="organizationCode" >-->
-      <!--        <template slot-scope="scope">-->
-      <!--          {{ orgFormatter(scope.row.organizationCode) }}-->
-      <!--        </template>-->
-      <!--      </el-table-column>-->
     </el-table>
 
     <pagination
@@ -89,14 +62,14 @@
 </template>
 
 <script>
-import {doReturnPoints, integralGroupList} from "@/api/integral/integral";
-import user from "@/store/modules/user";
-
+import { doReturnPoints, integralGroupList, importGroupList } from '@/api/integral/integral'
+import user from '@/store/modules/user'
 
 export default {
-  name: "Refund",
+  name: 'Refund',
   data() {
     return {
+      exportLoading: false,
       // 遮罩层
       loading: true,
       // 导出遮罩层
@@ -109,7 +82,7 @@ export default {
       // 总条数
       total: 0,
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
       // 积分管理表格数据
@@ -119,40 +92,33 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        moneyType: null,
-        rechargeEquipmentCode: null,
-        rechargeEquipmentName: null,
         loginName: null,
-        nickName: null,
-        cardNumber: null,
-        cardName: null,
-        organizationCode: null,
-        organizations: []
+        nickName: null
       },
       // 表单参数
       form: {
         nickName: ''
       }
-    };
+    }
   },
   created() {
-    this.getList();
+    this.getList()
   },
   methods: {
     /** 查询积分管理列表 */
     getList() {
-      this.queryParams.organizationCode = user.state.organ;
-      this.loading = true;
+      this.queryParams.organizationCode = user.state.organ
+      this.loading = true
       integralGroupList(this.queryParams).then(response => {
-        this.integralList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
+        this.integralList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
     },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.reset();
+      this.open = false
+      this.reset()
     },
     // 表单重置
     reset() {
@@ -169,18 +135,30 @@ export default {
         organizationCode: null,
         rechargeId: null,
         updateTime: null
-      };
-      this.resetForm("form");
+      }
+      this.resetForm('form')
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams
+      this.$modal.confirm('是否确认导出所有用户余额数据?').then(() => {
+        this.exportLoading = true
+        return importGroupList(queryParams)
+      }).then(response => {
+        this.$download.name(response.msg)
+        this.exportLoading = false
+      }).catch(() => {
+      })
     },
     /** 搜索按钮操作 */
     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) {
@@ -190,41 +168,41 @@ export default {
     },
 
     handleReturnPoints(row) {
-      const submitArray = this.submitArray;
-      const loginName = this.uniqueLoginName(this.submitArray);
-      this.$modal.confirm('是否确认退还积分管理用户编码为"' + loginName + '"的数据项?').then(function () {
-        return doReturnPoints(submitArray);
+      const submitArray = this.submitArray
+      const loginName = this.uniqueLoginName(this.submitArray)
+      this.$modal.confirm('是否确认退还积分管理用户编码为"' + loginName + '"的数据项?').then(function() {
+        return doReturnPoints(submitArray)
       }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("退还成功");
+        this.getList()
+        this.$modal.msgSuccess('退还成功')
       }).catch(() => {
 
-      });
+      })
     },
 
     typeFormat(row) {
       if (row.moneyType === 1) {
-        return '押金';
+        return '押金'
       } else if (row.moneyType !== 1) {
         return '余额'
       } else {
-        return '';
+        return ''
       }
     },
 
     uniqueLoginName(arr) {
       const res = new Map()
-      return arr.filter(item => !res.has(arr.loginName) && res.set(arr.loginName, 1)).map(e => e.loginName);
+      return arr.filter(item => !res.has(arr.loginName) && res.set(arr.loginName, 1)).map(e => e.loginName)
     },
 
     orgFormatter(val) {
-      let name = '';
+      let name = ''
       user.state.organDicts.forEach(item => {
         if (item.deptCode == val) {
-          name = item.deptName;
+          name = item.deptName
         }
       })
-      return name;
+      return name
     }
   }
 }