省市区以及前端优化
parent
8debf3f15e
commit
5f5ab46b05
|
|
@ -24,6 +24,181 @@ public interface RemoteLogService
|
|||
*
|
||||
* @param sysOperLog 日志实体
|
||||
* @param source 请求来源
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/operlog")
|
||||
|
|
|
|||
|
|
@ -92,6 +92,11 @@
|
|||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun.oss</groupId>
|
||||
<artifactId>aliyun-sdk-oss</artifactId>
|
||||
<version>3.10.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
|
|
@ -106,11 +111,7 @@
|
|||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun.oss</groupId>
|
||||
<artifactId>aliyun-sdk-oss</artifactId>
|
||||
<version>3.10.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,95 @@
|
|||
package com.ruoyi.app.controller;
|
||||
|
||||
import com.ruoyi.app.service.IAppCityService;
|
||||
import com.ruoyi.app.service.IAppProvinceService;
|
||||
import com.ruoyi.app.service.IAppTownService;
|
||||
import com.ruoyi.app.service.impl.AppProvinceServiceImpl;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/area")
|
||||
@Api(tags = "省市区接口" , description = "省市区接口")
|
||||
public class AppAreaController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IAppProvinceService appProvinceService;
|
||||
|
||||
@Autowired
|
||||
private IAppCityService appCityService;
|
||||
|
||||
@Autowired
|
||||
private IAppTownService appTownService;
|
||||
|
||||
|
||||
/**
|
||||
* 所有省级数据
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getAllProvince")
|
||||
@ApiOperation(value = "所有省级数据", notes = "所有省级数据", httpMethod = "GET")
|
||||
public AjaxResult getAllProvince() {
|
||||
return AjaxResult.success(appProvinceService.selectAppProvinceList(null));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 所有市级数据
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getAllCity")
|
||||
@ApiOperation(value = "所有市级数据", notes = "所有市级数据", httpMethod = "GET")
|
||||
public AjaxResult getAllCity() {
|
||||
return AjaxResult.success(appCityService.selectAppCityList(null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 所有县级数据
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getAllTown")
|
||||
@ApiOperation(value = "所有县级数据", notes = "所有县级数据", httpMethod = "GET")
|
||||
public AjaxResult getAllTown() {
|
||||
return AjaxResult.success(appTownService.selectAppTownList(null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据省级地查询城市
|
||||
*/
|
||||
@GetMapping("/getCityByProvinceId")
|
||||
@ApiOperation(value = "根据省级id查询城市", notes = "根据省级id查询城市", httpMethod = "GET")
|
||||
public AjaxResult getCityByProvinceId(@RequestParam("provinceId") Integer provinceId) {
|
||||
return AjaxResult.success(appCityService.selectAppCityListByProvinceId(provinceId));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据省级地查询城市
|
||||
*/
|
||||
@GetMapping("/getTownByCityId")
|
||||
@ApiOperation(value = "根据省级id查询城市", notes = "根据省级id查询城市", httpMethod = "GET")
|
||||
public AjaxResult getTownByCityId(@RequestParam("cityId") Integer cityId) {
|
||||
return AjaxResult.success(appTownService.getTownByCityId(cityId));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 省市区树状结构返回
|
||||
*/
|
||||
@GetMapping("/getAreaTree")
|
||||
@ApiOperation(value = "省市区树状结构", notes = "省市区树状结构", httpMethod = "GET")
|
||||
public AjaxResult getAreaTree() {
|
||||
|
||||
return AjaxResult.success(appProvinceService.selectAppProvinceTree());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ import com.ruoyi.app.form.RegisterForm;
|
|||
import com.ruoyi.app.service.IAppRegisterService;
|
||||
import com.ruoyi.app.service.IAppUserService;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.utils.ip.IpUtils;
|
||||
import com.ruoyi.common.core.utils.uuid.IdUtils;
|
||||
import com.ruoyi.common.redis.service.RedisService;
|
||||
|
|
@ -49,6 +50,9 @@ public class AppLoginController {
|
|||
AppUser appUser = appUserService.selectAppUserByPhone(registerForm.getPhoneNumber());
|
||||
Assert.notNull(registerForm.getSchoolId(), "学校id不能为空");
|
||||
Assert.isNull(appUser, "手机号已注册");
|
||||
if (StringUtils.isNotEmpty(registerForm.getEmail())) {
|
||||
|
||||
}
|
||||
AppRegister appRegister = setAppRegister(registerForm);
|
||||
appRegister.setInvitationCode(registerForm.getInvitationCode());
|
||||
int i = appRegisterService.insertAppRegister(appRegister);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,65 @@
|
|||
package com.ruoyi.app.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 城市数据对象 app_city
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public class AppCity extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 城市id */
|
||||
private Integer id;
|
||||
|
||||
/** 城市名称 */
|
||||
@Excel(name = "城市名称")
|
||||
private String name;
|
||||
|
||||
/** 所属城市编号 */
|
||||
@Excel(name = "所属城市编号")
|
||||
private Long provinceId;
|
||||
|
||||
public void setId(Integer id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setProvinceId(Long provinceId)
|
||||
{
|
||||
this.provinceId = provinceId;
|
||||
}
|
||||
|
||||
public Long getProvinceId()
|
||||
{
|
||||
return provinceId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("provinceId", getProvinceId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.ruoyi.app.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 省数据对象 app_province
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public class AppProvince extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 省级id */
|
||||
private Integer id;
|
||||
|
||||
/** 省名 */
|
||||
@Excel(name = "省名")
|
||||
private String name;
|
||||
|
||||
/** 所属地区 */
|
||||
@Excel(name = "所属地区")
|
||||
private String area;
|
||||
|
||||
public void setId(Integer id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setArea(String area)
|
||||
{
|
||||
this.area = area;
|
||||
}
|
||||
|
||||
public String getArea()
|
||||
{
|
||||
return area;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("area", getArea())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.ruoyi.app.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 区数据对象 app_town
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public class AppTown extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 区id */
|
||||
private Integer id;
|
||||
|
||||
/** 区名称 */
|
||||
@Excel(name = "区名称")
|
||||
private String name;
|
||||
|
||||
/** 所属城市编号 */
|
||||
@Excel(name = "所属城市编号")
|
||||
private Long cityId;
|
||||
|
||||
public void setId(Integer id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setCityId(Long cityId)
|
||||
{
|
||||
this.cityId = cityId;
|
||||
}
|
||||
|
||||
public Long getCityId()
|
||||
{
|
||||
return cityId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("cityId", getCityId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.ruoyi.app.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AreaVo {
|
||||
private Integer id;
|
||||
private String name;
|
||||
private String parentId;
|
||||
private Integer level;
|
||||
private Boolean isLeaf;
|
||||
private List<AreaVo> children;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.ruoyi.app.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.app.domain.AppCity;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 城市数据Mapper接口
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface AppCityMapper
|
||||
{
|
||||
/**
|
||||
* 查询城市数据
|
||||
*
|
||||
* @param id 城市数据主键
|
||||
* @return 城市数据
|
||||
*/
|
||||
public AppCity selectAppCityById(Long id);
|
||||
|
||||
/**
|
||||
* 查询城市数据列表
|
||||
*
|
||||
* @param appCity 城市数据
|
||||
* @return 城市数据集合
|
||||
*/
|
||||
public List<AppCity> selectAppCityList(AppCity appCity);
|
||||
|
||||
/**
|
||||
* 新增城市数据
|
||||
*
|
||||
* @param appCity 城市数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAppCity(AppCity appCity);
|
||||
|
||||
/**
|
||||
* 修改城市数据
|
||||
*
|
||||
* @param appCity 城市数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAppCity(AppCity appCity);
|
||||
|
||||
/**
|
||||
* 删除城市数据
|
||||
*
|
||||
* @param id 城市数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppCityById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除城市数据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppCityByIds(Long[] ids);
|
||||
|
||||
List<AppCity> selectAppCityListByProvinceId(@Param("provinceId") Integer provinceId);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.app.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.app.domain.AppProvince;
|
||||
|
||||
/**
|
||||
* 省数据Mapper接口
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface AppProvinceMapper
|
||||
{
|
||||
/**
|
||||
* 查询省数据
|
||||
*
|
||||
* @param id 省数据主键
|
||||
* @return 省数据
|
||||
*/
|
||||
public AppProvince selectAppProvinceById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询省数据列表
|
||||
*
|
||||
* @param appProvince 省数据
|
||||
* @return 省数据集合
|
||||
*/
|
||||
public List<AppProvince> selectAppProvinceList(AppProvince appProvince);
|
||||
|
||||
/**
|
||||
* 新增省数据
|
||||
*
|
||||
* @param appProvince 省数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAppProvince(AppProvince appProvince);
|
||||
|
||||
/**
|
||||
* 修改省数据
|
||||
*
|
||||
* @param appProvince 省数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAppProvince(AppProvince appProvince);
|
||||
|
||||
/**
|
||||
* 删除省数据
|
||||
*
|
||||
* @param id 省数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppProvinceById(Integer id);
|
||||
|
||||
/**
|
||||
* 批量删除省数据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppProvinceByIds(Integer[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.ruoyi.app.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.app.domain.AppTown;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 区数据Mapper接口
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface AppTownMapper
|
||||
{
|
||||
/**
|
||||
* 查询区数据
|
||||
*
|
||||
* @param id 区数据主键
|
||||
* @return 区数据
|
||||
*/
|
||||
public AppTown selectAppTownById(Long id);
|
||||
|
||||
/**
|
||||
* 查询区数据列表
|
||||
*
|
||||
* @param appTown 区数据
|
||||
* @return 区数据集合
|
||||
*/
|
||||
public List<AppTown> selectAppTownList(AppTown appTown);
|
||||
|
||||
/**
|
||||
* 新增区数据
|
||||
*
|
||||
* @param appTown 区数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAppTown(AppTown appTown);
|
||||
|
||||
/**
|
||||
* 修改区数据
|
||||
*
|
||||
* @param appTown 区数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAppTown(AppTown appTown);
|
||||
|
||||
/**
|
||||
* 删除区数据
|
||||
*
|
||||
* @param id 区数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppTownById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除区数据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppTownByIds(Long[] ids);
|
||||
|
||||
List<AppTown> getTownByCityId(@Param("cityId") Integer cityId);
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.ruoyi.app.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.app.domain.AppCity;
|
||||
|
||||
/**
|
||||
* 城市数据Service接口
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface IAppCityService
|
||||
{
|
||||
/**
|
||||
* 查询城市数据
|
||||
*
|
||||
* @param id 城市数据主键
|
||||
* @return 城市数据
|
||||
*/
|
||||
public AppCity selectAppCityById(Long id);
|
||||
|
||||
/**
|
||||
* 查询城市数据列表
|
||||
*
|
||||
* @param appCity 城市数据
|
||||
* @return 城市数据集合
|
||||
*/
|
||||
public List<AppCity> selectAppCityList(AppCity appCity);
|
||||
|
||||
/**
|
||||
* 新增城市数据
|
||||
*
|
||||
* @param appCity 城市数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAppCity(AppCity appCity);
|
||||
|
||||
/**
|
||||
* 修改城市数据
|
||||
*
|
||||
* @param appCity 城市数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAppCity(AppCity appCity);
|
||||
|
||||
/**
|
||||
* 批量删除城市数据
|
||||
*
|
||||
* @param ids 需要删除的城市数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppCityByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除城市数据信息
|
||||
*
|
||||
* @param id 城市数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppCityById(Long id);
|
||||
|
||||
List<AppCity> selectAppCityListByProvinceId(Integer provinceId);
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.ruoyi.app.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.app.domain.AppProvince;
|
||||
import com.ruoyi.app.domain.vo.AreaVo;
|
||||
|
||||
/**
|
||||
* 省数据Service接口
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface IAppProvinceService
|
||||
{
|
||||
/**
|
||||
* 查询省数据
|
||||
*
|
||||
* @param id 省数据主键
|
||||
* @return 省数据
|
||||
*/
|
||||
public AppProvince selectAppProvinceById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询省数据列表
|
||||
*
|
||||
* @param appProvince 省数据
|
||||
* @return 省数据集合
|
||||
*/
|
||||
public List<AppProvince> selectAppProvinceList(AppProvince appProvince);
|
||||
|
||||
/**
|
||||
* 新增省数据
|
||||
*
|
||||
* @param appProvince 省数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAppProvince(AppProvince appProvince);
|
||||
|
||||
/**
|
||||
* 修改省数据
|
||||
*
|
||||
* @param appProvince 省数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAppProvince(AppProvince appProvince);
|
||||
|
||||
/**
|
||||
* 批量删除省数据
|
||||
*
|
||||
* @param ids 需要删除的省数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppProvinceByIds(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 删除省数据信息
|
||||
*
|
||||
* @param id 省数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppProvinceById(Integer id);
|
||||
|
||||
List<AreaVo> selectAppProvinceTree();
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.ruoyi.app.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.app.domain.AppTown;
|
||||
|
||||
/**
|
||||
* 区数据Service接口
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface IAppTownService
|
||||
{
|
||||
/**
|
||||
* 查询区数据
|
||||
*
|
||||
* @param id 区数据主键
|
||||
* @return 区数据
|
||||
*/
|
||||
public AppTown selectAppTownById(Long id);
|
||||
|
||||
/**
|
||||
* 查询区数据列表
|
||||
*
|
||||
* @param appTown 区数据
|
||||
* @return 区数据集合
|
||||
*/
|
||||
public List<AppTown> selectAppTownList(AppTown appTown);
|
||||
|
||||
/**
|
||||
* 新增区数据
|
||||
*
|
||||
* @param appTown 区数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAppTown(AppTown appTown);
|
||||
|
||||
/**
|
||||
* 修改区数据
|
||||
*
|
||||
* @param appTown 区数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAppTown(AppTown appTown);
|
||||
|
||||
/**
|
||||
* 批量删除区数据
|
||||
*
|
||||
* @param ids 需要删除的区数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppTownByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除区数据信息
|
||||
*
|
||||
* @param id 区数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppTownById(Long id);
|
||||
|
||||
List<AppTown> getTownByCityId(Integer cityId);
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
package com.ruoyi.app.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.app.mapper.AppCityMapper;
|
||||
import com.ruoyi.app.domain.AppCity;
|
||||
import com.ruoyi.app.service.IAppCityService;
|
||||
|
||||
/**
|
||||
* 城市数据Service业务层处理
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
@Service
|
||||
public class AppCityServiceImpl implements IAppCityService
|
||||
{
|
||||
@Autowired
|
||||
private AppCityMapper appCityMapper;
|
||||
|
||||
/**
|
||||
* 查询城市数据
|
||||
*
|
||||
* @param id 城市数据主键
|
||||
* @return 城市数据
|
||||
*/
|
||||
@Override
|
||||
public AppCity selectAppCityById(Long id)
|
||||
{
|
||||
return appCityMapper.selectAppCityById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询城市数据列表
|
||||
*
|
||||
* @param appCity 城市数据
|
||||
* @return 城市数据
|
||||
*/
|
||||
@Override
|
||||
public List<AppCity> selectAppCityList(AppCity appCity)
|
||||
{
|
||||
return appCityMapper.selectAppCityList(appCity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增城市数据
|
||||
*
|
||||
* @param appCity 城市数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAppCity(AppCity appCity)
|
||||
{
|
||||
return appCityMapper.insertAppCity(appCity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改城市数据
|
||||
*
|
||||
* @param appCity 城市数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAppCity(AppCity appCity)
|
||||
{
|
||||
return appCityMapper.updateAppCity(appCity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除城市数据
|
||||
*
|
||||
* @param ids 需要删除的城市数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAppCityByIds(Long[] ids)
|
||||
{
|
||||
return appCityMapper.deleteAppCityByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除城市数据信息
|
||||
*
|
||||
* @param id 城市数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAppCityById(Long id)
|
||||
{
|
||||
return appCityMapper.deleteAppCityById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AppCity> selectAppCityListByProvinceId(Integer provinceId) {
|
||||
|
||||
return appCityMapper.selectAppCityListByProvinceId(provinceId);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
package com.ruoyi.app.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.ruoyi.app.domain.AppCity;
|
||||
import com.ruoyi.app.domain.AppTown;
|
||||
import com.ruoyi.app.domain.vo.AreaVo;
|
||||
import com.ruoyi.app.mapper.AppCityMapper;
|
||||
import com.ruoyi.app.mapper.AppTownMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.app.mapper.AppProvinceMapper;
|
||||
import com.ruoyi.app.domain.AppProvince;
|
||||
import com.ruoyi.app.service.IAppProvinceService;
|
||||
|
||||
/**
|
||||
* 省数据Service业务层处理
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
@Service
|
||||
public class AppProvinceServiceImpl implements IAppProvinceService {
|
||||
@Autowired
|
||||
private AppProvinceMapper appProvinceMapper;
|
||||
|
||||
@Autowired
|
||||
private AppCityMapper appCityMapper;
|
||||
|
||||
@Autowired
|
||||
private AppTownMapper appTownMapper;
|
||||
|
||||
/**
|
||||
* 查询省数据
|
||||
*
|
||||
* @param id 省数据主键
|
||||
* @return 省数据
|
||||
*/
|
||||
@Override
|
||||
public AppProvince selectAppProvinceById(Integer id) {
|
||||
return appProvinceMapper.selectAppProvinceById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询省数据列表
|
||||
*
|
||||
* @param appProvince 省数据
|
||||
* @return 省数据
|
||||
*/
|
||||
@Override
|
||||
public List<AppProvince> selectAppProvinceList(AppProvince appProvince) {
|
||||
return appProvinceMapper.selectAppProvinceList(appProvince);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增省数据
|
||||
*
|
||||
* @param appProvince 省数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAppProvince(AppProvince appProvince) {
|
||||
return appProvinceMapper.insertAppProvince(appProvince);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改省数据
|
||||
*
|
||||
* @param appProvince 省数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAppProvince(AppProvince appProvince) {
|
||||
return appProvinceMapper.updateAppProvince(appProvince);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除省数据
|
||||
*
|
||||
* @param ids 需要删除的省数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAppProvinceByIds(Integer[] ids) {
|
||||
return appProvinceMapper.deleteAppProvinceByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除省数据信息
|
||||
*
|
||||
* @param id 省数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAppProvinceById(Integer id) {
|
||||
return appProvinceMapper.deleteAppProvinceById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AreaVo> selectAppProvinceTree() {
|
||||
// 查询所有省级列表
|
||||
List<AppProvince> appProvinces = appProvinceMapper.selectAppProvinceList(null);
|
||||
|
||||
return appProvinces.stream()
|
||||
.map(appProvince -> {
|
||||
AreaVo areaVo = new AreaVo();
|
||||
areaVo.setId(appProvince.getId());
|
||||
areaVo.setName(appProvince.getName());
|
||||
areaVo.setLevel(1);
|
||||
areaVo.setIsLeaf(false);
|
||||
|
||||
List<AppCity> appCities = appCityMapper.selectAppCityListByProvinceId(appProvince.getId());
|
||||
if (appCities == null || appCities.isEmpty()) {
|
||||
return areaVo;
|
||||
}
|
||||
|
||||
List<AreaVo> children = appCities.stream()
|
||||
.map(appCity -> {
|
||||
AreaVo child = new AreaVo();
|
||||
child.setId(appCity.getId());
|
||||
child.setName(appCity.getName());
|
||||
child.setLevel(2);
|
||||
child.setIsLeaf(false);
|
||||
|
||||
List<AppTown> appTowns = appTownMapper.getTownByCityId(appCity.getId());
|
||||
if (appTowns == null || appTowns.isEmpty()) {
|
||||
return child;
|
||||
}
|
||||
|
||||
List<AreaVo> townChildren = appTowns.stream()
|
||||
.map(appTown -> {
|
||||
AreaVo townChild = new AreaVo();
|
||||
townChild.setId(appTown.getId());
|
||||
townChild.setName(appTown.getName());
|
||||
townChild.setLevel(3);
|
||||
townChild.setIsLeaf(true);
|
||||
return townChild;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
child.setChildren(townChildren);
|
||||
return child;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
areaVo.setChildren(children);
|
||||
return areaVo;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
package com.ruoyi.app.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.app.mapper.AppTownMapper;
|
||||
import com.ruoyi.app.domain.AppTown;
|
||||
import com.ruoyi.app.service.IAppTownService;
|
||||
|
||||
/**
|
||||
* 区数据Service业务层处理
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
@Service
|
||||
public class AppTownServiceImpl implements IAppTownService
|
||||
{
|
||||
@Autowired
|
||||
private AppTownMapper appTownMapper;
|
||||
|
||||
/**
|
||||
* 查询区数据
|
||||
*
|
||||
* @param id 区数据主键
|
||||
* @return 区数据
|
||||
*/
|
||||
@Override
|
||||
public AppTown selectAppTownById(Long id)
|
||||
{
|
||||
return appTownMapper.selectAppTownById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询区数据列表
|
||||
*
|
||||
* @param appTown 区数据
|
||||
* @return 区数据
|
||||
*/
|
||||
@Override
|
||||
public List<AppTown> selectAppTownList(AppTown appTown)
|
||||
{
|
||||
return appTownMapper.selectAppTownList(appTown);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增区数据
|
||||
*
|
||||
* @param appTown 区数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAppTown(AppTown appTown)
|
||||
{
|
||||
return appTownMapper.insertAppTown(appTown);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改区数据
|
||||
*
|
||||
* @param appTown 区数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAppTown(AppTown appTown)
|
||||
{
|
||||
return appTownMapper.updateAppTown(appTown);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除区数据
|
||||
*
|
||||
* @param ids 需要删除的区数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAppTownByIds(Long[] ids)
|
||||
{
|
||||
return appTownMapper.deleteAppTownByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除区数据信息
|
||||
*
|
||||
* @param id 区数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAppTownById(Long id)
|
||||
{
|
||||
return appTownMapper.deleteAppTownById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AppTown> getTownByCityId(Integer cityId) {
|
||||
|
||||
return appTownMapper.getTownByCityId(cityId);
|
||||
}
|
||||
}
|
||||
|
|
@ -124,4 +124,14 @@ public class SendNoteUtil {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 邮件推送
|
||||
*
|
||||
*
|
||||
*/
|
||||
// public void sendEmail() {
|
||||
// SingleSendMailRequest request = new SingleSendMailRequest();
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/ruoyi-system" />
|
||||
<property name="log.path" value="logs/ruoyi-app" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
<?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.app.mapper.AppCityMapper">
|
||||
|
||||
<resultMap type="AppCity" id="AppCityResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="provinceId" column="province_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppCityVo">
|
||||
select id, name, province_id from app_city
|
||||
</sql>
|
||||
|
||||
<select id="selectAppCityList" parameterType="AppCity" resultMap="AppCityResult">
|
||||
<include refid="selectAppCityVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="provinceId != null "> and province_id = #{provinceId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAppCityById" parameterType="Long" resultMap="AppCityResult">
|
||||
<include refid="selectAppCityVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppCity" parameterType="AppCity" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into app_city
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="provinceId != null">province_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="provinceId != null">#{provinceId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppCity" parameterType="AppCity">
|
||||
update app_city
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="provinceId != null">province_id = #{provinceId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppCityById" parameterType="Long">
|
||||
delete from app_city where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppCityByIds" parameterType="String">
|
||||
delete from app_city where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="selectAppCityListByProvinceId" resultType="com.ruoyi.app.domain.AppCity">
|
||||
<include refid="selectAppCityVo"/> where province_id = #{provinceId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<?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.app.mapper.AppProvinceMapper">
|
||||
|
||||
<resultMap type="AppProvince" id="AppProvinceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="area" column="area" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppProvinceVo">
|
||||
select id, name, area from app_province
|
||||
</sql>
|
||||
|
||||
<select id="selectAppProvinceList" parameterType="AppProvince" resultMap="AppProvinceResult">
|
||||
<include refid="selectAppProvinceVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="area != null and area != ''"> and area = #{area}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAppProvinceById" parameterType="Integer" resultMap="AppProvinceResult">
|
||||
<include refid="selectAppProvinceVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppProvince" parameterType="AppProvince" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into app_province
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="area != null">area,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="area != null">#{area},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppProvince" parameterType="AppProvince">
|
||||
update app_province
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="area != null">area = #{area},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppProvinceById" parameterType="Integer">
|
||||
delete from app_province where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppProvinceByIds" parameterType="String">
|
||||
delete from app_province where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
<?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.app.mapper.AppTownMapper">
|
||||
|
||||
<resultMap type="AppTown" id="AppTownResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="cityId" column="city_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppTownVo">
|
||||
select id, name, city_id from app_town
|
||||
</sql>
|
||||
|
||||
<select id="selectAppTownList" parameterType="AppTown" resultMap="AppTownResult">
|
||||
<include refid="selectAppTownVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="cityId != null "> and city_id = #{cityId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAppTownById" parameterType="Long" resultMap="AppTownResult">
|
||||
<include refid="selectAppTownVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppTown" parameterType="AppTown">
|
||||
insert into app_town
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="cityId != null">city_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="cityId != null">#{cityId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppTown" parameterType="AppTown">
|
||||
update app_town
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="cityId != null">city_id = #{cityId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppTownById" parameterType="Long">
|
||||
delete from app_town where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppTownByIds" parameterType="String">
|
||||
delete from app_town where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getTownByCityId" resultType="com.ruoyi.app.domain.AppTown">
|
||||
<include refid="selectAppTownVo"/> where city_id = #{cityId} </select>
|
||||
</mapper>
|
||||
|
|
@ -3,6 +3,8 @@ package ${packageName}.controller;
|
|||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
|
@ -33,6 +35,7 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/${businessName}")
|
||||
@Api(tags = "${functionName}" , description = "${functionName}")
|
||||
public class ${ClassName}Controller extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
|
|
@ -43,6 +46,7 @@ public class ${ClassName}Controller extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:list")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation(value = "查询${functionName}", notes = "查询${functionName}", httpMethod = "GET")
|
||||
#if($table.crud || $table.sub)
|
||||
public TableDataInfo list(${ClassName} ${className})
|
||||
{
|
||||
|
|
@ -76,6 +80,7 @@ public class ${ClassName}Controller extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:query")
|
||||
@GetMapping(value = "/{${pkColumn.javaField}}")
|
||||
@ApiOperation(value = "获取${functionName}详细信息", notes = "获取${functionName}详细信息", httpMethod = "GET")
|
||||
public AjaxResult getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField})
|
||||
{
|
||||
return success(${className}Service.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}));
|
||||
|
|
@ -85,8 +90,9 @@ public class ${ClassName}Controller extends BaseController
|
|||
* 新增${functionName}
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:add")
|
||||
@ApiOperation(value = "新增${functionName}", notes = "新增${functionName}", httpMethod = "POST")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody ${ClassName} ${className})
|
||||
{
|
||||
return toAjax(${className}Service.insert${ClassName}(${className}));
|
||||
|
|
@ -96,8 +102,9 @@ public class ${ClassName}Controller extends BaseController
|
|||
* 修改${functionName}
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:edit")
|
||||
@ApiOperation(value = "修改${functionName}", notes = "修改${functionName}", httpMethod = "PUT")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@PutMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody ${ClassName} ${className})
|
||||
{
|
||||
return toAjax(${className}Service.update${ClassName}(${className}));
|
||||
|
|
@ -109,7 +116,7 @@ public class ${ClassName}Controller extends BaseController
|
|||
@RequiresPermissions("${permissionPrefix}:remove")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{${pkColumn.javaField}s}")
|
||||
public AjaxResult remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s)
|
||||
public R remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s)
|
||||
{
|
||||
return toAjax(${className}Service.delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaField}s));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,36 @@
|
|||
<el-table-column label="手机号" align="center" prop="phone" />
|
||||
<el-table-column label="用户名" align="center" prop="username" />
|
||||
<el-table-column label="学校证明" align="center" prop="prove" />
|
||||
<el-table-column label="头像" align="center" prop="avatarUrl" />
|
||||
<el-table-column
|
||||
align="center"
|
||||
width="200px"
|
||||
label="学校证明"
|
||||
>
|
||||
<template slot-scope="{ row }">
|
||||
<el-image
|
||||
:preview-src-list="[row.prove]"
|
||||
:src="row.prove"
|
||||
fit="cover"
|
||||
@click=""
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="avatarUrl"
|
||||
header-align="center"
|
||||
previce-srcList:
|
||||
align="center"
|
||||
label="头像"
|
||||
>
|
||||
<template slot-scope="scope" class="demo-image__preview">
|
||||
<img
|
||||
:src="scope.row.avatarUrl"
|
||||
width="40"
|
||||
height="40"
|
||||
class="head_pic"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="性别" align="center" prop="sex">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.sex == 0 ? '男' : scope.row.sex == 1 ? '女' : '' }}
|
||||
|
|
@ -239,7 +268,8 @@ export default {
|
|||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
},
|
||||
logicImageList: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue