server/system_service/src/main/java/com/doumee/biz/system/impl/SystemUserBizImpl.java
@@ -150,7 +150,7 @@ @Override @Transactional(rollbackFor = {Exception.class,BusinessException.class}) public void create(CreateSystemUserDTO systemUser) { public void create(CreateSystemUserDTO systemUser) { // éªè¯ç¨æ·å SystemUser queryUserDto = new SystemUser(); queryUserDto.setUsername(systemUser.getUsername()); server/system_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -790,7 +790,7 @@ String t = reversedHex.substring(i*2,i*2+2); result += new StringBuilder(t).reverse().toString(); } return result; return result.toUpperCase(); }catch (Exception e){ } @@ -1523,9 +1523,9 @@ public enum WarningConfig { ALARM_TEST(10002, "é ç²¾æµè¯"), GRID_TIME_OUT_INFO(10003, "å¼é¨è¶ æ¶æªå ³é"), KEY_TIME_OUT_BACK(10004, "é¥åè¶ æ¶æªå½è¿"), ALARM_TEST(10002, "ãé¥åæãé ç²¾æµè¯å¼å¸¸"), GRID_TIME_OUT_INFO(10003, "ãé¥åæãå¼é¨è¶ æ¶æªå ³é"), KEY_TIME_OUT_BACK(10004, "ãé¥åæãé¥åè¶ æ¶æªå½è¿"), ; // æååé private int key; server/system_timer/src/main/java/com/doumee/jobs/fegin/VisitServiceFegin.java
@@ -115,4 +115,7 @@ @PostMapping("/timer/systemUserJob/jobForOpenProhibitStatus") ApiResponse jobForOpenProhibitStatus(); @ApiOperation("ãé¥åæã宿¶åéé¥åæªåæ¶å½è¿éç¥") @PostMapping("/timer/jkCabinet/timeOutUnBackAlarm") ApiResponse timeOutUnBackAlarm(); } server/visits/admin_timer/src/main/java/com/doumee/api/JkCabinetTimerController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,40 @@ package com.doumee.api; import com.doumee.service.business.JkCabinetLogService; import com.doumee.service.business.JkCustomerService; import com.doumee.service.business.impl.JkCabinetGridServiceImpl; import com.doumee.service.business.third.model.ApiResponse; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.shiro.SecurityUtils; import org.apache.shiro.mgt.DefaultSecurityManager; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @author æ±è¹è¹ * @date 2023/11/30 15:33 */ @Api(tags = "é¥åæå®æ¶å¨") @RestController @RequestMapping("/timer/jkCabinet") public class JkCabinetTimerController extends BaseController { @Autowired private JkCabinetLogService jkCabinetLogService; @Autowired private JkCabinetGridServiceImpl impl; @ApiOperation("宿¶åéé¥åæªåæ¶å½è¿éç¥") @PostMapping("/timeOutUnBackAlarm") public ApiResponse timeOutUnBackAlarm() { jkCabinetLogService.timeOutUnBackAlarm(impl); return ApiResponse.success("宿¶åéé¥åæªåæ¶å½è¿éç¥"); } } server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/web/cabinet/CabinetController.java
@@ -183,9 +183,9 @@ @LoginNoRequired @ApiOperation("è·åICå¡ç¨æ·ä¸»é® - 叿º") @PostMapping("/getMemberIdByCode") public ApiResponse<Integer> getMemberIdByCode(@RequestParam String code) { this.saveInterfaceLog(Constants.strToJson("code",code), null,"getMemberIdByCode","è·åICå¡ç¨æ·ä¸»é® - 叿º"); return ApiResponse.success(jkIccardService.getMemberIdByCode(code)); public ApiResponse<Integer> getMemberIdByCode(@RequestBody QueryUserByCodeDTO dto) { this.saveInterfaceLog(JSONObject.toJSONString(dto), null,"getMemberIdByCode","è·åICå¡ç¨æ·ä¸»é® - 叿º"); return ApiResponse.success(jkIccardService.getMemberIdByCode(dto)); } private void saveInterfaceLog(String s, String result,String url,String name) { server/visits/dmvisit_admin/src/main/resources/bootstrap.yml
@@ -1,6 +1,6 @@ spring: profiles: active: dev active: test application: name: visitsAdmin # å®å ¨é ç½® server/visits/dmvisit_service/src/main/java/com/doumee/core/dingTalk/DingTalk.java
@@ -519,7 +519,6 @@ /** * å®é²/æ¶é² markdown * @param hiddenDanger * @return */ public OapiMessageCorpconversationAsyncsendV2Request.Msg getAlarmNoticeMsg(String areaName,String submitTime,String infoType){ server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/dto/AbnormalOpenGridDTO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,25 @@ package com.doumee.dao.business.dto; import com.doumee.core.annotation.excel.ExcelColumn; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * Created by IntelliJ IDEA. * * @Author : Rk * @create 2025/10/11 16:01 */ @Data public class AbnormalOpenGridDTO { @ApiModelProperty(value = "é¥åæä¸»é®") private Integer cabinetId; @ApiModelProperty(value = "æ¿å·") private String boardCode; @ApiModelProperty(value = "ééå·") private String channelCode; } server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/dto/AlcoholTestAlarmDTO.java
@@ -18,5 +18,8 @@ @ApiModelProperty(value = "é 精度æ°") private String alcoholNum; @ApiModelProperty(value = "é¥åæä¸»é®") private Integer cabinetId; } server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/dto/OpenGridDriverDTO.java
@@ -25,4 +25,6 @@ @ApiModelProperty(value = "ç¨æ·ä¸»é®") private Integer memberId; @ApiModelProperty(value = "å¼å¯æ¹å¼ï¼0=ç³»ç»å¼å¯ï¼1=æå¨å¼å¯") private Integer openType; } server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/dto/OptGridDTO.java
@@ -21,4 +21,6 @@ @ApiModelProperty(value = "ææ ¼ä¸»é®å表") private List<Integer> gridIdList; @ApiModelProperty(value = "å¼å¯æ¹å¼ï¼0=ç³»ç»å¼å¯ï¼1=æå¨å¼å¯") private Integer openType; } server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/dto/QueryUserByCodeDTO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,22 @@ package com.doumee.dao.business.dto; import com.doumee.core.annotation.excel.ExcelColumn; 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 QueryUserByCodeDTO { @ApiModelProperty(value = "ICå¡å·") private String code; @ApiModelProperty(value = "å ³è人åç±»åï¼0=叿ºï¼1=æ ¡éªäººå", example = "1") private Integer userType; } server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/JkCabinetLog.java
@@ -44,7 +44,7 @@ @ApiModelProperty(value = "æ¯å¦å é¤0å¦ 1æ¯", example = "1") private Integer isdeleted; @ApiModelProperty(value = "夿³¨") @ApiModelProperty(value = "夿³¨ è®°å½å¼é¨æ¹å¼") private String info; @ApiModelProperty(value = "é¥åæç¼ç ï¼å ³èjk_cabinet)", example = "1") @@ -90,6 +90,8 @@ @ApiModelProperty(value = "æä½åé¥åç¶æï¼0æªåå;1å·²å½è¿;2å·²ååº;", example = "1") private Integer keyStatus; @ApiModelProperty(value = "æ¯å¦åééç¥ï¼0=å¦ï¼1=æ¯ï¼", example = "1") private Integer isNotice; @ApiModelProperty(value = "å½è¿æ¶é´") @TableField(exist = false) @@ -101,7 +103,7 @@ private String companyName; @ApiModelProperty(value = "æä½äººåç§°", example = "1") @ExcelColumn(name="æä½äºº",index = 1,width = 2) @ExcelColumn(name="æä½äºº",index = 1,width = 12) @TableField(exist = false) private String memberName; @@ -125,4 +127,8 @@ @JsonFormat(pattern = "yyyy-MM-dd") private Date endDate; @ApiModelProperty(value = "æå¨ä½ç½®") @TableField(exist = false) private String location; } server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/JkCustomer.java
@@ -79,7 +79,7 @@ private String sortno; @ApiModelProperty(value = "ç»çº¬åº¦", example = "1") @ExcelColumn(name="ç»çº¬åº¦",index = 3,width = 10) @ExcelColumn(name="ç»çº¬åº¦",index = 4,width = 10) @TableField(exist = false) private String locationInfo; @ApiModelProperty(value = "é货路线ç¼ç ï¼å ³èjk_line)", example = "1") server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/JkKeys.java
@@ -78,6 +78,11 @@ private Integer status; @ApiModelProperty(value = "æ ç¾æç  å å¯åçæ rfid_lable", example = "1") @ExcelColumn(name="æ ç¾æç  å å¯åçæ rfid_lable") private String rfidCode; @ApiModelProperty(value = "åæ¾ä½ç½®", example = "1") @TableField(exist = false) private String gridCode; server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/JkVersion.java
@@ -35,7 +35,6 @@ @ApiModelProperty(value = "å建æ¶é´") @ExcelColumn(name="å建æ¶é´") @JsonFormat(pattern = "yyyy-MM-dd") private Date createDate; @ApiModelProperty(value = "æ´æ°äººç¼ç ", example = "1") @@ -44,7 +43,6 @@ @ApiModelProperty(value = "æ´æ°æ¶é´") @ExcelColumn(name="æ´æ°æ¶é´") @JsonFormat(pattern = "yyyy-MM-dd") private Date editDate; @ApiModelProperty(value = "æ¯å¦å é¤0å¦ 1æ¯", example = "1") server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/WarningPush.java
@@ -82,7 +82,7 @@ @ApiModelProperty(value = "æå¨ä½ç½®") //@ExcelColumn(name="æ¨éæ è¯") private String pushId; @ApiModelProperty(value = "æ¨éæ è¯") @ApiModelProperty(value = "æå¨ä½ç½®") @ExcelColumn(name="æå¨ä½ç½®",width=10,index = 5) private String region; @@ -94,6 +94,15 @@ //@ExcelColumn(name="æ¨éæ¹å¼ 0éééç¥") private Integer pushType; @ApiModelProperty(value = "人åç¼ç ï¼å¤ä¸ªä»¥,åå²", example = "1") //@ExcelColumn(name="æ¨éæ¹å¼ 0éééç¥") private String memberIds; @ApiModelProperty(value = "人ååç§°ï¼å¤ä¸ªä»¥,åå²", example = "1") //@ExcelColumn(name="æ¨éæ¹å¼ 0éééç¥") private String memberNames; @ApiModelProperty(value = "äºä»¶åç±» 0=å®é²äºä»¶ï¼1=æ¶é²äºä»¶ï¼2=车载äºä»¶ï¼3=é¥åæäºä»¶ï¼ 4=天æ°é¢è¦ï¼", example = "1") @ExcelColumn(name="äºä»¶åç±»",valueMapping = "0=å®é²äºä»¶;1=æ¶é²äºä»¶;2=车载äºä»¶;3=é¥åæäºä»¶;4=天æ°é¢è¦;",width=10,index = 3) @TableField(exist = false) server/visits/dmvisit_service/src/main/java/com/doumee/service/business/JkCabinetLogService.java
@@ -2,6 +2,7 @@ import com.doumee.dao.business.dto.TelecomCabinetLogDTO; import com.doumee.dao.business.vo.TelecomJkCabinetLogVO; import com.doumee.service.business.impl.JkCabinetGridServiceImpl; import com.doumee.service.business.third.model.PageData; import com.doumee.service.business.third.model.PageWrap; import com.doumee.dao.business.model.JkCabinetLog; @@ -103,4 +104,8 @@ * @return */ List<TelecomJkCabinetLogVO> getLogListForTelecom(TelecomCabinetLogDTO model); void timeOutUnBackAlarm(JkCabinetGridServiceImpl impl); } server/visits/dmvisit_service/src/main/java/com/doumee/service/business/JkIccardService.java
@@ -1,5 +1,6 @@ package com.doumee.service.business; import com.doumee.dao.business.dto.QueryUserByCodeDTO; import com.doumee.service.business.third.model.PageData; import com.doumee.service.business.third.model.PageWrap; import com.doumee.dao.business.model.JkIccard; @@ -97,5 +98,5 @@ void updateStatusById(JkIccard jkIccard); Integer getMemberIdByCode(String code); Integer getMemberIdByCode(QueryUserByCodeDTO dto); } server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetGridServiceImpl.java
@@ -1,6 +1,7 @@ package com.doumee.service.business.impl; import com.alibaba.fastjson.JSONObject; import com.doumee.biz.system.SystemDictDataBiz; import com.doumee.core.constants.ResponseStatus; import com.doumee.core.dingTalk.DingTalk; import com.doumee.core.dingTalk.DingTalkStream; @@ -58,14 +59,20 @@ @Autowired private JkCabinetLogMapper jkCabinetLogMapper; @Autowired private WarningMapper warningMapper; @Autowired private MemberMapper memberMapper; @Autowired private WarningMapper warningMapper; @Autowired private WarningRuleMapper warningRuleMapper; @Autowired private WarningPushMapper warningPushMapper; @Autowired private SystemDictDataBiz systemDictDataBiz; @Autowired private DingTalk dingTalk; @@ -179,7 +186,7 @@ MPJLambdaWrapper<JkCabinetGrid> wrapper = new MPJLambdaWrapper<JkCabinetGrid>() .selectAll(JkCabinetGrid.class) .selectAs(JkCabinet::getName,JkCabinetGrid::getCabinetName) .selectAs(JkKeys::getCode,JkCabinetGrid::getKeyCode) .selectAs(JkKeys::getRfidLable,JkCabinetGrid::getKeyCode) .leftJoin(JkCabinet.class,JkCabinet::getId,JkCabinetGrid::getCabinetId) .leftJoin(JkKeys.class,JkKeys::getId,JkCabinetGrid::getKeyId) .eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) @@ -310,7 +317,7 @@ } List<JkCabinetGrid> jkCabinetGridList = jkCabinetGridMapper.selectJoinList(JkCabinetGrid.class, new MPJLambdaWrapper<JkCabinetGrid>().selectAll(JkCabinetGrid.class) .selectAs(JkKeys::getCode,JkCabinetGrid::getKeyCode) .selectAs(JkKeys::getRfidLable,JkCabinetGrid::getKeyCode) .selectAs(JkKeys::getCarCode,JkCabinetGrid::getCarCode) .selectAs(JkKeys::getCarId,JkCabinetGrid::getCarId) .leftJoin(JkKeys.class,JkKeys::getId,JkCabinetGrid::getKeyId) @@ -392,6 +399,8 @@ jkCabinetLog.setAuthType(Constants.TWO); jkCabinetLog.setMemberId(loginUserInfo.getMemberId()); jkCabinetLog.setStatus(Constants.ZERO); jkCabinetLog.setIsNotice(Constants.ZERO); jkCabinetLog.setInfo(Objects.isNull(dto.getOpenType())||Constants.equalsInteger(dto.getOpenType(),Constants.ZERO)?"ç³»ç»å¼å¯":"æå¨å¼å¯"); if(Objects.nonNull(jkCabinetGrid.getKeyId())){ jkCabinetLog.setKeyId(jkCabinetGrid.getKeyId()); JkKeys jkKeys = jkKeysMapper.selectById(jkCabinetGrid.getKeyId()); @@ -406,6 +415,7 @@ jkCabinetLog.setType(Constants.ZERO); jkCabinetLogs.add(jkCabinetLog); } jkCabinetLogMapper.insert(jkCabinetLogs); } } @@ -464,18 +474,50 @@ } } } jkCabinetLog.setIsNotice(Constants.ZERO); jkCabinetLog.setType(Constants.ONE); jkCabinetLogMapper.insert(jkCabinetLog); //æ¥è¯¢é¥åçå¼é¨è®°å½ è¿è¡æ·»å å ³é¨è®°å½ä¸»é® jkCabinetLogMapper.update(null,new UpdateWrapper<JkCabinetLog>().lambda() .set(JkCabinetLog::getCloseLogId,jkCabinetLog.getId()) .eq(JkCabinetLog::getKeyId,jkCabinetLog.getKeyId()) .eq(JkCabinetLog::getType,Constants.ZERO) .isNull(JkCabinetLog::getCloseLogId)); if(Constants.equalsInteger(dto.getKeyStatus(),Constants.ONE)){ jkCabinetLogMapper.update(null,new UpdateWrapper<JkCabinetLog>().lambda() .set(JkCabinetLog::getCloseLogId,jkCabinetLog.getId()) .eq(JkCabinetLog::getKeyId,jkCabinetLog.getKeyId()) .eq(JkCabinetLog::getType,Constants.ONE) .eq(JkCabinetLog::getKeyStatus,Constants.TWO) .isNull(JkCabinetLog::getCloseLogId)); } } } // public void saveAbnormalOpenGridLog(AbnormalOpenGridDTO dto){ // if(Objects.isNull(dto) // || StringUtils.isBlank(dto.getBoardCode()) // || StringUtils.isBlank(dto.getBoardCode()) // || Objects.isNull(dto.getCabinetId()) // || Objects.isNull(dto.getKeyStatus()) // || Objects.isNull(dto.getAuthType()) // ){ // throw new BusinessException(ResponseStatus.BAD_REQUEST); // } // JkCabinetGrid jkCabinetGrid = jkCabinetGridMapper.selectOne(new QueryWrapper<JkCabinetGrid>().lambda().eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) // .eq(JkCabinetGrid::getCabinetId,dto.getCabinetId()) // .eq(JkCabinetGrid::getId,dto.getGridId()) // .last(" limit 1 ") // ); // JkCabinetLog jkCabinetLog = new JkCabinetLog(); // jkCabinetLog.setCreateDate(new Date()); // jkCabinetLog.setIsdeleted(Constants.ZERO); // jkCabinetLog.setCabinetId(dto.getCabinetId()); // jkCabinetLog.setGridId(jkCabinetGrid.getId()); // jkCabinetLog.setAuthType(dto.getAuthType()); // jkCabinetLog.setMemberId(dto.getMemberId()); // jkCabinetLog.setKeyStatus(Constants.ZERO); // jkCabinetLog.setStatus(Constants.ZERO); // // } /** @@ -512,7 +554,7 @@ } jkCabinetGridList = jkCabinetGridMapper.selectJoinList(JkCabinetGrid.class, new MPJLambdaWrapper<JkCabinetGrid>().selectAll(JkCabinetGrid.class) .selectAs(JkKeys::getCode,JkCabinetGrid::getKeyCode) .selectAs(JkKeys::getRfidLable,JkCabinetGrid::getKeyCode) .selectAs(JkKeys::getCarCode,JkCabinetGrid::getCarCode) .selectAs(JkKeys::getCarId,JkCabinetGrid::getCarId) .selectAs(JkKeys::getStatus,JkCabinetGrid::getKeyStatus) @@ -551,10 +593,8 @@ if(Objects.isNull(jkCabinetGrid)){ return ; } // LoginUserInfo loginUserInfo = openGridDriverDTO.getLoginUserInfo(); JkCabinetLog jkCabinetLog = new JkCabinetLog(); jkCabinetLog.setCreateDate(new Date()); // jkCabinetLog.setCreator(loginUserInfo.getId()); jkCabinetLog.setIsdeleted(Constants.ZERO); jkCabinetLog.setCabinetId(openGridDriverDTO.getCabinetId()); jkCabinetLog.setGridId(jkCabinetGrid.getId()); @@ -562,6 +602,7 @@ jkCabinetLog.setMemberId(openGridDriverDTO.getMemberId()); jkCabinetLog.setType(Constants.ZERO); jkCabinetLog.setStatus(Constants.ZERO); jkCabinetLog.setInfo(Objects.isNull(openGridDriverDTO.getOpenType())||Constants.equalsInteger(openGridDriverDTO.getOpenType(),Constants.ZERO)?"ç³»ç»å¼å¯":"æå¨å¼å¯"); if(Objects.nonNull(jkCabinetGrid.getKeyId())){ jkCabinetLog.setKeyId(jkCabinetGrid.getKeyId()); JkKeys jkKeys = jkKeysMapper.selectById(jkCabinetGrid.getKeyId()); @@ -573,6 +614,7 @@ jkCabinetLog.setRoleType(jkKeys.getRoleType()); } } jkCabinetLog.setIsNotice(Constants.ZERO); jkCabinetLogMapper.insert(jkCabinetLog); } @@ -593,8 +635,9 @@ if(Objects.nonNull(jkCabinetGrid)){ log.error("ææ ¼å¼é¨è¶ æ¶æªå ³éåè¦ä¿¡æ¯ï¼{}"+JSONObject.toJSONString(jkCabinetGrid)); Constants.WarningConfig warningConfig = Constants.WarningConfig.GRID_TIME_OUT_INFO; Warning warning = warningMapper.selectOne(new QueryWrapper<Warning>().lambda() .eq(Warning::getType,Constants.THREE).eq(Warning::getCode,Constants.WarningConfig.GRID_TIME_OUT_INFO.getKey()).eq(Warning::getIsdeleted,Constants.ZERO).last("limt 1")); .eq(Warning::getType,Constants.THREE).eq(Warning::getCode,warningConfig.getKey()).eq(Warning::getIsdeleted,Constants.ZERO).last("limt 1")); if(Objects.isNull(warning)){ return; } @@ -602,10 +645,33 @@ if(CollectionUtils.isEmpty(memberList)){ return; } //todo åå¨å¼å¸¸æ¥å¿ JkCabinet jkCabinet = jkCabinetMapper.selectById(dto.getCabinetId()); // åå¨å¼å¸¸æ¥å¿ WarningPush warningPush = new WarningPush(); warningPush.setCreateDate(new Date()); warningPush.setIsdeleted(Constants.ZERO); warningPush.setWarningId(warning.getId()); warningPush.setTitle(warningConfig.getInfo()); String content = "ãé¥åæ-"+jkCabinetGrid.getCabinetName()+"ãä¸ãææ ¼-"+jkCabinetGrid.getCode()+"ãè¶ æ¶æªå ³é"; warningPush.setContent(content); warningPush.setStatus(Constants.ZERO); warningPush.setPushType(Constants.ZERO); warningPush.setRegion(Objects.nonNull(jkCabinet)&&StringUtils.isNotBlank(jkCabinet.getLocation())?jkCabinet.getLocation():"æªç¥ä½ç½®"); warningPush.setMemberIds( StringUtils.join(memberList.stream().map(i->i.getId()).collect(Collectors.toList()),",") ); warningPush.setMemberIds( StringUtils.join(memberList.stream().map(i->i.getId()).collect(Collectors.toList()),",") ); warningPush.setMemberNames(StringUtils.join(memberList.stream().map(i->i.getName()).collect(Collectors.toList()),",") ); //todo ææ¶å ³é éééç¥ }else{ // Boolean noticeFlag = dingTalk.workInfoOANotice(Long.valueOf(systemDictDataBiz.queryByCode(Constants.DD_TALK,Constants.AGENT_ID).getCode()), // StringUtils.join(memberList.stream().filter(i->StringUtils.isNotBlank(i.getDdId())).map(i->i.getDdId()).collect(Collectors.toList()),","), // dingTalk.getAlarmNoticeMsg(warningPush.getRegion(),DateUtil.getCurrDateTime(),content)); // warningPush.setStatus(noticeFlag?Constants.ONE:Constants.TWO); warningPushMapper.insert(warningPush); } } @@ -638,9 +704,6 @@ } } return memberList; } @@ -656,8 +719,10 @@ .last(" limit 1 ") ); JkCabinet jkCabinet = jkCabinetMapper.selectById(dto.getCabinetId()); Constants.WarningConfig warningConfig = Constants.WarningConfig.ALARM_TEST; Warning warning = warningMapper.selectOne(new QueryWrapper<Warning>().lambda() .eq(Warning::getType,Constants.THREE).eq(Warning::getCode,Constants.WarningConfig.KEY_TIME_OUT_BACK.getKey()).eq(Warning::getIsdeleted,Constants.ZERO).last("limt 1")); .eq(Warning::getType,Constants.THREE).eq(Warning::getCode,warningConfig.getKey()).eq(Warning::getIsdeleted,Constants.ZERO).last("limt 1")); if(Objects.isNull(warning)){ return; } @@ -665,8 +730,44 @@ if(CollectionUtils.isEmpty(memberList)){ return; } //todo åå¨å¼å¸¸æ¥å¿ // åå¨å¼å¸¸æ¥å¿ WarningPush warningPush = new WarningPush(); warningPush.setCreateDate(new Date()); warningPush.setIsdeleted(Constants.ZERO); warningPush.setWarningId(warning.getId()); warningPush.setTitle(warningConfig.getInfo()); String content = ""; if(Objects.nonNull(systemUser.getRealname())){ content = content + systemUser.getRealname(); } if(Objects.nonNull(jkCabinet)){ content = content + "äº"+jkCabinet.getName()+"é¥åæ"; } content = content + "é ç²¾æ£æµå¼å¸¸"; warningPush.setContent(content + "é ç²¾æ£æµå¼å¸¸ï¼é 精度æ°ã"+dto.getAlcoholNum()+"°ã"); if(Objects.nonNull(dto.getAlcoholNum())){ content = content + "ï¼é 精度æ°ã"+dto.getAlcoholNum()+"°ã"; } warningPush.setContent(content); warningPush.setStatus(Constants.ZERO); warningPush.setPushType(Constants.ZERO); warningPush.setRegion(Objects.nonNull(jkCabinet)&&StringUtils.isNotBlank(jkCabinet.getLocation())?jkCabinet.getLocation():"æªç¥ä½ç½®"); warningPush.setMemberId(dto.getMemberId()); warningPush.setMemberIds( StringUtils.join(memberList.stream().map(i->i.getId()).collect(Collectors.toList()),",") ); warningPush.setMemberIds( StringUtils.join(memberList.stream().map(i->i.getId()).collect(Collectors.toList()),",") ); warningPush.setMemberNames(StringUtils.join(memberList.stream().map(i->i.getName()).collect(Collectors.toList()),",") ); //todo ææ¶å ³é éééç¥ // Boolean noticeFlag = dingTalk.workInfoOANotice(Long.valueOf(systemDictDataBiz.queryByCode(Constants.DD_TALK,Constants.AGENT_ID).getCode()), // StringUtils.join(memberList.stream().filter(i->StringUtils.isNotBlank(i.getDdId())).map(i->i.getDdId()).collect(Collectors.toList()),","), // dingTalk.getAlarmNoticeMsg(warningPush.getRegion(),DateUtil.getCurrDateTime(),warningConfig.getInfo())); // warningPush.setStatus(noticeFlag?Constants.ONE:Constants.TWO); warningPushMapper.insert(warningPush); //åå¨å¼å¸¸æ¥å¿ if(Objects.nonNull(systemUser)){ log.error("叿ºé ç²¾æ£æµï¼è¶ åºé ç²¾å¼åè¦ä¿¡æ¯ï¼{}"+JSONObject.toJSONString(systemUser)); @@ -675,4 +776,7 @@ } } server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetLogServiceImpl.java
@@ -1,7 +1,11 @@ package com.doumee.service.business.impl; import cn.hutool.core.bean.BeanUtil; import com.doumee.biz.system.SystemDictDataBiz; import com.doumee.core.utils.Constants; import com.doumee.dao.business.WarningMapper; import com.doumee.dao.business.WarningPushMapper; import com.doumee.dao.business.WarningRuleMapper; import com.doumee.dao.business.dto.TelecomCabinetLogDTO; import com.doumee.dao.business.model.*; import com.doumee.dao.business.vo.TelecomJkCabinetLogVO; @@ -21,8 +25,10 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; /** * é¥åæå¼å ³é¨è®°å½Serviceå®ç° @@ -35,6 +41,16 @@ @Autowired private JkCabinetLogMapper jkCabinetLogMapper; @Autowired private WarningMapper warningMapper; @Autowired private WarningRuleMapper warningRuleMapper; @Autowired private WarningPushMapper warningPushMapper; @Autowired private SystemDictDataBiz systemDictDataBiz; @Override public Integer create(JkCabinetLog jkCabinetLog) { jkCabinetLogMapper.insert(jkCabinetLog); @@ -154,6 +170,7 @@ .ge(Objects.nonNull(model.getStartDate()),JkCabinetLog::getCreateDate, Utils.Date.getStart(model.getStartDate())) .le(Objects.nonNull(model.getEndDate()),JkCabinetLog::getCreateDate, Utils.Date.getEnd(model.getEndDate())) .eq(JkCabinetLog::getIsdeleted, Constants.ZERO) .eq(JkCabinetLog::getType,Constants.ONE) .eq(JkCabinetLog::getKeyStatus,Constants.TWO) .orderByDesc(JkCabinetLog::getCreateDate); List<JkCabinetLog> jkCabinetLogs = jkCabinetLogMapper.selectJoinList(JkCabinetLog.class,wrapper); @@ -171,5 +188,68 @@ @Override public void timeOutUnBackAlarm(JkCabinetGridServiceImpl impl){ Constants.WarningConfig warningConfig = Constants.WarningConfig.KEY_TIME_OUT_BACK; Warning warning = warningMapper.selectOne(new QueryWrapper<Warning>().lambda() .eq(Warning::getType,Constants.THREE).eq(Warning::getCode,warningConfig.getKey()).eq(Warning::getIsdeleted,Constants.ZERO).last("limt 1")); if(Objects.isNull(warning)){ return; } MPJLambdaWrapper<JkCabinetLog> wrapper = new MPJLambdaWrapper<JkCabinetLog>() .selectAll(JkCabinetLog.class) .selectAs(Member::getName,JkCabinetLog::getMemberName) .selectAs(JkKeys::getCode,JkCabinetLog::getCarCode) .selectAs(JkCabinet::getLocation,JkCabinetLog::getLocation) .leftJoin(JkCabinet.class,JkCabinet::getId,JkCabinetLog::getCabinetId) .leftJoin(JkKeys.class,JkKeys::getId,JkCabinetLog::getKeyId) .leftJoin(Member.class,Member::getId,JkCabinetLog::getMemberId) .eq(JkCabinetLog::getIsdeleted,Constants.ZERO) .eq(JkCabinetLog::getType,Constants.ONE) .eq(JkCabinetLog::getIsNotice,Constants.ZERO) .eq(JkKeys::getStatus,Constants.TWO) .isNull(JkCabinetLog::getCloseLogId) .apply(" now() > DATE_ADD(t.CREATE_DATE, INTERVAL ifnull(t1.USE_TIME,0) MINUTE) ") .orderByDesc(JkCabinetLog::getCreateDate); List<JkCabinetLog> jkCabinetLogs = jkCabinetLogMapper.selectJoinList(JkCabinetLog.class,wrapper); if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(jkCabinetLogs)){ List<Member> memberList = impl.getWarningList(warning); if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(memberList)){ for (JkCabinetLog jkCabinetLog:jkCabinetLogs) { WarningPush warningPush = new WarningPush(); warningPush.setCreateDate(new Date()); warningPush.setIsdeleted(Constants.ZERO); warningPush.setWarningId(warning.getId()); warningPush.setTitle(warningConfig.getInfo()); String content = "ã车è¾-"+jkCabinetLog.getCarCode()+"é¥åãç±+"+(StringUtils.isNotBlank(jkCabinetLog.getMemberName())?jkCabinetLog.getMemberName():"æªç¥äººå")+"ååºï¼è¶ æ¶æªå½è¿"; warningPush.setContent(content); warningPush.setStatus(Constants.ZERO); warningPush.setPushType(Constants.ZERO); warningPush.setRegion( StringUtils.isNotBlank(jkCabinetLog.getLocation())?jkCabinetLog.getLocation():"æªç¥ä½ç½®"); warningPush.setMemberIds( StringUtils.join(memberList.stream().map(i->i.getId()).collect(Collectors.toList()),",") ); warningPush.setMemberIds( StringUtils.join(memberList.stream().map(i->i.getId()).collect(Collectors.toList()),",") ); warningPush.setMemberNames(StringUtils.join(memberList.stream().map(i->i.getName()).collect(Collectors.toList()),",") ); //todo ææ¶å ³é éééç¥ // Boolean noticeFlag = dingTalk.workInfoOANotice(Long.valueOf(systemDictDataBiz.queryByCode(Constants.DD_TALK,Constants.AGENT_ID).getCode()), // StringUtils.join(memberList.stream().filter(i->StringUtils.isNotBlank(i.getDdId())).map(i->i.getDdId()).collect(Collectors.toList()),","), // dingTalk.getAlarmNoticeMsg(warningPush.getRegion(),DateUtil.getCurrDateTime(),content)); // warningPush.setStatus(noticeFlag?Constants.ONE:Constants.TWO); warningPushMapper.insert(warningPush); } } } } } server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetServiceImpl.java
@@ -85,7 +85,7 @@ || Objects.isNull(jkCabinet.getSortType()) || ( Constants.equalsInteger(jkCabinet.getNoType(),Constants.ONE) && ( Objects.isNull(jkCabinet.getNoIndex()) || Objects.isNull(jkCabinet.getNoLength()) || StringUtils.isBlank(jkCabinet.getNoPrefix()) ) && ( Objects.isNull(jkCabinet.getNoIndex()) || Objects.isNull(jkCabinet.getNoLength()) ) ) ){ throw new BusinessException(ResponseStatus.BAD_REQUEST); @@ -134,7 +134,7 @@ if(Constants.equalsInteger(jkCabinet.getNoType(),Constants.ZERO)){ grid.setCode(StringUtils.leftPad(startNo.toString(),maxNum.toString().length()+1,"0")); }else{ grid.setCode(jkCabinet.getNoPrefix() + StringUtils.leftPad(startNo.toString(),jkCabinet.getNoLength(),"0")); grid.setCode(StringUtils.isNotBlank(jkCabinet.getNoPrefix())?jkCabinet.getNoPrefix():"" + StringUtils.leftPad(startNo.toString(),jkCabinet.getNoLength(),"0")); } jkCabinetGridList.add(grid); @@ -412,7 +412,7 @@ jkCabinetGridMapper.selectJoinList(JkCabinetGrid.class, new MPJLambdaWrapper<JkCabinetGrid>() .selectAll(JkCabinetGrid.class) .selectAs(JkKeys::getCarCode,JkCabinetGrid::getCarCode) .selectAs(JkKeys::getCode,JkCabinetGrid::getKeyCode) .selectAs(JkKeys::getRfidLable,JkCabinetGrid::getKeyCode) .selectAs(JkKeys::getStatus,JkCabinetGrid::getKeyStatus) .leftJoin(JkKeys.class,JkKeys::getId,JkCabinetGrid::getKeyId) .eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) @@ -504,7 +504,7 @@ List<Member> memberList = memberMapper.selectList(new QueryWrapper<Member>().lambda() .eq(Member::getIsdeleted,Constants.ZERO) .isNotNull(Member::getFaceImg) .apply(" FIND_IN_SET( id ,'"+jkCabinet.getManagerId()+"') ") .apply(" FIND_IN_SET( id ,'"+jkCabinet.getAuthMemberId()+"') ") ); if(CollectionUtils.isNotEmpty(memberList)){ for (Member member:memberList) { @@ -541,7 +541,7 @@ .selectAll(JkCabinetGrid.class) .selectAs(JkKeys::getCarCode,JkCabinetGrid::getCarCode) .selectAs(JkKeys::getStatus,JkCabinetGrid::getKeyStatus) .selectAs(JkKeys::getCode,JkCabinetGrid::getKeyCode) .selectAs(JkKeys::getRfidLable,JkCabinetGrid::getKeyCode) .leftJoin(JkKeys.class,JkKeys::getId,JkCabinetGrid::getKeyId) .eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) .eq(JkCabinetGrid::getCabinetId,jkCabinet.getId()) server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkIccardServiceImpl.java
@@ -4,6 +4,7 @@ import com.doumee.core.exception.BusinessException; import com.doumee.core.utils.Constants; import com.doumee.core.utils.DateUtil; import com.doumee.dao.business.dto.QueryUserByCodeDTO; import com.doumee.dao.business.model.*; import com.doumee.dao.system.model.SystemUser; import com.doumee.service.business.third.model.LoginUserInfo; @@ -181,16 +182,24 @@ @Override public Integer getMemberIdByCode(String code){ public Integer getMemberIdByCode(QueryUserByCodeDTO dto){ if(Objects.isNull(dto) || Objects.isNull(dto.getUserType()) || StringUtils.isBlank(dto.getCode())){ throw new BusinessException(ResponseStatus.BAD_REQUEST); } JkIccard jkIccard = jkIccardMapper.selectOne(new QueryWrapper<JkIccard>().lambda() .eq(JkIccard::getIsdeleted,Constants.ZERO) .eq(JkIccard::getStatus,Constants.ONE) .eq(JkIccard::getCode,code) .eq(JkIccard::getUserType,dto.getUserType()) .eq(JkIccard::getCode,dto.getCode()) .last(" limit 1 ") ); if(Objects.isNull(jkIccard)){ throw new BusinessException(ResponseStatus.DATA_EMPTY); } if(!Constants.equalsInteger(jkIccard.getStatus(),Constants.ONE)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼å½åICå¡å·²è¢«ç¦ç¨ï¼"); } return jkIccard.getMemberId(); } server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkKeysServiceImpl.java
@@ -49,7 +49,7 @@ || Objects.isNull(jkKeys.getCarId()) || Objects.isNull(jkKeys.getRoleType()) || StringUtils.isBlank(jkKeys.getCode()) || StringUtils.isBlank(jkKeys.getRfidLable()) || StringUtils.isBlank(jkKeys.getRfidCode()) ){ throw new BusinessException(ResponseStatus.BAD_REQUEST); } @@ -65,10 +65,15 @@ if(Objects.nonNull(carsKeys)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å½å车è¾å·²è¢«é¥å["+carsKeys.getCode()+"]ç»å®ä½¿ç¨ï¼"); } JkKeys rfidKeys = jkKeysMapper.selectOne(new QueryWrapper<JkKeys>().lambda().eq(JkKeys::getRfidLable,jkKeys.getRfidLable()).eq(JkKeys::getIsdeleted,Constants.ZERO).last("limit 1")); JkKeys rfidKeys = jkKeysMapper.selectOne(new QueryWrapper<JkKeys>().lambda().eq(JkKeys::getRfidCode,jkKeys.getRfidCode()).eq(JkKeys::getIsdeleted,Constants.ZERO).last("limit 1")); if(Objects.nonNull(rfidKeys)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å½åRFIDæ ç¾å·²è¢«é¥å["+rfidKeys.getCode()+"]使ç¨ï¼"); } String lable = Constants.getRFIDNumber(jkKeys.getRfidCode()); if(StringUtils.isEmpty(lable)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"RFIDæ ç¾è®¾ç½®å¤±è´¥ãæ ¼å¼ä¸æ£ç¡®ã"); } jkKeys.setRfidLable(lable); LoginUserInfo loginUserInfo = jkKeys.getLoginUserInfo(); jkKeys.setCreateDate(new Date()); jkKeys.setEditDate(jkKeys.getCreateDate()); @@ -114,10 +119,15 @@ || Objects.isNull(jkKeys.getCarId()) || Objects.isNull(jkKeys.getRoleType()) || StringUtils.isBlank(jkKeys.getCode()) || StringUtils.isBlank(jkKeys.getRfidLable()) || StringUtils.isBlank(jkKeys.getRfidCode()) ){ throw new BusinessException(ResponseStatus.BAD_REQUEST); } String lable = Constants.getRFIDNumber(jkKeys.getRfidCode()); if(StringUtils.isEmpty(lable)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"RFIDæ ç¾è®¾ç½®å¤±è´¥ãæ ¼å¼ä¸æ£ç¡®ã"); } jkKeys.setRfidLable(lable); //æ¥è¯¢ç¼å·æ¯å¦éå¤ if(jkKeysMapper.selectCount(new QueryWrapper<JkKeys>().lambda().ne(JkKeys::getId,jkKeys.getId()).eq(JkKeys::getCode,jkKeys.getCode()).eq(JkKeys::getIsdeleted,Constants.ZERO))>Constants.ZERO){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"é¥åç¼å·å·²åå¨ï¼"); @@ -134,6 +144,7 @@ if(Objects.nonNull(rfidKeys)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å½åRFIDæ ç¾å·²è¢«é¥å["+rfidKeys.getCode()+"]使ç¨ï¼"); } LoginUserInfo loginUserInfo = jkKeys.getLoginUserInfo(); jkKeys.setEditDate(new Date()); jkKeys.setEditor(loginUserInfo.getId());