9 changed files with 489 additions and 80 deletions
@ -0,0 +1,94 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.controller; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.elink.esua.epdc.dto.UserInfoDTO; |
||||
|
import com.elink.esua.epdc.excel.UserInfoExcel; |
||||
|
import com.elink.esua.epdc.service.UserInfoService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 用户信息表 用户信息表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-31 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("userinfo") |
||||
|
public class UserInfoController { |
||||
|
|
||||
|
@Autowired |
||||
|
private UserInfoService userInfoService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<UserInfoDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<UserInfoDTO> page = userInfoService.page(params); |
||||
|
return new Result<PageData<UserInfoDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<UserInfoDTO> get(@PathVariable("id") String id){ |
||||
|
UserInfoDTO data = userInfoService.get(id); |
||||
|
return new Result<UserInfoDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody UserInfoDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
userInfoService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping("update") |
||||
|
public Result update(@RequestBody UserInfoDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
userInfoService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
userInfoService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<UserInfoDTO> list = userInfoService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, UserInfoExcel.class); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,77 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 用户信息表 用户信息表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-31 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class UserInfoExcel { |
||||
|
|
||||
|
@Excel(name = "标识号") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "用户ID") |
||||
|
private String userId; |
||||
|
|
||||
|
@Excel(name = "头像地址") |
||||
|
private String headUrl; |
||||
|
|
||||
|
@Excel(name = "格言") |
||||
|
private String motto; |
||||
|
|
||||
|
@Excel(name = "承诺") |
||||
|
private String promise; |
||||
|
|
||||
|
@Excel(name = "服务范围") |
||||
|
private String serviceArea; |
||||
|
|
||||
|
@Excel(name = "推荐标识 0-否,1-是") |
||||
|
private String recommendFlag; |
||||
|
|
||||
|
@Excel(name = "推荐时间") |
||||
|
private Date recommendTime; |
||||
|
|
||||
|
@Excel(name = "删除标识 0-否,1-是") |
||||
|
private String delFlag; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private Integer revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.redis; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 用户信息表 用户信息表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-31 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class UserInfoRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
@ -1,40 +1,115 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
package com.elink.esua.epdc.service; |
package com.elink.esua.epdc.service; |
||||
|
|
||||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
||||
import com.elink.esua.epdc.commons.tools.utils.Result; |
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.dto.UserInfoDTO; |
||||
import com.elink.esua.epdc.dto.epdc.form.EpdcAppShowIdentityFormDTO; |
import com.elink.esua.epdc.dto.epdc.form.EpdcAppShowIdentityFormDTO; |
||||
import com.elink.esua.epdc.dto.epdc.result.EpdcAppIdentityDetailResultDTO; |
import com.elink.esua.epdc.dto.epdc.result.EpdcAppIdentityDetailResultDTO; |
||||
import com.elink.esua.epdc.entity.UserInfoEntity; |
import com.elink.esua.epdc.entity.UserInfoEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 用户信息表 用户信息表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-31 |
||||
|
*/ |
||||
public interface UserInfoService extends BaseService<UserInfoEntity> { |
public interface UserInfoService extends BaseService<UserInfoEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<UserInfoDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-08-31 |
||||
|
*/ |
||||
|
PageData<UserInfoDTO> page(Map<String, Object> params); |
||||
|
|
||||
/** |
/** |
||||
* 用户信息表 |
* 默认查询 |
||||
* @params [dto] |
* |
||||
|
* @param params |
||||
|
* @return java.util.List<UserInfoDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-08-31 |
||||
|
*/ |
||||
|
List<UserInfoDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return UserInfoDTO |
||||
|
* @author generator |
||||
|
* @date 2021-08-31 |
||||
|
*/ |
||||
|
UserInfoDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
* @return void |
* @return void |
||||
* @author zhangfenghe |
* @author generator |
||||
* @since 2021/8/29 11:00 |
* @date 2021-08-31 |
||||
*/ |
*/ |
||||
void save(EpdcAppShowIdentityFormDTO dto); |
void save(UserInfoDTO dto); |
||||
|
|
||||
EpdcAppIdentityDetailResultDTO getDentityDetail(String userId); |
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-08-31 |
||||
|
*/ |
||||
|
void update(UserInfoDTO dto); |
||||
|
|
||||
/** |
/** |
||||
* 党建引领-党员亮身份推荐 |
* 批量删除 |
||||
* @params [id] |
* |
||||
|
* @param ids |
||||
* @return void |
* @return void |
||||
* @author zhangfenghe |
* @author generator |
||||
* @since 2021/8/30 9:26 |
* @date 2021-08-31 |
||||
*/ |
*/ |
||||
Result recommended(String id); |
void delete(String[] ids); |
||||
|
|
||||
/** |
/** |
||||
* 党建引领-党员亮身份取消推荐 |
* 用户信息表 |
||||
* @params [id] |
* @params [dto] |
||||
* @return void |
* @return void |
||||
* @author zhangfenghe |
* @author zhangfenghe |
||||
* @since 2021/8/30 9:26 |
* @since 2021/8/29 11:00 |
||||
|
*/ |
||||
|
void save(EpdcAppShowIdentityFormDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 党员亮身份详情查询 |
||||
|
* @params [userId] |
||||
|
* @return com.elink.esua.epdc.dto.epdc.result.EpdcAppIdentityDetailResultDTO |
||||
|
* @author zhangfenghe |
||||
|
* @since 2021/9/1 9:23 |
||||
*/ |
*/ |
||||
Result recommendedCancel(String id); |
EpdcAppIdentityDetailResultDTO getDentityDetail(String userId); |
||||
} |
} |
Loading…
Reference in new issue