Commit 640c5901 authored by Shen's avatar Shen

1. admin模块 用户审核

2. 添加根据用户状态查询用户列表
3. 移动端对接添加服务人员注册
4. 添加用户身份绑定
5. 添加用机构绑定
parent b4560207
...@@ -16,6 +16,7 @@ import io.hmit.common.validator.group.AddGroup; ...@@ -16,6 +16,7 @@ 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.modules.security.user.SecurityUser; import io.hmit.modules.security.user.SecurityUser;
import io.hmit.modules.serviceOrder.dto.RoleUserDTO;
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.excel.UserExcel; import io.hmit.modules.serviceOrder.excel.UserExcel;
...@@ -87,6 +88,17 @@ public class UserController { ...@@ -87,6 +88,17 @@ public class UserController {
return new Result<PageData<UserDTO>>().ok(page); return new Result<PageData<UserDTO>>().ok(page);
} }
@GetMapping("getStaffByStatus")
@ApiOperation(value = "根据状态查询服务人员", notes = "状态为100时为待审核,101为正常")
@ApiImplicitParams({
@ApiImplicitParam(name = "orgId", value = "机构id", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = "status", value = "状态,100待审核,101正常", paramType = "query", dataType="String")
})
public Result<List<UserDTO>> getStaffByStatus(@ApiIgnore @RequestParam Map<String, Object> params){
List<UserDTO> list = userService.getOrgStaffByStatus(params);
return new Result<List<UserDTO>>().ok(list);
}
@GetMapping("{id}") @GetMapping("{id}")
@ApiOperation("信息") @ApiOperation("信息")
public Result<UserDTO> get(@PathVariable("id") Long id){ public Result<UserDTO> get(@PathVariable("id") Long id){
...@@ -96,6 +108,19 @@ public class UserController { ...@@ -96,6 +108,19 @@ public class UserController {
return new Result<UserDTO>().ok(data); return new Result<UserDTO>().ok(data);
} }
@PostMapping("auditedStaff")
@ApiOperation("审核通过")
public Result auditedStaff(@RequestParam("userId") Long id){
UserDTO userDTO = userService.get(id);
userDTO.setStatus(101);
RoleUserDTO roleUserDTO = new RoleUserDTO();
roleUserDTO.setUserId(id);
roleUserDTO.setRoleId(1354991197348798466L);
roleUserService.save(roleUserDTO);
return new Result().ok("success");
}
@PostMapping @PostMapping
@ApiOperation("保存") @ApiOperation("保存")
@LogOperation("保存") @LogOperation("保存")
......
...@@ -21,4 +21,6 @@ public interface UserDao extends BaseDao<UserEntity> { ...@@ -21,4 +21,6 @@ public interface UserDao extends BaseDao<UserEntity> {
List<UserEntity> getOrgStaff(Long orgId); List<UserEntity> getOrgStaff(Long orgId);
List<UserEntity> getOrgStaffByStatus(Long orgId, Integer status);
} }
...@@ -24,4 +24,6 @@ public interface UserService extends CrudService<UserEntity, UserDTO> { ...@@ -24,4 +24,6 @@ public interface UserService extends CrudService<UserEntity, UserDTO> {
PageData<UserDTO> getOrgStaff(Map<String, Object> params); PageData<UserDTO> getOrgStaff(Map<String, Object> params);
List<UserDTO> getOrgStaffByStatus(Map<String, Object> params);
} }
...@@ -116,6 +116,10 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -116,6 +116,10 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
pensionOrderEntity.setOrderRecipientName(recipient.getUsername()); pensionOrderEntity.setOrderRecipientName(recipient.getUsername());
pensionOrderEntity.setOrderRecipientPhone(recipient.getMobile()); pensionOrderEntity.setOrderRecipientPhone(recipient.getMobile());
pensionOrderEntity.setOrderRecipientTime(new Date()); pensionOrderEntity.setOrderRecipientTime(new Date());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
pensionOrderEntity.setAppointmentTime(sdf.parse(params.get("appointmentTime").toString()));
}catch (Exception ignored){}
update(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class)); update(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class));
pushMessage.sendServiceWeChatMsg(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class), recipient.getOpenid()); pushMessage.sendServiceWeChatMsg(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class), recipient.getOpenid());
pushMessage.sendWeChatMsg(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class), userService.getUserByUserId(pensionOrderEntity.getCreator()).getOpenid(), "oldman"); pushMessage.sendWeChatMsg(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class), userService.getUserByUserId(pensionOrderEntity.getCreator()).getOpenid(), "oldman");
......
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -5,6 +5,7 @@ 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.ConvertUtils;
import io.hmit.common.utils.SubListForPageUtil; 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.PensionOrderDTO;
...@@ -75,4 +76,10 @@ public class UserServiceImpl extends CrudServiceImpl<UserDao, UserEntity, UserDT ...@@ -75,4 +76,10 @@ public class UserServiceImpl extends CrudServiceImpl<UserDao, UserEntity, UserDT
return getPageData(SubListForPageUtil.getSubList(params, list), list.size(), UserDTO.class); return getPageData(SubListForPageUtil.getSubList(params, list), list.size(), UserDTO.class);
} }
@Override
public List<UserDTO> getOrgStaffByStatus(Map<String, Object> params) {
List<UserEntity> staffList = userDao.getOrgStaffByStatus(Long.parseLong(params.get("orgId").toString()), Integer.parseInt(params.get("status").toString()));
return ConvertUtils.sourceToTarget(staffList, UserDTO.class);
}
} }
...@@ -32,4 +32,9 @@ ...@@ -32,4 +32,9 @@
FROM tb_user tu, pension_organization_user pou WHERE tu.id = pou.service_id AND pou.organization_id = #{orgId} FROM tb_user tu, pension_organization_user pou WHERE tu.id = pou.service_id AND pou.organization_id = #{orgId}
</select> </select>
<select id="getOrgStaffByStatus" 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} AND tu.status = #{status}
</select>
</mapper> </mapper>
...@@ -6,10 +6,7 @@ import io.hmit.annotation.Login; ...@@ -6,10 +6,7 @@ import io.hmit.annotation.Login;
import io.hmit.annotation.LoginUser; import io.hmit.annotation.LoginUser;
import io.hmit.common.utils.ConvertUtils; import io.hmit.common.utils.ConvertUtils;
import io.hmit.common.utils.Result; import io.hmit.common.utils.Result;
import io.hmit.dto.OrgUserInfoDTO; import io.hmit.dto.*;
import io.hmit.dto.ServiceUserInfoDTO;
import io.hmit.dto.UserInfoDTO;
import io.hmit.dto.UserRegisterDTO;
import io.hmit.entity.UserEntity; import io.hmit.entity.UserEntity;
import io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO; import io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO;
import io.hmit.modules.serviceOrder.dto.PensionOrderDTO; import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
...@@ -99,6 +96,14 @@ public class UserController { ...@@ -99,6 +96,14 @@ public class UserController {
return new Result(); return new Result();
} }
@PostMapping("registerService")
@ApiOperation("注册服务人员")
public Result registerService(@RequestBody ServiceRegisterDTO dto){
userService.registerService(dto);
return new Result();
}
@Login @Login
@GetMapping("findUserAdderss") @GetMapping("findUserAdderss")
@ApiOperation("根据手机号或用户姓名查找用户地址") @ApiOperation("根据手机号或用户姓名查找用户地址")
......
package io.hmit.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Eve
* @email mengmengeve@gmail.com
* @create 2021/1/27
*/
@Data
@ApiModel(value = "服务人员注册信息")
public class ServiceRegisterDTO {
@JsonIgnore
private Long id;
/**
* 用户名
*/
@ApiModelProperty(value = "姓名")
private String username;
/**
* 手机号
*/
@ApiModelProperty(value = "手机号")
private String mobile;
/**
* 身份证号码
*/
@ApiModelProperty(value = "身份证号码")
private Long idCardNo;
/**
* 性别
*/
@ApiModelProperty(value = "性别")
private String gender;
/**
* 微信openid
*/
@ApiModelProperty(value = "微信openid")
private String openid;
/**
* 注册角色
*/
@ApiModelProperty(value = "所属机构")
private Long orgId;
}
...@@ -94,5 +94,9 @@ public class UserEntity implements Serializable { ...@@ -94,5 +94,9 @@ public class UserEntity implements Serializable {
* 身份证号码 * 身份证号码
*/ */
private Long idCardNo; private Long idCardNo;
/**
* 状态
*/
private Integer status;
} }
package io.hmit.modules.serviceOrder.dao;
import io.hmit.common.dao.BaseDao;
import io.hmit.modules.serviceOrder.entity.PensionOrganizationUserEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 机构人员关系
*
* @author Shen Yuanfeng syf0412@vip.qq.com
* @since 1.0.0 2021-05-17
*/
@Mapper
public interface PensionOrganizationUserDao extends BaseDao<PensionOrganizationUserEntity> {
}
\ No newline at end of file
package io.hmit.modules.serviceOrder.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 机构人员关系
*
* @author Shen Yuanfeng syf0412@vip.qq.com
* @since 1.0.0 2021-05-17
*/
@Data
@ApiModel(value = "机构人员关系")
public class PensionOrganizationUserDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "机构ID")
private Long organizationId;
@ApiModelProperty(value = "用户ID")
private Long userId;
@ApiModelProperty(value = "服务人员ID")
private Long serviceId;
@ApiModelProperty(value = "创建者")
private Long creator;
@ApiModelProperty(value = "创建时间")
private Date createDate;
}
\ No newline at end of file
package io.hmit.modules.serviceOrder.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.hmit.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 机构人员关系
*
* @author Shen Yuanfeng syf0412@vip.qq.com
* @since 1.0.0 2021-05-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("pension_organization_user")
public class PensionOrganizationUserEntity {
private static final long serialVersionUID = 1L;
@TableId
private Long id;
/**
* 机构ID
*/
private Long organizationId;
/**
* 用户ID
*/
private Long userId;
/**
* 服务人员ID
*/
private Long serviceId;
/**
* 创建者
*/
private Long creator;
/**
* 创建时间
*/
private Date createDate;
}
\ No newline at end of file
package io.hmit.service;
import io.hmit.common.service.CrudService;
import io.hmit.modules.serviceOrder.dto.PensionOrganizationUserDTO;
import io.hmit.modules.serviceOrder.entity.PensionOrganizationUserEntity;
/**
* 机构人员关系
*
* @author Shen Yuanfeng syf0412@vip.qq.com
* @since 1.0.0 2021-05-17
*/
public interface PensionOrganizationUserService extends CrudService<PensionOrganizationUserEntity, PensionOrganizationUserDTO> {
}
\ No newline at end of file
...@@ -55,4 +55,6 @@ public interface UserService extends BaseService<UserEntity> { ...@@ -55,4 +55,6 @@ public interface UserService extends BaseService<UserEntity> {
List<UserAddressDTO> findUserAddressByUsernameOrMobile(String str); List<UserAddressDTO> findUserAddressByUsernameOrMobile(String str);
void registerService(ServiceRegisterDTO serviceRegisterDTO);
} }
package io.hmit.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.modules.serviceOrder.dao.PensionOrganizationUserDao;
import io.hmit.modules.serviceOrder.dto.PensionOrganizationUserDTO;
import io.hmit.modules.serviceOrder.entity.PensionOrganizationUserEntity;
import io.hmit.service.PensionOrganizationUserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* 机构人员关系
*
* @author Shen Yuanfeng syf0412@vip.qq.com
* @since 1.0.0 2021-05-17
*/
@Service
public class PensionOrganizationUserServiceImpl extends CrudServiceImpl<PensionOrganizationUserDao, PensionOrganizationUserEntity, PensionOrganizationUserDTO> implements PensionOrganizationUserService {
@Override
public QueryWrapper<PensionOrganizationUserEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
QueryWrapper<PensionOrganizationUserEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
return wrapper;
}
}
\ No newline at end of file
...@@ -13,13 +13,17 @@ import io.hmit.dao.UserDao; ...@@ -13,13 +13,17 @@ import io.hmit.dao.UserDao;
import io.hmit.dto.*; import io.hmit.dto.*;
import io.hmit.entity.TokenEntity; import io.hmit.entity.TokenEntity;
import io.hmit.entity.UserEntity; import io.hmit.entity.UserEntity;
import io.hmit.modules.serviceOrder.dto.PensionOrganizationUserDTO;
import io.hmit.modules.serviceOrder.dto.UserAddressDTO; import io.hmit.modules.serviceOrder.dto.UserAddressDTO;
import io.hmit.modules.serviceOrder.dto.UserRoleInfoDTO; import io.hmit.modules.serviceOrder.dto.UserRoleInfoDTO;
import io.hmit.modules.serviceOrder.service.PensionOldFamilyService; import io.hmit.modules.serviceOrder.service.PensionOldFamilyService;
import io.hmit.modules.serviceOrder.service.PensionOrganizationService;
import io.hmit.modules.serviceOrder.service.RoleUserService; import io.hmit.modules.serviceOrder.service.RoleUserService;
import io.hmit.service.PensionOrganizationUserService;
import io.hmit.service.TokenService; import io.hmit.service.TokenService;
import io.hmit.service.UserService; import io.hmit.service.UserService;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -45,6 +49,9 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem ...@@ -45,6 +49,9 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
@Autowired @Autowired
private RoleUserService roleUserService; private RoleUserService roleUserService;
@Autowired
private PensionOrganizationUserService pensionOrganizationUserService;
@Override @Override
public UserEntity getByMobile(String mobile) { public UserEntity getByMobile(String mobile) {
return baseDao.getUserByMobile(mobile); return baseDao.getUserByMobile(mobile);
...@@ -213,4 +220,16 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem ...@@ -213,4 +220,16 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
return userAddress; return userAddress;
} }
@Override
public void registerService(ServiceRegisterDTO serviceRegisterDTO) {
UserEntity userEntity = new UserEntity();
BeanUtils.copyProperties(serviceRegisterDTO, userEntity);
userEntity.setStatus(100);
insert(userEntity);
PensionOrganizationUserDTO pensionOrganizationUserDTO = new PensionOrganizationUserDTO();
pensionOrganizationUserDTO.setOrganizationId(serviceRegisterDTO.getOrgId());
pensionOrganizationUserDTO.setServiceId(userEntity.getId());
pensionOrganizationUserService.save(pensionOrganizationUserDTO);
}
} }
\ 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