New file |
| | |
| | | package com.zy.crm.common.entity; |
| | | |
| | | public enum PhoneCodeTypeParam { |
| | | |
| | | ALIYUN_M1ABAC630E(0, "【中扬立库】有新的CRM流程需要审核","M1ABAC630E"), |
| | | ALIYUN_M6F3C81FE3(1, "【中扬立库】分配了新的规划申请单任务!","M6F3C81FE3"), |
| | | ; |
| | | |
| | | public Integer id; |
| | | public String code; |
| | | public String templateId; |
| | | PhoneCodeTypeParam(Integer id,String code, String templateId) { |
| | | this.id = id; |
| | | this.code = code; |
| | | this.templateId = templateId; |
| | | } |
| | | |
| | | public static PhoneCodeTypeParam get(Short id) { |
| | | if (null == id) { |
| | | return null; |
| | | } |
| | | for (PhoneCodeTypeParam type : PhoneCodeTypeParam.values()) { |
| | | if (type.id.equals(id.intValue())) { |
| | | return type; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static PhoneCodeTypeParam get(PhoneCodeTypeParam type) { |
| | | if (null == type) { |
| | | return null; |
| | | } |
| | | for (PhoneCodeTypeParam crnLiftPosType : PhoneCodeTypeParam.values()) { |
| | | if (crnLiftPosType == type) { |
| | | return crnLiftPosType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.core.common.*; |
| | | import com.core.domain.KeyValueVo; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.crm.common.entity.PhoneCodeTypeParam; |
| | | import com.zy.crm.common.model.SettleDto; |
| | | import com.zy.crm.common.service.OssService; |
| | | import com.zy.crm.common.utils.FileSaveExampleUtil; |
| | |
| | | throw new CoolException("保持失败,请重试"); |
| | | } |
| | | |
| | | if (!smsCodeService.sendSmsCodeText(planLeader.getMobile(), PhoneCodeTypeParam.ALIYUN_M1ABAC630E)) { |
| | | return R.ok("创建成功但短信发送失败!"); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | hostPlan.setHostPlanId(hostPlanId); |
| | | if (!planService.updateById(hostPlan)) { |
| | | throw new CoolException("更新失败,请重试"); |
| | | } |
| | | if (!smsCodeService.sendSmsCodeText(planLeader.getMobile(), PhoneCodeTypeParam.ALIYUN_M1ABAC630E)) { |
| | | return R.ok("创建成功但短信发送失败!"); |
| | | } |
| | | return R.ok("保存成功"); |
| | | } |
| | |
| | | plan.setUpdateBy(getUserId()); |
| | | plan.setUpdateTime(new Date()); |
| | | |
| | | boolean sendSmsCode = smsCodeService.sendSmsCodeText(planner.getMobile()); |
| | | if (!sendSmsCode) { |
| | | System.out.println("短信发送失败!"); |
| | | } |
| | | |
| | | if (!planService.updateById(plan)) { |
| | | throw new CoolException("审核失败,请联系管理员"); |
| | | } |
| | |
| | | planFoll.setUserId(planner.getId()); |
| | | if (!planFollService.insert(planFoll)) { |
| | | throw new CoolException("审核失败,请联系管理员"); |
| | | } |
| | | |
| | | if (!smsCodeService.sendSmsCodeText(planner.getMobile(), PhoneCodeTypeParam.ALIYUN_M6F3C81FE3)) { |
| | | return R.ok("审核成功但短信发送失败!"); |
| | | } |
| | | break; |
| | | case 2: |
| | |
| | | if (!planService.updateById(plan)) { |
| | | throw new CoolException("审核失败,请联系管理员"); |
| | | } |
| | | if (!smsCodeService.sendSmsCodeText(salesman.getMobile(), PhoneCodeTypeParam.ALIYUN_M1ABAC630E)) { |
| | | return R.ok("审核成功但短信发送失败!"); |
| | | } |
| | | break; |
| | | case 3: |
| | | // 业务员 |
| | |
| | | import com.core.common.R; |
| | | import com.core.domain.KeyValueVo; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.crm.common.entity.PhoneCodeTypeParam; |
| | | import com.zy.crm.common.model.SettleDto; |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.entity.*; |
| | |
| | | |
| | | @Autowired |
| | | private PriOnline2FollService priOnline2FollService; |
| | | |
| | | @Autowired |
| | | private SmsCodeService smsCodeService; |
| | | |
| | | String PZH = " ———————————————————————————————————————————————————————————————————————————————— "; |
| | | |
| | |
| | | |
| | | if (user.getId().equals(priOnline2.getUserId())) { |
| | | if (priOnline2.getAssistantHostSign()==0){ |
| | | User manager = new User(); |
| | | try { |
| | | manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 获取部门领导 |
| | | } catch (Exception e) { |
| | | manager = getUser(); |
| | | } |
| | | try { |
| | | priQuoteAdd(priOnline2.getId(), plannerId); |
| | | } catch (Exception e) { |
| | | return R.error("自动生成报价单失败"); |
| | | } |
| | | if (!smsCodeService.sendSmsCodeText(manager.getMobile(), PhoneCodeTypeParam.ALIYUN_M1ABAC630E)) { |
| | | return R.ok("审批成功但短信发送失败!"); |
| | | } |
| | | }else { |
| | | try { |
| | |
| | | return R.error("更新主表失败"); |
| | | } |
| | | } |
| | | |
| | | }else { |
| | | User phoneUser = userService.selectById(nextUserId); |
| | | if (!smsCodeService.sendSmsCodeText(phoneUser.getMobile(), PhoneCodeTypeParam.ALIYUN_M1ABAC630E)) { |
| | | return R.ok("审批成功但短信发送失败!"); |
| | | } |
| | | } |
| | | |
| | | return R.ok("审批成功"); |
| | |
| | | import com.core.common.R; |
| | | import com.core.domain.KeyValueVo; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.crm.common.entity.PhoneCodeTypeParam; |
| | | import com.zy.crm.common.model.SettleDto; |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.entity.*; |
| | |
| | | |
| | | @Autowired |
| | | private PlanTypeService planTypeService; |
| | | |
| | | @Autowired |
| | | private SmsCodeService smsCodeService; |
| | | |
| | | String PZH=" ———————————————————————————————————————————————————————————————————————————————— "; |
| | | |
| | |
| | | if (!priQuoteService.updateById(priQuote)) { |
| | | throw new CoolException("审核失败,请联系管理员"); |
| | | } |
| | | if (!smsCodeService.sendSmsCodeText(planLeader.getMobile(), PhoneCodeTypeParam.ALIYUN_M1ABAC630E)) { |
| | | return R.ok("审批成功但短信发送失败!"); |
| | | } |
| | | |
| | | } else { |
| | | return R.error("抱歉,您没有审核的权限"); |
| | |
| | | if (!priQuoteService.updateById(priQuote)) { |
| | | throw new CoolException("审核失败,请联系管理员"); |
| | | } |
| | | User phoneUser = userService.selectById(priQuote.getUserId()); |
| | | if (!smsCodeService.sendSmsCodeText(phoneUser.getMobile(), PhoneCodeTypeParam.ALIYUN_M1ABAC630E)) { |
| | | return R.ok("审批成功但短信发送失败!"); |
| | | } |
| | | break; |
| | | case 3: |
| | | // 业务员 |
| | |
| | | package com.zy.crm.manager.service; |
| | | |
| | | import com.zy.crm.common.entity.PhoneCodeTypeParam; |
| | | import com.zy.crm.manager.entity.SmsCode; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | |
| | | SmsCode selectByPhone(String phone); |
| | | |
| | | boolean sendSmsCode(String phone); |
| | | boolean sendSmsCodeText(String phone); |
| | | // boolean sendSmsCodeText(String phone); |
| | | boolean sendSmsCodeText(String phone, PhoneCodeTypeParam param); |
| | | |
| | | boolean verifySmsCode(String phone, String code); |
| | | |
| | |
| | | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.crm.common.entity.PhoneCodeTypeParam; |
| | | import com.zy.crm.manager.mapper.SmsCodeMapper; |
| | | import com.zy.crm.manager.entity.SmsCode; |
| | | import com.zy.crm.manager.service.SmsCodeService; |
| | |
| | | return true; |
| | | } |
| | | |
| | | // @Override |
| | | // public boolean sendSmsCodeText(String phone) { |
| | | // String randomNum = "分配了新的规划申请单任务!" ;//获取六位随机数 |
| | | // SmsCode smsCode = new SmsCode(); |
| | | // smsCode.setPhone(phone); |
| | | // smsCode.setCode(randomNum); |
| | | // smsCode.setStatus(0); |
| | | // smsCode.setCreateTime(new Date()); |
| | | // if (this.baseMapper.insert(smsCode) <= 0) { |
| | | // return false; |
| | | // } |
| | | // |
| | | // boolean sendSmsCode = SmsUtils.sendSmsCodeText(phone, ""); |
| | | // if (!sendSmsCode) { |
| | | // return false; |
| | | // } |
| | | // |
| | | // smsCode.setSendTime(new Date()); |
| | | // smsCode.setStatus(1); |
| | | // this.baseMapper.updateById(smsCode); |
| | | // return true; |
| | | // } |
| | | |
| | | @Override |
| | | public boolean sendSmsCodeText(String phone) { |
| | | String randomNum = "分配了新的规划申请单任务!" ;//获取六位随机数 |
| | | public boolean sendSmsCodeText(String phone, PhoneCodeTypeParam param) { |
| | | String randomNum = param.code; |
| | | SmsCode smsCode = new SmsCode(); |
| | | smsCode.setPhone(phone); |
| | | smsCode.setCode(randomNum); |
| | |
| | | return false; |
| | | } |
| | | |
| | | boolean sendSmsCode = SmsUtils.sendSmsCodeText(phone, ""); |
| | | boolean sendSmsCode = SmsUtils.sendSmsCodeText(phone, param); |
| | | if (!sendSmsCode) { |
| | | return false; |
| | | } |
| | |
| | | import com.aliyun.sdk.service.dysmsapi20170525.models.SendSmsRequest; |
| | | import com.aliyun.sdk.service.dysmsapi20170525.models.SendSmsResponse; |
| | | import com.aliyun.sdk.service.dysmsapi20170525.models.SendSmsResponseBody; |
| | | import com.zy.crm.common.entity.PhoneCodeTypeParam; |
| | | import darabonba.core.client.ClientOverrideConfiguration; |
| | | |
| | | import java.util.*; |
| | |
| | | /** |
| | | * 阿里云市场API 分配了新的规划申请单任务!请注意查收! |
| | | */ |
| | | private static boolean aliyun_2(String phone, String code) { |
| | | private static boolean aliyun_2(String phone, PhoneCodeTypeParam phoneCodeTypeParam) { |
| | | try { |
| | | HashMap<String, Object> headers = new HashMap<>(); |
| | | HashMap<String, Object> param = new HashMap<>(); |
| | |
| | | String APPCODE = "15ce5d8be5e348c7b680dfd7cfb8307e"; |
| | | headers.put("Authorization", "APPCODE " + APPCODE); |
| | | |
| | | param.put("templateId", "M6F3C81FE3"); |
| | | param.put("templateId", phoneCodeTypeParam.templateId); |
| | | param.put("receive", phone); |
| | | param.put("tag", code); |
| | | param.put("tag", ""); |
| | | |
| | | String response = new HttpHandler.Builder() |
| | | .setUri("https://smkjdxtzjk.market.alicloudapi.com") |
| | |
| | | /** |
| | | * 发送短信-阿里云原生 |
| | | */ |
| | | public static boolean sendSmsCodeText(String phone, String code) { |
| | | return aliyun_2(phone, code); |
| | | public static boolean sendSmsCodeText(String phone, PhoneCodeTypeParam param) { |
| | | return aliyun_2(phone, param); |
| | | } |
| | | |
| | | /** |
| | |
| | | name: @pom.build.finalName@ |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | # url: jdbc:sqlserver://192.168.4.15:1433;databasename=zy_crm |
| | | # username: sa |
| | | # password: sa@123 |
| | | url: jdbc:sqlserver://47.97.1.152:51433;databasename=zy_crm |
| | | url: jdbc:sqlserver://192.168.4.15:1433;databasename=zy_crm |
| | | username: sa |
| | | password: Zoneyung@zy56$ |
| | | password: sa@123 |
| | | # url: jdbc:sqlserver://127.0.0.1:51433;databasename=zy_crm |
| | | # username: sa |
| | | # password: Zoneyung@zy56$ |
| | | # url: jdbc:sqlserver://47.97.1.152:51433;databasename=zy_crm |
| | | # username: sa |
| | | # password: Zoneyung@zy56$ |
| | | mvc: |
| | | static-path-pattern: /** |
| | | redis: |