Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_app_user_sign") |
| | | @ApiModel(value="TAppUserSign对象", description="") |
| | | public class TAppUserSign extends BasePojo { |
| | | public class TAppUserSign implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | private BigDecimal electrovalence; |
| | | @ApiModelProperty(value = "会员电价") |
| | | private BigDecimal vipElectrovalence; |
| | | @ApiModelProperty(value = "距离 单位米") |
| | | private BigDecimal distance; |
| | | |
| | | } |
| | |
| | | * 会员服务 |
| | | * @author ruoyi |
| | | */ |
| | | @FeignClient(contextId = "VipClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = VipFallbackFactory.class) |
| | | @FeignClient(contextId = "VipClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = VipFallbackFactory.class) |
| | | public interface VipClient { |
| | | |
| | | /** |
| | |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/21 17:41 |
| | | */ |
| | | @FeignClient(contextId = "WebSocketClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = WebSocketFallbackFactory.class) |
| | | @FeignClient(contextId = "WebSocketClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = WebSocketFallbackFactory.class) |
| | | public interface WebSocketClient { |
| | | |
| | | |
| | |
| | | <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-seata</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- SpringBoot Actuator --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-other</artifactId> |
| | | <version>3.6.2</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-chargingPile</artifactId> |
| | | <version>3.6.2</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.seata</groupId> |
| | | <artifactId>seata-all</artifactId> |
| | | <version>1.6.1</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | |
| | | if (user.getPhonenumber() != null) { |
| | | user.setUserName(user.getPhonenumber()); |
| | | } |
| | | user.setPassword(null); |
| | | user.setUpdateBy(SecurityUtils.getUsername()); |
| | | user.setUpdateTime(new Date()); |
| | | userService.updateUser(user); |
| | |
| | | where r.role_key=#{roleKey} and r.del_flag = '0' limit 1 |
| | | </select> |
| | | <select id="isExitUpdate" resultType="com.ruoyi.system.api.domain.SysRole"> |
| | | select role_name romeName from sys_role where role_name=#{roleName} and companyId =#{companyId} and role_id != #{roleId} |
| | | select role_name romeName from sys_role where role_name=#{roleName} and role_id != #{roleId} |
| | | </select> |
| | | |
| | | <insert id="insertRole" parameterType="com.ruoyi.system.api.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId"> |
| | |
| | | <if test="roleId != null and roleId != 0">role_id,</if> |
| | | <if test="roleName != null and roleName != ''">role_name,</if> |
| | | <if test="roleKey != null and roleKey != ''">role_key,</if> |
| | | <if test="roleSort != null">role_sort,</if> |
| | | <if test="dataScope != null and dataScope != ''">data_scope,</if> |
| | | <if test="menuCheckStrictly != null">menu_check_strictly,</if> |
| | | <if test="deptCheckStrictly != null">dept_check_strictly,</if> |
| | | <if test="status != null and status != ''">status,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | <if test="carDataAuth != null and carDataAuth != ''">carDataAuth,</if> |
| | | <if test="carTrainOperAuth != null and carTrainOperAuth != ''">carTrainOperAuth,</if> |
| | | <if test="contractDataAuth != null and contractDataAuth != ''">contractDataAuth,</if> |
| | | <if test="companyId != null and companyId != ''">companyId,</if> |
| | | create_time |
| | | )values( |
| | | <if test="roleId != null and roleId != 0">#{roleId},</if> |
| | | <if test="roleName != null and roleName != ''">#{roleName},</if> |
| | | <if test="roleKey != null and roleKey != ''">#{roleKey},</if> |
| | | <if test="roleSort != null">#{roleSort},</if> |
| | | <if test="dataScope != null and dataScope != ''">#{dataScope},</if> |
| | | <if test="menuCheckStrictly != null">#{menuCheckStrictly},</if> |
| | | <if test="deptCheckStrictly != null">#{deptCheckStrictly},</if> |
| | | <if test="status != null and status != ''">#{status},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="carDataAuth != null and carDataAuth != ''">#{carDataAuth},</if> |
| | | <if test="carTrainOperAuth != null and carTrainOperAuth != ''">#{carTrainOperAuth},</if> |
| | | <if test="contractDataAuth != null and contractDataAuth != ''">#{contractDataAuth},</if> |
| | | <if test="companyId != null and companyId != ''">#{companyId},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | |
| | | <set> |
| | | <if test="roleName != null and roleName != ''">role_name = #{roleName},</if> |
| | | <if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if> |
| | | <if test="roleSort != null">role_sort = #{roleSort},</if> |
| | | <if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if> |
| | | <if test="menuCheckStrictly != null">menu_check_strictly = #{menuCheckStrictly},</if> |
| | | <if test="deptCheckStrictly != null">dept_check_strictly = #{deptCheckStrictly},</if> |
| | | <if test="status != null and status != ''">status = #{status},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="carDataAuth != null and carDataAuth != ''">carDataAuth = #{carDataAuth},</if> |
| | | <if test="carTrainOperAuth != null and carTrainOperAuth != ''">carTrainOperAuth = #{carTrainOperAuth},</if> |
| | | <if test="contractDataAuth != null and contractDataAuth != ''">contractDataAuth = #{contractDataAuth},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where role_id = #{roleId} |
| | |
| | | <if test="loginDate != null">login_date = #{loginDate},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="forbiddenRemark != null">forbidden_remark = #{forbiddenRemark},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where user_id = #{userId} |
| | |
| | | public AjaxResult<PageInfo<SiteVO>> pageList(@Validated @RequestBody SiteQuery query){ |
| | | return AjaxResult.success(siteService.pageList(query)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取站点列表", tags = {"小程序-站点管理-地图导航站点"}) |
| | | @PostMapping("/getMapSiteList") |
| | | public AjaxResult<List<SiteVO>> getMapSiteList(@Validated @RequestBody SiteQuery query){ |
| | | return AjaxResult.success(siteService.getMapSiteList(query)); |
| | | } |
| | | @ApiOperation(value = "获取站点详细信息", tags = {"小程序-站点管理-站点详情"}) |
| | | @PostMapping("/getDetailById") |
| | | public AjaxResult<SiteDetailVO> getDetailById(@Validated @RequestBody SiteDetailQuery query){ |
| | |
| | | * @return |
| | | */ |
| | | List<Site> getSiteListGun(@Param("ids")Set<Integer> ids); |
| | | |
| | | /** |
| | | * 获取站点列表不分页 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<SiteVO> getMapSiteList(@Param("query")SiteQuery query); |
| | | } |
| | |
| | | */ |
| | | List<Site> getSiteListGun(); |
| | | |
| | | /** |
| | | * 获取站点列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<SiteVO> getMapSiteList(SiteQuery query); |
| | | } |
| | |
| | | return this.baseMapper.getSiteListGun(ids); |
| | | } |
| | | |
| | | @Override |
| | | public List<SiteVO> getMapSiteList(SiteQuery query) { |
| | | // 获取当前登录用户id |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | // 根据id查询用户信息 |
| | | TAppUser appUser = appUserClient.getUserById(userId).getData(); |
| | | List<SiteVO> list = this.baseMapper.getMapSiteList(query); |
| | | if(Objects.nonNull(appUser) && Objects.nonNull(appUser.getVipId())){ |
| | | // 查询会员信息 |
| | | TVip vip = vipClient.getInfo1(appUser.getVipId()).getData(); |
| | | if(Objects.nonNull(vip) && vip.getType() == 2){ |
| | | list.forEach(item -> { |
| | | item.setVipElectrovalence(vip.getDiscount().multiply(item.getElectrovalence())); |
| | | }); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设置站点计费策略 |
| | |
| | | select |
| | | a.accounting_strategy_id, |
| | | (a.electrovalence+a.service_charge) AS electrovalence, |
| | | ((a.electrovalence+a.service_charge)*a.discount) AS vipElectrovalence |
| | | ((a.electrovalence+a.service_charge)*b.discount) AS vipElectrovalence |
| | | from |
| | | t_accounting_strategy_detail a |
| | | left join |
| | | t_accounting_strategy b on (a.accounting_strategy_id = b.id) |
| | | where b.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | AND DATE_FORMAT(NOW(), '%H:%i:%s') between b.start_time and b.end_time) tasd on (ts.accounting_strategy_id = tasd.accounting_strategy_id) |
| | | AND DATE_FORMAT(NOW(), '%H:%i:%s') between a.start_time and a.end_time) tasd on (ts.accounting_strategy_id = tasd.accounting_strategy_id) |
| | | <where> |
| | | <if test="null != query.name and '' != query.name"> |
| | | and ts.`name` like CONCAT('%', #{query.name}, '%') |
| | | </if> |
| | | AND ts.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | AND ts.status = ${@com.ruoyi.common.core.enums.SiteStatusEnum@NORMAL_USE.getCode()} |
| | | AND ts.status = ${@com.ruoyi.common.core.enums.status.SiteStatusEnum@NORMAL_USE.getCode()} |
| | | </where> |
| | | <if test="query.sortType != null"> |
| | | <choose> |
| | | <when test="query.sortType == 1"> |
| | | ORDER BY ts.distance ASC |
| | | ORDER BY distance ASC |
| | | </when> |
| | | <when test="query.sortType == 2"> |
| | | ORDER BY tasd.electrovalence ASC |
| | |
| | | AND del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | </where> |
| | | </select> |
| | | <select id="getMapSiteList" resultType="com.ruoyi.chargingPile.api.vo.SiteVO"> |
| | | select |
| | | 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, |
| | | ROUND( |
| | | 6378.138 * 2 * ASIN( |
| | | SQRT( |
| | | POW( |
| | | SIN( |
| | | ( |
| | | #{query.lat} * PI() / 180 - ts.lat * PI() / 180 |
| | | ) / 2 |
| | | ), |
| | | 2 |
| | | ) + COS(#{query.lat} * PI() / 180) * COS(ts.lat * PI() / 180) * POW( |
| | | SIN( |
| | | ( |
| | | #{query.lon} * PI() / 180 - ts.lon * PI() / 180 |
| | | ) / 2 |
| | | ), |
| | | 2 |
| | | ) |
| | | ) |
| | | ) * 1000 |
| | | ) AS distance |
| | | from t_site ts |
| | | left join ( |
| | | 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 |
| | | from |
| | | t_charging_gun |
| | | where |
| | | del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | group by |
| | | site_id) tcg on (ts.id = tcg.site_id) |
| | | left join ( |
| | | select |
| | | a.accounting_strategy_id, |
| | | (a.electrovalence+a.service_charge) AS electrovalence, |
| | | ((a.electrovalence+a.service_charge)*b.discount) AS vipElectrovalence |
| | | from |
| | | t_accounting_strategy_detail a |
| | | left join |
| | | t_accounting_strategy b on (a.accounting_strategy_id = b.id) |
| | | where b.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | AND DATE_FORMAT(NOW(), '%H:%i:%s') between a.start_time and a.end_time) tasd on (ts.accounting_strategy_id = tasd.accounting_strategy_id) |
| | | <where> |
| | | <if test="null != query.name and '' != query.name"> |
| | | and ts.`name` like CONCAT('%', #{query.name}, '%') |
| | | </if> |
| | | AND ts.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | AND ts.status = ${@com.ruoyi.common.core.enums.status.SiteStatusEnum@NORMAL_USE.getCode()} |
| | | </where> |
| | | <if test="query.sortType != null"> |
| | | <choose> |
| | | <when test="query.sortType == 1"> |
| | | ORDER BY distance ASC |
| | | </when> |
| | | </choose> |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | public class IotDAConfig { |
| | | |
| | | /** |
| | | * ak配置 |
| | | * ak配置 SSD4HKIJPFO68W8QFSNG |
| | | */ |
| | | private String ak; |
| | | /** |
| | | * sk配置 |
| | | * sk配置 8Obp0fPsyFQ3bQUIaO2kKrS3XVPMOlXZ1nqPgK2k |
| | | */ |
| | | private String sk; |
| | | /** |
New file |
| | |
| | | package com.ruoyi.integration.iotda.constant; |
| | | |
| | | public class ServiceIdConstant { |
| | | /** |
| | | * 登录认证应答 |
| | | */ |
| | | public static final String ONLINE_REPLY = "online_reply"; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.integration.iotda.utils.listener; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * iotda消息监听 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | @RestController |
| | | public class IotMessageListener { |
| | | |
| | | |
| | | /** |
| | | * 设备消息监听 |
| | | * @param jsonObject |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | @PostMapping(value = "/message") |
| | | public AjaxResult<Integer> add(@RequestBody JSONObject jsonObject) throws IOException { |
| | | System.err.println(jsonObject); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.integration.iotda.utils.produce; |
| | | |
| | | import com.huaweicloud.sdk.core.exception.ConnectionException; |
| | | import com.huaweicloud.sdk.core.exception.RequestTimeoutException; |
| | | import com.huaweicloud.sdk.core.exception.ServiceResponseException; |
| | | import com.huaweicloud.sdk.iotda.v5.IoTDAClient; |
| | | import com.huaweicloud.sdk.iotda.v5.model.CreateMessageRequest; |
| | | import com.huaweicloud.sdk.iotda.v5.model.CreateMessageResponse; |
| | | import com.huaweicloud.sdk.iotda.v5.model.DeviceMessageRequest; |
| | | import com.ruoyi.common.core.utils.uuid.UUID; |
| | | import com.ruoyi.integration.iotda.builder.IotBuilder; |
| | | import com.ruoyi.integration.iotda.config.IotDAConfig; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | |
| | | @Component |
| | | public class IotMessageProduce { |
| | | |
| | | @Autowired |
| | | private IotBuilder iotBuilder; |
| | | |
| | | /** |
| | | * 设备消息下发 |
| | | * @param deviceId 设备id |
| | | * @param name 消息名称 |
| | | * @param message 消息内容 |
| | | * @return |
| | | */ |
| | | public String sendMessage(String deviceId,String name,String message){ |
| | | CreateMessageRequest request = new CreateMessageRequest(); |
| | | request.withDeviceId(deviceId); |
| | | DeviceMessageRequest body = new DeviceMessageRequest(); |
| | | body.withMessageId(UUID.randomUUID().toString()); |
| | | body.withName(name); |
| | | body.withMessage(message); |
| | | request.withBody(body); |
| | | try { |
| | | CreateMessageResponse response = iotBuilder.buildIot().createMessage(request); |
| | | System.out.println(response.toString()); |
| | | } catch (ConnectionException e) { |
| | | e.printStackTrace(); |
| | | } catch (RequestTimeoutException e) { |
| | | e.printStackTrace(); |
| | | } catch (ServiceResponseException e) { |
| | | e.printStackTrace(); |
| | | System.out.println(e.getHttpStatusCode()); |
| | | System.out.println(e.getRequestId()); |
| | | System.out.println(e.getErrorCode()); |
| | | System.out.println(e.getErrorMsg()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.iotda.utils.tools; |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.integration.iotda.constant.ServiceIdConstant; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class MessageUtil { |
| | | |
| | | /** |
| | | * 登录认证应答 |
| | | * @param charging_pile_code 桩编码 |
| | | * @param online_result 登录结果(0:成功,1:失败) |
| | | * @return |
| | | */ |
| | | public static String onlineReply(String charging_pile_code,Integer online_result){ |
| | | Map<String,Object> map = new HashMap<>(3); |
| | | map.put("service_id", ServiceIdConstant.ONLINE_REPLY); |
| | | map.put("charging_pile_code",charging_pile_code); |
| | | map.put("online_result",online_result); |
| | | return JSONObject.toJSONString(map); |
| | | } |
| | | |
| | | /** |
| | | * 心跳包应答 |
| | | * @param charging_pile_code 桩编码 |
| | | * @param charging_gun_code 枪号 |
| | | * @param charging_gun_status 心跳应答(0) |
| | | * @return |
| | | */ |
| | | public static String pong(String charging_pile_code,String charging_gun_code,Integer charging_gun_status){ |
| | | Map<String,Object> map = new HashMap<>(3); |
| | | map.put("service_id", ServiceIdConstant.ONLINE_REPLY); |
| | | map.put("charging_pile_code",charging_pile_code); |
| | | map.put("charging_gun_code",charging_gun_code); |
| | | map.put("charging_gun_status",charging_gun_status); |
| | | return JSONObject.toJSONString(map); |
| | | } |
| | | |
| | | } |
| | |
| | | private TokenService tokenService; |
| | | @Autowired |
| | | private TOrderEvaluateService orderEvaluateService; |
| | | @Autowired |
| | | private TOrderEvaluateTagService orderEvaluateTagService; |
| | | |
| | | @Resource |
| | | private WxPaymentClient wxPaymentClient; |
| | |
| | | @ResponseBody |
| | | @PostMapping(value = "/paymentChargingOrder") |
| | | @ApiOperation(value = "支付充电充值费用", tags = {"小程序-扫一扫"}) |
| | | public AjaxResult paymentChargingOrder(AddChargingOrder addChargingOrder){ |
| | | public AjaxResult paymentChargingOrder(@RequestBody AddChargingOrder addChargingOrder){ |
| | | return chargingOrderService.paymentChargingOrder(addChargingOrder); |
| | | } |
| | | |
| | |
| | | /** |
| | | * 查询订单申诉详情 |
| | | */ |
| | | @ApiOperation(tags = {"小程序-订单申诉"},value = "查询订单申诉详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TOrderAppealVO> getDetailById(@RequestParam("id") Integer id) { |
| | | @ApiOperation(tags = {"小程序-订单申诉"},value = "查询订单申诉详情") |
| | | public AjaxResult<TOrderAppealVO> getDetailById(Integer id) { |
| | | return AjaxResult.ok(orderAppealService.getDetailById(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping(value = "/addOrderAppeal") |
| | | @PostMapping(value = "/addOrderAppeal") |
| | | @ApiOperation(value = "申诉订单", tags = {"小程序-充电记录(个人中心)"}) |
| | | public AjaxResult addOrderAppeal(@RequestBody TOrderAppeal orderAppeal){ |
| | | Long appUserId = tokenService.getLoginUserApplet().getUserId(); |
| | |
| | | import java.time.LocalDateTime; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | |
| | | @PostMapping("/saveSet") |
| | | @ApiOperation(tags = {"管理后台-积分管理"},value = "保存积分设置") |
| | | public R saveSet(@RequestBody TIntegralRule dto) { |
| | | integralRuleService.updateById(dto); |
| | | // JSONObject jsonObject = JSONObject.parseObject(dto); |
| | | // String chargeCredit = jsonObject.getString("chargeCredit"); |
| | | // String credit = jsonObject.getString("credit"); |
| | | // String inviteUsersToEarnPoints = jsonObject.getString("inviteUsersToEarnPoints"); |
| | | // String addVehiclesEarnsPoints = jsonObject.getString("addVehiclesEarnsPoints"); |
| | | // String signInForPoints = jsonObject.getString("signInForPoints"); |
| | | // TIntegralRule tIntegralRule = new TIntegralRule(); |
| | | // tIntegralRule.setAddVehiclesEarnsPoints(signInForPoints); |
| | | // tIntegralRule.setChargeCredit(chargeCredit); |
| | | // tIntegralRule.setCredit(credit); |
| | | // tIntegralRule.setSignInForPoints(addVehiclesEarnsPoints); |
| | | // tIntegralRule.setInviteUsersToEarnPoints(inviteUsersToEarnPoints); |
| | | // TIntegralRule one = integralRuleService.getOne(null); |
| | | // if (one!=null){ |
| | | // one.setAddVehiclesEarnsPoints(signInForPoints); |
| | | // one.setChargeCredit(chargeCredit); |
| | | // one.setCredit(credit); |
| | | // one.setSignInForPoints(addVehiclesEarnsPoints); |
| | | // one.setInviteUsersToEarnPoints(inviteUsersToEarnPoints); |
| | | // integralRuleService.updateById(one); |
| | | // }else{ |
| | | // integralRuleService.save(tIntegralRule); |
| | | // } |
| | | TIntegralRule one = integralRuleService.getOne(null); |
| | | if (one!=null){ |
| | | dto.setId(one.getId()); |
| | | integralRuleService.saveOrUpdate(dto); |
| | | }else{ |
| | | integralRuleService.saveOrUpdate(dto); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | @GetMapping("/getInfo") |
| | |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.other.api.domain.TGoods"> |
| | | select * from t_goods |
| | | where 1=1 |
| | | <where> |
| | | <if test="req.name != null and req.name != ''"> |
| | | AND `name` LIKE concat('%',#{req.name}, '%') |
| | | </if> |
| | |
| | | <if test="req.otherState != null and req.otherState == 2"> |
| | | AND inventory = 0 |
| | | </if> |
| | | AND del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | |