Merge branch 'xzj' of https://gitee.com/darlk/ShengTangManage into xzj
This commit is contained in:
pom.xml
running/pdf
stdiet-admin/src/main
stdiet-common/src/main/java/com/stdiet/common
config
core
domain
entity
utils
stdiet-custom/src/main
java
com
stdiet
custom
domain
SysCommision.javaSysCustomerCase.javaSysCustomerCaseFile.javaSysCustomerHealthy.javaSysOrder.javaSysOrderPause.javaSysRecipesDetail.javaSysRecipesPlan.javaSysRecipesPlanListInfo.javaSysRecipesTemplate.java
dto
request
response
mapper
SysCommisionMapper.javaSysCustomerCaseFileMapper.javaSysCustomerCaseMapper.javaSysCustomerHealthyMapper.javaSysOrderMapper.javaSysOrderPauseMapper.javaSysRecipesMapper.javaSysRecipesPlanMapper.javaSysRecipesTemplateMapper.java
service
ISysCommisionService.javaISysCommissionDayService.javaISysCustomerCaseService.javaISysCustomerHealthyService.javaISysCustomerService.javaISysOrderPauseService.javaISysRecipesPlanService.javaISysRecipesService.javaISysRecipesTemplateService.javaISysWapServices.java
impl
SysCommisionServiceImpl.javaSysCommissionDayServiceImpl.javaSysCustomerCaseServiceImpl.javaSysCustomerHealthyServiceImpl.javaSysCustomerServiceImpl.javaSysOrderPauseServiceImpl.javaSysOrderServiceImpl.javaSysRecipesPlanServiceImpl.javaSysRecipesServiceImpl.javaSysRecipesTemplateServiceImpl.javaSysWapServicesImp.java
utils
resources
stdiet-framework/src/main/java/com/stdiet/framework/config
stdiet-ui
package.jsonpermission.jsvue.config.js
src
api
custom
contract.jscustomerCase.jshealthy.jsrecipes.jsrecipesPause.jsrecipesPlan.jsrecipesShow.jsrecipesTemplate.js
system
dict
components
BodySignView
ContractDrawer
Customer
FileDownload
FileUpload
HealthyView
HeatStatisticsDrawer
OrderAdd
OrderEdit
PhysicalSignsDialog
PhysicalSignsGuidance
PhysicalSignsRemark
RecipesPlanDrawer
router
store
modules
utils
views
custom
commision
contract
customer
customerCase
dishes
ingredient
order
recipesBuild
BodySignView.vue
RecipesView
RecipesAspectCom
RecipesCom
RecommendView
RecommondView.vueTemplateInfoView
index.vuerecipesPlan
recipesShow
recipesTemplate
subhealthy
investigation
11
pom.xml
11
pom.xml
@ -30,6 +30,7 @@
|
|||||||
<poi.version>3.17</poi.version>
|
<poi.version>3.17</poi.version>
|
||||||
<velocity.version>1.7</velocity.version>
|
<velocity.version>1.7</velocity.version>
|
||||||
<jwt.version>0.9.1</jwt.version>
|
<jwt.version>0.9.1</jwt.version>
|
||||||
|
<aliyun-oss.version>3.8.0</aliyun-oss.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- 依赖声明 -->
|
<!-- 依赖声明 -->
|
||||||
@ -187,10 +188,18 @@
|
|||||||
<artifactId>stdiet-common</artifactId>
|
<artifactId>stdiet-common</artifactId>
|
||||||
<version>${stdiet.version}</version>
|
<version>${stdiet.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- OSS存储-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun.oss</groupId>
|
||||||
|
<artifactId>aliyun-sdk-oss</artifactId>
|
||||||
|
<version>${aliyun-oss.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>stdiet-admin</module>
|
<module>stdiet-admin</module>
|
||||||
<module>stdiet-framework</module>
|
<module>stdiet-framework</module>
|
||||||
|
BIN
running/pdf/healthyReport.pdf
Normal file
BIN
running/pdf/healthyReport.pdf
Normal file
Binary file not shown.
@ -172,3 +172,13 @@ xss:
|
|||||||
excludes: /system/notice/*
|
excludes: /system/notice/*
|
||||||
# 匹配链接
|
# 匹配链接
|
||||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||||
|
|
||||||
|
#阿里云OSS配置
|
||||||
|
aliyun:
|
||||||
|
oss:
|
||||||
|
AccessKeyID: LTAI4GEGbBEiqv1Z512K4qWn
|
||||||
|
AccessKeySecret: fT7eIhejMwMy5tFooCF0puLkurH64j
|
||||||
|
Buckets: stdiet
|
||||||
|
EndPoint: https://oss-cn-shenzhen.aliyuncs.com
|
||||||
|
#案例文件夹路径
|
||||||
|
casePrefix: case/
|
@ -10,6 +10,7 @@ stdiet:
|
|||||||
demoEnabled: true
|
demoEnabled: true
|
||||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||||
profile: /Users/wonder/Documents/Workspaces/java/ShengtangManage/running/uploadPath
|
profile: /Users/wonder/Documents/Workspaces/java/ShengtangManage/running/uploadPath
|
||||||
|
# profile: D:/ruoyi/uploadPath
|
||||||
# 获取ip地址开关
|
# 获取ip地址开关
|
||||||
addressEnabled: false
|
addressEnabled: false
|
||||||
# 验证码类型 math 数组计算 char 字符验证
|
# 验证码类型 math 数组计算 char 字符验证
|
||||||
@ -172,3 +173,14 @@ xss:
|
|||||||
excludes: /system/notice/*
|
excludes: /system/notice/*
|
||||||
# 匹配链接
|
# 匹配链接
|
||||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||||
|
|
||||||
|
#阿里云OSS配置
|
||||||
|
aliyun:
|
||||||
|
oss:
|
||||||
|
AccessKeyID: LTAI4GEGbBEiqv1Z512K4qWn
|
||||||
|
AccessKeySecret: fT7eIhejMwMy5tFooCF0puLkurH64j
|
||||||
|
Buckets: stdiet
|
||||||
|
EndPoint: https://oss-cn-shenzhen.aliyuncs.com
|
||||||
|
#案例文件夹路径
|
||||||
|
casePrefix: case/
|
||||||
|
|
||||||
|
@ -172,3 +172,13 @@ xss:
|
|||||||
excludes: /system/notice/*
|
excludes: /system/notice/*
|
||||||
# 匹配链接
|
# 匹配链接
|
||||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||||
|
|
||||||
|
#阿里云OSS配置
|
||||||
|
aliyun:
|
||||||
|
oss:
|
||||||
|
AccessKeyID: LTAI4GEGbBEiqv1Z512K4qWn
|
||||||
|
AccessKeySecret: fT7eIhejMwMy5tFooCF0puLkurH64j
|
||||||
|
Buckets: stdiet
|
||||||
|
EndPoint: https://oss-cn-shenzhen.aliyuncs.com
|
||||||
|
#案例文件夹路径
|
||||||
|
casePrefix: case/
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.stdiet.web.controller;
|
||||||
|
|
||||||
|
import com.stdiet.common.config.AliyunOSSConfig;
|
||||||
|
import com.stdiet.common.utils.oss.AliyunOSSUtils;
|
||||||
|
import com.stdiet.custom.mapper.SysCustomerPhysicalSignsMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.ApplicationArguments;
|
||||||
|
import org.springframework.boot.ApplicationRunner;
|
||||||
|
import org.springframework.core.annotation.Order;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Order(value = 1)
|
||||||
|
public class MyApplicationRunner implements ApplicationRunner {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysCustomerPhysicalSignsMapper sysCustomerPhysicalSignsMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(ApplicationArguments args) throws Exception {
|
||||||
|
System.out.println("项目启动调用方法");
|
||||||
|
// String path = AliyunOSSUtils.uploadFileInputSteam(AliyunOSSConfig.casePrefix,"ceshi.png",new File("D:\\ceshi.png"));
|
||||||
|
// System.out.println(path);
|
||||||
|
}
|
||||||
|
}
|
@ -5,6 +5,7 @@ import java.math.RoundingMode;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.stdiet.custom.domain.SysCommissionDayDetail;
|
import com.stdiet.custom.domain.SysCommissionDayDetail;
|
||||||
|
import com.stdiet.custom.dto.request.SysOrderCommision;
|
||||||
import com.stdiet.custom.service.ISysCommissionDayService;
|
import com.stdiet.custom.service.ISysCommissionDayService;
|
||||||
import com.stdiet.framework.web.domain.server.Sys;
|
import com.stdiet.framework.web.domain.server.Sys;
|
||||||
import com.stdiet.system.domain.CusSalesman;
|
import com.stdiet.system.domain.CusSalesman;
|
||||||
|
197
stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerCaseController.java
Normal file
197
stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerCaseController.java
Normal file
@ -0,0 +1,197 @@
|
|||||||
|
package com.stdiet.web.controller.custom;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.stdiet.common.config.AliyunOSSConfig;
|
||||||
|
import com.stdiet.common.config.RuoYiConfig;
|
||||||
|
import com.stdiet.common.constant.Constants;
|
||||||
|
import com.stdiet.common.exception.file.FileNameLengthLimitExceededException;
|
||||||
|
import com.stdiet.common.utils.StringUtils;
|
||||||
|
import com.stdiet.common.utils.file.FileUploadUtils;
|
||||||
|
import com.stdiet.common.utils.file.FileUtils;
|
||||||
|
import com.stdiet.common.utils.file.MimeTypeUtils;
|
||||||
|
import com.stdiet.common.utils.oss.AliyunOSSUtils;
|
||||||
|
import com.stdiet.custom.domain.SysCustomerCaseFile;
|
||||||
|
import com.stdiet.custom.dto.request.FileRequest;
|
||||||
|
import com.sun.deploy.net.HttpResponse;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
import org.aspectj.weaver.loadtime.Aj;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.http.StreamingHttpOutputMessage;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.stdiet.common.annotation.Log;
|
||||||
|
import com.stdiet.common.core.controller.BaseController;
|
||||||
|
import com.stdiet.common.core.domain.AjaxResult;
|
||||||
|
import com.stdiet.common.enums.BusinessType;
|
||||||
|
import com.stdiet.custom.domain.SysCustomerCase;
|
||||||
|
import com.stdiet.custom.service.ISysCustomerCaseService;
|
||||||
|
import com.stdiet.common.utils.poi.ExcelUtil;
|
||||||
|
import com.stdiet.common.core.page.TableDataInfo;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户案例管理Controller
|
||||||
|
*
|
||||||
|
* @author xiezhijun
|
||||||
|
* @date 2021-03-04
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/custom/customerCase")
|
||||||
|
public class SysCustomerCaseController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysCustomerCaseService sysCustomerCaseService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户案例管理列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('custom:customerCase:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysCustomerCase sysCustomerCase)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysCustomerCase> list = sysCustomerCaseService.selectSysCustomerCaseList(sysCustomerCase);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出客户案例管理列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('custom:customerCase:export')")
|
||||||
|
@Log(title = "客户案例管理", businessType = BusinessType.EXPORT)
|
||||||
|
@GetMapping("/export")
|
||||||
|
public AjaxResult export(SysCustomerCase sysCustomerCase)
|
||||||
|
{
|
||||||
|
List<SysCustomerCase> list = sysCustomerCaseService.selectSysCustomerCaseList(sysCustomerCase);
|
||||||
|
ExcelUtil<SysCustomerCase> util = new ExcelUtil<SysCustomerCase>(SysCustomerCase.class);
|
||||||
|
return util.exportExcel(list, "customerCase");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取客户案例管理详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('custom:customerCase:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(sysCustomerCaseService.selectSysCustomerCaseById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增客户案例管理
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('custom:customerCase:add')")
|
||||||
|
@Log(title = "客户案例管理", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody SysCustomerCase sysCustomerCase)
|
||||||
|
{
|
||||||
|
return toAjax(sysCustomerCaseService.insertSysCustomerCase(sysCustomerCase));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改客户案例管理
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('custom:customerCase:edit')")
|
||||||
|
@Log(title = "客户案例管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody SysCustomerCase sysCustomerCase)
|
||||||
|
{
|
||||||
|
return toAjax(sysCustomerCaseService.updateSysCustomerCase(sysCustomerCase));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除客户案例管理
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('custom:customerCase:remove')")
|
||||||
|
@Log(title = "客户案例管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(sysCustomerCaseService.deleteSysCustomerCaseByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户案例文件列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/getFileListByCaseId")
|
||||||
|
@PreAuthorize("@ss.hasPermi('custom:customerCase:list')")
|
||||||
|
public TableDataInfo getFileListByCaseId(@RequestParam("caseId")Long caseId)
|
||||||
|
{
|
||||||
|
List<SysCustomerCaseFile> list = sysCustomerCaseService.getFileListByCaseId(caseId);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传文件到OSS返回URL
|
||||||
|
*/
|
||||||
|
@PostMapping("/uploadCaseFile")
|
||||||
|
@PreAuthorize("@ss.hasPermi('custom:customerCase:list')")
|
||||||
|
public AjaxResult uploadCseFile(MultipartFile file) throws Exception {
|
||||||
|
try {
|
||||||
|
if(file == null){
|
||||||
|
return AjaxResult.error("文件不存在");
|
||||||
|
}
|
||||||
|
int fileNameLength = file.getOriginalFilename().length();
|
||||||
|
if (fileNameLength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
|
||||||
|
{
|
||||||
|
throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
|
||||||
|
}
|
||||||
|
FileUploadUtils.assertAllowed(file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
||||||
|
|
||||||
|
String fileUrl = AliyunOSSUtils.uploadFileInputSteam(AliyunOSSConfig.casePrefix, file.getOriginalFilename(), file);
|
||||||
|
|
||||||
|
AjaxResult ajax = null;
|
||||||
|
if(StringUtils.isNotEmpty(fileUrl)){
|
||||||
|
ajax = AjaxResult.success();
|
||||||
|
ajax.put("fileUrl", fileUrl);
|
||||||
|
ajax.put("fileName", file.getOriginalFilename());
|
||||||
|
}else{
|
||||||
|
ajax = AjaxResult.error("文件上传失败");
|
||||||
|
}
|
||||||
|
return ajax;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("文件上传失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载案例文件
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/downCaseFile")
|
||||||
|
@PreAuthorize("@ss.hasPermi('custom:customerCase:list')")
|
||||||
|
public void downCaseFile(@RequestBody FileRequest fileRequest, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
/*try{
|
||||||
|
InputStream fileStream = AliyunOSSUtils.downloadFile(fileRequest.getFileUrl());
|
||||||
|
byte[] body = new byte[fileStream.available()];
|
||||||
|
fileStream.read(body);
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.add("Content-Disposition", "attchement;filename=" + fileRequest.getFileName());
|
||||||
|
HttpStatus statusCode = HttpStatus.OK;
|
||||||
|
ResponseEntity<byte[]> entity = new ResponseEntity<byte[]>(body, headers, statusCode);
|
||||||
|
return entity;
|
||||||
|
}catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;*/
|
||||||
|
try {
|
||||||
|
response.setCharacterEncoding("utf-8");
|
||||||
|
response.setContentType("multipart/form-data");
|
||||||
|
response.setHeader("Content-Disposition",
|
||||||
|
"attachment;fileName=" + FileUtils.setFileDownloadHeader(request, fileRequest.getFileName()));
|
||||||
|
FileUtils.writeBytes(AliyunOSSUtils.downloadFile(fileRequest.getFileUrl()), response.getOutputStream());
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -9,19 +9,15 @@ import com.stdiet.common.utils.StringUtils;
|
|||||||
import com.stdiet.common.utils.poi.ExcelUtil;
|
import com.stdiet.common.utils.poi.ExcelUtil;
|
||||||
import com.stdiet.common.utils.sign.AesUtils;
|
import com.stdiet.common.utils.sign.AesUtils;
|
||||||
import com.stdiet.custom.domain.SysCustomer;
|
import com.stdiet.custom.domain.SysCustomer;
|
||||||
import com.stdiet.custom.domain.SysCustomerHealthy;
|
|
||||||
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
|
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
|
||||||
import com.stdiet.custom.service.ISysCustomerHealthyService;
|
import com.stdiet.custom.service.ISysCustomerHealthyService;
|
||||||
import com.stdiet.custom.service.ISysCustomerPhysicalSignsService;
|
import com.stdiet.custom.service.ISysCustomerPhysicalSignsService;
|
||||||
import com.stdiet.custom.service.ISysCustomerService;
|
import com.stdiet.custom.service.ISysCustomerService;
|
||||||
import com.stdiet.framework.web.domain.server.Sys;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户体征信息Controller
|
* 客户体征信息Controller
|
||||||
@ -122,8 +118,7 @@ public class SysCustomerController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/getCustomerAndSignByPhone")
|
@GetMapping("/getCustomerAndSignByPhone")
|
||||||
@PreAuthorize("@ss.hasPermi('custom:customer:query')")
|
@PreAuthorize("@ss.hasPermi('custom:customer:query')")
|
||||||
public AjaxResult getCustomerAndSignByPhone(@RequestParam("phone")String phone)
|
public AjaxResult getCustomerAndSignByPhone(@RequestParam("phone") String phone) {
|
||||||
{
|
|
||||||
SysCustomerPhysicalSigns sysCustomer = null;
|
SysCustomerPhysicalSigns sysCustomer = null;
|
||||||
if (StringUtils.isNotEmpty(phone)) {
|
if (StringUtils.isNotEmpty(phone)) {
|
||||||
sysCustomer = sysCustomerPhysicalSignsService.selectSysCustomerAndSignByPhone(phone);
|
sysCustomer = sysCustomerPhysicalSignsService.selectSysCustomerAndSignByPhone(phone);
|
||||||
@ -133,40 +128,19 @@ public class SysCustomerController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据客户ID获取体征或健康评估信息,优先健康评估信息
|
* 根据客户ID获取体征或健康评估信息,优先健康评估信息
|
||||||
|
*
|
||||||
* @param id 客户ID
|
* @param id 客户ID
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/physicalSigns/{id}")
|
@GetMapping("/physicalSigns/{id}")
|
||||||
public AjaxResult getPhysicalSignsById(@PathVariable("id") Long id) {
|
public AjaxResult getPhysicalSignsById(@PathVariable("id") Long id) {
|
||||||
Map<String, Object> result = new HashMap<>();
|
return AjaxResult.success(sysCustomerService.getPhysicalSignsById(id));
|
||||||
String key = "customerHealthy";
|
|
||||||
result.put("type", 0);
|
|
||||||
//查询健康评估信息
|
|
||||||
SysCustomerHealthy sysCustomerHealthy = sysCustomerHealthyService.selectSysCustomerHealthyByCustomerId(id);
|
|
||||||
if(sysCustomerHealthy != null){
|
|
||||||
/* if (StringUtils.isNotEmpty(sysCustomerHealthy.getPhone())) {
|
|
||||||
sysCustomerHealthy.setPhone(StringUtils.hiddenPhoneNumber(sysCustomerHealthy.getPhone()));
|
|
||||||
}*/
|
|
||||||
result.put(key, sysCustomerHealthy);
|
|
||||||
}else{
|
|
||||||
//查询体征信息
|
|
||||||
SysCustomerPhysicalSigns sysCustomerPhysicalSigns = sysCustomerPhysicalSignsService.selectSysCustomerPhysicalSignsByCusId(id);
|
|
||||||
if(sysCustomerPhysicalSigns != null){
|
|
||||||
/* if (StringUtils.isNotEmpty(sysCustomerPhysicalSigns.getPhone())) {
|
|
||||||
sysCustomerPhysicalSigns.setPhone(StringUtils.hiddenPhoneNumber(sysCustomerPhysicalSigns.getPhone()));
|
|
||||||
}*/
|
|
||||||
result.put("type", 1);
|
|
||||||
}
|
|
||||||
result.put(key, sysCustomerPhysicalSigns);
|
|
||||||
}
|
|
||||||
//对ID进行加密
|
|
||||||
result.put("enc_id", id != null ? AesUtils.encrypt(id+"", null) : "");
|
|
||||||
return AjaxResult.success(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据客户ID删除对应体征信息或健康评估信息
|
* 根据客户ID删除对应体征信息或健康评估信息
|
||||||
* @param id 客户ID
|
*
|
||||||
|
* @param customerId 客户ID
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/delCustomerHealthy/{id}")
|
@GetMapping("/delCustomerHealthy/{id}")
|
||||||
|
@ -3,6 +3,7 @@ package com.stdiet.custom.controller;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.stdiet.common.utils.StringUtils;
|
import com.stdiet.common.utils.StringUtils;
|
||||||
|
import com.stdiet.custom.dto.request.HealthyDetailRequest;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -109,4 +110,14 @@ public class SysCustomerHealthyController extends BaseController
|
|||||||
{
|
{
|
||||||
return toAjax(sysCustomerHealthyService.deleteSysCustomerHealthyByIds(ids));
|
return toAjax(sysCustomerHealthyService.deleteSysCustomerHealthyByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成健康体征报告
|
||||||
|
*/
|
||||||
|
@Log(title = "健康体征报告", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/generateHealthyReport")
|
||||||
|
public AjaxResult generateHealthyReport(@RequestBody HealthyDetailRequest healthyDetailRequest)
|
||||||
|
{
|
||||||
|
return sysCustomerHealthyService.generateHealthyReport(healthyDetailRequest);
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package com.stdiet.web.controller.custom;
|
package com.stdiet.web.controller.custom;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.stdiet.common.annotation.Log;
|
import com.stdiet.common.annotation.Log;
|
||||||
import com.stdiet.common.core.domain.AjaxResult;
|
import com.stdiet.common.core.domain.AjaxResult;
|
||||||
import com.stdiet.common.core.domain.entity.SysUser;
|
import com.stdiet.common.core.domain.entity.SysUser;
|
||||||
@ -19,6 +20,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.net.URLDecoder;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -47,6 +49,7 @@ public class SysOrderController extends OrderBaseController {
|
|||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public OrderTableDataInfo list(SysOrder sysOrder) {
|
public OrderTableDataInfo list(SysOrder sysOrder) {
|
||||||
startPage();
|
startPage();
|
||||||
|
dealOrderType(sysOrder);
|
||||||
List<SysOrder> list = sysOrderService.selectSysOrderList(sysOrder);
|
List<SysOrder> list = sysOrderService.selectSysOrderList(sysOrder);
|
||||||
List<SysUser> userList = userService.selectAllUser();
|
List<SysUser> userList = userService.selectAllUser();
|
||||||
BigDecimal totalAmount = sysOrderService.selectAllOrderAmount(sysOrder);
|
BigDecimal totalAmount = sysOrderService.selectAllOrderAmount(sysOrder);
|
||||||
@ -68,6 +71,20 @@ public class SysOrderController extends OrderBaseController {
|
|||||||
return getOrderDataTable(list, totalAmount);
|
return getOrderDataTable(list, totalAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理订单类型
|
||||||
|
* @param sysOrder
|
||||||
|
*/
|
||||||
|
private void dealOrderType(SysOrder sysOrder) {
|
||||||
|
if(StringUtils.isNotEmpty(sysOrder.getOrderType())){
|
||||||
|
try {
|
||||||
|
JSONArray array = JSONArray.parseArray(URLDecoder.decode(sysOrder.getOrderType(),"UTF-8"));
|
||||||
|
sysOrder.setSearchOrderTypeArray(array.size() > 0 ? array : null);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出销售订单列表
|
* 导出销售订单列表
|
||||||
|
@ -27,7 +27,7 @@ import com.stdiet.common.core.page.TableDataInfo;
|
|||||||
* @date 2021-01-07
|
* @date 2021-01-07
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/orderPause/pause")
|
@RequestMapping("/recipes/pause")
|
||||||
public class SysOrderPauseController extends BaseController
|
public class SysOrderPauseController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -36,7 +36,7 @@ public class SysOrderPauseController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 查询订单服务暂停列表
|
* 查询订单服务暂停列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('orderPause:pause:query')")
|
@PreAuthorize("@ss.hasPermi('recipes:pause:query')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysOrderPause sysOrderPause)
|
public TableDataInfo list(SysOrderPause sysOrderPause)
|
||||||
{
|
{
|
||||||
@ -48,7 +48,7 @@ public class SysOrderPauseController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 导出订单服务暂停列表
|
* 导出订单服务暂停列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('orderPause:pause:export')")
|
@PreAuthorize("@ss.hasPermi('recipes:pause:export')")
|
||||||
@Log(title = "订单服务暂停", businessType = BusinessType.EXPORT)
|
@Log(title = "订单服务暂停", businessType = BusinessType.EXPORT)
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public AjaxResult export(SysOrderPause sysOrderPause)
|
public AjaxResult export(SysOrderPause sysOrderPause)
|
||||||
@ -61,7 +61,7 @@ public class SysOrderPauseController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 获取订单服务暂停详细信息
|
* 获取订单服务暂停详细信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('orderPause:pause:query')")
|
@PreAuthorize("@ss.hasPermi('recipes:pause:query')")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
{
|
{
|
||||||
@ -71,27 +71,32 @@ public class SysOrderPauseController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 新增订单服务暂停
|
* 新增订单服务暂停
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('orderPause:pause:add')")
|
@PreAuthorize("@ss.hasPermi('recipes:pause:add')")
|
||||||
@Log(title = "订单服务暂停", businessType = BusinessType.INSERT)
|
@Log(title = "订单服务暂停", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody SysOrderPause sysOrderPause)
|
public AjaxResult add(@RequestBody SysOrderPause sysOrderPause)
|
||||||
{
|
{
|
||||||
int count = sysOrderPauseService.getCountByOrderIdAndPauseDate(sysOrderPause);
|
int count = sysOrderPauseService.getCountByCusIdAndPauseDate(sysOrderPause);
|
||||||
if(count > 0){
|
if(count > 0){
|
||||||
return AjaxResult.error("时间范围重叠,请检查时间");
|
return AjaxResult.error("时间范围重叠,请检查时间");
|
||||||
}
|
}
|
||||||
|
long orderId = sysOrderPauseService.selectNearMainOrderIdByCusId(sysOrderPause.getCusId());
|
||||||
|
if(orderId < 0) {
|
||||||
|
return AjaxResult.error("找不到对应的订单信息");
|
||||||
|
}
|
||||||
|
sysOrderPause.setOrderId(orderId);
|
||||||
return toAjax(sysOrderPauseService.insertSysOrderPause(sysOrderPause));
|
return toAjax(sysOrderPauseService.insertSysOrderPause(sysOrderPause));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改订单服务暂停
|
* 修改订单服务暂停
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('orderPause:pause:edit')")
|
@PreAuthorize("@ss.hasPermi('recipes:pause:edit')")
|
||||||
@Log(title = "订单服务暂停", businessType = BusinessType.UPDATE)
|
@Log(title = "订单服务暂停", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody SysOrderPause sysOrderPause)
|
public AjaxResult edit(@RequestBody SysOrderPause sysOrderPause)
|
||||||
{
|
{
|
||||||
int count = sysOrderPauseService.getCountByOrderIdAndPauseDate(sysOrderPause);
|
int count = sysOrderPauseService.getCountByCusIdAndPauseDate(sysOrderPause);
|
||||||
if(count > 0){
|
if(count > 0){
|
||||||
return AjaxResult.error("时间范围重叠,请检查时间");
|
return AjaxResult.error("时间范围重叠,请检查时间");
|
||||||
}
|
}
|
||||||
@ -101,7 +106,7 @@ public class SysOrderPauseController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除订单服务暂停
|
* 删除订单服务暂停
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('orderPause:pause:remove')")
|
@PreAuthorize("@ss.hasPermi('recipes:pause:remove')")
|
||||||
@Log(title = "订单服务暂停", businessType = BusinessType.DELETE)
|
@Log(title = "订单服务暂停", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
@ -79,4 +79,5 @@ public class SysRecipesController extends BaseController {
|
|||||||
public AjaxResult delete(@PathVariable Long id) {
|
public AjaxResult delete(@PathVariable Long id) {
|
||||||
return toAjax(sysRecipesService.deleteDishes(id));
|
return toAjax(sysRecipesService.deleteDishes(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ public class SysRecipesPlanController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 查询食谱计划列表
|
* 查询食谱计划列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:list')")
|
@PreAuthorize("@ss.hasPermi('recipes:plan:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysRecipesPlan sysRecipesPlan)
|
public TableDataInfo list(SysRecipesPlan sysRecipesPlan)
|
||||||
{
|
{
|
||||||
@ -48,7 +48,7 @@ public class SysRecipesPlanController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 根据订单查询完整食谱计划列表
|
* 根据订单查询完整食谱计划列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:list')")
|
@PreAuthorize("@ss.hasPermi('recipes:plan:list')")
|
||||||
@GetMapping("/getAllPlanByOrderId")
|
@GetMapping("/getAllPlanByOrderId")
|
||||||
public TableDataInfo getAllPlanByOrderId(SysRecipesPlan sysRecipesPlan)
|
public TableDataInfo getAllPlanByOrderId(SysRecipesPlan sysRecipesPlan)
|
||||||
{
|
{
|
||||||
@ -57,10 +57,16 @@ public class SysRecipesPlanController extends BaseController
|
|||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('recipes:plan:list')")
|
||||||
|
@GetMapping(value = "/list/{cusId}")
|
||||||
|
public AjaxResult getAllPlanByCusId(@PathVariable Long cusId) {
|
||||||
|
return AjaxResult.success(sysRecipesPlanService.selectPlanListByCusId(cusId));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取食谱计划详细信息
|
* 获取食谱计划详细信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:query')")
|
@PreAuthorize("@ss.hasPermi('recipes:plan:query')")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
{
|
{
|
||||||
@ -70,7 +76,7 @@ public class SysRecipesPlanController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改食谱计划
|
* 修改食谱计划
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:edit')")
|
@PreAuthorize("@ss.hasPermi('recipes:plan:edit')")
|
||||||
@Log(title = "食谱计划", businessType = BusinessType.UPDATE)
|
@Log(title = "食谱计划", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody SysRecipesPlan sysRecipesPlan)
|
public AjaxResult edit(@RequestBody SysRecipesPlan sysRecipesPlan)
|
||||||
@ -81,7 +87,7 @@ public class SysRecipesPlanController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 导出食谱计划列表
|
* 导出食谱计划列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:export')")
|
@PreAuthorize("@ss.hasPermi('recipes:plan:export')")
|
||||||
@Log(title = "食谱计划", businessType = BusinessType.EXPORT)
|
@Log(title = "食谱计划", businessType = BusinessType.EXPORT)
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public AjaxResult export(SysRecipesPlan sysRecipesPlan)
|
public AjaxResult export(SysRecipesPlan sysRecipesPlan)
|
||||||
|
71
stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysRecipesTemplateController.java
Normal file
71
stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysRecipesTemplateController.java
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
package com.stdiet.web.controller.custom;
|
||||||
|
|
||||||
|
import com.stdiet.common.core.controller.BaseController;
|
||||||
|
import com.stdiet.common.core.domain.AjaxResult;
|
||||||
|
import com.stdiet.common.core.page.TableDataInfo;
|
||||||
|
import com.stdiet.custom.domain.SysRecipesTemplate;
|
||||||
|
import com.stdiet.custom.service.ISysRecipesTemplateService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 食谱模板
|
||||||
|
*
|
||||||
|
* @author wonder
|
||||||
|
* @date 2021-02-27
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/recipes/template")
|
||||||
|
public class SysRecipesTemplateController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ISysRecipesTemplateService iSysRecipesTemplateService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('recipes:template:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysRecipesTemplate sysRecipesTemplate) {
|
||||||
|
startPage();
|
||||||
|
List<SysRecipesTemplate> list = iSysRecipesTemplateService.selectRecipesTemplateListByCondition(sysRecipesTemplate);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('recipes:template:list')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult detail(@PathVariable Long id) {
|
||||||
|
return AjaxResult.success(iSysRecipesTemplateService.getRecipesTemplateById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('recipes:template:edit')")
|
||||||
|
@PostMapping("/add")
|
||||||
|
public AjaxResult add(@RequestBody SysRecipesTemplate sysRecipesTemplate) {
|
||||||
|
return toAjax(iSysRecipesTemplateService.insertRecipsesTemplate(sysRecipesTemplate));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('recipes:template:list')")
|
||||||
|
@PutMapping(value = "/update")
|
||||||
|
public AjaxResult update(@RequestBody SysRecipesTemplate sysRecipesTemplate) {
|
||||||
|
return toAjax(iSysRecipesTemplateService.updateRecipesTemplate(sysRecipesTemplate));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('recipes:template:query')")
|
||||||
|
@DeleteMapping(value = "/delete/{id}")
|
||||||
|
public AjaxResult delete(@PathVariable("id") Long id) {
|
||||||
|
return AjaxResult.success(iSysRecipesTemplateService.removeRecipesTemplate(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package com.stdiet.web.controller.custom;
|
||||||
|
|
||||||
|
import com.stdiet.common.core.controller.BaseController;
|
||||||
|
import com.stdiet.common.core.domain.AjaxResult;
|
||||||
|
import com.stdiet.custom.service.ISysRecipesService;
|
||||||
|
import com.stdiet.custom.service.ISysWapServices;
|
||||||
|
import com.stdiet.system.service.ISysDictTypeService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wap")
|
||||||
|
public class SysWapController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
ISysWapServices iSysWapServices;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ISysRecipesService iSysRecipesService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ISysDictTypeService iSysDictTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户食谱详情
|
||||||
|
*
|
||||||
|
* @param outId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/recipes/plans/{outId}")
|
||||||
|
public AjaxResult detail(@PathVariable String outId) {
|
||||||
|
return AjaxResult.success(iSysWapServices.getRecipesPlanListInfo(outId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户信息
|
||||||
|
* @param outId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/healthyInfo/{outId}")
|
||||||
|
public AjaxResult healthy(@PathVariable String outId) {
|
||||||
|
return AjaxResult.success(iSysWapServices.getHealthyDataByOutId(outId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取某天食谱菜品
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/recipes/menu/{id}")
|
||||||
|
public AjaxResult dayilyMenu(@PathVariable Long id) {
|
||||||
|
return AjaxResult.success(iSysRecipesService.selectDishesByMenuId(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统字典
|
||||||
|
* @param dictType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/dict/{dictType}")
|
||||||
|
public AjaxResult sysDict(@PathVariable String dictType) {
|
||||||
|
return AjaxResult.success(iSysDictTypeService.selectDictDataByType(dictType));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.stdiet.common.config;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class AliyunOSSConfig {
|
||||||
|
|
||||||
|
public static String AccessKeyID;
|
||||||
|
|
||||||
|
public static String AccessKeySecret;
|
||||||
|
|
||||||
|
public static String Buckets;
|
||||||
|
|
||||||
|
public static String EndPoint;
|
||||||
|
|
||||||
|
public static String casePrefix;
|
||||||
|
|
||||||
|
@Value("${aliyun.oss.AccessKeyID}")
|
||||||
|
public void setAccessKeyID(String AccessKeyID){
|
||||||
|
AliyunOSSConfig.AccessKeyID = AccessKeyID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Value("${aliyun.oss.AccessKeySecret}")
|
||||||
|
public void setAccessKeySecret(String AccessKeySecret){
|
||||||
|
AliyunOSSConfig.AccessKeySecret = AccessKeySecret;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Value("${aliyun.oss.Buckets}")
|
||||||
|
public void setBuckets(String Buckets){
|
||||||
|
AliyunOSSConfig.Buckets = Buckets;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Value("${aliyun.oss.EndPoint}")
|
||||||
|
public void setEndPoint(String EndPoint){
|
||||||
|
AliyunOSSConfig.EndPoint = EndPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Value("${aliyun.oss.casePrefix}")
|
||||||
|
public void setCasePrefix(String casePrefix){
|
||||||
|
AliyunOSSConfig.casePrefix = casePrefix;
|
||||||
|
}
|
||||||
|
}
|
@ -9,6 +9,8 @@ import com.stdiet.common.annotation.Excel.ColumnType;
|
|||||||
import com.stdiet.common.constant.UserConstants;
|
import com.stdiet.common.constant.UserConstants;
|
||||||
import com.stdiet.common.core.domain.BaseEntity;
|
import com.stdiet.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典数据表 sys_dict_data
|
* 字典数据表 sys_dict_data
|
||||||
*
|
*
|
||||||
@ -34,6 +36,8 @@ public class SysDictData extends BaseEntity
|
|||||||
@Excel(name = "字典键值")
|
@Excel(name = "字典键值")
|
||||||
private String dictValue;
|
private String dictValue;
|
||||||
|
|
||||||
|
private List<String> dictValueList;
|
||||||
|
|
||||||
/** 字典类型 */
|
/** 字典类型 */
|
||||||
@Excel(name = "字典类型")
|
@Excel(name = "字典类型")
|
||||||
private String dictType;
|
private String dictType;
|
||||||
@ -154,6 +158,14 @@ public class SysDictData extends BaseEntity
|
|||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<String> getDictValueList() {
|
||||||
|
return dictValueList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDictValueList(List<String> dictValueList) {
|
||||||
|
this.dictValueList = dictValueList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
@ -7,6 +7,7 @@ import java.time.LocalDate;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||||
|
|
||||||
@ -186,4 +187,14 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
|||||||
ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault());
|
ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault());
|
||||||
return Date.from(zonedDateTime.toInstant());
|
return Date.from(zonedDateTime.toInstant());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String localDateToString(LocalDate date, String pattern){
|
||||||
|
DateTimeFormatter fmt = DateTimeFormatter.ofPattern(pattern);
|
||||||
|
return date.format(fmt);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LocalDate stringToLocalDate(String date, String pattern){
|
||||||
|
DateTimeFormatter fmt = DateTimeFormatter.ofPattern(pattern);
|
||||||
|
return LocalDate.parse(date, fmt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,9 @@ public class HealthyUtils {
|
|||||||
//营养成分比例
|
//营养成分比例
|
||||||
public static final Integer[] nutritionRate = {30, 20, 50};
|
public static final Integer[] nutritionRate = {30, 20, 50};
|
||||||
|
|
||||||
|
//默认活动因子
|
||||||
|
public static final double activityFactor = 0.3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算减脂每天最大摄入量(千卡)
|
* 计算减脂每天最大摄入量(千卡)
|
||||||
* @param age 年龄
|
* @param age 年龄
|
||||||
@ -148,7 +151,7 @@ public class HealthyUtils {
|
|||||||
* @param weight 体重
|
* @param weight 体重
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static final Double[] calculateNutritionEveryWeight(Integer[] nutritionQuality, double weight){
|
public static Double[] calculateNutritionEveryWeight(Integer[] nutritionQuality, double weight){
|
||||||
Double[] nutritionEveryWeight = new Double[3];
|
Double[] nutritionEveryWeight = new Double[3];
|
||||||
nutritionEveryWeight[0] = NumberUtils.getNumberByRoundHalfUp(nutritionQuality[0]/weight*2,2).doubleValue();
|
nutritionEveryWeight[0] = NumberUtils.getNumberByRoundHalfUp(nutritionQuality[0]/weight*2,2).doubleValue();
|
||||||
nutritionEveryWeight[1] = NumberUtils.getNumberByRoundHalfUp(nutritionQuality[1]/weight*2,2).doubleValue();
|
nutritionEveryWeight[1] = NumberUtils.getNumberByRoundHalfUp(nutritionQuality[1]/weight*2,2).doubleValue();
|
||||||
@ -156,5 +159,19 @@ public class HealthyUtils {
|
|||||||
return nutritionEveryWeight;
|
return nutritionEveryWeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算不运动热量、运动热量
|
||||||
|
* @param metabolizeHeat
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Long[] calculateWithoutExerciseHeat(Integer metabolizeHeat){
|
||||||
|
Long[] array = new Long[2];
|
||||||
|
//不运动热量
|
||||||
|
array[0] = Math.round(metabolizeHeat * (1 + activityFactor));
|
||||||
|
//运动热量
|
||||||
|
array[1] = Math.round(metabolizeHeat * (1 + 0.8));
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
package com.stdiet.common.utils.file;
|
package com.stdiet.common.utils.file;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.*;
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
@ -74,6 +69,55 @@ public class FileUtils extends org.apache.commons.io.FileUtils
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 输出指定文件的byte数组
|
||||||
|
*
|
||||||
|
* @param inputStream 输入流
|
||||||
|
* @param os 输出流
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static void writeBytes(InputStream inputStream, OutputStream os) throws IOException
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
byte[] b = new byte[1024];
|
||||||
|
int length;
|
||||||
|
while ((length = inputStream.read(b)) > 0)
|
||||||
|
{
|
||||||
|
os.write(b, 0, length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (os != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
os.close();
|
||||||
|
}
|
||||||
|
catch (IOException e1)
|
||||||
|
{
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (inputStream != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
inputStream.close();
|
||||||
|
}
|
||||||
|
catch (IOException e1)
|
||||||
|
{
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除文件
|
* 删除文件
|
||||||
*
|
*
|
||||||
|
@ -0,0 +1,283 @@
|
|||||||
|
package com.stdiet.common.utils.oss;
|
||||||
|
|
||||||
|
import com.aliyun.oss.model.GetObjectRequest;
|
||||||
|
import com.aliyun.oss.model.OSSObject;
|
||||||
|
import com.stdiet.common.config.AliyunOSSConfig;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import com.aliyun.oss.OSS;
|
||||||
|
import com.aliyun.oss.OSSClientBuilder;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class AliyunOSSUtils { ;
|
||||||
|
|
||||||
|
public static OSS getOssClient() {
|
||||||
|
return new OSSClientBuilder().build(AliyunOSSConfig.EndPoint, AliyunOSSConfig.AccessKeyID, AliyunOSSConfig.AccessKeySecret);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取图片的URL头信息
|
||||||
|
*
|
||||||
|
* @return 返回url头信息
|
||||||
|
*/
|
||||||
|
private static String getURLHead() {
|
||||||
|
//从哪个位置截取
|
||||||
|
int cutPoint = AliyunOSSConfig.EndPoint.lastIndexOf('/') + 1;
|
||||||
|
//http头
|
||||||
|
String head = AliyunOSSConfig.EndPoint.substring(0, cutPoint);
|
||||||
|
//服务器地址信息
|
||||||
|
String tail = AliyunOSSConfig.EndPoint.substring(cutPoint);
|
||||||
|
//返回结果
|
||||||
|
return head + AliyunOSSConfig.Buckets + "." + tail + "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取存储在服务器上的地址
|
||||||
|
*
|
||||||
|
* @param oranName 文件名
|
||||||
|
* @return 文件URL
|
||||||
|
*/
|
||||||
|
private static String getRealName(String oranName) {
|
||||||
|
return getURLHead() + oranName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取一个随机的文件名
|
||||||
|
*
|
||||||
|
* @param oranName 初始的文件名
|
||||||
|
* @return 返回加uuid后的文件名
|
||||||
|
*/
|
||||||
|
private static String getRandomImageName(String prefix, String oranName) {
|
||||||
|
//获取一个uuid 去掉-
|
||||||
|
String uuid = UUID.randomUUID().toString().replace("-", "");
|
||||||
|
//查一下是否带路径
|
||||||
|
int cutPoint = oranName.lastIndexOf("/") + 1;
|
||||||
|
//如果存在路径
|
||||||
|
if (cutPoint != 0) {
|
||||||
|
//掐头 如果开头是/ 则去掉
|
||||||
|
String head = oranName.indexOf("/") == 0 ? oranName.substring(1, cutPoint) : oranName.substring(0, cutPoint);
|
||||||
|
//去尾
|
||||||
|
String tail = oranName.substring(cutPoint);
|
||||||
|
//返回正确的带路径的图片名称
|
||||||
|
return prefix + head + uuid + tail;
|
||||||
|
}
|
||||||
|
//不存在 直接返回
|
||||||
|
return prefix + uuid + oranName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MultipartFile2File
|
||||||
|
* @param multipartFile
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static File transferToFile(MultipartFile multipartFile) {
|
||||||
|
//选择用缓冲区来实现这个转换即使用java 创建的临时文件 使用 MultipartFile.transferto()方法 。
|
||||||
|
File file = null;
|
||||||
|
try {
|
||||||
|
//获取文件名
|
||||||
|
String originalFilename = multipartFile.getOriginalFilename();
|
||||||
|
//获取最后一个"."的位置
|
||||||
|
int cutPoint = originalFilename.lastIndexOf(".");
|
||||||
|
//获取文件名
|
||||||
|
String prefix = originalFilename.substring(0,cutPoint);
|
||||||
|
//获取后缀名
|
||||||
|
String suffix = originalFilename.substring(cutPoint + 1);
|
||||||
|
//创建临时文件
|
||||||
|
file = File.createTempFile(prefix, suffix);
|
||||||
|
//multipartFile2file
|
||||||
|
multipartFile.transferTo(file);
|
||||||
|
//删除临时文件
|
||||||
|
file.deleteOnExit();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过文件URL反向解析文件名
|
||||||
|
*
|
||||||
|
* @param fileURL 文件URL
|
||||||
|
* @return 原文件名
|
||||||
|
*/
|
||||||
|
private static String getObjectName(String fileURL) {
|
||||||
|
return fileURL.substring(getURLHead().length());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传文件流
|
||||||
|
* @param prefix 路径的前缀路径目录
|
||||||
|
* @param oranFileName 上传到服务器上的文件路径和名称
|
||||||
|
* @param file 来自本地的文件或者文件流
|
||||||
|
*/
|
||||||
|
public static String uploadFileInputSteam(String prefix, String oranFileName, MultipartFile file) {
|
||||||
|
|
||||||
|
// <yourObjectName>上传文件到OSS时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg
|
||||||
|
String objectName = getRandomImageName(prefix, oranFileName);
|
||||||
|
|
||||||
|
// 创建OSSClient实例。
|
||||||
|
OSS ossClient = getOssClient();
|
||||||
|
|
||||||
|
// 上传文件流
|
||||||
|
try (InputStream inputStream = new FileInputStream(transferToFile(file))) {
|
||||||
|
//上传到OSS
|
||||||
|
ossClient.putObject(AliyunOSSConfig.Buckets, objectName, inputStream);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭OSSClient。
|
||||||
|
ossClient.shutdown();
|
||||||
|
|
||||||
|
//返回文件在服务器上的全路径+名称
|
||||||
|
return getRealName(objectName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传文件流
|
||||||
|
* @param prefix 路径的前缀路径目录
|
||||||
|
* @param oranFileName 上传到服务器上的文件路径和名称
|
||||||
|
* @param file 来自本地的文件或者文件流
|
||||||
|
*/
|
||||||
|
public static String uploadFileInputSteam(String prefix, String oranFileName, File file) {
|
||||||
|
|
||||||
|
// <yourObjectName>上传文件到OSS时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg
|
||||||
|
String objectName = getRandomImageName(prefix, oranFileName);
|
||||||
|
|
||||||
|
// 创建OSSClient实例。
|
||||||
|
OSS ossClient = getOssClient();
|
||||||
|
|
||||||
|
// 上传文件流。
|
||||||
|
try (InputStream inputStream = new FileInputStream(file);) {
|
||||||
|
//上传到OSS
|
||||||
|
ossClient.putObject(AliyunOSSConfig.Buckets, objectName, inputStream);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭OSSClient。
|
||||||
|
ossClient.shutdown();
|
||||||
|
|
||||||
|
//返回文件在服务器上的全路径+名称
|
||||||
|
return getRealName(objectName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从OSS中下载一个文件
|
||||||
|
*
|
||||||
|
* @param fileURL 文件的url
|
||||||
|
* @param localFileName 下载到本地的文件名称
|
||||||
|
*/
|
||||||
|
public static void downloadFileToLoacal(String fileURL, String localFileName) {
|
||||||
|
|
||||||
|
//将url解析成objectName
|
||||||
|
String objectName = getObjectName(fileURL);
|
||||||
|
|
||||||
|
// 创建OSSClient实例。
|
||||||
|
OSS ossClient = getOssClient();
|
||||||
|
|
||||||
|
// 下载OSS文件到本地文件。如果指定的本地文件存在会覆盖,不存在则新建。
|
||||||
|
ossClient.getObject(new GetObjectRequest(AliyunOSSConfig.Buckets, objectName), new File(localFileName));
|
||||||
|
|
||||||
|
// 关闭OSSClient。
|
||||||
|
ossClient.shutdown();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从OSS中下载一个文件流
|
||||||
|
*
|
||||||
|
* @param fileURL 文件的url
|
||||||
|
*/
|
||||||
|
public static InputStream downloadFile(String fileURL) throws IOException {
|
||||||
|
|
||||||
|
//将url解析成objectName
|
||||||
|
String objectName = getObjectName(fileURL);
|
||||||
|
|
||||||
|
// 创建OSSClient实例。
|
||||||
|
OSS ossClient = getOssClient();
|
||||||
|
|
||||||
|
OSSObject ossObject = ossClient.getObject(AliyunOSSConfig.Buckets, objectName);
|
||||||
|
|
||||||
|
//获取流
|
||||||
|
InputStream streamData = ossObject.getObjectContent();
|
||||||
|
|
||||||
|
// 关闭OSSClient。
|
||||||
|
ossClient.shutdown();
|
||||||
|
|
||||||
|
return streamData;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除指定路径下的一个文件
|
||||||
|
*
|
||||||
|
* @param fileURL 文件的全称
|
||||||
|
*/
|
||||||
|
public static void deleteFile(String fileURL) {
|
||||||
|
|
||||||
|
// 反向解析文件名
|
||||||
|
String objectName = getObjectName(fileURL);
|
||||||
|
|
||||||
|
// 创建OSSClient实例。
|
||||||
|
OSS ossClient = getOssClient();
|
||||||
|
|
||||||
|
// 删除文件。如需删除文件夹,请将ObjectName设置为对应的文件夹名称。如果文件夹非空,则需要将文件夹下的所有object删除后才能删除该文件夹。
|
||||||
|
ossClient.deleteObject(AliyunOSSConfig.Buckets, objectName);
|
||||||
|
|
||||||
|
//删除成功 打印文件存储地址
|
||||||
|
printDeleteSuccessInfo(fileURL);
|
||||||
|
|
||||||
|
// 关闭OSSClient。
|
||||||
|
ossClient.shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打印文件的存储地址
|
||||||
|
*
|
||||||
|
* @param fileURL 文件URL
|
||||||
|
*/
|
||||||
|
private static void printUploadSuccessInfo(String fileURL) {
|
||||||
|
//上传成功
|
||||||
|
System.out.println("upload success, path = " + getRealName(fileURL));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打印文件的存储地址
|
||||||
|
*
|
||||||
|
* @param fileURL 文件URL
|
||||||
|
*/
|
||||||
|
private static void printDeleteSuccessInfo(String fileURL) {
|
||||||
|
//上传成功
|
||||||
|
System.out.println("delete success, path = " + getRealName(fileURL));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过文件的URL 判断文件是否存在
|
||||||
|
*
|
||||||
|
* @param fileURL 文件的URL
|
||||||
|
* @return 文件是否存在
|
||||||
|
*/
|
||||||
|
public static boolean exists(String fileURL) {
|
||||||
|
|
||||||
|
// 反向解析文件名
|
||||||
|
String objectName = getObjectName(fileURL);
|
||||||
|
|
||||||
|
// 创建OSSClient实例。
|
||||||
|
OSS ossClient = getOssClient();
|
||||||
|
|
||||||
|
// 判断文件是否存在。doesObjectExist还有一个参数isOnlyInOSS,如果为true则忽略302重定向或镜像;如果为false,则考虑302重定向或镜像。
|
||||||
|
boolean found = ossClient.doesObjectExist(AliyunOSSConfig.Buckets, objectName);
|
||||||
|
|
||||||
|
// 关闭OSSClient。
|
||||||
|
ossClient.shutdown();
|
||||||
|
|
||||||
|
// 返回是否存在
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -403,4 +403,22 @@ public class ReflectUtils
|
|||||||
}
|
}
|
||||||
return new RuntimeException(msg, e);
|
return new RuntimeException(msg, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据属性名获取属性值
|
||||||
|
*
|
||||||
|
* @param fieldName
|
||||||
|
* @param object
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getFieldValueByFieldName(String fieldName, Object object) {
|
||||||
|
try {
|
||||||
|
Field field = object.getClass().getDeclaredField(fieldName);
|
||||||
|
//设置对象的访问权限,保证对private的属性的访问
|
||||||
|
field.setAccessible(true);
|
||||||
|
return field.get(object) == null ? "" : field.get(object).toString();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.stdiet.custom.domain;
|
package com.stdiet.custom.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.stdiet.common.annotation.Excel;
|
import com.stdiet.common.annotation.Excel;
|
||||||
@ -13,6 +14,7 @@ import java.math.BigDecimal;
|
|||||||
* @author wonder
|
* @author wonder
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
public class SysCommision extends BaseEntity {
|
public class SysCommision extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ -58,86 +60,6 @@ public class SysCommision extends BaseEntity {
|
|||||||
@Excel(name = "提成", scale = 2)
|
@Excel(name = "提成", scale = 2)
|
||||||
private BigDecimal commision;
|
private BigDecimal commision;
|
||||||
|
|
||||||
public BigDecimal getCommision() {
|
//订单审核状态
|
||||||
return commision;
|
private String reviewStatus;
|
||||||
}
|
|
||||||
|
|
||||||
public void setCommision(BigDecimal commision) {
|
|
||||||
this.commision = commision;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getPostId() {
|
|
||||||
return postId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPostId(Long postId) {
|
|
||||||
this.postId = postId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPostName(String postName) {
|
|
||||||
this.postName = postName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPostName() {
|
|
||||||
return postName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRuleId(Long ruleId) {
|
|
||||||
this.ruleId = ruleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getRuleId() {
|
|
||||||
return ruleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserId(Long userId) {
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getUserId() {
|
|
||||||
return userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserName(String userName) {
|
|
||||||
this.userName = userName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUserName() {
|
|
||||||
return userName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAmount(BigDecimal amount) {
|
|
||||||
this.amount = amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getAmount() {
|
|
||||||
return amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRate(Float rate) {
|
|
||||||
this.rate = rate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Float getRate() {
|
|
||||||
return rate;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("ruleId", getRuleId())
|
|
||||||
.append("userId", getUserId())
|
|
||||||
.append("userName", getUserName())
|
|
||||||
.append("postId", getPostId())
|
|
||||||
.append("postName", getPostName())
|
|
||||||
.append("amount", getAmount())
|
|
||||||
.append("commision", getCommision())
|
|
||||||
.append("rate", getRate())
|
|
||||||
.append("createBy", getCreateBy())
|
|
||||||
.append("createTime", getCreateTime())
|
|
||||||
.append("updateBy", getUpdateBy())
|
|
||||||
.append("updateTime", getUpdateTime())
|
|
||||||
.append("remark", getRemark())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.stdiet.custom.domain;
|
||||||
|
|
||||||
|
import com.stdiet.common.annotation.Excel;
|
||||||
|
import com.stdiet.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户案例管理对象 sys_customer_case
|
||||||
|
*
|
||||||
|
* @author xiezhijun
|
||||||
|
* @date 2021-03-04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SysCustomerCase extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 案例名称 */
|
||||||
|
@Excel(name = "案例名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 案例关键词 */
|
||||||
|
@Excel(name = "关键词")
|
||||||
|
private String keyword;
|
||||||
|
|
||||||
|
/** 案例所属客户ID */
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
@Excel(name = "所属客户")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
/** 删除标识 0未删除 1已删除,默认0 */
|
||||||
|
private Long delFlag;
|
||||||
|
|
||||||
|
//案例文件名称数组
|
||||||
|
private String[] caseFileName;
|
||||||
|
|
||||||
|
//案例文件URL数组
|
||||||
|
private String[] caseFileUrl;
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.stdiet.custom.domain;
|
||||||
|
|
||||||
|
import com.stdiet.common.annotation.Excel;
|
||||||
|
import com.stdiet.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户案例对应文件管理对象 sys_customer_case_file
|
||||||
|
*
|
||||||
|
* @author xiezhijun
|
||||||
|
* @date 2021-03-04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SysCustomerCaseFile extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 案例文件 */
|
||||||
|
@Excel(name = "案例文件")
|
||||||
|
private Long caseId;
|
||||||
|
|
||||||
|
/** 文件路径 */
|
||||||
|
@Excel(name = "文件路径")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
|
/** 文件名字 */
|
||||||
|
@Excel(name = "文件名字")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
/** 删除标识 0未删除 1已删除 */
|
||||||
|
private Long delFlag;
|
||||||
|
}
|
@ -433,6 +433,9 @@ public class SysCustomerHealthy extends BaseEntity
|
|||||||
//备注
|
//备注
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/** 减脂指导 */
|
||||||
|
private String guidance;
|
||||||
|
|
||||||
/** 湿气数据 */
|
/** 湿气数据 */
|
||||||
@Excel(name = "湿气数据")
|
@Excel(name = "湿气数据")
|
||||||
private String moistureDate;
|
private String moistureDate;
|
||||||
|
@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import com.stdiet.common.annotation.Excel;
|
import com.stdiet.common.annotation.Excel;
|
||||||
@ -269,6 +270,9 @@ public class SysOrder extends BaseEntity {
|
|||||||
//拆分比例,如:1,9就是按照比例10%、90%拆分,非持久化字段
|
//拆分比例,如:1,9就是按照比例10%、90%拆分,非持久化字段
|
||||||
private String nutritionistRate;
|
private String nutritionistRate;
|
||||||
|
|
||||||
|
//订单查询时的订单类型二维数组
|
||||||
|
private JSONArray searchOrderTypeArray;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,11 +1,12 @@
|
|||||||
package com.stdiet.custom.domain;
|
package com.stdiet.custom.domain;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.stdiet.common.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.stdiet.common.annotation.Excel;
|
|
||||||
import com.stdiet.common.core.domain.BaseEntity;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单服务暂停对象 sys_order_pause
|
* 订单服务暂停对象 sys_order_pause
|
||||||
@ -13,115 +14,59 @@ import com.stdiet.common.core.domain.BaseEntity;
|
|||||||
* @author xzj
|
* @author xzj
|
||||||
* @date 2021-01-07
|
* @date 2021-01-07
|
||||||
*/
|
*/
|
||||||
public class SysOrderPause extends BaseEntity
|
@Data
|
||||||
{
|
public class SysOrderPause {
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/** $column.columnComment */
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 订单id */
|
/**
|
||||||
|
* 订单id
|
||||||
|
*/
|
||||||
private Long orderId;
|
private Long orderId;
|
||||||
|
|
||||||
/** 服务暂停开始时间 */
|
private Long cusId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务暂停开始时间
|
||||||
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Excel(name = "服务暂停开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "服务暂停开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date pauseStartDate;
|
private Date pauseStartDate;
|
||||||
|
|
||||||
/** 服务暂停结束时间 */
|
/**
|
||||||
|
* 服务暂停结束时间
|
||||||
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Excel(name = "服务暂停结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "服务暂停结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date pauseEndDate;
|
private Date pauseEndDate;
|
||||||
|
|
||||||
/** 服务暂停理由 */
|
/**
|
||||||
|
* 服务暂停理由
|
||||||
|
*/
|
||||||
@Excel(name = "服务暂停理由")
|
@Excel(name = "服务暂停理由")
|
||||||
private String reason;
|
private String reason;
|
||||||
|
|
||||||
/** 备注 */
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
@Excel(name = "备注")
|
@Excel(name = "备注")
|
||||||
private String remarks;
|
private String remarks;
|
||||||
|
|
||||||
/** 删除标识 0未删除 1已删除,默认0 */
|
/**
|
||||||
|
* 删除标识 0未删除 1已删除,默认0
|
||||||
|
*/
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
public void setId(Long id)
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
{
|
private Date createTime;
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId()
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
{
|
private Date updateTime;
|
||||||
return id;
|
|
||||||
}
|
|
||||||
public void setOrderId(Long orderId)
|
|
||||||
{
|
|
||||||
this.orderId = orderId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getOrderId()
|
private String createBy;
|
||||||
{
|
|
||||||
return orderId;
|
|
||||||
}
|
|
||||||
public void setPauseStartDate(Date pauseStartDate)
|
|
||||||
{
|
|
||||||
this.pauseStartDate = pauseStartDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getPauseStartDate()
|
private String updateBy;
|
||||||
{
|
|
||||||
return pauseStartDate;
|
|
||||||
}
|
|
||||||
public void setPauseEndDate(Date pauseEndDate)
|
|
||||||
{
|
|
||||||
this.pauseEndDate = pauseEndDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getPauseEndDate()
|
|
||||||
{
|
|
||||||
return pauseEndDate;
|
|
||||||
}
|
|
||||||
public void setReason(String reason)
|
|
||||||
{
|
|
||||||
this.reason = reason;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getReason()
|
|
||||||
{
|
|
||||||
return reason;
|
|
||||||
}
|
|
||||||
public void setRemarks(String remarks)
|
|
||||||
{
|
|
||||||
this.remarks = remarks;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRemarks()
|
|
||||||
{
|
|
||||||
return remarks;
|
|
||||||
}
|
|
||||||
public void setDelFlag(Integer delFlag)
|
|
||||||
{
|
|
||||||
this.delFlag = delFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getDelFlag()
|
|
||||||
{
|
|
||||||
return delFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("id", getId())
|
|
||||||
.append("orderId", getOrderId())
|
|
||||||
.append("pauseStartDate", getPauseStartDate())
|
|
||||||
.append("pauseEndDate", getPauseEndDate())
|
|
||||||
.append("reason", getReason())
|
|
||||||
.append("remarks", getRemarks())
|
|
||||||
.append("createTime", getCreateTime())
|
|
||||||
.append("createBy", getCreateBy())
|
|
||||||
.append("updateTime", getUpdateTime())
|
|
||||||
.append("updateBy", getUpdateBy())
|
|
||||||
.append("delFlag", getDelFlag())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.stdiet.custom.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SysRecipesDetail {
|
||||||
|
|
||||||
|
private List<SysRecipesPlan> plans;
|
||||||
|
|
||||||
|
}
|
@ -1,12 +1,10 @@
|
|||||||
package com.stdiet.custom.domain;
|
package com.stdiet.custom.domain;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.stdiet.common.annotation.Excel;
|
import com.stdiet.common.annotation.Excel;
|
||||||
import com.stdiet.common.core.domain.BaseEntity;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 食谱计划对象 sys_recipes_plan
|
* 食谱计划对象 sys_recipes_plan
|
||||||
@ -15,19 +13,26 @@ import com.stdiet.common.core.domain.BaseEntity;
|
|||||||
* @date 2021-01-15
|
* @date 2021-01-15
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class SysRecipesPlan extends BaseEntity
|
public class SysRecipesPlan {
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/** $column.columnComment */
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 订单ID */
|
/**
|
||||||
|
* 订单ID
|
||||||
|
*/
|
||||||
//@Excel(name = "订单ID")
|
//@Excel(name = "订单ID")
|
||||||
private Long orderId;
|
private Long orderId;
|
||||||
|
|
||||||
private Long cusId;
|
private Long cusId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对外的用户id
|
||||||
|
*/
|
||||||
|
private String outId;
|
||||||
|
|
||||||
//客户ID
|
//客户ID
|
||||||
// private Long customerId;
|
// private Long customerId;
|
||||||
|
|
||||||
@ -46,12 +51,16 @@ public class SysRecipesPlan extends BaseEntity
|
|||||||
//处理过的客户手机号
|
//处理过的客户手机号
|
||||||
private String hidePhone;
|
private String hidePhone;
|
||||||
|
|
||||||
/** 食谱开始日期 */
|
/**
|
||||||
|
* 食谱开始日期
|
||||||
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Excel(name = "食谱开始日期", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "食谱开始日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date startDate;
|
private Date startDate;
|
||||||
|
|
||||||
/** 食谱结束日期 */
|
/**
|
||||||
|
* 食谱结束日期
|
||||||
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Excel(name = "食谱结束日期", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "食谱结束日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date endDate;
|
private Date endDate;
|
||||||
@ -78,19 +87,61 @@ public class SysRecipesPlan extends BaseEntity
|
|||||||
@Excel(name = "营养师助理")
|
@Excel(name = "营养师助理")
|
||||||
private String nutritionistAssis;
|
private String nutritionistAssis;
|
||||||
|
|
||||||
/** 食谱ID */
|
/**
|
||||||
|
* 食谱ID
|
||||||
|
*/
|
||||||
//@Excel(name = "食谱ID")
|
//@Excel(name = "食谱ID")
|
||||||
private Long recipesId;
|
private Long recipesId;
|
||||||
|
|
||||||
/** 食谱是否发送,0未发送 1已发送 */
|
/**
|
||||||
|
* 食谱是否发送,0未发送 1已发送
|
||||||
|
*/
|
||||||
@Excel(name = "食谱是否发送", readConverterExp = "0=未发送,1=已发送")
|
@Excel(name = "食谱是否发送", readConverterExp = "0=未发送,1=已发送")
|
||||||
private Integer sendFlag;
|
private Integer sendFlag;
|
||||||
|
|
||||||
/** 食谱发送时间 */
|
/**
|
||||||
|
* 食谱发送时间
|
||||||
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Excel(name = "食谱发送时间", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "食谱发送时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date sendTime;
|
private Date sendTime;
|
||||||
|
|
||||||
/** 删除标识 0未删除 1已删除 默认0 */
|
/**
|
||||||
|
* 删除标识 0未删除 1已删除 默认0
|
||||||
|
*/
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核标识 0未审核 1已审核 默认0
|
||||||
|
*/
|
||||||
|
private Integer reviewStatus;
|
||||||
|
|
||||||
|
/** 该食谱计划中暂停日期,使用 | 隔开 */
|
||||||
|
//@Excel(name = "该食谱计划中暂停日期,使用 | 隔开")
|
||||||
|
private String pauseDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新者
|
||||||
|
*/
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
// 0-普通 1-模板
|
||||||
|
private Integer type;
|
||||||
}
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.stdiet.custom.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SysRecipesPlanListInfo {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date startDate;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date endDate;
|
||||||
|
|
||||||
|
private Integer startNumDay;
|
||||||
|
|
||||||
|
private Integer endNumDay;
|
||||||
|
|
||||||
|
private List<SysRecipesPlan> menus;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package com.stdiet.custom.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SysRecipesTemplate {
|
||||||
|
Long id;
|
||||||
|
|
||||||
|
String name;
|
||||||
|
|
||||||
|
Long nutritionistId;
|
||||||
|
|
||||||
|
String nutritionist;
|
||||||
|
|
||||||
|
Long nutriAssisId;
|
||||||
|
|
||||||
|
String nutriAssis;
|
||||||
|
|
||||||
|
Long planId;
|
||||||
|
|
||||||
|
String remark;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
Date updateTime;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
Date createTime;
|
||||||
|
|
||||||
|
String updateBy;
|
||||||
|
|
||||||
|
String createBy;
|
||||||
|
|
||||||
|
Long recipesId;
|
||||||
|
|
||||||
|
Integer reviewStatus;
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.stdiet.custom.dto.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FileRequest {
|
||||||
|
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
|
private String fileName;
|
||||||
|
}
|
@ -0,0 +1,396 @@
|
|||||||
|
package com.stdiet.custom.dto.request;
|
||||||
|
|
||||||
|
import com.stdiet.common.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class HealthyDetailRequest implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 客户ID */
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
/** 加密的客户ID,非持久化字段 **/
|
||||||
|
private String customerEncId;
|
||||||
|
|
||||||
|
/** 客户姓名,非持久化字段 */
|
||||||
|
@Excel(name = "客户姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 客户手机号,非持久化字段 */
|
||||||
|
@Excel(name = "客户手机号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/** 调理项目id */
|
||||||
|
//@Excel(name = "调理项目id")
|
||||||
|
private String conditioningProjectId;
|
||||||
|
|
||||||
|
/** 调理项目名称 ,非持久化字段*/
|
||||||
|
@Excel(name = "调理项目")
|
||||||
|
private String conditioningProject;
|
||||||
|
|
||||||
|
/** 0男 1女 2未知,默认2 */
|
||||||
|
@Excel(name = "0男 1女 2未知,默认2")
|
||||||
|
private String sex;
|
||||||
|
|
||||||
|
/** 年龄 */
|
||||||
|
@Excel(name = "年龄")
|
||||||
|
private String age;
|
||||||
|
|
||||||
|
/** 身高 */
|
||||||
|
@Excel(name = "身高")
|
||||||
|
private String tall;
|
||||||
|
|
||||||
|
/** 体重 */
|
||||||
|
@Excel(name = "体重")
|
||||||
|
private String weight;
|
||||||
|
|
||||||
|
/** 调味品种类,使用 , 隔开 */
|
||||||
|
@Excel(name = "调味品种类,使用 , 隔开")
|
||||||
|
private String condiment;
|
||||||
|
|
||||||
|
/** 其他调味品种类 */
|
||||||
|
@Excel(name = "其他调味品种类")
|
||||||
|
private String otherCondiment;
|
||||||
|
|
||||||
|
/** 喜好的烹调方式,使用 , 隔开 */
|
||||||
|
@Excel(name = "喜好的烹调方式,使用 , 隔开")
|
||||||
|
private String cookingStyle;
|
||||||
|
|
||||||
|
/** 烹调方式对应频次,每周几次,使用 , 隔开 */
|
||||||
|
@Excel(name = "烹调方式对应频次,每周几次,使用 , 隔开")
|
||||||
|
private String cookingStyleRate;
|
||||||
|
|
||||||
|
/** 洗菜方式,使用 , 隔开 */
|
||||||
|
@Excel(name = "洗菜方式,使用 , 隔开")
|
||||||
|
private String washVegetablesStyle;
|
||||||
|
|
||||||
|
/** 其他洗菜方式 */
|
||||||
|
@Excel(name = "其他洗菜方式")
|
||||||
|
private String otherWashVegetablesStyle;
|
||||||
|
|
||||||
|
/** 早餐习惯 */
|
||||||
|
@Excel(name = "早餐习惯")
|
||||||
|
private String breakfastType;
|
||||||
|
|
||||||
|
/** 早餐吃的食物 */
|
||||||
|
@Excel(name = "早餐吃的食物")
|
||||||
|
private String breakfastFood;
|
||||||
|
|
||||||
|
/** 午餐习惯,使用 , 隔开 */
|
||||||
|
@Excel(name = "午餐习惯,使用 , 隔开")
|
||||||
|
private String lunchType;
|
||||||
|
|
||||||
|
/** 晚餐习惯,使用 , 隔开 */
|
||||||
|
@Excel(name = "晚餐习惯,使用 , 隔开")
|
||||||
|
private String dinner;
|
||||||
|
|
||||||
|
/** 早餐当中素菜占比 */
|
||||||
|
@Excel(name = "早餐当中素菜占比")
|
||||||
|
private String vegetableRate;
|
||||||
|
|
||||||
|
/** 最常吃的肉类 */
|
||||||
|
@Excel(name = "最常吃的肉类")
|
||||||
|
private String commonMeat;
|
||||||
|
|
||||||
|
/** 晚餐时间(24小时制) */
|
||||||
|
@Excel(name = "晚餐时间", readConverterExp = "2=4小时制")
|
||||||
|
private String dinnerTime;
|
||||||
|
|
||||||
|
/** 每周吃夜宵次数,默认0 */
|
||||||
|
@Excel(name = "每周吃夜宵次数,默认0")
|
||||||
|
private String supperNum;
|
||||||
|
|
||||||
|
/** 夜宵通常吃的食物 */
|
||||||
|
@Excel(name = "夜宵通常吃的食物")
|
||||||
|
private String supperFood;
|
||||||
|
|
||||||
|
/** 食物的冷热偏好 */
|
||||||
|
@Excel(name = "食物的冷热偏好")
|
||||||
|
private String dietHotAndCold;
|
||||||
|
|
||||||
|
/** 食物的口味偏好,使用 , 隔开 */
|
||||||
|
@Excel(name = "食物的口味偏好,使用 , 隔开")
|
||||||
|
private String dietFlavor;
|
||||||
|
|
||||||
|
/** 平均每周吃生菜几次 */
|
||||||
|
@Excel(name = "平均每周吃生菜几次")
|
||||||
|
private String vegetablesNum;
|
||||||
|
|
||||||
|
/** 每周吃生菜的频次类型 */
|
||||||
|
@Excel(name = "每周吃生菜的频次类型")
|
||||||
|
private String vegetablesRateType;
|
||||||
|
|
||||||
|
/** 平均每天吃水果次数,默认0 */
|
||||||
|
@Excel(name = "平均每天吃水果次数,默认0")
|
||||||
|
private String fruitsNum;
|
||||||
|
|
||||||
|
/** 吃水果的时间段 */
|
||||||
|
@Excel(name = "吃水果的时间段")
|
||||||
|
private String fruitsTime;
|
||||||
|
|
||||||
|
/** 平时吃水果的频次 */
|
||||||
|
@Excel(name = "平时吃水果的频次")
|
||||||
|
private String fruitsRate;
|
||||||
|
|
||||||
|
/** 一餐吃几碗饭 */
|
||||||
|
@Excel(name = "一餐吃几碗饭")
|
||||||
|
private String riceNum;
|
||||||
|
|
||||||
|
/** 吃几成饱 */
|
||||||
|
@Excel(name = "吃几成饱")
|
||||||
|
private String riceFull;
|
||||||
|
|
||||||
|
/** 吃饭速度 */
|
||||||
|
@Excel(name = "吃饭速度")
|
||||||
|
private String eatingSpeed;
|
||||||
|
|
||||||
|
/** 常吃的零食,使用 , 隔开 */
|
||||||
|
@Excel(name = "常吃的零食,使用 , 隔开")
|
||||||
|
private String snacks;
|
||||||
|
|
||||||
|
/** 其他零食 */
|
||||||
|
@Excel(name = "其他零食")
|
||||||
|
private String otherSnacks;
|
||||||
|
|
||||||
|
/** 有无服用营养保健品,0无 1有 */
|
||||||
|
@Excel(name = "有无服用营养保健品,0无 1有")
|
||||||
|
private String healthProductsFlag;
|
||||||
|
|
||||||
|
/** 营养保健品品牌名 */
|
||||||
|
@Excel(name = "营养保健品品牌名")
|
||||||
|
private String healthProductsBrand;
|
||||||
|
|
||||||
|
/** 营养保健品产品名 */
|
||||||
|
@Excel(name = "营养保健品产品名")
|
||||||
|
private String healthProductsName;
|
||||||
|
|
||||||
|
/** 服用营养保健品频次,每周几次 */
|
||||||
|
@Excel(name = "服用营养保健品频次,每周几次")
|
||||||
|
private String healthProductsWeekRate;
|
||||||
|
|
||||||
|
/** 服用营养保健品频次,每天几次 */
|
||||||
|
@Excel(name = "服用营养保健品频次,每天几次")
|
||||||
|
private String healthProductsDayRate;
|
||||||
|
|
||||||
|
/** 每天的饮水量,单位:毫升 */
|
||||||
|
@Excel(name = "每天的饮水量,单位:毫升")
|
||||||
|
private String waterNum;
|
||||||
|
|
||||||
|
/** 喜欢喝什么水,使用 , 隔开 */
|
||||||
|
@Excel(name = "喜欢喝什么水,使用 , 隔开")
|
||||||
|
private String waterType;
|
||||||
|
|
||||||
|
/** 喝水习惯,使用 , 隔开 */
|
||||||
|
@Excel(name = "喝水习惯,使用 , 隔开")
|
||||||
|
private String waterHabit;
|
||||||
|
|
||||||
|
/** 常喝的饮品的每周频次,使用,隔开 */
|
||||||
|
@Excel(name = "常喝的饮品的每周频次,使用,隔开")
|
||||||
|
private String drinksNum;
|
||||||
|
|
||||||
|
/** 是否喝酒 */
|
||||||
|
@Excel(name = "是否喝酒")
|
||||||
|
private String drinkWineFlag;
|
||||||
|
|
||||||
|
/** 喝酒种类,使用,隔开 */
|
||||||
|
@Excel(name = "喝酒种类,使用,隔开")
|
||||||
|
private String drinkWineClassify;
|
||||||
|
|
||||||
|
/** 其他酒种类 */
|
||||||
|
@Excel(name = "其他酒种类")
|
||||||
|
private String otherWineClassify;
|
||||||
|
|
||||||
|
/** 对应酒的量 */
|
||||||
|
@Excel(name = "对应酒的量")
|
||||||
|
private String drinkWineAmount;
|
||||||
|
|
||||||
|
/** 是否抽烟,0否 1是,默认0 */
|
||||||
|
@Excel(name = "是否抽烟,0否 1是,默认0")
|
||||||
|
private String smokeFlag;
|
||||||
|
|
||||||
|
/** 抽烟频次和烟龄,戒烟几年,使用,隔开 */
|
||||||
|
@Excel(name = "抽烟频次和烟龄,戒烟几年,使用,隔开")
|
||||||
|
private String smokeRate;
|
||||||
|
|
||||||
|
/** 是否经常抽二手烟 0否 1是,默认0 */
|
||||||
|
@Excel(name = "是否经常抽二手烟 0否 1是,默认0")
|
||||||
|
private String secondSmoke;
|
||||||
|
|
||||||
|
/** 工作行业 */
|
||||||
|
@Excel(name = "工作行业")
|
||||||
|
private String workIndustry;
|
||||||
|
|
||||||
|
/** 工作性质,使用,隔开 */
|
||||||
|
@Excel(name = "工作性质,使用,隔开")
|
||||||
|
private String workType;
|
||||||
|
|
||||||
|
/** 排便次数 */
|
||||||
|
@Excel(name = "排便次数")
|
||||||
|
private String defecationNum;
|
||||||
|
|
||||||
|
/** 其他手动输入的排便次数 */
|
||||||
|
@Excel(name = "其他手动输入的排便次数")
|
||||||
|
private String otherDefecationNum;
|
||||||
|
|
||||||
|
/** 排便时间段,使用,隔开 */
|
||||||
|
@Excel(name = "排便时间段,使用,隔开")
|
||||||
|
private String defecationTime;
|
||||||
|
|
||||||
|
/** 排便的形状 */
|
||||||
|
@Excel(name = "排便的形状")
|
||||||
|
private String defecationShape;
|
||||||
|
|
||||||
|
/** 排便的气味 */
|
||||||
|
@Excel(name = "排便的气味")
|
||||||
|
private String defecationSmell;
|
||||||
|
|
||||||
|
/** 排便的速度 */
|
||||||
|
@Excel(name = "排便的速度")
|
||||||
|
private String defecationSpeed;
|
||||||
|
|
||||||
|
/** 排便的颜色 */
|
||||||
|
@Excel(name = "排便的颜色")
|
||||||
|
private String defecationColor;
|
||||||
|
|
||||||
|
/** 每周运动次数 */
|
||||||
|
@Excel(name = "每周运动次数")
|
||||||
|
private String motionNum;
|
||||||
|
|
||||||
|
/** 每次运动的时长,分钟 */
|
||||||
|
private String motionDuration;
|
||||||
|
|
||||||
|
/** 每天运动的时间,24小时制 */
|
||||||
|
private String motionTime;
|
||||||
|
|
||||||
|
/** 有氧运动项目,使用,隔开 */
|
||||||
|
private String aerobicMotionClassify;
|
||||||
|
|
||||||
|
/** 无氧运动项目,使用,隔开 */
|
||||||
|
private String anaerobicMotionClassify;
|
||||||
|
|
||||||
|
/** 无氧有氧项目,使用,隔开 */
|
||||||
|
private String anaerobicAerobicMotionClassify;
|
||||||
|
|
||||||
|
/** 其他运动项目,使用,隔开 */
|
||||||
|
private String otherMotionClassify;
|
||||||
|
|
||||||
|
private String motion;
|
||||||
|
|
||||||
|
/** 运动场地,使用,隔开 */
|
||||||
|
private String motionField;
|
||||||
|
|
||||||
|
/** 其他运动场地 */
|
||||||
|
private String otherMotionField;
|
||||||
|
|
||||||
|
/** 睡觉时间,24小时制 */
|
||||||
|
private String sleepTime;
|
||||||
|
|
||||||
|
/** 睡眠质量 */
|
||||||
|
private String sleepQuality;
|
||||||
|
|
||||||
|
/** 是否有辅助入睡药物,0否 1是,默认0 */
|
||||||
|
private String sleepDrugFlag;
|
||||||
|
|
||||||
|
/** 辅助睡眠类药物名称 */
|
||||||
|
private String sleepDrug;
|
||||||
|
|
||||||
|
/** 是否经常熬夜(超过11点)0否 1是,默认0 */
|
||||||
|
private String stayupLateFlag;
|
||||||
|
|
||||||
|
/** 熬夜频次,每周几次 */
|
||||||
|
private String stayupLateWeekNum;
|
||||||
|
|
||||||
|
/** 家族疾病史,使用,隔开 */
|
||||||
|
private String familyIllnessHistory;
|
||||||
|
|
||||||
|
/** 其他家族病史 */
|
||||||
|
private String otherFamilyIllnessHistory;
|
||||||
|
|
||||||
|
/** 手术史,使用,隔开 */
|
||||||
|
private String operationHistory;
|
||||||
|
|
||||||
|
/** 其他手术史 */
|
||||||
|
private String otherOperationHistory;
|
||||||
|
|
||||||
|
/** 近期是否做过手术,0否 1是,默认0 */
|
||||||
|
private String nearOperationFlag;
|
||||||
|
|
||||||
|
/** 手术恢复情况 */
|
||||||
|
private String recoveryeSituation;
|
||||||
|
|
||||||
|
/** 是否长期服用药物,0否 1是,默认0 */
|
||||||
|
private String longEatDrugFlag;
|
||||||
|
|
||||||
|
/** 长期服用的药物,使用,隔开 */
|
||||||
|
private String longEatDrugClassify;
|
||||||
|
|
||||||
|
/** 其他长期服用的药物 */
|
||||||
|
private String otherLongEatDrugClassify;
|
||||||
|
|
||||||
|
/** 是否出现过过敏症状,0否 1是,默认0 */
|
||||||
|
private String allergyFlag;
|
||||||
|
|
||||||
|
/** 过敏症状 */
|
||||||
|
private String allergySituation;
|
||||||
|
|
||||||
|
/** 过敏源,使用,隔开 */
|
||||||
|
private String allergen;
|
||||||
|
|
||||||
|
/** 其他过敏源 */
|
||||||
|
private String otherAllergen;
|
||||||
|
|
||||||
|
/** 体检报告 */
|
||||||
|
private String medicalReport;
|
||||||
|
|
||||||
|
/** 体检报告名称 */
|
||||||
|
private String medicalReportName;
|
||||||
|
|
||||||
|
/** 南方人北方人,0南方 1北方 */
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
/** 减脂经历方法 */
|
||||||
|
@Excel(name = "减脂经历方法")
|
||||||
|
private String experience;
|
||||||
|
|
||||||
|
/** 是否减脂反弹,0否 1是 */
|
||||||
|
private String rebound;
|
||||||
|
|
||||||
|
/** 减脂遇到的困难 */
|
||||||
|
private String difficulty;
|
||||||
|
|
||||||
|
/** 是否意识到生活习惯是减脂关键 0否 1是 */
|
||||||
|
private String crux;
|
||||||
|
|
||||||
|
/** 忌口或饮食食物 */
|
||||||
|
private String dishesIngredient;
|
||||||
|
|
||||||
|
/** 饮食习惯 */
|
||||||
|
private String makeFoodType;
|
||||||
|
|
||||||
|
/** 客户病史体征,使用,隔开 */
|
||||||
|
private String physicalSigns;
|
||||||
|
|
||||||
|
/** 其他病史体征 **/
|
||||||
|
private String otherPhysicalSigns;
|
||||||
|
|
||||||
|
/** 气血数据 */
|
||||||
|
private String bloodData;
|
||||||
|
|
||||||
|
//备注
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/** 湿气数据 */
|
||||||
|
private String moistureDate;
|
||||||
|
|
||||||
|
|
||||||
|
/** 减脂指导 **/
|
||||||
|
private String guidance;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.stdiet.custom.dto.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SysOrderCommision implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
//后台用户ID
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
//岗位ID
|
||||||
|
private Long postId;
|
||||||
|
|
||||||
|
//订单审核状态
|
||||||
|
private String reviewStatus;
|
||||||
|
|
||||||
|
//订单截止结束时间
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
}
|
@ -69,4 +69,23 @@ public class NutritionalCalories implements Serializable {
|
|||||||
//蛋白质、脂肪、碳水剩余可摄入热量
|
//蛋白质、脂肪、碳水剩余可摄入热量
|
||||||
public Integer[] surplusNutritionalHeat;
|
public Integer[] surplusNutritionalHeat;
|
||||||
|
|
||||||
|
|
||||||
|
private String nutritionalHeat_one;
|
||||||
|
|
||||||
|
private String nutritionalHeat_two;
|
||||||
|
|
||||||
|
private String nutritionalHeat_three;
|
||||||
|
|
||||||
|
private String nutritionalQuality_one;
|
||||||
|
|
||||||
|
private String nutritionalQuality_two;
|
||||||
|
|
||||||
|
private String nutritionalQuality_three;
|
||||||
|
|
||||||
|
private String weightNutritionalRate_one;
|
||||||
|
|
||||||
|
private String weightNutritionalRate_two;
|
||||||
|
|
||||||
|
private String weightNutritionalRate_three;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.stdiet.custom.mapper;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.stdiet.custom.domain.SysCommision;
|
import com.stdiet.custom.domain.SysCommision;
|
||||||
|
import com.stdiet.custom.dto.request.SysOrderCommision;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务提成比例Mapper接口
|
* 业务提成比例Mapper接口
|
||||||
@ -61,5 +62,10 @@ public interface SysCommisionMapper
|
|||||||
|
|
||||||
public List<SysCommision> selectSysCommisionDetail(SysCommision sysCommision);
|
public List<SysCommision> selectSysCommisionDetail(SysCommision sysCommision);
|
||||||
|
|
||||||
List<SysCommision> selectSysCommisionDayDetail(SysCommision sysCommision);
|
/**
|
||||||
|
* 查询售后、营养师用户信息
|
||||||
|
* @param sysCommision
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysCommision> getAfterSaleAndNutri(SysCommision sysCommision);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,87 @@
|
|||||||
|
package com.stdiet.custom.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.stdiet.custom.domain.SysCustomerCaseFile;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户案例对应文件管理Mapper接口
|
||||||
|
*
|
||||||
|
* @author xiezhijun
|
||||||
|
* @date 2021-03-04
|
||||||
|
*/
|
||||||
|
public interface SysCustomerCaseFileMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询客户案例对应文件管理
|
||||||
|
*
|
||||||
|
* @param id 客户案例对应文件管理ID
|
||||||
|
* @return 客户案例对应文件管理
|
||||||
|
*/
|
||||||
|
public SysCustomerCaseFile selectSysCustomerCaseFileById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户案例对应文件管理列表
|
||||||
|
*
|
||||||
|
* @param sysCustomerCaseFile 客户案例对应文件管理
|
||||||
|
* @return 客户案例对应文件管理集合
|
||||||
|
*/
|
||||||
|
public List<SysCustomerCaseFile> selectSysCustomerCaseFileList(SysCustomerCaseFile sysCustomerCaseFile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增客户案例对应文件管理
|
||||||
|
*
|
||||||
|
* @param sysCustomerCaseFile 客户案例对应文件管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSysCustomerCaseFile(SysCustomerCaseFile sysCustomerCaseFile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改客户案例对应文件管理
|
||||||
|
*
|
||||||
|
* @param sysCustomerCaseFile 客户案例对应文件管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSysCustomerCaseFile(SysCustomerCaseFile sysCustomerCaseFile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除客户案例对应文件管理
|
||||||
|
*
|
||||||
|
* @param id 客户案例对应文件管理ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSysCustomerCaseFileById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除客户案例对应文件管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSysCustomerCaseFileByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案例ID删除该案例下的所有文件记录
|
||||||
|
* @param caseId
|
||||||
|
*/
|
||||||
|
int deleteSysCustomerCaseFileByCaseId(@Param("caseId")Long caseId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案例ID批量删除该案例下的所有文件记录
|
||||||
|
* @param caseIds
|
||||||
|
*/
|
||||||
|
int deleteSysCustomerCaseFileByCaseIds(Long[] caseIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入案例文件记录
|
||||||
|
* @param list
|
||||||
|
*/
|
||||||
|
int insertBatch(List<SysCustomerCaseFile> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案例Id查询案例文件列表
|
||||||
|
* @param caseId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysCustomerCaseFile> selectSysCustomerCaseFileListByCaseId(@Param("caseId") Long caseId);
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.stdiet.custom.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.stdiet.custom.domain.SysCustomerCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户案例管理Mapper接口
|
||||||
|
*
|
||||||
|
* @author xiezhijun
|
||||||
|
* @date 2021-03-04
|
||||||
|
*/
|
||||||
|
public interface SysCustomerCaseMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询客户案例管理
|
||||||
|
*
|
||||||
|
* @param id 客户案例管理ID
|
||||||
|
* @return 客户案例管理
|
||||||
|
*/
|
||||||
|
public SysCustomerCase selectSysCustomerCaseById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户案例管理列表
|
||||||
|
*
|
||||||
|
* @param sysCustomerCase 客户案例管理
|
||||||
|
* @return 客户案例管理集合
|
||||||
|
*/
|
||||||
|
public List<SysCustomerCase> selectSysCustomerCaseList(SysCustomerCase sysCustomerCase);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增客户案例管理
|
||||||
|
*
|
||||||
|
* @param sysCustomerCase 客户案例管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSysCustomerCase(SysCustomerCase sysCustomerCase);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改客户案例管理
|
||||||
|
*
|
||||||
|
* @param sysCustomerCase 客户案例管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSysCustomerCase(SysCustomerCase sysCustomerCase);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除客户案例管理
|
||||||
|
*
|
||||||
|
* @param id 客户案例管理ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSysCustomerCaseById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除客户案例管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSysCustomerCaseByIds(Long[] ids);
|
||||||
|
}
|
@ -2,6 +2,7 @@ package com.stdiet.custom.mapper;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.stdiet.common.core.domain.entity.SysDictData;
|
||||||
import com.stdiet.custom.domain.SysCustomer;
|
import com.stdiet.custom.domain.SysCustomer;
|
||||||
import com.stdiet.custom.domain.SysCustomerHealthy;
|
import com.stdiet.custom.domain.SysCustomerHealthy;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@ -79,4 +80,12 @@ public interface SysCustomerHealthyMapper
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int deleteCustomerHealthyByCustomerId(@Param("customerId")Long customerId);
|
int deleteCustomerHealthyByCustomerId(@Param("customerId")Long customerId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据类型、键值集合查询字典类型
|
||||||
|
* @param sysDictData
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<SysDictData> selectDictDataByTypeAndValue(SysDictData sysDictData);
|
||||||
}
|
}
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||||||
import com.stdiet.custom.domain.SysCommision;
|
import com.stdiet.custom.domain.SysCommision;
|
||||||
import com.stdiet.custom.domain.SysCommissionDayDetail;
|
import com.stdiet.custom.domain.SysCommissionDayDetail;
|
||||||
import com.stdiet.custom.domain.SysOrder;
|
import com.stdiet.custom.domain.SysOrder;
|
||||||
|
import com.stdiet.custom.dto.request.SysOrderCommision;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -72,7 +73,7 @@ public interface SysOrderMapper
|
|||||||
public BigDecimal selectAllOrderAmount(SysOrder sysOrder);
|
public BigDecimal selectAllOrderAmount(SysOrder sysOrder);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取订单信息
|
* 获取订单信息(按天提成计算)
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SysOrder> selectSimpleOrderMessage(SysCommision sysCommision);
|
List<SysOrder> selectSimpleOrderMessage(SysCommision sysCommision);
|
||||||
|
@ -65,7 +65,7 @@ public interface SysOrderPauseMapper
|
|||||||
* @param sysOrderPause
|
* @param sysOrderPause
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int getCountByOrderIdAndPauseDate(SysOrderPause sysOrderPause);
|
int getCountByCusIdAndPauseDate(SysOrderPause sysOrderPause);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据订单ID删除暂停记录
|
* 根据订单ID删除暂停记录
|
||||||
@ -73,4 +73,13 @@ public interface SysOrderPauseMapper
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int deletePauseByOrderId(Long[] orderIds);
|
int deletePauseByOrderId(Long[] orderIds);
|
||||||
|
|
||||||
|
long selectNearMainOrderIdByCusId(Long cusId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单ID获取暂停计划
|
||||||
|
* @param orderId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysOrderPause> getPauseListByOrderId(@Param("orderId")Long orderId);
|
||||||
}
|
}
|
@ -25,4 +25,6 @@ public interface SysRecipesMapper {
|
|||||||
public int addDishes(SysRecipesDailyDishes sysRecipesDaily);
|
public int addDishes(SysRecipesDailyDishes sysRecipesDaily);
|
||||||
|
|
||||||
public int deleteDishes(Long id);
|
public int deleteDishes(Long id);
|
||||||
|
|
||||||
|
public List<SysRecipesDailyDishes> selectDishesByMenuId(Long id);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,8 @@ package com.stdiet.custom.mapper;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.stdiet.custom.domain.SysRecipesPlan;
|
import com.stdiet.custom.domain.SysRecipesPlan;
|
||||||
|
import com.stdiet.custom.domain.SysRecipesPlanListInfo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 食谱计划Mapper接口
|
* 食谱计划Mapper接口
|
||||||
@ -80,10 +82,32 @@ public interface SysRecipesPlanMapper
|
|||||||
*/
|
*/
|
||||||
List<SysRecipesPlan> selectPlanListByCondition(SysRecipesPlan sysRecipesPlan);
|
List<SysRecipesPlan> selectPlanListByCondition(SysRecipesPlan sysRecipesPlan);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户ID查询最后一天食谱计划
|
||||||
|
* @param customerId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
SysRecipesPlan getLastDayRecipesPlan(@Param("customerId")Long customerId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据订单ID查询食谱计划
|
* 根据订单ID查询食谱计划
|
||||||
* @param sysRecipesPlan
|
* @param sysRecipesPlan
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SysRecipesPlan> selectPlanListByOrderId(SysRecipesPlan sysRecipesPlan);
|
List<SysRecipesPlan> selectPlanListByOrderId(SysRecipesPlan sysRecipesPlan);
|
||||||
|
|
||||||
|
Long getCusIdByOutId(String outId);
|
||||||
|
|
||||||
|
List<SysRecipesPlanListInfo> selectRecipesPlanListInfo(String outId);
|
||||||
|
|
||||||
|
List<SysRecipesPlan> selectPlanListByCusId(Long cusId);
|
||||||
|
|
||||||
|
List<SysRecipesPlan> selectRecipesModelList(SysRecipesPlan sysRecipesPlan);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新食谱计划的开始时间、结束时间
|
||||||
|
* @param list
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateMuchRecipesPlanDate(SysRecipesPlan sysRecipesPlan);
|
||||||
}
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.stdiet.custom.mapper;
|
||||||
|
|
||||||
|
import com.stdiet.custom.domain.SysRecipesTemplate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 食谱计划Mapper接口
|
||||||
|
*
|
||||||
|
* @author wonder
|
||||||
|
* @date 2021-02-27
|
||||||
|
*/
|
||||||
|
public interface SysRecipesTemplateMapper {
|
||||||
|
List<SysRecipesTemplate> selectRecipesTemplateListByCondition(SysRecipesTemplate sysRecipesTemplate);
|
||||||
|
|
||||||
|
int insertRecipsesTemplate(SysRecipesTemplate sysRecipesTemplate);
|
||||||
|
|
||||||
|
int updateRecipesTemplate(SysRecipesTemplate sysRecipesTemplate);
|
||||||
|
|
||||||
|
int removeRecipesTemplate(Long id);
|
||||||
|
|
||||||
|
SysRecipesTemplate getRecipesTemplateById(Long id);
|
||||||
|
}
|
@ -62,6 +62,4 @@ public interface ISysCommisionService
|
|||||||
public int deleteSysCommisionById(Long ruleId);
|
public int deleteSysCommisionById(Long ruleId);
|
||||||
|
|
||||||
public List<SysCommision> selectSysCommisionDetail(SysCommision sysCommision);
|
public List<SysCommision> selectSysCommisionDetail(SysCommision sysCommision);
|
||||||
|
|
||||||
List<SysCommision> selectSysCommisionDayDetail(SysCommision sysCommision);
|
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import com.stdiet.custom.domain.SysCommision;
|
|||||||
import com.stdiet.custom.domain.SysCommissionDayDetail;
|
import com.stdiet.custom.domain.SysCommissionDayDetail;
|
||||||
import com.stdiet.custom.domain.SysOrder;
|
import com.stdiet.custom.domain.SysOrder;
|
||||||
import com.stdiet.custom.domain.SysOrderCommisionDayDetail;
|
import com.stdiet.custom.domain.SysOrderCommisionDayDetail;
|
||||||
|
import com.stdiet.custom.dto.request.SysOrderCommision;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.stdiet.custom.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.stdiet.custom.domain.SysCustomerCase;
|
||||||
|
import com.stdiet.custom.domain.SysCustomerCaseFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户案例管理Service接口
|
||||||
|
*
|
||||||
|
* @author xiezhijun
|
||||||
|
* @date 2021-03-04
|
||||||
|
*/
|
||||||
|
public interface ISysCustomerCaseService {
|
||||||
|
/**
|
||||||
|
* 查询客户案例管理
|
||||||
|
*
|
||||||
|
* @param id 客户案例管理ID
|
||||||
|
* @return 客户案例管理
|
||||||
|
*/
|
||||||
|
public SysCustomerCase selectSysCustomerCaseById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户案例管理列表
|
||||||
|
*
|
||||||
|
* @param sysCustomerCase 客户案例管理
|
||||||
|
* @return 客户案例管理集合
|
||||||
|
*/
|
||||||
|
public List<SysCustomerCase> selectSysCustomerCaseList(SysCustomerCase sysCustomerCase);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增客户案例管理
|
||||||
|
*
|
||||||
|
* @param sysCustomerCase 客户案例管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSysCustomerCase(SysCustomerCase sysCustomerCase);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改客户案例管理
|
||||||
|
*
|
||||||
|
* @param sysCustomerCase 客户案例管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSysCustomerCase(SysCustomerCase sysCustomerCase);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除客户案例管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的客户案例管理ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSysCustomerCaseByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除客户案例管理信息
|
||||||
|
*
|
||||||
|
* @param id 客户案例管理ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSysCustomerCaseById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案例ID获取对应文件列表
|
||||||
|
* @param caseId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysCustomerCaseFile> getFileListByCaseId(Long caseId);
|
||||||
|
|
||||||
|
}
|
@ -3,7 +3,9 @@ package com.stdiet.custom.service;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.stdiet.common.core.domain.AjaxResult;
|
import com.stdiet.common.core.domain.AjaxResult;
|
||||||
|
import com.stdiet.common.core.domain.entity.SysDictData;
|
||||||
import com.stdiet.custom.domain.SysCustomerHealthy;
|
import com.stdiet.custom.domain.SysCustomerHealthy;
|
||||||
|
import com.stdiet.custom.dto.request.HealthyDetailRequest;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -78,4 +80,18 @@ public interface ISysCustomerHealthyService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int deleteCustomerHealthyByCustomerId(Long customerId);
|
int deleteCustomerHealthyByCustomerId(Long customerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成健康评估报告
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult generateHealthyReport(HealthyDetailRequest healthyDetailRequest);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据类型、键值集合查询字典类型
|
||||||
|
* @param sysDictData
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<SysDictData> selectDictDataByTypeAndValue(SysDictData sysDictData);
|
||||||
}
|
}
|
@ -1,6 +1,8 @@
|
|||||||
package com.stdiet.custom.service;
|
package com.stdiet.custom.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.stdiet.custom.domain.SysCustomer;
|
import com.stdiet.custom.domain.SysCustomer;
|
||||||
import com.stdiet.custom.dto.request.CustomerInvestigateRequest;
|
import com.stdiet.custom.dto.request.CustomerInvestigateRequest;
|
||||||
|
|
||||||
@ -74,4 +76,9 @@ public interface ISysCustomerService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean isCustomerExistByPhone(SysCustomer sysCustomer);
|
boolean isCustomerExistByPhone(SysCustomer sysCustomer);
|
||||||
|
|
||||||
|
Map<String,Object> getPhysicalSignsById(Long id);
|
||||||
|
|
||||||
|
Map<String,Object> getPhysicalSignsByOutId(String id);
|
||||||
|
|
||||||
}
|
}
|
@ -64,7 +64,7 @@ public interface ISysOrderPauseService
|
|||||||
* @param sysOrderPause
|
* @param sysOrderPause
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int getCountByOrderIdAndPauseDate(SysOrderPause sysOrderPause);
|
int getCountByCusIdAndPauseDate(SysOrderPause sysOrderPause);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据订单ID删除暂停记录
|
* 根据订单ID删除暂停记录
|
||||||
@ -72,4 +72,13 @@ public interface ISysOrderPauseService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int deletePauseByOrderId(Long[] orderIds);
|
int deletePauseByOrderId(Long[] orderIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单ID获取暂停记录
|
||||||
|
* @param orderId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysOrderPause> getPauseListByOrderId(Long orderId);
|
||||||
|
|
||||||
|
long selectNearMainOrderIdByCusId(Long cusId);
|
||||||
}
|
}
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.stdiet.custom.domain.SysOrder;
|
import com.stdiet.custom.domain.SysOrder;
|
||||||
import com.stdiet.custom.domain.SysRecipesPlan;
|
import com.stdiet.custom.domain.SysRecipesPlan;
|
||||||
|
import com.stdiet.custom.domain.SysRecipesPlanListInfo;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -90,5 +91,33 @@ public interface ISysRecipesPlanService
|
|||||||
*/
|
*/
|
||||||
List<SysRecipesPlan> selectPlanListByOrderId(SysRecipesPlan sysRecipesPlan);
|
List<SysRecipesPlan> selectPlanListByOrderId(SysRecipesPlan sysRecipesPlan);
|
||||||
|
|
||||||
public void myGenerateRecipesPlan(SysOrder sysOrder);
|
|
||||||
|
/**
|
||||||
|
* 通过outId查询cusId
|
||||||
|
* @param outId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Long getCusIdByOutId(String outId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户ID查询最后一天食谱计划
|
||||||
|
* @param customerId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
SysRecipesPlan getLastDayRecipesPlan(Long customerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过outId查询食谱计划简要
|
||||||
|
* @param outId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysRecipesPlanListInfo> selectRecipesPlanListInfo(String outId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过客户id查询食谱计划
|
||||||
|
* @param cusId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysRecipesPlan> selectPlanListByCusId(Long cusId);
|
||||||
|
|
||||||
}
|
}
|
@ -12,9 +12,12 @@ public interface ISysRecipesService {
|
|||||||
|
|
||||||
public List<SysRecipes> selectSysRecipesByRecipesId(Long id);
|
public List<SysRecipes> selectSysRecipesByRecipesId(Long id);
|
||||||
|
|
||||||
|
public List<SysRecipesDailyDishes> selectDishesByMenuId(Long id);
|
||||||
|
|
||||||
public int updateDishesDetail(SysRecipesDailyDishes sysRecipesDaily);
|
public int updateDishesDetail(SysRecipesDailyDishes sysRecipesDaily);
|
||||||
|
|
||||||
public int addDishes(SysRecipesDailyDishes sysRecipesDaily);
|
public int addDishes(SysRecipesDailyDishes sysRecipesDaily);
|
||||||
|
|
||||||
public int deleteDishes(Long id);
|
public int deleteDishes(Long id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
24
stdiet-custom/src/main/java/com/stdiet/custom/service/ISysRecipesTemplateService.java
Normal file
24
stdiet-custom/src/main/java/com/stdiet/custom/service/ISysRecipesTemplateService.java
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package com.stdiet.custom.service;
|
||||||
|
|
||||||
|
import com.stdiet.custom.domain.SysRecipesTemplate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 食谱计划Service接口
|
||||||
|
*
|
||||||
|
* @author wonder
|
||||||
|
* @date 2021-02-27
|
||||||
|
*/
|
||||||
|
public interface ISysRecipesTemplateService {
|
||||||
|
|
||||||
|
List<SysRecipesTemplate> selectRecipesTemplateListByCondition(SysRecipesTemplate sysRecipesTemplate);
|
||||||
|
|
||||||
|
int insertRecipsesTemplate(SysRecipesTemplate sysRecipesTemplate);
|
||||||
|
|
||||||
|
int updateRecipesTemplate(SysRecipesTemplate sysRecipesTemplate);
|
||||||
|
|
||||||
|
int removeRecipesTemplate(Long id);
|
||||||
|
|
||||||
|
SysRecipesTemplate getRecipesTemplateById(Long id);
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.stdiet.custom.service;
|
||||||
|
|
||||||
|
import com.stdiet.custom.domain.SysRecipesPlanListInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface ISysWapServices {
|
||||||
|
|
||||||
|
List<SysRecipesPlanListInfo> getRecipesPlanListInfo(String outId);
|
||||||
|
|
||||||
|
Map<String, Object> getHealthyDataByOutId(String outId);
|
||||||
|
}
|
@ -98,9 +98,4 @@ public class SysCommisionServiceImpl implements ISysCommisionService
|
|||||||
public List<SysCommision> selectSysCommisionDetail(SysCommision sysCommision) {
|
public List<SysCommision> selectSysCommisionDetail(SysCommision sysCommision) {
|
||||||
return sysCommisionMapper.selectSysCommisionDetail(sysCommision);
|
return sysCommisionMapper.selectSysCommisionDetail(sysCommision);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<SysCommision> selectSysCommisionDayDetail(SysCommision sysCommision){
|
|
||||||
return sysCommisionMapper.selectSysCommisionDayDetail(sysCommision);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package com.stdiet.custom.service.impl;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.stdiet.common.utils.DateUtils;
|
import com.stdiet.common.utils.DateUtils;
|
||||||
import com.stdiet.custom.domain.*;
|
import com.stdiet.custom.domain.*;
|
||||||
|
import com.stdiet.custom.dto.request.SysOrderCommision;
|
||||||
import com.stdiet.custom.mapper.SysCommisionMapper;
|
import com.stdiet.custom.mapper.SysCommisionMapper;
|
||||||
import com.stdiet.custom.mapper.SysOrderMapper;
|
import com.stdiet.custom.mapper.SysOrderMapper;
|
||||||
import com.stdiet.custom.mapper.SysOrderPauseMapper;
|
import com.stdiet.custom.mapper.SysOrderPauseMapper;
|
||||||
@ -32,7 +33,7 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
|||||||
public List<SysCommissionDayDetail> calculateCommissionByDay(SysCommision sysCommision){
|
public List<SysCommissionDayDetail> calculateCommissionByDay(SysCommision sysCommision){
|
||||||
List<SysCommissionDayDetail> result = new ArrayList<>();
|
List<SysCommissionDayDetail> result = new ArrayList<>();
|
||||||
//查询用户
|
//查询用户
|
||||||
List<SysCommision> list = sysCommisionMapper.selectSysCommisionDayDetail(sysCommision);
|
List<SysCommision> list = sysCommisionMapper.getAfterSaleAndNutri(sysCommision);
|
||||||
//合计
|
//合计
|
||||||
SysCommissionDayDetail total = new SysCommissionDayDetail();
|
SysCommissionDayDetail total = new SysCommissionDayDetail();
|
||||||
total.setTotalCommissionAmount(new BigDecimal(0));
|
total.setTotalCommissionAmount(new BigDecimal(0));
|
||||||
|
137
stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerCaseServiceImpl.java
Normal file
137
stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerCaseServiceImpl.java
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
package com.stdiet.custom.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import com.stdiet.common.utils.DateUtils;
|
||||||
|
import com.stdiet.custom.domain.SysCustomerCaseFile;
|
||||||
|
import com.stdiet.custom.mapper.SysCustomerCaseFileMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.stdiet.custom.mapper.SysCustomerCaseMapper;
|
||||||
|
import com.stdiet.custom.domain.SysCustomerCase;
|
||||||
|
import com.stdiet.custom.service.ISysCustomerCaseService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户案例管理Service业务层处理
|
||||||
|
*
|
||||||
|
* @author xiezhijun
|
||||||
|
* @date 2021-03-04
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional
|
||||||
|
public class SysCustomerCaseServiceImpl implements ISysCustomerCaseService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private SysCustomerCaseMapper sysCustomerCaseMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysCustomerCaseFileMapper sysCustomerCaseFileMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户案例管理
|
||||||
|
*
|
||||||
|
* @param id 客户案例管理ID
|
||||||
|
* @return 客户案例管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SysCustomerCase selectSysCustomerCaseById(Long id)
|
||||||
|
{
|
||||||
|
return sysCustomerCaseMapper.selectSysCustomerCaseById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户案例管理列表
|
||||||
|
*
|
||||||
|
* @param sysCustomerCase 客户案例管理
|
||||||
|
* @return 客户案例管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysCustomerCase> selectSysCustomerCaseList(SysCustomerCase sysCustomerCase)
|
||||||
|
{
|
||||||
|
return sysCustomerCaseMapper.selectSysCustomerCaseList(sysCustomerCase);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增客户案例管理
|
||||||
|
*
|
||||||
|
* @param sysCustomerCase 客户案例管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertSysCustomerCase(SysCustomerCase sysCustomerCase)
|
||||||
|
{
|
||||||
|
sysCustomerCase.setCreateTime(DateUtils.getNowDate());
|
||||||
|
int rows = sysCustomerCaseMapper.insertSysCustomerCase(sysCustomerCase);
|
||||||
|
if(rows > 0){
|
||||||
|
//批量添加文件对应列表
|
||||||
|
SysCustomerCaseFile caseFile = null;
|
||||||
|
if(sysCustomerCase.getCaseFileUrl() != null && sysCustomerCase.getCaseFileUrl().length > 0){
|
||||||
|
List<SysCustomerCaseFile> caseFileList = new ArrayList<>();
|
||||||
|
for (String url : sysCustomerCase.getCaseFileUrl()) {
|
||||||
|
caseFile = new SysCustomerCaseFile();
|
||||||
|
caseFile.setCaseId(sysCustomerCase.getId());
|
||||||
|
caseFile.setFileName(sysCustomerCase.getCaseFileName()[caseFileList.size()]);
|
||||||
|
caseFile.setFileUrl(url);
|
||||||
|
caseFileList.add(caseFile);
|
||||||
|
}
|
||||||
|
rows = sysCustomerCaseFileMapper.insertBatch(caseFileList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改客户案例管理
|
||||||
|
*
|
||||||
|
* @param sysCustomerCase 客户案例管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateSysCustomerCase(SysCustomerCase sysCustomerCase)
|
||||||
|
{
|
||||||
|
sysCustomerCase.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return sysCustomerCaseMapper.updateSysCustomerCase(sysCustomerCase);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除客户案例管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的客户案例管理ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSysCustomerCaseByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
int rows = sysCustomerCaseMapper.deleteSysCustomerCaseByIds(ids);
|
||||||
|
if(rows > 0){
|
||||||
|
rows = sysCustomerCaseFileMapper.deleteSysCustomerCaseFileByCaseIds(ids);
|
||||||
|
}
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除客户案例管理信息
|
||||||
|
*
|
||||||
|
* @param id 客户案例管理ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSysCustomerCaseById(Long id)
|
||||||
|
{
|
||||||
|
int rows = sysCustomerCaseMapper.deleteSysCustomerCaseById(id);
|
||||||
|
if(rows > 0){
|
||||||
|
rows = sysCustomerCaseFileMapper.deleteSysCustomerCaseFileByCaseId(id);
|
||||||
|
}
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案例ID获取对应文件列表
|
||||||
|
* @param caseId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<SysCustomerCaseFile> getFileListByCaseId(Long caseId){
|
||||||
|
return sysCustomerCaseFileMapper.selectSysCustomerCaseFileListByCaseId(caseId);
|
||||||
|
}
|
||||||
|
}
|
@ -1,14 +1,22 @@
|
|||||||
package com.stdiet.custom.service.impl;
|
package com.stdiet.custom.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.stdiet.common.config.RuoYiConfig;
|
||||||
import com.stdiet.common.core.domain.AjaxResult;
|
import com.stdiet.common.core.domain.AjaxResult;
|
||||||
|
import com.stdiet.common.core.domain.entity.SysDictData;
|
||||||
|
import com.stdiet.common.utils.DateUtils;
|
||||||
import com.stdiet.common.utils.StringUtils;
|
import com.stdiet.common.utils.StringUtils;
|
||||||
import com.stdiet.common.utils.bean.ObjectUtils;
|
import com.stdiet.common.utils.bean.ObjectUtils;
|
||||||
|
import com.stdiet.common.utils.reflect.ReflectUtils;
|
||||||
import com.stdiet.common.utils.sign.AesUtils;
|
import com.stdiet.common.utils.sign.AesUtils;
|
||||||
import com.stdiet.custom.domain.SysCustomer;
|
import com.stdiet.custom.domain.SysCustomer;
|
||||||
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
|
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
|
||||||
|
import com.stdiet.custom.dto.request.HealthyDetailRequest;
|
||||||
|
import com.stdiet.custom.dto.response.NutritionalCalories;
|
||||||
import com.stdiet.custom.service.ISysCustomerService;
|
import com.stdiet.custom.service.ISysCustomerService;
|
||||||
|
import com.stdiet.custom.utils.NutritionalUtils;
|
||||||
|
import com.stdiet.custom.utils.PdfUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.stdiet.custom.mapper.SysCustomerHealthyMapper;
|
import com.stdiet.custom.mapper.SysCustomerHealthyMapper;
|
||||||
@ -141,4 +149,111 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService
|
|||||||
public int deleteCustomerHealthyByCustomerId(Long customerId){
|
public int deleteCustomerHealthyByCustomerId(Long customerId){
|
||||||
return sysCustomerHealthyMapper.deleteCustomerHealthyByCustomerId(customerId);
|
return sysCustomerHealthyMapper.deleteCustomerHealthyByCustomerId(customerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成健康评估报告
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult generateHealthyReport(HealthyDetailRequest healthyDetailRequest){
|
||||||
|
AjaxResult ajaxResult = AjaxResult.error();
|
||||||
|
String templatePath = "/home/workspace/ShengTangManage/running/pdf/healthyReport.pdf";
|
||||||
|
//String templatePath = "D:\\contract\\healthyReport.pdf";
|
||||||
|
String fileName = "healthyReport" + healthyDetailRequest.getCustomerId() + System.currentTimeMillis() + ".pdf";
|
||||||
|
String filePath = RuoYiConfig.getDownloadPath() + fileName;
|
||||||
|
//查询客户健康信息
|
||||||
|
SysCustomerHealthy sysCustomerHealthy = selectSysCustomerHealthyById(healthyDetailRequest.getId());
|
||||||
|
if(sysCustomerHealthy != null){
|
||||||
|
ajaxResult = PdfUtils.generatePdfFile(templatePath, filePath, getReportData(sysCustomerHealthy, healthyDetailRequest));
|
||||||
|
ajaxResult.put("path", fileName);
|
||||||
|
}
|
||||||
|
return ajaxResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String[] healthyAttrNameAray = {"createTime","name","phone","conditioningProject","sex","age","tall","weight","position",
|
||||||
|
"experience","difficulty","rebound","crux","condiment","cookingStyle","cookingStyleRate","washVegetablesStyle",
|
||||||
|
"breakfastType","breakfastFood","lunchType","dinner","vegetableRate","commonMeat","dinnerTime","supperNum","supperFood",
|
||||||
|
"dietHotAndCold","dietFlavor","vegetablesNum","vegetablesRateType","fruitsNum","fruitsTime","fruitsRate","riceNum","riceFull",
|
||||||
|
"eatingSpeed","makeFoodType","snacks","healthProductsFlag","healthProductsBrand","healthProductsName",
|
||||||
|
"healthProductsWeekRate","dishesIngredient","waterNum","waterType","waterHabit",
|
||||||
|
"drinksNum","drinkWineFlag","drinkWineClassify","drinkWineAmount","smokeFlag","smokeRate",
|
||||||
|
"secondSmoke","workIndustry","workType","defecationNum","defecationTime","defecationShape",
|
||||||
|
"defecationSmell","defecationSpeed","defecationColor","motionNum","motionDuration","motionTime",
|
||||||
|
"motion","motionField","sleepTime","sleepQuality","sleepDrugFlag","sleepDrug","stayupLateFlag","stayupLateWeekNum",
|
||||||
|
"physicalSigns","moistureDate","bloodData","familyIllnessHistory","operationHistory","nearOperationFlag",
|
||||||
|
"recoveryeSituation","longEatDrugFlag","longEatDrugClassify","allergyFlag","allergySituation","allergen"
|
||||||
|
};
|
||||||
|
|
||||||
|
public static final String[] nutriAttrNameArray = {"standardWeight","overWeight","metabolizeHeat","activityFactor","withoutExerciseHeat",
|
||||||
|
"exerciseHeat","targetEveryWeightHeat","standardEveryWeightHeat","nutritionalHeat_one","nutritionalHeat_two","nutritionalHeat_three",
|
||||||
|
"nutritionalQuality_one","nutritionalQuality_two","nutritionalQuality_three",
|
||||||
|
"weightNutritionalRate_one","weightNutritionalRate_two","weightNutritionalRate_three"
|
||||||
|
};
|
||||||
|
|
||||||
|
private Map<String,String> getReportData(SysCustomerHealthy sysCustomerHealthy, HealthyDetailRequest healthyDetailRequest){
|
||||||
|
if(StringUtils.isNotEmpty(sysCustomerHealthy.getBloodData())){
|
||||||
|
SysDictData param = new SysDictData();
|
||||||
|
param.setDictType("sys_moisture_data");
|
||||||
|
param.setDictValueList(Arrays.asList(sysCustomerHealthy.getBloodData().split(",")));
|
||||||
|
List<SysDictData> bloodData = selectDictDataByTypeAndValue(param);
|
||||||
|
String bloodString = "";
|
||||||
|
for (SysDictData blood : bloodData) {
|
||||||
|
bloodString += blood.getDictValue() + "、" +blood.getDictLabel() + "\n";
|
||||||
|
}
|
||||||
|
healthyDetailRequest.setBloodData(bloodString);
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(sysCustomerHealthy.getMoistureDate())){
|
||||||
|
SysDictData param = new SysDictData();
|
||||||
|
param.setDictType("sys_blood_data");
|
||||||
|
param.setDictValueList(Arrays.asList(sysCustomerHealthy.getBloodData().split(",")));
|
||||||
|
List<SysDictData> moistureData = selectDictDataByTypeAndValue(param);
|
||||||
|
String moistureString = "";
|
||||||
|
for (SysDictData moisture : moistureData) {
|
||||||
|
moistureString += moisture.getDictValue() + "、" + moisture.getDictLabel() + "\n";
|
||||||
|
}
|
||||||
|
healthyDetailRequest.setMoistureDate(moistureString);
|
||||||
|
}
|
||||||
|
Map<String,String> data = new HashMap<>();
|
||||||
|
for (String key : healthyAttrNameAray) {
|
||||||
|
data.put(key, ReflectUtils.getFieldValueByFieldName(key, healthyDetailRequest));
|
||||||
|
}
|
||||||
|
//减脂指导
|
||||||
|
data.put("guidance", sysCustomerHealthy.getGuidance());
|
||||||
|
//营养热量分析数据
|
||||||
|
NutritionalCalories nutritionalCalories = NutritionalUtils.getNutritionalCaloriesData(sysCustomerHealthy);
|
||||||
|
nutritionalCalories.setNutritionalHeat_one(nutritionalCalories.getNutritionalHeat()[0].toString());
|
||||||
|
nutritionalCalories.setNutritionalHeat_two(nutritionalCalories.getNutritionalHeat()[1].toString());
|
||||||
|
nutritionalCalories.setNutritionalHeat_three(nutritionalCalories.getNutritionalHeat()[2].toString());
|
||||||
|
nutritionalCalories.setNutritionalQuality_one(nutritionalCalories.getNutritionalQuality()[0].toString());
|
||||||
|
nutritionalCalories.setNutritionalQuality_two(nutritionalCalories.getNutritionalQuality()[1].toString());
|
||||||
|
nutritionalCalories.setNutritionalQuality_three(nutritionalCalories.getNutritionalQuality()[2].toString());
|
||||||
|
nutritionalCalories.setWeightNutritionalRate_one(nutritionalCalories.getWeightNutritionalRate()[0].toString());
|
||||||
|
nutritionalCalories.setWeightNutritionalRate_two(nutritionalCalories.getWeightNutritionalRate()[1].toString());
|
||||||
|
nutritionalCalories.setWeightNutritionalRate_three(nutritionalCalories.getWeightNutritionalRate()[2].toString());
|
||||||
|
for (String key : nutriAttrNameArray) {
|
||||||
|
if("targetEveryWeightHeat".equals(key)){
|
||||||
|
data.put(key, nutritionalCalories.getTargetEveryWeightHeat()[0].intValue()+"-"+nutritionalCalories.getTargetEveryWeightHeat()[1].intValue());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if("standardEveryWeightHeat".equals(key)){
|
||||||
|
data.put(key, nutritionalCalories.getStandardEveryWeightHeat()[0].intValue()+"-"+nutritionalCalories.getStandardEveryWeightHeat()[1].intValue());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
data.put(key, ReflectUtils.getFieldValueByFieldName(key, nutritionalCalories));
|
||||||
|
}
|
||||||
|
data.put("company","深圳胜唐体控有限公司");
|
||||||
|
data.put("date", DateUtils.getDate());
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据类型、键值集合查询字典类型
|
||||||
|
* @param sysDictData
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysDictData> selectDictDataByTypeAndValue(SysDictData sysDictData){
|
||||||
|
return sysCustomerHealthyMapper.selectDictDataByTypeAndValue(sysDictData);
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,22 +1,22 @@
|
|||||||
package com.stdiet.custom.service.impl;
|
package com.stdiet.custom.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.stdiet.common.core.domain.model.LoginUser;
|
|
||||||
import com.stdiet.common.utils.DateUtils;
|
import com.stdiet.common.utils.DateUtils;
|
||||||
import com.stdiet.common.utils.SecurityUtils;
|
|
||||||
import com.stdiet.common.utils.StringUtils;
|
import com.stdiet.common.utils.StringUtils;
|
||||||
import com.stdiet.common.utils.bean.ObjectUtils;
|
import com.stdiet.common.utils.sign.AesUtils;
|
||||||
|
import com.stdiet.custom.domain.SysCustomer;
|
||||||
|
import com.stdiet.custom.domain.SysCustomerHealthy;
|
||||||
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
|
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
|
||||||
import com.stdiet.custom.dto.request.CustomerInvestigateRequest;
|
import com.stdiet.custom.mapper.SysCustomerMapper;
|
||||||
import com.stdiet.custom.mapper.SysCustomerPhysicalSignsMapper;
|
import com.stdiet.custom.mapper.SysCustomerPhysicalSignsMapper;
|
||||||
|
import com.stdiet.custom.service.ISysCustomerService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.stdiet.custom.mapper.SysCustomerMapper;
|
|
||||||
import com.stdiet.custom.domain.SysCustomer;
|
|
||||||
import com.stdiet.custom.service.ISysCustomerService;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户信息Service业务层处理
|
* 客户信息Service业务层处理
|
||||||
*
|
*
|
||||||
@ -25,14 +25,19 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Transactional
|
@Transactional
|
||||||
public class SysCustomerServiceImpl implements ISysCustomerService
|
public class SysCustomerServiceImpl implements ISysCustomerService {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysCustomerMapper sysCustomerMapper;
|
private SysCustomerMapper sysCustomerMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysCustomerPhysicalSignsMapper sysCustomerPhysicalSignsMapper;
|
private SysCustomerPhysicalSignsMapper sysCustomerPhysicalSignsMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysCustomerHealthyServiceImpl sysCustomerHealthyService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysCustomerPhysicalSignsServiceImpl sysCustomerPhysicalSignsService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询客户信息
|
* 查询客户信息
|
||||||
*
|
*
|
||||||
@ -40,8 +45,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
|||||||
* @return 客户信息
|
* @return 客户信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysCustomer selectSysCustomerById(Long id)
|
public SysCustomer selectSysCustomerById(Long id) {
|
||||||
{
|
|
||||||
return sysCustomerMapper.selectSysCustomerById(id);
|
return sysCustomerMapper.selectSysCustomerById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,8 +56,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
|||||||
* @return 客户信息
|
* @return 客户信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysCustomer> selectSysCustomerList(SysCustomer sysCustomer)
|
public List<SysCustomer> selectSysCustomerList(SysCustomer sysCustomer) {
|
||||||
{
|
|
||||||
return sysCustomerMapper.selectSysCustomerList(sysCustomer);
|
return sysCustomerMapper.selectSysCustomerList(sysCustomer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,8 +67,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertSysCustomer(SysCustomer sysCustomer)
|
public int insertSysCustomer(SysCustomer sysCustomer) {
|
||||||
{
|
|
||||||
sysCustomer.setCreateTime(DateUtils.getNowDate());
|
sysCustomer.setCreateTime(DateUtils.getNowDate());
|
||||||
return sysCustomerMapper.insertSysCustomer(sysCustomer);
|
return sysCustomerMapper.insertSysCustomer(sysCustomer);
|
||||||
}
|
}
|
||||||
@ -77,8 +79,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateSysCustomer(SysCustomer sysCustomer)
|
public int updateSysCustomer(SysCustomer sysCustomer) {
|
||||||
{
|
|
||||||
sysCustomer.setUpdateTime(DateUtils.getNowDate());
|
sysCustomer.setUpdateTime(DateUtils.getNowDate());
|
||||||
return sysCustomerMapper.updateSysCustomer(sysCustomer);
|
return sysCustomerMapper.updateSysCustomer(sysCustomer);
|
||||||
}
|
}
|
||||||
@ -90,8 +91,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteSysCustomerByIds(Long[] ids)
|
public int deleteSysCustomerByIds(Long[] ids) {
|
||||||
{
|
|
||||||
return sysCustomerMapper.deleteSysCustomerByIds(ids);
|
return sysCustomerMapper.deleteSysCustomerByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,8 +102,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteSysCustomerById(Long id)
|
public int deleteSysCustomerById(Long id) {
|
||||||
{
|
|
||||||
return sysCustomerMapper.deleteSysCustomerById(id);
|
return sysCustomerMapper.deleteSysCustomerById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,6 +118,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断客户手机号是否已存在
|
* 判断客户手机号是否已存在
|
||||||
|
*
|
||||||
* @param sysCustomer
|
* @param sysCustomer
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -135,4 +135,37 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getPhysicalSignsById(Long id) {
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
String key = "customerHealthy";
|
||||||
|
result.put("type", 0);
|
||||||
|
//查询健康评估信息
|
||||||
|
SysCustomerHealthy sysCustomerHealthy = sysCustomerHealthyService.selectSysCustomerHealthyByCustomerId(id);
|
||||||
|
if (sysCustomerHealthy != null) {
|
||||||
|
/* if (StringUtils.isNotEmpty(sysCustomerHealthy.getPhone())) {
|
||||||
|
sysCustomerHealthy.setPhone(StringUtils.hiddenPhoneNumber(sysCustomerHealthy.getPhone()));
|
||||||
|
}*/
|
||||||
|
result.put(key, sysCustomerHealthy);
|
||||||
|
} else {
|
||||||
|
//查询体征信息
|
||||||
|
SysCustomerPhysicalSigns sysCustomerPhysicalSigns = sysCustomerPhysicalSignsService.selectSysCustomerPhysicalSignsByCusId(id);
|
||||||
|
if (sysCustomerPhysicalSigns != null) {
|
||||||
|
/* if (StringUtils.isNotEmpty(sysCustomerPhysicalSigns.getPhone())) {
|
||||||
|
sysCustomerPhysicalSigns.setPhone(StringUtils.hiddenPhoneNumber(sysCustomerPhysicalSigns.getPhone()));
|
||||||
|
}*/
|
||||||
|
result.put("type", 1);
|
||||||
|
}
|
||||||
|
result.put(key, sysCustomerPhysicalSigns);
|
||||||
|
}
|
||||||
|
//对ID进行加密
|
||||||
|
result.put("enc_id", id != null ? AesUtils.encrypt(id + "", null) : "");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getPhysicalSignsByOutId(String id) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
@ -126,8 +126,8 @@ public class SysOrderPauseServiceImpl implements ISysOrderPauseService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getCountByOrderIdAndPauseDate(SysOrderPause sysOrderPause){
|
public int getCountByCusIdAndPauseDate(SysOrderPause sysOrderPause){
|
||||||
return sysOrderPauseMapper.getCountByOrderIdAndPauseDate(sysOrderPause);
|
return sysOrderPauseMapper.getCountByCusIdAndPauseDate(sysOrderPause);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -139,4 +139,19 @@ public class SysOrderPauseServiceImpl implements ISysOrderPauseService
|
|||||||
public int deletePauseByOrderId(Long[] orderIds){
|
public int deletePauseByOrderId(Long[] orderIds){
|
||||||
return sysOrderPauseMapper.deletePauseByOrderId(orderIds);
|
return sysOrderPauseMapper.deletePauseByOrderId(orderIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单ID获取暂停计划
|
||||||
|
* @param orderId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysOrderPause> getPauseListByOrderId(Long orderId){
|
||||||
|
return sysOrderPauseMapper.getPauseListByOrderId(orderId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long selectNearMainOrderIdByCusId(Long cusId) {
|
||||||
|
return sysOrderPauseMapper.selectNearMainOrderIdByCusId(cusId);
|
||||||
|
}
|
||||||
}
|
}
|
@ -206,12 +206,10 @@ public class SysOrderServiceImpl implements ISysOrderService {
|
|||||||
//更新订单
|
//更新订单
|
||||||
int row = sysOrderMapper.updateSysOrder(sysOrder);
|
int row = sysOrderMapper.updateSysOrder(sysOrder);
|
||||||
// 审核后的订单才生成食谱
|
// 审核后的订单才生成食谱
|
||||||
if (row > 0 && oldSysOrder.getReviewStatus().equals("no") && sysOrder.getReviewStatus().equals("yes")) {
|
if (row > 0 && isNeedRegenerateRecipesPlan(oldSysOrder, sysOrder)) {
|
||||||
//异步更新食谱计划
|
//异步更新食谱计划
|
||||||
if (isNeedRegenerateRecipesPlan(oldSysOrder, sysOrder)) {
|
|
||||||
sysRecipesPlanService.regenerateRecipesPlan(sysOrder.getOrderId());
|
sysRecipesPlanService.regenerateRecipesPlan(sysOrder.getOrderId());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,6 +221,9 @@ public class SysOrderServiceImpl implements ISysOrderService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private boolean isNeedRegenerateRecipesPlan(SysOrder oldSysOrder, SysOrder newSysOrder) {
|
private boolean isNeedRegenerateRecipesPlan(SysOrder oldSysOrder, SysOrder newSysOrder) {
|
||||||
|
if(oldSysOrder.getReviewStatus().equals("no") && newSysOrder.getReviewStatus().equals("yes")){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (oldSysOrder.getServeTimeId() != null && newSysOrder.getServeTimeId() != null && oldSysOrder.getServeTimeId().intValue() != newSysOrder.getServeTimeId().intValue()) {
|
if (oldSysOrder.getServeTimeId() != null && newSysOrder.getServeTimeId() != null && oldSysOrder.getServeTimeId().intValue() != newSysOrder.getServeTimeId().intValue()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
package com.stdiet.custom.service.impl;
|
package com.stdiet.custom.service.impl;
|
||||||
|
|
||||||
import com.stdiet.common.utils.DateUtils;
|
import com.stdiet.common.utils.DateUtils;
|
||||||
|
import com.stdiet.common.utils.StringUtils;
|
||||||
import com.stdiet.common.utils.SynchrolockUtil;
|
import com.stdiet.common.utils.SynchrolockUtil;
|
||||||
|
import com.stdiet.common.utils.sign.Md5Utils;
|
||||||
import com.stdiet.custom.domain.SysOrder;
|
import com.stdiet.custom.domain.SysOrder;
|
||||||
import com.stdiet.custom.domain.SysOrderPause;
|
import com.stdiet.custom.domain.SysOrderPause;
|
||||||
import com.stdiet.custom.domain.SysRecipesPlan;
|
import com.stdiet.custom.domain.SysRecipesPlan;
|
||||||
|
import com.stdiet.custom.domain.SysRecipesPlanListInfo;
|
||||||
import com.stdiet.custom.mapper.SysRecipesPlanMapper;
|
import com.stdiet.custom.mapper.SysRecipesPlanMapper;
|
||||||
import com.stdiet.custom.service.ISysOrderPauseService;
|
import com.stdiet.custom.service.ISysOrderPauseService;
|
||||||
import com.stdiet.custom.service.ISysOrderService;
|
import com.stdiet.custom.service.ISysOrderService;
|
||||||
@ -16,9 +19,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 食谱计划Service业务层处理
|
* 食谱计划Service业务层处理
|
||||||
@ -29,6 +30,7 @@ import java.util.List;
|
|||||||
@Service("sysRecipesPlanService")
|
@Service("sysRecipesPlanService")
|
||||||
@Transactional
|
@Transactional
|
||||||
public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
||||||
|
|
||||||
public static final String generateRecipesPlanLockKey = "generateRecipesPlanLock::%s";
|
public static final String generateRecipesPlanLockKey = "generateRecipesPlanLock::%s";
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRecipesPlanMapper sysRecipesPlanMapper;
|
private SysRecipesPlanMapper sysRecipesPlanMapper;
|
||||||
@ -129,39 +131,35 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SysOrder sysOrder = sysOrderService.selectSysOrderById(orderId);
|
SysOrder sysOrder = sysOrderService.selectSysOrderById(orderId);
|
||||||
//订单为空、金额小于0不进行食谱生成、更新,只对2021年开始的订单进行食谱计划生成,判断订单金额、开始时间、结束时间,为空则直接返回,不重新生成食谱计划
|
//订单为空、金额小于0、订单未审核不进行食谱生成、更新,只对2021年开始的订单进行食谱计划生成,判断订单金额、开始时间、结束时间,为空则直接返回,不重新生成食谱计划
|
||||||
if (sysOrder == null && DateUtils.dateToLocalDate(sysOrder.getOrderTime()).getYear() < 2021
|
if (sysOrder == null || !sysOrder.getReviewStatus().equals("yes") || DateUtils.dateToLocalDate(sysOrder.getOrderTime()).getYear() < 2021
|
||||||
|| sysOrder.getAmount().floatValue() <= 0 || sysOrder.getStartTime() == null || sysOrder.getServerEndTime() == null) {
|
|| sysOrder.getAmount().floatValue() <= 0 || sysOrder.getStartTime() == null || sysOrder.getServerEndTime() == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//判断是否提成单,拆分单中的副单,体验单
|
//判断是否提成单,拆分单中的副单,体验单
|
||||||
if(sysOrder.getAfterSaleCommissOrder().intValue() == 1 || ("1".equals(sysOrder.getOrderType()) && sysOrder.getMainOrderId().intValue() == 1) ||
|
if(sysOrder.getAfterSaleCommissOrder().intValue() == 1 || ("1".equals(sysOrder.getOrderType()) && sysOrder.getMainOrderId().intValue() == 1) ||
|
||||||
"2".equals(sysOrder.getOrderType())){
|
"2".equals(sysOrder.getOrderType())){
|
||||||
|
System.out.println("---------------------不生成食谱------------------------");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
//获取redis中该订单对应的锁
|
//获取redis中该订单对应的锁
|
||||||
if (synchrolockUtil.lock(String.format(generateRecipesPlanLockKey, orderId))) {
|
if (synchrolockUtil.lock(String.format(generateRecipesPlanLockKey, orderId))) {
|
||||||
|
//判断是否已存在食谱计划
|
||||||
SysRecipesPlan queryParam = new SysRecipesPlan();
|
SysRecipesPlan queryParam = new SysRecipesPlan();
|
||||||
queryParam.setOrderId(orderId);
|
queryParam.setOrderId(orderId);
|
||||||
List<SysRecipesPlan> oldRecipesPlanList = sysRecipesPlanMapper.selectSysRecipesPlanList(queryParam);
|
List<SysRecipesPlan> oldRecipesPlanList = sysRecipesPlanMapper.selectSysRecipesPlanList(queryParam);
|
||||||
//判断是否已存在食谱
|
//暂停记录列表,按暂停开始时间顺序
|
||||||
/*if (oldRecipesPlanList != null && oldRecipesPlanList.size() > 0) {
|
List<SysOrderPause> pauseList = sysOrderPauseService.getPauseListByOrderId(sysOrder.getOrderId());
|
||||||
Long[] orderIdArray = new Long[1];
|
List<SysRecipesPlan> planList = generatePlan(sysOrder, oldRecipesPlanList, DateUtils.dateToLocalDate(sysOrder.getStartTime()), DateUtils.dateToLocalDate(sysOrder.getServerEndTime()), pauseList);
|
||||||
orderIdArray[0] = orderId;
|
if(oldRecipesPlanList != null && oldRecipesPlanList.size() > 0){
|
||||||
//删除该订单对于食谱
|
updateOrAddRecipesPlan(oldRecipesPlanList, planList);
|
||||||
//delRecipesPlanByOrderId(orderIdArray);
|
}else{
|
||||||
}*/
|
|
||||||
SysOrderPause pauseParam = new SysOrderPause();
|
|
||||||
pauseParam.setOrderId(sysOrder.getOrderId());
|
|
||||||
//暂停记录列表
|
|
||||||
List<SysOrderPause> pauseList = sysOrderPauseService.selectSysOrderPauseList(pauseParam);
|
|
||||||
List<SysRecipesPlan> planList = generatePlan(sysOrder, oldRecipesPlanList,
|
|
||||||
DateUtils.dateToLocalDate(sysOrder.getStartTime()), DateUtils.dateToLocalDate(sysOrder.getServerEndTime()), pauseList);
|
|
||||||
if (planList != null && planList.size() > 0) {
|
if (planList != null && planList.size() > 0) {
|
||||||
sysRecipesPlanMapper.insertBatch(planList);
|
sysRecipesPlanMapper.insertBatch(planList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
@ -170,71 +168,122 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新食谱计划,删除旧食谱中多余的,添加新食谱中多的
|
||||||
|
* @param oldRecipesPlanList
|
||||||
|
* @param newRecipesPlanList
|
||||||
|
*/
|
||||||
|
private void updateOrAddRecipesPlan(List<SysRecipesPlan> oldRecipesPlanList, List<SysRecipesPlan> newRecipesPlanList){
|
||||||
|
int newSize = newRecipesPlanList.size();
|
||||||
|
int index = 0;
|
||||||
|
List<SysRecipesPlan> addList = new ArrayList<>();
|
||||||
|
List<SysRecipesPlan> updateList = new ArrayList<>();
|
||||||
|
List<Long> delList = new ArrayList<>();
|
||||||
|
for (SysRecipesPlan plan : oldRecipesPlanList) {
|
||||||
|
if(index < newSize){
|
||||||
|
if(plan.getStartDate().compareTo(newRecipesPlanList.get(index).getStartDate()) != 0
|
||||||
|
|| plan.getEndDate().compareTo(newRecipesPlanList.get(index).getEndDate()) != 0){
|
||||||
|
plan.setStartDate(newRecipesPlanList.get(index).getStartDate());
|
||||||
|
plan.setEndDate(newRecipesPlanList.get(index).getEndDate());
|
||||||
|
plan.setPauseDate(newRecipesPlanList.get(index).getPauseDate());
|
||||||
|
updateList.add(plan);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
delList.add(plan.getId());
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if(newSize > oldRecipesPlanList.size()){
|
||||||
|
addList = newRecipesPlanList.subList(oldRecipesPlanList.size(),newSize);
|
||||||
|
}
|
||||||
|
//更新
|
||||||
|
if(updateList.size() > 0){
|
||||||
|
System.out.println("更新数量:"+updateList.size());
|
||||||
|
for (SysRecipesPlan plan : updateList) {
|
||||||
|
sysRecipesPlanMapper.updateSysRecipesPlan(plan);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//删除多余的食谱计划
|
||||||
|
if(delList.size() > 0){
|
||||||
|
sysRecipesPlanMapper.deleteSysRecipesPlanByIds(delList.toArray(new Long[delList.size()]));
|
||||||
|
}
|
||||||
|
//添加新的
|
||||||
|
if(addList.size() > 0){
|
||||||
|
sysRecipesPlanMapper.insertBatch(addList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据订单ID、订单开始服务时间、结束时间、暂停列表生成食谱计划列表
|
* 根据订单ID、订单开始服务时间、结束时间、暂停列表生成食谱计划列表
|
||||||
*
|
*
|
||||||
* @param sysOrder 订单对象
|
* @param sysOrder 订单对象
|
||||||
* @param oldRecipesPlanList 旧的食谱计划
|
|
||||||
* @param serverStartDate 服务开始时间
|
* @param serverStartDate 服务开始时间
|
||||||
* @param serverEndDate 服务结束时间
|
* @param serverEndDate 服务结束时间
|
||||||
* @param pauseList 暂停列表
|
* @param pauseList 暂停列表
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<SysRecipesPlan> generatePlan(SysOrder sysOrder, List<SysRecipesPlan> oldRecipesPlanList,
|
private List<SysRecipesPlan> generatePlan(SysOrder sysOrder, List<SysRecipesPlan> oldRecipesPlanList, LocalDate serverStartDate, LocalDate serverEndDate, List<SysOrderPause> pauseList) {
|
||||||
LocalDate serverStartDate, LocalDate serverEndDate, List<SysOrderPause> pauseList) {
|
//查询该客户最后一次食谱计划对应天数
|
||||||
|
int oldStartNumDay = 0;
|
||||||
|
if(oldRecipesPlanList.size() == 0){
|
||||||
|
SysRecipesPlan lastSysRecipesPlan = getLastDayRecipesPlan(sysOrder.getCusId());
|
||||||
|
oldStartNumDay = lastSysRecipesPlan == null || lastSysRecipesPlan.getEndNumDay() == null ? 0 : lastSysRecipesPlan.getEndNumDay().intValue();
|
||||||
|
}else{
|
||||||
|
oldStartNumDay = oldRecipesPlanList.get(0).getStartNumDay() - 1;
|
||||||
|
}
|
||||||
List<SysRecipesPlan> planList = new ArrayList<>();
|
List<SysRecipesPlan> planList = new ArrayList<>();
|
||||||
boolean breakFlag = false;
|
LocalDate planStartDate = null;
|
||||||
LocalDate planStartDate = serverStartDate;
|
LocalDate planEndDate = serverStartDate.plusDays(-1);
|
||||||
LocalDate planEndDate = planStartDate.plusDays(6);
|
boolean breakFlag = true;
|
||||||
while (true) {
|
do {
|
||||||
SysRecipesPlan sysRecipesPlan = new SysRecipesPlan();
|
SysRecipesPlan sysRecipesPlan = new SysRecipesPlan();
|
||||||
|
planStartDate = planEndDate.plusDays(1);
|
||||||
|
planEndDate = planStartDate.plusDays(6);
|
||||||
//判断是否大于服务到期时间
|
//判断是否大于服务到期时间
|
||||||
if (ChronoUnit.DAYS.between(planEndDate, serverEndDate) <= 0) {
|
if (ChronoUnit.DAYS.between(planEndDate, serverEndDate) <= 0) {
|
||||||
planEndDate = serverEndDate;
|
planEndDate = serverEndDate;
|
||||||
breakFlag = true;
|
breakFlag = false;
|
||||||
|
}
|
||||||
|
String[] pauseResult = dealPlanPause(planStartDate, planEndDate, pauseList);
|
||||||
|
//开始时间变更为暂停结束之后的日期,因为暂停开始时间与食谱计划开始时间相同
|
||||||
|
if(StringUtils.isNotEmpty(pauseResult[0])){
|
||||||
|
planStartDate = DateUtils.stringToLocalDate(pauseResult[0],"yyyyMMdd");
|
||||||
|
planEndDate = DateUtils.stringToLocalDate(pauseResult[1],"yyyyMMdd");
|
||||||
}
|
}
|
||||||
long pauseDay = getPauseDayeCount(planStartDate, planEndDate, pauseList);
|
|
||||||
//加上暂停时间
|
//加上暂停时间
|
||||||
planEndDate = planEndDate.plusDays(pauseDay);
|
planEndDate = planEndDate.plusDays(Integer.parseInt(pauseResult[2]));
|
||||||
sysRecipesPlan.setStartDate(DateUtils.localDateToDate(planStartDate));
|
sysRecipesPlan.setStartDate(DateUtils.localDateToDate(planStartDate));
|
||||||
sysRecipesPlan.setEndDate(DateUtils.localDateToDate(planEndDate));
|
sysRecipesPlan.setEndDate(DateUtils.localDateToDate(planEndDate));
|
||||||
sysRecipesPlan.setOrderId(sysOrder.getOrderId());
|
sysRecipesPlan.setOrderId(sysOrder.getOrderId());
|
||||||
sysRecipesPlan.setCusId(sysOrder.getCusId());
|
sysRecipesPlan.setCusId(sysOrder.getCusId());
|
||||||
/*//当开始时间小于等于当前时间,默认为已发送,发送时间为前一天
|
sysRecipesPlan.setOutId(Md5Utils.hash(String.valueOf(sysOrder.getCusId())));
|
||||||
if(ChronoUnit.DAYS.between(planStartDate, LocalDate.now()) >= 0){
|
oldStartNumDay += 1;
|
||||||
sysRecipesPlan.setSendFlag(1);
|
sysRecipesPlan.setStartNumDay(oldStartNumDay);
|
||||||
sysRecipesPlan.setSendTime(DateUtils.localDateToDate(LocalDate.now().minusDays(1)));
|
oldStartNumDay += 6;
|
||||||
}*/
|
sysRecipesPlan.setEndNumDay(oldStartNumDay);
|
||||||
//将旧食谱计划中的发送状态、发送时间、食谱复制到新食谱计划中
|
//暂停日期
|
||||||
boolean existFlag = oldRecipesPlanList.size() >= planList.size() + 1;
|
sysRecipesPlan.setPauseDate(pauseResult[3]);
|
||||||
sysRecipesPlan.setSendFlag(existFlag ? oldRecipesPlanList.get(planList.size()).getSendFlag() : 0);
|
//添加暂停范围内的日期
|
||||||
sysRecipesPlan.setSendTime(existFlag ? oldRecipesPlanList.get(planList.size()).getSendTime() : null);
|
|
||||||
sysRecipesPlan.setRecipesId(existFlag ? oldRecipesPlanList.get(planList.size()).getRecipesId() : null);
|
|
||||||
|
|
||||||
planList.add(sysRecipesPlan);
|
planList.add(sysRecipesPlan);
|
||||||
|
}while (breakFlag);
|
||||||
planStartDate = planEndDate.plusDays(1);
|
|
||||||
planEndDate = planStartDate.plusDays(6);
|
|
||||||
|
|
||||||
if (breakFlag) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return planList;
|
return planList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据食谱开始时间、结束时间、暂停列表获取在食谱计划范围内的暂停天数
|
* 根据食谱开始时间、结束时间、暂停列表获取在食谱计划范围内的暂停天数,以及返回调整之后的计划开始、结束时间,以及暂停日期
|
||||||
*
|
* @param planStartDate 原先的计划开始时间
|
||||||
* @param planStartDate 计划开始时间
|
* @param planEndDate 原先计划结束时间
|
||||||
* @param planEndDate 计划结束时间
|
* @param pauseList 暂停列表集合
|
||||||
* @param pauseList 暂停列表
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public long getPauseDayeCount(LocalDate planStartDate, LocalDate planEndDate, List<SysOrderPause> pauseList) {
|
private String[] dealPlanPause(LocalDate planStartDate, LocalDate planEndDate, List<SysOrderPause> pauseList) {
|
||||||
|
//分别为计划开始时间、计划结束时间,范围内暂停天数,具体暂停日期,使用|隔开
|
||||||
|
String[] result = {"","","0",""};
|
||||||
long pauseDay = 0;
|
long pauseDay = 0;
|
||||||
|
Set<String> pauseDateString = new TreeSet<>(new MyComparator());
|
||||||
//判断这个时间内是否存在暂停
|
//判断这个时间内是否存在暂停
|
||||||
if (pauseList != null && pauseList.size() > 0) {
|
if (pauseList != null && pauseList.size() > 0) {
|
||||||
|
//每条暂停时间的范围不会重叠,在添加暂停时做了限制
|
||||||
for (SysOrderPause sysOrderPause : pauseList) {
|
for (SysOrderPause sysOrderPause : pauseList) {
|
||||||
LocalDate pauseStartDate = DateUtils.dateToLocalDate(sysOrderPause.getPauseStartDate());
|
LocalDate pauseStartDate = DateUtils.dateToLocalDate(sysOrderPause.getPauseStartDate());
|
||||||
LocalDate pauseEndDate = DateUtils.dateToLocalDate(sysOrderPause.getPauseEndDate());
|
LocalDate pauseEndDate = DateUtils.dateToLocalDate(sysOrderPause.getPauseEndDate());
|
||||||
@ -247,10 +296,48 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
|||||||
if (ChronoUnit.DAYS.between(planEndDate, pauseEndDate) > 0) {
|
if (ChronoUnit.DAYS.between(planEndDate, pauseEndDate) > 0) {
|
||||||
pauseEndDate = planEndDate;
|
pauseEndDate = planEndDate;
|
||||||
}
|
}
|
||||||
pauseDay += ChronoUnit.DAYS.between(pauseStartDate, pauseEndDate);
|
//判断暂停记录是否从食谱计划开始时间开始的
|
||||||
|
if(ChronoUnit.DAYS.between(pauseStartDate, planStartDate) == 0){
|
||||||
|
//记录该条暂停记录结束之后的第一天日期,如果两条记录连着,则取最后暂停结束之后的第一天
|
||||||
|
if("".equals(result[0]) || result[0].equals(DateUtils.localDateToString(pauseStartDate,"yyyyMMdd"))){
|
||||||
|
planStartDate = pauseEndDate.plusDays(1);
|
||||||
|
planEndDate = planStartDate.plusDays(6);
|
||||||
|
result[0] = DateUtils.localDateToString(planStartDate,"yyyyMMdd");
|
||||||
|
result[1] = DateUtils.localDateToString(planEndDate,"yyyyMMdd");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
pauseDay += ChronoUnit.DAYS.between(pauseStartDate, pauseEndDate) + 1;
|
||||||
|
pauseDateString.addAll(getPauseDateString(pauseStartDate, pauseEndDate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return pauseDay;
|
}
|
||||||
|
result[2] = pauseDay+"";
|
||||||
|
result[3] = pauseDateString.size() > 0 ? StringUtils.join(pauseDateString,"|") : "";
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据暂停时间范围获取范围内的日期
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private Set<String> getPauseDateString(LocalDate pauseStartDate, LocalDate pauseEndDate){
|
||||||
|
Set<String> pauseDateList = new HashSet<>();
|
||||||
|
long daysBetween = ChronoUnit.DAYS.between(pauseStartDate, pauseEndDate);
|
||||||
|
for(int i = 0; i <= daysBetween; i++){
|
||||||
|
pauseDateList.add(DateUtils.localDateToString(pauseStartDate.plusDays(i),"yyyyMMdd"));
|
||||||
|
}
|
||||||
|
return pauseDateList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 集合排序key值比较器
|
||||||
|
* */
|
||||||
|
class MyComparator implements Comparator<String>{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compare(String o1, String o2) {
|
||||||
|
return Integer.parseInt(o1) - Integer.parseInt(o2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -286,8 +373,32 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
|||||||
return sysRecipesPlanMapper.selectPlanListByOrderId(sysRecipesPlan);
|
return sysRecipesPlanMapper.selectPlanListByOrderId(sysRecipesPlan);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户ID查询最后一天食谱计划
|
||||||
|
* @param customerId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public SysRecipesPlan getLastDayRecipesPlan(Long customerId){
|
||||||
|
return sysRecipesPlanMapper.getLastDayRecipesPlan(customerId);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void myGenerateRecipesPlan(SysOrder sysOrder) {
|
public Long getCusIdByOutId(String outId) {
|
||||||
|
return sysRecipesPlanMapper.getCusIdByOutId(outId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysRecipesPlanListInfo> selectRecipesPlanListInfo(String outId) {
|
||||||
|
return sysRecipesPlanMapper.selectRecipesPlanListInfo(outId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysRecipesPlan> selectPlanListByCusId(Long cusId) {
|
||||||
|
return sysRecipesPlanMapper.selectPlanListByCusId(cusId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SysRecipesPlan> selectRecipesModelList(SysRecipesPlan sysRecipesPlan) {
|
||||||
|
return sysRecipesPlanMapper.selectRecipesModelList(sysRecipesPlan);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
@ -54,6 +54,7 @@ public class SysRecipesServiceImpl implements ISysRecipesService {
|
|||||||
SysRecipesPlan sysRecipesPlan = new SysRecipesPlan();
|
SysRecipesPlan sysRecipesPlan = new SysRecipesPlan();
|
||||||
sysRecipesPlan.setId(sysRecipes.getPlanId());
|
sysRecipesPlan.setId(sysRecipes.getPlanId());
|
||||||
sysRecipesPlan.setRecipesId(sysRecipes.getId());
|
sysRecipesPlan.setRecipesId(sysRecipes.getId());
|
||||||
|
sysRecipesPlan.setReviewStatus(1);
|
||||||
sysRecipesPlanMapper.updateSysRecipesPlan(sysRecipesPlan);
|
sysRecipesPlanMapper.updateSysRecipesPlan(sysRecipesPlan);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,6 +66,11 @@ public class SysRecipesServiceImpl implements ISysRecipesService {
|
|||||||
return sysRecipesMapper.selectSysRecipesByRecipesId(id);
|
return sysRecipesMapper.selectSysRecipesByRecipesId(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysRecipesDailyDishes> selectDishesByMenuId(Long id) {
|
||||||
|
return sysRecipesMapper.selectDishesByMenuId(id);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int updateDishesDetail(SysRecipesDailyDishes sysRecipesDailyDishes) {
|
public int updateDishesDetail(SysRecipesDailyDishes sysRecipesDailyDishes) {
|
||||||
return sysRecipesMapper.updateDishesDetail(sysRecipesDailyDishes);
|
return sysRecipesMapper.updateDishesDetail(sysRecipesDailyDishes);
|
||||||
|
79
stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysRecipesTemplateServiceImpl.java
Normal file
79
stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysRecipesTemplateServiceImpl.java
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
package com.stdiet.custom.service.impl;
|
||||||
|
|
||||||
|
import com.stdiet.common.utils.DateUtils;
|
||||||
|
import com.stdiet.common.utils.SecurityUtils;
|
||||||
|
import com.stdiet.common.utils.StringUtils;
|
||||||
|
import com.stdiet.custom.domain.SysRecipesPlan;
|
||||||
|
import com.stdiet.custom.domain.SysRecipesTemplate;
|
||||||
|
import com.stdiet.custom.mapper.SysRecipesPlanMapper;
|
||||||
|
import com.stdiet.custom.mapper.SysRecipesTemplateMapper;
|
||||||
|
import com.stdiet.custom.service.ISysRecipesTemplateService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 食谱计划Service业务层处理
|
||||||
|
*
|
||||||
|
* @author wonder
|
||||||
|
* @date 2021-02-27
|
||||||
|
*/
|
||||||
|
@Service("sysRecipesPlanModelService")
|
||||||
|
@Transactional
|
||||||
|
public class SysRecipesTemplateServiceImpl implements ISysRecipesTemplateService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
SysRecipesTemplateMapper sysRecipesTemplateMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
SysRecipesPlanMapper sysRecipesPlanMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysRecipesTemplate> selectRecipesTemplateListByCondition(SysRecipesTemplate sysRecipesTemplate) {
|
||||||
|
return sysRecipesTemplateMapper.selectRecipesTemplateListByCondition(sysRecipesTemplate);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertRecipsesTemplate(SysRecipesTemplate sysRecipesTemplate) {
|
||||||
|
SysRecipesPlan sysRecipesPlan = new SysRecipesPlan();
|
||||||
|
sysRecipesPlan.setStartNumDay(1);
|
||||||
|
sysRecipesPlan.setEndNumDay(7);
|
||||||
|
sysRecipesPlan.setType(1);
|
||||||
|
sysRecipesPlan.setCusId(0L);
|
||||||
|
sysRecipesPlanMapper.insertSysRecipesPlan(sysRecipesPlan);
|
||||||
|
if (!StringUtils.isNull(sysRecipesPlan.getId())) {
|
||||||
|
sysRecipesTemplate.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
sysRecipesTemplate.setCreateTime(DateUtils.getNowDate());
|
||||||
|
sysRecipesTemplate.setPlanId(sysRecipesPlan.getId());
|
||||||
|
return sysRecipesTemplateMapper.insertRecipsesTemplate(sysRecipesTemplate);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateRecipesTemplate(SysRecipesTemplate sysRecipesTemplate) {
|
||||||
|
sysRecipesTemplate.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
sysRecipesTemplate.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return sysRecipesTemplateMapper.updateRecipesTemplate(sysRecipesTemplate);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int removeRecipesTemplate(Long id) {
|
||||||
|
SysRecipesTemplate sysRecipesTemplate= sysRecipesTemplateMapper.getRecipesTemplateById(id);
|
||||||
|
if(StringUtils.isNull(sysRecipesTemplate)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int rows = sysRecipesTemplateMapper.removeRecipesTemplate(sysRecipesTemplate.getId());
|
||||||
|
if(rows > 0) {
|
||||||
|
return sysRecipesPlanMapper.deleteSysRecipesPlanById(sysRecipesTemplate.getPlanId());
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SysRecipesTemplate getRecipesTemplateById(Long id) {
|
||||||
|
return sysRecipesTemplateMapper.getRecipesTemplateById(id);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package com.stdiet.custom.service.impl;
|
||||||
|
|
||||||
|
import com.stdiet.common.utils.StringUtils;
|
||||||
|
import com.stdiet.custom.domain.SysRecipesPlan;
|
||||||
|
import com.stdiet.custom.domain.SysRecipesPlanListInfo;
|
||||||
|
import com.stdiet.custom.service.ISysCustomerService;
|
||||||
|
import com.stdiet.custom.service.ISysRecipesPlanService;
|
||||||
|
import com.stdiet.custom.service.ISysWapServices;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Transactional
|
||||||
|
public class SysWapServicesImp implements ISysWapServices {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ISysCustomerService iSysCustomerService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ISysRecipesPlanService iSysRecipesPlanService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysRecipesPlanListInfo> getRecipesPlanListInfo(String outId) {
|
||||||
|
return iSysRecipesPlanService.selectRecipesPlanListInfo(outId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getHealthyDataByOutId(String outId) {
|
||||||
|
Long cusId = iSysRecipesPlanService.getCusIdByOutId(outId);
|
||||||
|
if(cusId > 0) {
|
||||||
|
return iSysCustomerService.getPhysicalSignsById(cusId);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package com.stdiet.custom.utils;
|
package com.stdiet.custom.utils;
|
||||||
|
|
||||||
import com.stdiet.common.utils.HealthyUtils;
|
import com.stdiet.common.utils.HealthyUtils;
|
||||||
|
import com.stdiet.common.utils.NumberUtils;
|
||||||
import com.stdiet.custom.domain.SysCustomerHealthy;
|
import com.stdiet.custom.domain.SysCustomerHealthy;
|
||||||
import com.stdiet.custom.dto.response.NutritionalCalories;
|
import com.stdiet.custom.dto.response.NutritionalCalories;
|
||||||
|
|
||||||
@ -19,7 +20,7 @@ public class NutritionalUtils {
|
|||||||
nutritionalCalories.setTall(sysCustomerHealthy.getTall());
|
nutritionalCalories.setTall(sysCustomerHealthy.getTall());
|
||||||
nutritionalCalories.setWeight(sysCustomerHealthy.getWeight().doubleValue());
|
nutritionalCalories.setWeight(sysCustomerHealthy.getWeight().doubleValue());
|
||||||
nutritionalCalories.setStandardWeight(HealthyUtils.calculateStandardWeight(nutritionalCalories.getTall()));
|
nutritionalCalories.setStandardWeight(HealthyUtils.calculateStandardWeight(nutritionalCalories.getTall()));
|
||||||
double overHeight = nutritionalCalories.getWeight() - nutritionalCalories.getStandardWeight();
|
double overHeight = NumberUtils.getNumberByRoundHalfUp(nutritionalCalories.getWeight() - nutritionalCalories.getStandardWeight(),1).doubleValue();
|
||||||
overHeight = overHeight > 0 ? overHeight : 0;
|
overHeight = overHeight > 0 ? overHeight : 0;
|
||||||
nutritionalCalories.setOverWeight(overHeight);
|
nutritionalCalories.setOverWeight(overHeight);
|
||||||
nutritionalCalories.setMetabolizeHeat(HealthyUtils.calculateMetabolizeHeat(nutritionalCalories.getAge(), nutritionalCalories.getTall(), nutritionalCalories.getWeight()).intValue());
|
nutritionalCalories.setMetabolizeHeat(HealthyUtils.calculateMetabolizeHeat(nutritionalCalories.getAge(), nutritionalCalories.getTall(), nutritionalCalories.getWeight()).intValue());
|
||||||
@ -32,6 +33,13 @@ public class NutritionalUtils {
|
|||||||
nutritionalCalories.setNutritionalHeat(nutritionalHeatAndQuality[0]);
|
nutritionalCalories.setNutritionalHeat(nutritionalHeatAndQuality[0]);
|
||||||
nutritionalCalories.setNutritionalQuality(nutritionalHeatAndQuality[1]);
|
nutritionalCalories.setNutritionalQuality(nutritionalHeatAndQuality[1]);
|
||||||
nutritionalCalories.setWeightNutritionalRate(HealthyUtils.calculateNutritionEveryWeight(nutritionalHeatAndQuality[1], nutritionalCalories.getWeight()));
|
nutritionalCalories.setWeightNutritionalRate(HealthyUtils.calculateNutritionEveryWeight(nutritionalHeatAndQuality[1], nutritionalCalories.getWeight()));
|
||||||
|
//活动因子
|
||||||
|
nutritionalCalories.setActivityFactor(HealthyUtils.activityFactor);
|
||||||
|
Long[] heatArray = HealthyUtils.calculateWithoutExerciseHeat(nutritionalCalories.getMetabolizeHeat());
|
||||||
|
//不运动热量
|
||||||
|
nutritionalCalories.setWithoutExerciseHeat(heatArray[0].intValue());
|
||||||
|
//运动热量
|
||||||
|
nutritionalCalories.setExerciseHeat(heatArray[1].intValue());
|
||||||
}
|
}
|
||||||
return nutritionalCalories;
|
return nutritionalCalories;
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@ public class OrderUtils {
|
|||||||
|
|
||||||
private static final String[] orderMoneyTypeArray = {"全款单","定金单","尾款单"};
|
private static final String[] orderMoneyTypeArray = {"全款单","定金单","尾款单"};
|
||||||
|
|
||||||
|
private static final String[] orderMainTypeArray = {"主单","副单"};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据订单对象获取订单类型名称
|
* 根据订单对象获取订单类型名称
|
||||||
* @param sysOrder
|
* @param sysOrder
|
||||||
@ -18,8 +20,16 @@ public class OrderUtils {
|
|||||||
public static final String getOrderTypeName(SysOrder sysOrder){
|
public static final String getOrderTypeName(SysOrder sysOrder){
|
||||||
String orderTypeName = "";
|
String orderTypeName = "";
|
||||||
orderTypeName += orderTypeArray[Integer.parseInt(sysOrder.getOrderType())];
|
orderTypeName += orderTypeArray[Integer.parseInt(sysOrder.getOrderType())];
|
||||||
|
//比例拆分单需要确认出主单副单
|
||||||
|
/*if("1".equals(sysOrder.getOrderType())){
|
||||||
|
orderTypeName += "("+(sysOrder.getMainOrderId().intValue() == 0 ? orderMainTypeArray[0] : orderMainTypeArray[1])+")";
|
||||||
|
}*/
|
||||||
orderTypeName += "/"+orderCountTypeArray[Integer.parseInt(sysOrder.getOrderCountType())];
|
orderTypeName += "/"+orderCountTypeArray[Integer.parseInt(sysOrder.getOrderCountType())];
|
||||||
orderTypeName += "/"+orderMoneyTypeArray[Integer.parseInt(sysOrder.getOrderMoneyType())];
|
orderTypeName += "/"+orderMoneyTypeArray[Integer.parseInt(sysOrder.getOrderMoneyType())];
|
||||||
|
//判断是不是二开提成单
|
||||||
|
if("1".equals(sysOrder.getOrderCountType()) && sysOrder.getAfterSaleCommissOrder().intValue() == 1){
|
||||||
|
orderTypeName += "/提成单";
|
||||||
|
}
|
||||||
return orderTypeName;
|
return orderTypeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,70 @@
|
|||||||
|
package com.stdiet.custom.utils;
|
||||||
|
|
||||||
|
import com.itextpdf.text.DocumentException;
|
||||||
|
import com.itextpdf.text.pdf.*;
|
||||||
|
import com.itextpdf.text.Document;
|
||||||
|
import com.stdiet.common.core.domain.AjaxResult;
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class PdfUtils {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成PDF
|
||||||
|
* @param templatePath PDF模板文件路径
|
||||||
|
* @param filePath 目标文件路径
|
||||||
|
* @param data 数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static AjaxResult generatePdfFile(String templatePath, String filePath, Map<String,String> data){
|
||||||
|
AjaxResult ajaxResult = AjaxResult.success();
|
||||||
|
|
||||||
|
PdfReader reader;
|
||||||
|
FileOutputStream out;
|
||||||
|
ByteArrayOutputStream bos;
|
||||||
|
PdfStamper stamper;
|
||||||
|
|
||||||
|
try {
|
||||||
|
out = new FileOutputStream(filePath);// 输出流到新的pdf,没有b2.pdf时会创建
|
||||||
|
reader = new PdfReader(templatePath);// 读取pdf模板
|
||||||
|
bos = new ByteArrayOutputStream();
|
||||||
|
stamper = new PdfStamper(reader, bos);
|
||||||
|
AcroFields form = stamper.getAcroFields();
|
||||||
|
|
||||||
|
form.addSubstitutionFont(BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED));
|
||||||
|
for(String key : data.keySet()){
|
||||||
|
form.setField(key, data.get(key), true);
|
||||||
|
}
|
||||||
|
stamper.setFormFlattening(true);// 如果为false那么生成的PDF文件还能编辑,一定要设为true
|
||||||
|
stamper.close();
|
||||||
|
|
||||||
|
Document doc = new Document();
|
||||||
|
|
||||||
|
PdfCopy copy = new PdfCopy(doc, out);
|
||||||
|
doc.open();
|
||||||
|
PdfImportedPage importPage = null;
|
||||||
|
for (int i = 1; i <= reader.getNumberOfPages(); i++) {
|
||||||
|
importPage = copy
|
||||||
|
.getImportedPage(new PdfReader(bos.toByteArray()), i);
|
||||||
|
copy.addPage(importPage);
|
||||||
|
}
|
||||||
|
doc.close();
|
||||||
|
|
||||||
|
//Runtime.getRuntime().exec("chmod 644 " + filePath);
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
ajaxResult = AjaxResult.error();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
ajaxResult = AjaxResult.error();
|
||||||
|
} catch (DocumentException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
ajaxResult = AjaxResult.error();
|
||||||
|
}
|
||||||
|
return ajaxResult;
|
||||||
|
}
|
||||||
|
}
|
@ -32,7 +32,9 @@
|
|||||||
SELECT ${column} AS user_id, ${postId} AS post_id, SUM(amount) AS amount
|
SELECT ${column} AS user_id, ${postId} AS post_id, SUM(amount) AS amount
|
||||||
FROM sys_order
|
FROM sys_order
|
||||||
WHERE ${column} IS NOT NULL AND ${column} <> 0 AND del_flag = 0
|
WHERE ${column} IS NOT NULL AND ${column} <> 0 AND del_flag = 0
|
||||||
AND review_status = 'yes'
|
<if test="reviewStatus != null and reviewStatus != ''">
|
||||||
|
AND review_status = #{reviewStatus}
|
||||||
|
</if>
|
||||||
<if test="beginTime != null and beginTime != ''">AND date_format(order_time,'%y%m%d') >=
|
<if test="beginTime != null and beginTime != ''">AND date_format(order_time,'%y%m%d') >=
|
||||||
date_format(${beginTime},'%y%m%d')
|
date_format(${beginTime},'%y%m%d')
|
||||||
</if>
|
</if>
|
||||||
@ -47,6 +49,7 @@
|
|||||||
JOIN (
|
JOIN (
|
||||||
<include refid="groupAmountVo">
|
<include refid="groupAmountVo">
|
||||||
<property name="column" value="pre_sale_id"/>
|
<property name="column" value="pre_sale_id"/>
|
||||||
|
<property name="reviewStatus" value="#{reviewStatus}"/>
|
||||||
<property name="beginTime" value="#{beginTime}"/>
|
<property name="beginTime" value="#{beginTime}"/>
|
||||||
<property name="endTime" value="#{endTime}"/>
|
<property name="endTime" value="#{endTime}"/>
|
||||||
<property name="postId" value="5"/>
|
<property name="postId" value="5"/>
|
||||||
@ -54,6 +57,7 @@
|
|||||||
UNION
|
UNION
|
||||||
<include refid="groupAmountVo">
|
<include refid="groupAmountVo">
|
||||||
<property name="column" value="after_sale_id"/>
|
<property name="column" value="after_sale_id"/>
|
||||||
|
<property name="reviewStatus" value="#{reviewStatus}"/>
|
||||||
<property name="beginTime" value="#{beginTime}"/>
|
<property name="beginTime" value="#{beginTime}"/>
|
||||||
<property name="endTime" value="#{endTime}"/>
|
<property name="endTime" value="#{endTime}"/>
|
||||||
<property name="postId" value="6"/>
|
<property name="postId" value="6"/>
|
||||||
@ -61,6 +65,7 @@
|
|||||||
UNION
|
UNION
|
||||||
<include refid="groupAmountVo">
|
<include refid="groupAmountVo">
|
||||||
<property name="column" value="nutritionist_id"/>
|
<property name="column" value="nutritionist_id"/>
|
||||||
|
<property name="reviewStatus" value="#{reviewStatus}"/>
|
||||||
<property name="beginTime" value="#{beginTime}"/>
|
<property name="beginTime" value="#{beginTime}"/>
|
||||||
<property name="endTime" value="#{endTime}"/>
|
<property name="endTime" value="#{endTime}"/>
|
||||||
<property name="postId" value="9"/>
|
<property name="postId" value="9"/>
|
||||||
@ -68,6 +73,7 @@
|
|||||||
UNION
|
UNION
|
||||||
<include refid="groupAmountVo">
|
<include refid="groupAmountVo">
|
||||||
<property name="column" value="nutri_assis_id"/>
|
<property name="column" value="nutri_assis_id"/>
|
||||||
|
<property name="reviewStatus" value="#{reviewStatus}"/>
|
||||||
<property name="beginTime" value="#{beginTime}"/>
|
<property name="beginTime" value="#{beginTime}"/>
|
||||||
<property name="endTime" value="#{endTime}"/>
|
<property name="endTime" value="#{endTime}"/>
|
||||||
<property name="postId" value="10"/>
|
<property name="postId" value="10"/>
|
||||||
@ -75,6 +81,7 @@
|
|||||||
UNION
|
UNION
|
||||||
<include refid="groupAmountVo">
|
<include refid="groupAmountVo">
|
||||||
<property name="column" value="operator_id"/>
|
<property name="column" value="operator_id"/>
|
||||||
|
<property name="reviewStatus" value="#{reviewStatus}"/>
|
||||||
<property name="beginTime" value="#{beginTime}"/>
|
<property name="beginTime" value="#{beginTime}"/>
|
||||||
<property name="endTime" value="#{endTime}"/>
|
<property name="endTime" value="#{endTime}"/>
|
||||||
<property name="postId" value="11"/>
|
<property name="postId" value="11"/>
|
||||||
@ -82,6 +89,7 @@
|
|||||||
UNION
|
UNION
|
||||||
<include refid="groupAmountVo">
|
<include refid="groupAmountVo">
|
||||||
<property name="column" value="operator_assis_id"/>
|
<property name="column" value="operator_assis_id"/>
|
||||||
|
<property name="reviewStatus" value="#{reviewStatus}"/>
|
||||||
<property name="beginTime" value="#{beginTime}"/>
|
<property name="beginTime" value="#{beginTime}"/>
|
||||||
<property name="endTime" value="#{endTime}"/>
|
<property name="endTime" value="#{endTime}"/>
|
||||||
<property name="postId" value="13"/>
|
<property name="postId" value="13"/>
|
||||||
@ -89,6 +97,7 @@
|
|||||||
UNION
|
UNION
|
||||||
<include refid="groupAmountVo">
|
<include refid="groupAmountVo">
|
||||||
<property name="column" value="planner_id"/>
|
<property name="column" value="planner_id"/>
|
||||||
|
<property name="reviewStatus" value="#{reviewStatus}"/>
|
||||||
<property name="beginTime" value="#{beginTime}"/>
|
<property name="beginTime" value="#{beginTime}"/>
|
||||||
<property name="endTime" value="#{endTime}"/>
|
<property name="endTime" value="#{endTime}"/>
|
||||||
<property name="postId" value="7"/>
|
<property name="postId" value="7"/>
|
||||||
@ -96,6 +105,7 @@
|
|||||||
UNION
|
UNION
|
||||||
<include refid="groupAmountVo">
|
<include refid="groupAmountVo">
|
||||||
<property name="column" value="planner_assis_id"/>
|
<property name="column" value="planner_assis_id"/>
|
||||||
|
<property name="reviewStatus" value="#{reviewStatus}"/>
|
||||||
<property name="beginTime" value="#{beginTime}"/>
|
<property name="beginTime" value="#{beginTime}"/>
|
||||||
<property name="endTime" value="#{endTime}"/>
|
<property name="endTime" value="#{endTime}"/>
|
||||||
<property name="postId" value="8"/>
|
<property name="postId" value="8"/>
|
||||||
@ -188,7 +198,8 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="selectSysCommisionDayDetail" parameterType="SysCommision" resultMap="SysCommisionResult">
|
<!-- 查询售后和营养师 -->
|
||||||
|
<select id="getAfterSaleAndNutri" parameterType="SysCommision" resultMap="SysCommisionResult">
|
||||||
SELECT su.user_id,su.nick_name as user_name,sp.post_id, sp.post_code,sp.post_name FROM sys_user su
|
SELECT su.user_id,su.nick_name as user_name,sp.post_id, sp.post_code,sp.post_name FROM sys_user su
|
||||||
LEFT JOIN sys_user_post sup ON sup.user_id = su.user_id
|
LEFT JOIN sys_user_post sup ON sup.user_id = su.user_id
|
||||||
LEFT JOIN sys_post sp ON sp.post_id = sup.post_id
|
LEFT JOIN sys_post sp ON sp.post_id = sup.post_id
|
||||||
|
@ -0,0 +1,111 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.stdiet.custom.mapper.SysCustomerCaseFileMapper">
|
||||||
|
|
||||||
|
<resultMap type="SysCustomerCaseFile" id="SysCustomerCaseFileResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="caseId" column="case_id" />
|
||||||
|
<result property="fileUrl" column="file_url" />
|
||||||
|
<result property="fileName" column="file_name" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="delFlag" column="del_flag" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectSysCustomerCaseFileVo">
|
||||||
|
select id, case_id, file_url, file_name, create_time, create_by, update_time, update_by, del_flag from sys_customer_case_file
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectSysCustomerCaseFileList" parameterType="SysCustomerCaseFile" resultMap="SysCustomerCaseFileResult">
|
||||||
|
<include refid="selectSysCustomerCaseFileVo"/> where del_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据案例ID查询文件列表 -->
|
||||||
|
<select id="selectSysCustomerCaseFileListByCaseId" parameterType="Long" resultMap="SysCustomerCaseFileResult">
|
||||||
|
<include refid="selectSysCustomerCaseFileVo"/> where del_flag = 0 and case_id = #{caseId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSysCustomerCaseFileById" parameterType="Long" resultMap="SysCustomerCaseFileResult">
|
||||||
|
<include refid="selectSysCustomerCaseFileVo"/>
|
||||||
|
where id = #{id} and del_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertSysCustomerCaseFile" parameterType="SysCustomerCaseFile" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into sys_customer_case_file
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="caseId != null">case_id,</if>
|
||||||
|
<if test="fileUrl != null">file_url,</if>
|
||||||
|
<if test="fileName != null">file_name,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="delFlag != null">del_flag,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="caseId != null">#{caseId},</if>
|
||||||
|
<if test="fileUrl != null">#{fileUrl},</if>
|
||||||
|
<if test="fileName != null">#{fileName},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="delFlag != null">#{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateSysCustomerCaseFile" parameterType="SysCustomerCaseFile">
|
||||||
|
update sys_customer_case_file
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="caseId != null">case_id = #{caseId},</if>
|
||||||
|
<if test="fileUrl != null">file_url = #{fileUrl},</if>
|
||||||
|
<if test="fileName != null">file_name = #{fileName},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteSysCustomerCaseFileById" parameterType="Long">
|
||||||
|
update sys_customer_case_file set del_flag = 1 where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteSysCustomerCaseFileByIds" parameterType="String">
|
||||||
|
update sys_customer_case_file set del_flag = 1 where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 根据案例ID删除该案例对应的所有文件记录 -->
|
||||||
|
<update id="deleteSysCustomerCaseFileByCaseId" parameterType="Long">
|
||||||
|
update sys_customer_case_file set del_flag = 1 where case_id = #{caseId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 根据案例ID批量删除该案例对应的所有文件记录 -->
|
||||||
|
<update id="deleteSysCustomerCaseFileByCaseIds" parameterType="String">
|
||||||
|
update sys_customer_case_file set del_flag = 1 where case_id in
|
||||||
|
<foreach item="caseId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{caseId}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 批量插入案例文件记录 -->
|
||||||
|
<insert id="insertBatch">
|
||||||
|
INSERT INTO sys_customer_case_file
|
||||||
|
(case_id, file_url, file_name)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" item="caseFile" separator=",">
|
||||||
|
(#{caseFile.caseId}, #{caseFile.fileUrl}, #{caseFile.fileName})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,98 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.stdiet.custom.mapper.SysCustomerCaseMapper">
|
||||||
|
|
||||||
|
<resultMap type="SysCustomerCase" id="SysCustomerCaseResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="name" column="name" />
|
||||||
|
<result property="keyword" column="keyword" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="customerId" column="customer_id" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="delFlag" column="del_flag" />
|
||||||
|
|
||||||
|
<result property="customerName" column="customer_name"></result>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectSysCustomerCaseVo">
|
||||||
|
select id, name, keyword, remark, customer_id, create_time from sys_customer_case
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectSysCustomerCaseList" parameterType="SysCustomerCase" resultMap="SysCustomerCaseResult">
|
||||||
|
select scc.id, scc.name, scc.keyword, scc.remark, scc.customer_id, scc.create_time,sc.name as customer_name from sys_customer_case scc
|
||||||
|
left join sys_customer sc on sc.id = scc.customer_id and sc.del_flag = 0
|
||||||
|
where scc.del_flag = 0
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
and (scc.name like concat('%', #{name}, '%') OR scc.keyword like concat('%', #{name}, '%') OR scc.remark like concat('%', #{name}, '%'))
|
||||||
|
</if>
|
||||||
|
<if test="customerName != null and customerName != ''">
|
||||||
|
and sc.name like concat('%', #{customerName}, '%')
|
||||||
|
</if>
|
||||||
|
order by id desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSysCustomerCaseById" parameterType="Long" resultMap="SysCustomerCaseResult">
|
||||||
|
select scc.id, scc.name, scc.keyword, scc.remark, scc.customer_id, scc.create_time,sc.name as customer_name from sys_customer_case scc
|
||||||
|
left join sys_customer sc on sc.id = scc.customer_id and sc.del_flag = 0
|
||||||
|
where scc.id = #{id} and scc.del_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertSysCustomerCase" parameterType="SysCustomerCase" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into sys_customer_case
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="name != null">name,</if>
|
||||||
|
<if test="keyword != null">keyword,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="customerId != null">customer_id,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="delFlag != null">del_flag,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="name != null">#{name},</if>
|
||||||
|
<if test="keyword != null">#{keyword},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="customerId != null">#{customerId},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="delFlag != null">#{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateSysCustomerCase" parameterType="SysCustomerCase">
|
||||||
|
update sys_customer_case
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="name != null">name = #{name},</if>
|
||||||
|
<if test="keyword != null">keyword = #{keyword},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="customerId != null">customer_id = #{customerId},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteSysCustomerCaseById" parameterType="Long">
|
||||||
|
update sys_customer_case set del_flag = 1 where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteSysCustomerCaseByIds" parameterType="String">
|
||||||
|
update sys_customer_case set del_flag = 1 where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
@ -112,6 +112,7 @@
|
|||||||
<result property="bloodData" column="blood_data" />
|
<result property="bloodData" column="blood_data" />
|
||||||
<result property="moistureDate" column="moisture_date" />
|
<result property="moistureDate" column="moisture_date" />
|
||||||
<result property="remark" column="remark"></result>
|
<result property="remark" column="remark"></result>
|
||||||
|
<result property="guidance" column="guidance" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
@ -123,7 +124,7 @@
|
|||||||
|
|
||||||
<sql id="selectSysCustomerHealthyVo">
|
<sql id="selectSysCustomerHealthyVo">
|
||||||
select sch.id, customer_id, conditioning_project_id, sex, age, weight, tall, condiment, other_condiment, cooking_style, cooking_style_rate, wash_vegetables_style, other_wash_vegetables_style, breakfast_type, breakfast_food, lunch_type, dinner, vegetable_rate, common_meat, dinner_time, supper_num, supper_food, diet_hot_and_cold, diet_flavor, vegetables_num, vegetables_rate_type, fruits_num, fruits_time, fruits_rate, rice_num, rice_full, eating_speed, snacks, other_snacks, health_products_flag, health_products_brand, health_products_name, health_products_week_rate, health_products_day_rate, water_num, water_type, water_habit, drinks_num, drink_wine_flag, drink_wine_classify, other_wine_classify, drink_wine_amount, smoke_flag, smoke_rate, second_smoke, work_industry, work_type, defecation_num, other_defecation_num, defecation_time, defecation_shape, defecation_smell, defecation_speed, defecation_color, motion_num, motion_duration, motion_time, aerobic_motion_classify, anaerobic_motion_classify, anaerobic_aerobic_motion_classify, other_motion_classify, motion_field, other_motion_field, sleep_time, sleep_quality, sleep_drug_flag, sleep_drug, stayup_late_flag, stayup_late_week_num, family_illness_history, other_family_illness_history, operation_history, other_operation_history, near_operation_flag, recoverye_situation, long_eat_drug_flag, long_eat_drug_classify, other_long_eat_drug_classify, allergy_flag, allergy_situation, allergen, other_allergen, medical_report, medical_report_name,
|
select sch.id, customer_id, conditioning_project_id, sex, age, weight, tall, condiment, other_condiment, cooking_style, cooking_style_rate, wash_vegetables_style, other_wash_vegetables_style, breakfast_type, breakfast_food, lunch_type, dinner, vegetable_rate, common_meat, dinner_time, supper_num, supper_food, diet_hot_and_cold, diet_flavor, vegetables_num, vegetables_rate_type, fruits_num, fruits_time, fruits_rate, rice_num, rice_full, eating_speed, snacks, other_snacks, health_products_flag, health_products_brand, health_products_name, health_products_week_rate, health_products_day_rate, water_num, water_type, water_habit, drinks_num, drink_wine_flag, drink_wine_classify, other_wine_classify, drink_wine_amount, smoke_flag, smoke_rate, second_smoke, work_industry, work_type, defecation_num, other_defecation_num, defecation_time, defecation_shape, defecation_smell, defecation_speed, defecation_color, motion_num, motion_duration, motion_time, aerobic_motion_classify, anaerobic_motion_classify, anaerobic_aerobic_motion_classify, other_motion_classify, motion_field, other_motion_field, sleep_time, sleep_quality, sleep_drug_flag, sleep_drug, stayup_late_flag, stayup_late_week_num, family_illness_history, other_family_illness_history, operation_history, other_operation_history, near_operation_flag, recoverye_situation, long_eat_drug_flag, long_eat_drug_classify, other_long_eat_drug_classify, allergy_flag, allergy_situation, allergen, other_allergen, medical_report, medical_report_name,
|
||||||
position,experience,rebound,difficulty,crux,dishes_ingredient,make_food_type,physical_signs_id,other_physical_signs,blood_data,moisture_date,sch.remark,
|
position,experience,rebound,difficulty,crux,dishes_ingredient,make_food_type,physical_signs_id,other_physical_signs,blood_data,moisture_date,sch.remark,sch.guidance,
|
||||||
sch.create_time, sch.create_by,sch. update_time, sch.update_by, sch.del_flag
|
sch.create_time, sch.create_by,sch. update_time, sch.update_by, sch.del_flag
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
@ -261,6 +262,7 @@
|
|||||||
<if test="bloodData != null">blood_data,</if>
|
<if test="bloodData != null">blood_data,</if>
|
||||||
<if test="moistureDate != null">moisture_date,</if>
|
<if test="moistureDate != null">moisture_date,</if>
|
||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="guidance != null">guidance,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
@ -369,6 +371,7 @@
|
|||||||
<if test="bloodData != null">#{bloodData},</if>
|
<if test="bloodData != null">#{bloodData},</if>
|
||||||
<if test="moistureDate != null">#{moistureDate},</if>
|
<if test="moistureDate != null">#{moistureDate},</if>
|
||||||
<if test="remark != null">#{remark},</if>
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="guidance != null">#{guidance},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
@ -480,6 +483,7 @@
|
|||||||
<if test="bloodData != null">blood_data = #{bloodData},</if>
|
<if test="bloodData != null">blood_data = #{bloodData},</if>
|
||||||
<if test="moistureDate != null">moisture_date = #{moistureDate},</if>
|
<if test="moistureDate != null">moisture_date = #{moistureDate},</if>
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="guidance != null">guidance = #{guidance},</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
@ -517,4 +521,20 @@
|
|||||||
update sys_customer_healthy set del_flag = 1 where customer_id = #{customerId}
|
update sys_customer_healthy set del_flag = 1 where customer_id = #{customerId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<resultMap type="SysDictData" id="SysDictDataResult">
|
||||||
|
<id property="dictCode" column="dict_code" />
|
||||||
|
<result property="dictSort" column="dict_sort" />
|
||||||
|
<result property="dictLabel" column="dict_label" />
|
||||||
|
<result property="dictValue" column="dict_value" />
|
||||||
|
<result property="dictType" column="dict_type" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectDictDataByTypeAndValue" parameterType="SysDictData" resultMap="SysDictDataResult">
|
||||||
|
select dict_code, dict_sort, dict_label, dict_value, dict_type from sys_dict_data
|
||||||
|
where status = '0' and dict_type = #{dictType}
|
||||||
|
and dict_value in <foreach collection="dictValueList" item="item" index="index"
|
||||||
|
open="(" separator="," close=")">#{item}</foreach>
|
||||||
|
order by dict_sort asc
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -44,6 +44,7 @@
|
|||||||
<if test="reviewStatus != null and type != ''"> and review_status = #{reviewStatus}</if>
|
<if test="reviewStatus != null and type != ''"> and review_status = #{reviewStatus}</if>
|
||||||
<if test="isMain != null and type != ''"> and is_main = #{isMain}</if>
|
<if test="isMain != null and type != ''"> and is_main = #{isMain}</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<sql id="selectSysIngreditentsByIdVo">
|
<sql id="selectSysIngreditentsByIdVo">
|
||||||
@ -91,7 +92,7 @@
|
|||||||
<if test="isMain != null">is_main,</if>
|
<if test="isMain != null">is_main,</if>
|
||||||
<if test="methods != null">methods,</if>
|
<if test="methods != null">methods,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
<if test="reviewStatus != null">review_status</if>
|
<if test="reviewStatus != null">review_status,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
@ -102,7 +103,7 @@
|
|||||||
<if test="isMain != null">#{isMain},</if>
|
<if test="isMain != null">#{isMain},</if>
|
||||||
<if test="methods != null">#{methods},</if>
|
<if test="methods != null">#{methods},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
<if test="reviewStatus != null">#{reviewStatus}</if>
|
<if test="reviewStatus != null">#{reviewStatus},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
@ -69,6 +69,28 @@
|
|||||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON cp.dict_value = o.conditioning_project_id
|
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON cp.dict_value = o.conditioning_project_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<sql id="searchOrderType">
|
||||||
|
<if test="searchOrderTypeArray != null">
|
||||||
|
<trim prefix="AND (" suffix=")" suffixOverrides="or">
|
||||||
|
<foreach collection="searchOrderTypeArray" separator="or" item="typeArray" index="i">
|
||||||
|
(
|
||||||
|
<foreach collection="typeArray" separator="and" item="type" index="j">
|
||||||
|
<if test="j == 0">
|
||||||
|
order_type = #{type}
|
||||||
|
</if>
|
||||||
|
<if test="j == 1">
|
||||||
|
order_count_type = #{type}
|
||||||
|
</if>
|
||||||
|
<if test="j == 2">
|
||||||
|
order_money_type = #{type}
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
</sql>
|
||||||
|
|
||||||
<select id="selectAllOrderAmount" parameterType="SysOrder" resultType="BigDecimal">
|
<select id="selectAllOrderAmount" parameterType="SysOrder" resultType="BigDecimal">
|
||||||
SELECT SUM(amount) FROM sys_order
|
SELECT SUM(amount) FROM sys_order
|
||||||
<where>
|
<where>
|
||||||
@ -102,7 +124,12 @@
|
|||||||
and 0 > amount
|
and 0 > amount
|
||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
|
<include refid="searchOrderType">
|
||||||
|
<property name="reviewStatus" value="#{searchOrderTypeArray}"/>
|
||||||
|
</include>
|
||||||
<if test="true">and del_flag = 0</if>
|
<if test="true">and del_flag = 0</if>
|
||||||
|
<!-- 计算总额时需要除去二开售后提成单 -->
|
||||||
|
AND after_sale_commiss_order = 0
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -139,6 +166,9 @@
|
|||||||
and 0 > amount
|
and 0 > amount
|
||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
|
<include refid="searchOrderType">
|
||||||
|
<property name="reviewStatus" value="#{searchOrderTypeArray}"/>
|
||||||
|
</include>
|
||||||
<if test="true">and o.del_flag = 0</if>
|
<if test="true">and o.del_flag = 0</if>
|
||||||
</where>
|
</where>
|
||||||
order by order_time desc
|
order by order_time desc
|
||||||
@ -365,7 +395,10 @@
|
|||||||
from sys_order o
|
from sys_order o
|
||||||
left join sys_user su_sale on su_sale.user_id = o.after_sale_id and su_sale.del_flag = 0
|
left join sys_user su_sale on su_sale.user_id = o.after_sale_id and su_sale.del_flag = 0
|
||||||
left join sys_user su_nutritionist on su_nutritionist.user_id = o.nutritionist_id and su_nutritionist.del_flag = 0
|
left join sys_user su_nutritionist on su_nutritionist.user_id = o.nutritionist_id and su_nutritionist.del_flag = 0
|
||||||
where review_status = 'yes' and o.order_time >= '2021-01-01' and o.del_flag = 0
|
where o.order_time >= '2021-01-01' and o.del_flag = 0
|
||||||
|
<if test="reviewStatus != null and reviewStatus != ''">
|
||||||
|
and review_status = #{reviewStatus}
|
||||||
|
</if>
|
||||||
<if test="userId != null">
|
<if test="userId != null">
|
||||||
and (su_sale.user_id = #{userId} or su_nutritionist.user_id = #{userId})
|
and (su_sale.user_id = #{userId} or su_nutritionist.user_id = #{userId})
|
||||||
</if>
|
</if>
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
<resultMap type="SysOrderPause" id="SysOrderPauseResult">
|
<resultMap type="SysOrderPause" id="SysOrderPauseResult">
|
||||||
<result property="id" column="id"/>
|
<result property="id" column="id"/>
|
||||||
<result property="orderId" column="order_id"/>
|
<result property="orderId" column="order_id"/>
|
||||||
|
<result property="cusId" column="cus_id"/>
|
||||||
<result property="pauseStartDate" column="pause_start_date"/>
|
<result property="pauseStartDate" column="pause_start_date"/>
|
||||||
<result property="pauseEndDate" column="pause_end_date"/>
|
<result property="pauseEndDate" column="pause_end_date"/>
|
||||||
<result property="reason" column="reason"/>
|
<result property="reason" column="reason"/>
|
||||||
@ -19,21 +20,22 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="baseSelectField">
|
<sql id="baseSelectField">
|
||||||
id, order_id, pause_start_date, pause_end_date, reason, remarks, create_time, create_by, update_time, update_by, del_flag
|
id, order_id, cus_id, pause_start_date, pause_end_date, reason, remarks, create_time, create_by, update_time, update_by, del_flag
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="selectSysOrderPauseVo">
|
<sql id="selectSysOrderPauseVo">
|
||||||
select id, order_id, pause_start_date, pause_end_date, reason, remarks, create_time, create_by, update_time, update_by, del_flag from sys_order_pause sop
|
select id, order_id, cus_id, pause_start_date, pause_end_date, reason, remarks, create_time, create_by, update_time, update_by, del_flag from sys_recipes_pause sop
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectSysOrderPauseList" parameterType="SysOrderPause" resultMap="SysOrderPauseResult">
|
<select id="selectSysOrderPauseList" parameterType="SysOrderPause" resultMap="SysOrderPauseResult">
|
||||||
<!--select sop.id, sop.order_id, sop.pause_start_date, sop.pause_end_date, sop.reason, sop.remarks, sop.create_time, sop.create_by, sop.update_time, sop.update_by, sop.del_flag,
|
<!--select sop.id, sop.order_id, sop.pause_start_date, sop.pause_end_date, sop.reason, sop.remarks, sop.create_time, sop.create_by, sop.update_time, sop.update_by, sop.del_flag,
|
||||||
so.customer,so.order_time
|
so.customer,so.order_time
|
||||||
from sys_order_pause sop
|
from sys_recipes_pause sop
|
||||||
left join sys_order so on so.order_id = sop.order_id-->
|
left join sys_order so on so.order_id = sop.order_id-->
|
||||||
<include refid="selectSysOrderPauseVo"></include>
|
<include refid="selectSysOrderPauseVo"></include>
|
||||||
where sop.del_flag = 0
|
where sop.del_flag = 0
|
||||||
<if test="orderId != null ">and sop.order_id = #{orderId}</if>
|
<if test="orderId != null ">and sop.order_id = #{orderId}</if>
|
||||||
|
<if test="cusId != null ">and sop.cus_id = #{cusId}</if>
|
||||||
<if test="pauseStartDate != null ">and sop.pause_start_date = #{pauseStartDate}</if>
|
<if test="pauseStartDate != null ">and sop.pause_start_date = #{pauseStartDate}</if>
|
||||||
<if test="pauseEndDate != null ">and sop.pause_end_date = #{pauseEndDate}</if>
|
<if test="pauseEndDate != null ">and sop.pause_end_date = #{pauseEndDate}</if>
|
||||||
<if test="reason != null and reason != ''">and sop.reason = #{reason}</if>
|
<if test="reason != null and reason != ''">and sop.reason = #{reason}</if>
|
||||||
@ -46,9 +48,10 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertSysOrderPause" parameterType="SysOrderPause" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertSysOrderPause" parameterType="SysOrderPause" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into sys_order_pause
|
insert into sys_recipes_pause
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="orderId != null">order_id,</if>
|
<if test="orderId != null">order_id,</if>
|
||||||
|
<if test="cusId != null">cus_id,</if>
|
||||||
<if test="pauseStartDate != null">pause_start_date,</if>
|
<if test="pauseStartDate != null">pause_start_date,</if>
|
||||||
<if test="pauseEndDate != null">pause_end_date,</if>
|
<if test="pauseEndDate != null">pause_end_date,</if>
|
||||||
<if test="reason != null">reason,</if>
|
<if test="reason != null">reason,</if>
|
||||||
@ -61,6 +64,7 @@
|
|||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="orderId != null">#{orderId},</if>
|
<if test="orderId != null">#{orderId},</if>
|
||||||
|
<if test="cusId != null">#{cusId},</if>
|
||||||
<if test="pauseStartDate != null">#{pauseStartDate},</if>
|
<if test="pauseStartDate != null">#{pauseStartDate},</if>
|
||||||
<if test="pauseEndDate != null">#{pauseEndDate},</if>
|
<if test="pauseEndDate != null">#{pauseEndDate},</if>
|
||||||
<if test="reason != null">#{reason},</if>
|
<if test="reason != null">#{reason},</if>
|
||||||
@ -74,9 +78,10 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateSysOrderPause" parameterType="SysOrderPause">
|
<update id="updateSysOrderPause" parameterType="SysOrderPause">
|
||||||
update sys_order_pause
|
update sys_recipes_pause
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="orderId != null">order_id = #{orderId},</if>
|
<if test="orderId != null">order_id = #{orderId},</if>
|
||||||
|
<if test="cusId != null">cus_id = #{cusId},</if>
|
||||||
<if test="pauseStartDate != null">pause_start_date = #{pauseStartDate},</if>
|
<if test="pauseStartDate != null">pause_start_date = #{pauseStartDate},</if>
|
||||||
<if test="pauseEndDate != null">pause_end_date = #{pauseEndDate},</if>
|
<if test="pauseEndDate != null">pause_end_date = #{pauseEndDate},</if>
|
||||||
<if test="reason != null">reason = #{reason},</if>
|
<if test="reason != null">reason = #{reason},</if>
|
||||||
@ -91,19 +96,19 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="deleteSysOrderPauseById" parameterType="Long">
|
<update id="deleteSysOrderPauseById" parameterType="Long">
|
||||||
update sys_order_pause set del_flag = 1 where id = #{id}
|
update sys_recipes_pause set del_flag = 1 where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="deleteSysOrderPauseByIds" parameterType="String">
|
<update id="deleteSysOrderPauseByIds" parameterType="String">
|
||||||
update sys_order_pause set del_flag = 1 where id in
|
update sys_recipes_pause set del_flag = 1 where id in
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<!-- 根据订单ID、时间范围查询数量 -->
|
<!-- 根据用户ID、时间范围查询数量 -->
|
||||||
<select id="getCountByOrderIdAndPauseDate" parameterType="SysOrderPause" resultType="int">
|
<select id="getCountByCusIdAndPauseDate" parameterType="SysOrderPause" resultType="int">
|
||||||
select count(id) from sys_order_pause where del_flag = 0 and order_id = #{orderId}
|
select count(id) from sys_recipes_pause where del_flag = 0 and cus_id = #{cusId}
|
||||||
AND (#{pauseStartDate} >= pause_start_date AND pause_end_date >= #{pauseStartDate}
|
AND (#{pauseStartDate} >= pause_start_date AND pause_end_date >= #{pauseStartDate}
|
||||||
OR #{pauseEndDate} >= pause_start_date AND pause_end_date >= #{pauseEndDate})
|
OR #{pauseEndDate} >= pause_start_date AND pause_end_date >= #{pauseEndDate})
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
@ -114,10 +119,24 @@
|
|||||||
|
|
||||||
<!-- 根据订单ID删除暂停记录 -->
|
<!-- 根据订单ID删除暂停记录 -->
|
||||||
<update id="deletePauseByOrderId" parameterType="String">
|
<update id="deletePauseByOrderId" parameterType="String">
|
||||||
update sys_order_pause set del_flag = 1 where order_id in
|
update sys_recipes_pause set del_flag = 1 where order_id in
|
||||||
<foreach item="orderId" collection="array" open="(" separator="," close=")">
|
<foreach item="orderId" collection="array" open="(" separator="," close=")">
|
||||||
#{orderId}
|
#{orderId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="selectNearMainOrderIdByCusId" parameterType="Long" resultType="Long">
|
||||||
|
SELECT order_id
|
||||||
|
FROM sys_order
|
||||||
|
WHERE cus_id=#{cusId} AND del_flag = 0 AND order_type IN(0, 1) AND after_sale_commiss_order = 0
|
||||||
|
AND order_money_type IN(0, 2) AND main_order_id=0 AND server_end_time > NOW()
|
||||||
|
ORDER BY server_end_time ASC LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据订单ID获取暂停记录,根据暂停开始时间排序,用于生成食谱计划,不能随意修改排序方式 -->
|
||||||
|
<select id="getPauseListByOrderId" parameterType="Long" resultMap="SysOrderPauseResult">
|
||||||
|
<include refid="selectSysOrderPauseVo"></include>
|
||||||
|
where sop.del_flag = 0 and sop.order_id = #{orderId} order by sop.pause_start_date asc
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -82,6 +82,9 @@
|
|||||||
<update id="updateDishesDetail" parameterType="SysRecipesDailyDishes">
|
<update id="updateDishesDetail" parameterType="SysRecipesDailyDishes">
|
||||||
update sys_customer_menu_dishes
|
update sys_customer_menu_dishes
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="menuId != null">menu_id = #{menuId},</if>
|
||||||
|
<if test="dishesId != null">dishes_id = #{dishesId},</if>
|
||||||
|
<if test="type != null">type = #{type},</if>
|
||||||
<if test="detail != null">detail = #{detail, jdbcType=OTHER, typeHandler=com.stdiet.custom.typehandler.ArrayJsonHandler},</if>
|
<if test="detail != null">detail = #{detail, jdbcType=OTHER, typeHandler=com.stdiet.custom.typehandler.ArrayJsonHandler},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
|
@ -14,16 +14,19 @@
|
|||||||
<result property="recipesId" column="recipes_id"/>
|
<result property="recipesId" column="recipes_id"/>
|
||||||
<result property="sendFlag" column="send_flag"/>
|
<result property="sendFlag" column="send_flag"/>
|
||||||
<result property="sendTime" column="send_time"/>
|
<result property="sendTime" column="send_time"/>
|
||||||
|
<result property="pauseDate" column="pause_date"/>
|
||||||
<result property="createTime" column="create_time"/>
|
<result property="createTime" column="create_time"/>
|
||||||
<result property="createBy" column="create_by"/>
|
<result property="createBy" column="create_by"/>
|
||||||
<result property="updateTime" column="update_time"/>
|
<result property="updateTime" column="update_time"/>
|
||||||
<result property="updateBy" column="update_by"/>
|
<result property="updateBy" column="update_by"/>
|
||||||
<result property="delFlag" column="del_flag"/>
|
<result property="delFlag" column="del_flag"/>
|
||||||
<result property="cusId" column="cus_id"/>
|
<result property="cusId" column="cus_id"/>
|
||||||
|
<result property="outId" column="out_id"/>
|
||||||
<!-- 非持久化字段 -->
|
<!-- 非持久化字段 -->
|
||||||
<!-- <result property="customerId" column="cus_id"></result><!– 客户ID –>-->
|
<!-- <result property="customerId" column="cus_id"></result><!– 客户ID –>-->
|
||||||
<result property="customer" column="customer"/><!-- 客户姓名 -->
|
<result property="customer" column="customer"/><!-- 客户姓名 -->
|
||||||
<result property="phone" column="phone"/>
|
<result property="phone" column="phone"/>
|
||||||
|
<result property="reviewStatus" column="review_status"/>
|
||||||
<result property="orderStartDate" column="order_start_date"/>
|
<result property="orderStartDate" column="order_start_date"/>
|
||||||
<result property="orderEndDate" column="order_end_date"/>
|
<result property="orderEndDate" column="order_end_date"/>
|
||||||
<result property="nutritionistId" column="nutritionist_id"/>
|
<result property="nutritionistId" column="nutritionist_id"/>
|
||||||
@ -32,12 +35,14 @@
|
|||||||
<result property="nutritionistAssis" column="nutritionist_assis"/>
|
<result property="nutritionistAssis" column="nutritionist_assis"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
<sql id="selectSysRecipesPlanVo">
|
<sql id="selectSysRecipesPlanVo">
|
||||||
select id, order_id, cus_id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, send_time, create_time, create_by, update_time, update_by, del_flag from sys_recipes_plan
|
select id, order_id, cus_id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, send_time, pause_date, create_time, create_by, update_time, update_by, del_flag, review_status from sys_recipes_plan
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectSysRecipesPlanList" parameterType="SysRecipesPlan" resultMap="SysRecipesPlanResult">
|
<select id="selectSysRecipesPlanList" parameterType="SysRecipesPlan" resultMap="SysRecipesPlanResult">
|
||||||
<include refid="selectSysRecipesPlanVo"/> where del_flag = 0
|
<include refid="selectSysRecipesPlanVo"/>
|
||||||
|
where del_flag = 0
|
||||||
<if test="orderId != null ">and order_id = #{orderId}</if>
|
<if test="orderId != null ">and order_id = #{orderId}</if>
|
||||||
<if test="cusId != null ">and cus_id = #{cusId}</if>
|
<if test="cusId != null ">and cus_id = #{cusId}</if>
|
||||||
<if test="startDate != null ">and start_date = #{startDate}</if>
|
<if test="startDate != null ">and start_date = #{startDate}</if>
|
||||||
@ -47,6 +52,9 @@
|
|||||||
<if test="recipesId != null ">and recipes_id = #{recipesId}</if>
|
<if test="recipesId != null ">and recipes_id = #{recipesId}</if>
|
||||||
<if test="sendFlag != null ">and send_flag = #{sendFlag}</if>
|
<if test="sendFlag != null ">and send_flag = #{sendFlag}</if>
|
||||||
<if test="sendTime != null ">and send_time = #{sendTime}</if>
|
<if test="sendTime != null ">and send_time = #{sendTime}</if>
|
||||||
|
<if test="reviewStatus != null ">and review_status = #{reviewStatus}</if>
|
||||||
|
<!-- 请勿轻易修改排序方式,会影响食谱生成等逻辑 -->
|
||||||
|
order by id ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectSysRecipesPlanById" parameterType="Long" resultMap="SysRecipesPlanResult">
|
<select id="selectSysRecipesPlanById" parameterType="Long" resultMap="SysRecipesPlanResult">
|
||||||
@ -54,11 +62,18 @@
|
|||||||
where id = #{id} and del_flag = 0
|
where id = #{id} and del_flag = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据用户ID查询是否存在该用户最后一天食谱 -->
|
||||||
|
<select id="getLastDayRecipesPlan" resultMap="SysRecipesPlanResult" parameterType="Long">
|
||||||
|
<include refid="selectSysRecipesPlanVo"/>
|
||||||
|
where cus_id = #{customerId} and del_flag = 0 order by end_num_day DESC limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertSysRecipesPlan" parameterType="SysRecipesPlan" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertSysRecipesPlan" parameterType="SysRecipesPlan" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into sys_recipes_plan
|
insert into sys_recipes_plan
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="orderId != null">order_id,</if>
|
<if test="orderId != null">order_id,</if>
|
||||||
<if test="cusId != null">cus_id,</if>
|
<if test="cusId != null">cus_id,</if>
|
||||||
|
<if test="outId != null">out_id,</if>
|
||||||
<if test="startDate != null">start_date,</if>
|
<if test="startDate != null">start_date,</if>
|
||||||
<if test="endDate != null">end_date,</if>
|
<if test="endDate != null">end_date,</if>
|
||||||
<if test="startNumDay != null">start_num_day,</if>
|
<if test="startNumDay != null">start_num_day,</if>
|
||||||
@ -66,15 +81,19 @@
|
|||||||
<if test="recipesId != null">recipes_id,</if>
|
<if test="recipesId != null">recipes_id,</if>
|
||||||
<if test="sendFlag != null">send_flag,</if>
|
<if test="sendFlag != null">send_flag,</if>
|
||||||
<if test="sendTime != null">send_time,</if>
|
<if test="sendTime != null">send_time,</if>
|
||||||
|
<if test="pauseDate != null">pause_date,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="delFlag != null">del_flag,</if>
|
<if test="delFlag != null">del_flag,</if>
|
||||||
|
<if test="reviewStatus != null">review_status,</if>
|
||||||
|
<if test="type != null">type,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="orderId != null">#{orderId},</if>
|
<if test="orderId != null">#{orderId},</if>
|
||||||
<if test="cusId != null">#{cusId},</if>
|
<if test="cusId != null">#{cusId},</if>
|
||||||
|
<if test="outId != null">#{outId},</if>
|
||||||
<if test="startDate != null">#{startDate},</if>
|
<if test="startDate != null">#{startDate},</if>
|
||||||
<if test="endDate != null">#{endDate},</if>
|
<if test="endDate != null">#{endDate},</if>
|
||||||
<if test="startNumDay != null">#{startNumDay},</if>
|
<if test="startNumDay != null">#{startNumDay},</if>
|
||||||
@ -82,11 +101,14 @@
|
|||||||
<if test="recipesId != null">#{recipesId},</if>
|
<if test="recipesId != null">#{recipesId},</if>
|
||||||
<if test="sendFlag != null">#{sendFlag},</if>
|
<if test="sendFlag != null">#{sendFlag},</if>
|
||||||
<if test="sendTime != null">#{sendTime},</if>
|
<if test="sendTime != null">#{sendTime},</if>
|
||||||
|
<if test="pauseDate != null">#{pauseDate},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
<if test="delFlag != null">#{delFlag},</if>
|
<if test="delFlag != null">#{delFlag},</if>
|
||||||
|
<if test="reviewStatus != null">#{reviewStatus},</if>
|
||||||
|
<if test="type != null">#{type},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@ -95,6 +117,7 @@
|
|||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="orderId != null">order_id = #{orderId},</if>
|
<if test="orderId != null">order_id = #{orderId},</if>
|
||||||
<if test="cusId != null">cus_id = #{cusId},</if>
|
<if test="cusId != null">cus_id = #{cusId},</if>
|
||||||
|
<if test="outId != null">out_id = #{outId},</if>
|
||||||
<if test="startDate != null">start_date = #{startDate},</if>
|
<if test="startDate != null">start_date = #{startDate},</if>
|
||||||
<if test="endDate != null">end_date = #{endDate},</if>
|
<if test="endDate != null">end_date = #{endDate},</if>
|
||||||
<if test="startNumDay != null">start_num_day = #{startNumDay},</if>
|
<if test="startNumDay != null">start_num_day = #{startNumDay},</if>
|
||||||
@ -102,39 +125,42 @@
|
|||||||
<if test="recipesId != null">recipes_id = #{recipesId},</if>
|
<if test="recipesId != null">recipes_id = #{recipesId},</if>
|
||||||
<if test="sendFlag != null">send_flag = #{sendFlag},</if>
|
<if test="sendFlag != null">send_flag = #{sendFlag},</if>
|
||||||
<if test="sendTime != null">send_time = #{sendTime},</if>
|
<if test="sendTime != null">send_time = #{sendTime},</if>
|
||||||
|
<if test="pauseDate != null">pause_date = #{pauseDate},</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||||
|
<if test="reviewStatus != null">review_status = #{reviewStatus},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id} and del_flag = 0
|
where id = #{id} and del_flag = 0
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteSysRecipesPlanById" parameterType="Long">
|
<update id="deleteSysRecipesPlanById" parameterType="Long">
|
||||||
delete from sys_recipes_plan where id = #{id}
|
update sys_recipes_plan set del_flag = 1 where id = #{id}
|
||||||
</delete>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteSysRecipesPlanByIds" parameterType="String">
|
<update id="deleteSysRecipesPlanByIds" parameterType="String">
|
||||||
delete from sys_recipes_plan where id in
|
update sys_recipes_plan set del_flag = 1 where id in
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</update>
|
||||||
|
|
||||||
<!-- 批量插入食谱计划 -->
|
<!-- 批量插入食谱计划 -->
|
||||||
<insert id="insertBatch">
|
<insert id="insertBatch">
|
||||||
INSERT INTO sys_recipes_plan
|
INSERT INTO sys_recipes_plan
|
||||||
(order_id, cus_id, start_date, end_date, start_num_day, end_num_day, send_flag, send_time, recipes_id)
|
(order_id, cus_id, out_id, start_date, end_date, start_num_day, end_num_day, send_flag, send_time, pause_date, recipes_id)
|
||||||
VALUES
|
VALUES
|
||||||
<foreach collection="list" item="plan" separator=",">
|
<foreach collection="list" item="plan" separator=",">
|
||||||
(#{plan.orderId}, #{plan.cusId}, #{plan.startDate}, #{plan.endDate}, #{plan.startNumDay}, #{plan.endNumDay}, #{plan.sendFlag}, #{plan.sendTime}, #{plan.recipesId})
|
(#{plan.orderId}, #{plan.cusId}, #{plan.outId}, #{plan.startDate}, #{plan.endDate}, #{plan.startNumDay}, #{plan.endNumDay},
|
||||||
|
#{plan.sendFlag}, #{plan.sendTime}, #{plan.pauseDate}, #{plan.recipesId})
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<!-- 根据订单ID删除对应食谱计划 -->
|
<!-- 根据订单ID删除对应食谱计划 -->
|
||||||
<update id="delRecipesPlanByOrderId" parameterType="String">
|
<update id="delRecipesPlanByOrderId" parameterType="String">
|
||||||
delete from sys_recipes_plan where order_id in
|
update sys_recipes_plan set del_flag = 1 where order_id in
|
||||||
<foreach item="orderId" collection="array" open="(" separator="," close=")">
|
<foreach item="orderId" collection="array" open="(" separator="," close=")">
|
||||||
#{orderId}
|
#{orderId}
|
||||||
</foreach>
|
</foreach>
|
||||||
@ -143,20 +169,25 @@
|
|||||||
<!-- 食谱计划、订单表联查 -->
|
<!-- 食谱计划、订单表联查 -->
|
||||||
<select id="selectPlanListByCondition" parameterType="SysRecipesPlan" resultMap="SysRecipesPlanResult">
|
<select id="selectPlanListByCondition" parameterType="SysRecipesPlan" resultMap="SysRecipesPlanResult">
|
||||||
SELECT srp.id,srp.order_id,srp.recipes_id,srp.start_num_day,srp.end_num_day,srp.cus_id,sc.phone,
|
SELECT srp.id,srp.order_id,srp.recipes_id,srp.start_num_day,srp.end_num_day,srp.cus_id,sc.phone,
|
||||||
su_nutritionist.nick_name nutritionist,su_nutritionist_assis.nick_name AS nutritionist_assis,
|
su_nutritionist.nick_name AS nutritionist,su_nutritionist_assis.nick_name AS nutritionist_assis,
|
||||||
srp.start_date,srp.end_date,srp.send_flag,srp.send_time, sc.name as customer
|
srp.start_date,srp.end_date,srp.send_flag,srp.send_time, sc.name as customer, srp.review_status
|
||||||
FROM sys_recipes_plan srp
|
FROM sys_recipes_plan srp
|
||||||
LEFT JOIN sys_order sr ON sr.order_id = srp.order_id
|
LEFT JOIN sys_order sr ON sr.order_id = srp.order_id
|
||||||
LEFT JOIN sys_customer sc ON sc.id = srp.cus_id
|
LEFT JOIN sys_customer sc ON sc.id = srp.cus_id
|
||||||
LEFT JOIN sys_user su_nutritionist ON su_nutritionist.user_id = sr.nutritionist_id AND su_nutritionist.del_flag = 0
|
LEFT JOIN sys_user su_nutritionist ON su_nutritionist.user_id = sr.nutritionist_id AND su_nutritionist.del_flag = 0
|
||||||
LEFT JOIN sys_user su_nutritionist_assis ON su_nutritionist_assis.user_id = sr.nutri_assis_id AND su_nutritionist_assis.del_flag = 0
|
LEFT JOIN sys_user su_nutritionist_assis ON su_nutritionist_assis.user_id = sr.nutri_assis_id AND su_nutritionist_assis.del_flag = 0
|
||||||
WHERE srp.del_flag = 0 and sr.del_flag = 0
|
WHERE srp.del_flag = 0 AND sr.del_flag = 0 AND srp.type = 0
|
||||||
<if test="orderId != null">AND srp.order_id = #{orderId}</if>
|
<if test="orderId != null">AND srp.order_id = #{orderId}</if>
|
||||||
<if test="sendFlag != null">AND srp.send_flag = #{sendFlag}</if>
|
<if test="sendFlag != null">AND srp.send_flag = #{sendFlag}</if>
|
||||||
<if test="customer != null and customer != ''">AND (sc.name like concat('%',#{customer},'%') OR sc.phone like concat('%',#{customer},'%'))</if>
|
<if test="customer != null and customer != ''">AND (sc.name like concat('%',#{customer},'%') OR sc.phone like
|
||||||
|
concat('%',#{customer},'%'))
|
||||||
|
</if>
|
||||||
<if test="nutritionistId != null">AND su_nutritionist.user_id = #{nutritionistId}</if>
|
<if test="nutritionistId != null">AND su_nutritionist.user_id = #{nutritionistId}</if>
|
||||||
<if test="nutritionistAssisId != null">AND su_nutritionist_assis.user_id = #{nutritionistAssisId}</if>
|
<if test="nutritionistAssisId != null">AND su_nutritionist_assis.user_id = #{nutritionistAssisId}</if>
|
||||||
<if test="startDate != null and endDate != null ">AND srp.start_date BETWEEN date_format(#{startDate},'%y%m%d') AND date_format(#{endDate},'%y%m%d') </if>
|
<if test="reviewStatus != null">AND srp.review_status = #{reviewStatus}</if>
|
||||||
|
<if test="startDate != null and endDate != null ">AND srp.start_date BETWEEN date_format(#{startDate},'%y%m%d')
|
||||||
|
AND date_format(#{endDate},'%y%m%d')
|
||||||
|
</if>
|
||||||
ORDER BY srp.order_id DESC,srp.id ASC
|
ORDER BY srp.order_id DESC,srp.id ASC
|
||||||
</select>
|
</select>
|
||||||
<!-- 食谱计划、订单表联查 -->
|
<!-- 食谱计划、订单表联查 -->
|
||||||
@ -186,4 +217,45 @@
|
|||||||
<if test="sendFlag != null">AND srp.send_flag = #{sendFlag}</if>
|
<if test="sendFlag != null">AND srp.send_flag = #{sendFlag}</if>
|
||||||
ORDER BY srp.id ASC
|
ORDER BY srp.id ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据cusId查询食谱计划-->
|
||||||
|
<select id="selectPlanListByCusId" parameterType="Long" resultMap="SysRecipesPlanResult">
|
||||||
|
select id, out_id, start_date, end_date, start_num_day, end_num_day, recipes_id, review_status from sys_recipes_plan
|
||||||
|
where cus_id=#{cusId} and del_flag = 0 order by id asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getCusIdByOutId" parameterType="String" resultType="Long">
|
||||||
|
select cus_id from sys_recipes_plan where out_id=#{outId} limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<resultMap id="SysRecipesPlanListInfoResult" type="SysRecipesPlanListInfo">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="startDate" column="start_date"/>
|
||||||
|
<result property="endDate" column="end_date"/>
|
||||||
|
<result property="startNumDay" column="start_num_day"/>
|
||||||
|
<result property="endNumDay" column="end_num_day"/>
|
||||||
|
<association property="menus" column="recipes_id" select="selectMenuIds"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 通过outId查询食谱计划简要-->
|
||||||
|
<select id="selectRecipesPlanListInfo" resultMap="SysRecipesPlanListInfoResult">
|
||||||
|
select id, start_date, end_date, start_num_day, end_num_day, recipes_id from sys_recipes_plan where out_id=#{outId} and del_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<resultMap type="SysRecipesDaily" id="SysRecipesResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="numDay" column="num_day"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectMenuIds" parameterType="Long" resultMap="SysRecipesResult">
|
||||||
|
select id, num_day from sys_customer_daily_menu where recipes_id=#{recipes_id} and del_flag = 0 order by num_day asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 批量修改食谱计划 -->
|
||||||
|
<update id="updateMuchRecipesPlanDate" parameterType="SysRecipesPlan">
|
||||||
|
<!--<foreach collection="list" item="item" separator=";" open="" close="">
|
||||||
|
|
||||||
|
</foreach>-->
|
||||||
|
update sys_recipes_plan set start_date = #{startDate},end_date = #{endDate},pause_date=#{pauseDate} where id = #{id}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
@ -0,0 +1,96 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.stdiet.custom.mapper.SysRecipesTemplateMapper">
|
||||||
|
|
||||||
|
<resultMap type="SysRecipesTemplate" id="SysRecipesTemplateResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="name" column="name"/>
|
||||||
|
<result property="planId" column="plan_id"/>
|
||||||
|
<result property="nutritionistId" column="nutritionist_id"/>
|
||||||
|
<result property="nutriAssisId" column="nutri_assis_id"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="recipesId" column="recipes_id"/>
|
||||||
|
<result property="reviewStatus" column="review_status"/>
|
||||||
|
|
||||||
|
<result property="nutritionist" column="nutritionist"/>
|
||||||
|
<result property="nutriAssis" column="nutritionist_assis"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectRecipesTemplateListByCondition" parameterType="SysRecipesTemplate" resultMap="SysRecipesTemplateResult">
|
||||||
|
select srt.id, srt.name, srt.nutritionist_id, srt.nutri_assis_id, srt.remark, srt.update_time,
|
||||||
|
srt.create_time, srt.update_by, srt.create_by, srt.plan_id, srp.recipes_id, srp.review_status,
|
||||||
|
su_nutritionist.nick_name as nutritionist, su_nutritionist_assis.nick_name as nutritionist_assis
|
||||||
|
from sys_recipes_template srt
|
||||||
|
left join sys_recipes_plan srp on srp.id = srt.plan_id
|
||||||
|
left join sys_user su_nutritionist on su_nutritionist.user_id = srt.nutritionist_id and su_nutritionist.del_flag = 0
|
||||||
|
left join sys_user su_nutritionist_assis on su_nutritionist_assis.user_id = srt.nutri_assis_id and su_nutritionist_assis.del_flag = 0
|
||||||
|
where srt.del_flag = 0
|
||||||
|
<if test="name != null and name != ''">and srt.name like concat('%', #{name}, '%')</if>
|
||||||
|
<if test="nutriAssisId != null ">and srt.nutri_assis_id = #{nutriAssisId}</if>
|
||||||
|
<if test="nutritionistId != null ">and srt.nutritionist_id = #{nutritionistId}</if>
|
||||||
|
<if test="reviewStatus != null ">and srp.review_status = #{reviewStatus}</if>
|
||||||
|
order by srt.id desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getRecipesTemplateById" parameterType="Long" resultType="SysRecipesTemplate">
|
||||||
|
select srt.id, srt.name, srt.nutritionist_id as nutritionistId, srt.nutri_assis_id as nutriAssisId, srt.remark, srt.update_time as updateTime,
|
||||||
|
srt.create_time as createTime, srt.update_by as updateBy, srt.create_by as createBy, srt.plan_id as planId,
|
||||||
|
su_nutritionist.nick_name as nutritionist, su_nutritionist_assis.nick_name as nutriAssis
|
||||||
|
from sys_recipes_template srt
|
||||||
|
left join sys_user su_nutritionist on su_nutritionist.user_id = srt.nutritionist_id and su_nutritionist.del_flag = 0
|
||||||
|
left join sys_user su_nutritionist_assis on su_nutritionist_assis.user_id = srt.nutri_assis_id and su_nutritionist_assis.del_flag = 0
|
||||||
|
where srt.id = #{id} and srt.del_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertRecipsesTemplate" parameterType="SysRecipesTemplate" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into sys_recipes_template
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="name != null">name,</if>
|
||||||
|
<if test="planId != null">plan_id,</if>
|
||||||
|
<if test="nutriAssisId != null">nutri_assis_id,</if>
|
||||||
|
<if test="nutritionistId != null">nutritionist_id,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="name != null">#{name},</if>
|
||||||
|
<if test="planId != null">#{planId},</if>
|
||||||
|
<if test="nutriAssisId != null">#{nutriAssisId},</if>
|
||||||
|
<if test="nutritionistId != null">#{nutritionistId},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateRecipesTemplate" parameterType="SysRecipesTemplate">
|
||||||
|
update sys_recipes_template
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="name != null">name = #{name},</if>
|
||||||
|
<if test="nutriAssisId != null">nutri_assis_id = #{nutriAssisId},</if>
|
||||||
|
<if test="nutritionistId != null">nutritionist_id = #{nutritionistId},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="removeRecipesTemplate" parameterType="Long">
|
||||||
|
update sys_recipes_template set del_flag=1 where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
@ -102,6 +102,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
"/custom/wxUserInfo/wx/**",
|
"/custom/wxUserInfo/wx/**",
|
||||||
"/custom/wxUserLog/wx/**",
|
"/custom/wxUserLog/wx/**",
|
||||||
"/wx/**",
|
"/wx/**",
|
||||||
|
"/wap/**",
|
||||||
"/investigate/**",
|
"/investigate/**",
|
||||||
"/common/customerUploadFile"
|
"/common/customerUploadFile"
|
||||||
).anonymous()
|
).anonymous()
|
||||||
|
@ -64,6 +64,7 @@
|
|||||||
"vue": "2.6.10",
|
"vue": "2.6.10",
|
||||||
"vue-count-to": "1.0.13",
|
"vue-count-to": "1.0.13",
|
||||||
"vue-cropper": "0.4.9",
|
"vue-cropper": "0.4.9",
|
||||||
|
"vue-qr": "^2.3.0",
|
||||||
"vue-router": "3.0.2",
|
"vue-router": "3.0.2",
|
||||||
"vue-scrollto": "^2.20.0",
|
"vue-scrollto": "^2.20.0",
|
||||||
"vue-splitpane": "1.0.4",
|
"vue-splitpane": "1.0.4",
|
||||||
|
@ -1,68 +1,74 @@
|
|||||||
import request from '@/utils/request'
|
import request from "@/utils/request";
|
||||||
|
|
||||||
// 查询合同列表
|
// 查询合同列表
|
||||||
export function listContract(query) {
|
export function listContract(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/custom/contract/list',
|
url: "/custom/contract/list",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询合同详细
|
// 查询合同详细
|
||||||
export function getContract(id) {
|
export function getContract(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/custom/contract/' + id,
|
url: "/custom/contract/" + id,
|
||||||
method: 'get'
|
method: "get"
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增合同
|
// 新增合同
|
||||||
export function addContract(data) {
|
export function addContract(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/custom/contract',
|
url: "/custom/contract",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改合同
|
// 修改合同
|
||||||
export function updateContract(data) {
|
export function updateContract(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/custom/contract',
|
url: "/custom/contract",
|
||||||
method: 'put',
|
method: "put",
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除合同
|
// 删除合同
|
||||||
export function delContract(id) {
|
export function delContract(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/custom/contract/' + id,
|
url: "/custom/contract/" + id,
|
||||||
method: 'delete'
|
method: "delete"
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出合同
|
// 导出合同
|
||||||
export function exportContract(query) {
|
export function exportContract(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/custom/contract/export',
|
url: "/custom/contract/export",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getFile(id) {
|
export function getFile(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/custom/contract/file/' + id,
|
url: "/custom/contract/file/" + id,
|
||||||
method: 'get',
|
method: "get",
|
||||||
})
|
headers: {
|
||||||
|
isToken: false
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function signContract(data) {
|
export function signContract(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/custom/contract/sign',
|
url: "/custom/contract/sign",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
headers: {
|
||||||
|
isToken: false
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
84
stdiet-ui/src/api/custom/customerCase.js
Normal file
84
stdiet-ui/src/api/custom/customerCase.js
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询客户案例管理列表
|
||||||
|
export function listCustomerCase(query) {
|
||||||
|
return request({
|
||||||
|
url: '/custom/customerCase/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询客户案例管理详细
|
||||||
|
export function getCustomerCase(id) {
|
||||||
|
return request({
|
||||||
|
url: '/custom/customerCase/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增客户案例管理
|
||||||
|
export function addCustomerCase(data) {
|
||||||
|
return request({
|
||||||
|
url: '/custom/customerCase',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改客户案例管理
|
||||||
|
export function updateCustomerCase(data) {
|
||||||
|
return request({
|
||||||
|
url: '/custom/customerCase',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除客户案例管理
|
||||||
|
export function delCustomerCase(id) {
|
||||||
|
return request({
|
||||||
|
url: '/custom/customerCase/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出客户案例管理
|
||||||
|
export function exportCustomerCase(query) {
|
||||||
|
return request({
|
||||||
|
url: '/custom/customerCase/export',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据案例ID查询对应文件列表
|
||||||
|
export function getFileListByCaseId(caseId) {
|
||||||
|
return request({
|
||||||
|
url: '/custom/customerCase/getFileListByCaseId',
|
||||||
|
method: 'get',
|
||||||
|
params: {"caseId": caseId}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 上传案例文件
|
||||||
|
export function uploadCseFile(data) {
|
||||||
|
return request({
|
||||||
|
url: '/custom/customerCase/uploadCseFile',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载案例文件
|
||||||
|
export function downCaseFile(data) {
|
||||||
|
return request({
|
||||||
|
url: '/custom/customerCase/downCaseFile',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -61,4 +61,14 @@ export function download(fileName) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 生成健康体征报告
|
||||||
|
export function generateHealthyReport(healthyDetail) {
|
||||||
|
return request({
|
||||||
|
url: '/custom/healthy/generateHealthyReport',
|
||||||
|
method: 'post',
|
||||||
|
data: healthyDetail
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import request from "@/utils/request";
|
|||||||
|
|
||||||
export function addRecipesApi(data) {
|
export function addRecipesApi(data) {
|
||||||
return request({
|
return request({
|
||||||
url: "/custom/recipes/",
|
url: "/custom/recipes",
|
||||||
method: "post",
|
method: "post",
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||||||
// 查询订单服务暂停列表
|
// 查询订单服务暂停列表
|
||||||
export function listPause(query) {
|
export function listPause(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/orderPause/pause/list',
|
url: '/recipes/pause/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
@ -12,7 +12,7 @@ export function listPause(query) {
|
|||||||
// 查询订单服务暂停详细
|
// 查询订单服务暂停详细
|
||||||
export function getPause(id) {
|
export function getPause(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/orderPause/pause/' + id,
|
url: '/recipes/pause/' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -20,7 +20,7 @@ export function getPause(id) {
|
|||||||
// 新增订单服务暂停
|
// 新增订单服务暂停
|
||||||
export function addPause(data) {
|
export function addPause(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/orderPause/pause',
|
url: '/recipes/pause',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@ -29,7 +29,7 @@ export function addPause(data) {
|
|||||||
// 修改订单服务暂停
|
// 修改订单服务暂停
|
||||||
export function updatePause(data) {
|
export function updatePause(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/orderPause/pause',
|
url: '/recipes/pause',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@ -38,7 +38,7 @@ export function updatePause(data) {
|
|||||||
// 删除订单服务暂停
|
// 删除订单服务暂停
|
||||||
export function delPause(id) {
|
export function delPause(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/orderPause/pause/' + id,
|
url: '/recipes/pause/' + id,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -46,7 +46,7 @@ export function delPause(id) {
|
|||||||
// 导出订单服务暂停
|
// 导出订单服务暂停
|
||||||
export function exportPause(query) {
|
export function exportPause(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/orderPause/pause/export',
|
url: '/recipes/pause/export',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
@ -1,36 +1,43 @@
|
|||||||
import request from '@/utils/request'
|
import request from "@/utils/request";
|
||||||
|
|
||||||
// 查询食谱计划列表
|
// 查询食谱计划列表
|
||||||
export function listRecipesPlan(query) {
|
export function listRecipesPlan(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/recipes/recipesPlan/list',
|
url: "/recipes/recipesPlan/list",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询食谱计划详细
|
// 查询食谱计划详细
|
||||||
export function getRecipesPlan(id) {
|
export function getRecipesPlan(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/recipes/recipesPlan/' + id,
|
url: "/recipes/recipesPlan/" + id,
|
||||||
method: 'get'
|
method: "get"
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改食谱计划
|
// 修改食谱计划
|
||||||
export function updateRecipesPlan(data) {
|
export function updateRecipesPlan(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/recipes/recipesPlan',
|
url: "/recipes/recipesPlan",
|
||||||
method: 'put',
|
method: "put",
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出食谱计划
|
// 导出食谱计划
|
||||||
export function exportRecipesPlan(query) {
|
export function exportRecipesPlan(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/recipes/recipesPlan/export',
|
url: "/recipes/recipesPlan/export",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function listRecipesPlanByCusId(id) {
|
||||||
|
return request({
|
||||||
|
url: "/recipes/recipesPlan/list/" + id,
|
||||||
|
method: "get"
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
41
stdiet-ui/src/api/custom/recipesShow.js
Normal file
41
stdiet-ui/src/api/custom/recipesShow.js
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
export function getRecipesPlans(id) {
|
||||||
|
return request({
|
||||||
|
url: "/wap/recipes/plans/" + id,
|
||||||
|
method: "get",
|
||||||
|
headers: {
|
||||||
|
isToken: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getHealthyInfo(id) {
|
||||||
|
return request({
|
||||||
|
url: "/wap/healthyInfo/" + id,
|
||||||
|
method: "get",
|
||||||
|
headers: {
|
||||||
|
isToken: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRecipesMenuInfoApi(id) {
|
||||||
|
return request({
|
||||||
|
url: "/wap/recipes/menu/" + id,
|
||||||
|
method: "get",
|
||||||
|
headers: {
|
||||||
|
isToken: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDicts(id) {
|
||||||
|
return request({
|
||||||
|
url: "/wap/dict/" + id,
|
||||||
|
method: "get",
|
||||||
|
headers: {
|
||||||
|
isToken: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
39
stdiet-ui/src/api/custom/recipesTemplate.js
Normal file
39
stdiet-ui/src/api/custom/recipesTemplate.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
export function listRecipesTemplate(query) {
|
||||||
|
return request({
|
||||||
|
url: "/recipes/template/list",
|
||||||
|
method: "get",
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRecipesTemplateDetail(id) {
|
||||||
|
return request({
|
||||||
|
url: "/recipes/template/" + id,
|
||||||
|
method: "get"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addRecipesTemplate(data) {
|
||||||
|
return request({
|
||||||
|
url: "/recipes/template/add",
|
||||||
|
method: "post",
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateRecipesTemplate(data) {
|
||||||
|
return request({
|
||||||
|
url: "/recipes/template/update",
|
||||||
|
method: "put",
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteRecipesTemplate(id) {
|
||||||
|
return request({
|
||||||
|
url: "/recipes/template/delete/" + id,
|
||||||
|
method: "delete"
|
||||||
|
});
|
||||||
|
}
|
@ -1,61 +1,61 @@
|
|||||||
import request from '@/utils/request'
|
import request from "@/utils/request";
|
||||||
|
|
||||||
// 查询字典数据列表
|
// 查询字典数据列表
|
||||||
export function listData(query) {
|
export function listData(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/data/list',
|
url: "/system/dict/data/list",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询字典数据详细
|
// 查询字典数据详细
|
||||||
export function getData(dictCode) {
|
export function getData(dictCode) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/data/' + dictCode,
|
url: "/system/dict/data/" + dictCode,
|
||||||
method: 'get'
|
method: "get"
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据字典类型查询字典数据信息
|
// 根据字典类型查询字典数据信息
|
||||||
export function getDicts(dictType) {
|
export function getDicts(dictType) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/data/type/' + dictType,
|
url: "/system/dict/data/type/" + dictType,
|
||||||
method: 'get'
|
method: "get"
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增字典数据
|
// 新增字典数据
|
||||||
export function addData(data) {
|
export function addData(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/data',
|
url: "/system/dict/data",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改字典数据
|
// 修改字典数据
|
||||||
export function updateData(data) {
|
export function updateData(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/data',
|
url: "/system/dict/data",
|
||||||
method: 'put',
|
method: "put",
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除字典数据
|
// 删除字典数据
|
||||||
export function delData(dictCode) {
|
export function delData(dictCode) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/data/' + dictCode,
|
url: "/system/dict/data/" + dictCode,
|
||||||
method: 'delete'
|
method: "delete"
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出字典数据
|
// 导出字典数据
|
||||||
export function exportData(query) {
|
export function exportData(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/data/export',
|
url: "/system/dict/data/export",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
155
stdiet-ui/src/components/BodySignView/index.vue
Normal file
155
stdiet-ui/src/components/BodySignView/index.vue
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
<template>
|
||||||
|
<div class="body_sign_view_wrapper">
|
||||||
|
<div>
|
||||||
|
<h2>{{ this.data.name }}</h2>
|
||||||
|
<!-- <el-button
|
||||||
|
v-if="dev"
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
class="remark_btn"
|
||||||
|
@click="handleOnRemark"
|
||||||
|
>修改备注</el-button
|
||||||
|
> -->
|
||||||
|
<div class="msg-info" v-for="(info, idx) in basicInfo" :key="idx">
|
||||||
|
<text-info
|
||||||
|
v-for="con in info"
|
||||||
|
:title="con.title"
|
||||||
|
:key="con.title"
|
||||||
|
:value="data[con.value]"
|
||||||
|
extraclass="text-info-extra"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 备注弹窗 -->
|
||||||
|
<el-dialog title="修改备注" :visible.sync="open" width="480px">
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
v-model="data.remark"
|
||||||
|
rows="6"
|
||||||
|
placeholder="请输入备注信息"
|
||||||
|
maxlength="300"
|
||||||
|
show-word-limit
|
||||||
|
/>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submit">确 定</el-button>
|
||||||
|
<el-button @click="onClosed">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import TextInfo from "@/components/TextInfo";
|
||||||
|
import { updateHealthy } from "@/api/custom/healthy";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "BodySignView",
|
||||||
|
props: {
|
||||||
|
data: {
|
||||||
|
type: Object,
|
||||||
|
default: {},
|
||||||
|
},
|
||||||
|
dev: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
"text-info": TextInfo,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
const basicInfo = [
|
||||||
|
[
|
||||||
|
{ title: "性别", value: "sex" },
|
||||||
|
{ title: "年龄", value: "age" },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ title: "电话", value: "phone" },
|
||||||
|
{ title: "地域", value: "position" },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ title: "身高", value: "tall" },
|
||||||
|
{ title: "体重", value: "weight" },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ title: "工作职业", value: "vocation" },
|
||||||
|
{ title: "上夜班", value: "night" },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ title: "熬夜失眠", value: "staylate" },
|
||||||
|
{ title: "运动情况", value: "walk" },
|
||||||
|
],
|
||||||
|
|
||||||
|
[
|
||||||
|
{ title: "浑身乏力", value: "weakness" },
|
||||||
|
{ title: "经常运动", value: "motion" },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ title: "睡觉时间", value: "sleepTime" },
|
||||||
|
{ title: "起床时间", value: "getupTime" },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ title: "饮食方式", value: "makeFoodType" },
|
||||||
|
{ title: "饮食特点", value: "makeFoodTaste" },
|
||||||
|
],
|
||||||
|
[{ title: "便秘", value: "constipation" }],
|
||||||
|
[{ title: "饮食备注", value: "remarks" }],
|
||||||
|
[{ title: "减脂反弹", value: "rebound" }],
|
||||||
|
[{ title: "意识到生活习惯是减脂关键", value: "crux" }],
|
||||||
|
[{ title: "减脂遇到的困难", value: "difficulty" }],
|
||||||
|
[{ title: "湿气数据", value: "moistureDate" }],
|
||||||
|
[{ title: "气血数据", value: "bloodData" }],
|
||||||
|
[{ title: "病史", value: "signStr" }],
|
||||||
|
[{ title: "忌口或过敏源", value: "dishesIngredientId" }],
|
||||||
|
[{ title: "方便沟通时间", value: "connectTime" }],
|
||||||
|
];
|
||||||
|
if (this.dev) {
|
||||||
|
basicInfo.splice(3, 0, [{ title: "基础代谢BMR", value: "basicBMR" }]);
|
||||||
|
basicInfo.splice(4, 0, [
|
||||||
|
{ title: "不运动总热量", value: "notSportHeat" },
|
||||||
|
]);
|
||||||
|
basicInfo.splice(basicInfo.length, 0, [
|
||||||
|
{ title: "备注", value: "remark" },
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
basicInfo,
|
||||||
|
open: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleOnRemark() {
|
||||||
|
this.open = true;
|
||||||
|
},
|
||||||
|
onClosed() {
|
||||||
|
this.open = false;
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
const { id, remark } = this.data;
|
||||||
|
updateHealthy({ id, remark }).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.body_sign_view_wrapper {
|
||||||
|
.remark_btn {
|
||||||
|
position: absolute;
|
||||||
|
top: 36px;
|
||||||
|
right: 16px;
|
||||||
|
}
|
||||||
|
.msg-info {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
|
||||||
|
.text-info-extra {
|
||||||
|
margin-bottom: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -50,21 +50,27 @@
|
|||||||
width="200"
|
width="200"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column label="合同地址" align="center" prop="path">
|
||||||
label="合同地址"
|
|
||||||
align="center"
|
|
||||||
prop="path"
|
|
||||||
width="80"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
|
style="margin-right: 8px"
|
||||||
icon="el-icon-copy-document"
|
icon="el-icon-copy-document"
|
||||||
@click="handleCopy(scope.row.path)"
|
@click="handleCopy(scope.row.path)"
|
||||||
class="copyBtn"
|
class="copyBtn"
|
||||||
:data-clipboard-text="copyValue"
|
:data-clipboard-text="copyValue"
|
||||||
>复制
|
>复制
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-popover placement="top" trigger="click">
|
||||||
|
<VueQr :text="copyValue" :logoSrc="logo" />
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
icon="el-icon-picture-outline"
|
||||||
|
type="text"
|
||||||
|
@click="handleCopy(scope.row.path)"
|
||||||
|
>二维码</el-button
|
||||||
|
>
|
||||||
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="180">
|
<el-table-column label="操作" align="center" width="180">
|
||||||
@ -108,15 +114,18 @@ import { delContract, listContract } from "@/api/custom/contract";
|
|||||||
import ContractDetail from "@/components/ContractDetail";
|
import ContractDetail from "@/components/ContractDetail";
|
||||||
import Clipboard from "clipboard";
|
import Clipboard from "clipboard";
|
||||||
import ContractAdd from "@/components/ContractAdd";
|
import ContractAdd from "@/components/ContractAdd";
|
||||||
|
import VueQr from "vue-qr";
|
||||||
|
const logo = require("@/assets/logo/logo_b.png");
|
||||||
export default {
|
export default {
|
||||||
name: "CustomerContractDrawer",
|
name: "CustomerContractDrawer",
|
||||||
components: {
|
components: {
|
||||||
"contract-detail": ContractDetail,
|
"contract-detail": ContractDetail,
|
||||||
"add-contract": ContractAdd,
|
"add-contract": ContractAdd,
|
||||||
|
VueQr,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
logo,
|
||||||
visible: false,
|
visible: false,
|
||||||
title: "",
|
title: "",
|
||||||
data: undefined,
|
data: undefined,
|
||||||
|
174
stdiet-ui/src/components/Customer/SelectCustomer.vue
Normal file
174
stdiet-ui/src/components/Customer/SelectCustomer.vue
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 选择用户对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" @closed="cancel" width="480px" append-to-body>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="60px" style="margin-top: -20px">
|
||||||
|
<el-form-item label="名字" prop="name">
|
||||||
|
<el-input
|
||||||
|
v-model.trim="queryParams.name"
|
||||||
|
placeholder="请输入名字"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button
|
||||||
|
type="cyan"
|
||||||
|
icon="el-icon-search"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<!--<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleSelect"
|
||||||
|
>选择当前勾选用户</el-button>
|
||||||
|
</el-col>-->
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="customerCenterList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
ref="customerTable"
|
||||||
|
>
|
||||||
|
<!-- <el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
width="166"
|
||||||
|
/>-->
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="客户姓名" align="center" prop="name" />
|
||||||
|
<el-table-column label="手机号" align="center" prop="phone" />
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
:layout="'total, sizes, prev, next'"
|
||||||
|
:pageSizes="[5]"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleSelect"
|
||||||
|
>确定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
listCustomer,
|
||||||
|
} from "@/api/custom/customer";
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "selectCustomer",
|
||||||
|
components: {
|
||||||
|
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 选择名字数组
|
||||||
|
names:[],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 客户档案表格数据
|
||||||
|
customerCenterList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 5,
|
||||||
|
name: null,
|
||||||
|
phone: null
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showDialog(title) {
|
||||||
|
this.title = title ? title : "选择客户";
|
||||||
|
this.open = true;
|
||||||
|
},
|
||||||
|
/** 查询客户档案列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listCustomer(this.queryParams).then((response) => {
|
||||||
|
this.customerCenterList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.$refs.customerTable.clearSelection();
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map((item) => item.id);
|
||||||
|
this.names = selection.map((item) => item.name);
|
||||||
|
this.single = selection.length !== 1;
|
||||||
|
this.multiple = !selection.length;
|
||||||
|
},
|
||||||
|
/** 选择用户操作 */
|
||||||
|
handleSelect() {
|
||||||
|
const id = this.ids[0];
|
||||||
|
const name = this.names[0];
|
||||||
|
this.cancel();
|
||||||
|
this.$emit('dealCustomerId', id, name);
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
73
stdiet-ui/src/components/FileDownload/MuchFileDown.vue
Normal file
73
stdiet-ui/src/components/FileDownload/MuchFileDown.vue
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 多文件下载对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" @closed="cancel" width="600px" append-to-body>
|
||||||
|
<div class="app-container">
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="fileList">
|
||||||
|
<el-table-column label="文件名" align="center" prop="fileName" />
|
||||||
|
<el-table-column label="上传时间" align="center" prop="createTime" />
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-download"
|
||||||
|
@click=""
|
||||||
|
>下载</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { downCaseFile } from "@/api/custom/customerCase";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "MuchFileDown",
|
||||||
|
components: {
|
||||||
|
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
//案例id
|
||||||
|
caseId: null,
|
||||||
|
//文件列表
|
||||||
|
fileList: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showDialog(title, fileList) {
|
||||||
|
this.title = title ? title : "文件列表";
|
||||||
|
this.fileList = fileList;
|
||||||
|
this.loading = false;
|
||||||
|
this.open = true;
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.caseId = null;
|
||||||
|
this.fileList = [];
|
||||||
|
},
|
||||||
|
downloadFile(file){
|
||||||
|
downCaseFile(file);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
126
stdiet-ui/src/components/FileUpload/DragUpload.vue
Normal file
126
stdiet-ui/src/components/FileUpload/DragUpload.vue
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<template>
|
||||||
|
<el-upload class="upload-demo"
|
||||||
|
ref="upload"
|
||||||
|
drag
|
||||||
|
:headers="upload.headers"
|
||||||
|
:action="upload.url"
|
||||||
|
:limit="upload.limit"
|
||||||
|
:disabled="upload.isUploading"
|
||||||
|
:file-list="upload.fileList"
|
||||||
|
:multiple="upload.multiple"
|
||||||
|
:on-change="handleFileChange"
|
||||||
|
:on-exceed="handleFileexceed"
|
||||||
|
:on-progress="handleFileUploadProgress"
|
||||||
|
:on-success="handleFileSuccess"
|
||||||
|
:on-error="handleFileFail"
|
||||||
|
:data="upload.data"
|
||||||
|
:auto-upload="false">
|
||||||
|
<i class="el-icon-upload"></i>
|
||||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
|
<div class="el-upload__tip" slot="tip">每个案例最多上传5个文件,且每个文件不超过50M</div>
|
||||||
|
</el-upload>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getToken } from '@/utils/auth'
|
||||||
|
export default {
|
||||||
|
name: "DragUpload",
|
||||||
|
components: {
|
||||||
|
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
upload: {
|
||||||
|
// 是否禁用上传
|
||||||
|
isUploading: false,
|
||||||
|
// 上传的地址
|
||||||
|
url: process.env.VUE_APP_BASE_API + "/custom/customerCase/uploadCaseFile",
|
||||||
|
// 设置上传的请求头部
|
||||||
|
headers: {Authorization: 'Bearer ' + getToken()},
|
||||||
|
// 其他需要携带的数据
|
||||||
|
data:{},
|
||||||
|
//文件列表
|
||||||
|
fileList:[],
|
||||||
|
//同时上传文件上限
|
||||||
|
limit: 5,
|
||||||
|
//每个文件大小
|
||||||
|
fileSize: 1024 * 1024 * 50,
|
||||||
|
//是否支持同时选择多张
|
||||||
|
multiple: true
|
||||||
|
},
|
||||||
|
uploadResult:{
|
||||||
|
fileUrl:[],
|
||||||
|
fileName:[]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
uploadFile(){
|
||||||
|
if(this.upload.fileList.length > 0 && this.uploadResult.fileUrl.length != this.upload.fileList.length){
|
||||||
|
this.$refs.upload.submit();
|
||||||
|
}else{
|
||||||
|
this.$emit('callbackMethod', this.uploadResult);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
uploadReset(){
|
||||||
|
this.upload.fileList = [];
|
||||||
|
this.uploadResult["fileUrl"] = [];
|
||||||
|
this.uploadResult["fileName"] = [];
|
||||||
|
},
|
||||||
|
//监控上传文件列表
|
||||||
|
handleFileChange(file, fileList) {
|
||||||
|
let sizeFlag = file.size > this.upload.fileSize;
|
||||||
|
if (sizeFlag) {
|
||||||
|
this.$message({
|
||||||
|
message: "当前文件过大",
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
fileList.pop();
|
||||||
|
}
|
||||||
|
this.upload.fileList = fileList;
|
||||||
|
},
|
||||||
|
// 文件数量超过限度
|
||||||
|
handleFileexceed(file, fileList){
|
||||||
|
this.$message({
|
||||||
|
message: "最多可上传"+ this.upload.limit +"份文件",
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 文件上传中处理
|
||||||
|
handleFileUploadProgress(event, file, fileList) {
|
||||||
|
//this.upload.isUploading = true;
|
||||||
|
},
|
||||||
|
// 文件上传成功处理
|
||||||
|
handleFileSuccess(response, file, fileList) {
|
||||||
|
if(response != null && response.code === 200){
|
||||||
|
this.uploadResult.fileUrl.push(response.fileUrl);
|
||||||
|
this.uploadResult.fileName.push(response.fileName);
|
||||||
|
if(this.uploadResult.fileUrl.length === this.upload.fileList.length){
|
||||||
|
//文件全部上传成功,则调用回调方法
|
||||||
|
this.$emit('callbackMethod', this.uploadResult);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.upload.fileList = fileList.pop();
|
||||||
|
this.$message.error('文件上传失败,请检查文件格式');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 文件上传失败处理
|
||||||
|
handleFileFail(err, file, fileList){
|
||||||
|
this.$message.error('文件上传失败,请检查文件格式');
|
||||||
|
this.upload.fileList = fileList.pop();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -1,7 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="health_view_wrapper">
|
||||||
<div>
|
<div>
|
||||||
<h2>{{ this.data.name }}</h2>
|
<h2>{{ this.data.name }}</h2>
|
||||||
|
<el-button
|
||||||
|
v-if="dev"
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
class="remark_btn"
|
||||||
|
@click="handleOnRemark"
|
||||||
|
>修改备注</el-button
|
||||||
|
>
|
||||||
<div class="msg-info" v-for="(info, idx) in basicInfo" :key="idx">
|
<div class="msg-info" v-for="(info, idx) in basicInfo" :key="idx">
|
||||||
<text-info
|
<text-info
|
||||||
v-for="con in info"
|
v-for="con in info"
|
||||||
@ -28,20 +36,45 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
|
|
||||||
|
<!-- 备注弹窗 -->
|
||||||
|
<el-dialog title="修改备注" :visible.sync="open" width="480px">
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
v-model="data.remark"
|
||||||
|
rows="6"
|
||||||
|
placeholder="请输入备注信息"
|
||||||
|
maxlength="300"
|
||||||
|
show-word-limit
|
||||||
|
/>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submit">确 定</el-button>
|
||||||
|
<el-button @click="onClosed">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import TextInfo from "@/components/TextInfo";
|
import TextInfo from "@/components/TextInfo";
|
||||||
|
import { updateHealthy } from "@/api/custom/healthy";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "HealthyView",
|
name: "HealthyView",
|
||||||
props: ["data"],
|
props: {
|
||||||
|
data: {
|
||||||
|
type: Object,
|
||||||
|
default: {},
|
||||||
|
},
|
||||||
|
dev: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
"text-info": TextInfo,
|
"text-info": TextInfo,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
const basicInfo = [
|
||||||
basicInfo: [
|
|
||||||
[
|
[
|
||||||
{ title: "调理项目", value: "conditioningProject" },
|
{ title: "调理项目", value: "conditioningProject" },
|
||||||
{ title: "电话", value: "phone" },
|
{ title: "电话", value: "phone" },
|
||||||
@ -55,8 +88,18 @@ export default {
|
|||||||
{ title: "体重", value: "weight" },
|
{ title: "体重", value: "weight" },
|
||||||
],
|
],
|
||||||
[{ title: "地域", value: "position" }],
|
[{ title: "地域", value: "position" }],
|
||||||
[{ title: "备注", value: "remark" }],
|
];
|
||||||
],
|
if (this.dev) {
|
||||||
|
basicInfo.splice(3, 0, [{ title: "基础代谢BMR", value: "basicBMR" }]);
|
||||||
|
basicInfo.splice(4, 0, [
|
||||||
|
{ title: "不运动总热量", value: "notSportHeat" },
|
||||||
|
]);
|
||||||
|
basicInfo.splice(6, 0, [{ title: "备注", value: "remark" }]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
open: false,
|
||||||
|
basicInfo,
|
||||||
healthyInvestigate: [
|
healthyInvestigate: [
|
||||||
{
|
{
|
||||||
title: "减脂经历评估",
|
title: "减脂经历评估",
|
||||||
@ -180,9 +223,33 @@ export default {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
handleOnRemark() {
|
||||||
|
this.open = true;
|
||||||
|
},
|
||||||
|
onClosed() {
|
||||||
|
this.open = false;
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
const { id, remark } = this.data;
|
||||||
|
updateHealthy({ id, remark }).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss">
|
<style lang="scss" scoped>
|
||||||
|
.health_view_wrapper {
|
||||||
|
.remark_btn {
|
||||||
|
position: absolute;
|
||||||
|
top: 36px;
|
||||||
|
right: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.msg-info {
|
.msg-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
@ -191,4 +258,5 @@ export default {
|
|||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
@ -10,13 +10,31 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button icon="el-icon-share" size="small" title="点击复制链接" class="copyBtn" type="primary" :data-clipboard-text="copyValue" @click="handleCopy()">外食计算器</el-button>
|
<el-button
|
||||||
|
icon="el-icon-share"
|
||||||
|
size="small"
|
||||||
|
title="点击复制链接"
|
||||||
|
class="copyBtn"
|
||||||
|
type="primary"
|
||||||
|
:data-clipboard-text="copyValue"
|
||||||
|
@click="handleCopy()"
|
||||||
|
>外食计算器</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-popover :placement="bottom" trigger="click">
|
||||||
|
<VueQr :text="copyValue" :logoSrc="logo" />
|
||||||
|
<el-button slot="reference">二维码</el-button>
|
||||||
|
</el-popover>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table :data="foodHeatStatisticsList">
|
<el-table :data="foodHeatStatisticsList">
|
||||||
<el-table-column label="日期" align="center" prop="edibleDate" width="120">
|
<el-table-column
|
||||||
|
label="日期"
|
||||||
|
align="center"
|
||||||
|
prop="edibleDate"
|
||||||
|
width="120"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.edibleDate, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.edibleDate, "{y}-{m}-{d}") }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="食材" align="center" prop="ingredient" />
|
<!-- <el-table-column label="食材" align="center" prop="ingredient" />
|
||||||
@ -27,30 +45,41 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="质量(克)" align="center" prop="quantity" />-->
|
<el-table-column label="质量(克)" align="center" prop="quantity" />-->
|
||||||
|
|
||||||
<el-table-column label="可摄入量" align="center" prop="maxHeatValue" />
|
<el-table-column
|
||||||
|
label="可摄入量"
|
||||||
|
align="center"
|
||||||
|
prop="maxHeatValue"
|
||||||
|
/>
|
||||||
<el-table-column label="食材热量" align="center" prop="heatValue" />
|
<el-table-column label="食材热量" align="center" prop="heatValue" />
|
||||||
<el-table-column label="热量缺口" align="center" prop="heatGap" />
|
<el-table-column label="热量缺口" align="center" prop="heatGap" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@click="handleDetail(scope.row)"
|
@click="handleDetail(scope.row)"
|
||||||
v-hasPermi="['custom:foodHeatStatistics:query']"
|
v-hasPermi="['custom:foodHeatStatistics:query']"
|
||||||
>详情</el-button>
|
>详情</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleCalculate(scope.row)"
|
@click="handleCalculate(scope.row)"
|
||||||
>计算</el-button>
|
>计算</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleOnDeleteClick(scope.row)"
|
@click="handleOnDeleteClick(scope.row)"
|
||||||
v-hasPermi="['custom:foodHeatStatistics:remove']"
|
v-hasPermi="['custom:foodHeatStatistics:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -63,26 +92,40 @@
|
|||||||
@pagination="fetchHeatList"
|
@pagination="fetchHeatList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<heatStatisticsCalculate ref="heatStatisticsCalculateRef"></heatStatisticsCalculate>
|
<heatStatisticsCalculate
|
||||||
<heatStatisticsDetail ref="heatStatisticsDetailRef"></heatStatisticsDetail>
|
ref="heatStatisticsCalculateRef"
|
||||||
|
></heatStatisticsCalculate>
|
||||||
|
<heatStatisticsDetail
|
||||||
|
ref="heatStatisticsDetailRef"
|
||||||
|
></heatStatisticsDetail>
|
||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { listFoodHeatStatistics, getFoodHeatStatistics, delFoodHeatStatistics, addFoodHeatStatistics, updateFoodHeatStatistics, exportFoodHeatStatistics } from "@/api/custom/foodHeatStatistics";
|
import {
|
||||||
import Clipboard from 'clipboard';
|
listFoodHeatStatistics,
|
||||||
|
getFoodHeatStatistics,
|
||||||
|
delFoodHeatStatistics,
|
||||||
|
addFoodHeatStatistics,
|
||||||
|
updateFoodHeatStatistics,
|
||||||
|
exportFoodHeatStatistics,
|
||||||
|
} from "@/api/custom/foodHeatStatistics";
|
||||||
|
import Clipboard from "clipboard";
|
||||||
import HeatStatisticsCalculate from "@/components/HeatStatisticsCalculate";
|
import HeatStatisticsCalculate from "@/components/HeatStatisticsCalculate";
|
||||||
import HeatStatisticsDetail from "@/components/HeatStatisticsDetail";
|
import HeatStatisticsDetail from "@/components/HeatStatisticsDetail";
|
||||||
|
import VueQr from "vue-qr";
|
||||||
|
const logo = require("@/assets/logo/logo_b.png");
|
||||||
export default {
|
export default {
|
||||||
name: "HeatStatisticsDrawer",
|
name: "HeatStatisticsDrawer",
|
||||||
components: {
|
components: {
|
||||||
'heatStatisticsCalculate':HeatStatisticsCalculate,
|
heatStatisticsCalculate: HeatStatisticsCalculate,
|
||||||
'heatStatisticsDetail': HeatStatisticsDetail
|
heatStatisticsDetail: HeatStatisticsDetail,
|
||||||
|
VueQr,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
logo,
|
||||||
visible: false,
|
visible: false,
|
||||||
title: "",
|
title: "",
|
||||||
data: undefined,
|
data: undefined,
|
||||||
@ -94,7 +137,7 @@ export default {
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
copyValue: ""
|
copyValue: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -106,33 +149,31 @@ export default {
|
|||||||
}
|
}
|
||||||
this.title = `「${this.data.name}」热量统计列表`;
|
this.title = `「${this.data.name}」热量统计列表`;
|
||||||
this.queryParams.customerId = data.id;
|
this.queryParams.customerId = data.id;
|
||||||
|
this.copyValue =
|
||||||
|
window.location.origin.replace("manage", "sign") +
|
||||||
|
"/foodHeatCalculator/" +
|
||||||
|
this.data.encId;
|
||||||
this.fetchHeatList();
|
this.fetchHeatList();
|
||||||
},
|
},
|
||||||
fetchHeatList() {
|
fetchHeatList() {
|
||||||
listFoodHeatStatistics(this.queryParams).then(response => {
|
listFoodHeatStatistics(this.queryParams).then((response) => {
|
||||||
this.foodHeatStatisticsList = response.rows;
|
this.foodHeatStatisticsList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleAdd() {
|
handleAdd() {},
|
||||||
|
|
||||||
},
|
|
||||||
handleOnClosed() {
|
handleOnClosed() {
|
||||||
this.data = undefined;
|
this.data = undefined;
|
||||||
this.copyValue = "";
|
this.copyValue = "";
|
||||||
},
|
},
|
||||||
handleOnDeleteClick(data) {
|
handleOnDeleteClick(data) {
|
||||||
const ids = data.id || this.ids;
|
const ids = data.id || this.ids;
|
||||||
this.$confirm(
|
this.$confirm("是否确认删除该数据项?", "警告", {
|
||||||
'是否确认删除该数据项?',
|
|
||||||
"警告",
|
|
||||||
{
|
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}
|
})
|
||||||
)
|
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return delFoodHeatStatistics(ids);
|
return delFoodHeatStatistics(ids);
|
||||||
})
|
})
|
||||||
@ -143,11 +184,10 @@ export default {
|
|||||||
.catch(function () {});
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
handleCopy() {
|
handleCopy() {
|
||||||
this.copyValue = window.location.origin.replace('manage', 'sign') + "/foodHeatCalculator/"+this.data.encId;
|
new Clipboard(".copyBtn");
|
||||||
const btnCopy = new Clipboard('.copyBtn');
|
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '拷贝成功',
|
message: "拷贝成功",
|
||||||
type: 'success'
|
type: "success",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleCalculate(data) {
|
handleCalculate(data) {
|
||||||
@ -157,7 +197,7 @@ export default {
|
|||||||
},
|
},
|
||||||
handleDetail(data) {
|
handleDetail(data) {
|
||||||
this.$refs.heatStatisticsDetailRef.showDialog(data, this.data.name);
|
this.$refs.heatStatisticsDetailRef.showDialog(data, this.data.name);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="成交金额" prop="amount">
|
<el-form-item label="成交金额" prop="amount">
|
||||||
<el-input v-model="form.amount" placeholder="请输入金额" />
|
<el-input v-model.trim="form.amount" placeholder="请输入金额" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="成交金额" prop="amount">
|
<el-form-item label="成交金额" prop="amount">
|
||||||
<el-input v-model="form.amount" placeholder="请输入金额" />
|
<el-input v-model.trim="form.amount" placeholder="请输入金额" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user