Merge branch 'master' of gitee.com:darlk/ShengTangManage into develop
This commit is contained in:
@ -9,14 +9,11 @@ import com.stdiet.custom.domain.SysCustomer;
|
||||
import com.stdiet.custom.domain.SysCustomerHealthy;
|
||||
import com.stdiet.custom.domain.SysPhysicalSigns;
|
||||
import com.stdiet.custom.dto.request.CustomerInvestigateRequest;
|
||||
import com.stdiet.custom.service.ISysCustomerHealthyService;
|
||||
import com.stdiet.custom.service.ISysCustomerPhysicalSignsService;
|
||||
import com.stdiet.custom.service.ISysCustomerService;
|
||||
import com.stdiet.custom.service.ISysPhysicalSignsService;
|
||||
import com.stdiet.custom.dto.request.FoodHeatCalculatorRequest;
|
||||
import com.stdiet.custom.service.*;
|
||||
import com.stdiet.system.service.ISysDictTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -47,6 +44,9 @@ public class InvestigateController extends BaseController {
|
||||
@Autowired
|
||||
private ISysCustomerService sysCustomerService;
|
||||
|
||||
@Autowired
|
||||
private ISysFoodHeatStatisticsService sysFoodHeatStatisticsService;
|
||||
|
||||
/**
|
||||
* 建立客户信息档案
|
||||
*/
|
||||
@ -107,4 +107,13 @@ public class InvestigateController extends BaseController {
|
||||
return sysCustomerHealthyService.insertSysCustomerHealthy(sysCustomerHealthy);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户外食计算统计
|
||||
*/
|
||||
@PostMapping("/addFoodHeatStatistics")
|
||||
public AjaxResult addFoodHeatStatistics(@RequestBody FoodHeatCalculatorRequest foodHeatCalculatorRequest)
|
||||
{
|
||||
return toAjax(sysFoodHeatStatisticsService.addMuchFoodHeat(foodHeatCalculatorRequest));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ public class SysCustomerController extends BaseController {
|
||||
for (SysCustomer sysCus : list) {
|
||||
if (StringUtils.isNotEmpty(sysCus.getPhone())) {
|
||||
sysCus.setPhone(StringUtils.hiddenPhoneNumber(sysCus.getPhone()));
|
||||
sysCus.setEncId(sysCus.getId() != null ? AesUtils.encrypt(sysCus.getId()+"", null) : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -143,17 +144,17 @@ public class SysCustomerController extends BaseController {
|
||||
//查询健康评估信息
|
||||
SysCustomerHealthy sysCustomerHealthy = sysCustomerHealthyService.selectSysCustomerHealthyByCustomerId(id);
|
||||
if(sysCustomerHealthy != null){
|
||||
if (StringUtils.isNotEmpty(sysCustomerHealthy.getPhone())) {
|
||||
/* 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())) {
|
||||
/* if (StringUtils.isNotEmpty(sysCustomerPhysicalSigns.getPhone())) {
|
||||
sysCustomerPhysicalSigns.setPhone(StringUtils.hiddenPhoneNumber(sysCustomerPhysicalSigns.getPhone()));
|
||||
}
|
||||
}*/
|
||||
result.put("type", 1);
|
||||
}
|
||||
result.put(key, sysCustomerPhysicalSigns);
|
||||
|
@ -0,0 +1,114 @@
|
||||
package com.stdiet.web.controller.custom;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.stdiet.custom.domain.SysCustomerHeatStatistics;
|
||||
import com.stdiet.custom.service.ISysCustomerHeatStatisticsService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
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.common.utils.poi.ExcelUtil;
|
||||
import com.stdiet.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 外食热量统计Controller
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-02-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/foodHeatStatistics")
|
||||
public class SysFoodHeatStatisticsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysCustomerHeatStatisticsService sysCustomerHeatStatisticsService;
|
||||
|
||||
/**
|
||||
* 查询外食热量统计列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:foodHeatStatistics:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysCustomerHeatStatistics sysCustomerHeatStatistics)
|
||||
{
|
||||
startPage();
|
||||
List<SysCustomerHeatStatistics> list = sysCustomerHeatStatisticsService.selectSysCustomerHeatStatisticsList(sysCustomerHeatStatistics);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出外食热量统计列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:foodHeatStatistics:export')")
|
||||
@Log(title = "外食热量统计", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(SysCustomerHeatStatistics sysCustomerHeatStatistics)
|
||||
{
|
||||
List<SysCustomerHeatStatistics> list = sysCustomerHeatStatisticsService.selectSysCustomerHeatStatisticsList(sysCustomerHeatStatistics);
|
||||
ExcelUtil<SysCustomerHeatStatistics> util = new ExcelUtil<SysCustomerHeatStatistics>(SysCustomerHeatStatistics.class);
|
||||
return util.exportExcel(list, "customerHeatstatistics");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取外食热量统计详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:foodHeatStatistics:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(sysCustomerHeatStatisticsService.selectSysCustomerHeatStatisticsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增外食热量统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:foodHeatStatistics:add')")
|
||||
@Log(title = "外食热量统计", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysCustomerHeatStatistics sysCustomerHeatStatistics)
|
||||
{
|
||||
return toAjax(sysCustomerHeatStatisticsService.insertSysCustomerHeatStatistics(sysCustomerHeatStatistics));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改外食热量统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:foodHeatStatistics:edit')")
|
||||
@Log(title = "外食热量统计", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysCustomerHeatStatistics sysCustomerHeatStatistics)
|
||||
{
|
||||
return toAjax(sysCustomerHeatStatisticsService.updateSysCustomerHeatStatistics(sysCustomerHeatStatistics));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除外食热量统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:foodHeatStatistics:remove')")
|
||||
@Log(title = "外食热量统计", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(sysCustomerHeatStatisticsService.deleteSysCustomerHeatStatisticsByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改食材热量并计算
|
||||
*/
|
||||
@Log(title = "修改食材热量并计算", businessType = BusinessType.UPDATE)
|
||||
@RequestMapping("/addFoodHeatData")
|
||||
public AjaxResult addFoodHeatData(@RequestBody SysCustomerHeatStatistics sysCustomerHeatStatistics)
|
||||
{
|
||||
return toAjax(sysCustomerHeatStatisticsService.calculateCustomerHeat(sysCustomerHeatStatistics));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user