食谱计划页面、逻辑优化

This commit is contained in:
xiezhijun
2021-01-18 19:12:55 +08:00
parent 072b0a1f36
commit 5588aa2e4c
22 changed files with 1122 additions and 80 deletions

View File

@ -7,18 +7,13 @@ import com.stdiet.common.utils.StringUtils;
import com.stdiet.custom.domain.SysPhysicalSigns;
import com.stdiet.common.utils.bean.ObjectUtils;
import com.stdiet.custom.domain.SysRecipesPlan;
import com.stdiet.custom.dto.request.CustomerInvestigateRequest;
import com.stdiet.custom.dto.response.CustomerListResponse;
import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;
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 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;
@ -146,4 +141,19 @@ public class SysCustomerController extends BaseController
{
return toAjax(sysCustomerService.delCustomerAndSignById(ids));
}
/**
* 根据手机号查看用户体征
*/
@GetMapping("/getCustomerAndSignByPhone")
@PreAuthorize("@ss.hasPermi('custom:customer:query')")
public AjaxResult getCustomerAndSignByPhone(@RequestParam("phone")String phone)
{
SysCustomer sysCustomer = null;
if(StringUtils.isNotEmpty(phone)){
sysCustomer = sysCustomerService.selectSysCustomerAndSignByPhone(phone);
}
return AjaxResult.success(sysCustomer);
}
}

View File

@ -137,6 +137,45 @@ public class SysOrderController extends OrderBaseController {
return AjaxResult.success(sysOrderService.selectSysOrderById(orderId));
}
/**
* 获取销售订单详细信息(列出所有营养师、助理等名称)
*/
@PreAuthorize("@ss.hasPermi('custom:order:query')")
@GetMapping(value = "/getInfoDetail")
public AjaxResult getInfoDetail(@RequestParam("orderId") Long orderId) {
SysOrder order = sysOrderService.selectSysOrderById(orderId);
if(order != null){
List<SysUser> userList = userService.selectAllUser();
for(SysUser user : userList){
if (user.getUserId().equals(order.getPreSaleId())) {
order.setPreSale(user.getNickName());
}
if (user.getUserId().equals(order.getAfterSaleId())) {
order.setAfterSale(user.getNickName());
}
if (user.getUserId().equals(order.getNutritionistId())) {
order.setNutritionist(user.getNickName());
}
if (user.getUserId().equals(order.getNutriAssisId())) {
order.setNutriAssis(user.getNickName());
}
if (user.getUserId().equals(order.getOperatorId())) {
order.setOperator(user.getNickName());
}
if (user.getUserId().equals(order.getPlannerId())) {
order.setPlanner(user.getNickName());
}
if (user.getUserId().equals(order.getPlannerAssisId())) {
order.setPlannerAssis(user.getNickName());
}
if (user.getUserId().equals(order.getOperatorAssisId())) {
order.setOperatorAssis(user.getNickName());
}
}
}
return AjaxResult.success(order);
}
/**
* 新增销售订单
*/

View File

@ -3,14 +3,7 @@ package com.stdiet.web.controller.custom;
import java.util.List;
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 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;
@ -41,10 +34,31 @@ public class SysRecipesPlanController extends BaseController
public TableDataInfo list(SysRecipesPlan sysRecipesPlan)
{
startPage();
List<SysRecipesPlan> list = sysRecipesPlanService.selectSysRecipesPlanList(sysRecipesPlan);
List<SysRecipesPlan> list = sysRecipesPlanService.selectPlanListByCondition(sysRecipesPlan);
return getDataTable(list);
}
/**
* 获取食谱计划详细信息
*/
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(sysRecipesPlanService.selectSysRecipesPlanById(id));
}
/**
* 修改食谱计划
*/
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:edit')")
@Log(title = "食谱计划", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysRecipesPlan sysRecipesPlan)
{
return toAjax(sysRecipesPlanService.updateSysRecipesPlan(sysRecipesPlan));
}
/**
* 导出食谱计划列表
*/
@ -53,7 +67,7 @@ public class SysRecipesPlanController extends BaseController
@GetMapping("/export")
public AjaxResult export(SysRecipesPlan sysRecipesPlan)
{
List<SysRecipesPlan> list = sysRecipesPlanService.selectSysRecipesPlanList(sysRecipesPlan);
List<SysRecipesPlan> list = sysRecipesPlanService.selectPlanListByCondition(sysRecipesPlan);
ExcelUtil<SysRecipesPlan> util = new ExcelUtil<SysRecipesPlan>(SysRecipesPlan.class);
return util.exportExcel(list, "recipesPlan");
}