| | |
| | | package com.matrix.system.padApi.action; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.RSAUtils; |
| | | import com.matrix.core.tools.UUIDUtil; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.app.vo.UserInfoVo; |
| | | import com.matrix.system.common.authority.DefaultAuthorityManager; |
| | | import com.matrix.system.common.authority.strategy.AccountPasswordLogin; |
| | |
| | | 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; |
| | |
| | | @Resource |
| | | private SysWorktimeService sysWorkTimeService; |
| | | |
| | | @Resource |
| | | private SysUsersService usersService; |
| | | |
| | | @Autowired |
| | | private SysBedInfoDao sysBedInfoDao; |
| | | |
| | | @Value("${login_public_key}") |
| | | private String publicKey; |
| | | |
| | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private SysUsersService usersService; |
| | | |
| | | @ApiOperation(value = "首页", notes = "首页") |
| | | @GetMapping(value = "/frist") |
| | | public AjaxResult frist() { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | @GetMapping(value = "/frist/{suId}") |
| | | public AjaxResult frist(@PathVariable Long suId) { |
| | | SysUsers user = usersService.findById(suId); |
| | | LogUtil.info("首页 shopId={}", user.getShopId()); |
| | | // SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | PadOrderListDto orderListDto = new PadOrderListDto(); |
| | | orderListDto.setPageNum(1); |
| | | orderListDto.setPageSize(5); |
| | |
| | | PaginationVO pageVo = new PaginationVO(); |
| | | pageVo.setOffset(offset); |
| | | pageVo.setLimit(limit); |
| | | if(ObjectUtil.isNotEmpty(user.getShopId())){ |
| | | orderListDto.setShopId(user.getShopId()); |
| | | } |
| | | if (!DataAuthUtil.hasAllShopAuth()) { |
| | | orderListDto.setShopId(user.getShopId()); |
| | | } |
| | |
| | | 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); |
| | |
| | | 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); |