| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.WebUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.TCrmBranchDTO; |
| | | import com.ruoyi.system.export.TCrmBranchExport; |
| | | import com.ruoyi.system.export.TSysAppUserClinicExport; |
| | | import com.ruoyi.system.export.TSysAppUserExport; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.TCrmBranchQuery; |
| | | import com.ruoyi.system.query.TSysAppUserQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TCrmBranchVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | |
| | | crmChangePointsService.save(changePoints); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @Log(title = "crm分公司管理信息-分公司管理信息导出", businessType = BusinessType.EXPORT) |
| | | @ApiOperation(value = "分公司管理信息导出") |
| | | @PostMapping("/exportList") |
| | | public void exportList(@RequestBody TCrmBranchQuery query){ |
| | | List<TCrmBranchExport> crmBranchExports = crmBranchService.exportList(query); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TCrmBranchExport.class, crmBranchExports); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("分公司管理信息.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.WebUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.TCrmClinicAuditDTO; |
| | | import com.ruoyi.system.dto.TCrmClinicDTO; |
| | | import com.ruoyi.system.export.TCrmChangePointsBranchExport; |
| | | import com.ruoyi.system.export.TCrmClinicAuditExport; |
| | | import com.ruoyi.system.export.TCrmClinicListExport; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.TCrmChangePointsQuery; |
| | | import com.ruoyi.system.query.TCrmClinicQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TCrmClinicVO; |
| | | import com.ruoyi.system.vo.TSysAppUserVO; |
| | | import com.ruoyi.web.controller.tool.MsgUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDateTime; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private final ISysUserService sysUserService; |
| | | private final TCrmDeviceService crmDeviceService; |
| | | private final TokenService tokenService; |
| | | private final MsgUtils msgUtils; |
| | | private final TSysMessageTemplateService sysMessageTemplateService; |
| | | @Autowired |
| | | public TCrmClinicController(TCrmClinicService crmClinicService, TCrmSupplierService crmSupplierService, TCrmBranchService crmBranchService, TCrmWarehouseService crmWarehouseService, TCrmSalespersonService crmSalespersonService, ISysUserService sysUserService, TCrmDeviceService crmDeviceService, TokenService tokenService) { |
| | | public TCrmClinicController(TCrmClinicService crmClinicService, TCrmSupplierService crmSupplierService, TCrmBranchService crmBranchService, TCrmWarehouseService crmWarehouseService, TCrmSalespersonService crmSalespersonService, ISysUserService sysUserService, TCrmDeviceService crmDeviceService, TokenService tokenService, MsgUtils msgUtils, TSysMessageTemplateService sysMessageTemplateService) { |
| | | this.crmClinicService = crmClinicService; |
| | | this.crmSupplierService = crmSupplierService; |
| | | this.crmBranchService = crmBranchService; |
| | |
| | | this.sysUserService = sysUserService; |
| | | this.crmDeviceService = crmDeviceService; |
| | | this.tokenService = tokenService; |
| | | this.msgUtils = msgUtils; |
| | | this.sysMessageTemplateService = sysMessageTemplateService; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @Log(title = "crm诊所管理信息-诊所管理导出", businessType = BusinessType.EXPORT) |
| | | @ApiOperation(value = "诊所管理导出") |
| | | @PostMapping("/exportList") |
| | | public void exportList(@RequestBody TCrmClinicQuery query){ |
| | | List<TCrmClinicListExport> crmClinicListExports = crmClinicService.exportList(query); |
| | | for (TCrmClinicListExport crmClinicListExport : crmClinicListExports) { |
| | | if(Objects.nonNull(crmClinicListExport.getLowProcurementMoney())){ |
| | | crmClinicListExport.setLowProcurementMoneyStr("¥"+crmClinicListExport.getLowProcurementMoney()); |
| | | } |
| | | if(Objects.nonNull(crmClinicListExport.getMonthPurchaseAmount())){ |
| | | crmClinicListExport.setMonthPurchaseAmountStr("¥"+crmClinicListExport.getMonthPurchaseAmount()); |
| | | } |
| | | } |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TCrmClinicListExport.class, crmClinicListExports); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("诊所管理.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | @Log(title = "crm诊所管理信息-诊所审核导出", businessType = BusinessType.EXPORT) |
| | | @ApiOperation(value = "诊所审核导出") |
| | | @PostMapping("/exportAudit") |
| | | public void exportAudit(@RequestBody TCrmClinicQuery query){ |
| | | List<TCrmClinicAuditExport> crmClinicAuditExports = crmClinicService.exportAudit(query); |
| | | for (TCrmClinicAuditExport crmClinicAuditExport : crmClinicAuditExports) { |
| | | if(Objects.nonNull(crmClinicAuditExport.getLowProcurementMoney())){ |
| | | crmClinicAuditExport.setLowProcurementMoneyStr("¥"+crmClinicAuditExport.getLowProcurementMoney()); |
| | | } |
| | | } |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TCrmClinicAuditExport.class, crmClinicAuditExports); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("诊所审核.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 业绩短信提醒 |
| | | */ |
| | | @ApiOperation(value = "crm诊所管理信息-业绩短信提醒", notes = "clinicId:诊所id,performanceStatus:业绩状态 1=未达成 2=已达成") |
| | | @GetMapping(value = "/medicationReminder") |
| | | public R<String> medicationReminder(@RequestParam(value = "clinicId") String clinicId, |
| | | @RequestParam(value = "performanceStatus") Integer performanceStatus) { |
| | | TCrmClinic crmClinic = crmClinicService.getById(clinicId); |
| | | if(StringUtils.isNotBlank(crmClinic.getPhone())){ |
| | | Integer performanceCount = crmClinic.getPerformanceCount(); |
| | | if(performanceStatus == 1){ |
| | | performanceCount = performanceCount+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()); |
| | | msgUtils.sendMsg(crmClinic.getPhone(),params, messageTemplate.getTemplateCode()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.WebUtils; |
| | | import com.ruoyi.system.export.TCrmClinicAuditExport; |
| | | import com.ruoyi.system.export.TSysAppUserClinicExport; |
| | | import com.ruoyi.system.export.TSysAppUserExport; |
| | | import com.ruoyi.system.export.TSysAppUserListExport; |
| | | import com.ruoyi.system.model.TSysAppUser; |
| | | import com.ruoyi.system.model.TSysChronicDisease; |
| | | import com.ruoyi.system.model.TSysInspection; |
| | | import com.ruoyi.system.model.TSysMessageTemplate; |
| | | import com.ruoyi.system.query.TCrmClinicQuery; |
| | | import com.ruoyi.system.query.TSysAppUserQuery; |
| | | import com.ruoyi.system.service.TSysAppUserService; |
| | | import com.ruoyi.system.service.TSysChronicDiseaseService; |
| | | import com.ruoyi.system.service.TSysInspectionService; |
| | | import com.ruoyi.system.service.TSysOrderService; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TSysAppUserVO; |
| | | import com.ruoyi.system.vo.TSysOrderVO; |
| | | import com.ruoyi.web.controller.tool.MsgUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private final TSysInspectionService sysInspectionService; |
| | | private final TSysOrderService sysOrderService; |
| | | private final TSysChronicDiseaseService sysChronicDiseaseService; |
| | | private final MsgUtils msgUtils; |
| | | private final TSysMessageTemplateService sysMessageTemplateService; |
| | | @Autowired |
| | | public TSysAppUserController(TSysAppUserService sysAppUserService, TSysInspectionService sysInspectionService, TSysOrderService sysOrderService, TSysChronicDiseaseService sysChronicDiseaseService) { |
| | | public TSysAppUserController(TSysAppUserService sysAppUserService, TSysInspectionService sysInspectionService, TSysOrderService sysOrderService, TSysChronicDiseaseService sysChronicDiseaseService, MsgUtils msgUtils, TSysMessageTemplateService sysMessageTemplateService) { |
| | | this.sysAppUserService = sysAppUserService; |
| | | this.sysInspectionService = sysInspectionService; |
| | | this.sysOrderService = sysOrderService; |
| | | this.sysChronicDiseaseService = sysChronicDiseaseService; |
| | | this.msgUtils = msgUtils; |
| | | this.sysMessageTemplateService = sysMessageTemplateService; |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping(value = "/pageChronicDiseaseUserList") |
| | | public R<PageInfo<TSysAppUserVO>> pageChronicDiseaseUserList(@RequestBody TSysAppUserQuery query) { |
| | | return R.ok(sysAppUserService.pageChronicDiseaseUserList(query)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 用药提醒 |
| | | */ |
| | | @ApiOperation(value = "慢性病患者-用药提醒", notes = "userId:患者用户id,templateId:短信模板id") |
| | | @GetMapping(value = "/medicationReminder") |
| | | public R<String> medicationReminder(@RequestParam(value = "userId") String userId, |
| | | @RequestParam(value = "templateId") String templateId) { |
| | | TSysAppUser sysAppUser = sysAppUserService.getById(userId); |
| | | if(StringUtils.isNotBlank(sysAppUser.getPhone())){ |
| | | sysAppUser.setLastReminderTime(LocalDateTime.now()); |
| | | sysAppUserService.updateById(sysAppUser); |
| | | TSysMessageTemplate messageTemplate = sysMessageTemplateService.getById(templateId); |
| | | // 发送短信 |
| | | try { |
| | | Map<String,String> params = new HashMap<>(); |
| | | msgUtils.sendMsg(sysAppUser.getPhone(),params, messageTemplate.getTemplateCode()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Log(title = "用户管理信息-慢性病患者导出-平台", businessType = BusinessType.EXPORT) |
| | | @ApiOperation(value = "慢性病患者导出-平台") |
| | | @PostMapping("/exportList") |
| | | public void exportList(@RequestBody TSysAppUserQuery query){ |
| | | List<TSysAppUserListExport> sysAppUserListExports = sysAppUserService.exportList(query); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TSysAppUserListExport.class, sysAppUserListExports); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("慢性病患者.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | @Log(title = "用户管理信息-慢性病患者导出-诊所", businessType = BusinessType.EXPORT) |
| | | @ApiOperation(value = "慢性病患者导出-诊所") |
| | | @PostMapping("/exportListClinic") |
| | | public void exportListClinic(@RequestBody TSysAppUserQuery query){ |
| | | List<TSysAppUserClinicExport> sysAppUserClinicExports = sysAppUserService.exportListClinic(query); |
| | | for (TSysAppUserClinicExport sysAppUserClinicExport : sysAppUserClinicExports) { |
| | | String lastReminderTime = sysAppUserClinicExport.getLastReminderTime(); |
| | | lastReminderTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(lastReminderTime); |
| | | sysAppUserClinicExport.setLastReminderTime(lastReminderTime); |
| | | } |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TSysAppUserClinicExport.class, sysAppUserClinicExports); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("慢性病患者.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Log(title = "用户管理信息-用户管理信息导出", businessType = BusinessType.EXPORT) |
| | | @ApiOperation(value = "用户管理信息导出") |
| | | @PostMapping("/exportListAppUser") |
| | | public void exportListAppUser(@RequestBody TSysAppUserQuery query){ |
| | | List<TSysAppUserExport> sysAppUserExports = sysAppUserService.exportListAppUser(query); |
| | | for (TSysAppUserExport sysAppUserExport : sysAppUserExports) { |
| | | String lastInspectionTime = sysAppUserExport.getLastInspectionTime(); |
| | | lastInspectionTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(lastInspectionTime); |
| | | sysAppUserExport.setLastInspectionTime(lastInspectionTime); |
| | | sysAppUserExport.setCreateTimeStr(sysAppUserExport.getCreateTime().toLocalDate().toString()); |
| | | } |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TSysAppUserClinicExport.class, sysAppUserExports); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("用户管理信息.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.web.controller.task; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import com.ruoyi.system.model.TErpProcurement; |
| | | import com.ruoyi.system.service.TCrmClinicService; |
| | | import com.ruoyi.system.service.TErpProcurementService; |
| | | import com.ruoyi.system.utils.util.AIUtil; |
| | | import com.ruoyi.system.vo.TCrmClinicVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | |
| | | private RedisCache redisCache; |
| | | @Autowired |
| | | private AIUtil aiUtil; |
| | | @Autowired |
| | | private TCrmClinicService crmClinicService; |
| | | @Autowired |
| | | private TErpProcurementService erpProcurementService; |
| | | |
| | | @Scheduled(fixedRate = 86460000) |
| | | // @Scheduled(cron = "10 0 0 * * ?") |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "10 0 0 * * ?") |
| | | public void monthUpdateClinicPerformance() { |
| | | try { |
| | | // 判断哪些诊所本月没有业绩达标 |
| | | List<TCrmClinic> clinics = crmClinicService.list(); |
| | | List<TErpProcurement> procurements = erpProcurementService.list(Wrappers.lambdaQuery(TErpProcurement.class) |
| | | .in(TErpProcurement::getStatus, Arrays.asList(3,4,5)) |
| | | .likeRight(TErpProcurement::getCreateTime, LocalDate.now())); |
| | | for (TCrmClinic clinic : clinics) { |
| | | List<TErpProcurement> procurementList = procurements.stream().filter(procurement -> procurement.getClinicId().equals(clinic.getId())).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(procurementList)){ |
| | | BigDecimal monthPurchaseAmount = procurementList.stream().map(TErpProcurement::getPayMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // 未达标 |
| | | if(monthPurchaseAmount.compareTo(clinic.getLowProcurementMoney())<0){ |
| | | clinic.setPerformanceCount(clinic.getPerformanceCount()+1); |
| | | } |
| | | } |
| | | } |
| | | crmClinicService.updateBatchById(clinics); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.model.TSysAppUser; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.TSysAppUserService; |
| | | import com.ruoyi.system.model.TSysMessageTemplate; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.utils.wx.body.resp.Code2SessionRespBody; |
| | | import com.ruoyi.system.utils.wx.body.resq.Code2SessionResqBody; |
| | | import com.ruoyi.system.utils.wx.model.WeixinProperties; |
| | | import com.ruoyi.system.utils.wx.pojo.AppletUserDecodeData; |
| | | import com.ruoyi.system.utils.wx.pojo.AppletUserEncrypteData; |
| | | import com.ruoyi.system.utils.wx.pojo.OfficeUserEncrypteData; |
| | | import com.ruoyi.system.utils.wx.tools.WxAppletTools; |
| | | import com.ruoyi.system.utils.wx.tools.WxUtils; |
| | | import com.ruoyi.web.controller.tool.MsgUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.web.service.SysLoginService; |
| | | import com.ruoyi.framework.web.service.SysPermissionService; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | private WeixinProperties wxConfig; |
| | | @Autowired |
| | | private RestTemplate wxRestTemplate; |
| | | @Resource |
| | | @Autowired |
| | | private MsgUtils msgUtils; |
| | | @Autowired |
| | | private TSysMessageTemplateService sysMessageTemplateService; |
| | | @Autowired |
| | | private RedisService redisService; |
| | | @Resource |
| | | @Autowired |
| | | private TSysAppUserService sysAppUserService; |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | /** |
| | | * 账号密码登录 |
| | | * |
| | |
| | | return R.ok(tokenInfos); |
| | | } |
| | | |
| | | @ApiOperation(value = "通过code获得openid",tags = {"微信服务号、公众号登录"}) |
| | | @PostMapping("/openIdByCode") |
| | | public R<Map<String, Object>> openIdByCode(@RequestBody OfficeUserEncrypteData data) { |
| | | log.info("<<<<<<<<换取openid开始<<<<<<<<:{}", data.getCode()); |
| | | WxAppletTools appletTools = new WxAppletTools(wxRestTemplate, wxConfig, redisService); |
| | | Code2SessionRespBody body = appletTools.getOpenIdByJscode2session(new Code2SessionResqBody().build(data.getCode())); |
| | | String openid = body.getOpenid(); |
| | | String phone = data.getPhone(); |
| | | if(StringUtils.isEmpty(phone)){ |
| | | return R.fail("请输入手机号"); |
| | | } |
| | | TSysAppUser sysAppUser = sysAppUserService.getOne(Wrappers.lambdaQuery(TSysAppUser.class) |
| | | .eq(TSysAppUser::getPhone, phone)); |
| | | if(Objects.nonNull(sysAppUser)){ |
| | | sysAppUser.setOfficeOpenId(openid); |
| | | sysAppUserService.updateById(sysAppUser); |
| | | } |
| | | // 获取诊所信息 |
| | | SysUser sysUser = sysUserService.selectByPhone(phone); |
| | | if(Objects.nonNull(sysUser) && (sysUser.getRoleType() == 5 || sysUser.getRoleType() == 3)){ |
| | | // 诊所 |
| | | sysUser.setOpenId(openid); |
| | | sysUserService.updateUserInfo(sysUser); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 账号密码登录 |
| | | * |
| | |
| | | String code = String.valueOf((int) (Math.random() * 1000000)); |
| | | redisCache.setCacheObject(phone, code,5*60,TimeUnit.SECONDS); |
| | | try { |
| | | // smsUtil.sendSms(phone, "2369926", new String[]{code}); |
| | | TSysMessageTemplate messageTemplate = sysMessageTemplateService.getOne(Wrappers.lambdaQuery(TSysMessageTemplate.class) |
| | | .eq(TSysMessageTemplate::getTemplateType, 1)); |
| | | Map<String,String> params = new HashMap<>(); |
| | | params.put("code", code); |
| | | msgUtils.sendMsg(phone, params, messageTemplate.getTemplateCode()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| New file |
| | |
| | | package com.ruoyi.web.controller.tool; |
| | | |
| | | import com.aliyun.dysmsapi20170525.models.SendSmsRequest; |
| | | import com.aliyun.dysmsapi20170525.models.SendSmsResponse; |
| | | import com.aliyun.tea.TeaException; |
| | | import com.aliyun.teaopenapi.models.Config; |
| | | import com.aliyun.teautil.models.RuntimeOptions; |
| | | import com.ruoyi.system.model.TSysMessageConfig; |
| | | import com.ruoyi.system.service.TSysMessageConfigService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class MsgUtils { |
| | | |
| | | @Autowired |
| | | private TSysMessageConfigService messageConfigService; |
| | | |
| | | /** |
| | | * 使用AK&SK初始化账号Client |
| | | * @param accessKeyId |
| | | * @param accessKeySecret |
| | | * @return Client |
| | | * @throws Exception |
| | | */ |
| | | public static com.aliyun.dysmsapi20170525.Client createClient(String accessKeyId, String accessKeySecret) throws Exception { |
| | | Config config = new Config() |
| | | // 您的 AccessKey ID |
| | | .setAccessKeyId(accessKeyId) |
| | | // 您的 AccessKey Secret |
| | | .setAccessKeySecret(accessKeySecret); |
| | | // 访问的域名 |
| | | config.endpoint = "dysmsapi.aliyuncs.com"; |
| | | return new com.aliyun.dysmsapi20170525.Client(config); |
| | | } |
| | | |
| | | public void sendMsg(String phone, Map<String,String> params, String templateCode) throws Exception { |
| | | TSysMessageConfig sysMessageConfig = messageConfigService.getById(1); |
| | | com.aliyun.dysmsapi20170525.Client client = MsgUtils.createClient(sysMessageConfig.getAccessKeyId(),sysMessageConfig.getAccessKeySecret()); |
| | | SendSmsRequest sendSmsRequest = new SendSmsRequest() |
| | | .setSignName(sysMessageConfig.getSignName()) |
| | | .setTemplateCode(templateCode) |
| | | .setPhoneNumbers(phone); |
| | | if(!CollectionUtils.isEmpty(params)){ |
| | | StringBuilder builder = new StringBuilder(); |
| | | params.forEach((key,value)->{ |
| | | builder.append("\""+key+"\":\""+value+"\""); |
| | | builder.append(","); |
| | | }); |
| | | builder.deleteCharAt(builder.length()-1); |
| | | sendSmsRequest.setTemplateParam("{"+builder.toString()+"}"); |
| | | } |
| | | RuntimeOptions runtime = new RuntimeOptions(); |
| | | try { |
| | | // 复制代码运行请自行打印 API 的返回值 |
| | | SendSmsResponse sendSmsResponse = client.sendSmsWithOptions(sendSmsRequest, runtime); |
| | | log.info("短信发送成功:{},{}",sendSmsResponse.getBody().getMessage(),sendSmsResponse.getStatusCode()); |
| | | } catch (TeaException error) { |
| | | // 如有需要,请打印 error |
| | | com.aliyun.teautil.Common.assertAsString(error.message); |
| | | log.info("短信发送失败:{}",error.message); |
| | | } catch (Exception _error) { |
| | | TeaException error = new TeaException(_error.getMessage(), _error); |
| | | // 如有需要,请打印 error |
| | | com.aliyun.teautil.Common.assertAsString(error.message); |
| | | log.info("短信发送失败:{}",error.message); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * 模板消息发送地址 |
| | | */ |
| | | public static final String OFFICIAL_ACCOUNT_TEMPLATE_URL = "https://api.weixin.qq.com/cgi-bin/message/template/subscribe?access_token=ACCESS_TOKEN"; |
| | | public static final String OFFICIAL_ACCOUNT_TEMPLATE_URL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=ACCESS_TOKEN"; |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.export; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import cn.afterturn.easypoi.excel.annotation.ExcelCollection; |
| | | import com.ruoyi.system.model.TCrmBranchSalary; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "crm分公司管理导出TCrmBranchExport") |
| | | public class TCrmBranchExport implements Serializable { |
| | | |
| | | @Excel(name = "分公司名称", width = 20,needMerge = true) |
| | | private String branchName; |
| | | |
| | | @Excel(name = "负责人姓名", width = 20,needMerge = true) |
| | | private String userName; |
| | | |
| | | @Excel(name = "联系电话", width = 20,needMerge = true) |
| | | private String phone; |
| | | |
| | | @Excel(name = "剩余积分数", width = 20,needMerge = true) |
| | | private Integer userPoints; |
| | | |
| | | @Excel(name = "管辖区域", width = 20,needMerge = true) |
| | | private String areaNames; |
| | | |
| | | @Excel(name = "获取1积分所需采购金额", width = 20,needMerge = true) |
| | | private BigDecimal pointsCommission; |
| | | |
| | | @Excel(name = "分佣比例", width = 20,needMerge = true) |
| | | private BigDecimal moneyCommission; |
| | | |
| | | @ExcelCollection(name = "职位薪资") |
| | | private List<TCrmBranchSalary> crmBranchSalaries; |
| | | private String id; |
| | | |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.export; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel(value = "诊所审核导出TCrmClinicAuditExport") |
| | | public class TCrmClinicAuditExport implements Serializable { |
| | | |
| | | private String id; |
| | | @Excel(name = "诊所名称",width = 20) |
| | | private String clinicName; |
| | | @Excel(name = "负责人姓名",width = 20) |
| | | private String personChargeName; |
| | | @Excel(name = "联系电话",width = 20) |
| | | private String phone; |
| | | @Excel(name = "所属分公司",width = 20) |
| | | private String branchName; |
| | | @Excel(name = "负责业务员",width = 20) |
| | | private String salespersonName; |
| | | @Excel(name = "每月最低采购金额",width = 20) |
| | | private String lowProcurementMoneyStr; |
| | | private String lowProcurementMoney; |
| | | @Excel(name = "状态",width = 20,replace = {"待审核_1","已拒绝_2","使用中_3","冻结_4"}) |
| | | private Integer status; |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.export; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "诊所审核导出TCrmClinicAuditExport") |
| | | public class TCrmClinicListExport implements Serializable { |
| | | private String id; |
| | | @Excel(name = "诊所名称",width = 20) |
| | | private String clinicName; |
| | | @Excel(name = "负责人姓名",width = 20) |
| | | private String personChargeName; |
| | | @Excel(name = "联系电话",width = 20) |
| | | private String phone; |
| | | @Excel(name = "所属分公司",width = 20) |
| | | private String branchName; |
| | | @Excel(name = "负责业务员",width = 20) |
| | | private String salespersonName; |
| | | @Excel(name = "剩余积分",width = 20) |
| | | private Integer userPoints; |
| | | @Excel(name = "每月最低采购金额",width = 20) |
| | | private String lowProcurementMoneyStr; |
| | | private BigDecimal lowProcurementMoney; |
| | | @Excel(name = "当月采购金额",width = 20) |
| | | private String monthPurchaseAmountStr; |
| | | private BigDecimal monthPurchaseAmount; |
| | | @Excel(name = "业绩状态",width = 20,replace = {"未达成_1","已达成_2"}) |
| | | private Integer performanceStatus; |
| | | @Excel(name = "状态",width = 20,replace = {"待审核_1","已拒绝_2","使用中_3","冻结_4"}) |
| | | private Integer status; |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.export; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel(value = "慢性病患者管理列表导出诊所TSysAppUserClinicExport") |
| | | public class TSysAppUserClinicExport implements Serializable { |
| | | @Excel(name = "用户姓名", width = 20) |
| | | private String nickName; |
| | | |
| | | @Excel(name = "联系电话", width = 20) |
| | | private String phone; |
| | | |
| | | @Excel(name = "性别 1=男 2=女", width = 20,replace = {"男_1","女_2"}) |
| | | private Integer sex; |
| | | |
| | | @Excel(name = "年龄", width = 20) |
| | | private Long age; |
| | | |
| | | @Excel(name = "慢性病名称拼接", width = 20) |
| | | private String sysChronicDiseaseNames; |
| | | |
| | | @Excel(name = "上次短信提醒时间", width = 20) |
| | | private String lastReminderTime; |
| | | private String chronicDiseaseId; |
| | | |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.export; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel(value = "慢性病患者管理列表导出诊所TSysAppUserClinicExport") |
| | | public class TSysAppUserExport implements Serializable { |
| | | @Excel(name = "用户姓名", width = 20) |
| | | private String nickName; |
| | | |
| | | @Excel(name = "联系电话", width = 20) |
| | | private String phone; |
| | | |
| | | @Excel(name = "性别 1=男 2=女", width = 20,replace = {"男_1","女_2"}) |
| | | private Integer sex; |
| | | |
| | | @Excel(name = "年龄", width = 20) |
| | | private Long age; |
| | | |
| | | @Excel(name = "是否慢性病患者", width = 20,replace = {"是_1","否_0"}) |
| | | private Integer isInspection; |
| | | |
| | | @Excel(name = "慢性病名称拼接", width = 20) |
| | | private String sysChronicDiseaseNames; |
| | | |
| | | @Excel(name = "最近检测时间", width = 20) |
| | | private String lastInspectionTime; |
| | | @Excel(name = "注册时间", width = 20) |
| | | private String createTimeStr; |
| | | private LocalDateTime createTime; |
| | | private String chronicDiseaseId; |
| | | private LocalDateTime birthTime; |
| | | |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.export; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel(value = "慢性病患者管理列表导出平台TSysAppUserListExport") |
| | | public class TSysAppUserListExport implements Serializable { |
| | | @Excel(name = "用户姓名", width = 20) |
| | | private String nickName; |
| | | |
| | | @Excel(name = "联系电话", width = 20) |
| | | private String phone; |
| | | |
| | | @Excel(name = "性别 1=男 2=女", width = 20,replace = {"男_1","女_2"}) |
| | | private Integer sex; |
| | | |
| | | @Excel(name = "年龄", width = 20) |
| | | private Long age; |
| | | |
| | | @Excel(name = "慢性病名称拼接", width = 20) |
| | | private String sysChronicDiseaseNames; |
| | | private String chronicDiseaseId; |
| | | |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.listener.event.PublishTopicLiveInfoEvent; |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import com.ruoyi.system.model.TCrmSalesperson; |
| | |
| | | List<Long> userIds = clinicList.stream().map(TCrmClinic::getUserId).collect(Collectors.toList()); |
| | | List<SysUser> sysUserList = sysUserService.selectUserListByIds(userIds); |
| | | for (SysUser user : sysUserList) { |
| | | templateMessageSendUtil.wxOfficeTemplateAppLiveRequest(user.getOpenId(),liveTitle,liveStartTime); |
| | | if(StringUtils.isNotEmpty(user.getOpenId())){ |
| | | templateMessageSendUtil.wxOfficeTemplateAppLiveRequest(user.getOpenId(),liveTitle,liveStartTime); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | // 用户 |
| | | List<TSysAppUser> sysAppUsers = sysAppUserService.list(); |
| | | for (TSysAppUser sysAppUser : sysAppUsers) { |
| | | templateMessageSendUtil.wxOfficeTemplateAppLiveRequest(sysAppUser.getOfficeOpenId(),liveTitle,liveStartTime); |
| | | if(StringUtils.isNotEmpty(sysAppUser.getOfficeOpenId())){ |
| | | templateMessageSendUtil.wxOfficeTemplateAppLiveRequest(sysAppUser.getOfficeOpenId(),liveTitle,liveStartTime); |
| | | } |
| | | } |
| | | } |
| | | if(pushType.contains("3")){ |
| | |
| | | List<Long> userIds = crmSalespeopleList.stream().map(TCrmSalesperson::getUserId).collect(Collectors.toList()); |
| | | List<SysUser> sysUserList = sysUserService.selectUserListByIds(userIds); |
| | | for (SysUser user : sysUserList) { |
| | | templateMessageSendUtil.wxOfficeTemplateAppLiveRequest(user.getOpenId(),liveTitle,liveStartTime); |
| | | if(StringUtils.isNotEmpty(user.getOpenId())){ |
| | | templateMessageSendUtil.wxOfficeTemplateAppLiveRequest(user.getOpenId(),liveTitle,liveStartTime); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.export.TCrmBranchExport; |
| | | import com.ruoyi.system.model.TCrmBranch; |
| | | import com.ruoyi.system.query.TCrmBranchQuery; |
| | | import com.ruoyi.system.vo.TCrmBranchVO; |
| | |
| | | * @return |
| | | */ |
| | | List<TCrmBranchVO> pageList(@Param("query") TCrmBranchQuery query, @Param("pageInfo")PageInfo<TCrmBranchVO> pageInfo); |
| | | |
| | | /** |
| | | * 导出列表 |
| | | * |
| | | * @param query 查询参数 |
| | | * @return |
| | | */ |
| | | List<TCrmBranchExport> exportList(@Param("query")TCrmBranchQuery query); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.export.TCrmClinicAuditExport; |
| | | import com.ruoyi.system.export.TCrmClinicListExport; |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import com.ruoyi.system.query.TCrmClinicQuery; |
| | | import com.ruoyi.system.vo.TCrmClinicVO; |
| | |
| | | */ |
| | | List<TCrmClinicVO> pageAuditList(@Param("query") TCrmClinicQuery query, @Param("pageInfo")PageInfo<TCrmClinicVO> pageInfo); |
| | | |
| | | /** |
| | | * 审核导出 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TCrmClinicAuditExport> exportAudit(@Param("query")TCrmClinicQuery query); |
| | | |
| | | /** |
| | | * 列表导出 |
| | | * @param query |
| | | * @return |
| | | * @author xiaochen |
| | | * @date 2025/8/20 10:09 |
| | | */ |
| | | List<TCrmClinicListExport> exportList(@Param("query")TCrmClinicQuery query); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.export.TSysAppUserClinicExport; |
| | | import com.ruoyi.system.export.TSysAppUserExport; |
| | | import com.ruoyi.system.export.TSysAppUserListExport; |
| | | import com.ruoyi.system.model.TSysAppUser; |
| | | import com.ruoyi.system.query.TCrmClinicQuery; |
| | | import com.ruoyi.system.query.TSysAppUserQuery; |
| | | import com.ruoyi.system.vo.TSysAppUserVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | * @return |
| | | */ |
| | | List<TSysAppUserVO> pageChronicDiseaseUserList(@Param("query")TSysAppUserQuery query, @Param("pageInfo")PageInfo<TSysAppUserVO> pageInfo); |
| | | |
| | | /** |
| | | * 导出列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TSysAppUserListExport> exportList(@Param("query")TSysAppUserQuery query); |
| | | |
| | | /** |
| | | * 导出列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TSysAppUserClinicExport> exportListClinic(@Param("query")TSysAppUserQuery query); |
| | | |
| | | /** |
| | | * 导出列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TSysAppUserExport> exportListAppUser(@Param("query")TSysAppUserQuery query); |
| | | } |
| | |
| | | @TableField("audit_remark") |
| | | private String auditRemark; |
| | | |
| | | @ApiModelProperty(value = "业绩未达标次数") |
| | | @TableField("performance_count") |
| | | private Integer performanceCount; |
| | | |
| | | } |
| | |
| | | @TableField("template_content") |
| | | private String templateContent; |
| | | |
| | | @ApiModelProperty(value = "类型 1=验证码 2=业绩提醒 3=用药提醒") |
| | | @TableField("template_type") |
| | | private Integer templateType; |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.joda.time.LocalDateTime; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | @ApiModel(value = "crm诊所管理查询参数TCrmClinicQuery") |
| | |
| | | @ApiModelProperty(value = "业务员id") |
| | | private String salespersonId; |
| | | |
| | | @ApiModelProperty(value = "业绩状态 1=已达成 2=未达成") |
| | | @ApiModelProperty(value = "业绩状态 1=未达成 2=已达成") |
| | | private Integer performanceStatus; |
| | | |
| | | @ApiModelProperty(value = "状态 1=待审核 2=已拒绝 3=使用中 4=冻结") |
| | |
| | | private Long userId; |
| | | @ApiModelProperty(value = "前端忽略") |
| | | private Integer roleType; |
| | | @ApiModelProperty(value = "前端忽略") |
| | | private LocalDate createTime; |
| | | |
| | | } |
| | |
| | | void updateUserStatusByUserIds(List<Long> userIds, String status); |
| | | |
| | | List<SysUser> selectUserListByIds(List<Long> userIds); |
| | | |
| | | int updateUserInfo(SysUser sysUser); |
| | | } |
| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.dto.TCrmBranchDTO; |
| | | import com.ruoyi.system.export.TCrmBranchExport; |
| | | import com.ruoyi.system.model.TCrmBranch; |
| | | import com.ruoyi.system.model.TCrmDevice; |
| | | import com.ruoyi.system.query.TCrmBranchQuery; |
| | | import com.ruoyi.system.query.TSysAppUserQuery; |
| | | import com.ruoyi.system.vo.TCrmBranchVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | R<Boolean> updateBranch(TCrmBranchDTO dto); |
| | | |
| | | /** |
| | | * 导出 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TCrmBranchExport> exportList(TCrmBranchQuery query); |
| | | } |
| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.dto.TCrmClinicDTO; |
| | | import com.ruoyi.system.export.TCrmClinicAuditExport; |
| | | import com.ruoyi.system.export.TCrmClinicListExport; |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import com.ruoyi.system.query.TCrmClinicQuery; |
| | | import com.ruoyi.system.vo.TCrmClinicVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | R<Boolean> updateClinic(TCrmClinicDTO dto); |
| | | |
| | | /** |
| | | * 获取crm诊所管理审核列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TCrmClinicAuditExport> exportAudit(TCrmClinicQuery query); |
| | | |
| | | /** |
| | | * 获取crm诊所管理列表导出 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TCrmClinicListExport> exportList(TCrmClinicQuery query); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.export.TSysAppUserClinicExport; |
| | | import com.ruoyi.system.export.TSysAppUserExport; |
| | | import com.ruoyi.system.export.TSysAppUserListExport; |
| | | import com.ruoyi.system.model.TSysAppUser; |
| | | import com.ruoyi.system.query.TCrmClinicQuery; |
| | | import com.ruoyi.system.query.TSysAppUserQuery; |
| | | import com.ruoyi.system.vo.TSysAppUserVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | PageInfo<TSysAppUserVO> pageChronicDiseaseUserList(TSysAppUserQuery query); |
| | | |
| | | /** |
| | | * 患者导出平台 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TSysAppUserListExport> exportList(TSysAppUserQuery query); |
| | | |
| | | /** |
| | | * 患者导出诊所 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TSysAppUserClinicExport> exportListClinic(TSysAppUserQuery query); |
| | | |
| | | /** |
| | | * 患者导出APP |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TSysAppUserExport> exportListAppUser(TSysAppUserQuery query); |
| | | } |
| | |
| | | return userMapper.selectUserListByIds(userIds); |
| | | } |
| | | |
| | | @Override |
| | | public int updateUserInfo(SysUser sysUser) { |
| | | return userMapper.updateUser(sysUser); |
| | | } |
| | | |
| | | // @Override |
| | | // public UserInfoVo userInfo(Long userId) { |
| | | // return userMapper.userInfo(userId); |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.dto.TCrmBranchDTO; |
| | | import com.ruoyi.system.export.TCrmBranchExport; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.mapper.TCrmBranchMapper; |
| | | import com.ruoyi.system.model.TCrmBranch; |
| | | import com.ruoyi.system.model.TCrmBranchArea; |
| | | import com.ruoyi.system.model.TCrmBranchSalary; |
| | | import com.ruoyi.system.query.TCrmBranchQuery; |
| | | import com.ruoyi.system.query.TSysAppUserQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TCrmBranchAreaService; |
| | | import com.ruoyi.system.service.TCrmBranchSalaryService; |
| | |
| | | // } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public List<TCrmBranchExport> exportList(TCrmBranchQuery query) { |
| | | List<TCrmBranchArea> crmBranchAreas = new ArrayList<>(); |
| | | if(StringUtils.isNotEmpty(query.getCityCode())){ |
| | | crmBranchAreas = crmBranchAreaService.list(Wrappers.lambdaQuery(TCrmBranchArea.class) |
| | | .eq(TCrmBranchArea::getCityCode, query.getCityCode())); |
| | | } |
| | | |
| | | if(StringUtils.isNotEmpty(query.getProvinceCode())){ |
| | | crmBranchAreas = crmBranchAreaService.list(Wrappers.lambdaQuery(TCrmBranchArea.class) |
| | | .eq(TCrmBranchArea::getProvinceCode, query.getProvinceCode())); |
| | | } |
| | | if(!CollectionUtils.isEmpty(crmBranchAreas)){ |
| | | List<String> branchIds = crmBranchAreas.stream().map(TCrmBranchArea::getBranchId).collect(Collectors.toList()); |
| | | query.setBranchIds(branchIds); |
| | | }else { |
| | | return new ArrayList<>(); |
| | | } |
| | | List<TCrmBranchExport> list = this.baseMapper.exportList(query); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return list; |
| | | } |
| | | List<String> branchIds = list.stream().map(TCrmBranchExport::getId).collect(Collectors.toList()); |
| | | List<TCrmBranchArea> crmBranchAreaList = crmBranchAreaService.list(Wrappers.lambdaQuery(TCrmBranchArea.class) |
| | | .in(TCrmBranchArea::getBranchId, branchIds)); |
| | | // 查询职位薪资 |
| | | List<TCrmBranchSalary> crmBranchSalaries = crmBranchSalaryService.list(Wrappers.lambdaQuery(TCrmBranchSalary.class) |
| | | .in(TCrmBranchSalary::getBranchId, branchIds)); |
| | | for (TCrmBranchExport crmBranchExport : list) { |
| | | List<TCrmBranchArea> tCrmBranchAreas = crmBranchAreaList.stream().filter(t -> t.getBranchId().equals(crmBranchExport.getId())).collect(Collectors.toList()); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (TCrmBranchArea tCrmBranchArea : tCrmBranchAreas) { |
| | | stringBuilder.append(tCrmBranchArea.getProvinceName()).append("-").append(tCrmBranchArea.getCityName()).append(","); |
| | | } |
| | | // 去除',' |
| | | stringBuilder.deleteCharAt(stringBuilder.length()-1); |
| | | crmBranchExport.setAreaNames(stringBuilder.toString()); |
| | | // 职位薪资 |
| | | List<TCrmBranchSalary> crmBranchSalariesList = crmBranchSalaries.stream().filter(t -> t.getBranchId().equals(crmBranchExport.getId())).collect(Collectors.toList()); |
| | | crmBranchExport.setCrmBranchSalaries(crmBranchSalariesList); |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.dto.TCrmClinicDTO; |
| | | import com.ruoyi.system.export.TCrmClinicAuditExport; |
| | | import com.ruoyi.system.export.TCrmClinicListExport; |
| | | import com.ruoyi.system.mapper.TCrmClinicMapper; |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import com.ruoyi.system.model.TErpProcurement; |
| | | import com.ruoyi.system.query.TCrmClinicQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TCrmClinicService; |
| | | import com.ruoyi.system.service.TErpProcurementService; |
| | | import com.ruoyi.system.vo.TCrmClinicVO; |
| | | import com.ruoyi.system.vo.TCrmSupplierVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | @Autowired |
| | | private TErpProcurementService erpProcurementService; |
| | | |
| | | @Override |
| | | public PageInfo<TCrmClinicVO> pageList(TCrmClinicQuery query) { |
| | | |
| | | // TODO 业绩状态查询处理 |
| | | |
| | | query.setCreateTime(LocalDate.now()); |
| | | PageInfo<TCrmClinicVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TCrmClinicVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
| | | } |
| | | |
| | | List<String> clinicIds = list.stream().map(TCrmClinicVO::getId).collect(Collectors.toList()); |
| | | List<TErpProcurement> procurements = erpProcurementService.list(Wrappers.lambdaQuery(TErpProcurement.class) |
| | | .in(TErpProcurement::getClinicId, clinicIds) |
| | | .in(TErpProcurement::getStatus, Arrays.asList(3,4,5)) |
| | | .likeRight(TErpProcurement::getCreateTime, LocalDate.now())); |
| | | for (TCrmClinicVO tCrmClinicVO : list) { |
| | | List<TErpProcurement> procurementList = procurements.stream().filter(procurement -> procurement.getClinicId().equals(tCrmClinicVO.getId())).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(procurementList)){ |
| | | tCrmClinicVO.setMonthPurchaseAmount(procurementList.stream().map(TErpProcurement::getPayMoney).reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | } |
| | | |
| | | if(Objects.nonNull(tCrmClinicVO.getMonthPurchaseAmount()) && tCrmClinicVO.getMonthPurchaseAmount().compareTo(tCrmClinicVO.getLowProcurementMoney())>0){ |
| | | tCrmClinicVO.setPerformanceStatus(2); |
| | | } |
| | | |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TCrmClinicVO> pageAuditList(TCrmClinicQuery query) { |
| | | |
| | | // TODO 业绩状态查询处理 |
| | | |
| | | PageInfo<TCrmClinicVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TCrmClinicVO> list = this.baseMapper.pageAuditList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public List<TCrmClinicAuditExport> exportAudit(TCrmClinicQuery query) { |
| | | List<TCrmClinicAuditExport> list = this.baseMapper.exportAudit(query); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<TCrmClinicListExport> exportList(TCrmClinicQuery query) { |
| | | query.setCreateTime(LocalDate.now()); |
| | | List<TCrmClinicListExport> list = this.baseMapper.exportList(query); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return list; |
| | | } |
| | | |
| | | List<String> clinicIds = list.stream().map(TCrmClinicListExport::getId).collect(Collectors.toList()); |
| | | List<TErpProcurement> procurements = erpProcurementService.list(Wrappers.lambdaQuery(TErpProcurement.class) |
| | | .in(TErpProcurement::getClinicId, clinicIds) |
| | | .in(TErpProcurement::getStatus, Arrays.asList(3,4,5)) |
| | | .likeRight(TErpProcurement::getCreateTime, LocalDate.now())); |
| | | for (TCrmClinicListExport crmClinicListExport : list) { |
| | | List<TErpProcurement> procurementList = procurements.stream().filter(procurement -> procurement.getClinicId().equals(crmClinicListExport.getId())).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(procurementList)){ |
| | | crmClinicListExport.setMonthPurchaseAmount(procurementList.stream().map(TErpProcurement::getPayMoney).reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | } |
| | | |
| | | if(Objects.nonNull(crmClinicListExport.getMonthPurchaseAmount()) && crmClinicListExport.getMonthPurchaseAmount().compareTo(crmClinicListExport.getLowProcurementMoney())>0){ |
| | | crmClinicListExport.setPerformanceStatus(2); |
| | | } |
| | | |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | |
| | | if (CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
| | | } |
| | | if(query.getRoleType() == 5){ |
| | | if(Objects.nonNull(query.getRoleType()) && query.getRoleType() == 5){ |
| | | Long userId = query.getUserId(); |
| | | for (TSysActivityVO sysActivityVO : list) { |
| | | Set<Long> cacheSet = redisCache.getCacheSet(Constants.SYS_ACTIVITY_CLICK_COUNT + sysActivityVO.getId()); |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.export.TSysAppUserClinicExport; |
| | | import com.ruoyi.system.export.TSysAppUserExport; |
| | | import com.ruoyi.system.export.TSysAppUserListExport; |
| | | import com.ruoyi.system.mapper.TSysAppUserMapper; |
| | | import com.ruoyi.system.mapper.TSysChronicDiseaseMapper; |
| | | import com.ruoyi.system.model.TSysAppUser; |
| | | import com.ruoyi.system.model.TSysActivity; |
| | | import com.ruoyi.system.model.TSysAppUser; |
| | | import com.ruoyi.system.model.TSysChronicDisease; |
| | | import com.ruoyi.system.query.TCrmClinicQuery; |
| | | import com.ruoyi.system.query.TSysAppUserQuery; |
| | | import com.ruoyi.system.service.TSysAppUserService; |
| | | import com.ruoyi.system.vo.TSysAppUserVO; |
| | |
| | | if(tSysAppUserVO.getBirthTime() != null){ |
| | | long age = ChronoUnit.YEARS.between(tSysAppUserVO.getBirthTime(), LocalDateTime.now()); |
| | | tSysAppUserVO.setAge(age); |
| | | } |
| | | if(StringUtils.isNotEmpty(tSysAppUserVO.getChronicDiseaseId())){ |
| | | tSysAppUserVO.setIsInspection(1); |
| | | }else { |
| | | tSysAppUserVO.setIsInspection(0); |
| | | } |
| | | }); |
| | | pageInfo.setRecords(list); |
| | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public List<TSysAppUserListExport> exportList(TSysAppUserQuery query) { |
| | | List<TSysAppUserListExport> list = this.baseMapper.exportList(query); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return list; |
| | | } |
| | | List<TSysChronicDisease> sysChronicDiseaseList = sysChronicDiseaseMapper.selectList(Wrappers.lambdaQuery(TSysChronicDisease.class)); |
| | | for (TSysAppUserListExport sysAppUserListExport : list) { |
| | | String chronicDiseaseId = sysAppUserListExport.getChronicDiseaseId(); |
| | | String[] split = chronicDiseaseId.split(","); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (String diseaseId : split) { |
| | | List<TSysChronicDisease> chronicDiseaseList = sysChronicDiseaseList.stream().filter(disease -> disease.getId().equals(diseaseId)).collect(Collectors.toList()); |
| | | // 最后一位不拼接逗号 |
| | | if(diseaseId.equals(split[split.length-1])){ |
| | | stringBuilder.append(chronicDiseaseList.get(0).getChronicName()); |
| | | }else{ |
| | | stringBuilder.append(chronicDiseaseList.get(0).getChronicName()).append(","); |
| | | } |
| | | } |
| | | sysAppUserListExport.setSysChronicDiseaseNames(stringBuilder.toString()); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<TSysAppUserClinicExport> exportListClinic(TSysAppUserQuery query) { |
| | | List<TSysAppUserClinicExport> list = this.baseMapper.exportListClinic(query); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return list; |
| | | } |
| | | List<TSysChronicDisease> sysChronicDiseaseList = sysChronicDiseaseMapper.selectList(Wrappers.lambdaQuery(TSysChronicDisease.class)); |
| | | for (TSysAppUserClinicExport sysAppUserClinicExport : list) { |
| | | String chronicDiseaseId = sysAppUserClinicExport.getChronicDiseaseId(); |
| | | String[] split = chronicDiseaseId.split(","); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (String diseaseId : split) { |
| | | List<TSysChronicDisease> chronicDiseaseList = sysChronicDiseaseList.stream().filter(disease -> disease.getId().equals(diseaseId)).collect(Collectors.toList()); |
| | | // 最后一位不拼接逗号 |
| | | if(diseaseId.equals(split[split.length-1])){ |
| | | stringBuilder.append(chronicDiseaseList.get(0).getChronicName()); |
| | | }else{ |
| | | stringBuilder.append(chronicDiseaseList.get(0).getChronicName()).append(","); |
| | | } |
| | | } |
| | | sysAppUserClinicExport.setSysChronicDiseaseNames(stringBuilder.toString()); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<TSysAppUserExport> exportListAppUser(TSysAppUserQuery query) { |
| | | List<TSysAppUserExport> list = this.baseMapper.exportListAppUser(query); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return list; |
| | | } |
| | | // 年龄计算 |
| | | list.forEach(tSysAppUserVO -> { |
| | | if(tSysAppUserVO.getBirthTime() != null){ |
| | | long age = ChronoUnit.YEARS.between(tSysAppUserVO.getBirthTime(), LocalDateTime.now()); |
| | | tSysAppUserVO.setAge(age); |
| | | } |
| | | if(StringUtils.isNotEmpty(tSysAppUserVO.getChronicDiseaseId())){ |
| | | tSysAppUserVO.setIsInspection(1); |
| | | }else { |
| | | tSysAppUserVO.setIsInspection(0); |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | |
| | | if (CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
| | | } |
| | | if(query.getRoleType() == 5){ |
| | | if(Objects.nonNull(query.getRoleType()) && query.getRoleType() == 5){ |
| | | Long userId = query.getUserId(); |
| | | for (TSysEducationalInfoVO sysEducationalInfoVO : list) { |
| | | Set<Long> cacheSet = redisCache.getCacheSet(Constants.SYS_EDUCATION_CLICK_COUNT + sysEducationalInfoVO.getId()); |
| | |
| | | // boolean memberInSet = redisCache.isMemberInSet(Constants.LIVE_APPOINTMENT_PUSH + sysLive.getId(), query.getAppUserId()); |
| | | // sysLive.setAppointmentStatus(memberInSet ? 2 : 1); |
| | | |
| | | if(query.getRoleType() == 5){ |
| | | if(Objects.nonNull(query.getRoleType()) && query.getRoleType() == 5){ |
| | | Long userId = query.getUserId(); |
| | | Set<Long> cacheSet = redisCache.getCacheSet(Constants.SYS_ACTIVITY_CLICK_COUNT + sysLive.getId()); |
| | | if(cacheSet.contains(userId)){ |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | |
| | | if (CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
| | | } |
| | | if(query.getRoleType() == 5){ |
| | | if(Objects.nonNull(query.getRoleType()) && query.getRoleType() == 5){ |
| | | Long userId = query.getUserId(); |
| | | for (TSysProductIntroductionVO tSysProductIntroduction : list) { |
| | | Set<Long> cacheSet = redisCache.getCacheSet(Constants.SYS_PRODUCT_CLICK_COUNT + tSysProductIntroduction.getId()); |
| New file |
| | |
| | | package com.ruoyi.system.utils.wx.pojo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName AppletUserDecodeData |
| | | * @Description |
| | | * 小程序加密数据体 |
| | | * |
| | | */ |
| | | @Data |
| | | public class OfficeUserEncrypteData implements Serializable { |
| | | private String code; |
| | | private String phone; |
| | | } |
| | |
| | | @ApiModelProperty(value = "消息模板id") |
| | | private String template_id; |
| | | |
| | | @ApiModelProperty(value = "订阅场景值") |
| | | private String scene = "1000"; |
| | | |
| | | @ApiModelProperty(value = "订阅通知") |
| | | private String title = "课程预约结果通知"; |
| | | // @ApiModelProperty(value = "订阅场景值") |
| | | // private String scene = "1000"; |
| | | // |
| | | // @ApiModelProperty(value = "订阅通知") |
| | | // private String title = "课程预约结果通知"; |
| | | |
| | | @ApiModelProperty(value = "消息模板data数据") |
| | | private WxOfficeTemplateAppLiveResultRequestData data; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 微信公众号获取openId |
| | | * 微信公众号/服务号获取openId |
| | | * @param resqBody |
| | | * @return |
| | | */ |
| | |
| | | @ApiModelProperty(value = "当月采购金额") |
| | | private BigDecimal monthPurchaseAmount; |
| | | |
| | | @ApiModelProperty(value = "剩余积分") |
| | | private Integer userPoints; |
| | | |
| | | @ApiModelProperty(value = "业绩状态 1=未达成 2=已达成") |
| | | private Integer performanceStatus; |
| | | private Integer performanceStatus = 1; |
| | | |
| | | } |
| | |
| | | <if test="loginDate != null">login_date = #{loginDate},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="ifBlack != null">ifBlack = #{ifBlack},</if> |
| | | <if test="districtId != null">districtId = #{districtId},</if> |
| | | <if test="disableRemark != null">disable_remark = #{disableRemark},</if> |
| | | <if test="operatingTime != null">operating_time = #{operatingTime},</if> |
| | | <if test="operatingPerson != null">operating_person = #{operatingPerson},</if> |
| | | <if test="openId != null">open_id = #{openId},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where user_id = #{userId} |
| | |
| | | </where> |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | <select id="exportList" resultType="com.ruoyi.system.export.TCrmBranchExport"> |
| | | select id, user_id, branch_name, user_name, phone, money_commission, points_commission, |
| | | user_points, status, create_time, update_time, create_by, update_by, disabled |
| | | from t_crm_branch |
| | | <where> |
| | | <if test="query.branchName != null and query.branchName != ''"> |
| | | and branch_name like concat('%',#{query.branchName},'%') |
| | | </if> |
| | | <if test="query.userName != null and query.userName != ''"> |
| | | and user_name like concat('%',#{query.userName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and status = #{query.status} |
| | | </if> |
| | | <if test="query.branchIds != null and query.branchIds.size()>0"> |
| | | and id in |
| | | <foreach item="item" collection="query.branchIds" separator="," open="(" close=")" index=""> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="qualification_picture" property="qualificationPicture" /> |
| | | <result column="status" property="status" /> |
| | | <result column="audit_remark" property="auditRemark" /> |
| | | <result column="performance_count" property="performanceCount" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, branch_id, salesperson_id, warehouse_id,user_id, clinic_name, person_charge_name, phone, low_procurement_money, |
| | | clinic_address, qualification_picture, status,audit_remark, create_time, update_time, create_by, update_by, disabled |
| | | clinic_address, qualification_picture, status,audit_remark,performance_count, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TCrmClinicVO"> |
| | | SELECT |
| | | tcc.id, tcc.branch_id, tcc.salesperson_id, tcc.warehouse_id,tcc.user_id, tcc.clinic_name, tcc.person_charge_name, |
| | | tcc.phone, tcc.low_procurement_money, tcc.clinic_address, tcc.qualification_picture, tcc.status,tcc.audit_remark, |
| | | tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled, |
| | | tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count, |
| | | tcb.branch_name, tcs.salesperson_name, tcw.warehouse_name |
| | | from t_crm_clinic tcc |
| | | left join t_crm_branch tcb on tcc.branch_id = tcb.id |
| | |
| | | <if test="query.salespersonId != null and query.salespersonId != ''"> |
| | | and tcc.salesperson_id = #{query.salespersonId} |
| | | </if> |
| | | <!-- <if test="query.performanceStatus != null">--> |
| | | <!-- and tcc.salesperson_id = #{query.performanceStatus}--> |
| | | <!-- </if>--> |
| | | <if test="query.performanceStatus != null and query.performanceStatus == 1"> |
| | | and tcc.low_procurement_money < (SELECT IFNULL(SUM(pay_money),0) FROM |
| | | t_erp_procurement |
| | | WHERE clinic_id = tcc.id AND status in (3,4,5) |
| | | AND create_time LIKE concat(#{query.createTime},'%') |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | ) |
| | | </if> |
| | | <if test="query.performanceStatus != null and query.performanceStatus == 2"> |
| | | and tcc.low_procurement_money >= (SELECT IFNULL(SUM(pay_money),0) FROM |
| | | t_erp_procurement |
| | | WHERE clinic_id = tcc.id AND status in (3,4,5) |
| | | AND create_time LIKE concat(#{query.createTime},'%') |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | ) |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and tcc.status = #{query.status} |
| | | </if> |
| | |
| | | SELECT |
| | | tcc.id, tcc.branch_id, tcc.salesperson_id, tcc.warehouse_id,tcc.user_id, tcc.clinic_name, tcc.person_charge_name, |
| | | tcc.phone, tcc.low_procurement_money, tcc.clinic_address, tcc.qualification_picture, tcc.status,tcc.audit_remark, |
| | | tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled, |
| | | tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count, |
| | | tcb.branch_name, tcs.salesperson_name, tcw.warehouse_name |
| | | from t_crm_clinic tcc |
| | | left join t_crm_branch tcb on tcc.branch_id = tcb.id |
| | |
| | | <if test="query.salespersonId != null and query.salespersonId != ''"> |
| | | and tcc.salesperson_id = #{query.salespersonId} |
| | | </if> |
| | | <!-- <if test="query.performanceStatus != null">--> |
| | | <!-- and tcc.salesperson_id = #{query.performanceStatus}--> |
| | | <!-- </if>--> |
| | | <if test="query.status != null"> |
| | | and tcc.status = #{query.status} |
| | | </if> |
| | |
| | | </where> |
| | | ORDER BY tcc.create_time DESC |
| | | </select> |
| | | <select id="exportAudit" resultType="com.ruoyi.system.export.TCrmClinicAuditExport"> |
| | | SELECT |
| | | tcc.id, tcc.branch_id, tcc.salesperson_id, tcc.warehouse_id,tcc.user_id, tcc.clinic_name, tcc.person_charge_name, |
| | | tcc.phone, tcc.low_procurement_money, tcc.clinic_address, tcc.qualification_picture, tcc.status,tcc.audit_remark, |
| | | tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count, |
| | | tcb.branch_name, tcs.salesperson_name, tcw.warehouse_name |
| | | from t_crm_clinic tcc |
| | | left join t_crm_branch tcb on tcc.branch_id = tcb.id |
| | | left join t_crm_salesperson tcs on tcc.salesperson_id = tcs.id |
| | | left join t_crm_warehouse tcw on tcc.warehouse_id = tcw.id |
| | | <where> |
| | | <if test="query.clinicName != null and query.clinicName != ''"> |
| | | and tcc.clinic_name like concat('%',#{query.clinicName},'%') |
| | | </if> |
| | | <if test="query.personChargeName != null and query.personChargeName != ''"> |
| | | and tcc.person_charge_name like concat('%',#{query.personChargeName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tcc.phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | <if test="query.branchId != null and query.branchId != ''"> |
| | | and tcc.branch_id = #{query.branchId} |
| | | </if> |
| | | <if test="query.salespersonId != null and query.salespersonId != ''"> |
| | | and tcc.salesperson_id = #{query.salespersonId} |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and tcc.status = #{query.status} |
| | | </if> |
| | | and tcc.status in (1,2) |
| | | AND tcc.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY tcc.create_time DESC |
| | | </select> |
| | | <select id="exportList" resultType="com.ruoyi.system.export.TCrmClinicListExport"> |
| | | SELECT |
| | | tcc.id, tcc.branch_id, tcc.salesperson_id, tcc.warehouse_id,tcc.user_id, tcc.clinic_name, tcc.person_charge_name, |
| | | tcc.phone, tcc.low_procurement_money, tcc.clinic_address, tcc.qualification_picture, tcc.status,tcc.audit_remark, |
| | | tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count, |
| | | tcb.branch_name, tcs.salesperson_name, tcw.warehouse_name |
| | | from t_crm_clinic tcc |
| | | left join t_crm_branch tcb on tcc.branch_id = tcb.id |
| | | left join t_crm_salesperson tcs on tcc.salesperson_id = tcs.id |
| | | left join t_crm_warehouse tcw on tcc.warehouse_id = tcw.id |
| | | <where> |
| | | <if test="query.clinicName != null and query.clinicName != ''"> |
| | | and tcc.clinic_name like concat('%',#{query.clinicName},'%') |
| | | </if> |
| | | <if test="query.personChargeName != null and query.personChargeName != ''"> |
| | | and tcc.person_charge_name like concat('%',#{query.personChargeName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tcc.phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | <if test="query.branchId != null and query.branchId != ''"> |
| | | and tcc.branch_id = #{query.branchId} |
| | | </if> |
| | | <if test="query.salespersonId != null and query.salespersonId != ''"> |
| | | and tcc.salesperson_id = #{query.salespersonId} |
| | | </if> |
| | | <if test="query.performanceStatus != null and query.performanceStatus == 1"> |
| | | and tcc.low_procurement_money < (SELECT IFNULL(SUM(pay_money),0) FROM |
| | | t_erp_procurement |
| | | WHERE clinic_id = tcc.id AND status in (3,4,5) |
| | | AND create_time LIKE concat(#{query.createTime},'%') |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | ) |
| | | </if> |
| | | <if test="query.performanceStatus != null and query.performanceStatus == 2"> |
| | | and tcc.low_procurement_money >= (SELECT IFNULL(SUM(pay_money),0) FROM |
| | | t_erp_procurement |
| | | WHERE clinic_id = tcc.id AND status in (3,4,5) |
| | | AND create_time LIKE concat(#{query.createTime},'%') |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | ) |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and tcc.status = #{query.status} |
| | | </if> |
| | | <if test="query.branchId != null and query.userId == 2"> |
| | | and tcc.branch_id = #{query.branchId} |
| | | </if> |
| | | <if test="query.salespersonId != null and query.userId == 3"> |
| | | and tcc.salesperson_id = #{query.salespersonId} |
| | | </if> |
| | | and tcc.status in (3,4) |
| | | AND tcc.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY tcc.create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <if test="query.status != null"> |
| | | AND status = #{query.status} |
| | | </if> |
| | | <if test="roleType != null and query.roleType == 5"> |
| | | <if test="query.roleType != null and query.roleType == 5"> |
| | | AND show_type in (2,3) |
| | | </if> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | |
| | | tsau.chronic_disease_id,tsau.status,tsau.last_reminder_time, tsau.create_time, tsau.update_time, tsau.create_by, |
| | | tsau.update_by, tsau.disabled |
| | | from t_sys_app_user tsau |
| | | left join (select id,app_user_id, max(check_time) as lastInspectionTime from t_sys_inspection limit 1) tsi on tsi.app_user_id = tsau.id |
| | | <where> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tsau.phone = #{query.phone} |
| | |
| | | </where> |
| | | ORDER BY tsau.create_time DESC |
| | | </select> |
| | | <select id="exportList" resultType="com.ruoyi.system.export.TSysAppUserListExport"> |
| | | select tsau.id, tsau.nick_name, tsau.phone, tsau.birth_time, tsau.sex, tsau.open_id,tsau.office_open_id, |
| | | tsau.chronic_disease_id,tsau.status,tsau.last_reminder_time, tsau.create_time, tsau.update_time, tsau.create_by, |
| | | tsau.update_by, tsau.disabled |
| | | from t_sys_app_user tsau |
| | | <where> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tsau.phone = #{query.phone} |
| | | </if> |
| | | <if test="query.nickName != null and query.nickName != ''"> |
| | | and tsau.nick_name like concat('%',#{query.nickName},'%') |
| | | </if> |
| | | <if test="query.inspectionId != null and query.inspectionId != ''"> |
| | | and FIND_IN_SET(#{query.inspectionId},tsau.chronic_disease_id) |
| | | </if> |
| | | AND tsau.chronic_disease_id IS NOT NULL |
| | | AND tsau.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY tsau.create_time DESC |
| | | </select> |
| | | <select id="exportListClinic" resultType="com.ruoyi.system.export.TSysAppUserClinicExport"> |
| | | select tsau.id, tsau.nick_name, tsau.phone, tsau.birth_time, tsau.sex, tsau.open_id,tsau.office_open_id, |
| | | tsau.chronic_disease_id,tsau.status,tsau.last_reminder_time, tsau.create_time, tsau.update_time, tsau.create_by, |
| | | tsau.update_by, tsau.disabled |
| | | from t_sys_app_user tsau |
| | | <where> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tsau.phone = #{query.phone} |
| | | </if> |
| | | <if test="query.nickName != null and query.nickName != ''"> |
| | | and tsau.nick_name like concat('%',#{query.nickName},'%') |
| | | </if> |
| | | <if test="query.inspectionId != null and query.inspectionId != ''"> |
| | | and FIND_IN_SET(#{query.inspectionId},tsau.chronic_disease_id) |
| | | </if> |
| | | AND tsau.chronic_disease_id IS NOT NULL |
| | | AND tsau.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY tsau.create_time DESC |
| | | </select> |
| | | <select id="exportListAppUser" resultType="com.ruoyi.system.export.TSysAppUserExport"> |
| | | select tsau.id, tsau.nick_name, tsau.phone, tsau.birth_time, tsau.sex, tsau.open_id,tsau.office_open_id, |
| | | tsau.chronic_disease_id,tsau.status,tsau.last_reminder_time, tsau.create_time, tsau.update_time, tsau.create_by, |
| | | tsau.update_by, tsau.disabled, tsi.lastInspectionTime |
| | | from t_sys_app_user tsau |
| | | left join (select id,app_user_id, max(check_time) as lastInspectionTime from t_sys_inspection limit 1) tsi on tsi.app_user_id = tsau.id |
| | | <where> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tsau.phone = #{query.phone} |
| | | </if> |
| | | <if test="query.nickName != null and query.nickName != ''"> |
| | | and tsau.nick_name like concat('%',#{query.nickName},'%') |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | and tsau.id in (select app_user_id from t_sys_inspection where check_time between #{query.startTime} and #{query.endTime}) |
| | | </if> |
| | | <if test="query.isInspection != null and query.isInspection == 1"> |
| | | and tsau.chronic_disease_id IS NOT NULL |
| | | </if> |
| | | <if test="query.isInspection != null and query.isInspection == 0"> |
| | | and tsau.chronic_disease_id IS NULL |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and tsau.status = #{query.status} |
| | | </if> |
| | | AND tsau.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY tsau.create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, live_title, live_cover, live_introduction, start_time,end_time, expected_duration, live_way, live_mode,live_url, |
| | | live_lecturer, live_type, password, live_detail, push_type,click_count, create_time, update_time, create_by, update_by, disabled |
| | | live_lecturer, live_type, live_detail, push_type,click_count, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TSysLiveVO"> |
| | | SELECT |
| | |
| | | <result column="template_name" property="templateName" /> |
| | | <result column="template_code" property="templateCode" /> |
| | | <result column="template_content" property="templateContent" /> |
| | | <result column="template_type" property="templateType" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, template_name, template_code, template_content, create_time, update_time, create_by, update_by, disabled |
| | | id, template_name, template_code, template_content,template_type, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.model.TSysMessageTemplate"> |
| | | SELECT |
| | |
| | | <if test="query.templateName != null and query.templateName != ''"> |
| | | AND template_name LIKE concat('%',#{query.templateName},'%') |
| | | </if> |
| | | AND template_type = 3 |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY create_time DESC |