935090232@qq.com
2022-04-24 4bc4270eb46bd06db2013b234aab3e54e1150e2a
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java
@@ -1,7 +1,6 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.component.rabbitmq.RabiitMqTemplate;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.system.common.init.UserCacheManager;
import com.matrix.core.exception.GlobleException;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.VerifyResult;
@@ -75,7 +74,7 @@
    private  SysBeauticianStateService sysBeauticianStateService;
    @Autowired
    RedisUserLoginUtils redisUserLoginUtils;
    private UserCacheManager userCacheManager;
    @Autowired
    ShopProductDao productDao;
@@ -86,8 +85,6 @@
    @Autowired
    SysVipInfoDao sysVipInfoDao;
    @Autowired
    RabiitMqTemplate rabiitMqTemplate;
    @Autowired
    SysProjUseDao projUseDao;
@@ -125,7 +122,7 @@
            return new AjaxResult(AjaxResult.STATUS_SUCCESS, shopList);
        }
        Double distance = null;
        BigDecimal distance = null;
        SysShopInfo nearestShop = null;
        AjaxResult ajaxResult = new AjaxResult("200", shopList);
@@ -133,9 +130,9 @@
            for (SysShopInfo shopInfo : shopList) {
                Double shopX = Double.parseDouble(shopInfo.getLongitude());
                Double shopY = Double.parseDouble(shopInfo.getLatitude());
                Double disResult = LocationUtil.getDistance(Double.parseDouble(locX), Double.parseDouble(locY), shopX, shopY);
                shopInfo.setDistance(new BigDecimal(disResult).setScale(1, BigDecimal.ROUND_HALF_UP));
                if (distance == null || distance > disResult) {
                BigDecimal disResult = LocationUtil.getDistance(Double.parseDouble(locX), Double.parseDouble(locY), shopX, shopY);
                shopInfo.setDistance(disResult);
                if (distance == null || distance.compareTo(disResult)>0) {
                    distance = disResult;
                    nearestShop = shopInfo;
                }
@@ -223,11 +220,18 @@
    @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 (SysVipInfo.VALID_FLAG_N == vipInfo.getValidFlag()) {
            AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(new ArrayList<>(), "获取成功");
            ajaxResult.putInMap("proj", new ServiceProductListVo());
            return ajaxResult;
        }
        ServiceProductListVo productListVo = new ServiceProductListVo();
        productListVo.setName(vipInfo.getVipName());
        productListVo.setVipId(vipInfo.getId());
@@ -237,7 +241,6 @@
        queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_XM);
        queryUse.setTaocanId(-1L);
        queryUse.setStatus(Dictionary.TAOCAN_STATUS_YX);
        queryUse.setIsOver(Dictionary.FLAG_NO_N);
        List<SysProjUse> projList = projUseService.findInPage(queryUse, null);
        List<ServiceProjVo> serviceProjVos = SysProjUseMapper.INSTANCE.entityListToProjVoList(projList);
@@ -274,8 +277,8 @@
    @RequestMapping(value = "/createServiceOrder")
    public @ResponseBody
    AjaxResult createServiceOrder(@RequestBody Onlinebooking onlinebooking) {
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        SysVipInfo vipInfo = vipInfoDao.selectByPhone(sysVipInfo.getPhone());
        SysVipInfo sysVipInfo = userCacheManager.getLoginUser();
        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();
@@ -368,9 +371,14 @@
    @PostMapping(value = "/getServiceOrderList")
    @ResponseBody
    public AjaxResult findServiceOrderList(@RequestBody @Validated ErpServiceOrderListDto orderListDto) {
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        SysVipInfo vipInfo= vipInfoDao.selectByPhone(sysVipInfo.getPhone());
        orderListDto.setVipId(vipInfo.getId());
        SysVipInfo sysVipInfo = userCacheManager.getLoginUser();
        orderListDto.setVipId(sysVipInfo.getId());
        SysVipInfo vipInfo = sysVipInfoDao.selectById(sysVipInfo.getId());
        if (SysVipInfo.VALID_FLAG_N == vipInfo.getValidFlag()) {
            return AjaxResult.buildSuccessInstance(new ArrayList<>(), "查询成功");
        }
        List<ErpServiceOrderListVo> apiServiceOrderListInPage = projServicesDao.findWxServiceOrderList(orderListDto);
        return AjaxResult.buildSuccessInstance(apiServiceOrderListInPage,"查询成功");
    }