|  |  |  | 
|---|
|  |  |  | package com.doumee.api.web; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.doumee.biz.system.SystemDictDataBiz; | 
|---|
|  |  |  | import com.doumee.config.annotation.ErpLoginRequired; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.model.openapi.request.*; | 
|---|
|  |  |  | import com.doumee.core.model.openapi.response.*; | 
|---|
|  |  |  | import com.doumee.core.erp.model.openapi.request.*; | 
|---|
|  |  |  | import com.doumee.core.erp.model.openapi.response.*; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.service.business.ERPSyncService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiImplicitParam; | 
|---|
|  |  |  | import io.swagger.annotations.ApiImplicitParams; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.HashMap; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * Created by IntelliJ IDEA. | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Api(tags = "1、【访客端】数据资源接口(向ERP端提供或提交数据信息)") | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @RequestMapping("/visitbiz/resource") | 
|---|
|  |  |  | @RequestMapping("/visitbiz") | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | public class BizResourceController extends ApiController{ | 
|---|
|  |  |  | public class BizResourceController extends ApiController { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ERPSyncService erpSyncService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private SystemDictDataBiz systemDictDataBiz; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "调用凭据获取接口", notes = "访客端提供,供ERP端调用,向ERP提供统接口调用凭证") | 
|---|
|  |  |  | @GetMapping("/accesstoken") | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "String", name = "accessKey", value = "访问key,由访客端提供", required = true), | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "String", name = "accessSecret", value = "访问秘钥,由访客端提供", required = true) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<AccessTokenResponse> roleList(@RequestParam  String accessKey, @RequestParam  String accessSecret) { | 
|---|
|  |  |  | return  ApiResponse.success(new AccessTokenResponse()); | 
|---|
|  |  |  | public ApiResponse<AccessTokenResponse> accesstoken(@RequestParam  String accessKey, @RequestParam  String accessSecret) { | 
|---|
|  |  |  | return  ApiResponse.success(erpSyncService.createERPToken(accessKey,accessSecret)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ErpLoginRequired | 
|---|
|  |  |  | @ApiOperation(value = "门禁组全量接口", notes = "访客端提供,供ERP端调用,ERP端同步获取门禁组全量信息") | 
|---|
|  |  |  | @PostMapping("/resource/role/list") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "授权token值", required = true) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<List<RoleListResponse>> roleList(@RequestBody RoleListRequest param) { | 
|---|
|  |  |  | return  ApiResponse.success(new ArrayList<RoleListResponse>()); | 
|---|
|  |  |  | param.setToken(this.getToken()); | 
|---|
|  |  |  | return  ApiResponse.success(erpSyncService.erpQueryDeviceList(param)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "停车场全量信息接口", notes = "访客端提供,供ERP端调用,ERP端同步全部停车场数据") | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "授权token值", required = true) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<ParkListResponse> parkList(@RequestBody ParkListRequest param) { | 
|---|
|  |  |  | return  ApiResponse.success(new ParkListResponse()); | 
|---|
|  |  |  | public ApiResponse<List<ParkListResponse>> parkList(@RequestBody ParkListRequest param) { | 
|---|
|  |  |  | param.setToken(this.getToken()); | 
|---|
|  |  |  | return  ApiResponse.success(erpSyncService.parkList(param)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "访客出入事件同步接口", notes = "访客端提供,供ERP端调用,ERP端获取访客出入记录信息") | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "授权token值", required = true) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<PageData<VisitEventListResponse>> visitList (@RequestBody PageWrap<VisitListRequest> pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | pageWrap.getModel().setToken(this.getToken()); | 
|---|
|  |  |  | return ApiResponse.success(erpSyncService.visitListPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "门禁出入事件同步接口", notes = "访客端提供,供ERP端调用,ERP端获取门禁出入记录信息") | 
|---|
|  |  |  | @PostMapping("/resource/doorEvent/list") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "授权token值", required = true) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<PageData<DoorEventListResponse>> doorEventList (@RequestBody PageWrap<DoorEventListRequest> pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | pageWrap.getModel().setToken(this.getToken()); | 
|---|
|  |  |  | return ApiResponse.success(erpSyncService.doorEventListPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "车辆出入事件同步接口", notes = "访客端提供,供ERP端调用,ERP端获取车辆出入记录信息") | 
|---|
|  |  |  | @PostMapping("/resource/carvisit/list") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "授权token值", required = true) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<PageData<CarEventListResponse>> carEventList (@RequestBody PageWrap<CarEventListResponse> pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | public ApiResponse<PageData<CarEventListResponse>> carEventList (@RequestBody PageWrap<CarEventListRequest> pageWrap) { | 
|---|
|  |  |  | pageWrap.getModel().setToken(this.getToken()); | 
|---|
|  |  |  | return ApiResponse.success(erpSyncService.carEventList(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "组织变化接口", notes = "访客端提供,供ERP端调用,完成访客端组织信息同步,该接口支持单个组织新增、更新、删除需求") | 
|---|
|  |  |  | @PostMapping("/event/org/update") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "授权token值", required = true) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse orgUpdate(@RequestBody OrgUpdateRequest param) { | 
|---|
|  |  |  | param.setToken(this.getToken()); | 
|---|
|  |  |  | erpSyncService.orgUpdate(param); | 
|---|
|  |  |  | return  ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "人员变化接口", notes = "访客端提供,供ERP端调用,完成访客端人员信息同步,该接口支持单个人员新增、更新、删除需求") | 
|---|
|  |  |  | @PostMapping("/event/user/update") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "授权token值", required = true) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse userUpdate(@RequestBody UserUpdateRequest param) { | 
|---|
|  |  |  | param.setToken(this.getToken()); | 
|---|
|  |  |  | erpSyncService.userUpdate(param); | 
|---|
|  |  |  | return  ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "人员门禁组授权接口", notes = "访客端提供,供ERP端调用,访客端人员同步门禁组授权信息,该接口支持人员门禁组授权新增、更新、清空需求。") | 
|---|
|  |  |  | @PostMapping("/event/role/userAuthor") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "授权token值", required = true) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse roleUserAuthor(@RequestBody UserAuthorRequest param) { | 
|---|
|  |  |  | erpSyncService.roleUserAuthor(param); | 
|---|
|  |  |  | return  ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "车辆授权停车场接口", notes = "访客端提供,供ERP端调用,访客端同步车辆对停车场的使用权限,该接口支持车辆绑定、解绑归属人,支持新增、更新、清空车辆授权信息") | 
|---|
|  |  |  | @PostMapping("/event/park/carAuthor") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "授权token值", required = true) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse parkCarAuthor(@RequestBody CarAuthorRequest param) { | 
|---|
|  |  |  | erpSyncService.parkCarAuthor(param); | 
|---|
|  |  |  | return  ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "访客申请审批结果通知接口", notes = "访客端提供,供访客端调用,提交访客申请审批的结果") | 
|---|
|  |  |  | @PostMapping("/event/approve/notice") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "授权token值", required = true) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse approveApply(@RequestBody ApproveNoticeRequest account ) { | 
|---|
|  |  |  | public ApiResponse approveApply(@RequestBody ApproveNoticeRequest param) { | 
|---|
|  |  |  | param.setToken(this.getToken()); | 
|---|
|  |  |  | erpSyncService.approveApply(param); | 
|---|
|  |  |  | return  ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "FTP账户信息", notes = "访客端提供,供ERP端调用,FTP账户信息,其中【FTP资源访问映射地址】用于图片回显使用," + | 
|---|
|  |  |  | "比如人脸图片回显拼接:【FTP资源访问映射地址】+【FTP用户图片存储目录】+【实际人脸图片存储字段内容】" + | 
|---|
|  |  |  | "如:http://175.27.187.84/file4/member/20231211/skjd-skdjf4enc-flgk.png") | 
|---|
|  |  |  | @GetMapping("/resource/ftpAccount") | 
|---|
|  |  |  | public ApiResponse<Map<String,Object>> ftpAccount() { | 
|---|
|  |  |  | Map<String,Object> map = new HashMap<>(); | 
|---|
|  |  |  | map.put("FTP主机地址IP", | 
|---|
|  |  |  | systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_HOST).getCode()); | 
|---|
|  |  |  | map.put("FTP访问端口", | 
|---|
|  |  |  | systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_PORT).getCode()); | 
|---|
|  |  |  | map.put("FTP访问登录名", | 
|---|
|  |  |  | systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_USERNAME).getCode()); | 
|---|
|  |  |  | map.put("FTP访问登陆密码", | 
|---|
|  |  |  | systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_PWD).getCode()); | 
|---|
|  |  |  | map.put("FTP访客事件图片存储目录", | 
|---|
|  |  |  | systemDictDataBiz.queryByCode(Constants.FTP,Constants.VISIT_EVENT_IMG).getCode()); | 
|---|
|  |  |  | map.put("FTP车辆事件图片存储目录", | 
|---|
|  |  |  | systemDictDataBiz.queryByCode(Constants.FTP,Constants.CAR_EVENT_IMG).getCode()); | 
|---|
|  |  |  | map.put("FTP门禁事件图片存储目录", | 
|---|
|  |  |  | systemDictDataBiz.queryByCode(Constants.FTP,Constants.DEVICE_EVENT_IMG).getCode()); | 
|---|
|  |  |  | map.put("FTP用户图片存储目录", | 
|---|
|  |  |  | systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode()); | 
|---|
|  |  |  | map.put("FTP资源访问映射地址", | 
|---|
|  |  |  | systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode()); | 
|---|
|  |  |  | return  ApiResponse.success(map); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|