Merge branch 'developer' into alpha
| | |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.ModelUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.app.authority.AppAuthorityManager; |
| | | import com.matrix.system.common.authority.DefaultAuthorityManager; |
| | | import com.matrix.system.common.bean.SysUserLoginRecord; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | |
| | | //删除用户权限缓存 |
| | | String redisKey=DefaultAuthorityManager.USER_POWER_REDISKEY+ SecureUtil.md5(oldSysUsers.getSuId()+""); |
| | | String redisKeyPc=DefaultAuthorityManager.USER_POWER_REDISKEY_PC+ SecureUtil.md5(oldSysUsers.getSuId()+""); |
| | | String appRedisKey = AppAuthorityManager.USER_POWER_REDISKEY_APP + SecureUtil.md5(oldSysUsers.getSuId()+""); |
| | | LocalCache.remove(redisKey); |
| | | LocalCache.remove(redisKeyPc); |
| | | LocalCache.remove(appRedisKey); |
| | | |
| | | return MatrixConstance.DML_SUCCESSS; |
| | | } |
| | |
| | | package com.matrix.system.common.tools; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | public class LocationUtil { |
| | | |
| | | private static final double EARTH_RADIUS = 6378.137; |
| | |
| | | * shopX 店铺位置经度 |
| | | * shopY 店铺位置纬度 |
| | | */ |
| | | public static double getDistance(double locX, double locY, double shopX, double shopY) { |
| | | public static BigDecimal getDistance(double locX, double locY, double shopX, double shopY) { |
| | | double a, b, d, sa2, sb2; |
| | | locY = rad(locY); |
| | | shopY = rad(shopY); |
| | |
| | | d = 2 * EARTH_RADIUS |
| | | * Math.asin(Math.sqrt(sa2 * sa2 + Math.cos(locY) |
| | | * Math.cos(shopY) * sb2 * sb2)); |
| | | return d; |
| | | return BigDecimal.valueOf(d); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | // 112.886891,28.222562,114.061937,22.626003 -- 634093.3209722887 |
| | | // 113.930692,22.939454 -- 597367.3546527711 |
| | | System.out.println(getDistance(112.886891d, 28.222562d, 113.930692, 22.939454)); |
| | | // System.out.println(getDistance(112.886891d, 28.222562d, 113.930692, 22.939454)); |
| | | System.out.println(BigDecimal.ONE.compareTo(BigDecimal.ZERO)>0); |
| | | } |
| | | } |
| | |
| | | if (!DataAuthUtil.hasAllShopAuth()) { |
| | | sysOrder.setShopId(getMe().getShopId()); |
| | | } |
| | | sysOrder.setCompanyId(getMe().getCompanyId()); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, orderService.findInPage(sysOrder, pageVo), |
| | | orderService.findTotal(sysOrder)); |
| | | } |
| | |
| | | // String dirPath = "E:"; |
| | | String dirPath = fileStoragePath; |
| | | |
| | | File saveFile = new File(dirPath + "/" + fileName); |
| | | file.transferTo(saveFile); |
| | | File saveFile =new File (new File(dirPath).getAbsolutePath() + File.separator + fileName); |
| | | if (!saveFile.exists()) |
| | | { |
| | | if (!saveFile.getParentFile().exists()) |
| | | { |
| | | saveFile.getParentFile().mkdirs(); |
| | | } |
| | | } |
| | | file.transferTo(saveFile.getAbsoluteFile()); |
| | | |
| | | SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | |
| | | BusParameterSettings principalConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.PRINCIPAL_CONSUMPTION, vipInfo.getCompanyId()); |
| | | //本金消耗 |
| | | if (principalPrice > 0 |
| | | && StringUtils.isNotBlank(principalConsumption.getParamValue())) { |
| | | && StringUtils.isNotBlank(principalConsumption.getParamValue()) && Double.parseDouble(principalConsumption.getParamValue()) > 0 ) { |
| | | |
| | | principalConsumScore[0] = (int) (principalPrice / Double.parseDouble(principalConsumption.getParamValue())); |
| | | |
| | | if (StringUtils.isNotBlank(principalConsumption.getParamValue1())) { |
| | | if (StringUtils.isNotBlank(principalConsumption.getParamValue1()) && Double.parseDouble(principalConsumption.getParamValue1()) > 0 ) { |
| | | principalConsumScore[1] = (int) (principalPrice / Double.parseDouble(principalConsumption.getParamValue1())); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(principalConsumption.getParamValue2())) { |
| | | if (StringUtils.isNotBlank(principalConsumption.getParamValue2()) && Double.parseDouble(principalConsumption.getParamValue2()) > 0 ) { |
| | | principalConsumScore[2] = (int) (principalPrice / Double.parseDouble(principalConsumption.getParamValue2())); |
| | | } |
| | | } |
| | |
| | | BusParameterSettings giveConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.GIVE_CONSUMPTION, vipInfo.getCompanyId()); |
| | | //本金消耗 |
| | | if (giftPrice > 0 |
| | | && StringUtils.isNotBlank(giveConsumption.getParamValue())) { |
| | | && StringUtils.isNotBlank(giveConsumption.getParamValue()) && Double.parseDouble(giveConsumption.getParamValue())>0) { |
| | | |
| | | giveConsumScore[0] = (int) (giftPrice / Double.parseDouble(giveConsumption.getParamValue())); |
| | | |
| | | if (StringUtils.isNotBlank(giveConsumption.getParamValue1())) { |
| | | if (StringUtils.isNotBlank(giveConsumption.getParamValue1()) && Double.parseDouble(giveConsumption.getParamValue1())>0) { |
| | | giveConsumScore[1] = (int) (giftPrice / Double.parseDouble(giveConsumption.getParamValue1())); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(giveConsumption.getParamValue2())) { |
| | | if (StringUtils.isNotBlank(giveConsumption.getParamValue2()) && Double.parseDouble(giveConsumption.getParamValue2())>0 ) { |
| | | giveConsumScore[2] = (int) (giftPrice / Double.parseDouble(giveConsumption.getParamValue2())); |
| | | } |
| | | } |
| | |
| | | @RequestMapping(value = "/findUserInfo") |
| | | public @ResponseBody |
| | | AjaxResult findUserInfo() { |
| | | AjaxResult res = new AjaxResult(); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | SysVipInfo sysVipInfo = sysVipInfoService.findById(loginUser.getId()); |
| | | |
| | |
| | | sysVipInfo.setBalance(0D); |
| | | sysVipInfo.setPointAll(0); |
| | | } |
| | | } |
| | | |
| | | AjaxResult res = new AjaxResult(); |
| | | res.putInMap("couponCount", shopCouponRecordDao.countUnuseCouponRecord(loginUser.getId())); |
| | | res.putInMap("prizeCount", activitySignReceiveRecordDao.getSignAwardReceiveCount(loginUser.getId(), loginUser.getCompanyId())); |
| | | res.putInMap("userInfo", sysVipInfo); |
| | |
| | | } else { |
| | | res.putInMap("vipLevel", "初级会员"); |
| | | } |
| | | } |
| | | res.setStatus(AjaxResult.STATUS_SUCCESS); |
| | | return res; |
| | | } |
| | |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, shopList); |
| | | } |
| | | |
| | | Double distance = null; |
| | | BigDecimal distance = null; |
| | | SysShopInfo nearestShop = null; |
| | | |
| | | AjaxResult ajaxResult = new AjaxResult("200", shopList); |
| | |
| | | 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; |
| | | } |
| | |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | |
| | | private ShopActivitiesSeckillRecordDao shopActivitiesSeckillRecordDao; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult createSecKillOrder(CreateSecKillDTO secKillDTO) throws Exception { |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(secKillDTO.getId()); |
| | |
| | | //TODO 更新库存和销量 更新库存和销量[考虑和erp库存联动] |
| | | wxShopOrderUtil.updateProductAndSkuInfo(details); |
| | | |
| | | shopOrder.setUserId(secKillDTO.getId()); |
| | | shopOrder.setUserId(sysVipInfo.getId()); |
| | | shopOrder.setCreateBy("微信小程序生成"); |
| | | shopOrder.setUpdateBy("微信小程序生成"); |
| | | shopOrder.setCommodityPrice(secKillDTO.getPrice()); |
| | |
| | | |
| | | spring.profiles.active=test |
| | | spring.profiles.active=meidu |
| | | evn=dev |
| | | server.port=8080 |
| | | |
| | |
| | | and a.STATE !='预约取消' |
| | | and a.STATE !='待确认' |
| | | and a.STATE !='待预约' |
| | | and a.STATE !='服务单结束' |
| | | order by a.BEGIN_TIME asc |
| | | |
| | | </select> |