xiaoyong931011
2022-05-05 c633067f4d71f3d0e7b7c9e8b30aeb1a2ae6b452
zq-erp/src/main/java/com/matrix/system/padApi/action/PadApiCommonAction.java
@@ -1,6 +1,7 @@
package com.matrix.system.padApi.action;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
@@ -16,7 +17,6 @@
import com.matrix.system.common.dao.SysCompanyDao;
import com.matrix.system.common.init.LocalCache;
import com.matrix.system.common.service.SysUsersService;
import com.matrix.system.common.tools.DataAuthUtil;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.hive.action.BaseController;
import com.matrix.system.hive.action.util.QueryUtil;
@@ -24,6 +24,7 @@
import com.matrix.system.hive.bean.SysBedInfo;
import com.matrix.system.hive.bean.SysProjServices;
import com.matrix.system.hive.bean.SysShopInfo;
import com.matrix.system.hive.dao.SysBedInfoDao;
import com.matrix.system.hive.dao.SysShopInfoDao;
import com.matrix.system.hive.service.SysBedInfoService;
import com.matrix.system.hive.service.SysOrderService;
@@ -76,6 +77,12 @@
    @Resource
    private SysWorktimeService sysWorkTimeService;
    @Resource
    private SysUsersService usersService;
    @Autowired
    private SysBedInfoDao sysBedInfoDao;
    @Value("${login_public_key}")
    private String publicKey;
@@ -117,10 +124,6 @@
        return result;
    }
    @Resource
    private SysUsersService usersService;
    @ApiOperation(value = "首页", notes = "首页")
    @GetMapping(value = "/frist")
    public AjaxResult frist() {
@@ -133,19 +136,22 @@
        PaginationVO pageVo = new PaginationVO();
        pageVo.setOffset(offset);
        pageVo.setLimit(limit);
        if (!DataAuthUtil.hasAllShopAuth()) {
        if(ObjectUtil.isNotEmpty(user.getShopId())){
            orderListDto.setShopId(user.getShopId());
        }
//        if (!DataAuthUtil.hasAllShopAuth()) {
//            orderListDto.setShopId(user.getShopId());
//        }
        QueryUtil.setQueryLimitCom(orderListDto);
        List<PadOrderDetailVo> padApiOrderListInPage = sysOrderService.findPadApiOrderListInPage(orderListDto, pageVo);
        AjaxResult result = AjaxResult.buildSuccessInstance("");
        result.putInMap("orderList",padApiOrderListInPage);
        Date date = new Date();
        List<SysUsers> mls = usersService.findByRoleName(true, Dictionary.STAFF_POST_MLS);
        if(CollUtil.isNotEmpty(mls)){
            SysBeauticianState sysBeauticianState = new SysBeauticianState();
            Date date = new Date();
            sysBeauticianState.setBeginTime(DateUtil.getStartDate(date));
            sysBeauticianState.setEndTime(DateUtil.getStartDate(date));
            String panBanCodes = DateUtil.dateToString(sysBeauticianState.getBeginTime(),DateUtil.DATE_FORMAT_NO_SPLITE_DD);
@@ -169,7 +175,11 @@
        if(CollUtil.isNotEmpty(totalBed)){
            SysProjServices sysProjServices = new SysProjServices();
            sysProjServices.setShopId(getMe().getShopId());
            List<SysBedInfo> freeBed = bedInfoService.findFreeBed(sysProjServices);
            sysProjServices.setStartTime(DateUtil.getStartDate(date));
            sysProjServices.setEndTime(DateUtil.getStartDate(date));
            List<SysBedInfo> freeBed = sysBedInfoDao.findFreeBed(sysProjServices);
//            List<SysBedInfo> freeBed = bedInfoService.findFreeBed(sysProjServices);
            if(CollUtil.isNotEmpty(freeBed)){
                result.putInMap("usedBed", totalBed.size() - freeBed.size());
                result.putInMap("freeBed", freeBed);