From dad428d90c85381df5c9c0d6f914fdfae7d8d350 Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Thu, 28 Jan 2021 15:14:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/SysCustomerController.java | 104 +- .../com/stdiet/custom/domain/SysOrder.java | 10 + .../mapper/custom/SysCustomerMapper.xml | 1 + .../mapper/custom/SysOrderMapper.xml | 9 +- .../custom/customer/createOrderDialog.vue | 607 +++++++ stdiet-ui/src/views/custom/customer/index.vue | 1116 +++++------- .../src/views/custom/customer/orderDrawer.vue | 155 ++ stdiet-ui/src/views/custom/dishes/index.vue | 26 +- stdiet-ui/src/views/custom/order/index.vue | 1548 ++++++++++------- .../custom/recipesPlan/bodySignDialog.vue | 126 ++ .../src/views/custom/recipesPlan/index.vue | 267 +-- .../views/custom/recipesPlan/orderDialog.vue | 110 ++ 12 files changed, 2557 insertions(+), 1522 deletions(-) create mode 100644 stdiet-ui/src/views/custom/customer/createOrderDialog.vue create mode 100644 stdiet-ui/src/views/custom/customer/orderDrawer.vue create mode 100644 stdiet-ui/src/views/custom/recipesPlan/bodySignDialog.vue create mode 100644 stdiet-ui/src/views/custom/recipesPlan/orderDialog.vue diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerController.java index 83a989f04..b9e78d464 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerController.java @@ -1,29 +1,21 @@ package com.stdiet.web.controller.custom; -import java.util.ArrayList; -import java.util.List; - -import com.stdiet.common.utils.StringUtils; -import com.stdiet.custom.domain.SysCustomerPhysicalSigns; -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 com.stdiet.custom.service.ISysCustomerPhysicalSignsService; -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.*; 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.SysCustomer; -import com.stdiet.custom.service.ISysCustomerService; -import com.stdiet.common.utils.poi.ExcelUtil; import com.stdiet.common.core.page.TableDataInfo; +import com.stdiet.common.enums.BusinessType; +import com.stdiet.common.utils.StringUtils; +import com.stdiet.common.utils.poi.ExcelUtil; +import com.stdiet.custom.domain.SysCustomer; +import com.stdiet.custom.domain.SysCustomerPhysicalSigns; +import com.stdiet.custom.service.ISysCustomerPhysicalSignsService; +import com.stdiet.custom.service.ISysCustomerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import java.util.List; /** * 客户体征信息Controller @@ -33,8 +25,7 @@ import com.stdiet.common.core.page.TableDataInfo; */ @RestController @RequestMapping("/custom/customer") -public class SysCustomerController extends BaseController -{ +public class SysCustomerController extends BaseController { @Autowired private ISysCustomerService sysCustomerService; @@ -46,13 +37,12 @@ public class SysCustomerController extends BaseController */ @PreAuthorize("@ss.hasPermi('custom:customer:list')") @GetMapping("/list") - public TableDataInfo list(SysCustomerPhysicalSigns sysCustomerPhysicalSigns) - { + public TableDataInfo list(SysCustomer sysCustomer) { startPage(); - List list = sysCustomerPhysicalSignsService.selectSysCustomerAndSignList(sysCustomerPhysicalSigns); - if(list != null && list.size() > 0){ - for(SysCustomerPhysicalSigns sysCus : list){ - if(StringUtils.isNotEmpty(sysCus.getPhone())){ + List list = sysCustomerService.selectSysCustomerList(sysCustomer); + if (list != null && list.size() > 0) { + for (SysCustomer sysCus : list) { + if (StringUtils.isNotEmpty(sysCus.getPhone())) { sysCus.setPhone(StringUtils.hiddenPhoneNumber(sysCus.getPhone())); } } @@ -64,32 +54,12 @@ public class SysCustomerController extends BaseController * 导出客户信息列表 */ @PreAuthorize("@ss.hasPermi('custom:customer:export')") - @Log(title = "客户体征", businessType = BusinessType.EXPORT) + @Log(title = "客户档案", businessType = BusinessType.EXPORT) @GetMapping("/export") - public AjaxResult export(SysCustomerPhysicalSigns sysCustomerPhysicalSigns) throws Exception - { - List list = sysCustomerPhysicalSignsService.selectSysCustomerAndSignList(sysCustomerPhysicalSigns); - List responsesList = new ArrayList<>(); - CustomerListResponse customerListResponse = null; - for(SysCustomerPhysicalSigns sysCus : list){ - customerListResponse = ObjectUtils.getObjectByObject(sysCus, CustomerListResponse.class); - customerListResponse.setCreateTime(sysCus.getCreateTime()); - if(StringUtils.isNotEmpty(sysCus.getPhone())){ - customerListResponse.setPhone(StringUtils.hiddenPhoneNumber(sysCus.getPhone())); - } - StringBuilder signStr = new StringBuilder(); - if(sysCus.getSignList() != null && sysCus.getSignList().size() > 0){ - int i = 0; - for (SysPhysicalSigns s : sysCus.getSignList()) { - signStr.append((i != 0 ? "," : "") + s.getName()); - i++; - } - } - customerListResponse.setPhysicalSignsId(signStr.toString()); - responsesList.add(customerListResponse); - } - ExcelUtil util = new ExcelUtil(CustomerListResponse.class); - return util.exportExcel(responsesList, "客户体征数据"); + public AjaxResult export(SysCustomer sysCustomer) throws Exception { + List list = sysCustomerService.selectSysCustomerList(sysCustomer); + ExcelUtil util = new ExcelUtil(SysCustomer.class); + return util.exportExcel(list, "customerCenter"); } /** @@ -97,42 +67,38 @@ public class SysCustomerController extends BaseController */ @PreAuthorize("@ss.hasPermi('custom:customer:query')") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return AjaxResult.success(sysCustomerPhysicalSignsService.selectSysCustomerPhysicalSignsById(id)); + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(sysCustomerService.selectSysCustomerById(id)); } /** * 新增客户信息 */ @PreAuthorize("@ss.hasPermi('custom:customer:add')") - @Log(title = "客户体征", businessType = BusinessType.INSERT) + @Log(title = "客户档案", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody CustomerInvestigateRequest customerInvestigateRequest) throws Exception - { - return sysCustomerPhysicalSignsService.addOrupdateCustomerAndSign(customerInvestigateRequest); + public AjaxResult add(@RequestBody SysCustomer sysCustomer) throws Exception { + return toAjax(sysCustomerService.insertSysCustomer(sysCustomer)); } /** * 修改客户信息 */ @PreAuthorize("@ss.hasPermi('custom:customer:edit')") - @Log(title = "客户体征", businessType = BusinessType.UPDATE) + @Log(title = "客户档案", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody CustomerInvestigateRequest customerInvestigateRequest) throws Exception - { - return sysCustomerPhysicalSignsService.addOrupdateCustomerAndSign(customerInvestigateRequest); + public AjaxResult edit(@RequestBody SysCustomer sysCustomer) throws Exception { + return toAjax(sysCustomerService.updateSysCustomer(sysCustomer)); } /** * 删除客户信息 */ @PreAuthorize("@ss.hasPermi('custom:customer:remove')") - @Log(title = "客户体征", businessType = BusinessType.DELETE) + @Log(title = "客户档案", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { - return toAjax(sysCustomerPhysicalSignsService.deleteSysCustomerPhysicalSignsByIds(ids)); + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(sysCustomerService.deleteSysCustomerByIds(ids)); } /** @@ -142,7 +108,7 @@ public class SysCustomerController extends BaseController @PreAuthorize("@ss.hasPermi('custom:customer:query')") public AjaxResult getCustomerAndSignByPhone(@RequestParam("phone")String phone) { - SysCustomerPhysicalSigns sysCustomer = null; + SysCustomerPhysicalSigns sysCustomer = null; if(StringUtils.isNotEmpty(phone)){ sysCustomer = sysCustomerPhysicalSignsService.selectSysCustomerAndSignByPhone(phone); } diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysOrder.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysOrder.java index b8305ad9d..e81fa571a 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysOrder.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysOrder.java @@ -25,6 +25,8 @@ public class SysOrder extends BaseEntity { @Excel(name = "编号") private Long orderId; + private Long cusId; + /** * 客户姓名 */ @@ -224,6 +226,14 @@ public class SysOrder extends BaseEntity { * */ private List orderPauseList; + public Long getCusId() { + return cusId; + } + + public void setCusId(Long cusId) { + this.cusId = cusId; + } + @JsonFormat(pattern = "yyyy-MM-dd") public Date getStartTime() { return startTime; diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml index 78d64845e..36bf00620 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml @@ -35,6 +35,7 @@ where del_flag = 0 and name like concat('%', #{name}, '%') and phone like concat('%', #{phone}, '%') + order by create_time desc