城市编码、城市表
This commit is contained in:
parent
c58d84e756
commit
2bf46d2387
|
@ -1,11 +1,10 @@
|
|||
package com.ruoyi.web.controller.app;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.RlUser;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.model.RlModel;
|
||||
import com.ruoyi.system.domain.agent.RlAgent;
|
||||
import com.ruoyi.system.domain.city.RlCity;
|
||||
import com.ruoyi.system.domain.city.RlCityQuery;
|
||||
|
@ -17,6 +16,7 @@ import com.ruoyi.system.service.ISysDictDataService;
|
|||
import com.ruoyi.system.service.store.RlStoreService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class AppController extends BaseController
|
|||
private IRlAgentService rlAgentService;
|
||||
|
||||
@Autowired
|
||||
private IRlModelService eModelService;
|
||||
private IRlModelService modelService;
|
||||
|
||||
@Autowired
|
||||
private RlStoreService storeService;
|
||||
|
@ -60,13 +60,13 @@ public class AppController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取出租周期列表
|
||||
* 获取字典类型列表
|
||||
*/
|
||||
@GetMapping("/getRentalPeriod")
|
||||
public AjaxResult cityList()
|
||||
@GetMapping("/getDictData")
|
||||
public AjaxResult cityList(String dictType)
|
||||
{
|
||||
SysDictData sysDictData = new SysDictData();
|
||||
sysDictData.setDictType("rl_rental_period");
|
||||
sysDictData.setDictType(dictType);
|
||||
List<SysDictData> list = dictDataService.selectDictDataList(sysDictData);
|
||||
return success(list);
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ public class AppController extends BaseController
|
|||
logger.info("根据城市id获取车型列表:【cityId="+cityId+"】");
|
||||
RlAgent rlAgent = rlAgentService.selectRlAgentByCityId(cityId);
|
||||
if(rlAgent!=null){
|
||||
return success(eModelService.selectEModelListByAgentId(rlAgent.getAgentId()));
|
||||
return success(modelService.selectEModelListByAgentId(rlAgent.getAgentId()));
|
||||
}
|
||||
return error("代理商不存在");
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ public class AppController extends BaseController
|
|||
{
|
||||
logger.info("根据定位获取哪个城市:【lon="+lon+",lat="+lat+"】");
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
String city = rlCityService.getCityByLocation(lon,lat);
|
||||
RlCity city = rlCityService.getCityByLocation(lon, lat);
|
||||
ajax.put(AjaxResult.DATA_TAG, city);
|
||||
return ajax;
|
||||
}
|
||||
|
@ -147,7 +147,34 @@ public class AppController extends BaseController
|
|||
return success(storeService.selectSmStoreList(storeQuery));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据车型id获取详情
|
||||
*/
|
||||
@GetMapping("/getModelById")
|
||||
public AjaxResult getModelById(Long modelId)
|
||||
{
|
||||
logger.info("根据车型id获取详情:【modelId="+modelId+"】");
|
||||
if(modelId==null){
|
||||
return error("车型id[modelId]未传");
|
||||
}
|
||||
return success(modelService.selectEModelByModelId(modelId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据定位获取附近店铺列表
|
||||
*/
|
||||
@GetMapping("/getStoreListByLocation")
|
||||
public AjaxResult getStoreListByLocation(@RequestBody StoreQuery query)
|
||||
{
|
||||
logger.info("根据定位获取附近店铺列表:【StoreQuery="+ JSON.toJSONString(query)+"】");
|
||||
if(StrUtil.isBlank(query.getPhoneLon())){
|
||||
return error("经度[phoneLon]未传");
|
||||
}
|
||||
if(StrUtil.isBlank(query.getPhoneLat())){
|
||||
return error("纬度[phoneLat]未传");
|
||||
}
|
||||
return success(storeService.getStoreListByLocation(query));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
package com.ruoyi.web.controller.app;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.query.AuthenticationQuery;
|
||||
import com.ruoyi.system.service.IRlUserService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* app接口(需要登录校验的)
|
||||
* 校验
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/appVerify")
|
||||
public class AppVerifyController extends BaseController
|
||||
{
|
||||
|
||||
@Resource
|
||||
private IRlUserService rlUserService;
|
||||
|
||||
/**
|
||||
* 实名认证
|
||||
*/
|
||||
@Log(title = "实名认证", businessType = BusinessType.AUTHENTICATION)
|
||||
@GetMapping("/user/authentication")
|
||||
public AjaxResult authentication(AuthenticationQuery authenticationQuery)
|
||||
{
|
||||
logger.info("【实名认证】请求参数:authenticationQuery={}", JSON.toJSON(authenticationQuery));
|
||||
Object authentication = rlUserService.authentication(authenticationQuery);
|
||||
//判断o是否是字符串
|
||||
if(authentication instanceof String){
|
||||
return AjaxResult.error((String) authentication);
|
||||
}else{
|
||||
return AjaxResult.success(authentication);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package com.ruoyi.web.controller.rl;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.citycode.RlCityCode;
|
||||
import com.ruoyi.system.service.IRlCityCodeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 城市区号Controller
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2024-09-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/code")
|
||||
public class RlCityCodeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRlCityCodeService rlCityCodeService;
|
||||
|
||||
/**
|
||||
* 查询城市区号列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:code:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RlCityCode rlCityCode)
|
||||
{
|
||||
startPage();
|
||||
List<RlCityCode> list = rlCityCodeService.selectRlCityCodeList(rlCityCode);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出城市区号列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:code:export')")
|
||||
@Log(title = "城市区号", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RlCityCode rlCityCode)
|
||||
{
|
||||
List<RlCityCode> list = rlCityCodeService.selectRlCityCodeList(rlCityCode);
|
||||
ExcelUtil<RlCityCode> util = new ExcelUtil<RlCityCode>(RlCityCode.class);
|
||||
util.exportExcel(response, list, "城市区号数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取城市区号详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:code:query')")
|
||||
@GetMapping(value = "/{code}")
|
||||
public AjaxResult getInfo(@PathVariable("code") String code)
|
||||
{
|
||||
return success(rlCityCodeService.selectRlCityCodeByCode(code));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增城市区号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:code:add')")
|
||||
@Log(title = "城市区号", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RlCityCode rlCityCode)
|
||||
{
|
||||
return toAjax(rlCityCodeService.insertRlCityCode(rlCityCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改城市区号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:code:edit')")
|
||||
@Log(title = "城市区号", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RlCityCode rlCityCode)
|
||||
{
|
||||
return toAjax(rlCityCodeService.updateRlCityCode(rlCityCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除城市区号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:code:remove')")
|
||||
@Log(title = "城市区号", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{codes}")
|
||||
public AjaxResult remove(@PathVariable Long[] codes)
|
||||
{
|
||||
return toAjax(rlCityCodeService.deleteRlCityCodeByCodeIds(codes));
|
||||
}
|
||||
}
|
|
@ -187,3 +187,11 @@ geo:
|
|||
wx:
|
||||
appid: wx3428c498d5061192
|
||||
appSecret: 398d2cd38583a33233eef897996cc7ca
|
||||
et:
|
||||
# 手续费 4/1000 千分之几
|
||||
handlingCharge: 5.4
|
||||
verifyUrl: https://zidv2.market.alicloudapi.com/idcheck/Post
|
||||
appcode: 32b6c6445b1a42ed862dd4202392c47d
|
||||
repairAdmin: wx
|
||||
operateAdmin: root
|
||||
|
||||
|
|
|
@ -104,6 +104,17 @@ public class RlUser extends BaseEntity
|
|||
/** 店铺id */
|
||||
private Long storeId;
|
||||
|
||||
/** 是否认证:0-未认证;1-已认证 */
|
||||
public String isAuthentication;
|
||||
|
||||
public String getIsAuthentication() {
|
||||
return isAuthentication;
|
||||
}
|
||||
|
||||
public void setIsAuthentication(String isAuthentication) {
|
||||
this.isAuthentication = isAuthentication;
|
||||
}
|
||||
|
||||
public Long getStoreId() {
|
||||
return storeId;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.ruoyi.common.enums;
|
|||
|
||||
/**
|
||||
* 业务操作类型
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public enum BusinessType
|
||||
|
@ -51,9 +51,13 @@ public enum BusinessType
|
|||
* 生成代码
|
||||
*/
|
||||
GENCODE,
|
||||
|
||||
|
||||
/**
|
||||
* 清空数据
|
||||
*/
|
||||
CLEAN,
|
||||
/**
|
||||
* 实名认证
|
||||
*/
|
||||
AUTHENTICATION,
|
||||
}
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
package com.ruoyi.common.utils.verify;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.http.Method;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.common.utils.verify.vo.IDResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
public class VerifyIdentityUtil {
|
||||
|
||||
/**
|
||||
* 校验身份二要素是否一致
|
||||
* @param host 请求地址
|
||||
* @param appcode appcode
|
||||
* @param idCard 身份证号
|
||||
* @param realName 姓名
|
||||
* @return Boolean
|
||||
*/
|
||||
public static Object verifyIdentity(String host,String appcode,String idCard,String realName){
|
||||
try {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Authorization", "APPCODE " + appcode);
|
||||
//根据API的要求,定义相对应的Content-Type
|
||||
headers.put("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
|
||||
Map<String, Object> bodys = new HashMap<>();
|
||||
bodys.put("cardNo", idCard);
|
||||
bodys.put("realName", realName);
|
||||
String result= HttpUtil.createRequest(Method.POST, host).addHeaders(headers).form(bodys).execute().body();
|
||||
log.info("实名认证请求返回==================="+result);
|
||||
IDResponse idResponse = JSONObject.parseObject(result, IDResponse.class);
|
||||
if("成功".equals(idResponse.getReason())){
|
||||
IDResponse.Result result1 = idResponse.getResult();
|
||||
return result1;
|
||||
}else{
|
||||
return idResponse.getReason();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.ruoyi.common.utils.verify.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IDResponse {
|
||||
|
||||
private int error_code;
|
||||
|
||||
private String reason;
|
||||
|
||||
private Result result;
|
||||
|
||||
private String sn;
|
||||
|
||||
@Data
|
||||
public class Result {
|
||||
private String realname;
|
||||
|
||||
private String idcard;
|
||||
|
||||
private Boolean isok;
|
||||
|
||||
private IdCardInfor IdCardInfor;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public class IdCardInfor {
|
||||
private String province;
|
||||
|
||||
private String city;
|
||||
|
||||
private String district;
|
||||
|
||||
private String area;
|
||||
|
||||
private String sex;
|
||||
|
||||
private String birthday;
|
||||
|
||||
}
|
||||
}
|
|
@ -28,8 +28,12 @@ public class RlCity extends BaseEntity
|
|||
@Excel(name = "拼音")
|
||||
private String pinyin;
|
||||
|
||||
/** 行政级别 */
|
||||
@Excel(name = "行政级别")
|
||||
private String level;
|
||||
/** 地址编码 */
|
||||
@Excel(name = "地址编码")
|
||||
private String adcode;
|
||||
|
||||
/** 城市编码 */
|
||||
@Excel(name = "城市编码")
|
||||
private String citycode;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.system.domain.city;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
|
@ -12,4 +13,7 @@ import lombok.Data;
|
|||
public class RlCityVO extends RlCity
|
||||
{
|
||||
|
||||
@Excel(name = "城市名")
|
||||
private String cityName;
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package com.ruoyi.system.domain.citycode;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 城市区号对象 rl_city_code
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2024-09-19
|
||||
*/
|
||||
@Data
|
||||
public class RlCityCode extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编码id */
|
||||
private String code;
|
||||
|
||||
/** 城市 */
|
||||
@Excel(name = "城市")
|
||||
private String name;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.ruoyi.system.domain.citycode;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RlCityCodeQuery extends RlCityCode{
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.ruoyi.system.domain.citycode;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RlCityCodeVO extends RlCityCode{
|
||||
}
|
|
@ -5,6 +5,8 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 车辆型号对象 et_model
|
||||
*
|
||||
|
@ -44,4 +46,8 @@ public class RlModel extends BaseEntity
|
|||
@Excel(name = "简介")
|
||||
private String intro;
|
||||
|
||||
/** 押金 */
|
||||
@Excel(name = "押金")
|
||||
private BigDecimal deposit;
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.system.domain.query;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 实名认证对象
|
||||
*
|
||||
* @author 邱贞招
|
||||
* @date 2024-05-25
|
||||
*/
|
||||
@Data
|
||||
public class AuthenticationQuery {
|
||||
|
||||
/** 真实姓名 */
|
||||
private String realName;
|
||||
|
||||
/** 身份证 */
|
||||
private String idCard;
|
||||
|
||||
/** 身份证 */
|
||||
private Long userId;
|
||||
}
|
|
@ -129,4 +129,10 @@ public class Store extends BaseEntity
|
|||
|
||||
@ApiModelProperty("是否生效")
|
||||
private Boolean enabled;
|
||||
|
||||
@ApiModelProperty("是否免费送取车")
|
||||
private Boolean isFreeCar;
|
||||
|
||||
@ApiModelProperty("门店客服电话")
|
||||
private String serverPhone;
|
||||
}
|
||||
|
|
|
@ -4,8 +4,6 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author 辉
|
||||
* 2024/3/5
|
||||
|
@ -17,6 +15,9 @@ public class StoreVo extends Store {
|
|||
@ApiModelProperty("该店铺下的设备数量")
|
||||
private Integer deviceCount;
|
||||
|
||||
@ApiModelProperty("可租车辆")
|
||||
private Integer rentalCar;
|
||||
|
||||
@ApiModelProperty("距离")
|
||||
private double distance;
|
||||
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.system.domain.citycode.RlCityCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 城市区号Mapper接口
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2024-09-19
|
||||
*/
|
||||
public interface RlCityCodeMapper
|
||||
{
|
||||
/**
|
||||
* 查询城市区号
|
||||
*
|
||||
* @param code 城市区号
|
||||
* @return 城市区号
|
||||
*/
|
||||
public RlCityCode selectRlCityCodeByCode(String code);
|
||||
|
||||
/**
|
||||
* 查询城市区号列表
|
||||
*
|
||||
* @param rlCityCode 城市区号
|
||||
* @return 城市区号集合
|
||||
*/
|
||||
public List<RlCityCode> selectRlCityCodeList(RlCityCode rlCityCode);
|
||||
|
||||
/**
|
||||
* 新增城市区号
|
||||
*
|
||||
* @param rlCityCode 城市区号
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRlCityCode(RlCityCode rlCityCode);
|
||||
|
||||
/**
|
||||
* 修改城市区号
|
||||
*
|
||||
* @param rlCityCode 城市区号
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRlCityCode(RlCityCode rlCityCode);
|
||||
|
||||
/**
|
||||
* 删除城市区号
|
||||
*
|
||||
* @param codeId 城市区号主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRlCityCodeByCodeId(Long codeId);
|
||||
|
||||
/**
|
||||
* 批量删除城市区号
|
||||
*
|
||||
* @param codeIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRlCityCodeByCodeIds(Long[] codeIds);
|
||||
}
|
|
@ -59,4 +59,12 @@ public interface RlCityMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteRlCityByCityIds(Long[] cityIds);
|
||||
|
||||
/**
|
||||
* 根据地址编码查询城市
|
||||
*
|
||||
* @param adcode 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
RlCity selectRlCityByAdcode(String adcode);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public interface StoreMapper
|
|||
* @param store 商户
|
||||
* @return 商户集合
|
||||
*/
|
||||
public List<StoreVo> selectSmStoreList( @Param("query") StoreQuery store);
|
||||
public List<StoreVo> selectSmStoreList(@Param("query") StoreQuery store);
|
||||
|
||||
/**
|
||||
* 新增商户
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.system.domain.citycode.RlCityCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 城市区号Service接口
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2024-09-19
|
||||
*/
|
||||
public interface IRlCityCodeService
|
||||
{
|
||||
/**
|
||||
* 查询城市区号
|
||||
*
|
||||
* @param code 城市区号
|
||||
* @return 城市区号
|
||||
*/
|
||||
public RlCityCode selectRlCityCodeByCode(String code);
|
||||
|
||||
/**
|
||||
* 查询城市区号列表
|
||||
*
|
||||
* @param rlCityCode 城市区号
|
||||
* @return 城市区号集合
|
||||
*/
|
||||
public List<RlCityCode> selectRlCityCodeList(RlCityCode rlCityCode);
|
||||
|
||||
/**
|
||||
* 新增城市区号
|
||||
*
|
||||
* @param rlCityCode 城市区号
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRlCityCode(RlCityCode rlCityCode);
|
||||
|
||||
/**
|
||||
* 修改城市区号
|
||||
*
|
||||
* @param rlCityCode 城市区号
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRlCityCode(RlCityCode rlCityCode);
|
||||
|
||||
/**
|
||||
* 批量删除城市区号
|
||||
*
|
||||
* @param codeIds 需要删除的城市区号主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRlCityCodeByCodeIds(Long[] codeIds);
|
||||
|
||||
/**
|
||||
* 删除城市区号信息
|
||||
*
|
||||
* @param codeId 城市区号主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRlCityCodeByCodeId(Long codeId);
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.system.domain.city.RlCity;
|
||||
import com.ruoyi.system.domain.citycode.RlCityCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -20,6 +21,14 @@ public interface IRlCityService
|
|||
*/
|
||||
public RlCity selectRlCityByCityId(Long cityId);
|
||||
|
||||
/**
|
||||
* 根据地址编码查询城市
|
||||
*
|
||||
* @param adcode 地址编码
|
||||
* @return 城市
|
||||
*/
|
||||
public RlCity selectRlCityByAdcode(String adcode);
|
||||
|
||||
/**
|
||||
* 查询城市列表
|
||||
*
|
||||
|
@ -63,7 +72,7 @@ public interface IRlCityService
|
|||
/**
|
||||
* 根据定位获取哪个城市
|
||||
*/
|
||||
String getCityByLocation(String lon, String lat);
|
||||
RlCity getCityByLocation(String lon, String lat);
|
||||
|
||||
/**
|
||||
* 根据定位获取地址
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.system.domain.model.RlModel;
|
||||
import com.ruoyi.system.domain.store.StoreVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.RlUser;
|
||||
import com.ruoyi.system.domain.query.AuthenticationQuery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -219,11 +220,11 @@ public interface IRlUserService
|
|||
// */
|
||||
// int bandSystemUser(EUser user);
|
||||
//
|
||||
//// /**
|
||||
//// * 实名认证
|
||||
//// *
|
||||
//// */
|
||||
//// Object authentication(AuthenticationVo authenticationVo);
|
||||
/**
|
||||
* 实名认证
|
||||
*
|
||||
*/
|
||||
Object authentication(AuthenticationQuery authenticationQuery);
|
||||
//
|
||||
// /**
|
||||
// * 检测用户是否实名认证
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.ruoyi.system.domain.citycode.RlCityCode;
|
||||
import com.ruoyi.system.mapper.RlCityCodeMapper;
|
||||
import com.ruoyi.system.service.IRlCityCodeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 城市区号Service业务层处理
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2024-09-19
|
||||
*/
|
||||
@Service
|
||||
public class RlCityCodeServiceImpl implements IRlCityCodeService
|
||||
{
|
||||
@Resource
|
||||
private RlCityCodeMapper rlCityCodeMapper;
|
||||
|
||||
/**
|
||||
* 查询城市区号
|
||||
*
|
||||
* @param code 城市区号
|
||||
* @return 城市区号
|
||||
*/
|
||||
@Override
|
||||
public RlCityCode selectRlCityCodeByCode(String code)
|
||||
{
|
||||
return rlCityCodeMapper.selectRlCityCodeByCode(code);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询城市区号列表
|
||||
*
|
||||
* @param rlCityCode 城市区号
|
||||
* @return 城市区号
|
||||
*/
|
||||
@Override
|
||||
public List<RlCityCode> selectRlCityCodeList(RlCityCode rlCityCode)
|
||||
{
|
||||
return rlCityCodeMapper.selectRlCityCodeList(rlCityCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增城市区号
|
||||
*
|
||||
* @param rlCityCode 城市区号
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRlCityCode(RlCityCode rlCityCode)
|
||||
{
|
||||
return rlCityCodeMapper.insertRlCityCode(rlCityCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改城市区号
|
||||
*
|
||||
* @param rlCityCode 城市区号
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRlCityCode(RlCityCode rlCityCode)
|
||||
{
|
||||
return rlCityCodeMapper.updateRlCityCode(rlCityCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除城市区号
|
||||
*
|
||||
* @param codeIds 需要删除的城市区号主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRlCityCodeByCodeIds(Long[] codeIds)
|
||||
{
|
||||
return rlCityCodeMapper.deleteRlCityCodeByCodeIds(codeIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除城市区号信息
|
||||
*
|
||||
* @param codeId 城市区号主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRlCityCodeByCodeId(Long codeId)
|
||||
{
|
||||
return rlCityCodeMapper.deleteRlCityCodeByCodeId(codeId);
|
||||
}
|
||||
}
|
|
@ -5,7 +5,9 @@ import com.alibaba.fastjson2.JSONObject;
|
|||
import com.ruoyi.common.utils.http.HttpUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.system.domain.city.RlCity;
|
||||
import com.ruoyi.system.domain.citycode.RlCityCode;
|
||||
import com.ruoyi.system.mapper.RlCityMapper;
|
||||
import com.ruoyi.system.service.IRlCityCodeService;
|
||||
import com.ruoyi.system.service.IRlCityService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -29,6 +31,9 @@ public class RlCityServiceImpl implements IRlCityService
|
|||
@Resource
|
||||
private RlCityMapper rlCityMapper;
|
||||
|
||||
@Autowired
|
||||
private IRlCityService cityService;
|
||||
|
||||
/**
|
||||
* 查询城市
|
||||
*
|
||||
|
@ -41,6 +46,19 @@ public class RlCityServiceImpl implements IRlCityService
|
|||
return rlCityMapper.selectRlCityByCityId(cityId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据地址编码查询城市
|
||||
*
|
||||
* @param adcode 地址编码
|
||||
* @return 城市
|
||||
*/
|
||||
@Override
|
||||
public RlCity selectRlCityByAdcode(String adcode)
|
||||
{
|
||||
return rlCityMapper.selectRlCityByAdcode(adcode);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询城市列表
|
||||
*
|
||||
|
@ -105,24 +123,22 @@ public class RlCityServiceImpl implements IRlCityService
|
|||
* 根据定位获取哪个城市
|
||||
*/
|
||||
@Override
|
||||
public String getCityByLocation(String lon, String lat) {
|
||||
String city = null;
|
||||
public RlCity getCityByLocation(String lon, String lat) {
|
||||
try {
|
||||
String location = lon + "," + lat;
|
||||
String url = StrUtil.format("https://restapi.amap.com/v3/geocode/regeo?key={}&location={}&&radius=1000&extensions=all", GEO_WEB_KEY, location);
|
||||
String result = HttpUtils.sendGet(url);
|
||||
// log.info("【根据定位获取地址】请求结果result:{}",result);
|
||||
//将json字符串转换为Object
|
||||
JSONObject jsonObject = JSONObject.parseObject(result,JSONObject.class);
|
||||
JSONObject regeocode1 = jsonObject.getJSONObject("regeocode");
|
||||
JSONObject addressComponent = regeocode1.getJSONObject("addressComponent");
|
||||
city = addressComponent.getString("city");
|
||||
// log.info("【根据定位获取地址】address=:【{}】",result);
|
||||
return city;
|
||||
String adcode = addressComponent.getString("adcode");
|
||||
RlCity rlCity = cityService.selectRlCityByAdcode(adcode);
|
||||
return rlCity;
|
||||
} catch (Exception e) {
|
||||
log.error("【根据定位获取地址】转换地址报错", e);
|
||||
}
|
||||
return city;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,8 +3,10 @@ package com.ruoyi.system.service.impl;
|
|||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.map.GeoUtils;
|
||||
import com.ruoyi.system.domain.RlDevice;
|
||||
import com.ruoyi.system.domain.model.RlModel;
|
||||
import com.ruoyi.system.domain.store.StoreVo;
|
||||
import com.ruoyi.system.mapper.RlModelMapper;
|
||||
import com.ruoyi.system.service.IRlDeviceService;
|
||||
import com.ruoyi.system.service.IRlModelService;
|
||||
|
@ -16,6 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 车辆型号Service业务层处理
|
||||
|
|
|
@ -3,10 +3,13 @@ package com.ruoyi.system.service.impl;
|
|||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ruoyi.common.core.domain.entity.RlUser;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.verify.VerifyIdentityUtil;
|
||||
import com.ruoyi.system.domain.query.AuthenticationQuery;
|
||||
import com.ruoyi.system.mapper.RlUserMapper;
|
||||
import com.ruoyi.system.service.IRlUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
@ -44,11 +47,11 @@ public class RlUserServiceImpl implements IRlUserService{
|
|||
// @Resource
|
||||
// private SysUserMapper userMapper;
|
||||
|
||||
// @Value("${et.verifyUrl}")
|
||||
// private String verifyUrl;
|
||||
//
|
||||
// @Value("${et.appcode}")
|
||||
// private String appcode;
|
||||
@Value("${et.verifyUrl}")
|
||||
private String verifyUrl;
|
||||
|
||||
@Value("${et.appcode}")
|
||||
private String appcode;
|
||||
|
||||
/**
|
||||
* 根据条件分页查询用户列表
|
||||
|
@ -493,16 +496,16 @@ public class RlUserServiceImpl implements IRlUserService{
|
|||
// return EUserMapper.updateUser(user);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 实名认证
|
||||
// */
|
||||
// @Override
|
||||
// public Object authentication(AuthenticationVo authenticationVo) {
|
||||
// String idCard = authenticationVo.getIdCard();
|
||||
// String realName = authenticationVo.getRealName();
|
||||
// Object o = VerifyIdentityUtil.verifyIdentity(verifyUrl, appcode, idCard, realName);
|
||||
// return o;
|
||||
// }
|
||||
/**
|
||||
* 实名认证
|
||||
*/
|
||||
@Override
|
||||
public Object authentication(AuthenticationQuery authenticationQuery) {
|
||||
String idCard = authenticationQuery.getIdCard();
|
||||
String realName = authenticationQuery.getRealName();
|
||||
Object o = VerifyIdentityUtil.verifyIdentity(verifyUrl, appcode, idCard, realName);
|
||||
return o;
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * 检测是否实名认证
|
||||
|
|
|
@ -34,6 +34,14 @@ public interface RlStoreService
|
|||
*/
|
||||
public List<StoreVo> selectSmStoreList(StoreQuery store);
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有店铺列表
|
||||
*
|
||||
* @return 商户集合
|
||||
*/
|
||||
public List<StoreVo> getAllStores();
|
||||
|
||||
/**
|
||||
* 新增商户
|
||||
*
|
||||
|
@ -146,4 +154,9 @@ public interface RlStoreService
|
|||
* 条件更新
|
||||
*/
|
||||
int updateByQuery(Store data, StoreQuery query);
|
||||
|
||||
/**
|
||||
* 根据定位获取附近店铺列表
|
||||
*/
|
||||
List<StoreVo> getStoreListByLocation(StoreQuery query);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.ruoyi.common.utils.map.GeoUtils;
|
|||
import com.ruoyi.system.domain.store.*;
|
||||
import com.ruoyi.system.domain.store.enums.StoreGroupBy;
|
||||
import com.ruoyi.system.mapper.StoreMapper;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.system.service.store.RlStoreService;
|
||||
import com.ruoyi.system.service.store.StoreAssembler;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -55,6 +56,9 @@ public class StoreServiceImpl implements RlStoreService
|
|||
// @Autowired
|
||||
// private StoreApplyConverter storeApplyConverter;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService sysConfigService;
|
||||
|
||||
/**
|
||||
* 查询店铺
|
||||
*
|
||||
|
@ -91,6 +95,19 @@ public class StoreServiceImpl implements RlStoreService
|
|||
return storeVos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有店铺列表
|
||||
*
|
||||
* @return 店铺
|
||||
*/
|
||||
@Override
|
||||
public List<StoreVo> getAllStores()
|
||||
{
|
||||
StoreQuery query = new StoreQuery();
|
||||
return storeMapper.selectSmStoreList(query);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增店铺
|
||||
*
|
||||
|
@ -392,4 +409,32 @@ public class StoreServiceImpl implements RlStoreService
|
|||
return list.stream().collect(Collectors.toMap(keyMapper, StoreCountVO::getCount));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据定位获取附近店铺列表
|
||||
*/
|
||||
@Override
|
||||
public List<StoreVo> getStoreListByLocation(StoreQuery query) {
|
||||
String nearby = sysConfigService.selectConfigByKey("nearby.store");
|
||||
double radiusInKm = Double.parseDouble(nearby);
|
||||
// 根据定位获取附近方圆X公里的店铺列表
|
||||
double userLon = Double.parseDouble(query.getPhoneLon());
|
||||
double userLat = Double.parseDouble(query.getPhoneLat());
|
||||
// 获取所有店铺的列表
|
||||
List<StoreVo> allStores = storeMapper.selectSmStoreList(query);
|
||||
// 过滤出在方圆X公里内的店铺
|
||||
List<StoreVo> nearbyStores = allStores.stream()
|
||||
.filter(store -> {
|
||||
double storeLon = store.getLng().doubleValue();
|
||||
double storeLat = store.getLat().doubleValue();
|
||||
double distance = GeoUtils.haversineDistance(
|
||||
new double[]{userLon, userLat},
|
||||
new double[]{storeLon, storeLat}
|
||||
) / 1000; // 转换为公里
|
||||
return distance <= radiusInKm;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
return nearbyStores;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.RlCityCodeMapper">
|
||||
|
||||
<resultMap type="RlCityCode" id="RlCityCodeResult">
|
||||
<result property="code" column="code" />
|
||||
<result property="name" column="name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRlCityCodeVo">
|
||||
select code, name from rl_city_code
|
||||
</sql>
|
||||
|
||||
<select id="selectRlCityCodeList" parameterType="RlCityCode" resultMap="RlCityCodeResult">
|
||||
<include refid="selectRlCityCodeVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRlCityCodeByCode" parameterType="Long" resultMap="RlCityCodeResult">
|
||||
<include refid="selectRlCityCodeVo"/>
|
||||
where code = #{code}
|
||||
</select>
|
||||
|
||||
<insert id="insertRlCityCode" parameterType="RlCityCode">
|
||||
insert into rl_city_code
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="code != null">code,</if>
|
||||
<if test="name != null">name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="code != null">#{code},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRlCityCode" parameterType="RlCityCode">
|
||||
update rl_city_code
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
</trim>
|
||||
where code = #{code}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRlCityCodeBycode" parameterType="Long">
|
||||
delete from rl_city_code where code = #{code}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRlCityCodeBycodes" parameterType="String">
|
||||
delete from rl_city_code where code in
|
||||
<foreach item="code" collection="array" open="(" separator="," close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -3,43 +3,53 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.RlCityMapper">
|
||||
|
||||
<resultMap type="RlCity" id="RlCityResult">
|
||||
|
||||
<resultMap type="RlCityVO" id="RlCityResult">
|
||||
<result property="cityId" column="city_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="pinyin" column="pinyin" />
|
||||
<result property="level" column="level" />
|
||||
<result property="adcode" column="adcode" />
|
||||
<result property="citycode" column="citycode" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRlCityVo">
|
||||
select city_id, name, pinyin, level from rl_city
|
||||
select c.city_id, c.name, c.pinyin, c.adcode, c.citycode, cc.name cityName from rl_city c
|
||||
left join rl_city_code cc on c.citycode = cc.code
|
||||
</sql>
|
||||
|
||||
<select id="selectRlCityList" parameterType="RlCity" resultMap="RlCityResult">
|
||||
<include refid="selectRlCityVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="pinyin != null and pinyin != ''"> and pinyin = #{pinyin}</if>
|
||||
<if test="level != null and level != ''"> and level = #{level}</if>
|
||||
<if test="adcode != null and adcode != ''"> and adcode = #{adcode}</if>
|
||||
<if test="citycode != null and citycode != ''"> and citycode = #{citycode}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectRlCityByCityId" parameterType="Long" resultMap="RlCityResult">
|
||||
<include refid="selectRlCityVo"/>
|
||||
where city_id = #{cityId}
|
||||
</select>
|
||||
|
||||
<select id="selectRlCityByAdcode" parameterType="String" resultMap="RlCityResult">
|
||||
<include refid="selectRlCityVo"/>
|
||||
where adcode = #{adcode}
|
||||
</select>
|
||||
|
||||
<insert id="insertRlCity" parameterType="RlCity" useGeneratedKeys="true" keyProperty="cityId">
|
||||
insert into rl_city
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="pinyin != null">pinyin,</if>
|
||||
<if test="level != null">level,</if>
|
||||
<if test="adcode != null">adcode,</if>
|
||||
<if test="citycode != null">citycode,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="pinyin != null">#{pinyin},</if>
|
||||
<if test="level != null">#{level},</if>
|
||||
<if test="adcode != null">#{adcode},</if>
|
||||
<if test="citycode != null">#{citycode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -48,7 +58,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="pinyin != null">pinyin = #{pinyin},</if>
|
||||
<if test="level != null">level = #{level},</if>
|
||||
<if test="adcode != null">adcode = #{adcode},</if>
|
||||
<if test="citycode != null">citycode = #{citycode},</if>
|
||||
</trim>
|
||||
where city_id = #{cityId}
|
||||
</update>
|
||||
|
@ -58,9 +69,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<delete id="deleteRlCityByCityIds" parameterType="String">
|
||||
delete from rl_city where city_id in
|
||||
delete from rl_city where city_id in
|
||||
<foreach item="cityId" collection="array" open="(" separator="," close=")">
|
||||
#{cityId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
@ -15,16 +15,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="intro" column="intro" />
|
||||
<result property="agentId" column="agent_id" />
|
||||
<result property="deposit" column="deposit" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEModelVo">
|
||||
select model_id, model, full_voltage, low_voltage, full_endurance, create_by, create_time, update_by, update_time, remark from rl_model
|
||||
select model_id, model, full_voltage, low_voltage, full_endurance, create_by, create_time, update_by, update_time, remark, intro, agent_id, deposit from rl_model
|
||||
</sql>
|
||||
|
||||
<select id="selectEModelList" parameterType="RlModel" resultMap="EModelResult">
|
||||
select m.model_id, m.model, m.full_voltage, m.low_voltage,
|
||||
m.full_endurance, m.create_by, m.create_time,
|
||||
m.update_by, m.update_time, m.remark from rl_model m
|
||||
m.update_by, m.update_time, m.remark, m.intro, m.agent_id, m.deposit from rl_model m
|
||||
where 1 = 1
|
||||
<if test="model != null and model != ''"> and m.model = #{model}</if>
|
||||
<!-- 数据范围过滤 <if test="operator != null and operator != ''"> and m.operator = #{operator}</if> -->
|
||||
|
@ -34,14 +37,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectEModelListByAgentId" parameterType="RlModel" resultMap="EModelResult">
|
||||
select m.model_id, m.model, m.full_voltage, m.low_voltage,
|
||||
m.full_endurance, m.create_by, m.create_time,
|
||||
m.update_by, m.update_time, m.remark from rl_model m
|
||||
m.update_by, m.update_time, m.remark, m.intro, m.agent_id, m.deposit from rl_model m
|
||||
where m.agent_id = #{agentId}
|
||||
</select>
|
||||
|
||||
<select id="selectEModelByModelId" parameterType="Long" resultMap="EModelResult">
|
||||
select m.model_id, m.model, m.full_voltage, m.low_voltage,
|
||||
m.full_endurance, m.create_by, m.create_time,
|
||||
m.update_by, m.update_time, m.remark from rl_model m
|
||||
m.update_by, m.update_time, m.remark, m.intro, m.agent_id, m.deposit from rl_model m
|
||||
where m.model_id = #{modelId}
|
||||
</select>
|
||||
|
||||
|
@ -62,6 +65,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="intro != null">intro,</if>
|
||||
<if test="agentId != null">agent_id,</if>
|
||||
<if test="deposit != null">deposit,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="modelId != null">#{modelId},</if>
|
||||
|
@ -74,6 +80,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="intro != null">#{intro},</if>
|
||||
<if test="agentId != null">#{agentId},</if>
|
||||
<if test="deposit != null">#{deposit},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -89,6 +98,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="intro != null">intro = #{intro},</if>
|
||||
<if test="agentId != null">agent_id = #{agentId},</if>
|
||||
<if test="deposit != null">deposit = #{deposit},</if>
|
||||
</trim>
|
||||
where model_id = #{modelId}
|
||||
</update>
|
||||
|
|
|
@ -34,6 +34,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ss.status,
|
||||
ss.enabled,
|
||||
ss.agent_id,
|
||||
ss.is_free_car,
|
||||
ss.server_phone,
|
||||
su.user_name as user_name
|
||||
from rl_store ss
|
||||
left join rl_user su on su.user_id = ss.user_id
|
||||
|
@ -51,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="query.userName != null "> and su.user_name like concat('%', #{query.userName}, '%')</if>
|
||||
<if test="query.status != null "> and ss.status = #{query.status}</if>
|
||||
<if test="query.enabled != null "> and ss.enabled = #{query.enabled}</if>
|
||||
<if test="query.isFreeCar != null "> and ss.is_free_car = #{query.isFreeCar}</if>
|
||||
<if test="query.keyword != null and query.keyword != ''">
|
||||
and (
|
||||
ss.name like concat('%', #{query.keyword}, '%')
|
||||
|
@ -158,6 +161,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="show != null">`show`,</if>
|
||||
<if test="status != null">`status`,</if>
|
||||
<if test="enabled != null">`enabled`,</if>
|
||||
<if test="agentId != null">agent_id,</if>
|
||||
<if test="isFreeCar != null">is_free_car,</if>
|
||||
<if test="serverPhone != null">server_phone,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
|
@ -181,6 +187,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="show != null">#{show},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="enabled != null">#{enabled},</if>
|
||||
<if test="agentId != null">#{agentId},</if>
|
||||
<if test="isFreeCar != null">#{isFreeCar},</if>
|
||||
<if test="serverPhone != null">#{serverPhone},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -213,6 +222,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="data.show != null">`show` = #{data.show},</if>
|
||||
<if test="data.status != null">`status` = #{data.status},</if>
|
||||
<if test="data.enabled != null">`enabled` = #{data.enabled},</if>
|
||||
<if test="data.agentId != null">agent_id = #{data.agentId},</if>
|
||||
<if test="data.isFreeCar != null">is_free_car = #{data.isFreeCar},</if>
|
||||
<if test="data.serverPhone != null">server_phone = #{data.serverPhone},</if>
|
||||
</sql>
|
||||
|
||||
<update id="updateByQuery">
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.SysConfigMapper">
|
||||
|
||||
|
||||
<resultMap type="SysConfig" id="SysConfigResult">
|
||||
<id property="configId" column="config_id" />
|
||||
<result property="configName" column="config_name" />
|
||||
|
@ -15,12 +15,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectConfigVo">
|
||||
select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark
|
||||
select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark
|
||||
from sys_config
|
||||
</sql>
|
||||
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="sqlwhereSearch">
|
||||
<where>
|
||||
|
@ -32,12 +32,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<include refid="sqlwhereSearch"/>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<where>
|
||||
|
@ -57,18 +57,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectConfigById" parameterType="Long" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
where config_id = #{configId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
where config_key = #{configKey} limit 1
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertConfig" parameterType="SysConfig">
|
||||
insert into sys_config (
|
||||
<if test="configName != null and configName != '' ">config_name,</if>
|
||||
|
@ -88,9 +89,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateConfig" parameterType="SysConfig">
|
||||
update sys_config
|
||||
update sys_config
|
||||
<set>
|
||||
<if test="configName != null and configName != ''">config_name = #{configName},</if>
|
||||
<if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
|
||||
|
@ -102,16 +103,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</set>
|
||||
where config_id = #{configId}
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="deleteConfigById" parameterType="Long">
|
||||
delete from sys_config where config_id = #{configId}
|
||||
</delete>
|
||||
|
||||
|
||||
<delete id="deleteConfigByIds" parameterType="Long">
|
||||
delete from sys_config where config_id in
|
||||
delete from sys_config where config_id in
|
||||
<foreach item="configId" collection="array" open="(" separator="," close=")">
|
||||
#{configId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue
Block a user