/** * 审核通过后发信息给申请人和 用车人 * * @param cad 实体 * @param dispState 状态 */ public void sendMessageToUserAfterSuccess(CarApplyDispatchEntity cad, String dispState) { String adispcode = cad.getAdisp_code(); StringBuffer contents = new StringBuffer(); String carManPhone = carApplyDispatchService.getCarManPhone(cad.getCar_no()); // 当前这个人车的使用人电话。 contents.append( "您申请的于" + cad.getApply_date() + "因" + cad.getUse_reason() + "需要使用" + cad.getCarno() + "车,已经审批通过 。"); JmsSmParameter parameter1 = JmsSmParameter.getInstanceForNotNeedResponse(cad.getPhone(), contents.toString()); parameter1.setBusinessCode(MessageConfig.BussCode2 + adispcode); smSender.sendMessage(parameter1); contents.setLength(0); contents.append( cad.getUsers() + "于" + cad.getApprove_date() + "因" + cad.getUse_reason() + "需要使用" + cad.getCarno() + "车,请及时做好准备。"); JmsSmParameter parameter2 = JmsSmParameter.getInstanceForNotNeedResponse(carManPhone, contents.toString()); parameter2.setBusinessCode(MessageConfig.BussCode2 + adispcode); smSender.sendMessage(parameter2); logger.info("发送完成....."); }
/** * 审核不通过后发信息给申请人 * * @param cad 实体 * @param dispState 状态 */ public void sendMessageToUserAfterFailur(CarApplyDispatchEntity cad, String dispState) { String adispcode = cad.getAdisp_code(); StringBuffer contents = new StringBuffer(); contents.append( "您申请的于" + cad.getApply_date() + "因" + cad.getUse_reason() + "需要使用" + cad.getCarno() + "车,审批不通过 。"); JmsSmParameter parameter = JmsSmParameter.getInstanceForNotNeedResponse(cad.getPhone(), contents.toString()); parameter.setBusinessCode(MessageConfig.BussCode2 + adispcode); smSender.sendMessage(parameter); logger.info("发送完成....."); }