| | |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.pojo.VerifyResult; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.app.dto.ServiceOrderListDto; |
| | | import com.matrix.system.app.mapper.SysBeauticianStateMapper; |
| | | import com.matrix.system.app.mapper.SysProjServiceMapper; |
| | | import com.matrix.system.app.mapper.SysProjUseMapper; |
| | | import com.matrix.system.app.vo.*; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.common.tools.DataAuthUtil; |
| | | import com.matrix.system.common.tools.LocationUtil; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.dao.*; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.hive.service.*; |
| | | import com.matrix.system.shopXcx.bean.ShopProduct; |
| | | import com.matrix.system.shopXcx.api.dto.ErpServiceCommentDto; |
| | | import com.matrix.system.shopXcx.api.dto.ErpServiceOrderListDto; |
| | | import com.matrix.system.shopXcx.api.vo.ErpServiceOrderListVo; |
| | | import com.matrix.system.shopXcx.dao.ShopProductDao; |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import com.matrix.system.shopXcx.dto.YYDayOfWeek; |
| | | import com.matrix.system.shopXcx.dto.YYmonth; |
| | | import com.matrix.system.shopXcx.mqTask.DTO.UserProjInfo; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | |
| | | if (CollectionUtils.isNotEmpty(serviceTcVos)) { |
| | | serviceTcVos.forEach(item -> { |
| | | List<SysProjUse> sysProjUses = projUseService.selectTaocanProjUse(item.getId()); |
| | | List<SysProjUse> sysProjUses = projUseService.selectTaocanProjUse(item.getId(), queryUse.getStatus()); |
| | | List<ServiceProjVo> taocanProj = SysProjUseMapper.INSTANCE.entityListToProjVoList(sysProjUses); |
| | | item.setProj(taocanProj); |
| | | }); |
| | |
| | | public @ResponseBody |
| | | AjaxResult createServiceOrder(@RequestBody Onlinebooking onlinebooking) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | bizUser = bizUserDao.findByOpenId(bizUser.getOpenId()); |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(bizUser.getPhoneNumber()); |
| | | |
| | | |
| | | SysProjUse sysProjUse = projUseDao.selectById(Long.parseLong(onlinebooking.getProductId() + "")); |
| | | Date yyTime = DateUtil.stringToDate(onlinebooking.getTimeStr(), DateUtil.DATE_FORMAT_MM); |
| | | SysProjServices sysProjServices = new SysProjServices(); |
| | | sysProjServices.setCompanyId(vipInfo.getCompanyId()); |
| | | sysProjServices.setShopId(onlinebooking.getShopId()); |
| | | sysProjServices.setVipId(vipInfo.getId()); |
| | | |
| | | sysProjServices.setYyTime(yyTime); |
| | | sysProjServices.setRemark(onlinebooking.getRemark()); |
| | | |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = " 根据id查询预约订单的详情", notes = " 根据id查询预约订单的详情") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = ErpServiceOrderListVo.class) |
| | | }) |
| | | @RequestMapping(value = "/getServiceOrderById/{id}") |
| | | public @ResponseBody |
| | | AjaxResult getServiceOrderById(@PathVariable("id") Long id) { |
| | |
| | | if (projServices == null) { |
| | | return AjaxResult.buildFailInstance("服务单不存在"); |
| | | } |
| | | ServiceOrderDetailVo detailVo = SysProjServiceMapper.INSTANCE.projServiceToDetailVo(projServices); |
| | | List<SysBeauticianState> beauticianStates = sysBeauticianStateService.findBySerId(projServices.getId()); |
| | | List<ServiceOrderDetailItemVo> items = SysBeauticianStateMapper.INSTANCE.entitiesToDetailItemsVo(beauticianStates); |
| | | detailVo.setItems(items); |
| | | ErpServiceOrderListVo serviceOrder = projServicesDao.findWxServiceOrderById(id); |
| | | AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); |
| | | ajaxResult.putInMap("detail", detailVo); |
| | | ajaxResult.putInMap("shopInfo", shopInfoDao.selectById(projServices.getShopId())); |
| | | ajaxResult.putInMap("detail", serviceOrder); |
| | | return ajaxResult; |
| | | } |
| | | |
| | |
| | | * @param orderListDto |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "查询服务单列表", notes = "查询服务单列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = ErpServiceOrderListVo.class) |
| | | }) |
| | | @PostMapping(value = "/getServiceOrderList") |
| | | @ResponseBody |
| | | public AjaxResult findServiceOrderList(@RequestBody @Validated ServiceOrderListDto orderListDto) { |
| | | public AjaxResult findServiceOrderList(@RequestBody @Validated ErpServiceOrderListDto orderListDto) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo vipInfo= vipInfoDao.selectByPhone(bizUser.getPhoneNumber()); |
| | | |
| | | PaginationVO pageVo = new PaginationVO(); |
| | | int offset = (orderListDto.getPageNum() - 1) * orderListDto.getPageSize(); |
| | | int limit = orderListDto.getPageSize(); |
| | | pageVo.setOffset(offset); |
| | | pageVo.setLimit(limit); |
| | | orderListDto.setVipId(vipInfo.getId()); |
| | | List<ServiceOrderListVo> apiServiceOrderListInPage = projServicesService.findApiServiceOrderListInPage(orderListDto, pageVo); |
| | | return AjaxResult.buildSuccessInstance(apiServiceOrderListInPage, projServicesService.findApiServiceOrderListTotal(orderListDto)); |
| | | List<ErpServiceOrderListVo> apiServiceOrderListInPage = projServicesDao.findWxServiceOrderList(orderListDto); |
| | | return AjaxResult.buildSuccessInstance(apiServiceOrderListInPage,"查询成功"); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/cancelOrderById/{id}") |
| | | @ApiOperation(value = "取消预约", notes = "取消预约") |
| | | @GetMapping(value = "/cancelOrderById/{id}") |
| | | public @ResponseBody |
| | | AjaxResult cancelOrderById(@PathVariable("id") Long id) { |
| | | |
| | | AjaxResult cancelOrderById(@PathVariable Long id) { |
| | | SysProjServices services = new SysProjServices(); |
| | | services.setId(id); |
| | | int i = projServicesService.modifyCancelProjServices(services); |
| | |
| | | } else { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "取消预约失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "服务单评论", notes = "服务单评论") |
| | | @PostMapping(value = "/commentService") |
| | | public @ResponseBody |
| | | AjaxResult commentService(@RequestBody @Validated ErpServiceCommentDto commentDto) { |
| | | SysProjServices services = new SysProjServices(); |
| | | services.setId(commentDto.getId()); |
| | | services.setComment(commentDto.getComment()); |
| | | int i = projServicesDao.update(services); |
| | | if (i > 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "评论成功"); |
| | | } else { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "评论失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private UserProjInfo coversion(SysProjUse pUse) { |
| | | UserProjInfo projInfo = new UserProjInfo(); |
| | | projInfo.setId(pUse.getId()); |
| | | projInfo.setName(shoppingGoodsDao.selectById(pUse.getProjId()).getName()); |
| | | projInfo.setSurplusCount(pUse.getSurplusCount() + ""); |
| | | projInfo.setType(pUse.getType()); |
| | | return projInfo; |
| | | } |
| | | |
| | | |
| | | private int dateToCodeInt(Date date) { |
| | | return Integer.parseInt(DateUtil.dateToString(date, DateUtil.HHmm)); |
| | | } |
| | | |
| | | |
| | | } |