| | |
| | | public static final String LOCATION ="LOCATION" ; |
| | | public static final String API_KEY ="API_KEY" ; |
| | | public static final String CABINET_CONFIG ="CABINET_CONFIG" ; |
| | | public static final String JDY_CONFIG ="JDY_CONFIG" ; |
| | | public static final String BLOW_TIME ="BLOW_TIME" ; |
| | | public static final String PRESSURE ="PRESSURE" ; |
| | | public static final String CONCENTRATION ="CONCENTRATION" ; |
| | |
| | | public static final String WORK_END = "WORK_END"; |
| | | public static final String INTERVAL = "INTERVAL"; |
| | | public static final String USE_CAR_TAKE_CARE = "USE_CAR_TAKE_CARE"; |
| | | |
| | | public static final String PUSH_URL_KEYS = "PUSH_URL_KEYS"; |
| | | |
| | | |
| | | |
| | |
| | | public static final String APP_SECRET ="APP_SECRET"; |
| | | public static final String ACCESS_TOKEN ="ACCESS_TOKEN"; |
| | | public static final String AGENT_ID ="AGENT_ID"; |
| | | public static final String CLEAN_TIME ="CLEAN_TIME"; |
| | | public static final String EARLY_CONFIG ="EARLY_CONFIG"; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | public static boolean betweenTimeConfig(String timeConfigData){ |
| | | if(StringUtils.isNotBlank(timeConfigData)){ |
| | | Integer nowTime = Integer.valueOf(DateUtil.getFormattedDateUtil(new Date(),"HH:mm").replace(":","")); |
| | | List<String> cleanConfigList = Arrays.asList(StringUtils.split(timeConfigData,",")); |
| | | for (String config:cleanConfigList) { |
| | | String [] timeArr = config.split("-"); |
| | | if(timeArr.length>Constants.ONE){ |
| | | try { |
| | | Integer start = Integer.valueOf(timeArr[0].replace(":","")); |
| | | Integer end = Integer.valueOf(timeArr[1].replace(":","")); |
| | | if(start <= nowTime && end >= nowTime){ |
| | | return true; |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | public static String getCurrDateTime() { |
| | | Timestamp date = new Timestamp(System.currentTimeMillis()); |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | return formatter.format(date); |
| | | } |
| | | |
| | |
| | | import com.doumee.dao.web.reqeust.VisitRecordDTO; |
| | | import com.doumee.dao.web.response.VisitRecordVO; |
| | | import com.doumee.service.business.CarUseBookService; |
| | | import com.doumee.service.business.CarsService; |
| | | import com.doumee.service.business.third.model.ApiResponse; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | |
| | | @Autowired |
| | | private CarUseBookService carUseBookService; |
| | | |
| | | @Autowired |
| | | private CarsService carsService; |
| | | |
| | | public static final String SECRET ="yKSKuO0LoFf06jWGrwwuGudK"; |
| | | public static final String LOCAl_SECRET ="tSoMiqC3GY6tItXY48tSTwY6"; |
| | | public static final String LLCAL_CARINFO_SECRET = "4J1GMIAG3m6O2jkkaxTu5EOe"; |
| | | |
| | | |
| | | @LoginNoRequired |
| | | @ApiOperation("ç®éäºæ¨éç¨è½¦ç³è¯·") |
| | | @PostMapping("/pushCarApply") |
| | | public void pushCarApply (HttpServletRequest request, HttpServletResponse response) { |
| | | log.error("ç®éäº=========getRequestURIï¼"+request.getRequestURI()); |
| | | log.error("ç®éäº=========getRequestURLï¼"+request.getRequestURL()); |
| | | log.error("ãç®éäºã ç¨è½¦ç³è¯· =========getRequestURIï¼"+request.getRequestURI()); |
| | | log.error("ãç®éäºã ç¨è½¦ç³è¯· =========getRequestURLï¼"+request.getRequestURL()); |
| | | //æ°å»º{"data":{"_id":"6912f6d47b4a80933348df31","addr":"è±ç±³ç§æ","appId":"6909d0fbdb93b068192dc4a9","car_category":"ä¸å管ç","car_group":"彿¶å¿å±è½¦é","car_no":"çEU2866","car_statue":"åºè½¦","company":{"_id":"6909b792fa9388e2242f497d","dept_no":483166139,"name":"å¼åé¨","type":0},"createTime":"2025-11-11T08:41:56.152Z","create_date":"2025-11-10T16:00:00.000Z","creator":{"_id":"6909b792324dc197821895e7","name":"任康","status":1,"type":0,"username":"1568490244651036"},"deleteTime":null,"deleter":null,"driver":{"_id":"6909b792324dc197821895e5","name":"éé
ææ¦","status":1,"type":0,"username":"0115666322451143077815"},"driver_status":"空é²","end_date":"2025-11-11T09:41:00.000Z","entryId":"690ab9085ebd91d2308e595b","flowState":0,"formName":"派车ç³è¯·","holiday":"å¦","key_back_date":null,"key_info":"å¾
é¢å","key_use_date":null,"no":"20251111100004","reason":"æµè¯ç³è¯·","scope":"å¸å
","start_date":"2025-11-11T08:41:00.000Z","updateTime":"2025-11-11T08:41:56.155Z","updater":{"_id":"6909b792324dc197821895e7","name":"任康","status":1,"type":0,"username":"1568490244651036"},"users":[{"_id":"6909b792324dc197821895e5","name":"éé
ææ¦","status":1,"type":0,"username":"0115666322451143077815"}]},"op":"data_create","opTime":1762850516152} |
| | | //ä¿®æ¹{"data":{"_id":"6912f6d47b4a80933348df31","addr":"è±ç±³ç§æ","appId":"6909d0fbdb93b068192dc4a9","car_category":"ä¸å管ç","car_group":"彿¶å¿å±è½¦é","car_no":"çEU2866","car_statue":"åºè½¦","company":{"_id":"6909b792fa9388e2242f497d","dept_no":483166139,"name":"å¼åé¨","type":0},"createTime":"2025-11-11T08:41:56.152Z","create_date":"2025-11-10T16:00:00.000Z","creator":{"_id":"6909b792324dc197821895e7","name":"任康","status":1,"type":0,"username":"1568490244651036"},"deleteTime":null,"deleter":null,"driver":{"_id":"6909b792324dc197821895e5","name":"éé
ææ¦","status":1,"type":0,"username":"0115666322451143077815"},"driver_status":"空é²","end_date":"2025-11-11T09:41:00.000Z","entryId":"690ab9085ebd91d2308e595b","flowState":0,"formName":"派车ç³è¯·","holiday":"å¦","key_back_date":null,"key_info":"å¾
é¢å","key_use_date":null,"no":"20251111100004","reason":"æµè¯ç³è¯·","scope":"å¸å
","start_date":"2025-11-11T08:41:00.000Z","updateTime":"2025-11-11T08:43:06.436Z","updater":{"_id":"6909b792324dc197821895e7","name":"任康","status":1,"type":0,"username":"1568490244651036"},"users":[{"_id":"6909b792324dc197821895e5","name":"éé
ææ¦","status":1,"type":0,"username":"0115666322451143077815"}]},"op":"data_update","opTime":1762850586436} |
| | | //ä¿®æ¹{"data":{"_id":"6912f6d47b4a80933348df31","addr":"è±ç±³ç§æ","appId":"6909d0fbdb93b068192dc4a9","car_category":"ä¸å管ç","car_group":"彿¶å¿å±è½¦é","car_no":"çEU2866","car_statue":"åºè½¦","company":{"_id":"6909b792fa9388e2242f497d","dept_no":483166139,"name":"å¼åé¨","type":0},"createTime":"2025-11-11T08:41:56.152Z","create_date":"2025-11-10T16:00:00.000Z","creator":{"_id":"6909b792324dc197821895e7","name":"任康","status":1,"type":0,"username":"1568490244651036"},"deleteTime":null,"deleter":null,"driver":{"_id":"6909b792324dc197821895e5","name":"éé
ææ¦","status":1,"type":0,"username":"0115666322451143077815"},"driver_status":"空é²","end_date":"2025-11-11T09:41:00.000Z","entryId":"690ab9085ebd91d2308e595b","flowState":1,"formName":"派车ç³è¯·","holiday":"å¦","key_back_date":null,"key_info":"å¾
é¢å","key_use_date":null,"no":"20251111100004","reason":"æµè¯ç³è¯·","scope":"å¸å
","start_date":"2025-11-11T08:41:00.000Z","updateTime":"2025-11-11T08:45:01.231Z","updater":{"_id":"6909b792324dc197821895e4","name":"æ±è","status":1,"type":0,"username":"0458340612772735"},"users":[{"_id":"6909b792324dc197821895e5","name":"éé
ææ¦","status":1,"type":0,"username":"0115666322451143077815"}]},"op":"data_update","opTime":1762850701231} |
| | |
| | | String nonce = parameterMap.get("nonce"); |
| | | String timestamp = parameterMap.get("timestamp"); |
| | | String signature = getSignature(nonce, payload, LOCAl_SECRET, timestamp); |
| | | log.error("ç®éäº=========nonceï¼"+nonce); |
| | | log.error("ç®éäº=========timestampï¼"+timestamp); |
| | | log.error("ç®éäº=========payloadï¼"+payload); |
| | | log.error("ç®éäº=========ç¾åï¼"+jdy); |
| | | log.error("ç®éäº=========ç¾å(æ£ç¡®ï¼ï¼"+signature); |
| | | log.error("ãç®éäºã ç¨è½¦ç³è¯· =========nonceï¼"+nonce); |
| | | log.error("ãç®éäºã ç¨è½¦ç³è¯· =========timestampï¼"+timestamp); |
| | | log.error("ãç®éäºã ç¨è½¦ç³è¯· =========payloadï¼"+payload); |
| | | log.error("ãç®éäºã ç¨è½¦ç³è¯· =========ç¾åï¼"+jdy); |
| | | log.error("ãç®éäºã ç¨è½¦ç³è¯· =========ç¾å(æ£ç¡®ï¼ï¼"+signature); |
| | | if (!signature.equals(jdy)) { |
| | | response.setStatus(401); |
| | | response.getWriter().write("fail"); |
| | | response.getWriter().close();; |
| | | return ; |
| | | } |
| | | |
| | | carUseBookService.jdyPushCarUseBook(payload); |
| | | response.setStatus(200); |
| | | response.getWriter().write("success"); |
| | | response.getWriter().close(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | log.error("ãç®éäºã ç¨è½¦ç³è¯· =========å¼å¸¸ï¼"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | @LoginNoRequired |
| | | @ApiOperation("ç®éäºæ¨é车è¾ä¿¡æ¯") |
| | | @PostMapping("/pushCarInfo") |
| | | public void pushCarInfo (HttpServletRequest request, HttpServletResponse response) { |
| | | log.error("ãç®éäºã 车è¾ä¿¡æ¯ =========getRequestURIï¼"+request.getRequestURI()); |
| | | log.error("ãç®éäºã 车è¾ä¿¡æ¯=========getRequestURLï¼"+request.getRequestURL()); |
| | | //æ°å»º{"data":{"_id":"6912f6d47b4a80933348df31","addr":"è±ç±³ç§æ","appId":"6909d0fbdb93b068192dc4a9","car_category":"ä¸å管ç","car_group":"彿¶å¿å±è½¦é","car_no":"çEU2866","car_statue":"åºè½¦","company":{"_id":"6909b792fa9388e2242f497d","dept_no":483166139,"name":"å¼åé¨","type":0},"createTime":"2025-11-11T08:41:56.152Z","create_date":"2025-11-10T16:00:00.000Z","creator":{"_id":"6909b792324dc197821895e7","name":"任康","status":1,"type":0,"username":"1568490244651036"},"deleteTime":null,"deleter":null,"driver":{"_id":"6909b792324dc197821895e5","name":"éé
ææ¦","status":1,"type":0,"username":"0115666322451143077815"},"driver_status":"空é²","end_date":"2025-11-11T09:41:00.000Z","entryId":"690ab9085ebd91d2308e595b","flowState":0,"formName":"派车ç³è¯·","holiday":"å¦","key_back_date":null,"key_info":"å¾
é¢å","key_use_date":null,"no":"20251111100004","reason":"æµè¯ç³è¯·","scope":"å¸å
","start_date":"2025-11-11T08:41:00.000Z","updateTime":"2025-11-11T08:41:56.155Z","updater":{"_id":"6909b792324dc197821895e7","name":"任康","status":1,"type":0,"username":"1568490244651036"},"users":[{"_id":"6909b792324dc197821895e5","name":"éé
ææ¦","status":1,"type":0,"username":"0115666322451143077815"}]},"op":"data_create","opTime":1762850516152} |
| | | //ä¿®æ¹{"data":{"data":{"_id":"6909d2ac6bf3636d0dbcc953","_widget_1762251302690":"çAFJ6557","_widget_1762251302691":"ä¸è¬å
¬å¡","_widget_1762251302692":"","_widget_1762251302693":"å¸å±æ¬çº§è½¦é","_widget_1762251302694":{"_id":"6909b792324dc197821895e8","name":"ææè±","status":1,"type":0,"username":"045831294126209983"},"_widget_1762251302695":{"_id":"6909b792fa9388e2242f497d","dept_no":483166139,"name":"å¼åé¨","type":0},"_widget_1762251302696":"å¯ç¨","_widget_1762251302697":null,"_widget_1762251302698":10000,"_widget_1762251302699":null,"_widget_1762251302700":null,"_widget_1762251302701":null,"_widget_1762251302702":null,"_widget_1762251302703":"å¦","appId":"6909d0fbdb93b068192dc4a9","createTime":"2025-11-04T10:17:17.015Z","creator":{"_id":"6909b792324dc197821895e8","name":"ææè±","status":1,"type":0,"username":"045831294126209983"},"deleteTime":null,"deleter":null,"entryId":"6909d226b9a675ac4224aa6d","formName":"车è¾ä¿¡æ¯","updateTime":"2025-11-13T09:20:05.253Z","updater":{"_id":"6909b792324dc197821895e7","name":"任康","status":1,"type":0,"username":"1568490244651036"}},"op":"data_update","opTime":1763025605253} |
| | | //ä¿®æ¹{"data":{"_id":"6912f6d47b4a80933348df31","addr":"è±ç±³ç§æ","appId":"6909d0fbdb93b068192dc4a9","car_category":"ä¸å管ç","car_group":"彿¶å¿å±è½¦é","car_no":"çEU2866","car_statue":"åºè½¦","company":{"_id":"6909b792fa9388e2242f497d","dept_no":483166139,"name":"å¼åé¨","type":0},"createTime":"2025-11-11T08:41:56.152Z","create_date":"2025-11-10T16:00:00.000Z","creator":{"_id":"6909b792324dc197821895e7","name":"任康","status":1,"type":0,"username":"1568490244651036"},"deleteTime":null,"deleter":null,"driver":{"_id":"6909b792324dc197821895e5","name":"éé
ææ¦","status":1,"type":0,"username":"0115666322451143077815"},"driver_status":"空é²","end_date":"2025-11-11T09:41:00.000Z","entryId":"690ab9085ebd91d2308e595b","flowState":1,"formName":"派车ç³è¯·","holiday":"å¦","key_back_date":null,"key_info":"å¾
é¢å","key_use_date":null,"no":"20251111100004","reason":"æµè¯ç³è¯·","scope":"å¸å
","start_date":"2025-11-11T08:41:00.000Z","updateTime":"2025-11-11T08:45:01.231Z","updater":{"_id":"6909b792324dc197821895e4","name":"æ±è","status":1,"type":0,"username":"0458340612772735"},"users":[{"_id":"6909b792324dc197821895e5","name":"éé
ææ¦","status":1,"type":0,"username":"0115666322451143077815"}]},"op":"data_update","opTime":1762850701231} |
| | | try { |
| | | String jdy = request.getHeader("x-jdy-signature"); |
| | | StringBuilder json = new StringBuilder(); |
| | | String line; |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(request.getInputStream())); |
| | | while ((line = reader.readLine()) != null) { |
| | | json.append(line); |
| | | } |
| | | // String payload = IOUtils.toString(request.getInputStream(), "utf-8"); |
| | | String payload = json.toString(); |
| | | String uri = request.getRequestURI(); |
| | | Map<String, String> parameterMap = parseParameter(request.getQueryString()); |
| | | String nonce = parameterMap.get("nonce"); |
| | | String timestamp = parameterMap.get("timestamp"); |
| | | String signature = getSignature(nonce, payload, LLCAL_CARINFO_SECRET, timestamp); |
| | | log.error("ãç®éäºã 车è¾ä¿¡æ¯=========nonceï¼"+nonce); |
| | | log.error("ãç®éäºã 车è¾ä¿¡æ¯=========timestampï¼"+timestamp); |
| | | log.error("ãç®éäºã 车è¾ä¿¡æ¯=========payloadï¼"+payload); |
| | | log.error("ãç®éäºã 车è¾ä¿¡æ¯=========ç¾åï¼"+jdy); |
| | | log.error("ãç®éäºã 车è¾ä¿¡æ¯=========ç¾å(æ£ç¡®ï¼ï¼"+signature); |
| | | if (!signature.equals(jdy)) { |
| | | response.setStatus(401); |
| | | response.getWriter().write("fail"); |
| | | response.getWriter().close();; |
| | | return ; |
| | | } |
| | | carsService.jdyPushCarInfo(payload); |
| | | response.setStatus(200); |
| | | response.getWriter().write("success"); |
| | | response.getWriter().close(); |
| | |
| | | e.printStackTrace(); |
| | | log.error("ç®éäº=========å¼å¸¸ï¼"+e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | |
| | | @ApiOperation("ç®éäºæäº¤é¥ååè¿ä¿¡æ¯") |
| | | @PostMapping("/submitKeyRecord") |
| | | public ApiResponse<JkCabinetLog> submitKeyRecord (HttpServletRequest request, HttpServletResponse response) { |
| | |
| | | log.setMemberName("å¼ ä¸"); |
| | | return ApiResponse.success(log); |
| | | } |
| | | |
| | | public static final String SECRET ="yKSKuO0LoFf06jWGrwwuGudK"; |
| | | public static final String LOCAl_SECRET ="tSoMiqC3GY6tItXY48tSTwY6"; |
| | | |
| | | private static String getSignature(String nonce, String payload, String secret, String timestamp) { |
| | | return DigestUtils.sha1Hex(nonce + ":" + payload + ":" + secret + ":" + timestamp); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.dto; |
| | | |
| | | import com.doumee.service.business.third.model.LoginUserModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2025/10/11 16:01 |
| | | */ |
| | | @Data |
| | | public class JDYKeyUseByBookDTO{ |
| | | |
| | | @ApiModelProperty(value = "æä½æ¶é´") |
| | | private Long create_date; |
| | | |
| | | @ApiModelProperty(value = "é¢ç¨æ¶é´") |
| | | private Long start_date; |
| | | |
| | | @ApiModelProperty(value = "å½è¿æ¶é´") |
| | | private Long end_date; |
| | | |
| | | @ApiModelProperty(value = "æä½ç±»åï¼0=é¢ç¨ï¼1=å½è¿ï¼") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "派车å noåå·") |
| | | private String id; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "ç¨æ·ä¸»é®") |
| | | private Integer memberId; |
| | | |
| | | @ApiModelProperty(value = "å¼å¯æ¹å¼ï¼0=ç³»ç»å¼å¯ï¼1=æå¨å¼å¯") |
| | | @ApiModelProperty(value = "å¼å¯ç±»åï¼0=ç³»ç»å¼å¯ï¼1=æå¨å¼å¯") |
| | | private Integer openType; |
| | | |
| | | @ApiModelProperty(value = "å¼å¯æ¹å¼ï¼0=é车ï¼1=派车åï¼2=ä¿æ´") |
| | | private Integer openWay; |
| | | |
| | | @ApiModelProperty(value = "派车å主é®") |
| | | private Integer carUseBookId; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "ç®éäºä¸å¡ä¸»é®") |
| | | private String jdyId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "é¥åé¢åç¶æï¼0=å¾
é¢åï¼1=å·²é¢åï¼2=å·²å½è¿ï¼") |
| | | private Integer keyStatus; |
| | | |
| | | |
| | | @ApiModelProperty(value = "叿ºå§å", example = "1") |
| | | @TableField(exist = false) |
| | | private String driverName; |
| | |
| | | //@ExcelColumn(name="æå±åç±»ç¼ç ") |
| | | private Integer cateId; |
| | | |
| | | @ApiModelProperty(value = "ç®éäºä¸»é®", example = "1") |
| | | //@ExcelColumn(name="æå±åç±»ç¼ç ") |
| | | private String jdyId; |
| | | |
| | | @ApiModelProperty(value = "ç®éäºè½¦è¾åç±»åç§°", example = "1") |
| | | //@ExcelColumn(name="æå±åç±»ç¼ç ") |
| | | private String typeName; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "å车åºåç§°éå", example = "1") |
| | | //@ExcelColumn(name="å车åºåç§°éå") |
| | | @TableField(exist = false) |
| | |
| | | @TableField(exist = false) |
| | | private Integer keyStatus; |
| | | |
| | | @ApiModelProperty(value = "派车ç³è¯·å主é®", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer carUseBookId; |
| | | |
| | | @ApiModelProperty(value = "åé¥åæ¹å¼ï¼0=é车ï¼1=派车åï¼2=ä¿æ´ææ«", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer getKeyWay; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "æä½ç±»åï¼0=å¼é¨;1=å
³é¨;", example = "1") |
| | | private Integer type; |
| | | |
| | | |
| | | @ApiModelProperty(value = "å¼å¯æ¹å¼ï¼0=é车ï¼1=派车åï¼2=ä¿æ´") |
| | | private Integer openWay; |
| | | |
| | | @ApiModelProperty(value = "派车å主é®") |
| | | private Integer carUseBookId; |
| | | |
| | | @ApiModelProperty(value = "车çå·") |
| | | @TableField(exist = false) |
| | | private String carCode; |
| | |
| | | */ |
| | | PageData<CarsDTO> findCarPage(PageWrap<CarsQuery> pageWrap); |
| | | void dealCarsAuthBiz(List<Cars> carsList); |
| | | |
| | | void jdyPushCarInfo(String dataInfo); |
| | | } |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | 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.doumee.core.annotation.excel.ExcelImporter; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 车è¾ä¿¡æ¯è¡¨Serviceå®ç° |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void jdyPushCarInfo(String dataInfo){ |
| | | JSONObject dataInfoJSON = JSONObject.parseObject(dataInfo); |
| | | if(dataInfoJSON.isEmpty()){ |
| | | return; |
| | | } |
| | | String op = dataInfoJSON.getString("op"); |
| | | //å é¤ï¼data_remove æ°å¢ï¼data_add ä¿®æ¹ï¼data_update |
| | | if(StringUtils.isEmpty(op)){ |
| | | return; |
| | | } |
| | | JSONObject dataJSON = dataInfoJSON.getJSONObject("data"); |
| | | String no = dataJSON.getString("_id"); |
| | | if(StringUtils.isEmpty(no)){ |
| | | return; |
| | | } |
| | | if(op.equals("data_remove")){ |
| | | carsMapper.update(new UpdateWrapper<Cars>().lambda() |
| | | .set(Cars::getEditDate, DateUtil.getCurrDate()) |
| | | .set(Cars::getIsdeleted,Constants.ONE).eq(Cars::getJdyId,no)); |
| | | return; |
| | | } |
| | | |
| | | String status = dataJSON.getString("status"); |
| | | String carCode = dataJSON.getString("car_code"); |
| | | Cars cars = carsMapper.selectOne(new QueryWrapper<Cars>() |
| | | .lambda().eq(Cars::getJdyId,no).last("limit 1")); |
| | | if(Objects.isNull(cars)){ |
| | | cars = new Cars(); |
| | | cars.setCreateDate(new Date()); |
| | | cars.setEditDate(new Date()); |
| | | cars.setJdyId(no); |
| | | }else{ |
| | | cars.setEditDate(new Date()); |
| | | } |
| | | cars.setIsdeleted(Constants.ZERO); |
| | | cars.setCode(StringUtils.isBlank(carCode)?null:carCode); |
| | | cars.setStatus(StringUtils.isNotBlank(status)&&StringUtils.equals(status,"å¯ç¨")?0:1); |
| | | JSONObject driverJSON = dataJSON.getJSONObject("driver"); |
| | | if(!driverJSON.isEmpty()){ |
| | | String driverName = driverJSON.getString("name"); |
| | | String driverUserName = driverJSON.getString("username"); |
| | | if(StringUtils.isNotBlank(driverUserName)){ |
| | | Member driverMember = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getIsdeleted,Constants.ZERO).eq(Member::getDdId,driverUserName).last("limit 1 ")); |
| | | if(Objects.nonNull(driverMember)){ |
| | | cars.setMemberId(driverMember.getId()); |
| | | } |
| | | } |
| | | } |
| | | JSONObject createJSON = dataJSON.getJSONObject("creator"); |
| | | if(!createJSON.isEmpty()){ |
| | | String createName = createJSON.getString("name"); |
| | | String createUserName = createJSON.getString("username"); |
| | | if(StringUtils.isNotBlank(createUserName)){ |
| | | Member createMember = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getIsdeleted,Constants.ZERO).eq(Member::getDdId,createUserName).last("limit 1 ")); |
| | | if(Objects.nonNull(createMember)){ |
| | | cars.setMemberId(createMember.getId()); |
| | | } |
| | | } |
| | | } |
| | | carsMapper.insertOrUpdate(cars); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.HttpsUtil; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dao.MemberMapper; |
| | | import com.doumee.dao.business.dto.*; |
| | |
| | | |
| | | @Autowired |
| | | private DingTalk dingTalk; |
| | | |
| | | @Autowired |
| | | private CarUseBookMapper carUseBookMapper; |
| | | |
| | | @Override |
| | | public Integer create(JkCabinetGrid jkCabinetGrid) { |
| | |
| | | .set(JkKeys::getStatus,dto.getKeyStatus()) |
| | | .eq(JkKeys::getId,jkKeys.getId()) |
| | | ); |
| | | //å½è¿é¥å/ååºé¥å é½è¦å»æ¥è¯¢æå䏿¬¡å¼é¨è®°å½ è·åå
·ä½çå¼é¨çæ¹å¼ æ¯é车/派车/ä¿æ´ èµäºå½åå
³é¨è®°å½å
å¦ææ¯æ´¾è½¦åæ°æ® éè¦è°èµ·ç®éäºæ¨é |
| | | JkCabinetLog lastOutLog = jkCabinetLogMapper.selectOne(new QueryWrapper<JkCabinetLog>().lambda() |
| | | .eq(JkCabinetLog::getKeyId,jkCabinetLog.getKeyId()) |
| | | .eq(JkCabinetLog::getType,Constants.ZERO) |
| | | .last( "limit 1 ")); |
| | | if(Objects.nonNull(lastOutLog)){ |
| | | if(Objects.nonNull(lastOutLog.getCarUseBookId())) { |
| | | CarUseBook carUseBook = carUseBookMapper.selectById(lastOutLog.getCarUseBookId()); |
| | | if (Objects.nonNull(carUseBook) && Constants.equalsInteger(carUseBook.getKeyStatus(), Constants.ZERO)) { |
| | | carUseBookMapper.update(new UpdateWrapper<CarUseBook>().lambda() |
| | | .set(CarUseBook::getKeyStatus, Constants.ONE) |
| | | .eq(CarUseBook::getId, carUseBook.getId()) |
| | | ); |
| | | //æ¨éç®éäº æ è®°ä¸å¡æ°æ®å·²è¢«é¢åé¥å |
| | | if (StringUtils.isNotBlank(carUseBook.getJdyId())) { |
| | | JDYKeyUseByBookDTO jdyKeyUseByBookDTO = new JDYKeyUseByBookDTO(); |
| | | jdyKeyUseByBookDTO.setCreate_date(System.currentTimeMillis()); |
| | | jdyKeyUseByBookDTO.setStart_date(Constants.equalsInteger(dto.getKeyStatus(),Constants.TWO)?System.currentTimeMillis():null); |
| | | jdyKeyUseByBookDTO.setEnd_date(Constants.equalsInteger(dto.getKeyStatus(),Constants.ONE)?System.currentTimeMillis():null); |
| | | jdyKeyUseByBookDTO.setType(Constants.equalsInteger(dto.getKeyStatus(),Constants.TWO)?Constants.ZERO:Constants.ONE); |
| | | jdyKeyUseByBookDTO.setId(carUseBook.getJdyId()); |
| | | this.pushJDYKeyInfo(jdyKeyUseByBookDTO); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | jkCabinetLog.setIsNotice(Constants.ZERO); |
| | | jkCabinetLog.setType(Constants.ONE); |
| | | jkCabinetLogMapper.insert(jkCabinetLog); |
| | | |
| | | //æ¥è¯¢é¥åçå¼é¨è®°å½ è¿è¡æ·»å å
³é¨è®°å½ä¸»é® |
| | | if(Constants.equalsInteger(dto.getKeyStatus(),Constants.ONE)){ |
| | | jkCabinetLogMapper.update(null,new UpdateWrapper<JkCabinetLog>().lambda() |
| | |
| | | return jkCabinetGridList; |
| | | } |
| | | } |
| | | jkCabinetGridList = jkCabinetGridMapper.selectJoinList(JkCabinetGrid.class, |
| | | new MPJLambdaWrapper<JkCabinetGrid>().selectAll(JkCabinetGrid.class) |
| | | .selectAs(JkKeys::getRfidLable,JkCabinetGrid::getKeyCode) |
| | | .selectAs(JkKeys::getCarCode,JkCabinetGrid::getCarCode) |
| | | .selectAs(JkKeys::getCarId,JkCabinetGrid::getCarId) |
| | | .selectAs(JkKeys::getStatus,JkCabinetGrid::getKeyStatus) |
| | | .leftJoin(JkKeys.class,JkKeys::getId,JkCabinetGrid::getKeyId) |
| | | .eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getWorkingStatus,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getStatus,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getCabinetId,dto.getCabinetId()) |
| | | .in(Constants.equalsInteger(dto.getType(),Constants.ONE),JkKeys::getStatus,Constants.TWO,Constants.THREE) |
| | | .in(Constants.equalsInteger(dto.getType(),Constants.ZERO),JkKeys::getStatus,Constants.ONE) |
| | | .isNotNull(JkCabinetGrid::getKeyId) |
| | | .apply(" t1.car_id in ( select c.id from cars c where c.ISDELETED = 0 and c.MEMBER_ID = "+dto.getMemberId()+" ) ") |
| | | .orderByAsc(JkCabinetGrid::getCode) |
| | | ); |
| | | |
| | | //妿æ¯è¿é¥å åç´æ¥æ¥è¯¢å·²ååºçé¥åçæ°æ® |
| | | if(Constants.equalsInteger(dto.getType(),Constants.ONE)){ |
| | | jkCabinetGridList = jkCabinetGridMapper.selectJoinList(JkCabinetGrid.class, |
| | | new MPJLambdaWrapper<JkCabinetGrid>().selectAll(JkCabinetGrid.class) |
| | | .selectAs(JkKeys::getRfidLable,JkCabinetGrid::getKeyCode) |
| | | .selectAs(JkKeys::getCarCode,JkCabinetGrid::getCarCode) |
| | | .selectAs(JkKeys::getCarId,JkCabinetGrid::getCarId) |
| | | .selectAs(JkKeys::getStatus,JkCabinetGrid::getKeyStatus) |
| | | .innerJoin(JkKeys.class,JkKeys::getId,JkCabinetGrid::getKeyId) |
| | | .eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getWorkingStatus,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getStatus,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getCabinetId,dto.getCabinetId()) |
| | | .in(JkKeys::getStatus,Constants.TWO,Constants.THREE) |
| | | .isNotNull(JkCabinetGrid::getKeyId) |
| | | .apply("t1.car_id in ( select c.id from cars c where c.ISDELETED = 0 and c.MEMBER_ID = "+dto.getMemberId()+" )") |
| | | |
| | | .orderByAsc(JkCabinetGrid::getCode) |
| | | ); |
| | | }else{ |
| | | //夿å½åæ¶é´æ¯å¦å¤äºä¿æ´æ¶æ®µå
|
| | | String cleanConfig = systemDictDataBiz.queryByCode(Constants.CABINET_CONFIG,Constants.CLEAN_TIME).getCode(); |
| | | String earlyConfig = systemDictDataBiz.queryByCode(Constants.CABINET_CONFIG,Constants.EARLY_CONFIG).getCode(); |
| | | Boolean isCleanTime = Constants.betweenTimeConfig(cleanConfig); |
| | | List<Integer> girdIdList = new ArrayList<>(); |
| | | //æ¥è¯¢æ ¹æ®ä»»å¡å¯ä»¥é¢åçæ°æ® |
| | | jkCabinetGridList = jkCabinetGridMapper.selectJoinList(JkCabinetGrid.class, |
| | | new MPJLambdaWrapper<JkCabinetGrid>().selectAll(JkCabinetGrid.class) |
| | | .selectAs(JkKeys::getRfidLable,JkCabinetGrid::getKeyCode) |
| | | .selectAs(JkKeys::getCarCode,JkCabinetGrid::getCarCode) |
| | | .selectAs(JkKeys::getCarId,JkCabinetGrid::getCarId) |
| | | .selectAs(JkKeys::getStatus,JkCabinetGrid::getKeyStatus) |
| | | .selectAs(CarUseBook::getId,JkCabinetGrid::getCarUseBookId) |
| | | .select("1",JkCabinetGrid::getGetKeyWay) |
| | | .innerJoin(JkKeys.class,JkKeys::getId,JkCabinetGrid::getKeyId) |
| | | .innerJoin(CarUseBook.class,CarUseBook::getCarCode,JkKeys::getCarCode) |
| | | .innerJoin(Cars.class,Cars::getCode,CarUseBook::getCarCode) |
| | | .eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) |
| | | .eq(CarUseBook::getIsdeleted,Constants.ZERO) |
| | | .eq(Cars::getIsdeleted,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getWorkingStatus,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getStatus,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getCabinetId,dto.getCabinetId()) |
| | | .in(JkKeys::getStatus,Constants.ONE) |
| | | .eq(JkKeys::getRoleType,Constants.ONE) |
| | | .isNotNull(JkCabinetGrid::getKeyId) |
| | | .apply("and NOW() > DATE_SUB(t2.START_TIME, INTERVAL "+earlyConfig+" MINUTE) and now() < t2.end_time and t3.MEMBER_ID = "+dto.getMemberId()+" )") |
| | | |
| | | ); |
| | | if(CollectionUtils.isNotEmpty(jkCabinetGridList)){ |
| | | girdIdList = jkCabinetGridList.stream().map(i->i.getId()).collect(Collectors.toList()); |
| | | } |
| | | jkCabinetGridList.addAll(jkCabinetGridMapper.selectJoinList(JkCabinetGrid.class, |
| | | new MPJLambdaWrapper<JkCabinetGrid>().selectAll(JkCabinetGrid.class) |
| | | .selectAs(JkKeys::getRfidLable,JkCabinetGrid::getKeyCode) |
| | | .selectAs(JkKeys::getCarCode,JkCabinetGrid::getCarCode) |
| | | .selectAs(JkKeys::getCarId,JkCabinetGrid::getCarId) |
| | | .selectAs(JkKeys::getStatus,JkCabinetGrid::getKeyStatus) |
| | | .select(!isCleanTime?"0":"2",JkCabinetGrid::getGetKeyWay) |
| | | .innerJoin(JkKeys.class,JkKeys::getId,JkCabinetGrid::getKeyId) |
| | | .eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getWorkingStatus,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getStatus,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getCabinetId,dto.getCabinetId()) |
| | | .eq(!isCleanTime,JkKeys::getRoleType,Constants.ZERO) |
| | | .in(JkKeys::getStatus,Constants.ONE) |
| | | .isNotNull(JkCabinetGrid::getKeyId) |
| | | .notIn(CollectionUtils.isNotEmpty(girdIdList),JkCabinetGrid::getId,jkCabinetGridList) |
| | | .apply("t1.car_id in ( select c.id from cars c where c.ISDELETED = 0 and c.MEMBER_ID = "+dto.getMemberId()+" ) ") |
| | | ) |
| | | ); |
| | | } |
| | | |
| | | for (JkCabinetGrid jkCabinetGrid:jkCabinetGridList) { |
| | | jkCabinetGrid.setBindStatus(Objects.isNull(jkCabinetGrid.getKeyId())?Constants.ZERO:Constants.ONE); |
| | | jkCabinetGrid.setKeyStatus(Objects.isNull(jkCabinetGrid.getKeyStatus())?Constants.ZERO:jkCabinetGrid.getKeyStatus()); |
| | |
| | | jkCabinetLog.setAuthType(openGridDriverDTO.getAuthType()); |
| | | jkCabinetLog.setMemberId(openGridDriverDTO.getMemberId()); |
| | | jkCabinetLog.setType(Constants.ZERO); |
| | | jkCabinetLog.setStatus(Constants.ZERO); |
| | | jkCabinetLog.setOpenWay(openGridDriverDTO.getOpenWay()); |
| | | jkCabinetLog.setCarUseBookId(openGridDriverDTO.getCarUseBookId()); |
| | | |
| | | jkCabinetLog.setInfo(Objects.isNull(openGridDriverDTO.getOpenType())||Constants.equalsInteger(openGridDriverDTO.getOpenType(),Constants.ZERO)?"ç³»ç»å¼å¯":"æå¨å¼å¯"); |
| | | if(Objects.nonNull(jkCabinetGrid.getKeyId())){ |
| | | jkCabinetLog.setKeyId(jkCabinetGrid.getKeyId()); |
| | |
| | | } |
| | | jkCabinetLog.setIsNotice(Constants.ZERO); |
| | | jkCabinetLogMapper.insert(jkCabinetLog); |
| | | |
| | | } |
| | | |
| | | |
| | | public void pushJDYKeyInfo(JDYKeyUseByBookDTO dto){ |
| | | String url = systemDictDataBiz.queryByCode(Constants.JDY_CONFIG,Constants.PUSH_URL_KEYS).getCode(); |
| | | // JSONObject object = new JSONObject(); |
| | | // object.put("create_date","20251104160000"); |
| | | // object.put("start_date",System.currentTimeMillis() ); |
| | | // object.put("end_date", System.currentTimeMillis() + 24*3600*1000); |
| | | // object.put("id","10000020251105");// |
| | | // object.put("type",1);//0=é¢ç¨ï¼1=å½è¿ |
| | | log.error("ãç®éäºãæ¨éæ´¾è½¦åæ°æ®é¢ç¨ä¸å½è¿ä¿¡æ¯-请æ±å
¥åï¼"+JSONObject.toJSONString(dto)); |
| | | String result = HttpsUtil.postJson(url,JSONObject.toJSONString(dto)); |
| | | log.error("ãç®éäºãæ¨éæ´¾è½¦åæ°æ®é¢ç¨ä¸å½è¿ä¿¡æ¯-请æ±ç»æï¼"+JSONObject.toJSONString(result)); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void timeOutUnCloseAlarm(TimeOutCloseGridDTO dto){ |