¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.wx; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.HttpsUtil; |
| | | import com.doumee.dao.business.model.Bookings; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 微信å
¬ä¼å·éç¥ |
| | | * |
| | | * @Author : Rk |
| | | * @create 2023/12/27 9:19 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class WxPlatNotice { |
| | | |
| | | public void testSendNotice(List<String> openIds,String token){ |
| | | if(CollectionUtils.isNotEmpty(openIds)){ |
| | | String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token; |
| | | //æ´ä½åæ°map |
| | | Map<String, Object> paramMap = new HashMap<String, Object>(); |
| | | //æ¶æ¯ä¸»é¢æ¾ç¤ºç¸å
³map |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | Map<String, Object> const9 = new HashMap<String,Object>(); |
| | | const9.put("value","ç³è¯·å¾
æ¨å®¡æ¹"); |
| | | Map<String, Object> thing1 = new HashMap<String,Object>(); |
| | | thing1.put("value", "æµè¯åç§°"); |
| | | Map<String, Object> car_number7 = new HashMap<String,Object>(); |
| | | car_number7.put("value","çAP12345"); |
| | | Map<String, Object> character_string6 = new HashMap<String,Object>(); |
| | | character_string6.put("value","1"); |
| | | Map<String, Object> thing4 = new HashMap<String,Object>(); |
| | | thing4.put("value","çç±"); |
| | | dataMap.put("const9",const9); |
| | | dataMap.put("thing1",thing1); |
| | | dataMap.put("car_number7",car_number7); |
| | | dataMap.put("character_string6",character_string6); |
| | | dataMap.put("thing4",thing4); |
| | | paramMap.put("data", dataMap); |
| | | for (String openId:openIds) { |
| | | paramMap.clear(); |
| | | paramMap.put("template_id", "SPwvgtASkm1aMDBsYhX2wHKdL2JBEGPknDkgniSza2Y"); |
| | | paramMap.put("touser", openId); |
| | | paramMap.put("data", dataMap); |
| | | String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap)); |
| | | if(StringUtils.isBlank(response)){ |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", "失败"); |
| | | }else{ |
| | | JSONObject json = JSONObject.parseObject(response); |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"æå":"失败"+json.getString("errmsg")); |
| | | } |
| | | } |
| | | // log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", msgId != null ? "æå" : "失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¼è®®å®¤é¢çº¦éç¥ |
| | | * @param bookings |
| | | * @param tempId CuoDoxOl6SFwi4NhNgOQgKSJVjDD4VCIaPYlnbv_zdY |
| | | * @param token |
| | | * @param openIds |
| | | */ |
| | | public void sendMeetingBookTemplateNotice(Bookings bookings,String tempId, String token, Set<String> openIds){ |
| | | if(CollectionUtils.isNotEmpty(openIds)){ |
| | | String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token; |
| | | //æ´ä½åæ°map |
| | | Map<String, Object> paramMap = new HashMap<String, Object>(); |
| | | //æ¶æ¯ä¸»é¢æ¾ç¤ºç¸å
³map |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | //ä¼è®®åç§° |
| | | Map<String, Object> thing1 = new HashMap<String,Object>(); |
| | | thing1.put("value",bookings.getName()); |
| | | //ä¼è®®æ¶é´ |
| | | Map<String, Object> time2 = new HashMap<String,Object>(); |
| | | time2.put("value", DateUtil.getDate(bookings.getStartTime(),"yyyy-MM-dd HH:mm:ss") ); |
| | | //ä¼è®®å°ç¹ |
| | | Map<String, Object> thing3 = new HashMap<String,Object>(); |
| | | thing3.put("value",bookings.getRoomName()); |
| | | //å起人 |
| | | Map<String, Object> thing6 = new HashMap<String,Object>(); |
| | | thing6.put("value",bookings.getManagerInfo()); |
| | | |
| | | dataMap.put("thing1",thing1); |
| | | dataMap.put("time2",time2); |
| | | dataMap.put("thing3",thing3); |
| | | dataMap.put("thing6",thing6); |
| | | paramMap.put("data", dataMap); |
| | | for (String openId:openIds) { |
| | | paramMap.clear(); |
| | | paramMap.put("template_id", tempId); |
| | | paramMap.put("touser", openId); |
| | | paramMap.put("data", dataMap); |
| | | String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap)); |
| | | if(StringUtils.isBlank(response)){ |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", "失败"); |
| | | }else{ |
| | | JSONObject json = JSONObject.parseObject(response); |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"æå":"失败"+json.getString("errmsg")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ä¼è®®å®¤åæ¶éç¥ |
| | | * @param bookings |
| | | * @param tempId CiB6vCT2InovAoQfudY-lvzLSV0-3lfz3a5GsSFCzd8 |
| | | * @param token |
| | | * @param openIds |
| | | */ |
| | | public void sendMeetingBookCancelTemplateNotice(Bookings bookings,String tempId, String token, Set<String> openIds){ |
| | | if(CollectionUtils.isNotEmpty(openIds)){ |
| | | String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token; |
| | | //æ´ä½åæ°map |
| | | Map<String, Object> paramMap = new HashMap<String, Object>(); |
| | | //æ¶æ¯ä¸»é¢æ¾ç¤ºç¸å
³map |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | //ä¼è®®åç§° |
| | | Map<String, Object> thing1 = new HashMap<String,Object>(); |
| | | thing1.put("value",bookings.getName()); |
| | | //ä¼è®®æ¶é´ |
| | | Map<String, Object> time6 = new HashMap<String,Object>(); |
| | | time6.put("value", DateUtil.getDate(bookings.getStartTime(),"yyyy-MM-dd HH:mm:ss") ); |
| | | //ä¼è®®å°ç¹ |
| | | Map<String, Object> thing2 = new HashMap<String,Object>(); |
| | | thing2.put("value",bookings.getRoomName()); |
| | | //é¢çº¦äººå |
| | | Map<String, Object> thing4 = new HashMap<String,Object>(); |
| | | thing4.put("value",bookings.getManagerInfo()); |
| | | |
| | | dataMap.put("thing1",thing1); |
| | | dataMap.put("time6",time6); |
| | | dataMap.put("thing2",thing2); |
| | | dataMap.put("thing4",thing4); |
| | | paramMap.put("data", dataMap); |
| | | for (String openId:openIds) { |
| | | paramMap.clear(); |
| | | paramMap.put("template_id", tempId); |
| | | paramMap.put("touser", openId); |
| | | paramMap.put("data", dataMap); |
| | | String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap)); |
| | | if(StringUtils.isBlank(response)){ |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", "失败"); |
| | | }else{ |
| | | JSONObject json = JSONObject.parseObject(response); |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"æå":"失败"+json.getString("errmsg")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "åä¼äººåææºå·") |
| | | @TableField(exist = false) |
| | | private String userPhone; |
| | | @ApiModelProperty(value = "openid") |
| | | @TableField(exist = false) |
| | | private String openid; |
| | | |
| | | |
| | | |
| | |
| | | import com.doumee.core.utils.*; |
| | | import com.doumee.core.wx.MeetConstants; |
| | | import com.doumee.core.wx.SendWxMessage; |
| | | import com.doumee.core.wx.WxPlatNotice; |
| | | import com.doumee.dao.admin.request.BusinessOverDTO; |
| | | import com.doumee.dao.admin.request.QrOpenDoorDto; |
| | | import com.doumee.dao.admin.response.DevWgResponseParam; |
| | |
| | | if(Constants.equalsInteger(bookings.getJoinNotice(),Constants.ZERO)){ |
| | | this.sendNotice(bookings, MeetConstants.TWO); |
| | | } |
| | | //åé微信订é
éç¥ |
| | | // sendWxMessage.bookingsReservation(systemUserMapper.selectById(bookings.getCreator()), bookings, roomsMapper.selectById(bookings.getRoomId())); |
| | | SystemUser systemUser = systemUserMapper.selectById(bookings.getUserId()); |
| | | this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ZERO); |
| | | |
| | | return bookings.getId(); |
| | | } |
| | |
| | | updateProjectRel(bookings, user); |
| | | handleFile(bookings, user); |
| | | //åéä¼è®®éç¥ |
| | | if(Constants.equalsInteger(bookings.getJoinNotice(),Constants.ZERO)){ |
| | | this.sendNotice(bookings, MeetConstants.TWO); |
| | | } |
| | | SystemUser systemUser = systemUserMapper.selectById(bookings.getUserId()); |
| | | this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ZERO); |
| | | } |
| | | |
| | | @Override |
| | |
| | | bookings.setEditor(user.getId()); |
| | | bookingsMapper.updateById(bookings); |
| | | //åæ¶ä¼è®® åéåæ¶éç¥ |
| | | if(Constants.equalsInteger(bookings.getJoinNotice(),Constants.ZERO)){ |
| | | this.sendNotice(bookings, 3); |
| | | //åé微信订é
éç¥ |
| | | sendWxMessage.bookingsCancel(systemUserMapper.selectById(bookings.getCreator()), bookings, roomsMapper.selectById(bookings.getRoomId())); |
| | | } |
| | | SystemUser systemUser = systemUserMapper.selectById(bookings.getUserId()); |
| | | this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ONE); |
| | | |
| | | } |
| | | |
| | |
| | | String avatarPath = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode(); |
| | | userResponseList.forEach(i -> { |
| | | if(StringUtils.isNotBlank(i.getAvatar())){ |
| | | if(StringUtils.isNotBlank(i.getAvatar()) && !i.getAvatar().startsWith("HKIMG") ){ |
| | | i.setAvatar(avatarPath+i.getAvatar()); |
| | | }else{ |
| | | i.setAvatar(null); |
| | | } |
| | | }); |
| | | meetingDetailResponse.setUserResponseList(userResponseList); |
| | |
| | | bookings.setEditor(businessOverDTO.getUserId()); |
| | | bookingsMapper.updateById(bookings); |
| | | //åæ¶ä¼è®® åéåæ¶éç¥ |
| | | if(Constants.equalsInteger(bookings.getJoinNotice(),Constants.ZERO)){ |
| | | this.sendNotice(bookings, 3); |
| | | //åé微信订é
éç¥ |
| | | // sendWxMessage.bookingsCancel(systemUserMapper.selectById(bookings.getCreator()), bookings, roomsMapper.selectById(bookings.getRoomId())); |
| | | } |
| | | SystemUser systemUser = systemUserMapper.selectById(bookings.getUserId()); |
| | | this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ONE); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | bookings.setEditDate(new Date()); |
| | | bookingsMapper.updateById(bookings); |
| | | this.sendNotice(bookings, MeetConstants.ONE); |
| | | |
| | | //åé微信éç¥ |
| | | // sendWxMessage.bookingsStart(systemUserMapper.selectById(bookings.getCreator()), bookings, roomsMapper.selectById(bookings.getRoomId())); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @Async |
| | | public void sendWxNotice(Bookings bookings,String openid, Integer sendType) { |
| | | try{ |
| | | List<UserRel> userRelList = userRelMapper.selectJoinList(UserRel.class,new MPJLambdaWrapper<UserRel>() |
| | | .selectAll(UserRel.class) |
| | | .selectAs(SystemUser::getRealname,UserRel::getRealName) |
| | | .selectAs(SystemUser::getMobile,UserRel::getUserPhone) |
| | | .selectAs(SystemUser::getOpenid,UserRel::getOpenid) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,UserRel::getUserId) |
| | | .eq(UserRel::getObjType, MeetConstants.ONE) |
| | | .eq(UserRel::getObjId, bookings.getId()) |
| | | .eq(UserRel::getIsdeleted, MeetConstants.ZERO) |
| | | .isNotNull(SystemUser::getOpenid) |
| | | ); |
| | | List<String> openIdList = userRelList.stream().map(i->i.getOpenid()).collect(Collectors.toList()); |
| | | if(StringUtils.isNotBlank(openid)){ |
| | | openIdList.add(openid); |
| | | } |
| | | Set<String> openIds = new HashSet<String>(openIdList); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(openIds)){ |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | if(Constants.equalsInteger(sendType,Constants.ZERO)){ |
| | | wxPlatNotice.sendMeetingBookTemplateNotice(bookings,"CuoDoxOl6SFwi4NhNgOQgKSJVjDD4VCIaPYlnbv_zdY", |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(),openIds); |
| | | }else{ |
| | | |
| | | wxPlatNotice.sendMeetingBookCancelTemplateNotice(bookings,"CiB6vCT2InovAoQfudY-lvzLSV0-3lfz3a5GsSFCzd8", |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(),openIds); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Bookings> getMyJoinBookingMeet(Integer userId, Integer roomId, LocalDateTime startTime, LocalDateTime endTime) { |
| | | DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.wx.wxPlat.WxPlatNotice; |
| | | import com.doumee.dao.business.model.VisitReason; |
| | | import com.doumee.dao.business.model.Visits; |
| | | import com.doumee.dao.web.reqeust.CheckVisitedDTO; |
| | |
| | | import org.springframework.web.server.ServerWebExchange; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @LoginNoRequired |
| | | @ApiOperation(value = "testSendNotice", notes = "testSendNotice") |
| | | @GetMapping("/testSendNotice") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "openid", value = "openid", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "token", value = "token", required = true), |
| | | }) |
| | | public ApiResponse wxAuthorize(@RequestParam String openid,String token) { |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | List<String> idList = Arrays.asList(openid.split(",")); |
| | | wxPlatNotice.testSendNotice(idList,token); |
| | | return ApiResponse.success("æ¥è¯¢æå"); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢è¢«è®¿é®äººä¿¡æ¯", notes = "æ¥è¯¢è¢«è®¿é®äººä¿¡æ¯") |
| | | @PostMapping("/getVisitedMember") |
| | | public ApiResponse<List<MemberVO>> getVisitedMember(@Valid @RequestBody CheckVisitedDTO checkVisitedDTO) { |
| | |
| | | // 审æ¹é©³åç»ç³è¯·äººï¼ç³è¯·å·²è¢«é©³å |
| | | String visitReportAuditFail = "visitReportAuditFail"; |
| | | // ç»å®¡æ¹äººï¼ç³è¯·å¾
æ¨å®¡æ¹ |
| | | String visitReportWaitAudit = "visitReportAuditSuccess"; |
| | | String visitReportWaitAudit = "visitReportWaitAudit"; |
| | | } |
| | | |
| | | |
| | |
| | | // 审æ¹éè¿ç»ç³è¯·äººï¼ç³è¯·å·²å®¡æ ¸éè¿ |
| | | String platformBookAuditSuccess = "platformBookAuditSuccess"; |
| | | // 审æ¹é©³åç»ç³è¯·äººï¼ç³è¯·å·²è¢«é©³å |
| | | String platformBookAuditFail = "platformBookWaitAudit"; |
| | | String platformBookAuditFail = "platformBookAuditFail"; |
| | | // ç»å®¡æ¹äººï¼ç³è¯·å¾
æ¨å®¡æ¹ |
| | | String platformBookWaitAudit = "platformBookWaitAudit"; |
| | | } |
| | |
| | | String platformJobStopErr = "platformJobStopErr"; |
| | | // è¿è¾ä»»å¡ä¸è¾¾ ï¼ç»å¸æºï¼ |
| | | String platformJobNewJob = "platformJobNewJob"; |
| | | // è¿è¾ä»»å¡åæ¶ ï¼ç»å¸æºï¼ |
| | | String platformJobCancel = "platformJobCancel"; |
| | | } |
| | | |
| | | |
| | |
| | | package com.doumee.core.wx.wxPlat; |
| | | |
| | | import cn.emay.sdk.util.json.gson.JsonObject; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Http; |
| | | import com.doumee.core.utils.HttpsUtil; |
| | | import com.doumee.dao.business.VisitsMapper; |
| | | import com.doumee.dao.business.WxNoticeConfigMapper; |
| | | import com.doumee.dao.business.model.Visits; |
| | | import com.doumee.dao.business.model.WxNoticeConfig; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import me.chanjar.weixin.common.error.WxErrorException; |
| | |
| | | import me.chanjar.weixin.mp.bean.template.WxMpTemplateData; |
| | | import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 微信å
¬ä¼å·éç¥ |
| | |
| | | @Component |
| | | public class WxPlatNotice { |
| | | |
| | | /** |
| | | * 微信å
¬ä¼å·APIçService |
| | | */ |
| | | /* private final WxMpService wxMpService; |
| | | |
| | | public WxPlatNotice(WxMpService wxMpService) { |
| | | this.wxMpService = wxMpService; |
| | | }*/ |
| | | |
| | | |
| | | /** |
| | | * 访客ä¸å¡éç¥æ¥å£ |
| | | */ |
| | | public Boolean sendVisitAuditTemplateNotice(Visits visits,String prefix,String tempId){ |
| | | if(StringUtils.isBlank(visits.getOpenid())){ |
| | | return false; |
| | | public void testSendNotice(List<String> openIds,String token){ |
| | | if(CollectionUtils.isNotEmpty(openIds)){ |
| | | String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token; |
| | | //æ´ä½åæ°map |
| | | Map<String, Object> paramMap = new HashMap<String, Object>(); |
| | | //æ¶æ¯ä¸»é¢æ¾ç¤ºç¸å
³map |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | Map<String, Object> const9 = new HashMap<String,Object>(); |
| | | const9.put("value","ç³è¯·å¾
æ¨å®¡æ¹"); |
| | | Map<String, Object> thing1 = new HashMap<String,Object>(); |
| | | thing1.put("value", "æµè¯åç§°"); |
| | | Map<String, Object> car_number7 = new HashMap<String,Object>(); |
| | | car_number7.put("value","çAP12345"); |
| | | Map<String, Object> character_string6 = new HashMap<String,Object>(); |
| | | character_string6.put("value","1"); |
| | | Map<String, Object> thing4 = new HashMap<String,Object>(); |
| | | thing4.put("value","çç±"); |
| | | dataMap.put("const9",const9); |
| | | dataMap.put("thing1",thing1); |
| | | dataMap.put("car_number7",car_number7); |
| | | dataMap.put("character_string6",character_string6); |
| | | dataMap.put("thing4",thing4); |
| | | paramMap.put("data", dataMap); |
| | | for (String openId:openIds) { |
| | | paramMap.clear(); |
| | | paramMap.put("template_id", "SPwvgtASkm1aMDBsYhX2wHKdL2JBEGPknDkgniSza2Y"); |
| | | paramMap.put("touser", openId); |
| | | paramMap.put("data", dataMap); |
| | | String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap)); |
| | | if(StringUtils.isBlank(response)){ |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", "失败"); |
| | | }else{ |
| | | JSONObject json = JSONObject.parseObject(response); |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"æå":"失败"+json.getString("errmsg")); |
| | | } |
| | | WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder() |
| | | .toUser(visits.getOpenid()) |
| | | .templateId(tempId) |
| | | .url(prefix + visits.getId()) |
| | | .build(); |
| | | |
| | | |
| | | String thing1 = "å¾
审æ¹"; |
| | | if(visits.getStatus()==2){ |
| | | thing1 = "å®¡æ ¸éè¿"; |
| | | }else if(visits.getStatus()==3){ |
| | | thing1 = "å®¡æ ¸ä¸éè¿"; |
| | | }else if(visits.getStatus()==5){ |
| | | thing1 = "è®¾å¤æææå"; |
| | | }else if(visits.getStatus()==6){ |
| | | thing1 = "è®¾å¤æææªæå"; |
| | | } |
| | | // æ·»å æ¨¡æ¿æ°æ® |
| | | templateMessage.addData(new WxMpTemplateData("thing1", thing1)) |
| | | .addData(new WxMpTemplateData("thing2", visits.getName())) |
| | | .addData(new WxMpTemplateData("phone_number6", visits.getPhone())); |
| | | String msgId = null; |
| | | /* try { |
| | | // å鿍¡æ¿æ¶æ¯ |
| | | msgId = wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage); |
| | | } catch (WxErrorException e) { |
| | | e.printStackTrace(); |
| | | }*/ |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", msgId != null ? "æå" : "失败"); |
| | | return msgId != null; |
| | | // log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", msgId != null ? "æå" : "失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 访客ä¸å¡éç¥ |
| | | * 访客ç³è¯·/æ¥å¤ä¸å¡éç¥ |
| | | * @param wxNoticeConfigMapper |
| | | * @param visits |
| | | * @param objCode visitUpload,visitAuditSuccess,visitWaitAuditï¼visitWaitAudit,visitReportUploadï¼visitReportAuditSuccessï¼visitReportAuditFail, visitReportAuditSuccess |
| | | * @param openIds |
| | | */ |
| | | public void sendVisitTemplateNotice(WxNoticeConfigMapper wxNoticeConfigMapper,Visits visits,String objCode, String prefix, String tempId, List<String> openIds){ |
| | | public void sendVisitTemplateNotice(WxNoticeConfigMapper wxNoticeConfigMapper, Visits visits, String objCode, String token, List<String> openIds){ |
| | | try{ |
| | | if(CollectionUtils.isNotEmpty(openIds)){ |
| | | WxNoticeConfig wxNoticeConfig = wxNoticeConfigMapper.selectOne(new QueryWrapper<WxNoticeConfig>().lambda().eq(WxNoticeConfig::getObjType,WxPlatConstants.visit) |
| | | .eq(WxNoticeConfig::getObjCode,objCode) |
| | |
| | | if(Objects.isNull(wxNoticeConfig)){ |
| | | return; |
| | | } |
| | | WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder() |
| | | .toUser(visits.getOpenid()) |
| | | .templateId(tempId) |
| | | .url(prefix + visits.getId()) |
| | | .build(); |
| | | |
| | | templateMessage.addData(new WxMpTemplateData("thing1", visits.getName())) |
| | | .addData(new WxMpTemplateData("car_number7", StringUtils.isBlank(visits.getCarNos())?visits.getCarNos():"-")) |
| | | .addData(new WxMpTemplateData("character_string6", Constants.equalsInteger(visits.getMemberNum(),Constants.ZERO)?Constants.ONE+"":visits.getMemberNum().toString())) |
| | | .addData(new WxMpTemplateData("const9", wxNoticeConfig.getTitile())) |
| | | .addData(new WxMpTemplateData("thing4", visits.getReason())) |
| | | ; |
| | | String msgId = null; |
| | | /* try { |
| | | String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token; |
| | | //æ´ä½åæ°map |
| | | Map<String, Object> paramMap = new HashMap<String, Object>(); |
| | | //æ¶æ¯ä¸»é¢æ¾ç¤ºç¸å
³map |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | Map<String, Object> const9 = new HashMap<String,Object>(); |
| | | const9.put("value",wxNoticeConfig.getTitile()); |
| | | Map<String, Object> thing1 = new HashMap<String,Object>(); |
| | | thing1.put("value", visits.getName()); |
| | | Map<String, Object> car_number7 = new HashMap<String,Object>(); |
| | | car_number7.put("value",StringUtils.isNotBlank(visits.getCarNos())?visits.getCarNos():"-"); |
| | | Map<String, Object> character_string6 = new HashMap<String,Object>(); |
| | | character_string6.put("value","1"); |
| | | Map<String, Object> thing4 = new HashMap<String,Object>(); |
| | | thing4.put("value",visits.getReason()); |
| | | dataMap.put("const9",const9); |
| | | dataMap.put("thing1",thing1); |
| | | dataMap.put("car_number7",car_number7); |
| | | dataMap.put("character_string6",character_string6); |
| | | dataMap.put("thing4",thing4); |
| | | paramMap.put("data", dataMap); |
| | | for (String openId:openIds) { |
| | | templateMessage.setToUser(openId); |
| | | paramMap.clear(); |
| | | paramMap.put("template_id", wxNoticeConfig.getTempId()); |
| | | paramMap.put("touser", openId); |
| | | paramMap.put("data", dataMap); |
| | | String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap)); |
| | | if(StringUtils.isBlank(response)){ |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", "失败"); |
| | | }else{ |
| | | JSONObject json = JSONObject.parseObject(response); |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"æå":"失败"+json.getString("errmsg")); |
| | | } |
| | | // å鿍¡æ¿æ¶æ¯ |
| | | msgId = wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage); |
| | | } catch (WxErrorException e) { |
| | | e.printStackTrace(); |
| | | }*/ |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", msgId != null ? "æå" : "失败"); |
| | | } |
| | | // log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", msgId != null ? "æå" : "失败"); |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 鿣䏿¥ |
| | | * @param wxNoticeConfigMapper |
| | | * @param hiddenDanger |
| | | * @param objCode hiddenDangerUpload |
| | | * @param openIds |
| | | */ |
| | | public void sendHiddenDangerUploadTemplateNotice(WxNoticeConfigMapper wxNoticeConfigMapper, HiddenDanger hiddenDanger, String objCode,String token, List<String> openIds){ |
| | | try{ |
| | | if(CollectionUtils.isNotEmpty(openIds)){ |
| | | WxNoticeConfig wxNoticeConfig = wxNoticeConfigMapper.selectOne(new QueryWrapper<WxNoticeConfig>().lambda().eq(WxNoticeConfig::getObjType,WxPlatConstants.visit) |
| | | .eq(WxNoticeConfig::getObjCode,objCode) |
| | | .eq(WxNoticeConfig::getStatus, Constants.ZERO) |
| | | .last(" limit 1") |
| | | ); |
| | | if(Objects.isNull(wxNoticeConfig)){ |
| | | return; |
| | | } |
| | | String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token; |
| | | //æ´ä½åæ°map |
| | | Map<String, Object> paramMap = new HashMap<String, Object>(); |
| | | //æ¶æ¯ä¸»é¢æ¾ç¤ºç¸å
³map |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | //鿣åºå |
| | | Map<String, Object> thing9 = new HashMap<String,Object>(); |
| | | thing9.put("value",hiddenDanger.getAreaName()); |
| | | //鿣åç§° |
| | | Map<String, Object> thing1 = new HashMap<String,Object>(); |
| | | thing1.put("value", hiddenDanger.getCategoryName()); |
| | | //ææ¥äºº |
| | | Map<String, Object> thing12 = new HashMap<String,Object>(); |
| | | thing12.put("value",hiddenDanger.getMemberName()); |
| | | //ææ¥æ¶é´ |
| | | Map<String, Object> time11 = new HashMap<String,Object>(); |
| | | time11.put("value", DateUtil.getDate(hiddenDanger.getCreateDate(),"yyyyå¹´MMæddæ¥ HH:mm:ss") ); |
| | | dataMap.put("thing9",thing9); |
| | | dataMap.put("thing1",thing1); |
| | | dataMap.put("thing12",thing12); |
| | | dataMap.put("time11",time11); |
| | | paramMap.put("template_id", wxNoticeConfig.getTempId()); |
| | | paramMap.put("data", dataMap); |
| | | for (String openId:openIds) { |
| | | paramMap.clear(); |
| | | paramMap.put("touser", openId); |
| | | paramMap.put("data", dataMap); |
| | | String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap)); |
| | | if(StringUtils.isBlank(response)){ |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", "失败"); |
| | | }else{ |
| | | JSONObject json = JSONObject.parseObject(response); |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"æå":"失败"+json.getString("errmsg")); |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * éæ£æ´æ¹ |
| | | * @param wxNoticeConfigMapper |
| | | * @param hiddenDanger |
| | | * @param objCode hiddenDangerDeal |
| | | * @param openIds |
| | | */ |
| | | public void sendHiddenDangerDealTemplateNotice(WxNoticeConfigMapper wxNoticeConfigMapper, HiddenDanger hiddenDanger, String objCode,String token, List<String> openIds){ |
| | | try{ |
| | | if(CollectionUtils.isNotEmpty(openIds)){ |
| | | WxNoticeConfig wxNoticeConfig = wxNoticeConfigMapper.selectOne(new QueryWrapper<WxNoticeConfig>().lambda().eq(WxNoticeConfig::getObjType,WxPlatConstants.visit) |
| | | .eq(WxNoticeConfig::getObjCode,objCode) |
| | | .eq(WxNoticeConfig::getStatus, Constants.ZERO) |
| | | .last(" limit 1") |
| | | ); |
| | | if(Objects.isNull(wxNoticeConfig)){ |
| | | return; |
| | | } |
| | | String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token; |
| | | //æ´ä½åæ°map |
| | | Map<String, Object> paramMap = new HashMap<String, Object>(); |
| | | //æ¶æ¯ä¸»é¢æ¾ç¤ºç¸å
³map |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | //鿣åºå |
| | | Map<String, Object> thing17 = new HashMap<String,Object>(); |
| | | thing17.put("value",hiddenDanger.getAreaName()); |
| | | //鿣åç§° |
| | | Map<String, Object> thing3 = new HashMap<String,Object>(); |
| | | thing3.put("value", hiddenDanger.getCategoryName()); |
| | | //æ´æ¹æ¹å¼ |
| | | Map<String, Object> thing13 = new HashMap<String,Object>(); |
| | | thing13.put("value",Constants.equalsInteger(hiddenDanger.getStatus(),Constants.ONE)?"éæ£å·²æ´æ¹":"鿣已éå"); |
| | | //æäº¤äºº |
| | | Map<String, Object> thing10 = new HashMap<String,Object>(); |
| | | thing10.put("value",hiddenDanger.getCheckorName()); |
| | | //éç¥æ¶é´ |
| | | Map<String, Object> time16 = new HashMap<String,Object>(); |
| | | time16.put("value", DateUtil.getDate(hiddenDanger.getDealTime(),"yyyyå¹´MMæddæ¥ HH:mm:ss") ); |
| | | dataMap.put("thing17",thing17); |
| | | dataMap.put("thing3",thing3); |
| | | dataMap.put("thing13",thing13); |
| | | dataMap.put("thing10",thing10); |
| | | dataMap.put("time16",time16); |
| | | paramMap.put("template_id", wxNoticeConfig.getTempId()); |
| | | paramMap.put("data", dataMap); |
| | | for (String openId:openIds) { |
| | | paramMap.clear(); |
| | | paramMap.put("touser", openId); |
| | | paramMap.put("data", dataMap); |
| | | String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap)); |
| | | if(StringUtils.isBlank(response)){ |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", "失败"); |
| | | }else{ |
| | | JSONObject json = JSONObject.parseObject(response); |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"æå":"失败"+json.getString("errmsg")); |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * ç¨è½¦ç³è¯· å®¡æ¹æ
åµ |
| | | * @param wxNoticeConfigMapper |
| | | * @param carUseBook |
| | | * @param objCode reservationSuccessï¼meetingCancel,meetingBeginAï¼meetingEndA |
| | | * @param openIds |
| | | * @param sendType 0=ç³è¯·äººï¼1=审æ¹äºº |
| | | */ |
| | | public void sendCarUseBookTemplateNotice(WxNoticeConfigMapper wxNoticeConfigMapper, CarUseBook carUseBook, String objCode,String token, |
| | | List<String> openIds,Integer sendType){ |
| | | try { |
| | | if(CollectionUtils.isNotEmpty(openIds)){ |
| | | WxNoticeConfig wxNoticeConfig = wxNoticeConfigMapper.selectOne(new QueryWrapper<WxNoticeConfig>().lambda().eq(WxNoticeConfig::getObjType,WxPlatConstants.visit) |
| | | .eq(WxNoticeConfig::getObjCode,objCode) |
| | | .eq(WxNoticeConfig::getStatus, Constants.ZERO) |
| | | .last(" limit 1") |
| | | ); |
| | | if(Objects.isNull(wxNoticeConfig)){ |
| | | return; |
| | | } |
| | | String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token; |
| | | //æ´ä½åæ°map |
| | | Map<String, Object> paramMap = new HashMap<String, Object>(); |
| | | //æ¶æ¯ä¸»é¢æ¾ç¤ºç¸å
³map |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | //审æ¹è¿åº¦ |
| | | Map<String, Object> thing3 = new HashMap<String,Object>(); |
| | | if(Constants.equalsInteger(sendType,Constants.ONE)){ |
| | | thing3.put("value","ç³è¯·å¾
æ¨å®¡æ¹"); |
| | | }else{ |
| | | if(Constants.equalsInteger(carUseBook.getStatus(),Constants.ZERO)){ |
| | | thing3.put("value","ç³è¯·æäº¤æåå¾
å®¡æ ¸"); |
| | | }else if(Constants.equalsInteger(carUseBook.getStatus(),Constants.TWO)){ |
| | | thing3.put("value","ç³è¯·å·²å®¡æ ¸éè¿"); |
| | | }else{ |
| | | thing3.put("value","ç³è¯·å·²è¢«é©³å"); |
| | | } |
| | | } |
| | | //ç³è¯·äºº |
| | | Map<String, Object> thing1 = new HashMap<String,Object>(); |
| | | thing1.put("value", carUseBook.getMemberName()); |
| | | //车çå· |
| | | Map<String, Object> car_number2 = new HashMap<String,Object>(); |
| | | car_number2.put("value",carUseBook.getCarCode()); |
| | | //ç®çå° |
| | | Map<String, Object> thing11 = new HashMap<String,Object>(); |
| | | thing11.put("value",carUseBook.getAddr()); |
| | | //ç¨è½¦æ¶é´ |
| | | Map<String, Object> time14 = new HashMap<String,Object>(); |
| | | time14.put("value", carUseBook.getPlanUseDate()); |
| | | dataMap.put("thing3",thing3); |
| | | dataMap.put("car_number2",car_number2); |
| | | dataMap.put("thing1",thing1); |
| | | dataMap.put("thing11",thing11); |
| | | dataMap.put("time14",time14); |
| | | paramMap.put("template_id", wxNoticeConfig.getTempId()); |
| | | paramMap.put("data", dataMap); |
| | | for (String openId:openIds) { |
| | | paramMap.clear(); |
| | | paramMap.put("touser", openId); |
| | | paramMap.put("data", dataMap); |
| | | String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap)); |
| | | if(StringUtils.isBlank(response)){ |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", "失败"); |
| | | }else{ |
| | | JSONObject json = JSONObject.parseObject(response); |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"æå":"失败"+json.getString("errmsg")); |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 车è¾å
¥åç³è¯· ç©æµè½¦ |
| | | * @param wxNoticeConfigMapper |
| | | * @param platformBooks |
| | | * @param objCode platformBookUploadï¼platformBookAuditSuccess,platformBookAuditFailï¼platformBookWaitAudit |
| | | * @param token |
| | | * @param openIds |
| | | * @param sendType 0=ç³è¯·äººï¼1=审æ¹äºº |
| | | */ |
| | | public void sendPlatformBookTemplateNotice(WxNoticeConfigMapper wxNoticeConfigMapper, PlatformBooks platformBooks, String objCode,String token, |
| | | List<String> openIds,Integer sendType){ |
| | | try{ |
| | | if(CollectionUtils.isNotEmpty(openIds)){ |
| | | WxNoticeConfig wxNoticeConfig = wxNoticeConfigMapper.selectOne(new QueryWrapper<WxNoticeConfig>().lambda().eq(WxNoticeConfig::getObjType,WxPlatConstants.visit) |
| | | .eq(WxNoticeConfig::getObjCode,objCode) |
| | | .eq(WxNoticeConfig::getStatus, Constants.ZERO) |
| | | .last(" limit 1") |
| | | ); |
| | | if(Objects.isNull(wxNoticeConfig)){ |
| | | return; |
| | | } |
| | | String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token; |
| | | //æ´ä½åæ°map |
| | | Map<String, Object> paramMap = new HashMap<String, Object>(); |
| | | //æ¶æ¯ä¸»é¢æ¾ç¤ºç¸å
³map |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | //å®¡æ ¸ç¶æ |
| | | Map<String, Object> const9 = new HashMap<String,Object>(); |
| | | if(Constants.equalsInteger(sendType,Constants.ONE)){ |
| | | const9.put("value","ç³è¯·å¾
æ¨å®¡æ¹"); |
| | | }else{ |
| | | if(Constants.equalsInteger(platformBooks.getStatus(),Constants.ZERO)){ |
| | | const9.put("value","ç³è¯·æäº¤æåå¾
å®¡æ ¸"); |
| | | }else if(Constants.equalsInteger(platformBooks.getStatus(),Constants.TWO)){ |
| | | const9.put("value","ç³è¯·å·²å®¡æ ¸éè¿"); |
| | | }else{ |
| | | const9.put("value","ç³è¯·å·²è¢«é©³å"); |
| | | } |
| | | } |
| | | //车çå· |
| | | Map<String, Object> car_number3 = new HashMap<String,Object>(); |
| | | car_number3.put("value", platformBooks.getCarCodeFront()); |
| | | //ä¸å¡ç±»å |
| | | Map<String, Object> phrase4 = new HashMap<String,Object>(); |
| | | phrase4.put("value", platformBooks.getInReason()); |
| | | //ç³è¯·äºº |
| | | Map<String, Object> thing8 = new HashMap<String,Object>(); |
| | | thing8.put("value", platformBooks.getDriverName()); |
| | | //æ¶é´ |
| | | Map<String, Object> time4 = new HashMap<String,Object>(); |
| | | time4.put("value", DateUtil.getDate(platformBooks.getArriveDate(),"yyyyå¹´MMæddæ¥ HH:mm:ss") ); |
| | | dataMap.put("const9",const9); |
| | | dataMap.put("car_number3",car_number3); |
| | | dataMap.put("phrase4",phrase4); |
| | | dataMap.put("thing8",thing8); |
| | | dataMap.put("time4",time4); |
| | | paramMap.put("data", dataMap); |
| | | for (String openId:openIds) { |
| | | paramMap.clear(); |
| | | paramMap.put("template_id", wxNoticeConfig.getTempId()); |
| | | paramMap.put("touser", openId); |
| | | paramMap.put("data", dataMap); |
| | | String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap)); |
| | | if(StringUtils.isBlank(response)){ |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", "失败"); |
| | | }else{ |
| | | JSONObject json = JSONObject.parseObject(response); |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"æå":"失败"+json.getString("errmsg")); |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Wms ä»»å¡ä¸è¾¾éç¥ |
| | | * @param wxNoticeConfigMapper |
| | | * @param platformJob |
| | | * @param objCode platformJobNewJob |
| | | * @param openIds |
| | | */ |
| | | public void sendWmsTemplateNotice(WxNoticeConfigMapper wxNoticeConfigMapper, PlatformJob platformJob, String objCode,String token, |
| | | List<String> openIds){ |
| | | try{ |
| | | if(CollectionUtils.isNotEmpty(openIds)){ |
| | | WxNoticeConfig wxNoticeConfig = wxNoticeConfigMapper.selectOne(new QueryWrapper<WxNoticeConfig>().lambda().eq(WxNoticeConfig::getObjType,WxPlatConstants.visit) |
| | | .eq(WxNoticeConfig::getObjCode,objCode) |
| | | .eq(WxNoticeConfig::getStatus, Constants.ZERO) |
| | | .last(" limit 1") |
| | | ); |
| | | if(Objects.isNull(wxNoticeConfig)){ |
| | | return; |
| | | } |
| | | String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token; |
| | | //æ´ä½åæ°map |
| | | Map<String, Object> paramMap = new HashMap<String, Object>(); |
| | | //æ¶æ¯ä¸»é¢æ¾ç¤ºç¸å
³map |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | //è¿åç¼å· |
| | | Map<String, Object> character_string1 = new HashMap<String,Object>(); |
| | | character_string1.put("value",platformJob.getBillCode()); |
| | | //叿º |
| | | Map<String, Object> thing3 = new HashMap<String,Object>(); |
| | | thing3.put("value", platformJob.getDriverName()); |
| | | //ä¸è¾¾æ¶é´ |
| | | Map<String, Object> time4 = new HashMap<String,Object>(); |
| | | time4.put("value", DateUtil.getDate(platformJob.getCreateDate(),"yyyyå¹´MMæddæ¥ HH:mm:ss") ); |
| | | dataMap.put("character_string1",character_string1); |
| | | dataMap.put("thing3",thing3); |
| | | dataMap.put("time4",time4); |
| | | paramMap.put("data", dataMap); |
| | | for (String openId:openIds) { |
| | | paramMap.clear(); |
| | | paramMap.put("template_id", wxNoticeConfig.getTempId()); |
| | | paramMap.put("touser", openId); |
| | | paramMap.put("data", dataMap); |
| | | String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap)); |
| | | if(StringUtils.isBlank(response)){ |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", "失败"); |
| | | }else{ |
| | | JSONObject json = JSONObject.parseObject(response); |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"æå":"失败"+json.getString("errmsg")); |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * Wms ä»»å¡åæ¶éç¥ |
| | | * @param wxNoticeConfigMapper |
| | | * @param platformJob |
| | | * @param objCode platformJobNewJob |
| | | * @param openIds |
| | | */ |
| | | public void sendWmsCancelTemplateNotice(WxNoticeConfigMapper wxNoticeConfigMapper, PlatformJob platformJob, String objCode,String token, |
| | | List<String> openIds){ |
| | | try{ |
| | | if(CollectionUtils.isNotEmpty(openIds)){ |
| | | WxNoticeConfig wxNoticeConfig = wxNoticeConfigMapper.selectOne(new QueryWrapper<WxNoticeConfig>().lambda().eq(WxNoticeConfig::getObjType,WxPlatConstants.visit) |
| | | .eq(WxNoticeConfig::getObjCode,objCode) |
| | | .eq(WxNoticeConfig::getStatus, Constants.ZERO) |
| | | .last(" limit 1") |
| | | ); |
| | | if(Objects.isNull(wxNoticeConfig)){ |
| | | return; |
| | | } |
| | | String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token; |
| | | //æ´ä½åæ°map |
| | | Map<String, Object> paramMap = new HashMap<String, Object>(); |
| | | //æ¶æ¯ä¸»é¢æ¾ç¤ºç¸å
³map |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | //ä»»å¡åå· |
| | | Map<String, Object> character_string1 = new HashMap<String,Object>(); |
| | | character_string1.put("value",platformJob.getBillCode()); |
| | | //åæ¶æ¶é´ |
| | | Map<String, Object> time6 = new HashMap<String,Object>(); |
| | | time6.put("value", DateUtil.getDate(new Date(),"yyyyå¹´MMæddæ¥ HH:mm:ss") ); |
| | | dataMap.put("character_string1",character_string1); |
| | | dataMap.put("time6",time6); |
| | | paramMap.put("data", dataMap); |
| | | for (String openId:openIds) { |
| | | paramMap.clear(); |
| | | paramMap.put("template_id", wxNoticeConfig.getTempId()); |
| | | paramMap.put("touser", openId); |
| | | paramMap.put("data", dataMap); |
| | | String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap)); |
| | | if(StringUtils.isBlank(response)){ |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", "失败"); |
| | | }else{ |
| | | JSONObject json = JSONObject.parseObject(response); |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"æå":"失败"+json.getString("errmsg")); |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æå°ä½ä¸ |
| | | * @param wxNoticeConfigMapper |
| | | * @param platformJob |
| | | * @param objCode platformJobCallInï¼platformJobSingIn,platformJobOverNumï¼platformJobWorking,platformJobFinishï¼platformJobLevelPower,platformJobMoveï¼platformJobErrorï¼platformJobTimeOut,platformJobStopErr |
| | | * @param token |
| | | * @param openIds |
| | | */ |
| | | public void sendPlatformJobTemplateNotice(WxNoticeConfigMapper wxNoticeConfigMapper, PlatformJob platformJob, String objCode,String token, |
| | | List<String> openIds){ |
| | | try{ |
| | | if(CollectionUtils.isNotEmpty(openIds)){ |
| | | WxNoticeConfig wxNoticeConfig = wxNoticeConfigMapper.selectOne(new QueryWrapper<WxNoticeConfig>().lambda().eq(WxNoticeConfig::getObjType,WxPlatConstants.visit) |
| | | .eq(WxNoticeConfig::getObjCode,objCode) |
| | | .eq(WxNoticeConfig::getStatus, Constants.ZERO) |
| | | .last(" limit 1") |
| | | ); |
| | | if(Objects.isNull(wxNoticeConfig)){ |
| | | return; |
| | | } |
| | | String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token; |
| | | //æ´ä½åæ°map |
| | | Map<String, Object> paramMap = new HashMap<String, Object>(); |
| | | //æ¶æ¯ä¸»é¢æ¾ç¤ºç¸å
³map |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | //æå°éç¥ |
| | | Map<String, Object> const6 = new HashMap<String,Object>(); |
| | | const6.put("value",wxNoticeConfig.getTitile()); |
| | | //车çå· |
| | | Map<String, Object> character_string1 = new HashMap<String,Object>(); |
| | | character_string1.put("value",platformJob.getCarCodeFront()); |
| | | //æå°å· |
| | | Map<String, Object> thing3 = new HashMap<String,Object>(); |
| | | thing3.put("value", platformJob.getPlatformName()); |
| | | //æ¶é´ |
| | | Map<String, Object> time4 = new HashMap<String,Object>(); |
| | | time4.put("value", DateUtil.getDate(new Date(),"yyyyå¹´MMæddæ¥ HH:mm:ss") ); |
| | | dataMap.put("const6",const6); |
| | | dataMap.put("character_string1",character_string1); |
| | | dataMap.put("thing3",thing3); |
| | | dataMap.put("time4",time4); |
| | | paramMap.put("data", dataMap); |
| | | for (String openId:openIds) { |
| | | paramMap.clear(); |
| | | paramMap.put("template_id", wxNoticeConfig.getTempId()); |
| | | paramMap.put("touser", openId); |
| | | paramMap.put("data", dataMap); |
| | | String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap)); |
| | | if(StringUtils.isBlank(response)){ |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", "失败"); |
| | | }else{ |
| | | JSONObject json = JSONObject.parseObject(response); |
| | | log.warn("·==++--·æ¨é微信模æ¿ä¿¡æ¯ï¼{}·--++==·", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"æå":"失败"+json.getString("errmsg")); |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.SmsConstants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.core.wx.wxPlat.WxPlatConstants; |
| | | import com.doumee.core.wx.wxPlat.WxPlatNotice; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dao.CompanyMapper; |
| | | import com.doumee.dao.business.dao.SmsConfigMapper; |
| | |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Autowired |
| | | private WxNoticeConfigMapper wxNoticeConfigMapper; |
| | | |
| | | @Autowired |
| | | private ApproveTemplMapper approveTemplMapper; |
| | |
| | | approveList.add(createUserApprove); |
| | | |
| | | //æ¥è¯¢ææå¾
å¤ç人 |
| | | |
| | | String token = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(); |
| | | //审æ¹ä¸å¡æ°æ® |
| | | for (int i = 0; i < approveParamList.size(); i++) { |
| | | ApproveParam approveParam = approveParamList.get(i); |
| | |
| | | approve.setType(Constants.ZERO); |
| | | approveList.add(approve); |
| | | |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | if(Constants.equalsInteger(approve.getStatus(),Constants.ONE) && StringUtils.isNotBlank(member.getPhone())){ |
| | | //åéçä¿¡éç¥ |
| | | if(Constants.equalsInteger(noticeType,Constants.noticesObjectType.reason)){ |
| | |
| | | SmsConstants.platformBookContent.platformBookWaitAudit, |
| | | null,Arrays.asList(member.getPhone().split(",")) |
| | | ); |
| | | //å
¬ä¼å·éç¥ |
| | | if(StringUtils.isNotBlank(member.getOpenid())){ |
| | | wxPlatNotice.sendPlatformBookTemplateNotice( |
| | | wxNoticeConfigMapper, |
| | | platformBooksMapper.selectById(businessId), |
| | | WxPlatConstants.platformBookContent.platformBookWaitAudit, |
| | | token, |
| | | Arrays.asList(member.getOpenid().split(",")), |
| | | Constants.ONE); |
| | | } |
| | | }else if(Constants.equalsInteger(noticeType,Constants.noticesObjectType.visit)){ |
| | | //访客ç³è¯· |
| | | //çä¿¡éç¥ |
| | | SmsEmailServiceImpl.sendVisitSms(systemDictDataBiz, |
| | | emayService,smsEmailMapper,smsConfigMapper,visitsMapper,businessId, |
| | | SmsConstants.visitContent.visitNotice, |
| | | null,Arrays.asList(member.getPhone().split(",")) |
| | | ); |
| | | //å
¬ä¼å·éç¥ |
| | | if(StringUtils.isNotBlank(member.getOpenid())){ |
| | | wxPlatNotice.sendVisitTemplateNotice( |
| | | wxNoticeConfigMapper,visitsMapper.selectById(businessId), WxPlatConstants.visitContent.visitWaitAudit, |
| | | token, |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | }else if(Constants.equalsInteger(noticeType,Constants.noticesObjectType.visitReporting)){ |
| | | //访客æ¥å¤ |
| | | SmsEmailServiceImpl.sendVisitReportSms(systemDictDataBiz, |
| | |
| | | SmsConstants.visitReportingContent.visitReportingNotice, |
| | | null,Arrays.asList(member.getPhone().split(",")) |
| | | ); |
| | | //å
¬ä¼å·éç¥ |
| | | if(StringUtils.isNotBlank(member.getOpenid())){ |
| | | wxPlatNotice.sendVisitTemplateNotice( |
| | | wxNoticeConfigMapper,visitsMapper.selectById(businessId), WxPlatConstants.visitReportContent.visitReportWaitAudit, |
| | | token, |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | }else if(Constants.equalsInteger(noticeType,Constants.noticesObjectType.useCar)){ |
| | | //ç¨è½¦ç³è¯· |
| | | SmsEmailServiceImpl.sendCarUseSms(systemDictDataBiz, |
| | |
| | | SmsConstants.carUseBookContent.carUseBookWaitAudit, |
| | | null,Arrays.asList(member.getPhone().split(",")) |
| | | ); |
| | | //å
¬ä¼å·éç¥ |
| | | if(StringUtils.isNotBlank(member.getOpenid())){ |
| | | wxPlatNotice.sendCarUseBookTemplateNotice( |
| | | wxNoticeConfigMapper, |
| | | carUseBookMapper.selectById(businessId), |
| | | WxPlatConstants.carUseBookContent.carUseBookWaitAudit, |
| | | token, |
| | | Arrays.asList(member.getOpenid().split(",")), |
| | | Constants.ONE); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | public void dealBusinessData(ApproveDTO approveDTO,Approve approve){ |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | if(approveDTO.getObjType().equals(Constants.approveObjectType.unConstructionVisit) |
| | | ||approveDTO.getObjType().equals(Constants.approveObjectType.constructionVisit) |
| | | ||approveDTO.getObjType().equals(Constants.approveObjectType.visitReporting)){ |
| | |
| | | } |
| | | } |
| | | //访客æ¥å¤ |
| | | String objCode = ""; |
| | | if(approveDTO.getObjType().equals(Constants.approveObjectType.visitReporting)){ |
| | | //åéçä¿¡éç¥ |
| | | SmsEmailServiceImpl.sendVisitReportSms(systemDictDataBiz, |
| | |
| | | SmsConstants.visitReportingContent.visitReportingAuditFail, |
| | | approveDTO.getCheckInfo(),null |
| | | ); |
| | | objCode = Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)? WxPlatConstants.visitReportContent.visitReportAuditSuccess:WxPlatConstants.visitReportContent.visitReportAuditFail; |
| | | |
| | | |
| | | }else{ //访客ç³è¯· |
| | | //åéçä¿¡éç¥ |
| | | SmsEmailServiceImpl.sendVisitSms(systemDictDataBiz, |
| | |
| | | SmsConstants.visitContent.visitAuditFail, |
| | | approveDTO.getCheckInfo(),null |
| | | ); |
| | | objCode = Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)? WxPlatConstants.visitContent.visitAuditSuccess:WxPlatConstants.visitContent.visitAuditFail; |
| | | } |
| | | visitsMapper.updateById(visits); |
| | | //åé微信å
¬ä¼å· |
| | | if(StringUtils.isNotBlank(objCode)){ |
| | | Member member = memberMapper.selectById(visits.getCreateMemberId()); |
| | | if(Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())){ |
| | | wxPlatNotice.sendVisitTemplateNotice( |
| | | wxNoticeConfigMapper,visits, objCode, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | visitsMapper.updateById(visits); |
| | | }else if(approveDTO.getObjType().equals(Constants.approveObjectType.cityUseCar)||approveDTO.getObjType().equals( |
| | | Constants.approveObjectType.unCityUseCar)){ |
| | | this.updDriver(approveDTO,approve,true); |
| | | CarUseBook carUseBook = carUseBookJoinMapper.selectById(approveDTO.getObjId()); |
| | | if(Objects.nonNull(carUseBook)){ |
| | | Member member = memberMapper.selectById(carUseBook.getMemberId()); |
| | | //åééç¥çæ¯ |
| | | if(Objects.nonNull(member)&&StringUtils.isNotBlank(member.getPhone())){ |
| | | SmsEmailServiceImpl.sendCarUseSms(systemDictDataBiz, |
| | | emayService,smsEmailMapper,smsConfigMapper,carUseBookMapper,approveDTO.getObjId(), |
| | |
| | | SmsConstants.carUseBookContent.carUseBookAuditFail, |
| | | approveDTO.getCheckInfo(),Arrays.asList(member.getPhone().split(",")) |
| | | ); |
| | | } |
| | | if(StringUtils.isNotBlank(member.getOpenid())){ |
| | | //åé微信å
¬ä¼å·éç¥ |
| | | wxPlatNotice.sendCarUseBookTemplateNotice( |
| | | wxNoticeConfigMapper,carUseBook, |
| | | Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)?WxPlatConstants.carUseBookContent.carUseBookAuditSuccess: WxPlatConstants.carUseBookContent.carUseBookAuditFail, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")),0); |
| | | } |
| | | } |
| | | |
| | |
| | | approveDTO.getCheckInfo(),null |
| | | ); |
| | | |
| | | //TODO åé微信å
¬ä¼å·æ¶æ¯ |
| | | //åé微信å
¬ä¼å·æ¶æ¯ |
| | | Member member = memberMapper.selectById(platformBooks.getDriverId() ); |
| | | if(Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())){ |
| | | //åé微信å
¬ä¼å·éç¥ |
| | | wxPlatNotice.sendPlatformBookTemplateNotice( |
| | | wxNoticeConfigMapper,platformBooks, |
| | | Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)?WxPlatConstants.platformBookContent.platformBookAuditSuccess: WxPlatConstants.platformBookContent.platformBookAuditFail, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")),0); |
| | | } |
| | | |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.*; |
| | | import com.doumee.core.wx.wxPlat.WxPlatConstants; |
| | | import com.doumee.core.wx.wxPlat.WxPlatNotice; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dao.SmsConfigMapper; |
| | | import com.doumee.dao.business.dao.SmsEmailMapper; |
| | |
| | | import com.doumee.dao.business.vo.ApproveDataVO; |
| | | import com.doumee.dao.business.vo.DateIntervalVO; |
| | | |
| | | import com.doumee.dao.system.join.NoticesJoinMapper; |
| | | import com.doumee.dao.system.model.Notices; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.doumee.service.business.ApproveService; |
| | | import com.doumee.service.business.CarUseBookService; |
| | |
| | | private ApproveJoinMapper approveJoinMapper; |
| | | |
| | | @Autowired |
| | | private NoticesJoinMapper noticesJoinMapper; |
| | | |
| | | @Autowired |
| | | private ApproveService approveService; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | private EmayService emayService; |
| | | |
| | | @Autowired |
| | | private WxNoticeConfigMapper wxNoticeConfigMapper; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | |
| | | carUseBookMapper.insert(carUseBook); |
| | | //ç¨è½¦ç³è¯· 审æ¹è®°å½å建 |
| | | approveService.createApproveFlow(carUseBook.getType()==0?3:4,carUseBook.getId(),carUseBook.getMemberId()); |
| | | //åé微信å
¬ä¼å·éç¥ |
| | | //åé微信å
¬ä¼å·éç¥ |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | Member member = memberMapper.selectById(carUseBook.getMemberId()); |
| | | if(Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())){ |
| | | wxPlatNotice.sendCarUseBookTemplateNotice( |
| | | wxNoticeConfigMapper,carUseBook, |
| | | WxPlatConstants.carUseBookContent.carUseBookUpload, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")),0); |
| | | } |
| | | |
| | | return carUseBook.getId(); |
| | | } |
| | | |
| | |
| | | .in(Approve::getObjType,Constants.approveObjectType.cityUseCar,Constants.approveObjectType.unCityUseCar) |
| | | .eq(Approve::getObjId,id) |
| | | ); |
| | | |
| | | //å¤çå¾
åä¿¡æ¯ |
| | | noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda() |
| | | .set(Notices::getStatus,Constants.ONE) |
| | | .eq(Notices::getType,Constants.TWO) |
| | | .eq(Notices::getObjId,carUseBook.getId()) |
| | | ); |
| | | |
| | | |
| | | Member member = memberMapper.selectById(carUseBook.getMemberId()); |
| | | if(Objects.nonNull(member)&&StringUtils.isNotBlank(member.getPhone())){ |
| | | //ç¨è½¦ç³è¯·åæ¶ |
| | |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.SmsConstants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.core.wx.wxPlat.WxPlatConstants; |
| | | import com.doumee.core.wx.wxPlat.WxPlatNotice; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dao.SmsConfigMapper; |
| | | import com.doumee.dao.business.dao.SmsEmailMapper; |
| | |
| | | @Autowired |
| | | private EmayService emayService; |
| | | |
| | | @Autowired |
| | | private WxNoticeConfigMapper wxNoticeConfigMapper; |
| | | |
| | | |
| | | @Override |
| | | public Integer create(HiddenDanger hiddenDanger) { |
| | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | hiddenDanger.setMemberId(hiddenDanger.getLoginUserInfo().getMemberId()); |
| | | Member createMember = memberMapper.selectById(hiddenDanger.getMemberId()); |
| | | if(Objects.isNull(createMember)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°å建人信æ¯"); |
| | | } |
| | | hiddenDanger.setIsdeleted(Constants.ZERO); |
| | | hiddenDanger.setCreateDate(new Date()); |
| | | hiddenDanger.setEditDate(new Date()); |
| | |
| | | noticesJoinMapper.insert(notices); |
| | | |
| | | |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | if(Objects.nonNull(member) && StringUtils.isNotBlank(member.getPhone())){ |
| | | //åéçä¿¡éç¥ |
| | | SmsEmailServiceImpl.sendHiddenDangerSms(systemDictDataBiz, |
| | |
| | | ); |
| | | } |
| | | |
| | | |
| | | //æäº¤äººç微信å
¬ä¼å·éç¥ |
| | | if(Objects.nonNull(createMember)&&StringUtils.isNotBlank(createMember.getOpenid())){ |
| | | wxPlatNotice.sendHiddenDangerUploadTemplateNotice( |
| | | wxNoticeConfigMapper,hiddenDanger, |
| | | WxPlatConstants.hiddenDangerContent.hiddenDangerUpload, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(createMember.getOpenid().split(","))); |
| | | } |
| | | //å¤ç人ç微信å
¬ä¼å·éç¥ |
| | | if(Objects.nonNull(member)&&StringUtils.isNotBlank(member.getOpenid())){ |
| | | wxPlatNotice.sendHiddenDangerUploadTemplateNotice( |
| | | wxNoticeConfigMapper,hiddenDanger, |
| | | WxPlatConstants.hiddenDangerContent.hiddenDangerUpload, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(","))); |
| | | } |
| | | |
| | | return hiddenDanger.getId(); |
| | | } |
| | |
| | | .leftJoin(Member.class,Member::getId,HiddenDanger::getCheckUserId) |
| | | .leftJoin(HiddenDangerParam.class,HiddenDangerParam::getId,HiddenDanger::getCateId) |
| | | .leftJoin("company t4 on t1.company_id=t4.id") |
| | | .leftJoin("company t5 on t3.company_id=t5.id"); |
| | | .leftJoin("company t5 on t2.company_id=t5.id"); |
| | | queryWrapper |
| | | .eq(HiddenDanger::getId, id).last("limit 1"); |
| | | |
| | |
| | | .leftJoin(Member.class,Member::getId,HiddenDanger::getCheckUserId) |
| | | .leftJoin(HiddenDangerParam.class,HiddenDangerParam::getId,HiddenDanger::getCateId) |
| | | .leftJoin("company t4 on t1.company_id=t4.id") |
| | | .leftJoin("company t5 on t3.company_id=t5.id"); |
| | | .leftJoin("company t5 on t2.company_id=t5.id"); |
| | | |
| | | //æ°æ®æéå¼å§--------------------start---------------- |
| | | LoginUserInfo userInfo =pageWrap.getModel().getLoginUserInfo(); |
| | |
| | | Arrays.asList(member.getPhone().split(",")) |
| | | ); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | Member createMember = memberMapper.selectById(hiddenDanger.getMemberId()); |
| | | //å¤ç人ç微信å
¬ä¼å·éç¥ |
| | | if(Objects.nonNull(createMember)&&StringUtils.isNotBlank(createMember.getOpenid())){ |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendHiddenDangerDealTemplateNotice( |
| | | wxNoticeConfigMapper,hiddenDanger, |
| | | WxPlatConstants.hiddenDangerContent.hiddenDangerDeal, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(createMember.getOpenid().split(","))); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | Arrays.asList(member.getPhone().split(",")) |
| | | ); |
| | | } |
| | | |
| | | //å¤ç人ç微信å
¬ä¼å·éç¥ |
| | | if(Objects.nonNull(member)&&StringUtils.isNotBlank(member.getOpenid())){ |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendHiddenDangerUploadTemplateNotice( |
| | | wxNoticeConfigMapper,hiddenDanger, |
| | | WxPlatConstants.hiddenDangerContent.hiddenDangerUpload, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(","))); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | String appSecret = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_SECRET).getCode(); |
| | | String getTokenUrl = WXConstant.GET_USER_INFO_URL.replace("CODE", code) |
| | | .replace("APPID", appId).replace("SECRET", appSecret); |
| | | // JSONObject tokenJson = JSONObject.parseObject(HttpsUtil.get(getTokenUrl,true)); |
| | | String openId = code; |
| | | // if(!Objects.isNull(tokenJson.get("access_token"))){ |
| | | // openId = tokenJson.getString("openid"); |
| | | // } |
| | | // String openId = "12345"; |
| | | JSONObject tokenJson = JSONObject.parseObject(HttpsUtil.get(getTokenUrl,true)); |
| | | String openId = ""; |
| | | if(!Objects.isNull(tokenJson.get("access_token"))){ |
| | | openId = tokenJson.getString("openid"); |
| | | } |
| | | WxAuthorizeVO wxAuthorizeVO = new WxAuthorizeVO(); |
| | | wxAuthorizeVO.setOpenid(openId); |
| | | if(source==1){ |
| | |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.SmsConstants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.core.wx.wxPlat.WxPlatConstants; |
| | | import com.doumee.core.wx.wxPlat.WxPlatNotice; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dao.SmsConfigMapper; |
| | | import com.doumee.dao.business.dao.SmsEmailMapper; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | |
| | | @Autowired |
| | | private EmayService emayService; |
| | | |
| | | @Autowired |
| | | private WxNoticeConfigMapper wxNoticeConfigMapper; |
| | | |
| | | @Override |
| | | public Integer create(PlatformBooks platformBooks) { |
| | |
| | | |
| | | //åå»ºå®¡æ¹æµä¿¡æ¯ |
| | | approveService.createApproveForPlatfrom(approveTempl.getId(),platformBooks.getId(),platformBooks.getDriverId()); |
| | | //åéå
¬ä¼å·éç¥ ç»æäº¤äºº |
| | | Member member = memberMapper.selectById(platformBooks.getDriverId()); |
| | | if(Objects.nonNull(member)&&StringUtils.isNotBlank(member.getOpenid())){ |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendPlatformBookTemplateNotice( |
| | | wxNoticeConfigMapper,platformBooks, |
| | | WxPlatConstants.platformBookContent.platformBookUpload, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")),0); |
| | | } |
| | | |
| | | return platformBooks.getId(); |
| | | } |
| | | |
| | |
| | | import com.doumee.core.tms.model.response.TmsBaseResponse; |
| | | import com.doumee.core.tms.model.response.TmsLockStatusQueryResponse; |
| | | import com.doumee.core.utils.*; |
| | | import com.doumee.core.wx.wxPlat.WxPlatConstants; |
| | | import com.doumee.core.wx.wxPlat.WxPlatNotice; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dao.SmsConfigMapper; |
| | | import com.doumee.dao.business.dao.SmsEmailMapper; |
| | |
| | | private PlatformBroadcastLogMapper platformBroadcastLogMapper; |
| | | @Autowired |
| | | private PlatformWarnEventServiceImpl platformWarnEventService; |
| | | @Autowired |
| | | private MemberMapper memberMapper; |
| | | @Autowired |
| | | private WxNoticeConfigMapper wxNoticeConfigMapper; |
| | | |
| | | @Override |
| | | public Integer create(PlatformJob platformJob) { |
| | |
| | | SmsConstants.platformJobContent.platformJobCallIn,null,null |
| | | ); |
| | | |
| | | //å
¬ä¼å·æ¨¡æ¿æ¶æ¯ |
| | | if(Objects.nonNull(platformJob.getDriverId())) { |
| | | Member member = memberMapper.selectById(platformJob.getDriverId()); |
| | | if (Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())) { |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendPlatformJobTemplateNotice( |
| | | wxNoticeConfigMapper, platformJob, |
| | | WxPlatConstants.platformJobContent.platformJobCallIn, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | return platformJob; |
| | | } |
| | | |
| | |
| | | SmsConstants.platformJobContent.platformJobSingIn,platform.getName(),null |
| | | ); |
| | | |
| | | //å
¬ä¼å·æ¨¡æ¿æ¶æ¯ |
| | | if(Objects.nonNull(platformJob.getDriverId())){ |
| | | Member member = memberMapper.selectById(platformJob.getDriverId()); |
| | | if(Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())){ |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendPlatformJobTemplateNotice( |
| | | wxNoticeConfigMapper,platformJob, |
| | | WxPlatConstants.platformJobContent.platformJobSingIn, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | |
| | | //广æ ledéç¥ |
| | | platformJob.setPlatformName(platform.getName()); |
| | | this.broadcastAndLEed(platformJob,Constants.PlatformLedContent.CALLING.getInfo(), |
| | |
| | | SmsConstants.platformJobContent.platformJobMove,oldPlatform.getName(),platform.getName() |
| | | ); |
| | | |
| | | //å
¬ä¼å·æ¨¡æ¿æ¶æ¯ |
| | | if(Objects.nonNull(platformJob.getDriverId())) { |
| | | Member member = memberMapper.selectById(platformJob.getDriverId()); |
| | | if (Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())) { |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendPlatformJobTemplateNotice( |
| | | wxNoticeConfigMapper, platformJob, |
| | | WxPlatConstants.platformJobContent.platformJobMove, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | platformJob.setPlatformName(oldPlatform.getName()); |
| | | platformJob.setPlatformId(oldPlatform.getId()); |
| | | this.broadcastAndLEed(platformJob, StringUtils.isBlank(oldPlatform.getLedContent())?Constants.PlatformLedContent.IDEL_CONTNET.getName():oldPlatform.getLedContent(), |
| | |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobOverNum,null,null |
| | | ); |
| | | |
| | | //å
¬ä¼å·æ¨¡æ¿æ¶æ¯ |
| | | if(Objects.nonNull(platformJob.getDriverId())){ |
| | | Member member = memberMapper.selectById(platformJob.getDriverId()); |
| | | if(Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())){ |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendPlatformJobTemplateNotice( |
| | | wxNoticeConfigMapper,platformJob, |
| | | WxPlatConstants.platformJobContent.platformJobOverNum, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | platformJob.setPlatformName(platform.getName()); |
| | | this.broadcastAndLEed(platformJob, StringUtils.isBlank(platform.getLedContent())?Constants.PlatformLedContent.IDEL_CONTNET.getName():platform.getLedContent(), |
| | | null |
| | |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobError,platform.getName(),null |
| | | ); |
| | | |
| | | //å
¬ä¼å·æ¨¡æ¿æ¶æ¯ |
| | | if(Objects.nonNull(platformJob.getDriverId())) { |
| | | Member member = memberMapper.selectById(platformJob.getDriverId()); |
| | | if (Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())) { |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendPlatformJobTemplateNotice( |
| | | wxNoticeConfigMapper, platformJob, |
| | | WxPlatConstants.platformJobContent.platformJobError, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | platformJob.setPlatformName(platform.getName()); |
| | | this.broadcastAndLEed(platformJob, StringUtils.isBlank(platform.getLedContent())?Constants.PlatformLedContent.IDEL_CONTNET.getName():platform.getLedContent(), |
| | |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobWorking,platform.getName(),null |
| | | ); |
| | | |
| | | //å
¬ä¼å·æ¨¡æ¿æ¶æ¯ |
| | | if(Objects.nonNull(platformJob.getDriverId())) { |
| | | Member member = memberMapper.selectById(platformJob.getDriverId()); |
| | | if (Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())) { |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendPlatformJobTemplateNotice( |
| | | wxNoticeConfigMapper, platformJob, |
| | | WxPlatConstants.platformJobContent.platformJobWorking, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | } |
| | | //广æ ledéç¥ |
| | | platformJob.setPlatformName(platform.getName()); |
| | | this.broadcastAndLEed(platformJob,Constants.PlatformLedContent.WORKING.getInfo(), |
| | |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobFinish,platform.getName(),null |
| | | ); |
| | | |
| | | //å
¬ä¼å·æ¨¡æ¿æ¶æ¯ |
| | | if(Objects.nonNull(platformJob.getDriverId())) { |
| | | Member member = memberMapper.selectById(platformJob.getDriverId()); |
| | | if (Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())) { |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendPlatformJobTemplateNotice( |
| | | wxNoticeConfigMapper, platformJob, |
| | | WxPlatConstants.platformJobContent.platformJobFinish, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | //广æ ledéç¥ |
| | | platformJob.setPlatformName(platform.getName()); |
| | | this.broadcastAndLEed(platformJob,Constants.PlatformLedContent.DONE.getInfo(), |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.*; |
| | | import com.doumee.core.wx.WXConstant; |
| | | import com.doumee.core.wx.wxPlat.WxPlatConstants; |
| | | import com.doumee.core.wx.wxPlat.WxPlatNotice; |
| | | import com.doumee.dao.admin.response.InterestedListVO; |
| | | import com.doumee.dao.admin.response.PCWorkPlatformDataVO; |
| | |
| | | |
| | | @Autowired |
| | | private SmsEmailMapper smsEmailMapper; |
| | | |
| | | @Autowired |
| | | private WxNoticeConfigMapper wxNoticeConfigMapper; |
| | | |
| | | @Autowired |
| | | private EmayService emayService; |
| | |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对ä¸èµ·ï¼åèµ·æè®¿å®¡æ¹ç³è¯·å¤±è´¥ï¼"); |
| | | } |
| | | //åé微信å
¬ä¼å·éç¥ |
| | | wxPlatNotice.sendVisitAuditTemplateNotice(visits, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_PREFIX).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_AUDIT_VISIT).getCode()); |
| | | }else if(dataSyncConfig.getVisitorDataOrigin().equals(Constants.ZERO)){ |
| | | visits.setStatus(Constants.VisitStatus.waitCheck); |
| | | visitsMapper.updateById(visits); |
| | |
| | | } |
| | | initWithVisitInfo(visits); |
| | | updateProblemLog(visits,problemLog,member); |
| | | |
| | | //åé微信å
¬ä¼å·éç¥ - ç³è¯·æäº¤æåå¾
å®¡æ ¸ |
| | | if(StringUtils.isNotBlank(visits.getOpenid())){ |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendVisitTemplateNotice( |
| | | wxNoticeConfigMapper,visits, |
| | | Constants.equalsInteger(visits.getType(),Constants.TWO)?WxPlatConstants.visitReportContent.visitReportUpload:WxPlatConstants.visitContent.visitUpload, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(visits.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | //å建审æ¹è®°å½ |
| | | createApprove(visits,visitMember); |
| | | |
| | |
| | | if(Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.xfSuccess)){ |
| | | //妿ä¸åæåï¼ |
| | | visitsMapper.updateById(visits); |
| | | if(Objects.isNull(visits.getParentId())){ |
| | | wxPlatNotice.sendVisitAuditTemplateNotice(visits, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_PREFIX).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_AUDIT_VISIT).getCode()); |
| | | } |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"éæ°ä¸åä¼å¤±è´¥ï¼"); |
| | | } |
| | |
| | | i.setEndtime(param.getEndTime()); |
| | | i.setDoors(param.getDoors()); |
| | | visitsMapper.updateById(i); |
| | | if(Objects.isNull(i.getParentId())){ |
| | | wxPlatNotice.sendVisitAuditTemplateNotice(i, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_PREFIX).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_AUDIT_VISIT).getCode()); |
| | | } |
| | | }); |
| | | } |
| | | }catch (BusinessException e){ |
| | |
| | | // getUpdateModelByResponse(c,date,roleList,path); |
| | | getUpdateModelByResponseIccm(c,date,roleList,path); |
| | | visitsMapper.updateById(c); |
| | | if(Objects.isNull(c.getParentId())){ |
| | | wxPlatNotice.sendVisitAuditTemplateNotice(c, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_PREFIX).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_AUDIT_VISIT).getCode()); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | import com.doumee.core.wms.model.response.WmsBaseDataResponse; |
| | | import com.doumee.core.wms.model.response.WmsBaseResponse; |
| | | import com.doumee.core.wms.model.response.WmsInventoryDataResponse; |
| | | import com.doumee.core.wx.wxPlat.WxPlatConstants; |
| | | import com.doumee.core.wx.wxPlat.WxPlatNotice; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dao.SmsConfigMapper; |
| | | import com.doumee.dao.business.dao.SmsEmailMapper; |
| | |
| | | private EmayService emayService; |
| | | @Autowired |
| | | private RetentionMapper retentionMapper; |
| | | @Autowired |
| | | private WxNoticeConfigMapper wxNoticeConfigMapper; |
| | | /** |
| | | * å
¥åºéç¥ä»»å¡ä¸å¡å¤ç |
| | | * @param job åæ° |
| | |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,job.getId(), |
| | | SmsConstants.platformJobContent.platformJobNewJob,null,null |
| | | ); |
| | | //æ¥è¯¢å¸æºä¿¡æ¯ åéå
¬ä¼å·éç¥ |
| | | if(Objects.nonNull(job.getDriverId())){ |
| | | Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getPhone,job.getDriverId())); |
| | | if(Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())){ |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendWmsTemplateNotice( |
| | | wxNoticeConfigMapper,job, |
| | | WxPlatConstants.platformJobContent.platformJobNewJob, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | .set(PlatformJob::getStatus,Constants.PlatformJobStatus.CANCEL.getKey()) |
| | | .in(PlatformJob::getId,setJobIds) |
| | | ); |
| | | |
| | | for (Integer jobId:setJobIds |
| | | ) { |
| | | //çä¿¡éç¥ |
| | | SmsEmailServiceImpl.sendPlatformJobSms(systemDictDataBiz, |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,jobId, |
| | | SmsConstants.platformJobContent.platformJobStopJob,null,null |
| | | ); |
| | | //å
¬ä¼å·éç¥å¸æº ä»»å¡åæ¶ |
| | | PlatformJob job = platformJobMapper.selectById(jobId); |
| | | if(Objects.nonNull(job)){ |
| | | Member member = memberMapper.selectById(job.getDriverId()); |
| | | if(Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())){ |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendWmsCancelTemplateNotice( |
| | | wxNoticeConfigMapper,job, |
| | | WxPlatConstants.platformJobContent.platformJobCancel, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,jobId, |
| | | SmsConstants.platformJobContent.platformJobStopJob,null,null |
| | | ); |
| | | |
| | | //å
¬ä¼å·éç¥å¸æº ä»»å¡åæ¶ |
| | | PlatformJob job = platformJobMapper.selectById(jobId); |
| | | if(Objects.nonNull(job)){ |
| | | Member member = memberMapper.selectById(job.getDriverId()); |
| | | if(Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())){ |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | | wxPlatNotice.sendWmsCancelTemplateNotice( |
| | | wxNoticeConfigMapper,job, |
| | | WxPlatConstants.platformJobContent.platformJobCancel, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |