Commit 750025ed authored by Shen's avatar Shen

1. swagger配置优化

2. 机构人员查询接口(adamin和api)重构
3. 机构服务人员添加状态,100为待审核,101为审核通过
parent 96f69661
...@@ -2,6 +2,7 @@ package io.hmit.common.config; ...@@ -2,6 +2,7 @@ package io.hmit.common.config;
import io.hmit.common.constant.Constant; import io.hmit.common.constant.Constant;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.ApiInfoBuilder;
...@@ -30,10 +31,13 @@ public class SwaggerConfig { ...@@ -30,10 +31,13 @@ public class SwaggerConfig {
// http://localhost:8080/swagger-ui.html 原路径 // http://localhost:8080/swagger-ui.html 原路径
// http://localhost:8080/doc.html bootstrap版本路径 // http://localhost:8080/doc.html bootstrap版本路径
@Value("${QR.domain}")
private String QRPath;
@Bean @Bean
public Docket createRestApi() { public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2) return new Docket(DocumentationType.SWAGGER_2)
// .host("byyl.zjhmit.com") .host(QRPath)
.apiInfo(apiInfo()) .apiInfo(apiInfo())
.select() .select()
//加了ApiOperation注解的类,生成接口文档 //加了ApiOperation注解的类,生成接口文档
......
...@@ -17,6 +17,7 @@ import io.hmit.common.validator.group.DefaultGroup; ...@@ -17,6 +17,7 @@ import io.hmit.common.validator.group.DefaultGroup;
import io.hmit.common.validator.group.UpdateGroup; import io.hmit.common.validator.group.UpdateGroup;
import io.hmit.modules.security.user.SecurityUser; import io.hmit.modules.security.user.SecurityUser;
import io.hmit.modules.serviceOrder.dto.UserDTO; import io.hmit.modules.serviceOrder.dto.UserDTO;
import io.hmit.modules.serviceOrder.entity.UserEntity;
import io.hmit.modules.serviceOrder.excel.UserExcel; import io.hmit.modules.serviceOrder.excel.UserExcel;
import io.hmit.modules.serviceOrder.service.RoleUserService; import io.hmit.modules.serviceOrder.service.RoleUserService;
import io.hmit.modules.serviceOrder.service.UserService; import io.hmit.modules.serviceOrder.service.UserService;
...@@ -72,9 +73,22 @@ public class UserController { ...@@ -72,9 +73,22 @@ public class UserController {
return new Result<PageData<UserDTO>>().ok(page); return new Result<PageData<UserDTO>>().ok(page);
} }
@GetMapping("staffPage")
@ApiOperation(value = "根据机构Id获取工作人员", notes = "状态为100时为待审核,101为正常")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = "orgId", value = "机构id", paramType = "query", dataType="String")
})
public Result<PageData<UserDTO>> staffPage(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<UserDTO> page = userService.getOrgStaff(params);
return new Result<PageData<UserDTO>>().ok(page);
}
@GetMapping("{id}") @GetMapping("{id}")
@ApiOperation("信息") @ApiOperation("信息")
@RequiresPermissions("serviceOrder:user:info")
public Result<UserDTO> get(@PathVariable("id") Long id){ public Result<UserDTO> get(@PathVariable("id") Long id){
UserDTO data = userService.get(id); UserDTO data = userService.get(id);
data.setRoleIdList(roleUserService.getRoleIdList(data.getId())); data.setRoleIdList(roleUserService.getRoleIdList(data.getId()));
...@@ -85,7 +99,6 @@ public class UserController { ...@@ -85,7 +99,6 @@ public class UserController {
@PostMapping @PostMapping
@ApiOperation("保存") @ApiOperation("保存")
@LogOperation("保存") @LogOperation("保存")
@RequiresPermissions("serviceOrder:user:save")
public Result save(@RequestBody UserDTO dto){ public Result save(@RequestBody UserDTO dto){
//校验数据 //校验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
...@@ -99,7 +112,6 @@ public class UserController { ...@@ -99,7 +112,6 @@ public class UserController {
@PutMapping @PutMapping
@ApiOperation("修改") @ApiOperation("修改")
@LogOperation("修改") @LogOperation("修改")
@RequiresPermissions("serviceOrder:user:update")
public Result update(@RequestBody UserDTO dto){ public Result update(@RequestBody UserDTO dto){
//校验数据 //校验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
...@@ -113,7 +125,6 @@ public class UserController { ...@@ -113,7 +125,6 @@ public class UserController {
@DeleteMapping @DeleteMapping
@ApiOperation("删除") @ApiOperation("删除")
@LogOperation("删除") @LogOperation("删除")
@RequiresPermissions("serviceOrder:user:delete")
public Result delete(@RequestBody Long[] ids){ public Result delete(@RequestBody Long[] ids){
//校验数据 //校验数据
AssertUtils.isArrayEmpty(ids, "id"); AssertUtils.isArrayEmpty(ids, "id");
......
...@@ -14,7 +14,11 @@ import java.util.List; ...@@ -14,7 +14,11 @@ import java.util.List;
*/ */
@Mapper @Mapper
public interface UserDao extends BaseDao<UserEntity> { public interface UserDao extends BaseDao<UserEntity> {
UserEntity getUserByUserId(Long userId); UserEntity getUserByUserId(Long userId);
List<Long> getAllOrganizationStaff(Long userId); List<Long> getAllOrganizationStaff(Long userId);
List<UserEntity> getOrgStaff(Long orgId);
} }
...@@ -53,6 +53,12 @@ public class UserDTO implements Serializable { ...@@ -53,6 +53,12 @@ public class UserDTO implements Serializable {
@ApiModelProperty(value = "详细地址") @ApiModelProperty(value = "详细地址")
private String address; private String address;
@ApiModelProperty(value = "身份证号")
private Long idCardNo;
@ApiModelProperty(value = "状态")
private Integer status;
@ApiModelProperty(value = "角色ID列表") @ApiModelProperty(value = "角色ID列表")
private List<Long> roleIdList; private List<Long> roleIdList;
......
...@@ -55,6 +55,14 @@ public class UserEntity extends BaseEntity { ...@@ -55,6 +55,14 @@ public class UserEntity extends BaseEntity {
* 详细地址 * 详细地址
*/ */
private String address; private String address;
/**
* 身份证号
*/
private Long idCardNo;
/**
* 状态
*/
private Integer status;
/** /**
* 所属社区名称 * 所属社区名称
*/ */
......
...@@ -19,6 +19,9 @@ public interface UserService extends CrudService<UserEntity, UserDTO> { ...@@ -19,6 +19,9 @@ public interface UserService extends CrudService<UserEntity, UserDTO> {
void saveOrUpdateUserRole(Long userId, List<Long> roleIdList); void saveOrUpdateUserRole(Long userId, List<Long> roleIdList);
UserEntity getUserByUserId(Long userId); UserEntity getUserByUserId(Long userId);
PageData<UserEntity> getOrganizationAllUsers(Map<String, Object> params, Long userId); PageData<UserEntity> getOrganizationAllUsers(Map<String, Object> params, Long userId);
PageData<UserDTO> getOrgStaff(Map<String, Object> params);
} }
...@@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import io.hmit.common.constant.Constant; import io.hmit.common.constant.Constant;
import io.hmit.common.page.PageData; import io.hmit.common.page.PageData;
import io.hmit.common.service.impl.CrudServiceImpl; import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.common.utils.SubListForPageUtil;
import io.hmit.modules.serviceOrder.dao.UserDao; import io.hmit.modules.serviceOrder.dao.UserDao;
import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
import io.hmit.modules.serviceOrder.dto.UserDTO; import io.hmit.modules.serviceOrder.dto.UserDTO;
import io.hmit.modules.serviceOrder.entity.UserEntity; import io.hmit.modules.serviceOrder.entity.UserEntity;
import io.hmit.modules.serviceOrder.service.RoleUserService; import io.hmit.modules.serviceOrder.service.RoleUserService;
...@@ -29,6 +31,10 @@ public class UserServiceImpl extends CrudServiceImpl<UserDao, UserEntity, UserDT ...@@ -29,6 +31,10 @@ public class UserServiceImpl extends CrudServiceImpl<UserDao, UserEntity, UserDT
@Autowired @Autowired
private RoleUserService roleUserService; private RoleUserService roleUserService;
@Autowired
private UserDao userDao;
@Override @Override
public QueryWrapper<UserEntity> getWrapper(Map<String, Object> params){ public QueryWrapper<UserEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id"); String id = (String)params.get("id");
...@@ -63,4 +69,10 @@ public class UserServiceImpl extends CrudServiceImpl<UserDao, UserEntity, UserDT ...@@ -63,4 +69,10 @@ public class UserServiceImpl extends CrudServiceImpl<UserDao, UserEntity, UserDT
return getPageData(list, page.getTotal(), UserEntity.class); return getPageData(list, page.getTotal(), UserEntity.class);
} }
@Override
public PageData<UserDTO> getOrgStaff(Map<String, Object> params) {
List<UserEntity> list = userDao.getOrgStaff(Long.parseLong(params.get("orgId").toString()));
return getPageData(SubListForPageUtil.getSubList(params, list), list.size(), UserDTO.class);
}
} }
...@@ -75,4 +75,5 @@ QR: ...@@ -75,4 +75,5 @@ QR:
download-path: D:/upload/pension/ download-path: D:/upload/pension/
# download-path: /home/websoft/java_jar/pension_service/myfile/ # download-path: /home/websoft/java_jar/pension_service/myfile/
# download-path: /home/resourse/bsqzc/ D:/123/ /home/websoft/java_jar/pension_service/myfile/ # download-path: /home/resourse/bsqzc/ D:/123/ /home/websoft/java_jar/pension_service/myfile/
#此处修改需要在io.hmit.modules.security.config.WebMvcConfig 修改静态资源位置 domain: 192.168.10.61:8088
\ No newline at end of file # domain: byyl.zjhmit.com
\ No newline at end of file
...@@ -27,5 +27,9 @@ ...@@ -27,5 +27,9 @@
WHERE pou.user_id = tu.id and tu.user_id = #{userId}); WHERE pou.user_id = tu.id and tu.user_id = #{userId});
</select> </select>
<select id="getOrgStaff" resultType="io.hmit.modules.serviceOrder.entity.UserEntity">
SELECT tu.id, tu.user_id, tu.username, tu.mobile, tu.openid, tu.address_area, tu.address, tu.id_card_no, tu.status
FROM tb_user tu, pension_organization_user pou WHERE tu.id = pou.service_id AND pou.organization_id = #{orgId}
</select>
</mapper> </mapper>
...@@ -40,4 +40,6 @@ public interface UserDao extends BaseDao<UserEntity> { ...@@ -40,4 +40,6 @@ public interface UserDao extends BaseDao<UserEntity> {
*/ */
List<UserAddressDTO> findUserAddressByUsernameOrMobile(String username, String mobile); List<UserAddressDTO> findUserAddressByUsernameOrMobile(String username, String mobile);
List<UserEntity> getOrgStaff(Long userId);
} }
...@@ -11,6 +11,7 @@ import io.hmit.common.validator.ValidatorUtils; ...@@ -11,6 +11,7 @@ import io.hmit.common.validator.ValidatorUtils;
import io.hmit.common.validator.group.AddGroup; import io.hmit.common.validator.group.AddGroup;
import io.hmit.common.validator.group.DefaultGroup; import io.hmit.common.validator.group.DefaultGroup;
import io.hmit.common.validator.group.UpdateGroup; import io.hmit.common.validator.group.UpdateGroup;
import io.hmit.dto.UserInfoDTO;
import io.hmit.entity.UserEntity; import io.hmit.entity.UserEntity;
import io.hmit.modules.serviceOrder.dto.PensionOrderDTO; import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
import io.hmit.modules.serviceOrder.dto.ReservationDTO; import io.hmit.modules.serviceOrder.dto.ReservationDTO;
...@@ -368,8 +369,9 @@ public class PensionOrderController { ...@@ -368,8 +369,9 @@ public class PensionOrderController {
/** /**
* 本机构全部人员 * 本机构全部人员
*/ */
@Deprecated
@Login @Login
@GetMapping("organizationStaff") @GetMapping("organizationStaff2")
@ApiOperation(value = "本机构全部人员(机构)") @ApiOperation(value = "本机构全部人员(机构)")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
...@@ -377,12 +379,28 @@ public class PensionOrderController { ...@@ -377,12 +379,28 @@ public class PensionOrderController {
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
}) })
public Result<PageData<UserEntity>> organizationStaff(@ApiIgnore @LoginUser UserEntity user, public Result<PageData<UserEntity>> organizationStaff2(@ApiIgnore @LoginUser UserEntity user,
@ApiIgnore @RequestParam Map<String, Object> params){ @ApiIgnore @RequestParam Map<String, Object> params){
PageData<UserEntity> page = userService.getOrganizationAllUsers(params, user.getId()); PageData<UserEntity> page = userService.getOrganizationAllUsers(params, user.getId());
return new Result<PageData<UserEntity>>().ok(page); return new Result<PageData<UserEntity>>().ok(page);
} }
/**
* 本机构全部人员
*/
@Login
@GetMapping("organizationStaff")
@ApiOperation(value = "本机构全部人员(机构)")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType="int")
})
public Result<PageData<UserInfoDTO>> organizationStaff(@ApiIgnore @LoginUser UserEntity user,
@ApiIgnore @RequestParam Map<String, Object> params){
PageData<UserInfoDTO> page = userService.getOrganizationStaff(params, user.getId());
return new Result<PageData<UserInfoDTO>>().ok(page);
}
/** /**
* 机构处理 * 机构处理
*/ */
......
...@@ -43,6 +43,8 @@ public interface UserService extends BaseService<UserEntity> { ...@@ -43,6 +43,8 @@ public interface UserService extends BaseService<UserEntity> {
PageData<UserEntity> getOrganizationAllUsers(Map<String, Object> params, Long userId); PageData<UserEntity> getOrganizationAllUsers(Map<String, Object> params, Long userId);
PageData<UserInfoDTO> getOrganizationStaff(Map<String, Object> params, Long userId);
OrgUserInfoDTO getOrgUserByUserId(Long userId); OrgUserInfoDTO getOrgUserByUserId(Long userId);
ServiceUserInfoDTO getServiceUserByUserId(Long userId); ServiceUserInfoDTO getServiceUserByUserId(Long userId);
......
...@@ -7,6 +7,7 @@ import io.hmit.common.exception.HmitException; ...@@ -7,6 +7,7 @@ import io.hmit.common.exception.HmitException;
import io.hmit.common.page.PageData; import io.hmit.common.page.PageData;
import io.hmit.common.service.impl.BaseServiceImpl; import io.hmit.common.service.impl.BaseServiceImpl;
import io.hmit.common.utils.ConvertUtils; import io.hmit.common.utils.ConvertUtils;
import io.hmit.common.utils.SubListForPageUtil;
import io.hmit.common.validator.AssertUtils; import io.hmit.common.validator.AssertUtils;
import io.hmit.dao.UserDao; import io.hmit.dao.UserDao;
import io.hmit.dto.*; import io.hmit.dto.*;
...@@ -124,6 +125,12 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem ...@@ -124,6 +125,12 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
return getPageData(list, page.getTotal(), UserEntity.class); return getPageData(list, page.getTotal(), UserEntity.class);
} }
@Override
public PageData<UserInfoDTO> getOrganizationStaff(Map<String, Object> params, Long userId) {
List<UserEntity> list = userDao.getOrgStaff(userId);
return getPageData(SubListForPageUtil.getSubList(params, list), list.size(), UserInfoDTO.class);
}
@Override @Override
public OrgUserInfoDTO getOrgUserByUserId(Long userId) { public OrgUserInfoDTO getOrgUserByUserId(Long userId) {
return userDao.getOrgUserByUserId(userId); return userDao.getOrgUserByUserId(userId);
......
...@@ -56,4 +56,10 @@ ...@@ -56,4 +56,10 @@
</if> </if>
</select> </select>
<select id="getOrgStaff" resultType="io.hmit.entity.UserEntity">
SELECT tu.* FROM tb_user tu, pension_organization_user pou
WHERE tu.id = pou.service_id AND tu.status != 100
AND pou.organization_id = (SELECT pous.organization_id FROM pension_organization_user pous WHERE pous.service_id = #{userId})
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment