935090232@qq.com
2022-04-24 4bc4270eb46bd06db2013b234aab3e54e1150e2a
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java
@@ -1,6 +1,6 @@
package com.matrix.system.shopXcx.api.action;
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;
@@ -74,7 +74,7 @@
    private  SysBeauticianStateService sysBeauticianStateService;
    @Autowired
    RedisUserLoginUtils redisUserLoginUtils;
    private UserCacheManager userCacheManager;
    @Autowired
    ShopProductDao productDao;
@@ -122,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);
@@ -130,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;
                }
@@ -225,6 +225,13 @@
        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());
@@ -270,7 +277,7 @@
    @RequestMapping(value = "/createServiceOrder")
    public @ResponseBody
    AjaxResult createServiceOrder(@RequestBody Onlinebooking onlinebooking) {
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        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);
@@ -364,8 +371,14 @@
    @PostMapping(value = "/getServiceOrderList")
    @ResponseBody
    public AjaxResult findServiceOrderList(@RequestBody @Validated ErpServiceOrderListDto orderListDto) {
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        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,"查询成功");
    }