xiaoyong931011
2022-04-26 b3dddba2861bd98bbaf30df60121fc0709fac9da
20220426
1 files added
3 files modified
106 ■■■■■ changed files
zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjServices.java 11 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/padApi/action/PadServiceAction.java 56 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/padApi/dto/PadServiceListDto.java 33 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml 6 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjServices.java
@@ -352,6 +352,17 @@
    @Extend
    private String pageFlae;
    @Extend
    private String queryKey;
    public String getQueryKey() {
        return queryKey;
    }
    public void setQueryKey(String queryKey) {
        this.queryKey = queryKey;
    }
    public Long getStaffId() {
        return staffId;
    }
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,11 +25,13 @@
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 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;
@@ -81,12 +84,52 @@
    private SysStoreInfoDao sysStoreInfoDao;
    /**
     * 获取用户所有可用的项目和套餐
     * @return
     */
    @ApiOperation(value = "获取用户所有可用的项目和套餐", notes = "获取用户所有可用的项目和套餐")
    @GetMapping(value = "/getUserProjInfo/{id}")
    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,9 +137,20 @@
        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.getQueryKey())){
            projService.setQueryKey(orderListDto.getQueryKey());
        }
        QueryUtil.setQueryLimitCom(projService);
        List<SysProjServices> dataList = projServicesSerivce.findInPage(projService, pageVo);
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, projServicesSerivce.findTotal(projService));
zq-erp/src/main/java/com/matrix/system/padApi/dto/PadServiceListDto.java
New file
@@ -0,0 +1,33 @@
package com.matrix.system.padApi.dto;
import com.matrix.system.app.dto.BasePageDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@ApiModel(value = "PadServiceListDto", description = "服务单列表接收参数类")
@Data
public class PadServiceListDto extends BasePageDto {
    @ApiModelProperty(value = "状态", example = "待预约")
    private String state;
    @ApiModelProperty(value = "查询字段")
    private String queryKey;
    @ApiModelProperty(value = "预约开始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginTime;
    @ApiModelProperty(value = "预约结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date closureTime;
    @ApiModelProperty(hidden = true)
    private Long shopId;
    @ApiModelProperty(hidden = true)
    private Long companyId;
}
zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml
@@ -309,6 +309,9 @@
        left join sys_beautician_state c on a.id=c.SERVICES_ID
        WHERE 1 = 1
        <if test="record!=null">
            <if test="record.queryKey != null and record.queryKey != ''">
                and (instr(c.vip_name, #{record.queryKey}) or instr(c.phone, #{record.queryKey}) or instr(a.order_no, #{record.queryKey}))
            </if>
            <if test="record.queryStaffId != null and record.queryStaffId !='' ">
                and (a.CREATE_STAFF_ID  = #{record.queryStaffId}  or c.STAFF_ID=#{record.queryStaffId}  )
            </if>
@@ -376,6 +379,9 @@
        left join sys_beautician_state c on a.id=c.SERVICES_ID
        WHERE 1 = 1
        <if test="record!=null">
            <if test="record.queryKey != null and record.queryKey != ''">
                and (instr(c.vip_name, #{record.queryKey}) or instr(c.phone, #{record.queryKey}) or instr(a.order_no, #{record.queryKey}))
            </if>
            <if test="record.queryStaffId != null and record.queryStaffId !='' ">
                and (a.CREATE_STAFF_ID  = #{record.queryStaffId}  or c.STAFF_ID=#{record.queryStaffId}  )
            </if>