¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.web; |
| | | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.config.annotation.ErpLoginRequired; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | 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.dao.web.reqeust.ErpVisitDTO; |
| | | import com.doumee.service.business.VisitsService; |
| | | import com.doumee.service.business.ext.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 javax.validation.Valid; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2023/5/5 16:02 |
| | | */ |
| | | |
| | | @Api(tags = "1ããè®¿å®¢ç«¯ãæ°æ®èµæºæ¥å£ï¼åERP端æä¾ææäº¤æ°æ®ä¿¡æ¯ï¼") |
| | | @RestController |
| | | @RequestMapping("/visitbiz") |
| | | @Slf4j |
| | | public class BizResourceController extends ApiController { |
| | | |
| | | @Autowired |
| | | private ERPSyncService erpSyncService; |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Autowired |
| | | private VisitsService visitsService; |
| | | |
| | | |
| | | @ApiOperation(value = "è°ç¨åæ®è·åæ¥å£", notes = "访客端æä¾ï¼ä¾ERP端è°ç¨ï¼åERPæä¾ç»æ¥å£è°ç¨åè¯") |
| | | @GetMapping("/accesstoken") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "accessKey", value = "访é®keyï¼ç±è®¿å®¢ç«¯æä¾", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "accessSecret", value = "访é®ç§é¥ï¼ç±è®¿å®¢ç«¯æä¾", required = true) |
| | | }) |
| | | 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) { |
| | | param.setToken(this.getToken()); |
| | | return ApiResponse.success(erpSyncService.erpQueryDeviceList(param)); |
| | | } |
| | | |
| | | @ErpLoginRequired |
| | | @ApiOperation(value = "å车åºå
¨éä¿¡æ¯æ¥å£", notes = "访客端æä¾ï¼ä¾ERP端è°ç¨ï¼ERPç«¯åæ¥å
¨é¨åè½¦åºæ°æ®") |
| | | @PostMapping("/resource/park/list") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "æætokenå¼", required = true) |
| | | }) |
| | | public ApiResponse<List<ParkListResponse>> parkList(@RequestBody ParkListRequest param) { |
| | | param.setToken(this.getToken()); |
| | | return ApiResponse.success(erpSyncService.parkList(param)); |
| | | } |
| | | |
| | | @ErpLoginRequired |
| | | @ApiOperation(value = "访客åºå
¥äºä»¶åæ¥æ¥å£", notes = "访客端æä¾ï¼ä¾ERP端è°ç¨ï¼ERP端è·å访客åºå
¥è®°å½ä¿¡æ¯") |
| | | @PostMapping("/resource/visit/list") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "æætokenå¼", required = true) |
| | | }) |
| | | public ApiResponse<PageData<VisitEventListResponse>> visitList (@RequestBody PageWrap<VisitListRequest> pageWrap) { |
| | | pageWrap.getModel().setToken(this.getToken()); |
| | | return ApiResponse.success(erpSyncService.visitListPage(pageWrap)); |
| | | } |
| | | |
| | | @ErpLoginRequired |
| | | @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) { |
| | | pageWrap.getModel().setToken(this.getToken()); |
| | | return ApiResponse.success(erpSyncService.doorEventListPage(pageWrap)); |
| | | } |
| | | |
| | | @ErpLoginRequired |
| | | @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<CarEventListRequest> pageWrap) { |
| | | pageWrap.getModel().setToken(this.getToken()); |
| | | return ApiResponse.success(erpSyncService.carEventList(pageWrap)); |
| | | } |
| | | |
| | | @ErpLoginRequired |
| | | @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); |
| | | } |
| | | |
| | | @ErpLoginRequired |
| | | @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); |
| | | } |
| | | |
| | | @ErpLoginRequired |
| | | @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); |
| | | } |
| | | |
| | | @ErpLoginRequired |
| | | @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) { |
| | | ApiResponse response = ApiResponse.success(null); |
| | | try { |
| | | erpSyncService.parkCarAuthor(param); |
| | | }catch (BusinessException e){ |
| | | response = ApiResponse.failed(e.getCode(), e.getMessage()); |
| | | }catch (Exception e){ |
| | | response = ApiResponse.failed(ResponseStatus.SERVER_ERROR.getCode(),ResponseStatus.SERVER_ERROR.getMessage()); |
| | | } |
| | | //-----TODO-------è®°æ¥å¿-------start----- |
| | | |
| | | //-----TODO-------è®°æ¥å¿-------end----- |
| | | return response; |
| | | } |
| | | |
| | | @ErpLoginRequired |
| | | @ApiOperation(value = "访客ç³è¯·å®¡æ¹ç»æéç¥æ¥å£", notes = "访客端æä¾ï¼ä¾è®¿å®¢ç«¯è°ç¨ï¼æäº¤è®¿å®¢ç³è¯·å®¡æ¹çç»æ") |
| | | @PostMapping("/event/approve/notice") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "æætokenå¼", required = true) |
| | | }) |
| | | public ApiResponse approveApply(@RequestBody ApproveNoticeRequest param) { |
| | | param.setToken(this.getToken()); |
| | | erpSyncService.approveApply(param); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ErpLoginRequired |
| | | @ApiOperation(value = "å起访客ç³è¯·", notes = "访客端æä¾ï¼ä¾ERP端è°ç¨ï¼ERP端å起访客ç³è¯·") |
| | | @PostMapping("/resource/createVisit") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "æætokenå¼", required = true) |
| | | }) |
| | | public ApiResponse createVisit(@Valid @RequestBody ErpVisitDTO param) { |
| | | param.setToken(this.getToken()); |
| | | visitsService.createFKForErp(param); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | @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); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |