From 924a90bc1c4601bc51ceb0875858a093a97cde67 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Mon, 16 May 2022 17:31:20 +0800
Subject: [PATCH] 20220516
---
zq-erp/src/main/java/com/matrix/system/padApi/action/PadServiceAction.java | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 111 insertions(+), 3 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/system/padApi/action/PadServiceAction.java b/zq-erp/src/main/java/com/matrix/system/padApi/action/PadServiceAction.java
index 6c38816..490ddf5 100644
--- a/zq-erp/src/main/java/com/matrix/system/padApi/action/PadServiceAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/padApi/action/PadServiceAction.java
@@ -1,6 +1,7 @@
package com.matrix.system.padApi.action;
import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.matrix.core.anotations.RemoveRequestToken;
import com.matrix.core.constance.MatrixConstance;
@@ -24,15 +25,18 @@
import com.matrix.system.hive.bean.*;
import com.matrix.system.hive.dao.*;
import com.matrix.system.hive.service.*;
+import com.matrix.system.padApi.dto.PadServiceListDto;
+import com.matrix.system.padApi.dto.PadSignServiceDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.CollectionUtils;
-import org.assertj.core.util.Arrays;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
@CrossOrigin(origins = "*")
@@ -79,14 +83,56 @@
private ShoppingGoodsDao shoppingGoodsDao;
@Resource
private SysStoreInfoDao sysStoreInfoDao;
+ @Resource
+ private SysWorktimeService worktimeService;
+
+ /**
+ * 获取用户所有可用的项目和套餐
+ * @return
+ */
+ @ApiOperation(value = "获取用户所有可用的项目和套餐", notes = "获取用户所有可用的项目和套餐")
+ @GetMapping(value = "/getUserProjInfo/{vipId}")
+ public AjaxResult getUserProjInfo(@PathVariable("vipId")Long vipId) {
+ AjaxResult result = AjaxResult.buildSuccessInstance("查询成功");
+
+ SysProjUse queryUse = new SysProjUse();
+ queryUse.setVipId(vipId);
+ queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_XM);
+ queryUse.setTaocanId(-1L);
+ queryUse.setStatus(Dictionary.TAOCAN_STATUS_YX);
+ List<SysProjUse> projList = projUseService.findInPage(queryUse, null);
+ //切换到套餐查询条件
+ queryUse.setTaocanId(null);
+ queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_TC);
+ List<SysProjUse> taoCanList = projUseService.findInPage(queryUse, null);
+ taoCanList.forEach(item->{
+ item.setTaocanProjUse(projUseService.selectTaocanProjUse(item.getId(), queryUse.getStatus()));
+ item.setProjInfo(shoppingGoodsDao.selectById(item.getProjId()));
+ });
+ result.putInMap("projList", projList);
+ result.putInMap("taoCanList", taoCanList);
+
+ return result;
+ }
/**
* 显示所有服务单列表
*/
@ApiOperation(value = "显示所有服务单列表", notes = "显示所有服务单列表")
@PostMapping(value = "/showList")
- public AjaxResult showList(@RequestBody SysProjServices projService, PaginationVO pageVo) {
+// public AjaxResult showList(@RequestBody SysProjServices projService, PaginationVO pageVo) {
+ public AjaxResult showList(@RequestBody @Validated PadServiceListDto orderListDto) {
+ SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
+ int offset = (orderListDto.getPageNum() - 1) * orderListDto.getPageSize();
+ int limit = orderListDto.getPageSize();
+ PaginationVO pageVo = new PaginationVO();
+ pageVo.setOffset(offset);
+ pageVo.setLimit(limit);
+ if (!DataAuthUtil.hasAllShopAuth()) {
+ orderListDto.setShopId(user.getShopId());
+ }
+ QueryUtil.setQueryLimitCom(orderListDto);
//默认排序
if (StringUtils.isBlank(pageVo.getSort())) {
pageVo.setSort("create_time");
@@ -94,8 +140,25 @@
if (StringUtils.isBlank(pageVo.getOrder())) {
pageVo.setOrder("desc");
}
+
+ SysProjServices projService = new SysProjServices();
if (!DataAuthUtil.hasAllShopAuth()) {
projService.setShopId(getMe().getShopId());
+ }
+ if(ObjectUtil.isNotEmpty(orderListDto.getBeginTime())){
+ projService.setBeginTime(orderListDto.getBeginTime());
+ }
+ if(ObjectUtil.isNotEmpty(orderListDto.getClosureTime())){
+ projService.setClosureTime(orderListDto.getClosureTime());
+ }
+ if(ObjectUtil.isNotEmpty(orderListDto.getVipId())){
+ projService.setVipId(orderListDto.getVipId());
+ }
+ if(ObjectUtil.isNotEmpty(orderListDto.getQueryKey())){
+ projService.setQueryKey(orderListDto.getQueryKey());
+ }
+ if(StrUtil.isNotEmpty(orderListDto.getState())){
+ projService.setState(orderListDto.getState());
}
QueryUtil.setQueryLimitCom(projService);
List<SysProjServices> dataList = projServicesSerivce.findInPage(projService, pageVo);
@@ -193,6 +256,32 @@
return new AjaxResult(AjaxResult.STATUS_SUCCESS, staffs, 0);
}
+ /**
+ * 获取配料师
+ */
+ @ApiOperation(value = "获取配料师", notes = "获取配料师")
+ @GetMapping(value = "/getShopStaffByRoleName")
+ public AjaxResult getStaffByRoleName() {
+ return new AjaxResult(AjaxResult.STATUS_SUCCESS, sysUsersService.findByRoleName(true, "配料师"));
+ }
+
+ /**
+ * 获取工作时间
+ */
+ @ApiOperation(value = "获取工作时间", notes = "获取工作时间")
+ @GetMapping(value = "/getWorkTime")
+ public AjaxResult getWorkTime() {
+ Long shopId = getMe().getShopId();
+ Date minTime = worktimeService.findMinTime(shopId);
+ Date maxTime = worktimeService.findMaxTime(shopId);
+ if (minTime == null || maxTime == null) {
+ return AjaxResult.buildFailInstance("门店没有班次信息,请先设置门店班次");
+ } else {
+ return AjaxResult.buildSuccessInstance(java.util.Arrays.asList(
+ DateUtil.dateToString(minTime, "HH:mm"),
+ DateUtil.dateToString(maxTime, "HH:mm")));
+ }
+ }
/**
* 新增项目
@@ -218,7 +307,9 @@
}
SysProjServices newSysProjServices = sysProjServicesService.addSysProjServices(sysProjServices);
if (newSysProjServices != null) {
- return AjaxResult.buildSuccessInstance(Arrays.asList(newSysProjServices));
+ AjaxResult result = AjaxResult.buildSuccessInstance("下单成功!");
+ result.putInMap("newSysProjServices", newSysProjServices);
+ return result;
} else {
return new AjaxResult(AjaxResult.STATUS_FAIL, "下单失败!");
}
@@ -375,6 +466,23 @@
}
/**
+ * 设置客户签名
+ */
+ @ApiOperation(value = "设置客户签名", notes = "设置客户签名")
+ @PostMapping(value = "/signService")
+ public AjaxResult signService(@RequestBody PadSignServiceDto padSignServiceDto) {
+ SysProjServices services = new SysProjServices();
+ services.setId(padSignServiceDto.getId());
+ services.setSignPic(padSignServiceDto.getSignPic());
+ int i = sysProjServicesService.signService(services);
+ if (i > 0) {
+ return new AjaxResult(AjaxResult.STATUS_SUCCESS, "签名成功");
+ } else {
+ return new AjaxResult(AjaxResult.STATUS_FAIL, "签名失败");
+ }
+ }
+
+ /**
* 设置服务单划扣成功
*/
@ApiOperation(value = "设置服务单划扣成功", notes = "设置服务单划扣成功")
--
Gitblit v1.9.1