| | |
| | | /** |
| | | * 业绩短信提醒 |
| | | */ |
| | | @ApiOperation(value = "crm诊所管理信息-业绩短信提醒", notes = "clinicId:诊所id,performanceStatus:业绩状态 1=未达成 2=已达成") |
| | | @ApiOperation(value = "crm诊所管理信息-业绩短信提醒", notes = "clinicId:诊所id") |
| | | @GetMapping(value = "/medicationReminder") |
| | | public R<String> medicationReminder(@RequestParam(value = "clinicId") String clinicId, |
| | | @RequestParam(value = "performanceStatus") Integer performanceStatus) { |
| | | public R<String> medicationReminder(@RequestParam(value = "clinicId") String clinicId) { |
| | | TCrmClinic crmClinic = crmClinicService.getById(clinicId); |
| | | if(StringUtils.isNotBlank(crmClinic.getPhone())){ |
| | | Integer performanceCount = crmClinic.getPerformanceCount(); |
| | | if(performanceStatus == 1){ |
| | | performanceCount = performanceCount+1; |
| | | } |
| | | int performanceCount = crmClinic.getPerformanceCount() + 1; |
| | | TCrmSalesperson crmSalesperson = crmSalespersonService.getById(crmClinic.getSalespersonId()); |
| | | TSysMessageTemplate messageTemplate = sysMessageTemplateService.getOne(Wrappers.lambdaQuery(TSysMessageTemplate.class) |
| | | .eq(TSysMessageTemplate::getTemplateType, 2)); |
| | |
| | | try { |
| | | Map<String,String> params = new HashMap<>(); |
| | | params.put("name",crmSalesperson.getSalespersonName()); |
| | | params.put("num",performanceCount.toString()); |
| | | params.put("num", Integer.toString(performanceCount)); |
| | | msgUtils.sendMsg(crmClinic.getPhone(),params, messageTemplate.getTemplateCode()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |