|  |  |  | 
|---|
|  |  |  | package com.doumee.cloud.admin; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.doumee.api.BaseController; | 
|---|
|  |  |  | import com.doumee.biz.system.SystemUserBiz; | 
|---|
|  |  |  | import com.doumee.config.DataSyncConfig; | 
|---|
|  |  |  | import com.doumee.config.annotation.CloudRequiredPermission; | 
|---|
|  |  |  | import com.doumee.config.annotation.LoginNoRequired; | 
|---|
|  |  |  | import com.doumee.core.annotation.excel.ExcelExporter; | 
|---|
|  |  |  | import com.doumee.core.annotation.pr.PreventRepeat; | 
|---|
|  |  |  | import com.doumee.core.annotation.trace.Trace; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.admin.request.LaborMemberDTO; | 
|---|
|  |  |  | import com.doumee.dao.admin.request.MemberImport; | 
|---|
|  |  |  | import com.doumee.dao.admin.request.MemberQuery; | 
|---|
|  |  |  | import com.doumee.dao.business.dto.RegisterDriverDTO; | 
|---|
|  |  |  | import com.doumee.dao.business.dto.ResetPasswordDTO; | 
|---|
|  |  |  | import com.doumee.dao.business.model.Member; | 
|---|
|  |  |  | import com.doumee.dao.business.model.MemberRole; | 
|---|
|  |  |  | import com.doumee.dao.system.dto.UpdatePwdDto; | 
|---|
|  |  |  | import com.doumee.service.business.MemberService; | 
|---|
|  |  |  | import com.doumee.service.business.ext.ERPSyncService; | 
|---|
|  |  |  | import com.doumee.service.business.impl.hksync.fhk.HkSyncOrgUserFromHKServiceImpl; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import io.swagger.annotations.*; | 
|---|
|  |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.validation.annotation.Validated; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  | import org.springframework.web.multipart.MultipartFile; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  | import java.io.File; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private MemberService memberService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private SystemUserBiz systemUserBiz; | 
|---|
|  |  |  | @PreventRepeat | 
|---|
|  |  |  | @ApiOperation("新建") | 
|---|
|  |  |  | @PostMapping("/create") | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("员工权限下发") | 
|---|
|  |  |  | @GetMapping("/roleAuth/{id}") | 
|---|
|  |  |  | @CloudRequiredPermission("business:empower:create") | 
|---|
|  |  |  | public ApiResponse roleAuthById(@PathVariable Integer id) { | 
|---|
|  |  |  | memberService.roleAuthById(id); | 
|---|
|  |  |  | public ApiResponse roleAuthById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | memberService.roleAuthById(id,this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("同步人脸信息") | 
|---|
|  |  |  | @PostMapping("/updateFace") | 
|---|
|  |  |  | public ApiResponse updateFace(@RequestBody Member member,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | member.setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | memberService.updateFace(member); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("批量授权下发") | 
|---|
|  |  |  | @PostMapping("/batchRoleAuth") | 
|---|
|  |  |  | public ApiResponse batchRoleAuth(@RequestBody Member memberRole, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | memberRole.setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | memberService.batchRoleAuth(memberRole); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("强制删除安防平台人员信息") | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "人员信息导入" ,notes = "保单申请") | 
|---|
|  |  |  | @PostMapping("/importExcel") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(name = "file", value = "file", required = true, paramType = "query", dataType = "file", dataTypeClass = File.class), | 
|---|
|  |  |  | @ApiImplicitParam(name = "组织类型 0相关方 1内部组织", value = "companyType", required = true, paramType = "query", dataType = "Integer",example = "0",dataTypeClass = Integer.class), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @CloudRequiredPermission("business:member:create") | 
|---|
|  |  |  | public ApiResponse<String> importExcel (@ApiParam(value = "file") MultipartFile file,@ApiParam(value = "companyType") Integer companyType, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | return ApiResponse.success(memberService.importBatch(file,companyType,this.getLoginUser(token))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("批量拉黑") | 
|---|
|  |  |  | @GetMapping("/batchBlock") | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("查询全部") | 
|---|
|  |  |  | @PostMapping("/list") | 
|---|
|  |  |  | @CloudRequiredPermission("business:member:query") | 
|---|
|  |  |  | public ApiResponse<List<Member>> findPage (@RequestBody Member model,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | public ApiResponse<List<Member>> list (@RequestBody Member model,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | return ApiResponse.success(memberService.findList(model)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("查询全部司机") | 
|---|
|  |  |  | @PostMapping("/driveList") | 
|---|
|  |  |  | @CloudRequiredPermission("business:member:query") | 
|---|
|  |  |  | public ApiResponse<List<Member>> findDriveList (@RequestBody Member model,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | return ApiResponse.success(memberService.findDriveList(model)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("测试人员冻结") | 
|---|
|  |  |  | @PostMapping("/testFreeFz") | 
|---|
|  |  |  | public ApiResponse testFreeFz(@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @LoginNoRequired | 
|---|
|  |  |  | @ApiOperation("司机注册") | 
|---|
|  |  |  | @PostMapping("/registerDriver") | 
|---|
|  |  |  | public ApiResponse registerDriver(@RequestBody RegisterDriverDTO registerDriverDTO ){ | 
|---|
|  |  |  | memberService.registerDriver(registerDriverDTO); | 
|---|
|  |  |  | return ApiResponse.success("注册成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Trace(withRequestParameters = false) | 
|---|
|  |  |  | @ApiOperation("修改当前用户密码") | 
|---|
|  |  |  | @PostMapping("/updatePwd") | 
|---|
|  |  |  | public ApiResponse updatePwd (@RequestHeader(Constants.HEADER_USER_TOKEN) String token, @Validated @RequestBody UpdatePwdDto dto) { | 
|---|
|  |  |  | dto.setUserId(this.getLoginUser(token).getId()); | 
|---|
|  |  |  | systemUserBiz.updatePwd(dto); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|