Merge remote-tracking branch 'origin/master'
| | |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | // @RequiresPermissions("business:cars:query") |
| | | @RequiresPermissions("business:cars:query") |
| | | public ApiResponse<PageData<Cars>> findPage (@RequestBody PageWrap<Cars> pageWrap) { |
| | | return ApiResponse.success(carsService.findPage(pageWrap)); |
| | | } |
| | |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:device:query") |
| | | //@RequiresPermissions("business:device:query") |
| | | public ApiResponse<PageData<Device>> findPage (@RequestBody PageWrap<Device> pageWrap) { |
| | | return ApiResponse.success(deviceService.findPage(pageWrap)); |
| | | } |
| | |
| | | return ApiResponse.success(memberService.findVisitPage(pageWrap)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("å¼å¸¸äººå") |
| | | @PostMapping("/findUnusualPage") |
| | | @RequiresPermissions("business:member:query") |
| | | public ApiResponse<PageData<MemberInfoDTO>> findUnusualPage (@RequestBody PageWrap<MemberQuery> pageWrap) { |
| | | return ApiResponse.success(memberService.findUnusualPage(pageWrap)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.service.business.impl.hksync.HkSyncImgServiceImpl; |
| | | import org.apache.http.client.methods.CloseableHttpResponse; |
| | | import org.apache.http.client.methods.HttpGet; |
| | | import org.apache.http.client.utils.URIBuilder; |
| | |
| | | @EnableScheduling |
| | | public class ScheduleTool { |
| | | |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | private HkSyncImgServiceImpl hkSyncImgService; |
| | | /** |
| | | * æ¯å¦å¼åè
|
| | | */ |
| | |
| | | * ç¼åçå¸åº |
| | | * @throws Exception |
| | | */ |
| | | @Scheduled(fixedDelay=24*60*60*1000) |
| | | public void cacheCampus() throws Exception { |
| | | } |
| | | /** |
| | | * æ¯å¤©åæ¨éç½®ææè®¢åcodeç±»åå§å¼ |
| | | * @throws Exception |
| | | */ |
| | | @Scheduled(cron="0 0 0 * * ?") |
| | | public void resetOrderCodes() throws Exception { |
| | | @Scheduled(fixedDelay= 60*1000) |
| | | public void downloadHkImg() throws Exception { |
| | | hkSyncImgService.downHKImgs(0); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * åégetè¯·æ± |
| | | * @param url 请æ±URL |
| | | * @param param 请æ±åæ° key:value urlæºå¸¦åæ° æè
æ åå¯ä¸å¡« |
| | | * @return |
| | | */ |
| | | public String doGet(String url, Map<String, String> param) { |
| | | // å建Httpclient对象 |
| | | CloseableHttpClient httpclient = HttpClients.createDefault(); |
| | | String resultString = ""; |
| | | CloseableHttpResponse response = null; |
| | | try { |
| | | // å建uri |
| | | URIBuilder builder = new URIBuilder(url); |
| | | if (param != null) { |
| | | for (String key : param.keySet()) { |
| | | builder.addParameter(key, param.get(key)); |
| | | } |
| | | } |
| | | URI uri = builder.build(); |
| | | // å建http GETè¯·æ± |
| | | HttpGet httpGet = new HttpGet(uri); |
| | | // æ§è¡è¯·æ± |
| | | response = httpclient.execute(httpGet); |
| | | // 夿è¿åç¶ææ¯å¦ä¸º200 |
| | | if (response.getStatusLine().getStatusCode() == 200) { |
| | | resultString = EntityUtils.toString(response.getEntity(), "UTF-8"); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | if (response != null) { |
| | | response.close(); |
| | | } |
| | | httpclient.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return resultString; |
| | | } |
| | | |
| | | } |
| | |
| | | String eventSub= "/api/eventService/v1/eventSubscriptionByEventTypes";//äºä»¶è®¢é
|
| | | String doorSearch= "/api/resource/v2/door/search";//æ¥è¯¢é¨ç¦ç¹å表v2 |
| | | String cancelEventSub= "/api/eventService/v1/eventUnSubscriptionByEventTypes";//åæ¶äºä»¶è®¢é
|
| | | String visitPicture= "/api/visitor/v1/record/pictures";//è·å访客记å½ä¸çå¾ç |
| | | String devicePicture= "/api/acs/v1/event/pictures";//è·åé¨ç¦äºä»¶çå¾ç |
| | | String carPicture= "/api/pms/v1/image";//æ¥è¯¢è½¦è¾ææå¾ç |
| | | } |
| | | |
| | | /** |
| | |
| | | this.name = name; |
| | | this.key = key; |
| | | } |
| | | |
| | | |
| | | |
| | | // get set æ¹æ³ |
| | |
| | | } |
| | | } |
| | | /** |
| | | * è·å访客记å½ä¸çå¾ç |
| | | * @param body |
| | | * @return |
| | | */ |
| | | public static InputStream getVisitPicture(String body) throws Exception{ |
| | | |
| | | Map<String, String> path = getPath(HKConstants.InterfacePath.visitPicture); |
| | | //åæ°æ ¹æ®æ¥å£å®é
æ
åµè®¾ç½® |
| | | HttpResponse resp = ArtemisHttpUtil.doPostStringImgArtemis( path, body, null, null,"application/json",null); |
| | | if (200==resp.getStatusLine().getStatusCode()) { |
| | | HttpEntity entity = resp.getEntity(); |
| | | InputStream in = entity.getContent(); |
| | | return in; |
| | | }else{ |
| | | throw new Exception("è·å访客记å½ä¸çå¾çä¸è½½åºé"); |
| | | } |
| | | } |
| | | /** |
| | | * è·åé¨ç¦äºä»¶çå¾ç |
| | | * @param body |
| | | * @return |
| | | */ |
| | | public static InputStream getDevicePicture(String body) throws Exception{ |
| | | |
| | | Map<String, String> path = getPath(HKConstants.InterfacePath.devicePicture); |
| | | //åæ°æ ¹æ®æ¥å£å®é
æ
åµè®¾ç½® |
| | | HttpResponse resp = ArtemisHttpUtil.doPostStringImgArtemis( path, body, null, null,"application/json",null); |
| | | if (200==resp.getStatusLine().getStatusCode()) { |
| | | HttpEntity entity = resp.getEntity(); |
| | | InputStream in = entity.getContent(); |
| | | return in; |
| | | }else{ |
| | | throw new Exception("è·åé¨ç¦äºä»¶çå¾çä¸è½½åºé"); |
| | | } |
| | | } |
| | | /** |
| | | * æ¥è¯¢è½¦è¾ææå¾ç |
| | | * @param body |
| | | * @return |
| | | */ |
| | | public static InputStream getCarPicture(String body) throws Exception{ |
| | | |
| | | Map<String, String> path = getPath(HKConstants.InterfacePath.carPicture); |
| | | //åæ°æ ¹æ®æ¥å£å®é
æ
åµè®¾ç½® |
| | | HttpResponse resp = ArtemisHttpUtil.doPostStringImgArtemis( path, body, null, null,"application/json",null); |
| | | if (200==resp.getStatusLine().getStatusCode()) { |
| | | HttpEntity entity = resp.getEntity(); |
| | | InputStream in = entity.getContent(); |
| | | return in; |
| | | }else{ |
| | | throw new Exception("æ¥è¯¢è½¦è¾ææå¾çä¸è½½åºé"); |
| | | } |
| | | } |
| | | /** |
| | | * è·åé¨ç¦ç¹å表 |
| | | * @param body |
| | | * @return |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.haikang.model.param.request; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CarPictureRequest { |
| | | |
| | | private String aswSyscode;// string True å¾çæå¡å¯ä¸æ è¯ç ï¼æå¤§é¿åº¦64ï¼ ä»å
¶ä»è¿åå¾çUriæ¥å£å¤è·å |
| | | private String picUri ;//string True å¾çUriï¼æå¤§é¿åº¦256ï¼ |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.haikang.model.param.request; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DevicePictureRequest { |
| | | |
| | | private String svrIndexCode ;// string True æä¾picUriå¤ä¼æä¾æ¤å段 |
| | | private String picUri ;// string True å¾çç¸å¯¹å°å |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.haikang.model.param.request; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class VisitPictureRequest { |
| | | |
| | | private String svrIndexCode ;// string True æä¾picUriå¤ä¼æä¾æ¤å段 |
| | | private String picUri ;// string True å¾çç¸å¯¹å°å |
| | | |
| | | } |
| | |
| | | package com.doumee.core.haikang.service; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.haikang.model.param.request.*; |
| | | import com.doumee.core.haikang.model.param.respose.*; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | | import com.doumee.core.haikang.model.HKTools; |
| | | import com.doumee.core.haikang.model.param.BaseRequst; |
| | | import com.doumee.core.haikang.model.param.BaseResponse; |
| | | import com.doumee.dao.business.model.InterfaceLog; |
| | | import com.doumee.service.business.InterfaceLogService; |
| | | import com.hikvision.artemis.sdk.config.ArtemisConfig; |
| | | import com.doumee.core.haikang.model.param.request.*; |
| | | import com.doumee.core.haikang.model.param.respose.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | |
| | | import java.io.InputStream; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * è·å访客记å½ä¸çå¾ç |
| | | * @return |
| | | */ |
| | | public static InputStream getVisitPicture(VisitPictureRequest param) { |
| | | log.info("ãæµ·åº·è®¿å®¢å¾çæµã================å¼å§===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | InputStream res = HKTools.getVisitPicture(JSONObject.toJSONString(param)); |
| | | log.error("ãæµ·åº·è®¿å®¢å¾çæµã================æå====\n"); |
| | | return res; |
| | | }catch (Exception e){ |
| | | log.error("ãæµ·åº·è®¿å®¢å¾çæµã================失败====ï¼\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * è·åé¨ç¦äºä»¶çå¾ç |
| | | * @return |
| | | */ |
| | | public static InputStream getDevicePicture(DevicePictureRequest param) { |
| | | log.info("ãæµ·åº·é¨ç¦äºä»¶å¾çæµã================å¼å§===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | InputStream res = HKTools.getDevicePicture(JSONObject.toJSONString(param)); |
| | | log.error("ãæµ·åº·é¨ç¦äºä»¶å¾çæµã================æå====\n"); |
| | | return res; |
| | | }catch (Exception e){ |
| | | log.error("ãæµ·åº·é¨ç¦äºä»¶å¾çæµã================失败====ï¼\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * æ¥è¯¢è½¦è¾ææå¾ç |
| | | * @return |
| | | */ |
| | | public static InputStream getCarPicture(CarPictureRequest param) { |
| | | log.info("ãæµ·åº·è½¦è¾ææå¾çå¾çæµã================å¼å§===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | InputStream res = HKTools.getCarPicture(JSONObject.toJSONString(param)); |
| | | log.error("ãæµ·åº·è½¦è¾ææå¾çå¾çæµã================æå====\n"); |
| | | return res; |
| | | }catch (Exception e){ |
| | | log.error("ãæµ·åº·è½¦è¾ææå¾çå¾çæµã================失败====ï¼\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | *è·å车åºåè¡¨æ°æ®ï¼å
¨éï¼ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.model.openapi.request.erp; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/11/23 14:03 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "åå·¥åæ¥å¤±è´¥æ¨é请æ±åæ°" ) |
| | | public class MemberFailRequest { |
| | | |
| | | @ApiModelProperty(value = "åå·¥id" ) |
| | | private String userId; |
| | | @ApiModelProperty(value = "失败类å 0人ååæ¥å¤±è´¥ 1æéä¸å失败 " ) |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "夿³¨ä¿¡æ¯ï¼æè¿°å¤±è´¥åå ") |
| | | private String info; |
| | | |
| | | } |
| | |
| | | public static final String VISIT_EVENT_IMG = "VISIT_EVENT_IMG"; |
| | | public static final String CAR_EVENT_IMG = "CAR_EVENT_IMG"; |
| | | public static final String DEVICE_EVENT_IMG = "DEVICE_EVENT_IMG"; |
| | | public static final String FTP ="FTP" ; |
| | | public static final String FTP_HOST ="FTP_HOST" ; |
| | | public static final String FTP_PORT ="FTP_PORT" ; |
| | | public static final String FTP_USERNAME ="FTP_USERNAME" ; |
| | | public static final String FTP_PWD ="FTP_PWD" ; |
| | | public static boolean DEALING_HK_IMG = false; |
| | | // ERPæ¥å£é
ç½® |
| | | public static final String ERP_CONFIG = "ERP_CONFIG"; |
| | |
| | | |
| | | /** ç¨æ·å¯ç¨ç¦ç¨æä¸¾å¼*/ |
| | | ENABLE(0,"æ£å¸¸"), |
| | | DISABLE(1,"ç¦ç¨"); |
| | | DISABLE(1,"ç¦ç¨"), |
| | | FREEZE(2,"æé»/å»ç»"); |
| | | |
| | | private Integer value; |
| | | private String des; |
| | |
| | | } |
| | | return result; |
| | | } |
| | | public boolean uploadInputstream(InputStream inputStream, String remote) { |
| | | // 设置PassiveModeä¼ è¾ |
| | | try { |
| | | ftpClient.enterLocalPassiveMode(); |
| | | |
| | | // 设置以äºè¿å¶æµçæ¹å¼ä¼ è¾ |
| | | ftpClient.setFileType(FTP.BINARY_FILE_TYPE); |
| | | ftpClient.setControlEncoding("GBK"); |
| | | // 对è¿ç¨ç®å½çå¤ç |
| | | String remoteFileName = remote; |
| | | if (remote.contains(File.separator)) { |
| | | remoteFileName = remote.substring(remote.lastIndexOf(File.separator) + 1); |
| | | // å建æå¡å¨è¿ç¨ç®å½ç»æï¼åå»ºå¤±è´¥ç´æ¥è¿å |
| | | if (StringUtils.equals(CreateDirecroty(remote, ftpClient), "2")) { |
| | | log.error("å建ftpç®å½å¤±è´¥======================="+remote); |
| | | return false; |
| | | } |
| | | } |
| | | boolean result = ftpClient.storeFile(remoteFileName, inputStream); |
| | | inputStream.close(); |
| | | ftpClient.logout(); |
| | | if(result){ |
| | | log.info("ä¸ä¼ æä»¶æå======================"+remote); |
| | | }else{ |
| | | log.error("ä¸ä¼ æä»¶å¤±è´¥======================="+remote); |
| | | } |
| | | return result; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | log.error("ä¸ä¼ æä»¶å¤±è´¥======================="+remote); |
| | | } |
| | | return false; |
| | | } |
| | | public int getNumFromStr(String str,char searchstr) { |
| | | int count = 0; |
| | | char[] charArray = str.toCharArray(); |
| | |
| | | File src = new File(localDirectory); |
| | | try { |
| | | remoteDirectoryPath = remoteDirectoryPath + File.separator; |
| | | |
| | | // System.out.println(remoteDirectoryPath+":===============å建ç®å½================="); |
| | | boolean makeDirFlag = this.ftpClient.makeDirectory(remoteDirectoryPath); |
| | | }catch (IOException e) { |
| | | e.printStackTrace(); |
| | |
| | | for (int currentFile = 0;currentFile < allFile.length;currentFile++) { |
| | | File f =allFile[currentFile]; |
| | | String srcName= f.getPath().toString(); |
| | | // System.out.println(srcName+":====================读åæä»¶======================"); |
| | | String tPath = remoteDirectoryPath+f.getName(); |
| | | if (!f.isDirectory()) { |
| | | |
| | | // System.out.println(srcName+":====================å¼å§ä¼ è¾æä»¶======================"); |
| | | int dNum = getNumFromStr(tPath,File.separator.toCharArray()[0]); |
| | | uploadFile(f, tPath); |
| | | if(dNum -2>=0){ |
| | |
| | | } |
| | | } |
| | | }else{ |
| | | // System.out.println(srcName+":====================å建åç®å½======================"); |
| | | uploadDirectory(srcName, |
| | | tPath+File.separator); |
| | | } |
| | | // System.out.println(srcName+":====================ä¸ä¼ 宿¯======================"); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | @ApiModelProperty(value = "身份è¯å·") |
| | | private String idcardNo; |
| | | |
| | | @ApiModelProperty(value = " 0å³å¡è®¿å®¢ 1æ®é访客 2å
é¨äººå") |
| | | private Integer type; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.join; |
| | | |
| | | import com.doumee.dao.business.model.Cars; |
| | | import com.github.yulichang.base.mapper.MPJJoinMapper; |
| | | |
| | | public interface CarJoinMapper extends MPJJoinMapper<Cars> { |
| | | } |
| | |
| | | @ExcelColumn(name="夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "设å«å") |
| | | @ExcelColumn(name="设å«å") |
| | | @ApiModelProperty(value = "设å¤åç§°") |
| | | @ExcelColumn(name="设å¤åç§°") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "海康æ è¯", example = "1") |
| | |
| | | |
| | | PageData<MemberInfoDTO> findVisitPage(PageWrap<MemberQuery> pageWrap); |
| | | |
| | | PageData<MemberInfoDTO> findUnusualPage(PageWrap<MemberQuery> pageWrap); |
| | | |
| | | |
| | | /********************************************å
¬ä¼å·æ¥å£***********************************************************************/ |
| | | |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | |
| | | import com.doumee.dao.business.join.ParkBookJoinMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.service.business.CarsService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Override |
| | | public PageData<Cars> findPage(PageWrap<Cars> pageWrap) { |
| | | |
| | | MPJLambdaWrapper<Cars> visRecord = new MPJLambdaWrapper<>(); |
| | | visRecord.selectAll(Cars.class); |
| | | visRecord.eq(Cars::getIsdeleted, Constants.ZERO); |
| | | visRecord.eq(Cars::getId, Constants.ZERO); |
| | | Cars result = carJoinMapper.selectJoinOne(Cars.class,visRecord); |
| | | |
| | | IPage<Cars> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<Cars> queryWrapper = new QueryWrapper<>(); |
| | |
| | | .like(StringUtils.isNotBlank(pageWrap.getModel().getPhone()),Member::getPhone,pageWrap.getModel().getPhone()) |
| | | .like(StringUtils.isNotBlank(pageWrap.getModel().getCompanyName()),Company::getName,pageWrap.getModel().getCompanyName()) |
| | | .like(StringUtils.isNotBlank(pageWrap.getModel().getIdcardNo()),Member::getIdcardNo,pageWrap.getModel().getIdcardNo()) |
| | | .eq(Member::getStatus,Constants.Status.FREEZE) |
| | | .orderByDesc(Member::getCreateDate); |
| | | |
| | | |
| | | IPage<MemberInfoDTO> memberIPage = memberJoinMapper.selectJoinPage(page, MemberInfoDTO.class,queryWrapper); |
| | | return PageData.from(memberIPage); |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public PageData<MemberInfoDTO> findUnusualPage(PageWrap<MemberQuery> pageWrap) { |
| | | |
| | | |
| | | IPage<Member> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | MPJLambdaWrapper<Member> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.leftJoin(Company.class,Company::getId,Member::getCompanyId); |
| | | queryWrapper.selectAll(Member.class) |
| | | .selectAs(Company::getName,MemberInfoDTO::getCompanyName) |
| | | .select(" (select count(v.id) from visits v where v.MEMBER_ID=t.id and v.ISDELETED=0) as visitsCount") |
| | | .select(" (select STARTTIME from visits v where v.MEMBER_ID=t.id and v.ISDELETED=0 order by CREATE_DATE limit 1) as visitsLastDate"); |
| | | |
| | | queryWrapper.eq(Objects.nonNull(pageWrap.getModel().getType()),Member::getType,pageWrap.getModel().getType()); |
| | | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getName()),Member::getName,pageWrap.getModel().getName()) |
| | | .like(StringUtils.isNotBlank(pageWrap.getModel().getPhone()),Member::getPhone,pageWrap.getModel().getPhone()) |
| | | .like(StringUtils.isNotBlank(pageWrap.getModel().getCompanyName()),Company::getName,pageWrap.getModel().getCompanyName()) |
| | | .like(StringUtils.isNotBlank(pageWrap.getModel().getIdcardNo()),Member::getIdcardNo,pageWrap.getModel().getIdcardNo()) |
| | | .eq(Member::getStatus,Constants.Status.ENABLE) |
| | | .orderByDesc(Member::getCreateDate); |
| | | |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | | import com.doumee.core.haikang.model.param.BaseResponse; |
| | | import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest; |
| | | import com.doumee.core.haikang.model.param.request.*; |
| | | import com.doumee.core.haikang.model.param.respose.AcsDeviceInfoResponse; |
| | | import com.doumee.core.haikang.model.param.respose.AcsDeviceListResponse; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.FtpUtil; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.model.CarEvent; |
| | | import com.doumee.dao.business.model.Device; |
| | | import com.doumee.dao.business.model.DeviceEvent; |
| | | import com.doumee.dao.business.model.VisitEvent; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * 设å¤ä¿¡æ¯è¡¨Serviceå®ç° |
| | |
| | | * @date 2023/11/30 15:33 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class HkSyncImgServiceImpl extends HkSyncBaseServiceImpl { |
| | | |
| | | @Autowired |
| | |
| | | private DeviceEventMapper deviceEventMapper; |
| | | @Autowired |
| | | private VisitEventMapper visitEventMapper; |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Override |
| | | @Async |
| | | public String downHKImgs(int type){ |
| | | if(Constants.DEALING_HK_IMG){ |
| | | return null ; |
| | |
| | | |
| | | } |
| | | |
| | | private String downHkImgToFtp(String img1, String serverIndex, String visitEventImg) { |
| | | // |
| | | |
| | | private String downHkImgToFtp(String img1, String serverIndex, String folder) { |
| | | InputStream is = null; |
| | | if(StringUtils.equals(folder,Constants.CAR_EVENT_IMG)){ |
| | | //åè½¦åºææå¾ |
| | | CarPictureRequest param = new CarPictureRequest(); |
| | | param.setPicUri(img1); |
| | | param.setAswSyscode(serverIndex); |
| | | is = HKService.getCarPicture(param); |
| | | }else if(StringUtils.equals(folder,Constants.DEVICE_EVENT_IMG)){ |
| | | //é¨ç¦äºä»¶å¾ç |
| | | DevicePictureRequest param = new DevicePictureRequest(); |
| | | param.setPicUri(img1); |
| | | param.setSvrIndexCode(serverIndex); |
| | | is = HKService.getDevicePicture(param); |
| | | }else if(StringUtils.equals(folder,Constants.VISIT_EVENT_IMG)){ |
| | | //访客äºä»¶å¾ç |
| | | VisitPictureRequest param = new VisitPictureRequest(); |
| | | param.setPicUri(img1); |
| | | param.setSvrIndexCode(serverIndex); |
| | | is = HKService.getVisitPicture(param); |
| | | } |
| | | //TODO------jiangping--------- |
| | | try { |
| | | FtpUtil ftp = new FtpUtil(systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_HOST).getCode(), |
| | | Integer.parseInt(systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_PORT).getCode()), |
| | | systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_USERNAME).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_PWD).getCode()); |
| | | String date = DateUtil.getNowShortDate(); |
| | | String fName = File.separator+date+File.separator+ UUID.randomUUID().toString()+".jpg"; |
| | | String fileName = folder+fName; |
| | | boolean r = ftp.uploadInputstream(is,fileName);//ä¸ä¼ |
| | | if(r){ |
| | | log.info("ãæµ·åº·å¾çä¸è½½ä¸ä¼ FTP失败ã======================" ); |
| | | return fName; |
| | | }else{ |
| | | log.error("ãæµ·åº·å¾çä¸è½½ä¸ä¼ FTP失败ã======================" ); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("ãæµ·åº·å¾çä¸è½½ä¸ä¼ FTP失败ã======================"+e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.openapi.request.erp.ApproveAddRequest; |
| | | import com.doumee.core.model.openapi.request.erp.MemberFailRequest; |
| | | import com.doumee.core.model.openapi.request.erp.OrgListRequest; |
| | | import com.doumee.core.model.openapi.request.erp.UserListRequest; |
| | | import com.doumee.core.model.openapi.response.erp.ApproveInfoResponse; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | |
| | | |
| | | @Api(tags = "2ããERPã端æä¾æ¥å£ï¼å访客端æä¾ææäº¤æ°æ®ä¿¡æ¯ï¼") |
| | | @RestController |
| | | @RequestMapping("/erp") |
| | | @RequestMapping("/erp/resource") |
| | | @Slf4j |
| | | public class ErpResourceController extends ApiController{ |
| | | @ApiOperation(value = "å
¨éç»ç»ä¿¡æ¯æ¥å£", notes = "ERP端æä¾ï¼ä¾è®¿å®¢ç«¯æåå
¨é¨ç»ç»ä¿¡æ¯ï¼ç¨äºåå§ååå¨ææ§æ°æ®æ ¸æ¥") |
| | | @PostMapping("/resource/org/list") |
| | | @PostMapping("/org/list") |
| | | public ApiResponse<PageData<OrgListResponse>> orgList (@RequestBody PageWrap<OrgListRequest> pageWrap) { |
| | | return ApiResponse.success(null); |
| | | } |
| | | @ApiOperation(value = "å
¨é人åä¿¡æ¯æ¥å£", notes = "ERP端æä¾ï¼ä¾è®¿å®¢ç«¯æåå
¨é¨äººåä¿¡æ¯ï¼ç¨äºåå§ååå¨ææ§æ°æ®æ ¸æ¥") |
| | | @PostMapping("/resource/user/list") |
| | | @PostMapping("/user/list") |
| | | public ApiResponse<PageData<UserListRespone>> userList (@RequestBody PageWrap<UserListRequest> pageWrap) { |
| | | return ApiResponse.success(null); |
| | | } |
| | | @ApiOperation(value = "访客ç³è¯·æäº¤å®¡æ¹æ¥å£", notes = "ERP端æä¾ï¼ä¾è®¿å®¢ç«¯è°ç¨ï¼æäº¤è®¿å®¢ç³è¯·ä¿¡æ¯,æ¥å£æäº¤æåï¼ERP端è¿å审æ¹è®°å½ç¼ç ") |
| | | @PostMapping("/event/approve/apply") |
| | | public ApiResponse<String> approveApply(@RequestBody ApproveAddRequest account ) { |
| | | public ApiResponse<String> approveApply(@RequestBody ApproveAddRequest param ) { |
| | | return ApiResponse.success(UUID.randomUUID().toString()); |
| | | } |
| | | @ApiOperation(value = "访客ç³è¯·å®¡æ¹ç»ææ¥è¯¢æ¥å£", notes = "ERP端æä¾ï¼ä¾è®¿å®¢ç«¯è°ç¨ï¼æ¥è¯¢è®¿å®¢ç³è¯·å®¡æ¹ç»æ") |
| | | @GetMapping("/resource/approve/info") |
| | | @GetMapping("/approve/info") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "id", value = "审æ¹è®°å½å¯ä¸æ è¯", required = true) |
| | | }) |
| | | public ApiResponse<ApproveInfoResponse> approveInfo(@RequestParam String id ) { |
| | | return ApiResponse.success(null ); |
| | | } |
| | | @ApiOperation(value = "åå·¥åæ¥å¤±è´¥æ¨éæ¥å£", notes = "ERP端æä¾ï¼ä¾è®¿å®¢ç«¯è°ç¨ï¼åç¥erpå工信æ¯åæ¥å¤±è´¥çæ°æ®") |
| | | @PostMapping("/member/fail") |
| | | public ApiResponse<ApproveInfoResponse> memberFail(@RequestBody List<MemberFailRequest> param) { |
| | | return ApiResponse.success(null ); |
| | | } |
| | | |
| | | } |
| | | |