|  |  |  | 
|---|
|  |  |  | package com.matrix.system.shopXcx.api.action; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.matrix.biz.bean.BizUser; | 
|---|
|  |  |  | 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.LogUtil; | 
|---|
|  |  |  | 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.app.vo.ServiceProductListVo; | 
|---|
|  |  |  | import com.matrix.system.app.vo.ServiceProjVo; | 
|---|
|  |  |  | import com.matrix.system.app.vo.ServiceTcVo; | 
|---|
|  |  |  | import com.matrix.system.common.bean.BusParameterSettings; | 
|---|
|  |  |  | import com.matrix.system.common.bean.SysUsers; | 
|---|
|  |  |  | import com.matrix.system.common.dao.BusParameterSettingsDao; | 
|---|
|  |  |  | 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.score.constant.ScoreSettingConstant; | 
|---|
|  |  |  | import com.matrix.system.score.entity.ScoreVipDetail; | 
|---|
|  |  |  | import com.matrix.system.score.service.ScoreVipDetailService; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.api.dto.ErpServiceCommentDto; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.api.dto.ErpServiceOrderListDto; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.api.vo.ErpOrderDetailItemVo; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.api.vo.ErpServiceOrderListVo; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.bean.ShopProduct; | 
|---|
|  |  |  | 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 io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import io.swagger.annotations.ApiResponse; | 
|---|
|  |  |  | import io.swagger.annotations.ApiResponses; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Value; | 
|---|
|  |  |  | import org.springframework.stereotype.Controller; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.annotation.Resource; | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author jiangyouyao | 
|---|
|  |  |  | 
|---|
|  |  |  | SysUsersDao staffInfoDao; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | BizUserDao bizUserDao; | 
|---|
|  |  |  | SysVipInfoDao sysVipInfoDao; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | RabiitMqTemplate rabiitMqTemplate; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | ShoppingGoodsDao shoppingGoodsDao; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | ScoreVipDetailService scoreVipDetailService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private BusParameterSettingsDao busParameterSettingsDao; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Value("${evn}") | 
|---|
|  |  |  | private String evn; | 
|---|
|  |  |  | 
|---|
|  |  |  | @ResponseBody | 
|---|
|  |  |  | public | 
|---|
|  |  |  | AjaxResult getUserPro(@PathVariable String phone) { | 
|---|
|  |  |  | SysVipInfo vipInfo = vipInfoDao.selectByPhone(phone); | 
|---|
|  |  |  | SysVipInfo vipInfo = vipInfoDao.selectByPhone(phone,HostInterceptor.getCompanyId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (vipInfo == null) { | 
|---|
|  |  |  | throw new GlobleException("会员不存在"); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/createServiceOrder") | 
|---|
|  |  |  | public @ResponseBody | 
|---|
|  |  |  | AjaxResult createServiceOrder(@RequestBody Onlinebooking onlinebooking) { | 
|---|
|  |  |  | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); | 
|---|
|  |  |  | SysVipInfo vipInfo = vipInfoDao.selectByPhone(bizUser.getPhoneNumber()); | 
|---|
|  |  |  | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); | 
|---|
|  |  |  | SysVipInfo vipInfo = vipInfoDao.selectByPhone(sysVipInfo.getPhone(),HostInterceptor.getCompanyId()); | 
|---|
|  |  |  | SysProjUse sysProjUse = projUseDao.selectById(Long.parseLong(onlinebooking.getProductId() + "")); | 
|---|
|  |  |  | Date yyTime = DateUtil.stringToDate(onlinebooking.getTimeStr(), DateUtil.DATE_FORMAT_MM); | 
|---|
|  |  |  | SysProjServices sysProjServices = new SysProjServices(); | 
|---|
|  |  |  | 
|---|
|  |  |  | sysProjServices.setState(Dictionary.SERVICE_STATU_DQR); | 
|---|
|  |  |  | SysProjServices newSysProjServices = projServicesService.addSysProjServices(sysProjServices); | 
|---|
|  |  |  | if (newSysProjServices != null) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //添加用户积分 | 
|---|
|  |  |  | BusParameterSettings parameterSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.RESERVATION_SERVICE_SHOP, sysVipInfo.getCompanyId()); | 
|---|
|  |  |  | scoreVipDetailService.addScoreByParamSetting(sysVipInfo.getId(), null,null, newSysProjServices.getId(), | 
|---|
|  |  |  | ScoreVipDetail.SCORE_VIP_TYPE_JOIN_ACTIVE,"预约送积分", parameterSetting); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return AjaxResult.buildSuccessInstance("下单成功"); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | return new AjaxResult(AjaxResult.STATUS_FAIL, "下单失败!"); | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping(value = "/getServiceOrderList") | 
|---|
|  |  |  | @ResponseBody | 
|---|
|  |  |  | public AjaxResult findServiceOrderList(@RequestBody @Validated ErpServiceOrderListDto orderListDto) { | 
|---|
|  |  |  | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); | 
|---|
|  |  |  | SysVipInfo vipInfo= vipInfoDao.selectByPhone(bizUser.getPhoneNumber()); | 
|---|
|  |  |  | orderListDto.setVipId(vipInfo.getId()); | 
|---|
|  |  |  | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); | 
|---|
|  |  |  | orderListDto.setVipId(sysVipInfo.getId()); | 
|---|
|  |  |  | List<ErpServiceOrderListVo> apiServiceOrderListInPage = projServicesDao.findWxServiceOrderList(orderListDto); | 
|---|
|  |  |  | return AjaxResult.buildSuccessInstance(apiServiceOrderListInPage,"查询成功"); | 
|---|
|  |  |  | } | 
|---|