Merge remote-tracking branch 'origin/master'
1 文件已重命名
28个文件已修改
26个文件已添加
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | |
| | | public class AppUserInfoDto { |
| | | @ApiModelProperty("1是0否") |
| | | private Integer isVip; |
| | | @ApiModelProperty("最低会员价格") |
| | | private BigDecimal minPrice; |
| | | @ApiModelProperty("vip结束时间") |
| | | private LocalDateTime vipExpireTime; |
| | | @ApiModelProperty("当天是否签到") |
| | |
| | | package com.ruoyi.account.api.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | |
| | | @Data |
| | | public class InfoCouponDto { |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | @ApiModelProperty(value = "优惠券名称") |
| | | @TableField("name") |
| | | private String name; |
| | | private Integer type; |
| | | @ApiModelProperty(value = "优惠方式(1=满减,2=抵扣)") |
| | | @TableField("preferential_mode") |
| | | private Integer preferentialMode; |
| | |
| | | private Long userId; |
| | | @ApiModelProperty("1=正常,2=冻结") |
| | | private Integer status; |
| | | private String remark; |
| | | } |
| | |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.PointChangeDto; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R change(PointChangeDto points) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R<TAppUser> selectByPhone(String phone) { |
| | | return R.fail("通过手机号查询用户失败:"+throwable.getMessage()); |
| | | return R.fail("积分变化失败:"+throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.account.api.factory.AppUserFallbackFactory; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.PointChangeDto; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @PostMapping("/t-app-user/user/updateAppUser") |
| | | R updateAppUser(@RequestBody TAppUser appUser); |
| | | |
| | | @PostMapping("/t-app-user/user/points/change") |
| | | R change(@RequestBody PointChangeDto points); |
| | | |
| | | /** |
| | | * 通过手机号查询用户 |
| | | * @param phone |
| | |
| | | @TableField("city_code") |
| | | private String cityCode; |
| | | |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "状态(1=正常,2=冻结,3=注销)") |
| | | @TableField("status") |
| | | private Integer status; |
| | |
| | | |
| | | @Data |
| | | public class ApplyChargingQuery extends BasePage { |
| | | String name; |
| | | String landlordPhone; |
| | | } |
| | |
| | | @TableField("landlord_handling") |
| | | private Integer landlordHandling; |
| | | |
| | | |
| | | @ApiModelProperty(value = "户名") |
| | | @TableField("landlord_name") |
| | | private String landlordName; |
| | |
| | | private Integer superCount; |
| | | @ApiModelProperty(value = "慢充数量") |
| | | private Integer slowCount; |
| | | @ApiModelProperty(value = "快充空闲数量") |
| | | private Integer superFreeCount; |
| | | @ApiModelProperty(value = "超充空闲数量") |
| | | private Integer fastFreeCount; |
| | | @ApiModelProperty(value = "慢充空闲数量") |
| | | private Integer slowFreeCount; |
| | | @ApiModelProperty(value = "普通电价") |
| | | private BigDecimal electrovalence; |
| | | @ApiModelProperty(value = "会员电价") |
| | |
| | | return R.fail("创建订单" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Long> shopCreate(ExchangeDto exchangeDto) { |
| | | return R.fail("订单创建" + cause.getMessage()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R<TActivityVO> activityStatistics(TActivityStatisticsQuery dto) { |
| | |
| | | |
| | | @PostMapping("/t-exchange-order/create") |
| | | public R<Long> exchangeCreate(@RequestBody ExchangeDto exchangeDto); |
| | | @PostMapping("/t-shopping-order/create") |
| | | public R<Long> shopCreate(@RequestBody ExchangeDto exchangeDto); |
| | | |
| | | /** |
| | | * 管理后台 活动费用统计 |
New file |
| | |
| | | package com.ruoyi.common.core.dto; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AppGoodQuery extends BasePage { |
| | | @ApiModelProperty("1=购买商品,2=兑换商品") |
| | | private Integer type; |
| | | } |
File was renamed from ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/ExchangeDto.java |
| | |
| | | Integer goodType; |
| | | @ApiModelProperty(hidden = true) |
| | | Integer point; |
| | | @ApiModelProperty("购买数量") |
| | | Integer num; |
| | | @ApiModelProperty("优惠卷id") |
| | | Long couponId; |
| | | |
| | | @ApiModelProperty("1微信2支付宝") |
| | | Integer payMethod; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.dto; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | @Data |
| | | public class PointChangeDto { |
| | | private Long userId; |
| | | private Integer points; |
| | | private String remark; |
| | | private Integer type; |
| | | } |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | |
| | | import com.ruoyi.account.util.GiveVipUtil; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.PointChangeDto; |
| | | import com.ruoyi.common.core.enums.status.AppUserStatusEnum; |
| | | import com.ruoyi.common.core.utils.JwtUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | |
| | | import com.ruoyi.order.api.feignClient.ExchangeOrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import com.ruoyi.other.api.domain.*; |
| | | import com.ruoyi.other.api.dto.UnitListQueryDto; |
| | | import com.ruoyi.other.api.domain.TCompany; |
| | | import com.ruoyi.other.api.domain.TCoupon; |
| | | import com.ruoyi.other.api.domain.TIntegralRule; |
| | | import com.ruoyi.other.api.domain.TUserTag; |
| | | import com.ruoyi.other.api.feignClient.IntegralRuleClient; |
| | | import com.ruoyi.other.api.feignClient.OtherClient; |
| | | import com.ruoyi.other.api.feignClient.VipClient; |
| | | import com.ruoyi.system.api.model.LoginUserApplet; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private TAppUserCarService carService; |
| | | @Resource |
| | | private IntegralRuleClient integralRuleClient; |
| | | |
| | | @Resource |
| | | private VipClient vipClient; |
| | | |
| | | |
| | | |
| | |
| | | public R pointsDetail(@RequestBody UserChangeDto userChangeDto) { |
| | | TAppUser appUser = appUserService.getById(userChangeDto.getUserId()); |
| | | appUser.setStatus(userChangeDto.getStatus()); |
| | | appUser.setRemark(userChangeDto.getRemark()); |
| | | appUserService.updateById(appUser); |
| | | return R.ok(); |
| | | } |
| | |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | TAppUser byId = appUserService.getById(userId); |
| | | AppUserInfoDto appUserInfoDto = new AppUserInfoDto(); |
| | | TVip data = vipClient.getVipInfoByType(2).getData(); |
| | | appUserInfoDto.setMinPrice(data.getMonthlyCard()); |
| | | |
| | | //判断会员 |
| | | if (byId.getVipEndTime()==null||byId.getVipEndTime().isBefore(LocalDateTime.now())){ |
| | |
| | | TCoupon coupon = JSON.toJavaObject(JSON.parseObject(tAppCoupon.getCouponJson()), TCoupon.class); |
| | | InfoCouponDto infoCouponDto = new InfoCouponDto(); |
| | | BeanUtils.copyProperties(coupon,infoCouponDto); |
| | | infoCouponDto.setId(tAppCoupon.getId()); |
| | | couponDtos.add(infoCouponDto); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "签到", tags = {"小程序-个人中心-签到"}) |
| | | @PostMapping(value = "/user/sign") |
| | | @GetMapping(value = "/user/sign") |
| | | public R sign() { |
| | | LoginUserApplet loginUserApplet = tokenService.getLoginUserApplet(); |
| | | Long userId = loginUserApplet.getUserId(); |
| | |
| | | signService.updateById(appUserSign); |
| | | } |
| | | } |
| | | pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+points,1,userId,"每日签到",""); |
| | | pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+points,1,userId,"每日签到","JF"); |
| | | byId.setPoints(byId.getPoints()+points); |
| | | appUserService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | //已签到日期 |
| | | @ApiOperation(value = "本月已签到日期", tags = {"小程序-个人中心-签到"}) |
| | | @GetMapping(value = "/user/has/sign") |
| | | public R<List<TAppUserSign>> hasSign() { |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | DateTime startOfMonth = DateUtil.beginOfMonth(new Date()); |
| | | DateTime endOfMonth = DateUtil.endOfMonth(new Date()); |
| | | // 获取用户的所有签到记录 |
| | | List<TAppUserSign> signRecords = signService.lambdaQuery() |
| | | .between(TAppUserSign::getSignDay, startOfMonth, endOfMonth) |
| | | .eq(TAppUserSign::getAppUserId, userId) |
| | | .orderByDesc(TAppUserSign::getSignDay) |
| | | .list(); |
| | | return R.ok(signRecords); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | //已连续签到多少天 |
| | | |
| | | @ApiOperation(value = "本月已连续签到天数", tags = {"小程序-个人中心-签到"}) |
| | | @GetMapping(value = "/user/continue/sign") |
| | | public R continueSign() { |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | int days = signDayUtil.calculateContinuousSignDays(userId); |
| | | return R.ok(days); |
| | | } |
| | | |
| | | |
| | | |
| | | //积分变化记录用 |
| | | @PostMapping(value = "/user/points/change") |
| | | public R change(@RequestBody PointChangeDto points) { |
| | | TAppUser byId = appUserService.getById(points.getUserId()); |
| | | pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+points.getPoints(),points.getType(),points.getUserId(),points.getRemark(),"JF"); |
| | | byId.setPoints(byId.getPoints()+points.getPoints()); |
| | | appUserService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加编辑车辆", tags = {"小程序-个人中心-车辆"}) |
| | | @PostMapping(value = "/user/car/addOrUpdate") |
| | |
| | | public void addDetail(Integer old,Integer now,Integer type,Long userId,String extension,String code){ |
| | | |
| | | TAppUserIntegralChange tAppUserIntegralChange= new TAppUserIntegralChange(); |
| | | tAppUserIntegralChange.setCode(OrderCodeUtil.getOrderCode("DH")); |
| | | tAppUserIntegralChange.setCode(OrderCodeUtil.getOrderCode(code)); |
| | | tAppUserIntegralChange.setAppUserId(userId); |
| | | tAppUserIntegralChange.setChangeType(type); |
| | | tAppUserIntegralChange.setHistoricalIntegral(old); |
| | |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.builder.ExcelWriterBuilder; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.chargingPile.api.dto.ApplyChargingQuery; |
| | | import com.ruoyi.chargingPile.api.dto.ApplyChargingRemarkDto; |
| | |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.regex.Pattern; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @PostMapping(value = "/page") |
| | | public AjaxResult<Page<TApplyChargingPile>> page(ApplyChargingQuery applyChargingQuery) { |
| | | Page<TApplyChargingPile> page = applyChargingPileService.lambdaQuery() |
| | | .like(applyChargingQuery.getName() != null && !applyChargingQuery.getName().equals(""), TApplyChargingPile::getAgentPhone, applyChargingQuery.getName()) |
| | | .like(applyChargingQuery.getLandlordPhone() != null && !applyChargingQuery.getLandlordPhone().equals(""), TApplyChargingPile::getLandlordPhone, applyChargingQuery.getLandlordPhone()) |
| | | .page(Page.of(applyChargingQuery.getPageCurr(), applyChargingQuery.getPageSize())); |
| | | return AjaxResult.ok(page); |
| | | } |
| | |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "导出") |
| | | @PutMapping(value = "/export") |
| | | public R export(HttpServletResponse response) { |
| | | public R export(String landlordPhone,HttpServletResponse response) { |
| | | try { |
| | | response.setCharacterEncoding(Constants.UTF8); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | |
| | | return R.fail("excel导出失败!"); |
| | | } |
| | | try { |
| | | List<TApplyChargingPile> list = applyChargingPileService.lambdaQuery().last("limit 1").list(); |
| | | List<TApplyChargingPile> list = applyChargingPileService.lambdaQuery().like(landlordPhone != null && !landlordPhone.equals(""), TApplyChargingPile::getLandlordPhone, landlordPhone).list(); |
| | | |
| | | List<TApplyChargingPileExportDto> exportDtos =new ArrayList<>(); |
| | | for (TApplyChargingPile tApplyChargingPile : list) { |
| | | TApplyChargingPileExportDto applyChargingPileExportDto = new TApplyChargingPileExportDto(); |
| | | BeanUtils.copyProperties(tApplyChargingPile,applyChargingPileExportDto); |
| | | applyChargingPileExportDto.setLandlordFrontIdCard(new URL(tApplyChargingPile.getLandlordFrontIdCard())); |
| | | applyChargingPileExportDto.setLandlordBackIdCard(new URL(tApplyChargingPile.getLandlordBackIdCard())); |
| | | applyChargingPileExportDto.setAgentBackIdCard(new URL(tApplyChargingPile.getAgentBackIdCard())); |
| | | applyChargingPileExportDto.setAgentFrontIdCard(new URL(tApplyChargingPile.getAgentFrontIdCard())); |
| | | List<URL> urls = new ArrayList<>(); |
| | | urls.add(new URL("https://img-blog.csdnimg.cn/direct/c11088e1790049a5b84a0fda21a271b1.png")); |
| | | urls.add(new URL("https://img-blog.csdnimg.cn/direct/c11088e1790049a5b84a0fda21a271b1.png")); |
| | | urls.add(new URL("https://img-blog.csdnimg.cn/direct/c11088e1790049a5b84a0fda21a271b1.png")); |
| | | applyChargingPileExportDto.setUrls(urls); |
| | | JSONArray p1 = JSON.parseArray(tApplyChargingPile.getLandlordFrontIdCard()); |
| | | if (!p1.isEmpty()) { |
| | | applyChargingPileExportDto.setLandlordFrontIdCard(new URL((String) p1.get(0))); |
| | | } |
| | | JSONArray p2 = JSON.parseArray(tApplyChargingPile.getLandlordBackIdCard()); |
| | | if (!p2.isEmpty()){ |
| | | applyChargingPileExportDto.setLandlordBackIdCard(new URL((String)p2.get(0)));} |
| | | JSONArray p3 = JSON.parseArray(tApplyChargingPile.getAgentBackIdCard()); |
| | | if (!p3.isEmpty()) |
| | | applyChargingPileExportDto.setAgentBackIdCard(new URL((String)p3.get(0))); |
| | | JSONArray p4 = JSON.parseArray(tApplyChargingPile.getAgentFrontIdCard()); |
| | | if (!p4.isEmpty()) { |
| | | applyChargingPileExportDto.setAgentFrontIdCard(new URL((String)p4.get(0))); |
| | | } |
| | | |
| | | if (tApplyChargingPile.getChargingPileUser()==1){ |
| | | JSONArray pics1 = JSON.parseArray(tApplyChargingPile.getFixedParkingPropertyRights()); |
| | | if (!pics1.isEmpty()) { |
| | | applyChargingPileExportDto.setPics1(new URL((String)pics1.get(0))); |
| | | } |
| | | JSONArray pics2 = JSON.parseArray(tApplyChargingPile.getConstructionCertificate()); |
| | | if (!pics1.isEmpty()) { |
| | | applyChargingPileExportDto.setPics2(new URL((String)pics2.get(0))); |
| | | } |
| | | }else { |
| | | JSONArray pics1 = JSON.parseArray(tApplyChargingPile.getTitleCertificate()); |
| | | if (!pics1.isEmpty()) { |
| | | applyChargingPileExportDto.setPics1(new URL((String)pics1.get(0))); |
| | | } |
| | | JSONArray pics2 = JSON.parseArray(tApplyChargingPile.getBusinessLicense()); |
| | | if (!pics1.isEmpty()) { |
| | | applyChargingPileExportDto.setPics2(new URL((String)pics2.get(0))); |
| | | } |
| | | } |
| | | |
| | | JSONArray objects1 = JSON.parseArray(tApplyChargingPile.getFurtherInformation()); |
| | | for (int i = 0; i < objects1.size(); i++) { |
| | | JSONObject jsonObject = JSON.parseObject(objects1.get(i).toString()); |
| | | System.err.println("==================="+jsonObject.get("url")); |
| | | |
| | | boolean isImage = isImageUrl(jsonObject); |
| | | if (!isImage){ |
| | | continue; |
| | | } |
| | | System.err.println("Is image: " + isImage); |
| | | if (i==0){ |
| | | applyChargingPileExportDto.setUrl1(new URL((String)jsonObject.get("url"))); |
| | | }else if (i==1){ |
| | | applyChargingPileExportDto.setUrl2(new URL((String)jsonObject.get("url"))); |
| | | }else if (i==2){ |
| | | applyChargingPileExportDto.setUrl3(new URL((String)jsonObject.get("url"))); |
| | | }else if (i==3){ |
| | | applyChargingPileExportDto.setUrl4(new URL((String)jsonObject.get("url"))); |
| | | }else if (i==4){ |
| | | applyChargingPileExportDto.setUrl5(new URL((String)jsonObject.get("url"))); |
| | | }else if (i==5){ |
| | | applyChargingPileExportDto.setUrl6(new URL((String)jsonObject.get("url"))); |
| | | } |
| | | } |
| | | |
| | | if (tApplyChargingPile.getLandlordHandling()==1){ |
| | | applyChargingPileExportDto.setIs1("是"); |
| | | }else { |
| | | applyChargingPileExportDto.setIs1("否"); |
| | | } |
| | | if (tApplyChargingPile.getChargingPileUser()==1){ |
| | | applyChargingPileExportDto.setIs2("是"); |
| | | }else { |
| | | applyChargingPileExportDto.setIs2("否"); |
| | | } |
| | | if (tApplyChargingPile.getChargingPile()==1){ |
| | | applyChargingPileExportDto.setIs3("是"); |
| | | }else { |
| | | applyChargingPileExportDto.setIs3("否"); |
| | | } |
| | | exportDtos.add(applyChargingPileExportDto); |
| | | |
| | | } |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | public static boolean isImageUrl(JSONObject jsonObject) { |
| | | String url = jsonObject.getString("url"); |
| | | Pattern pattern = Pattern.compile( |
| | | "^.*\\.(?i)(jpg|jpeg|png|gif|bmp|webp)$" |
| | | ); |
| | | return pattern.matcher(url).matches(); |
| | | } |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "详情") |
| | | @PostMapping(value = "/detail/{id}") |
| | | public AjaxResult<TApplyChargingPile> detail(@PathVariable Integer id) { |
| | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | private List<URL> urls; |
| | | private URL pics1; |
| | | private URL pics2; |
| | | private URL url1; |
| | | private URL url2; |
| | | private URL url3; |
| | | private URL url4; |
| | | private URL url5; |
| | | private URL url6; |
| | | private String is1; |
| | | private String is2; |
| | | private String is3; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public List<SiteVO> getMapSiteList(SiteQuery query) { |
| | | |
| | | if(StringUtils.isEmpty(query.getLon()) || StringUtils.isEmpty(query.getLat())){ |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | // 获取当前登录用户id |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | // 根据id查询用户信息 |
| | |
| | | ts.id, ts.partner_id, ts.code, ts.`name`, ts.site_type, ts.business_category, ts.status, ts.construction_site, ts.img_url, |
| | | ts.lon, ts.lat, ts.address, ts.country_code, ts.phone,ts.guide, ts.service_description, ts.vehicle_description, |
| | | ts.parking_space, ts.rate_description, ts.space_charge_explain, ts.accounting_strategy_id,ts.del_flag,tcg.fastCount, |
| | | tcg.slowCount,tcg.superCount,tasd.electrovalence,tasd.vipElectrovalence, |
| | | tcg.slowCount,tcg.superCount,tasd.electrovalence,tasd.vipElectrovalence,tcg.superFreeCount,tcg.fastFreeCount,tcg.slowFreeCount, |
| | | ROUND( |
| | | 6378.138 * 2 * ASIN( |
| | | SQRT( |
| | |
| | | select site_id, |
| | | SUM(CASE WHEN charge_mode = 1 THEN 1 ELSE 0 END) AS superCount, |
| | | SUM(CASE WHEN charge_mode = 2 THEN 1 ELSE 0 END) AS fastCount, |
| | | SUM(CASE WHEN charge_mode = 3 THEN 1 ELSE 0 END) AS slowCount |
| | | SUM(CASE WHEN charge_mode = 3 THEN 1 ELSE 0 END) AS slowCount, |
| | | SUM(CASE WHEN charge_mode = 1 and `status` = 2 THEN 1 ELSE 0 END) AS superFreeCount, |
| | | SUM(CASE WHEN charge_mode = 2 and `status` = 2 THEN 1 ELSE 0 END) AS fastFreeCount, |
| | | SUM(CASE WHEN charge_mode = 3 and `status` = 2 THEN 1 ELSE 0 END) AS slowFreeCount |
| | | from |
| | | t_charging_gun |
| | | where |
| | |
| | | * 运营平台远程控制启机 |
| | | */ |
| | | public static final String PLATFORM_START_CHARGING = "platform_start_charging"; |
| | | /** |
| | | * 运营平台远程停机 |
| | | */ |
| | | public static final String PLATFORM_STOP_CHARGING = "platform_stop_charging"; |
| | | /** |
| | | * 交易记录确认 |
| | | */ |
| | | public static final String CONFIRM_TRANSACTION_RECORD = "confirm_transaction_record"; |
| | | /** |
| | | * 远程账户余额更新 |
| | | */ |
| | | public static final String UPDATE_BALANCE = "update_balance"; |
| | | /** |
| | | * 离线卡数据同步 |
| | | */ |
| | | public static final String SYNCHRONIZE_OFFLINE_CARD = "synchronize_offline_card"; |
| | | /** |
| | | * 离线卡数据清除 |
| | | */ |
| | | public static final String CLEAR_OFFLINE_CARD = "clear_offline_card"; |
| | | /** |
| | | * 离线卡数据查询 |
| | | */ |
| | | public static final String QUERY_OFFLINE_CARD = "query_offline_card"; |
| | | /** |
| | | * 充电桩工作参数设置 |
| | | */ |
| | | public static final String WORKING_PARAMETER_SETTING = "working_parameter_setting"; |
| | | /** |
| | | * 对时设置 |
| | | */ |
| | | public static final String TIMING_SETTING = "timing_setting"; |
| | | /** |
| | | * 计费模型设置 |
| | | */ |
| | | public static final String SETUP_BILLING_MODEL = "setup_billing_model"; |
| | | /** |
| | | * 遥控地锁升锁与降锁命令 (下行) |
| | | */ |
| | | public static final String OPEN_OR_CLOSE_GROUND_LOCK = "open_or_close_ground_lock"; |
| | | /** |
| | | * 远程重启 |
| | | */ |
| | | public static final String PLATFORM_RESTART = "platform_restart"; |
| | | /** |
| | | * 远程更新 |
| | | */ |
| | | public static final String PLATFORM_REMOTE_UPDATE = "platform_remote_update"; |
| | | |
| | | } |
| | |
| | | private PlatformConfirmationChargingService platformConfirmationChargingService; |
| | | @Autowired |
| | | private PlatformStartChargingService platformStartChargingService; |
| | | @Autowired |
| | | private PlatformStopChargingService platformStopChargingService; |
| | | @Autowired |
| | | private ConfirmTransactionRecordService confirmTransactionRecordService; |
| | | @Autowired |
| | | private UpdateBalanceService updateBalanceService; |
| | | @Autowired |
| | | private SynchronizeOfflineCardService synchronizeOfflineCardService; |
| | | @Autowired |
| | | private ClearOfflineCardService clearOfflineCardService; |
| | | @Autowired |
| | | private QueryOfflineCardService queryOfflineCardService; |
| | | @Autowired |
| | | private WorkingParameterSettingService workingParameterSettingService; |
| | | @Autowired |
| | | private TimingSettingService timingSettingService; |
| | | @Autowired |
| | | private SetupBillingModelService setupBillingModelService; |
| | | @Autowired |
| | | private OpenOrCloseGroundLockService openOrCloseGroundLockService; |
| | | @Autowired |
| | | private PlatformRestartService platformRestartService; |
| | | @Autowired |
| | | private PlatformRemoteUpdateService platformRemoteUpdateService; |
| | | |
| | | /** |
| | | * 登录认证应答 |
| | |
| | | return getMessageJsonString(platformStartCharging, ServiceIdConstant.PLATFORM_START_CHARGING); |
| | | } |
| | | |
| | | /** |
| | | * 运营平台远程停机 |
| | | * @param platformStopCharging 实体对象 |
| | | * @return |
| | | */ |
| | | public String platformStopCharging(PlatformStopCharging platformStopCharging){ |
| | | platformStopChargingService.create(platformStopCharging); |
| | | return getMessageJsonString(platformStopCharging, ServiceIdConstant.PLATFORM_STOP_CHARGING); |
| | | } |
| | | |
| | | /** |
| | | * 交易记录确认 |
| | | * @param confirmTransactionRecord 实体对象 |
| | | * @return |
| | | */ |
| | | public String confirmTransactionRecord(ConfirmTransactionRecord confirmTransactionRecord){ |
| | | confirmTransactionRecordService.create(confirmTransactionRecord); |
| | | return getMessageJsonString(confirmTransactionRecord, ServiceIdConstant.CONFIRM_TRANSACTION_RECORD); |
| | | } |
| | | |
| | | /** |
| | | * 远程账户余额更新 |
| | | * @param updateBalance 实体对象 |
| | | * @return |
| | | */ |
| | | public String updateBalance(UpdateBalance updateBalance){ |
| | | updateBalanceService.create(updateBalance); |
| | | return getMessageJsonString(updateBalance, ServiceIdConstant.UPDATE_BALANCE); |
| | | } |
| | | |
| | | /** |
| | | * 离线卡数据同步 |
| | | * @param synchronizeOfflineCard 实体对象 |
| | | * @return |
| | | */ |
| | | public String synchronizeOfflineCard(SynchronizeOfflineCard synchronizeOfflineCard){ |
| | | synchronizeOfflineCardService.create(synchronizeOfflineCard); |
| | | return getMessageJsonString(synchronizeOfflineCard, ServiceIdConstant.SYNCHRONIZE_OFFLINE_CARD); |
| | | } |
| | | |
| | | /** |
| | | * 离线卡数据清除 |
| | | * @param clearOfflineCard 实体对象 |
| | | * @return |
| | | */ |
| | | public String clearOfflineCard(ClearOfflineCard clearOfflineCard){ |
| | | clearOfflineCardService.create(clearOfflineCard); |
| | | return getMessageJsonString(clearOfflineCard, ServiceIdConstant.CLEAR_OFFLINE_CARD); |
| | | } |
| | | |
| | | /** |
| | | * 离线卡数据查询 |
| | | * @param queryOfflineCard 实体对象 |
| | | * @return |
| | | */ |
| | | public String queryOfflineCard(QueryOfflineCard queryOfflineCard){ |
| | | queryOfflineCardService.create(queryOfflineCard); |
| | | return getMessageJsonString(queryOfflineCard, ServiceIdConstant.QUERY_OFFLINE_CARD); |
| | | } |
| | | |
| | | /** |
| | | * 充电桩工作参数设置 |
| | | * @param workingParameterSetting 实体对象 |
| | | * @return |
| | | */ |
| | | public String workingParameterSetting(WorkingParameterSetting workingParameterSetting){ |
| | | workingParameterSettingService.create(workingParameterSetting); |
| | | return getMessageJsonString(workingParameterSetting, ServiceIdConstant.WORKING_PARAMETER_SETTING); |
| | | } |
| | | |
| | | /** |
| | | * 对时设置 |
| | | * @param timingSetting 实体对象 |
| | | * @return |
| | | */ |
| | | public String timingSetting(TimingSetting timingSetting){ |
| | | timingSettingService.create(timingSetting); |
| | | return getMessageJsonString(timingSetting, ServiceIdConstant.TIMING_SETTING); |
| | | } |
| | | |
| | | /** |
| | | * 计费模型设置 |
| | | * @param setupBillingModel 实体对象 |
| | | * @return |
| | | */ |
| | | public String setupBillingModel(SetupBillingModel setupBillingModel){ |
| | | setupBillingModelService.create(setupBillingModel); |
| | | return getMessageJsonString(setupBillingModel, ServiceIdConstant.SETUP_BILLING_MODEL); |
| | | } |
| | | |
| | | /** |
| | | * 遥控地锁升锁与降锁命令 (下行) |
| | | * @param openOrCloseGroundLock 实体对象 |
| | | * @return |
| | | */ |
| | | public String openOrCloseGroundLock(OpenOrCloseGroundLock openOrCloseGroundLock){ |
| | | openOrCloseGroundLockService.create(openOrCloseGroundLock); |
| | | return getMessageJsonString(openOrCloseGroundLock, ServiceIdConstant.OPEN_OR_CLOSE_GROUND_LOCK); |
| | | } |
| | | /** |
| | | * 远程重启 |
| | | * @param platformRestart 实体对象 |
| | | * @return |
| | | */ |
| | | public String platformRestart(PlatformRestart platformRestart){ |
| | | platformRestartService.create(platformRestart); |
| | | return getMessageJsonString(platformRestart, ServiceIdConstant.PLATFORM_RESTART); |
| | | } |
| | | /** |
| | | * 远程更新 |
| | | * @param platformRemoteUpdate 实体对象 |
| | | * @return |
| | | */ |
| | | public String platformRemoteUpdate(PlatformRemoteUpdate platformRemoteUpdate){ |
| | | platformRemoteUpdateService.create(platformRemoteUpdate); |
| | | return getMessageJsonString(platformRemoteUpdate, ServiceIdConstant.PLATFORM_REMOTE_UPDATE); |
| | | } |
| | | |
| | | /** |
| | | * 统一封装消息 |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.ClearOfflineCard; |
| | | |
| | | public interface ClearOfflineCardService extends BaseService<ClearOfflineCard> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.ConfirmTransactionRecord; |
| | | |
| | | public interface ConfirmTransactionRecordService extends BaseService<ConfirmTransactionRecord> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.OpenOrCloseGroundLock; |
| | | |
| | | public interface OpenOrCloseGroundLockService extends BaseService<OpenOrCloseGroundLock> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.PlatformRemoteUpdate; |
| | | |
| | | public interface PlatformRemoteUpdateService extends BaseService<PlatformRemoteUpdate> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.PlatformRestart; |
| | | |
| | | public interface PlatformRestartService extends BaseService<PlatformRestart> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.PlatformStopCharging; |
| | | |
| | | public interface PlatformStopChargingService extends BaseService<PlatformStopCharging> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.QueryOfflineCard; |
| | | |
| | | public interface QueryOfflineCardService extends BaseService<QueryOfflineCard> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.SetupBillingModel; |
| | | |
| | | public interface SetupBillingModelService extends BaseService<SetupBillingModel> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.SynchronizeOfflineCard; |
| | | |
| | | public interface SynchronizeOfflineCardService extends BaseService<SynchronizeOfflineCard> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.TimingSetting; |
| | | |
| | | public interface TimingSettingService extends BaseService<TimingSetting> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.UpdateBalance; |
| | | |
| | | public interface UpdateBalanceService extends BaseService<UpdateBalance> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.WorkingParameterSetting; |
| | | |
| | | public interface WorkingParameterSettingService extends BaseService<WorkingParameterSetting> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.ClearOfflineCard; |
| | | import com.ruoyi.integration.mongodb.service.ClearOfflineCardService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ClearOfflineCardServiceImpl implements ClearOfflineCardService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(ClearOfflineCard clearOfflineCard) { |
| | | mongoTemplate.save(clearOfflineCard); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ClearOfflineCard findById(String id) { |
| | | return mongoTemplate.findById(id, ClearOfflineCard.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ClearOfflineCard> findAll() { |
| | | return mongoTemplate.findAll(ClearOfflineCard.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.ConfirmTransactionRecord; |
| | | import com.ruoyi.integration.mongodb.service.ConfirmTransactionRecordService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ConfirmTransactionRecordServiceImpl implements ConfirmTransactionRecordService { |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(ConfirmTransactionRecord confirmTransactionRecord) { |
| | | mongoTemplate.save(confirmTransactionRecord); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ConfirmTransactionRecord findById(String id) { |
| | | return mongoTemplate.findById(id, ConfirmTransactionRecord.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ConfirmTransactionRecord> findAll() { |
| | | return mongoTemplate.findAll(ConfirmTransactionRecord.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.OpenOrCloseGroundLock; |
| | | import com.ruoyi.integration.mongodb.service.OpenOrCloseGroundLockService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class OpenOrCloseGroundLockServiceImpl implements OpenOrCloseGroundLockService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(OpenOrCloseGroundLock openOrCloseGroundLock) { |
| | | mongoTemplate.save(openOrCloseGroundLock); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public OpenOrCloseGroundLock findById(String id) { |
| | | return mongoTemplate.findById(id, OpenOrCloseGroundLock.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<OpenOrCloseGroundLock> findAll() { |
| | | return mongoTemplate.findAll(OpenOrCloseGroundLock.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.PlatformRemoteUpdate; |
| | | import com.ruoyi.integration.mongodb.service.PlatformRemoteUpdateService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class PlatformRemoteUpdateServiceImpl implements PlatformRemoteUpdateService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(PlatformRemoteUpdate platformRemoteUpdate) { |
| | | mongoTemplate.save(platformRemoteUpdate); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformRemoteUpdate findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformRemoteUpdate.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformRemoteUpdate> findAll() { |
| | | return mongoTemplate.findAll(PlatformRemoteUpdate.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.PlatformRestart; |
| | | import com.ruoyi.integration.mongodb.service.PlatformRestartService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class PlatformRestartServiceImpl implements PlatformRestartService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(PlatformRestart platformRestart) { |
| | | mongoTemplate.save(platformRestart); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformRestart findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformRestart.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformRestart> findAll() { |
| | | return mongoTemplate.findAll(PlatformRestart.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.PlatformStopCharging; |
| | | import com.ruoyi.integration.mongodb.service.PlatformStopChargingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class PlatformStopChargingServiceImpl implements PlatformStopChargingService { |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(PlatformStopCharging platformStopCharging) { |
| | | mongoTemplate.save(platformStopCharging); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformStopCharging findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformStopCharging.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformStopCharging> findAll() { |
| | | return mongoTemplate.findAll(PlatformStopCharging.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.QueryOfflineCard; |
| | | import com.ruoyi.integration.mongodb.service.QueryOfflineCardService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class QueryOfflineCardServiceImpl implements QueryOfflineCardService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(QueryOfflineCard queryOfflineCard) { |
| | | mongoTemplate.save(queryOfflineCard); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public QueryOfflineCard findById(String id) { |
| | | return mongoTemplate.findById(id, QueryOfflineCard.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<QueryOfflineCard> findAll() { |
| | | return mongoTemplate.findAll(QueryOfflineCard.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.SetupBillingModel; |
| | | import com.ruoyi.integration.mongodb.service.SetupBillingModelService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class SetupBillingModelServiceImpl implements SetupBillingModelService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(SetupBillingModel setupBillingModel) { |
| | | mongoTemplate.save(setupBillingModel); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public SetupBillingModel findById(String id) { |
| | | return mongoTemplate.findById(id, SetupBillingModel.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<SetupBillingModel> findAll() { |
| | | return mongoTemplate.findAll(SetupBillingModel.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.SynchronizeOfflineCard; |
| | | import com.ruoyi.integration.mongodb.service.SynchronizeOfflineCardService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class SynchronizeOfflineCardServiceImpl implements SynchronizeOfflineCardService { |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(SynchronizeOfflineCard synchronizeOfflineCard) { |
| | | mongoTemplate.save(synchronizeOfflineCard); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public SynchronizeOfflineCard findById(String id) { |
| | | return mongoTemplate.findById(id, SynchronizeOfflineCard.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<SynchronizeOfflineCard> findAll() { |
| | | return mongoTemplate.findAll(SynchronizeOfflineCard.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.TimingSetting; |
| | | import com.ruoyi.integration.mongodb.service.TimingSettingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class TimingSettingServiceImpl implements TimingSettingService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(TimingSetting timingSetting) { |
| | | mongoTemplate.save(timingSetting); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public TimingSetting findById(String id) { |
| | | return mongoTemplate.findById(id, TimingSetting.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<TimingSetting> findAll() { |
| | | return mongoTemplate.findAll(TimingSetting.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.UpdateBalance; |
| | | import com.ruoyi.integration.mongodb.service.UpdateBalanceService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class UpdateBalanceServiceImpl implements UpdateBalanceService { |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(UpdateBalance updateBalance) { |
| | | mongoTemplate.save(updateBalance); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public UpdateBalance findById(String id) { |
| | | return mongoTemplate.findById(id, UpdateBalance.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<UpdateBalance> findAll() { |
| | | return mongoTemplate.findAll(UpdateBalance.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.WorkingParameterSetting; |
| | | import com.ruoyi.integration.mongodb.service.WorkingParameterSettingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class WorkingParameterSettingServiceImpl implements WorkingParameterSettingService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(WorkingParameterSetting workingParameterSetting) { |
| | | mongoTemplate.save(workingParameterSetting); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public WorkingParameterSetting findById(String id) { |
| | | return mongoTemplate.findById(id, WorkingParameterSetting.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<WorkingParameterSetting> findAll() { |
| | | return mongoTemplate.findAll(WorkingParameterSetting.class); |
| | | } |
| | | } |
| | |
| | | tExchangeOrder.setCreateTime(LocalDateTime.now()); |
| | | tExchangeOrder.setDelFlag(false); |
| | | exchangeOrderService.save(tExchangeOrder); |
| | | return R.ok(); |
| | | return R.ok(tExchangeOrder.getId()); |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.order.controller; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.ExchangeDto; |
| | | import com.ruoyi.common.core.utils.OrderCodeUtil; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | |
| | | List<MyShoppingOrderList> list = shoppingOrderService.getNoInvoicedOrder(query); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | // @PostMapping("/create") |
| | | // public R<Long> shopCreate(@RequestBody ExchangeDto exchangeDto){ |
| | | // TShoppingOrder shoppingOrder = new TShoppingOrder(); |
| | | // shoppingOrder.setCode(OrderCodeUtil.getOrderCode("GW")); |
| | | // shoppingOrder.setAppUserId(exchangeDto.getUserId()); |
| | | // shoppingOrder.setOrderType(exchangeDto.getGoodType()); |
| | | // if (exchangeDto.getGoodType()==1) { |
| | | // shoppingOrder.setGoodsId(exchangeDto.getGoodId()); |
| | | // }else { |
| | | // shoppingOrder.setCouponId(exchangeDto.getGoodId()); |
| | | // } |
| | | // shoppingOrder.setPurchaseQuantity(exchangeDto.getNum()); |
| | | // shoppingOrder.setAppUserAddressId(Long.valueOf(exchangeDto.getAddressId())); |
| | | // shoppingOrder.setOrderAmount(new BigDecimal("0")); |
| | | // shoppingOrder.setAppCouponId(0L); |
| | | // shoppingOrder.setCouponDiscountAmount(new BigDecimal("0")); |
| | | // shoppingOrder.setVipDiscount(new BigDecimal("0")); |
| | | // shoppingOrder.setVipDiscountAmount(new BigDecimal("0")); |
| | | // shoppingOrder.setPaymentAmount(new BigDecimal("0")); |
| | | // shoppingOrder.setPaymentStatus(0); |
| | | // shoppingOrder.setPaymentType(0); |
| | | // shoppingOrder.setSerialNumber(""); |
| | | // shoppingOrder.setRemark(""); |
| | | // shoppingOrder.setStatus(0); |
| | | // shoppingOrder.setExpressCompany(""); |
| | | // shoppingOrder.setExpressNumber(""); |
| | | // shoppingOrder.setConsignerId(0); |
| | | // shoppingOrder.setConsignerTime(LocalDateTime.now()); |
| | | // shoppingOrder.setReceivingTime(LocalDateTime.now()); |
| | | // shoppingOrder.setCancellationTime(LocalDateTime.now()); |
| | | // shoppingOrder.setCancellationId(0); |
| | | // shoppingOrder.setRefundCode(""); |
| | | // shoppingOrder.setRefundAmount(new BigDecimal("0")); |
| | | // shoppingOrder.setRefundStatus(0); |
| | | // shoppingOrder.setRefundSerialNumber(""); |
| | | // shoppingOrder.setRefundTime(LocalDateTime.now()); |
| | | // shoppingOrder.setCreateTime(LocalDateTime.now()); |
| | | // shoppingOrder.setDelFlag(false); |
| | | // |
| | | // |
| | | // |
| | | // } |
| | | } |
| | | |
| | |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.AppGoodQuery; |
| | | import com.ruoyi.common.core.dto.PointChangeDto; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | |
| | | |
| | | @ApiOperation(tags = {"小程序-兑换商城"},value = "商品列表分页查询") |
| | | @PostMapping(value = "/app/pageList") |
| | | public AjaxResult<PageInfo<TGoods>> apppageList(BasePage basePage) { |
| | | return AjaxResult.ok(goodsService.pageList1(basePage)); |
| | | public AjaxResult<PageInfo<TGoods>> apppageList(@RequestBody AppGoodQuery appGoodQuery) { |
| | | return AjaxResult.ok(goodsService.pageList1(appGoodQuery)); |
| | | } |
| | | |
| | | @ApiOperation(tags = {"小程序-兑换商城"},value = "兑换商品") |
| | | @ApiOperation(tags = {"小程序-兑换商城"},value = "积分兑换商品") |
| | | @PostMapping(value = "/app/shop") |
| | | public AjaxResult<PageInfo<TGoods>> shop(@RequestBody ExchangeDto exchangeDto) { |
| | | //检查当前用户积分是否够 |
| | |
| | | } |
| | | exchangeDto.setPoint(point); |
| | | //生成积分兑换成功的订单 |
| | | orderClient.exchangeCreate(exchangeDto); |
| | | R<Long> longR = orderClient.exchangeCreate(exchangeDto); |
| | | if (exchangeDto.getGoodType()==2) { |
| | | //如果是优惠卷,赠送优惠卷给用户 |
| | | GrantCouponDto grantCouponDto = new GrantCouponDto(); |
| | |
| | | appCouponClient.grantCoupon(grantCouponDto); |
| | | } |
| | | //生成消耗积分的记录 |
| | | |
| | | |
| | | |
| | | PointChangeDto pointChangeDto = new PointChangeDto(); |
| | | pointChangeDto.setUserId(userId); |
| | | pointChangeDto.setPoints(point); |
| | | pointChangeDto.setRemark(longR.getData().toString()); |
| | | pointChangeDto.setType(6); |
| | | appUserClient.change(pointChangeDto); |
| | | return AjaxResult.success(); |
| | | |
| | | |
| | | } |
| | | |
| | | // @ApiOperation(tags = {"小程序-兑换商城"},value = "支付商品") |
| | | // @PostMapping(value = "/app/pay") |
| | | // public AjaxResult<PageInfo<TGoods>> pay(@RequestBody ExchangeDto exchangeDto) { |
| | | // |
| | | // //创建订单 |
| | | // |
| | | // //计算价格 |
| | | // |
| | | // //调起支付 |
| | | // |
| | | // |
| | | // |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 根据id获取商品信息 |
| | |
| | | package com.ruoyi.other.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.dto.AppGoodQuery; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.other.api.domain.TActivity; |
| | | import com.ruoyi.other.api.domain.TGoods; |
| | |
| | | public interface TGoodsMapper extends BaseMapper<TGoods> { |
| | | |
| | | List<TGoods> pageList(@Param("pageInfo")PageInfo<TGoods> pageInfo, @Param("req") GoodsDTO dto); |
| | | List<TGoods> pageList1(@Param("pageInfo")PageInfo<TGoods> pageInfo); |
| | | List<TGoods> pageList1(@Param("pageInfo")PageInfo<TGoods> pageInfo, @Param("appGoodQuery")AppGoodQuery appGoodQuery); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.dto.AppGoodQuery; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.other.api.domain.TGoods; |
| | |
| | | public interface TGoodsService extends IService<TGoods> { |
| | | |
| | | PageInfo<TGoods> pageList(GoodsDTO dto); |
| | | PageInfo<TGoods> pageList1(BasePage basePage); |
| | | PageInfo<TGoods> pageList1(AppGoodQuery appGoodQuery); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.ruoyi.common.core.dto.AppGoodQuery; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | |
| | | return pageInfo; |
| | | } |
| | | @Override |
| | | public PageInfo<TGoods> pageList1(BasePage basePage) { |
| | | public PageInfo<TGoods> pageList1(AppGoodQuery basePage) { |
| | | GoodsDTO dto = new GoodsDTO(); |
| | | dto.setType(2); |
| | | dto.setStatus(1); |
| | | dto.setPageCurr(basePage.getPageCurr()); |
| | | dto.setPageSize(basePage.getPageSize()); |
| | | PageInfo<TGoods> pageInfo = new PageInfo<>(dto.getPageCurr(),dto.getPageSize()); |
| | | List<TGoods> list = this.baseMapper.pageList1(pageInfo); |
| | | List<TGoods> list = this.baseMapper.pageList1(pageInfo,basePage); |
| | | |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (TGoods temp : list) { |
| | |
| | | </select> |
| | | |
| | | <select id="pageList1" resultType="com.ruoyi.other.api.domain.TGoods"> |
| | | select * from t_goods |
| | | <where> |
| | | AND del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | </where> |
| | | SELECT |
| | | id,name,redeem_points,inventory |
| | | FROM |
| | | t_goods |
| | | WHERE `status` = 1 and del_flag = 0 and type = #{appGoodQuery.type} |
| | | UNION ALL |
| | | SELECT |
| | | id,name,redeem_points,inventory_quantity as inventory |
| | | FROM |
| | | t_coupon |
| | | WHERE `status`= 1 and del_flag = 0 and type = #{appGoodQuery.type} |
| | | ORDER BY |
| | | CASE WHEN `inventory` = 0 THEN 0 ELSE 1 END DESC, |
| | | `redeem_points` ASC; |
| | | CASE |
| | | |
| | | WHEN `inventory` = 0 THEN |
| | | 0 ELSE 1 |
| | | END DESC, |
| | | `redeem_points` ASC; |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | public R<Map<String, Object>> payNotify(HttpServletRequest request) throws Exception { |
| | | try { |
| | | Map<String, Object> params = wxV3Pay.verifyNotify(request, new TypeReference<Map<String, Object>>() {}); |
| | | String outRefundNo = (String) params.get("out_refund_no"); |
| | | String substring = outRefundNo.substring(0, 2); |
| | | switch (substring){ |
| | | //购物订单 |
| | | case "GW": |
| | | //更改订单状态 |
| | | //如果是优惠卷赠送优惠卷 |
| | | break; |
| | | } |
| | | |
| | | log.info("支付回调:{}", params); |
| | | return R.ok(params); |
| | | } catch (Exception e) { |