diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/common/CommonController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/common/CommonController.java index 4bfa9b404..f2636c7f5 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/common/CommonController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/common/CommonController.java @@ -78,6 +78,26 @@ public class CommonController { } } + /** + * 通用上传请求(无需登录认证) + */ + @PostMapping("/common/customerUploadFile") + public AjaxResult customerUploadFile(MultipartFile file) throws Exception { + try { + // 上传文件路径 + String filePath = RuoYiConfig.getUploadPath(); + // 上传并返回新文件名称 + String fileName = FileUploadUtils.upload(filePath, file); + String url = serverConfig.getUrl() + fileName; + AjaxResult ajax = AjaxResult.success(); + ajax.put("fileName", fileName); + ajax.put("url", url); + return ajax; + } catch (Exception e) { + return AjaxResult.error(e.getMessage()); + } + } + /** * 本地资源通用下载 */ diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/common/InvestigateController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/common/InvestigateController.java index 20fc13e2d..4651865cd 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/common/InvestigateController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/common/InvestigateController.java @@ -4,18 +4,22 @@ 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.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.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.List; /** - * 客户信息调查Controller + * 客户相关信息调查Controller * * @author xzj * @date 2020-12-31 @@ -25,7 +29,7 @@ import java.util.List; public class InvestigateController extends BaseController { @Autowired - private ISysCustomerService iSysCustomerService; + private ISysCustomerPhysicalSignsService sysCustomerPhysicalSignsService; @Autowired private ISysPhysicalSignsService iSysPhysicalSignsService; @@ -33,19 +37,17 @@ public class InvestigateController extends BaseController { @Autowired private ISysDictTypeService dictTypeService; + @Autowired + private ISysCustomerHealthyService sysCustomerHealthyService; + /** * 建立客户信息档案 */ @PostMapping("/customerInvestigate") public AjaxResult customerInvestigate(@RequestBody CustomerInvestigateRequest customerInvestigateRequest) throws Exception { - //验证是否已存在该手机号 - SysCustomer phoneCustomer = iSysCustomerService.getCustomerByPhone(customerInvestigateRequest.getPhone()); - if(phoneCustomer != null){ - return AjaxResult.error("该手机号已存在"); - } customerInvestigateRequest.setId(null); //只能添加,无法修改 - return AjaxResult.success(iSysCustomerService.addOrupdateCustomerAndSign(customerInvestigateRequest)); + return sysCustomerPhysicalSignsService.addOrupdateCustomerAndSign(customerInvestigateRequest); } /** @@ -68,6 +70,13 @@ public class InvestigateController extends BaseController { return AjaxResult.success(dictTypeService.selectDictDataByType(dictType)); } - + /** + * 新增客户健康 + */ + @PostMapping("/addCustomerHealthy") + public AjaxResult addCustomerHealthy(@RequestBody SysCustomerHealthy sysCustomerHealthy) + { + return sysCustomerHealthyService.insertOrUpdateSysCustomerHealthy(sysCustomerHealthy); + } } 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 494186207..83a989f04 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 @@ -4,12 +4,14 @@ 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; @@ -36,17 +38,20 @@ public class SysCustomerController extends BaseController @Autowired private ISysCustomerService sysCustomerService; + @Autowired + private ISysCustomerPhysicalSignsService sysCustomerPhysicalSignsService; + /** * 查询客户信息列表 */ @PreAuthorize("@ss.hasPermi('custom:customer:list')") @GetMapping("/list") - public TableDataInfo list(SysCustomer sysCustomer) + public TableDataInfo list(SysCustomerPhysicalSigns sysCustomerPhysicalSigns) { startPage(); - List list = sysCustomerService.selectSysCustomerAndSignList(sysCustomer); + List list = sysCustomerPhysicalSignsService.selectSysCustomerAndSignList(sysCustomerPhysicalSigns); if(list != null && list.size() > 0){ - for(SysCustomer sysCus : list){ + for(SysCustomerPhysicalSigns sysCus : list){ if(StringUtils.isNotEmpty(sysCus.getPhone())){ sysCus.setPhone(StringUtils.hiddenPhoneNumber(sysCus.getPhone())); } @@ -61,22 +66,21 @@ public class SysCustomerController extends BaseController @PreAuthorize("@ss.hasPermi('custom:customer:export')") @Log(title = "客户体征", businessType = BusinessType.EXPORT) @GetMapping("/export") - public AjaxResult export(SysCustomer sysCustomer) throws Exception + public AjaxResult export(SysCustomerPhysicalSigns sysCustomerPhysicalSigns) throws Exception { - List list = sysCustomerService.selectSysCustomerAndSignList(sysCustomer); + List list = sysCustomerPhysicalSignsService.selectSysCustomerAndSignList(sysCustomerPhysicalSigns); List responsesList = new ArrayList<>(); CustomerListResponse customerListResponse = null; - for (SysCustomer customer : list) { - customerListResponse = ObjectUtils.getObjectByObject(customer.getSign(), CustomerListResponse.class); - customerListResponse.setCreateTime(customer.getCreateTime()); - customerListResponse.setName(customer.getName()); - if(StringUtils.isNotEmpty(customer.getPhone())){ - customerListResponse.setPhone(StringUtils.hiddenPhoneNumber(customer.getPhone())); + 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(customer.getSign().getSignList() != null && customer.getSign().getSignList().size() > 0){ + if(sysCus.getSignList() != null && sysCus.getSignList().size() > 0){ int i = 0; - for (SysPhysicalSigns s : customer.getSign().getSignList()) { + for (SysPhysicalSigns s : sysCus.getSignList()) { signStr.append((i != 0 ? "," : "") + s.getName()); i++; } @@ -95,7 +99,7 @@ public class SysCustomerController extends BaseController @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { - return AjaxResult.success(sysCustomerService.getCustomerAndSignById(id)); + return AjaxResult.success(sysCustomerPhysicalSignsService.selectSysCustomerPhysicalSignsById(id)); } /** @@ -106,12 +110,7 @@ public class SysCustomerController extends BaseController @PostMapping public AjaxResult add(@RequestBody CustomerInvestigateRequest customerInvestigateRequest) throws Exception { - //验证是否已存在该手机号 - SysCustomer phoneCustomer = sysCustomerService.getCustomerByPhone(customerInvestigateRequest.getPhone()); - if(phoneCustomer != null){ - return AjaxResult.error("该手机号已存在"); - } - return toAjax(sysCustomerService.addOrupdateCustomerAndSign(customerInvestigateRequest)); + return sysCustomerPhysicalSignsService.addOrupdateCustomerAndSign(customerInvestigateRequest); } /** @@ -122,15 +121,7 @@ public class SysCustomerController extends BaseController @PutMapping public AjaxResult edit(@RequestBody CustomerInvestigateRequest customerInvestigateRequest) throws Exception { - SysCustomer oldCustomer = sysCustomerService.selectSysCustomerById(customerInvestigateRequest.getId()); - if(oldCustomer != null && !oldCustomer.getPhone().equals(customerInvestigateRequest.getPhone())){ - //验证是否已存在该手机号 - SysCustomer phoneCustomer = sysCustomerService.getCustomerByPhone(customerInvestigateRequest.getPhone()); - if(phoneCustomer != null){ - return AjaxResult.error("该手机号已存在"); - } - } - return toAjax(sysCustomerService.addOrupdateCustomerAndSign(customerInvestigateRequest)); + return sysCustomerPhysicalSignsService.addOrupdateCustomerAndSign(customerInvestigateRequest); } /** @@ -141,10 +132,9 @@ public class SysCustomerController extends BaseController @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { - return toAjax(sysCustomerService.delCustomerAndSignById(ids)); + return toAjax(sysCustomerPhysicalSignsService.deleteSysCustomerPhysicalSignsByIds(ids)); } - /** * 根据手机号查看用户体征 */ @@ -152,9 +142,9 @@ public class SysCustomerController extends BaseController @PreAuthorize("@ss.hasPermi('custom:customer:query')") public AjaxResult getCustomerAndSignByPhone(@RequestParam("phone")String phone) { - SysCustomer sysCustomer = null; + SysCustomerPhysicalSigns sysCustomer = null; if(StringUtils.isNotEmpty(phone)){ - sysCustomer = sysCustomerService.selectSysCustomerAndSignByPhone(phone); + sysCustomer = sysCustomerPhysicalSignsService.selectSysCustomerAndSignByPhone(phone); } return AjaxResult.success(sysCustomer); } diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerHealthyController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerHealthyController.java new file mode 100644 index 000000000..5ad21ebe8 --- /dev/null +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerHealthyController.java @@ -0,0 +1,103 @@ +package com.stdiet.custom.controller; + +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 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.SysCustomerHealthy; +import com.stdiet.custom.service.ISysCustomerHealthyService; +import com.stdiet.common.utils.poi.ExcelUtil; +import com.stdiet.common.core.page.TableDataInfo; + +/** + * 客户健康Controller + * + * @author xzj + * @date 2021-01-23 + */ +@RestController +@RequestMapping("/custom/healthy") +public class SysCustomerHealthyController extends BaseController +{ + @Autowired + private ISysCustomerHealthyService sysCustomerHealthyService; + + /** + * 查询客户健康列表 + */ + @PreAuthorize("@ss.hasPermi('custom:healthy:list')") + @GetMapping("/list") + public TableDataInfo list(SysCustomerHealthy sysCustomerHealthy) + { + startPage(); + List list = sysCustomerHealthyService.selectSysCustomerHealthyList(sysCustomerHealthy); + return getDataTable(list); + } + + /** + * 导出客户健康列表 + */ + @PreAuthorize("@ss.hasPermi('custom:healthy:export')") + @Log(title = "客户健康", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(SysCustomerHealthy sysCustomerHealthy) + { + List list = sysCustomerHealthyService.selectSysCustomerHealthyList(sysCustomerHealthy); + ExcelUtil util = new ExcelUtil(SysCustomerHealthy.class); + return util.exportExcel(list, "healthy"); + } + + /** + * 获取客户健康详细信息 + */ + @PreAuthorize("@ss.hasPermi('custom:healthy:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(sysCustomerHealthyService.selectSysCustomerHealthyById(id)); + } + + /** + * 新增客户健康 + */ + @PreAuthorize("@ss.hasPermi('customer:healthy:add')") + @Log(title = "客户健康", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SysCustomerHealthy sysCustomerHealthy) + { + return sysCustomerHealthyService.insertOrUpdateSysCustomerHealthy(sysCustomerHealthy); + } + + /** + * 修改客户健康 + */ + @PreAuthorize("@ss.hasPermi('custom:healthy:edit')") + @Log(title = "客户健康", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SysCustomerHealthy sysCustomerHealthy) + { + return sysCustomerHealthyService.insertOrUpdateSysCustomerHealthy(sysCustomerHealthy); + } + + /** + * 删除客户健康 + */ + @PreAuthorize("@ss.hasPermi('custom:healthy:remove')") + @Log(title = "客户健康", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(sysCustomerHealthyService.deleteSysCustomerHealthyByIds(ids)); + } +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerHealthy.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerHealthy.java new file mode 100644 index 000000000..6a7a7e9cd --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerHealthy.java @@ -0,0 +1,1280 @@ +package com.stdiet.custom.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.stdiet.common.annotation.Excel; +import com.stdiet.common.core.domain.BaseEntity; + +/** + * 客户健康对象 sys_customer_healthy + * + * @author xzj + * @date 2021-01-23 + */ +public class SysCustomerHealthy extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 客户ID */ + //@Excel(name = "客户ID") + private Long customerId; + + /** 客户姓名,非持久化字段 */ + @Excel(name = "客户姓名") + private String name; + + /** 客户手机号,非持久化字段 */ + @Excel(name = "客户手机号") + private String phone; + + /** 调理项目id */ + //@Excel(name = "调理项目id") + private Long conditioningProjectId; + + /** 调理项目名称 ,非持久化字段*/ + @Excel(name = "调理项目") + private String conditioningProject; + + /** 0男 1女 2未知,默认2 */ + @Excel(name = "0男 1女 2未知,默认2") + private Long sex; + + /** 年龄 */ + @Excel(name = "年龄") + private Long age; + + /** 调味品种类,使用 , 隔开 */ + @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 Long vegetableRate; + + /** 最常吃的肉类 */ + @Excel(name = "最常吃的肉类") + private String commonMeat; + + /** 晚餐时间(24小时制) */ + @Excel(name = "晚餐时间", readConverterExp = "2=4小时制") + private String dinnerTime; + + /** 每周吃夜宵次数,默认0 */ + @Excel(name = "每周吃夜宵次数,默认0") + private Long supperNum; + + /** 夜宵通常吃的食物 */ + @Excel(name = "夜宵通常吃的食物") + private String supperFood; + + /** 食物的冷热偏好 */ + @Excel(name = "食物的冷热偏好") + private String dietHotAndCold; + + /** 食物的口味偏好,使用 , 隔开 */ + @Excel(name = "食物的口味偏好,使用 , 隔开") + private String dietFlavor; + + /** 平均每周吃生菜几次 */ + @Excel(name = "平均每周吃生菜几次") + private Long vegetablesNum; + + /** 每周吃生菜的频次类型 */ + @Excel(name = "每周吃生菜的频次类型") + private String vegetablesRateType; + + /** 平均每天吃水果次数,默认0 */ + @Excel(name = "平均每天吃水果次数,默认0") + private Long fruitsNum; + + /** 吃水果的时间段 */ + @Excel(name = "吃水果的时间段") + private String fruitsTime; + + /** 平时吃水果的频次 */ + @Excel(name = "平时吃水果的频次") + private String fruitsRate; + + /** 一餐吃几碗饭 */ + @Excel(name = "一餐吃几碗饭") + private Long riceNum; + + /** 吃几成饱 */ + @Excel(name = "吃几成饱") + private Long riceFull; + + /** 吃饭速度 */ + @Excel(name = "吃饭速度") + private String eatingSpeed; + + /** 常吃的零食,使用 , 隔开 */ + @Excel(name = "常吃的零食,使用 , 隔开") + private String snacks; + + /** 其他零食 */ + @Excel(name = "其他零食") + private String otherSnacks; + + /** 有无服用营养保健品,0无 1有 */ + @Excel(name = "有无服用营养保健品,0无 1有") + private Long healthProductsFlag; + + /** 营养保健品品牌名 */ + @Excel(name = "营养保健品品牌名") + private String healthProductsBrand; + + /** 营养保健品产品名 */ + @Excel(name = "营养保健品产品名") + private String healthProductsName; + + /** 服用营养保健品频次,每周几次 */ + @Excel(name = "服用营养保健品频次,每周几次") + private Long healthProductsWeekRate; + + /** 服用营养保健品频次,每天几次 */ + @Excel(name = "服用营养保健品频次,每天几次") + private Long healthProductsDayRate; + + /** 每天的饮水量,单位:毫升 */ + @Excel(name = "每天的饮水量,单位:毫升") + private Long 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 Long smokeFlag; + + /** 抽烟频次和烟龄,戒烟几年,使用,隔开 */ + @Excel(name = "抽烟频次和烟龄,戒烟几年,使用,隔开") + private String smokeRate; + + /** 是否经常抽二手烟 0否 1是,默认0 */ + @Excel(name = "是否经常抽二手烟 0否 1是,默认0") + private Long secondSmoke; + + /** 工作行业 */ + @Excel(name = "工作行业") + private String workIndustry; + + /** 工作性质,使用,隔开 */ + @Excel(name = "工作性质,使用,隔开") + private String workType; + + /** 排便次数 */ + @Excel(name = "排便次数") + private String defecationNum; + + /** 其他手动输入的排便次数 */ + @Excel(name = "其他手动输入的排便次数") + private Long 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 Long motionNum; + + /** 每次运动的时长,分钟 */ + @Excel(name = "每次运动的时长,分钟") + private Long motionDuration; + + /** 每天运动的时间,24小时制 */ + @Excel(name = "每天运动的时间,24小时制") + private String motionTime; + + /** 有氧运动项目,使用,隔开 */ + @Excel(name = "有氧运动项目,使用,隔开") + private String aerobicMotionClassify; + + /** 无氧运动项目,使用,隔开 */ + @Excel(name = "无氧运动项目,使用,隔开") + private String anaerobicMotionClassify; + + /** 无氧有氧项目,使用,隔开 */ + @Excel(name = "无氧有氧项目,使用,隔开") + private String anaerobicAerobicMotionClassify; + + /** 其他运动项目,使用,隔开 */ + @Excel(name = "其他运动项目,使用,隔开") + private String otherMotionClassify; + + /** 运动场地,使用,隔开 */ + @Excel(name = "运动场地,使用,隔开") + private String motionField; + + /** 其他运动场地 */ + @Excel(name = "其他运动场地") + private String otherMotionField; + + /** 睡觉时间,24小时制 */ + @Excel(name = "睡觉时间,24小时制") + private String sleepTime; + + /** 睡眠质量 */ + @Excel(name = "睡眠质量") + private String sleepQuality; + + /** 是否有辅助入睡药物,0否 1是,默认0 */ + @Excel(name = "是否有辅助入睡药物,0否 1是,默认0") + private Long sleepDrugFlag; + + /** 辅助睡眠类药物名称 */ + @Excel(name = "辅助睡眠类药物名称") + private String sleepDrug; + + /** 是否经常熬夜(超过11点)0否 1是,默认0 */ + @Excel(name = "是否经常熬夜", readConverterExp = "超=过11点") + private Long stayupLateFlag; + + /** 熬夜频次,每周几次 */ + @Excel(name = "熬夜频次,每周几次") + private Long stayupLateWeekNum; + + /** 家族疾病史,使用,隔开 */ + @Excel(name = "家族疾病史,使用,隔开") + private String familyIllnessHistory; + + /** 其他家族病史 */ + @Excel(name = "其他家族病史") + private String otherFamilyIllnessHistory; + + /** 手术史,使用,隔开 */ + @Excel(name = "手术史,使用,隔开") + private String operationHistory; + + /** 其他手术史 */ + @Excel(name = "其他手术史") + private String otherOperationHistory; + + /** 近期是否做过手术,0否 1是,默认0 */ + @Excel(name = "近期是否做过手术,0否 1是,默认0") + private Long nearOperationFlag; + + /** 手术恢复情况 */ + @Excel(name = "手术恢复情况") + private String recoveryeSituation; + + /** 是否长期服用药物,0否 1是,默认0 */ + @Excel(name = "是否长期服用药物,0否 1是,默认0") + private Long longEatDrugFlag; + + /** 长期服用的药物,使用,隔开 */ + @Excel(name = "长期服用的药物,使用,隔开") + private String longEatDrugClassify; + + /** 其他长期服用的药物 */ + @Excel(name = "其他长期服用的药物") + private String otherLongEatDrugClassify; + + /** 是否出现过过敏症状,0否 1是,默认0 */ + @Excel(name = "是否出现过过敏症状,0否 1是,默认0") + private Long allergyFlag; + + /** 过敏症状 */ + @Excel(name = "过敏症状") + private String allergySituation; + + /** 过敏源,使用,隔开 */ + @Excel(name = "过敏源,使用,隔开") + private String allergen; + + /** 其他过敏源 */ + @Excel(name = "其他过敏源") + private String otherAllergen; + + /** 体检报告 */ + @Excel(name = "体检报告") + private String medicalReport; + + /** 删除标识 0未删除 1已删除。默认0 */ + private Long delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCustomerId(Long customerId) + { + this.customerId = customerId; + } + + public Long getCustomerId() + { + return customerId; + } + public void setConditioningProjectId(Long conditioningProjectId) + { + this.conditioningProjectId = conditioningProjectId; + } + + public Long getConditioningProjectId() + { + return conditioningProjectId; + } + public void setSex(Long sex) + { + this.sex = sex; + } + + public Long getSex() + { + return sex; + } + public void setAge(Long age) + { + this.age = age; + } + + public Long getAge() + { + return age; + } + public void setCondiment(String condiment) + { + this.condiment = condiment; + } + + public String getCondiment() + { + return condiment; + } + public void setOtherCondiment(String otherCondiment) + { + this.otherCondiment = otherCondiment; + } + + public String getOtherCondiment() + { + return otherCondiment; + } + public void setCookingStyle(String cookingStyle) + { + this.cookingStyle = cookingStyle; + } + + public String getCookingStyle() + { + return cookingStyle; + } + public void setCookingStyleRate(String cookingStyleRate) + { + this.cookingStyleRate = cookingStyleRate; + } + + public String getCookingStyleRate() + { + return cookingStyleRate; + } + public void setWashVegetablesStyle(String washVegetablesStyle) + { + this.washVegetablesStyle = washVegetablesStyle; + } + + public String getWashVegetablesStyle() + { + return washVegetablesStyle; + } + public void setOtherWashVegetablesStyle(String otherWashVegetablesStyle) + { + this.otherWashVegetablesStyle = otherWashVegetablesStyle; + } + + public String getOtherWashVegetablesStyle() + { + return otherWashVegetablesStyle; + } + public void setBreakfastType(String breakfastType) + { + this.breakfastType = breakfastType; + } + + public String getBreakfastType() + { + return breakfastType; + } + public void setBreakfastFood(String breakfastFood) + { + this.breakfastFood = breakfastFood; + } + + public String getBreakfastFood() + { + return breakfastFood; + } + public void setLunchType(String lunchType) + { + this.lunchType = lunchType; + } + + public String getLunchType() + { + return lunchType; + } + public void setDinner(String dinner) + { + this.dinner = dinner; + } + + public String getDinner() + { + return dinner; + } + public void setVegetableRate(Long vegetableRate) + { + this.vegetableRate = vegetableRate; + } + + public Long getVegetableRate() + { + return vegetableRate; + } + public void setCommonMeat(String commonMeat) + { + this.commonMeat = commonMeat; + } + + public String getCommonMeat() + { + return commonMeat; + } + public void setDinnerTime(String dinnerTime) + { + this.dinnerTime = dinnerTime; + } + + public String getDinnerTime() + { + return dinnerTime; + } + public void setSupperNum(Long supperNum) + { + this.supperNum = supperNum; + } + + public Long getSupperNum() + { + return supperNum; + } + public void setSupperFood(String supperFood) + { + this.supperFood = supperFood; + } + + public String getSupperFood() + { + return supperFood; + } + public void setDietHotAndCold(String dietHotAndCold) + { + this.dietHotAndCold = dietHotAndCold; + } + + public String getDietHotAndCold() + { + return dietHotAndCold; + } + public void setDietFlavor(String dietFlavor) + { + this.dietFlavor = dietFlavor; + } + + public String getDietFlavor() + { + return dietFlavor; + } + public void setVegetablesNum(Long vegetablesNum) + { + this.vegetablesNum = vegetablesNum; + } + + public Long getVegetablesNum() + { + return vegetablesNum; + } + public void setVegetablesRateType(String vegetablesRateType) + { + this.vegetablesRateType = vegetablesRateType; + } + + public String getVegetablesRateType() + { + return vegetablesRateType; + } + public void setFruitsNum(Long fruitsNum) + { + this.fruitsNum = fruitsNum; + } + + public Long getFruitsNum() + { + return fruitsNum; + } + public void setFruitsTime(String fruitsTime) + { + this.fruitsTime = fruitsTime; + } + + public String getFruitsTime() + { + return fruitsTime; + } + public void setFruitsRate(String fruitsRate) + { + this.fruitsRate = fruitsRate; + } + + public String getFruitsRate() + { + return fruitsRate; + } + public void setRiceNum(Long riceNum) + { + this.riceNum = riceNum; + } + + public Long getRiceNum() + { + return riceNum; + } + public void setRiceFull(Long riceFull) + { + this.riceFull = riceFull; + } + + public Long getRiceFull() + { + return riceFull; + } + public void setEatingSpeed(String eatingSpeed) + { + this.eatingSpeed = eatingSpeed; + } + + public String getEatingSpeed() + { + return eatingSpeed; + } + public void setSnacks(String snacks) + { + this.snacks = snacks; + } + + public String getSnacks() + { + return snacks; + } + public void setOtherSnacks(String otherSnacks) + { + this.otherSnacks = otherSnacks; + } + + public String getOtherSnacks() + { + return otherSnacks; + } + public void setHealthProductsFlag(Long healthProductsFlag) + { + this.healthProductsFlag = healthProductsFlag; + } + + public Long getHealthProductsFlag() + { + return healthProductsFlag; + } + public void setHealthProductsBrand(String healthProductsBrand) + { + this.healthProductsBrand = healthProductsBrand; + } + + public String getHealthProductsBrand() + { + return healthProductsBrand; + } + public void setHealthProductsName(String healthProductsName) + { + this.healthProductsName = healthProductsName; + } + + public String getHealthProductsName() + { + return healthProductsName; + } + public void setHealthProductsWeekRate(Long healthProductsWeekRate) + { + this.healthProductsWeekRate = healthProductsWeekRate; + } + + public Long getHealthProductsWeekRate() + { + return healthProductsWeekRate; + } + public void setHealthProductsDayRate(Long healthProductsDayRate) + { + this.healthProductsDayRate = healthProductsDayRate; + } + + public Long getHealthProductsDayRate() + { + return healthProductsDayRate; + } + public void setWaterNum(Long waterNum) + { + this.waterNum = waterNum; + } + + public Long getWaterNum() + { + return waterNum; + } + public void setWaterType(String waterType) + { + this.waterType = waterType; + } + + public String getWaterType() + { + return waterType; + } + public void setWaterHabit(String waterHabit) + { + this.waterHabit = waterHabit; + } + + public String getWaterHabit() + { + return waterHabit; + } + public void setDrinksNum(String drinksNum) + { + this.drinksNum = drinksNum; + } + + public String getDrinksNum() + { + return drinksNum; + } + public void setDrinkWineFlag(String drinkWineFlag) + { + this.drinkWineFlag = drinkWineFlag; + } + + public String getDrinkWineFlag() + { + return drinkWineFlag; + } + public void setDrinkWineClassify(String drinkWineClassify) + { + this.drinkWineClassify = drinkWineClassify; + } + + public String getDrinkWineClassify() + { + return drinkWineClassify; + } + public void setOtherWineClassify(String otherWineClassify) + { + this.otherWineClassify = otherWineClassify; + } + + public String getOtherWineClassify() + { + return otherWineClassify; + } + public void setDrinkWineAmount(String drinkWineAmount) + { + this.drinkWineAmount = drinkWineAmount; + } + + public String getDrinkWineAmount() + { + return drinkWineAmount; + } + public void setSmokeFlag(Long smokeFlag) + { + this.smokeFlag = smokeFlag; + } + + public Long getSmokeFlag() + { + return smokeFlag; + } + public void setSmokeRate(String smokeRate) + { + this.smokeRate = smokeRate; + } + + public String getSmokeRate() + { + return smokeRate; + } + public void setSecondSmoke(Long secondSmoke) + { + this.secondSmoke = secondSmoke; + } + + public Long getSecondSmoke() + { + return secondSmoke; + } + public void setWorkIndustry(String workIndustry) + { + this.workIndustry = workIndustry; + } + + public String getWorkIndustry() + { + return workIndustry; + } + public void setWorkType(String workType) + { + this.workType = workType; + } + + public String getWorkType() + { + return workType; + } + public void setDefecationNum(String defecationNum) + { + this.defecationNum = defecationNum; + } + + public String getDefecationNum() + { + return defecationNum; + } + public void setOtherDefecationNum(Long otherDefecationNum) + { + this.otherDefecationNum = otherDefecationNum; + } + + public Long getOtherDefecationNum() + { + return otherDefecationNum; + } + public void setDefecationTime(String defecationTime) + { + this.defecationTime = defecationTime; + } + + public String getDefecationTime() + { + return defecationTime; + } + public void setDefecationShape(String defecationShape) + { + this.defecationShape = defecationShape; + } + + public String getDefecationShape() + { + return defecationShape; + } + public void setDefecationSmell(String defecationSmell) + { + this.defecationSmell = defecationSmell; + } + + public String getDefecationSmell() + { + return defecationSmell; + } + public void setDefecationSpeed(String defecationSpeed) + { + this.defecationSpeed = defecationSpeed; + } + + public String getDefecationSpeed() + { + return defecationSpeed; + } + public void setDefecationColor(String defecationColor) + { + this.defecationColor = defecationColor; + } + + public String getDefecationColor() + { + return defecationColor; + } + public void setMotionNum(Long motionNum) + { + this.motionNum = motionNum; + } + + public Long getMotionNum() + { + return motionNum; + } + public void setMotionDuration(Long motionDuration) + { + this.motionDuration = motionDuration; + } + + public Long getMotionDuration() + { + return motionDuration; + } + public void setMotionTime(String motionTime) + { + this.motionTime = motionTime; + } + + public String getMotionTime() + { + return motionTime; + } + public void setAerobicMotionClassify(String aerobicMotionClassify) + { + this.aerobicMotionClassify = aerobicMotionClassify; + } + + public String getAerobicMotionClassify() + { + return aerobicMotionClassify; + } + public void setAnaerobicMotionClassify(String anaerobicMotionClassify) + { + this.anaerobicMotionClassify = anaerobicMotionClassify; + } + + public String getAnaerobicMotionClassify() + { + return anaerobicMotionClassify; + } + public void setAnaerobicAerobicMotionClassify(String anaerobicAerobicMotionClassify) + { + this.anaerobicAerobicMotionClassify = anaerobicAerobicMotionClassify; + } + + public String getAnaerobicAerobicMotionClassify() + { + return anaerobicAerobicMotionClassify; + } + public void setOtherMotionClassify(String otherMotionClassify) + { + this.otherMotionClassify = otherMotionClassify; + } + + public String getOtherMotionClassify() + { + return otherMotionClassify; + } + public void setMotionField(String motionField) + { + this.motionField = motionField; + } + + public String getMotionField() + { + return motionField; + } + public void setOtherMotionField(String otherMotionField) + { + this.otherMotionField = otherMotionField; + } + + public String getOtherMotionField() + { + return otherMotionField; + } + public void setSleepTime(String sleepTime) + { + this.sleepTime = sleepTime; + } + + public String getSleepTime() + { + return sleepTime; + } + public void setSleepQuality(String sleepQuality) + { + this.sleepQuality = sleepQuality; + } + + public String getSleepQuality() + { + return sleepQuality; + } + public void setSleepDrugFlag(Long sleepDrugFlag) + { + this.sleepDrugFlag = sleepDrugFlag; + } + + public Long getSleepDrugFlag() + { + return sleepDrugFlag; + } + public void setSleepDrug(String sleepDrug) + { + this.sleepDrug = sleepDrug; + } + + public String getSleepDrug() + { + return sleepDrug; + } + public void setStayupLateFlag(Long stayupLateFlag) + { + this.stayupLateFlag = stayupLateFlag; + } + + public Long getStayupLateFlag() + { + return stayupLateFlag; + } + public void setStayupLateWeekNum(Long stayupLateWeekNum) + { + this.stayupLateWeekNum = stayupLateWeekNum; + } + + public Long getStayupLateWeekNum() + { + return stayupLateWeekNum; + } + public void setFamilyIllnessHistory(String familyIllnessHistory) + { + this.familyIllnessHistory = familyIllnessHistory; + } + + public String getFamilyIllnessHistory() + { + return familyIllnessHistory; + } + public void setOtherFamilyIllnessHistory(String otherFamilyIllnessHistory) + { + this.otherFamilyIllnessHistory = otherFamilyIllnessHistory; + } + + public String getOtherFamilyIllnessHistory() + { + return otherFamilyIllnessHistory; + } + public void setOperationHistory(String operationHistory) + { + this.operationHistory = operationHistory; + } + + public String getOperationHistory() + { + return operationHistory; + } + public void setOtherOperationHistory(String otherOperationHistory) + { + this.otherOperationHistory = otherOperationHistory; + } + + public String getOtherOperationHistory() + { + return otherOperationHistory; + } + public void setNearOperationFlag(Long nearOperationFlag) + { + this.nearOperationFlag = nearOperationFlag; + } + + public Long getNearOperationFlag() + { + return nearOperationFlag; + } + public void setRecoveryeSituation(String recoveryeSituation) + { + this.recoveryeSituation = recoveryeSituation; + } + + public String getRecoveryeSituation() + { + return recoveryeSituation; + } + public void setLongEatDrugFlag(Long longEatDrugFlag) + { + this.longEatDrugFlag = longEatDrugFlag; + } + + public Long getLongEatDrugFlag() + { + return longEatDrugFlag; + } + public void setLongEatDrugClassify(String longEatDrugClassify) + { + this.longEatDrugClassify = longEatDrugClassify; + } + + public String getLongEatDrugClassify() + { + return longEatDrugClassify; + } + public void setOtherLongEatDrugClassify(String otherLongEatDrugClassify) + { + this.otherLongEatDrugClassify = otherLongEatDrugClassify; + } + + public String getOtherLongEatDrugClassify() + { + return otherLongEatDrugClassify; + } + public void setAllergyFlag(Long allergyFlag) + { + this.allergyFlag = allergyFlag; + } + + public Long getAllergyFlag() + { + return allergyFlag; + } + public void setAllergySituation(String allergySituation) + { + this.allergySituation = allergySituation; + } + + public String getAllergySituation() + { + return allergySituation; + } + public void setAllergen(String allergen) + { + this.allergen = allergen; + } + + public String getAllergen() + { + return allergen; + } + public void setOtherAllergen(String otherAllergen) + { + this.otherAllergen = otherAllergen; + } + + public String getOtherAllergen() + { + return otherAllergen; + } + public void setMedicalReport(String medicalReport) + { + this.medicalReport = medicalReport; + } + + public String getMedicalReport() + { + return medicalReport; + } + public void setDelFlag(Long delFlag) + { + this.delFlag = delFlag; + } + + public Long getDelFlag() + { + return delFlag; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getConditioningProject() { + return conditioningProject; + } + + public void setConditioningProject(String conditioningProject) { + this.conditioningProject = conditioningProject; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("customerId", getCustomerId()) + .append("conditioningProjectId", getConditioningProjectId()) + .append("sex", getSex()) + .append("age", getAge()) + .append("condiment", getCondiment()) + .append("otherCondiment", getOtherCondiment()) + .append("cookingStyle", getCookingStyle()) + .append("cookingStyleRate", getCookingStyleRate()) + .append("washVegetablesStyle", getWashVegetablesStyle()) + .append("otherWashVegetablesStyle", getOtherWashVegetablesStyle()) + .append("breakfastType", getBreakfastType()) + .append("breakfastFood", getBreakfastFood()) + .append("lunchType", getLunchType()) + .append("dinner", getDinner()) + .append("vegetableRate", getVegetableRate()) + .append("commonMeat", getCommonMeat()) + .append("dinnerTime", getDinnerTime()) + .append("supperNum", getSupperNum()) + .append("supperFood", getSupperFood()) + .append("dietHotAndCold", getDietHotAndCold()) + .append("dietFlavor", getDietFlavor()) + .append("vegetablesNum", getVegetablesNum()) + .append("vegetablesRateType", getVegetablesRateType()) + .append("fruitsNum", getFruitsNum()) + .append("fruitsTime", getFruitsTime()) + .append("fruitsRate", getFruitsRate()) + .append("riceNum", getRiceNum()) + .append("riceFull", getRiceFull()) + .append("eatingSpeed", getEatingSpeed()) + .append("snacks", getSnacks()) + .append("otherSnacks", getOtherSnacks()) + .append("healthProductsFlag", getHealthProductsFlag()) + .append("healthProductsBrand", getHealthProductsBrand()) + .append("healthProductsName", getHealthProductsName()) + .append("healthProductsWeekRate", getHealthProductsWeekRate()) + .append("healthProductsDayRate", getHealthProductsDayRate()) + .append("waterNum", getWaterNum()) + .append("waterType", getWaterType()) + .append("waterHabit", getWaterHabit()) + .append("drinksNum", getDrinksNum()) + .append("drinkWineFlag", getDrinkWineFlag()) + .append("drinkWineClassify", getDrinkWineClassify()) + .append("otherWineClassify", getOtherWineClassify()) + .append("drinkWineAmount", getDrinkWineAmount()) + .append("smokeFlag", getSmokeFlag()) + .append("smokeRate", getSmokeRate()) + .append("secondSmoke", getSecondSmoke()) + .append("workIndustry", getWorkIndustry()) + .append("workType", getWorkType()) + .append("defecationNum", getDefecationNum()) + .append("otherDefecationNum", getOtherDefecationNum()) + .append("defecationTime", getDefecationTime()) + .append("defecationShape", getDefecationShape()) + .append("defecationSmell", getDefecationSmell()) + .append("defecationSpeed", getDefecationSpeed()) + .append("defecationColor", getDefecationColor()) + .append("motionNum", getMotionNum()) + .append("motionDuration", getMotionDuration()) + .append("motionTime", getMotionTime()) + .append("aerobicMotionClassify", getAerobicMotionClassify()) + .append("anaerobicMotionClassify", getAnaerobicMotionClassify()) + .append("anaerobicAerobicMotionClassify", getAnaerobicAerobicMotionClassify()) + .append("otherMotionClassify", getOtherMotionClassify()) + .append("motionField", getMotionField()) + .append("otherMotionField", getOtherMotionField()) + .append("sleepTime", getSleepTime()) + .append("sleepQuality", getSleepQuality()) + .append("sleepDrugFlag", getSleepDrugFlag()) + .append("sleepDrug", getSleepDrug()) + .append("stayupLateFlag", getStayupLateFlag()) + .append("stayupLateWeekNum", getStayupLateWeekNum()) + .append("familyIllnessHistory", getFamilyIllnessHistory()) + .append("otherFamilyIllnessHistory", getOtherFamilyIllnessHistory()) + .append("operationHistory", getOperationHistory()) + .append("otherOperationHistory", getOtherOperationHistory()) + .append("nearOperationFlag", getNearOperationFlag()) + .append("recoveryeSituation", getRecoveryeSituation()) + .append("longEatDrugFlag", getLongEatDrugFlag()) + .append("longEatDrugClassify", getLongEatDrugClassify()) + .append("otherLongEatDrugClassify", getOtherLongEatDrugClassify()) + .append("allergyFlag", getAllergyFlag()) + .append("allergySituation", getAllergySituation()) + .append("allergen", getAllergen()) + .append("otherAllergen", getOtherAllergen()) + .append("medicalReport", getMedicalReport()) + .append("createTime", getCreateTime()) + .append("createBy", getCreateBy()) + .append("updateTime", getUpdateTime()) + .append("updateBy", getUpdateBy()) + .append("delFlag", getDelFlag()) + .toString(); + } +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerPhysicalSigns.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerPhysicalSigns.java index 007388233..17ec598c0 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerPhysicalSigns.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerPhysicalSigns.java @@ -17,13 +17,21 @@ public class SysCustomerPhysicalSigns extends BaseEntity { private static final long serialVersionUID = 1L; - /** $column.columnComment */ + /** 体征ID */ private Long id; /** 客户id */ - @Excel(name = "客户id") + //@Excel(name = "客户id") private Long customerId; + /** 客户姓名,非持久化字段 */ + @Excel(name = "客户姓名") + private String name; + + /** 客户手机号,非持久化字段 */ + @Excel(name = "客户手机号") + private String phone; + /** 客户性别 0男 1女 */ @Excel(name = "客户性别 0男 1女") private Integer sex; @@ -425,6 +433,22 @@ public class SysCustomerPhysicalSigns extends BaseEntity this.delFlag = delFlag; } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/dto/request/CustomerInvestigateRequest.java b/stdiet-custom/src/main/java/com/stdiet/custom/dto/request/CustomerInvestigateRequest.java index 0f30aa7b0..e5eef9e9e 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/dto/request/CustomerInvestigateRequest.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/dto/request/CustomerInvestigateRequest.java @@ -15,9 +15,12 @@ public class CustomerInvestigateRequest extends BaseEntity //基础信息 - /** $column.columnComment */ + /** 体征信息ID */ private Long id; + /** 客户ID */ + private Long customerId; + /** 名字 */ @Excel(name = "名字") private String name; @@ -26,16 +29,7 @@ public class CustomerInvestigateRequest extends BaseEntity @Excel(name = "手机号") private String phone; - /** 邮箱 */ - @Excel(name = "邮箱") - private String email; - - /** 地址 */ - @Excel(name = "地址") - private String address; - //体征信息 - /** 客户性别 0男 1女 */ @Excel(name = "客户性别 0男 1女") private Integer sex; @@ -152,42 +146,34 @@ public class CustomerInvestigateRequest extends BaseEntity return id; } - public String getName() { - return name; - } - - public String getPhone() { - return phone; - } - - public String getEmail() { - return email; - } - - public String getAddress() { - return address; - } - public void setId(Long id) { this.id = id; } + public Long getCustomerId() { + return customerId; + } + + public void setCustomerId(Long customerId) { + this.customerId = customerId; + } + + public String getName() { + return name; + } + public void setName(String name) { this.name = name; } + public String getPhone() { + return phone; + } + public void setPhone(String phone) { this.phone = phone; } - public void setEmail(String email) { - this.email = email; - } - - public void setAddress(String address) { - this.address = address; - } - public Integer getSex() { return sex; } diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java new file mode 100644 index 000000000..9850eb379 --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java @@ -0,0 +1,70 @@ +package com.stdiet.custom.mapper; + +import java.util.List; + +import com.stdiet.custom.domain.SysCustomer; +import com.stdiet.custom.domain.SysCustomerHealthy; +import org.apache.ibatis.annotations.Param; + +/** + * 客户健康Mapper接口 + * + * @author xzj + * @date 2021-01-23 + */ +public interface SysCustomerHealthyMapper +{ + /** + * 查询客户健康 + * + * @param id 客户健康ID + * @return 客户健康 + */ + public SysCustomerHealthy selectSysCustomerHealthyById(Long id); + + /** + * 查询客户健康列表 + * + * @param sysCustomerHealthy 客户健康 + * @return 客户健康集合 + */ + public List selectSysCustomerHealthyList(SysCustomerHealthy sysCustomerHealthy); + + /** + * 新增客户健康 + * + * @param sysCustomerHealthy 客户健康 + * @return 结果 + */ + public int insertSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); + + /** + * 修改客户健康 + * + * @param sysCustomerHealthy 客户健康 + * @return 结果 + */ + public int updateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); + + /** + * 删除客户健康 + * + * @param id 客户健康ID + * @return 结果 + */ + public int deleteSysCustomerHealthyById(Long id); + + /** + * 批量删除客户健康 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteSysCustomerHealthyByIds(Long[] ids); + + /** + * 根据手机号查询客户健康评估信息 + * @param phone + */ + SysCustomerHealthy selectSysCustomerHealthyByPhone(@Param("phone") String phone); +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerMapper.java index c10c14829..388e7b86c 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerMapper.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerMapper.java @@ -67,14 +67,4 @@ public interface SysCustomerMapper * @return 结果 */ SysCustomer getCustomerByPhone(@Param("phone")String phone); - - //查询客户基础信息以及体征信息 - List selectSysCustomerAndSignList(SysCustomer sysCustomer); - - /** - * 根据手机号查询客户以及体征 - * @param phone - * @return - */ - SysCustomer selectSysCustomerAndSignByPhone(String phone); } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerPhysicalSignsMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerPhysicalSignsMapper.java index 79d1e7d14..6f88b4ceb 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerPhysicalSignsMapper.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerPhysicalSignsMapper.java @@ -1,6 +1,8 @@ package com.stdiet.custom.mapper; import java.util.List; + +import com.stdiet.custom.domain.SysCustomer; import com.stdiet.custom.domain.SysCustomerPhysicalSigns; import org.apache.ibatis.annotations.Param; @@ -20,14 +22,6 @@ public interface SysCustomerPhysicalSignsMapper */ public SysCustomerPhysicalSigns selectSysCustomerPhysicalSignsById(Long id); - /** - * 查询客户体征信息列表 - * - * @param sysCustomerPhysicalSigns 客户体征信息 - * @return 客户体征信息集合 - */ - public List selectSysCustomerPhysicalSignsList(SysCustomerPhysicalSigns sysCustomerPhysicalSigns); - /** * 新增客户体征信息 * @@ -60,13 +54,14 @@ public interface SysCustomerPhysicalSignsMapper */ public int deleteSysCustomerPhysicalSignsByIds(Long[] ids); - /** - * 根据客户id修改客户体征信息 - * - * @param sysCustomerPhysicalSigns 客户体征信息 - * @return 结果 - */ - int updateSysCustomerPhysicalSignsByCustomerId(SysCustomerPhysicalSigns sysCustomerPhysicalSigns); - int deleteSysCustomerPhysicalSignsByCustomerIds(Long[] ids); + //查询客户体征信息 + List selectSysCustomerAndSignList(SysCustomerPhysicalSigns sysCustomerPhysicalSigns); + + /** + * 根据手机号查询客户以及体征 + * @param phone + * @return + */ + SysCustomerPhysicalSigns selectSysCustomerAndSignByPhone(String phone); } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java new file mode 100644 index 000000000..4713cd90b --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java @@ -0,0 +1,62 @@ +package com.stdiet.custom.service; + +import java.util.List; + +import com.stdiet.common.core.domain.AjaxResult; +import com.stdiet.custom.domain.SysCustomerHealthy; +import org.apache.ibatis.annotations.Param; + +/** + * 客户健康Service接口 + * + * @author xzj + * @date 2021-01-23 + */ +public interface ISysCustomerHealthyService +{ + /** + * 查询客户健康 + * + * @param id 客户健康ID + * @return 客户健康 + */ + public SysCustomerHealthy selectSysCustomerHealthyById(Long id); + + /** + * 查询客户健康列表 + * + * @param sysCustomerHealthy 客户健康 + * @return 客户健康集合 + */ + public List selectSysCustomerHealthyList(SysCustomerHealthy sysCustomerHealthy); + + /** + * 新增或修改客户健康 + * + * @param sysCustomerHealthy 客户健康 + * @return 结果 + */ + public AjaxResult insertOrUpdateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); + + /** + * 批量删除客户健康 + * + * @param ids 需要删除的客户健康ID + * @return 结果 + */ + public int deleteSysCustomerHealthyByIds(Long[] ids); + + /** + * 删除客户健康信息 + * + * @param id 客户健康ID + * @return 结果 + */ + public int deleteSysCustomerHealthyById(Long id); + + /** + * 根据手机号查询客户健康评估信息 + * @param phone + */ + SysCustomerHealthy selectSysCustomerHealthyByPhone(String phone); +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerPhysicalSignsService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerPhysicalSignsService.java index 0a49bd856..2083ad21b 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerPhysicalSignsService.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerPhysicalSignsService.java @@ -1,7 +1,11 @@ package com.stdiet.custom.service; import java.util.List; + +import com.stdiet.common.core.domain.AjaxResult; +import com.stdiet.custom.domain.SysCustomer; import com.stdiet.custom.domain.SysCustomerPhysicalSigns; +import com.stdiet.custom.dto.request.CustomerInvestigateRequest; /** * 客户体征信息Service接口 @@ -18,14 +22,6 @@ public interface ISysCustomerPhysicalSignsService { */ public SysCustomerPhysicalSigns selectSysCustomerPhysicalSignsById(Long id); - /** - * 查询客户体征信息列表 - * - * @param sysCustomerPhysicalSigns 客户体征信息 - * @return 客户体征信息集合 - */ - public List selectSysCustomerPhysicalSignsList(SysCustomerPhysicalSigns sysCustomerPhysicalSigns); - /** * 新增客户体征信息 * @@ -57,4 +53,28 @@ public interface ISysCustomerPhysicalSignsService { * @return 结果 */ public int deleteSysCustomerPhysicalSignsById(Long id); + + /** + * 客户体征资料填写 + * + * @param customerInvestigateRequest 客户建档相关资料 + * @return 结果 + */ + AjaxResult addOrupdateCustomerAndSign(CustomerInvestigateRequest customerInvestigateRequest) throws Exception; + + /** + * 查询客户基础信息以及体征信息列表 + * + * @param sysCustomerPhysicalSigns 查询条件 + * @return 结果 + */ + List selectSysCustomerAndSignList(SysCustomerPhysicalSigns sysCustomerPhysicalSigns); + + /** + * 根据手机号查询客户以及体征 + * @param phone + * @return + */ + SysCustomerPhysicalSigns selectSysCustomerAndSignByPhone(String phone); + } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerService.java index c35403c4a..213a46ac2 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerService.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerService.java @@ -67,37 +67,4 @@ public interface ISysCustomerService * @return 结果 */ SysCustomer getCustomerByPhone(String phone); - - /** - * 客户建档资料填写 - * - * @param customerInvestigateRequest 客户建档相关资料 - * @return 结果 - */ - int addOrupdateCustomerAndSign( CustomerInvestigateRequest customerInvestigateRequest) throws Exception; - - /** - * 查询客户基础信息以及体征信息列表 - * - * @param sysCustomer 查询条件 - * @return 结果 - */ - List selectSysCustomerAndSignList(SysCustomer sysCustomer); - - /** - * 根据id查询客户信息(基础信息以及体征信息) - * - * @param id 客户id - * @return 结果 - */ - SysCustomer getCustomerAndSignById(Long id); - - int delCustomerAndSignById(Long[] ids); - - /** - * 根据手机号查询客户以及体征 - * @param phone - * @return - */ - SysCustomer selectSysCustomerAndSignByPhone(String phone); } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java new file mode 100644 index 000000000..55a32214c --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java @@ -0,0 +1,154 @@ +package com.stdiet.custom.service.impl; + +import java.util.List; + +import com.stdiet.common.core.domain.AjaxResult; +import com.stdiet.common.utils.bean.ObjectUtils; +import com.stdiet.custom.domain.SysCustomer; +import com.stdiet.custom.domain.SysCustomerPhysicalSigns; +import com.stdiet.custom.service.ISysCustomerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.stdiet.custom.mapper.SysCustomerHealthyMapper; +import com.stdiet.custom.domain.SysCustomerHealthy; +import com.stdiet.custom.service.ISysCustomerHealthyService; + +/** + * 客户健康Service业务层处理 + * + * @author xzj + * @date 2021-01-23 + */ +@Service +public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService +{ + @Autowired + private SysCustomerHealthyMapper sysCustomerHealthyMapper; + + @Autowired + private ISysCustomerService sysCustomerService; + + /** + * 查询客户健康 + * + * @param id 客户健康ID + * @return 客户健康 + */ + @Override + public SysCustomerHealthy selectSysCustomerHealthyById(Long id) + { + return sysCustomerHealthyMapper.selectSysCustomerHealthyById(id); + } + + /** + * 查询客户健康列表 + * + * @param sysCustomerHealthy 客户健康 + * @return 客户健康 + */ + @Override + public List selectSysCustomerHealthyList(SysCustomerHealthy sysCustomerHealthy) + { + return sysCustomerHealthyMapper.selectSysCustomerHealthyList(sysCustomerHealthy); + } + + /** + * 新增客户健康 + * + * @param sysCustomerHealthy 客户健康 + * @return 结果 + */ + @Override + public AjaxResult insertOrUpdateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy) + { + //当前登录用户 + //LoginUser loginUser = SecurityUtils.getLoginUser(); + Long cutomerId = 0L; + //新增 + if(sysCustomerHealthy.getId() == null){ + //根据手机号查询客户健康信息,判断是否已存在 + SysCustomerHealthy customerHealthy = selectSysCustomerHealthyByPhone(sysCustomerHealthy.getPhone()); + if(customerHealthy != null){ + return AjaxResult.error("该手机号已存在"); + } + //根据手机号查询客户基础信息,判断是否已存在 + SysCustomer phoneCustomer = sysCustomerService.getCustomerByPhone(sysCustomerHealthy.getPhone()); + if(phoneCustomer != null){ + if(!sysCustomerHealthy.getName().equals(phoneCustomer.getName())){ + return AjaxResult.error("该手机号与姓名不符"); + } + cutomerId = phoneCustomer.getId(); + }else{ + SysCustomer newSysCustomer = new SysCustomer(); + newSysCustomer.setName(sysCustomerHealthy.getName()); + newSysCustomer.setPhone(sysCustomerHealthy.getPhone()); + if(sysCustomerService.insertSysCustomer(newSysCustomer) > 0){ + cutomerId = newSysCustomer.getId(); + } + } + } + //更新 + else{ + SysCustomer oldCustomer = sysCustomerService.selectSysCustomerById(sysCustomerHealthy.getCustomerId()); + //如果修改了手机号,则需要判断手机号是否已经存在 + if(oldCustomer != null && !oldCustomer.getPhone().equals(sysCustomerHealthy.getPhone())) { + //验证该手机号是否已存在客户健康信息 + SysCustomerHealthy customerHealthy = selectSysCustomerHealthyByPhone(sysCustomerHealthy.getPhone()); + if (customerHealthy != null) { + return AjaxResult.error("该手机号已存在"); + } + //根据手机号查询客户基础信息,判断是否已存在 + SysCustomer phoneCustomer = sysCustomerService.getCustomerByPhone(sysCustomerHealthy.getPhone()); + if(phoneCustomer != null) { + return AjaxResult.error("该手机号已存在"); + } + } + SysCustomer newSysCustomer = new SysCustomer(); + newSysCustomer.setId(sysCustomerHealthy.getCustomerId()); + newSysCustomer.setName(sysCustomerHealthy.getName()); + newSysCustomer.setPhone(sysCustomerHealthy.getPhone()); + if(sysCustomerService.updateSysCustomer(newSysCustomer) > 0){ + cutomerId = newSysCustomer.getId(); + } + } + int rows = 0; + if(cutomerId != null && cutomerId > 0){ + sysCustomerHealthy.setCustomerId(cutomerId); + rows = sysCustomerHealthy.getId() == null ? sysCustomerHealthyMapper.insertSysCustomerHealthy(sysCustomerHealthy) : sysCustomerHealthyMapper.updateSysCustomerHealthy(sysCustomerHealthy); + } + return rows > 0 ? AjaxResult.success() : AjaxResult.error(); + } + + /** + * 批量删除客户健康 + * + * @param ids 需要删除的客户健康ID + * @return 结果 + */ + @Override + public int deleteSysCustomerHealthyByIds(Long[] ids) + { + return sysCustomerHealthyMapper.deleteSysCustomerHealthyByIds(ids); + } + + /** + * 删除客户健康信息 + * + * @param id 客户健康ID + * @return 结果 + */ + @Override + public int deleteSysCustomerHealthyById(Long id) + { + return sysCustomerHealthyMapper.deleteSysCustomerHealthyById(id); + } + + /** + * 根据手机号查询客户健康评估信息 + * @param phone + */ + @Override + public SysCustomerHealthy selectSysCustomerHealthyByPhone(String phone){ + return sysCustomerHealthyMapper.selectSysCustomerHealthyByPhone(phone); + } +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerPhysicalSignsServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerPhysicalSignsServiceImpl.java index 653b19da0..2a2de8674 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerPhysicalSignsServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerPhysicalSignsServiceImpl.java @@ -1,7 +1,13 @@ package com.stdiet.custom.service.impl; import java.util.List; + +import com.stdiet.common.core.domain.AjaxResult; import com.stdiet.common.utils.DateUtils; +import com.stdiet.common.utils.bean.ObjectUtils; +import com.stdiet.custom.domain.SysCustomer; +import com.stdiet.custom.dto.request.CustomerInvestigateRequest; +import com.stdiet.custom.service.ISysCustomerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.stdiet.custom.mapper.SysCustomerPhysicalSignsMapper; @@ -20,6 +26,9 @@ public class SysCustomerPhysicalSignsServiceImpl implements ISysCustomerPhysical @Autowired private SysCustomerPhysicalSignsMapper sysCustomerPhysicalSignsMapper; + @Autowired + private ISysCustomerService sysCustomerService; + /** * 查询客户体征信息 * @@ -32,18 +41,6 @@ public class SysCustomerPhysicalSignsServiceImpl implements ISysCustomerPhysical return sysCustomerPhysicalSignsMapper.selectSysCustomerPhysicalSignsById(id); } - /** - * 查询客户体征信息列表 - * - * @param sysCustomerPhysicalSigns 客户体征信息 - * @return 客户体征信息 - */ - @Override - public List selectSysCustomerPhysicalSignsList(SysCustomerPhysicalSigns sysCustomerPhysicalSigns) - { - return sysCustomerPhysicalSignsMapper.selectSysCustomerPhysicalSignsList(sysCustomerPhysicalSigns); - } - /** * 新增客户体征信息 * @@ -93,4 +90,91 @@ public class SysCustomerPhysicalSignsServiceImpl implements ISysCustomerPhysical { return sysCustomerPhysicalSignsMapper.deleteSysCustomerPhysicalSignsById(id); } + + /** + * 客户体征资料填写 + * + * @param customerInvestigateRequest 客户体征资料 + * @return 结果 + */ + public AjaxResult addOrupdateCustomerAndSign(CustomerInvestigateRequest customerInvestigateRequest) throws Exception{ + //当前登录用户 + //LoginUser loginUser = SecurityUtils.getLoginUser(); + Long cutomerId = 0L; + //新增 + if(customerInvestigateRequest.getId() == null){ + //根据手机号查询客户体征信息,判断是否已存在 + SysCustomerPhysicalSigns sysCustomerPhysicalSigns = selectSysCustomerAndSignByPhone(customerInvestigateRequest.getPhone()); + if(sysCustomerPhysicalSigns != null){ + return AjaxResult.error("该手机号已存在"); + } + //根据手机号查询客户基础信息,判断是否已存在 + SysCustomer phoneCustomer = sysCustomerService.getCustomerByPhone(customerInvestigateRequest.getPhone()); + if(phoneCustomer != null){ + if(!customerInvestigateRequest.getName().equals(phoneCustomer.getName())){ + return AjaxResult.error("该手机号与姓名不符"); + } + cutomerId = phoneCustomer.getId(); + }else{ + SysCustomer newSysCustomer = new SysCustomer(); + newSysCustomer.setName(customerInvestigateRequest.getName()); + newSysCustomer.setPhone(customerInvestigateRequest.getPhone()); + if(sysCustomerService.insertSysCustomer(newSysCustomer) > 0){ + cutomerId = newSysCustomer.getId(); + } + } + } + //更新 + else{ + SysCustomer oldCustomer = sysCustomerService.selectSysCustomerById(customerInvestigateRequest.getCustomerId()); + //如果修改了手机号,则需要判断手机号是否已经存在 + if(oldCustomer != null && !oldCustomer.getPhone().equals(customerInvestigateRequest.getPhone())) { + //验证该手机号是否已存在客户体征信息 + SysCustomerPhysicalSigns sysCustomerPhysicalSigns = selectSysCustomerAndSignByPhone(customerInvestigateRequest.getPhone()); + if (sysCustomerPhysicalSigns != null) { + return AjaxResult.error("该手机号已存在"); + } + //根据手机号查询客户基础信息,判断是否已存在 + SysCustomer phoneCustomer = sysCustomerService.getCustomerByPhone(customerInvestigateRequest.getPhone()); + if(phoneCustomer != null) { + return AjaxResult.error("该手机号已存在"); + } + } + SysCustomer newSysCustomer = new SysCustomer(); + newSysCustomer.setId(customerInvestigateRequest.getCustomerId()); + newSysCustomer.setName(customerInvestigateRequest.getName()); + newSysCustomer.setPhone(customerInvestigateRequest.getPhone()); + if(sysCustomerService.updateSysCustomer(newSysCustomer) > 0){ + cutomerId = newSysCustomer.getId(); + } + } + int rows = 0; + if(cutomerId != null && cutomerId > 0){ + SysCustomerPhysicalSigns customerSigns = ObjectUtils.getObjectByObject(customerInvestigateRequest, SysCustomerPhysicalSigns.class); + customerSigns.setCustomerId(cutomerId); + customerSigns.setId(customerInvestigateRequest.getId()); + rows = customerInvestigateRequest.getId() == null ? insertSysCustomerPhysicalSigns(customerSigns) : updateSysCustomerPhysicalSigns(customerSigns); + } + return rows > 0 ? AjaxResult.success() : AjaxResult.error(); + } + + /** + * 查询客户基础信息以及体征信息列表 + * + * @param sysCustomerPhysicalSigns 查询条件 + * @return 结果 + */ + public List selectSysCustomerAndSignList(SysCustomerPhysicalSigns sysCustomerPhysicalSigns){ + return sysCustomerPhysicalSignsMapper.selectSysCustomerAndSignList(sysCustomerPhysicalSigns); + } + + /** + * 根据手机号查询客户以及体征 + * @param phone + * @return + */ + @Override + public SysCustomerPhysicalSigns selectSysCustomerAndSignByPhone(String phone){ + return sysCustomerPhysicalSignsMapper.selectSysCustomerAndSignByPhone(phone); + } } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerServiceImpl.java index 37e4f655f..096395324 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerServiceImpl.java @@ -115,77 +115,4 @@ public class SysCustomerServiceImpl implements ISysCustomerService public SysCustomer getCustomerByPhone(String phone){ return sysCustomerMapper.getCustomerByPhone(phone); } - - /** - * 客户建档资料填写 - * - * @param customerInvestigateRequest 客户建档相关资料 - * @return 结果 - */ - public int addOrupdateCustomerAndSign(CustomerInvestigateRequest customerInvestigateRequest) throws Exception{ - //当前登录用户 - //LoginUser loginUser = SecurityUtils.getLoginUser(); - SysCustomer sysCustomer = new SysCustomer(); - sysCustomer.setId(customerInvestigateRequest.getId()); - sysCustomer.setName(customerInvestigateRequest.getName()); - sysCustomer.setPhone(customerInvestigateRequest.getPhone()); - //添加人、更新人 - /*if(loginUser != null){ - if(customerInvestigateRequest.getId() == null){ - sysCustomer.setCreateBy(loginUser.getUser().getUserId()+""); - }else{ - sysCustomer.setUpdateBy(loginUser.getUser().getUserId()+""); - } - }*/ - //sysCustomer.setEmail(customerInvestigateRequest.getEmail()); - //sysCustomer.setAddress(customerInvestigateRequest.getAddress()); - int addOrUpdateRow = customerInvestigateRequest.getId() == null ? insertSysCustomer(sysCustomer) : updateSysCustomer(sysCustomer); - if(addOrUpdateRow > 0){ - SysCustomerPhysicalSigns customerSigns = ObjectUtils.getObjectByObject(customerInvestigateRequest, SysCustomerPhysicalSigns.class); - customerSigns.setCustomerId(sysCustomer.getId()); - customerSigns.setId(null); - addOrUpdateRow = customerInvestigateRequest.getId() == null ? sysCustomerPhysicalSignsMapper.insertSysCustomerPhysicalSigns(customerSigns) : sysCustomerPhysicalSignsMapper.updateSysCustomerPhysicalSignsByCustomerId(customerSigns); - } - return addOrUpdateRow; - } - - /** - * 查询客户基础信息以及体征信息列表 - * - * @param sysCustomer 查询条件 - * @return 结果 - */ - public List selectSysCustomerAndSignList(SysCustomer sysCustomer){ - return sysCustomerMapper.selectSysCustomerAndSignList(sysCustomer); - } - - /** - * 根据id查询客户信息(基础信息以及体征信息) - * - * @param id 客户id - * @return 结果 - */ - public SysCustomer getCustomerAndSignById(Long id){ - SysCustomer sysCustomer = new SysCustomer(); - sysCustomer.setId(id); - List list = sysCustomerMapper.selectSysCustomerAndSignList(sysCustomer); - return list.size() > 0 ? list.get(0) : null; - } - - public int delCustomerAndSignById(Long[] ids){ - if(deleteSysCustomerByIds(ids) > 0){ - return sysCustomerPhysicalSignsMapper.deleteSysCustomerPhysicalSignsByCustomerIds(ids); - } - return 0; - } - - /** - * 根据手机号查询客户以及体征 - * @param phone - * @return - */ - @Override - public SysCustomer selectSysCustomerAndSignByPhone(String phone){ - return sysCustomerMapper.selectSysCustomerAndSignByPhone(phone); - } } \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml new file mode 100644 index 000000000..ebe0212e6 --- /dev/null +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml @@ -0,0 +1,434 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select sch.id, customer_id, conditioning_project_id, sex, age, 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, sch.create_time, sch.create_by,sch. update_time, sch.update_by, sch.del_flag + + + + + + + + insert into sys_customer_healthy + + id, + customer_id, + conditioning_project_id, + sex, + age, + 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, + create_time, + create_by, + update_time, + update_by, + del_flag, + + + #{id}, + #{customerId}, + #{conditioningProjectId}, + #{sex}, + #{age}, + #{condiment}, + #{otherCondiment}, + #{cookingStyle}, + #{cookingStyleRate}, + #{washVegetablesStyle}, + #{otherWashVegetablesStyle}, + #{breakfastType}, + #{breakfastFood}, + #{lunchType}, + #{dinner}, + #{vegetableRate}, + #{commonMeat}, + #{dinnerTime}, + #{supperNum}, + #{supperFood}, + #{dietHotAndCold}, + #{dietFlavor}, + #{vegetablesNum}, + #{vegetablesRateType}, + #{fruitsNum}, + #{fruitsTime}, + #{fruitsRate}, + #{riceNum}, + #{riceFull}, + #{eatingSpeed}, + #{snacks}, + #{otherSnacks}, + #{healthProductsFlag}, + #{healthProductsBrand}, + #{healthProductsName}, + #{healthProductsWeekRate}, + #{healthProductsDayRate}, + #{waterNum}, + #{waterType}, + #{waterHabit}, + #{drinksNum}, + #{drinkWineFlag}, + #{drinkWineClassify}, + #{otherWineClassify}, + #{drinkWineAmount}, + #{smokeFlag}, + #{smokeRate}, + #{secondSmoke}, + #{workIndustry}, + #{workType}, + #{defecationNum}, + #{otherDefecationNum}, + #{defecationTime}, + #{defecationShape}, + #{defecationSmell}, + #{defecationSpeed}, + #{defecationColor}, + #{motionNum}, + #{motionDuration}, + #{motionTime}, + #{aerobicMotionClassify}, + #{anaerobicMotionClassify}, + #{anaerobicAerobicMotionClassify}, + #{otherMotionClassify}, + #{motionField}, + #{otherMotionField}, + #{sleepTime}, + #{sleepQuality}, + #{sleepDrugFlag}, + #{sleepDrug}, + #{stayupLateFlag}, + #{stayupLateWeekNum}, + #{familyIllnessHistory}, + #{otherFamilyIllnessHistory}, + #{operationHistory}, + #{otherOperationHistory}, + #{nearOperationFlag}, + #{recoveryeSituation}, + #{longEatDrugFlag}, + #{longEatDrugClassify}, + #{otherLongEatDrugClassify}, + #{allergyFlag}, + #{allergySituation}, + #{allergen}, + #{otherAllergen}, + #{medicalReport}, + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + #{delFlag}, + + + + + update sys_customer_healthy + + customer_id = #{customerId}, + conditioning_project_id = #{conditioningProjectId}, + sex = #{sex}, + age = #{age}, + condiment = #{condiment}, + other_condiment = #{otherCondiment}, + cooking_style = #{cookingStyle}, + cooking_style_rate = #{cookingStyleRate}, + wash_vegetables_style = #{washVegetablesStyle}, + other_wash_vegetables_style = #{otherWashVegetablesStyle}, + breakfast_type = #{breakfastType}, + breakfast_food = #{breakfastFood}, + lunch_type = #{lunchType}, + dinner = #{dinner}, + vegetable_rate = #{vegetableRate}, + common_meat = #{commonMeat}, + dinner_time = #{dinnerTime}, + supper_num = #{supperNum}, + supper_food = #{supperFood}, + diet_hot_and_cold = #{dietHotAndCold}, + diet_flavor = #{dietFlavor}, + vegetables_num = #{vegetablesNum}, + vegetables_rate_type = #{vegetablesRateType}, + fruits_num = #{fruitsNum}, + fruits_time = #{fruitsTime}, + fruits_rate = #{fruitsRate}, + rice_num = #{riceNum}, + rice_full = #{riceFull}, + eating_speed = #{eatingSpeed}, + snacks = #{snacks}, + other_snacks = #{otherSnacks}, + health_products_flag = #{healthProductsFlag}, + health_products_brand = #{healthProductsBrand}, + health_products_name = #{healthProductsName}, + health_products_week_rate = #{healthProductsWeekRate}, + health_products_day_rate = #{healthProductsDayRate}, + water_num = #{waterNum}, + water_type = #{waterType}, + water_habit = #{waterHabit}, + drinks_num = #{drinksNum}, + drink_wine_flag = #{drinkWineFlag}, + drink_wine_classify = #{drinkWineClassify}, + other_wine_classify = #{otherWineClassify}, + drink_wine_amount = #{drinkWineAmount}, + smoke_flag = #{smokeFlag}, + smoke_rate = #{smokeRate}, + second_smoke = #{secondSmoke}, + work_industry = #{workIndustry}, + work_type = #{workType}, + defecation_num = #{defecationNum}, + other_defecation_num = #{otherDefecationNum}, + defecation_time = #{defecationTime}, + defecation_shape = #{defecationShape}, + defecation_smell = #{defecationSmell}, + defecation_speed = #{defecationSpeed}, + defecation_color = #{defecationColor}, + motion_num = #{motionNum}, + motion_duration = #{motionDuration}, + motion_time = #{motionTime}, + aerobic_motion_classify = #{aerobicMotionClassify}, + anaerobic_motion_classify = #{anaerobicMotionClassify}, + anaerobic_aerobic_motion_classify = #{anaerobicAerobicMotionClassify}, + other_motion_classify = #{otherMotionClassify}, + motion_field = #{motionField}, + other_motion_field = #{otherMotionField}, + sleep_time = #{sleepTime}, + sleep_quality = #{sleepQuality}, + sleep_drug_flag = #{sleepDrugFlag}, + sleep_drug = #{sleepDrug}, + stayup_late_flag = #{stayupLateFlag}, + stayup_late_week_num = #{stayupLateWeekNum}, + family_illness_history = #{familyIllnessHistory}, + other_family_illness_history = #{otherFamilyIllnessHistory}, + operation_history = #{operationHistory}, + other_operation_history = #{otherOperationHistory}, + near_operation_flag = #{nearOperationFlag}, + recoverye_situation = #{recoveryeSituation}, + long_eat_drug_flag = #{longEatDrugFlag}, + long_eat_drug_classify = #{longEatDrugClassify}, + other_long_eat_drug_classify = #{otherLongEatDrugClassify}, + allergy_flag = #{allergyFlag}, + allergy_situation = #{allergySituation}, + allergen = #{allergen}, + other_allergen = #{otherAllergen}, + medical_report = #{medicalReport}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + del_flag = #{delFlag}, + + where id = #{id} + + + + update sys_customer_healthy set del_flag = 1 where id = #{id} + + + + update sys_customer_healthy set del_flag = 1 where id in + + #{id} + + + + + + + + \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml index 4a24643fd..78d64845e 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml @@ -26,62 +26,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select id, name, phone, email, address, pay_date, start_date, purchase_num, pay_total, main_dietitian, assistant_dietitian, after_dietitian, salesman, charge_person, follow_status, create_time, create_by, update_time, update_by from sys_customer @@ -184,38 +128,6 @@ where phone = #{phone} and del_flag = 0 - - - select sc.id, sc.name, sc.phone, sc.create_time, sc.create_by, sc.update_time, sc.update_by, - - from sys_customer sc - left join sys_customer_physical_signs scps on scps.customer_id = sc.id and scps.del_flag = 0 - - - scps.sex, scps.age, scps.tall, scps.weight, scps.physical_signs_id, scps.dishes_ingredient_id, scps.photo, scps.constipation, - scps.stayLate, scps.motion, scps.make_food_type, scps.make_food_taste, scps.walk, scps.difficulty, scps.weakness, scps.rebound, scps.crux, scps.position, - scps.sleep_time, scps.getup_time, scps.connect_time, scps.remarks, scps.blood_data, scps.moisture_date, scps.vocation, - scps.night, scps.experience, scps.comments - - - - - - - - - \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml index 601d5bc3d..fc22489a2 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml @@ -4,9 +4,13 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + + + + + @@ -39,48 +43,28 @@ + + - - select id, customer_id, sex, age, tall, weight, physical_signs_id, dishes_ingredient_id, photo, constipation, stayLate, motion, make_food_type, make_food_taste, walk, difficulty, weakness, rebound, crux, position, sleep_time, getup_time, connect_time, remarks, blood_data, moisture_date, vocation, - night, experience, comments, create_time, create_by, update_time, update_by from sys_customer_physical_signs + + select scps.id,scps.customer_id,scps.sex, scps.age, scps.tall, scps.weight, scps.physical_signs_id, scps.dishes_ingredient_id, scps.photo, scps.constipation, + scps.stayLate, scps.motion, scps.make_food_type, scps.make_food_taste, scps.walk, scps.difficulty, scps.weakness, scps.rebound, scps.crux, scps.position, + scps.sleep_time, scps.getup_time, scps.connect_time, scps.remarks, scps.blood_data, scps.moisture_date, scps.vocation, + scps.night, scps.experience, scps.comments, scps.create_time, sc.name, sc.phone + from sys_customer_physical_signs scps + left join sys_customer sc on scps.customer_id = sc.id - + where scps.del_flag = 0 and sc.del_flag = 0 + and sc.name like concat('%', #{name}, '%') + and sc.phone like concat('%', #{phone}, '%') + order by scps.create_time desc - + where scps.del_flag = 0 and sc.del_flag = 0 and scps.id = #{id} @@ -198,61 +182,24 @@ - update sys_customer_physical_signs set del_flag = 0 where id = #{id} + update sys_customer_physical_signs set del_flag = 1 where id = #{id} - update sys_customer_physical_signs set del_flag = 0 where id in + update sys_customer_physical_signs set del_flag = 1 where id in #{id} - - - update sys_customer_physical_signs - - sex = #{sex}, - age = #{age}, - tall = #{tall}, - weight = #{weight}, - physical_signs_id = #{physicalSignsId}, - dishes_ingredient_id = #{dishesIngredientId}, - photo = #{photo}, - constipation = #{constipation}, - stayLate = #{staylate}, - motion = #{motion}, - make_food_type = #{makeFoodType}, - make_food_taste = #{makeFoodTaste}, - walk = #{walk}, - difficulty = #{difficulty}, - weakness = #{weakness}, - rebound = #{rebound}, - crux = #{crux}, - position = #{position}, - sleep_time = #{sleepTime}, - getup_time = #{getupTime}, - connect_time = #{connectTime}, - remarks = #{remarks}, - blood_data = #{bloodData}, - moisture_date = #{moistureDate}, - vocation = #{vocation}, - night = #{night}, - experience = #{experience}, - comments = #{comments}, - create_time = #{createTime}, - create_by = #{createBy}, - update_time = #{updateTime}, - update_by = #{updateBy}, - - where customer_id = #{customerId} - + + - - update sys_customer_physical_signs set del_flag = 0 where customer_id in - - #{id} - - + + \ No newline at end of file diff --git a/stdiet-framework/src/main/java/com/stdiet/framework/config/SecurityConfig.java b/stdiet-framework/src/main/java/com/stdiet/framework/config/SecurityConfig.java index c677b63fc..6e78cbf75 100644 --- a/stdiet-framework/src/main/java/com/stdiet/framework/config/SecurityConfig.java +++ b/stdiet-framework/src/main/java/com/stdiet/framework/config/SecurityConfig.java @@ -101,7 +101,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { "/custom/contract/file/**", "/custom/wxUserInfo/wx/**", "/custom/wxUserLog/wx/**", - "/investigate/**" + "/investigate/**", + "/common/customerUploadFile" ).anonymous() .antMatchers( HttpMethod.GET, diff --git a/stdiet-ui/src/api/custom/customerInvestigation.js b/stdiet-ui/src/api/custom/customerInvestigation.js index 7c184e9ab..57c739566 100644 --- a/stdiet-ui/src/api/custom/customerInvestigation.js +++ b/stdiet-ui/src/api/custom/customerInvestigation.js @@ -25,3 +25,12 @@ export function getDictData(dictType) { method: 'get' }) } + +// 新增客户健康 +export function addCustomerHealthy(data) { + return request({ + url: '/investigate/addCustomerHealthy', + method: 'post', + data: data + }) +} diff --git a/stdiet-ui/src/api/custom/healthy.js b/stdiet-ui/src/api/custom/healthy.js new file mode 100644 index 000000000..e0b25c6d0 --- /dev/null +++ b/stdiet-ui/src/api/custom/healthy.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询客户健康列表 +export function listHealthy(query) { + return request({ + url: '/custom/healthy/list', + method: 'get', + params: query + }) +} + +// 查询客户健康详细 +export function getHealthy(id) { + return request({ + url: '/custom/healthy/' + id, + method: 'get' + }) +} + +// 新增客户健康 +export function addHealthy(data) { + return request({ + url: '/custom/healthy', + method: 'post', + data: data + }) +} + +// 修改客户健康 +export function updateHealthy(data) { + return request({ + url: '/custom/healthy', + method: 'put', + data: data + }) +} + +// 删除客户健康 +export function delHealthy(id) { + return request({ + url: '/custom/healthy/' + id, + method: 'delete' + }) +} + +// 导出客户健康 +export function exportHealthy(query) { + return request({ + url: '/custom/healthy/export', + method: 'get', + params: query + }) +} diff --git a/stdiet-ui/src/utils/healthyData.js b/stdiet-ui/src/utils/healthyData.js new file mode 100644 index 000000000..50c160819 --- /dev/null +++ b/stdiet-ui/src/utils/healthyData.js @@ -0,0 +1,177 @@ +export const condimentArray = [ + {"name":"鸡精", "value":"1"}, + {"name":"耗油", "value":"2"}, + {"name":"生抽", "value":"3"}, + {"name":"老抽", "value":"4"}, + {"name":"香油", "value":"5"}, + {"name":"浓汤宝", "value":"6"}, + {"name":"鸡粉", "value":"7"}, + {"name":"花椒", "value":"8"}, + {"name":"辣椒油", "value":"9"} +] + +export const cookingStyleArray = [ + {"name":"煎","value":"1"},{"name":"烤","value":"2"},{"name":"炸","value":"3"},{"name":"卤","value":"4"}, + {"name":"腌","value":"5"},{"name":"腊","value":"6"},{"name":"煲","value":"7"},{"name":"炒","value":"8"}, + {"name":"蒸","value":"9"},{"name":"刺身","value":"10"},{"name":"水煮","value":"11"} +] + +export const cookingStyleRateArray = ["煎","炸","卤","腌","腊","煲"] + +export const washVegetablesStyleArray = [ + {"name":"先切后洗","value": "1"},{"name":"先洗后切","value": "2"},{"name":"切后浸泡","value": "3"} +] + +export const breakfastTypeArray = [ + {"name":"不吃","value": "1"},{"name":"偶尔吃","value": "2"},{"name":"每天吃","value": "3"} +] + +export const lunchTypeArray = [ + {"name":"外卖","value":"1"},{"name":"自带餐","value":"2"},{"name":"快餐","value":"3"},{"name":"餐厅","value":"4"} +] + +export const dinnerArray = [ + {"name":"餐馆吃","value":"1"},{"name":"在家吃","value":"2"},{"name":"丰盛","value":"3"},{"name":"清淡","value":"4"} +] + +export const dietHotAndColdArray = [ + {"name":"偏冷食","value":"1"},{"name":"偏冷食","value":"2"},{"name":"正常","value":"3"} +] + +export const dietFlavorArray = [ + {"name":"偏油","value":"1"},{"name":"偏咸","value":"2"},{"name":"偏辣","value":"3"}, + {"name":"偏甜","value":"4"},{"name":"偏酸","value":"5"},{"name":"清淡","value":"6"} +] + +export const vegetablesRateTypeArray = [ + {"name":"每天吃","value":"1"},{"name":"经常吃","value":"2"},{"name":"偶尔吃","value":"3"},{"name":"从不吃","value":"4"} +] + +export const fruitsTimeArray = [ + {"name":"餐前","value":"1"},{"name":"餐后","value":"2"},{"name":"餐间","value":"3"} +] + + +export const fruitsRateArray = [ + {"name":"每天吃","value":"1"},{"name":"经常吃","value":"2"},{"name":"偶尔吃","value":"3"},{"name":"从不吃","value":"4"} +] + +export const eatingSpeedArray = [ + {"name":"很快","value":"1"},{"name":"偏快","value":"2"},{"name":"正常","value":"3"},{"name":"偏慢","value":"4"} + ,{"name":"很慢","value":"5"} +] + +export const snacksArray = [ + {"name":"面包","value":"1"},{"name":"蛋糕","value":"2"},{"name":"饼干","value":"3"},{"name":"冰淇淋","value":"4"} + ,{"name":"糖果","value":"5"},{"name":"巧克力","value":"6"},{"name":"方便面","value":"7"},{"name":"薯条","value":"8"},{"name":"肉干","value":"9"}, + {"name":"坚果","value":"10"},{"name":"饮料","value":"11"},{"name":"果脯","value":"12"},{"name":"牛奶","value":"13"} +] + + +export const waterTypeArray = [ + {"name":"冰水","value":"1"},{"name":"温水","value":"2"},{"name":"常温水","value":"3"} +] + + +export const waterHabitArray = [ + {"name":"均匀地喝","value":"1"},{"name":"餐前多喝","value":"2"},{"name":"餐后多喝","value":"3"},{"name":"餐间多喝","value":"4"}, + {"name":"随时喝","value":"5"} +] + +export const drinksNumArray = ["老火汤","咖啡","浓茶","奶茶","冷饮","碳酸饮料","甜饮料","鲜榨果汁"] + + +export const drinkWineFlagArray = [ + {"name":"经常饮酒","value": "1"},{"name":"不饮酒","value": "2"},{"name":"偶尔","value": "3"} +] + + +export const drinkWineClassifyArray = [ + {"name":"白酒","value": "1"},{"name":"红酒","value": "2"},{"name":"啤酒","value": "3"} +] + +export const drinkWineAmountArray = ["白酒","啤酒","红酒"] + +export const drinkWineAmountUnitArray = ["两","瓶","毫升"] + +export const smokeRateArray = ["每天抽烟","烟龄","已戒烟"] +export const smokeRateUnitArray = ["次","年","年"] + +export const workTypeArray = [ + {"name":"工作时间长","value": "1"},{"name":"久坐","value": "2"},{"name":"久站","value": "3"}, + {"name":"走动多","value": "4"},{"name":"强度大","value": "5"},{"name":"用电脑多","value": "6"},{"name":"体力工作多","value": "7"} +] + +export const defecationTimeArray = [ + {"name":"上午","value": "1"},{"name":"中午","value": "2"},{"name":"晚上","value": "3"} +] + +export const aerobicMotionClassifyArray = [ + {"name":"跳绳","value": "1"},{"name":"跑步","value": "2"},{"name":"游泳","value": "3"} +] +export const anaerobicMotionClassifyArray = [ + {"name":"撸铁","value": "1"},{"name":"俯卧撑","value": "2"} +] + +export const anaerobicAerobicMotionClassifyArray = [ + {"name":"拳击","value": "1"},{"name":"瑜伽","value": "2"} +] + +export const motionFieldArray = [ + {"name":"居家","value": "1"},{"name":"健身房","value": "2"},{"name":"户外","value": "3"}, {"name":"健身房","value": "4"} +] + +export const sleepQualityArray = [ + {"name":"好","value": "1"},{"name":"一般","value": "2"},{"name":"入睡难","value": "3"}, + {"name":"失眠","value": "4"},{"name":"易醒","value": "5"},{"name":"多梦","value": "6"} +] + +export const familyIllnessHistoryArray = [ + {"name":"高血压病","value": "1"},{"name":"脑卒中","value": "2"},{"name":"冠心病","value": "3"}, + {"name":"外周血管病","value": "4"},{"name":"心力衰竭","value": "5"},{"name":"冠心病","value": "6"}, + {"name":"肥胖症","value": "7"},{"name":"慢性肾脏疾病","value": "8"},{"name":"骨质疏松","value": "9"}, + {"name":"痛风","value": "10"},{"name":"精神疾病","value": "11"},{"name":"恶性肿瘤","value": "12"}, + {"name":"慢性阻塞性肺病","value": "13"},{"name":"风湿性免疫性疾病","value": "14"}, +] + +export const operationHistoryArray = [ + {"name":"头颅(含脑)","value": "1"},{"name":"眼","value": "2"},{"name":"耳鼻咽喉","value": "3"}, + {"name":"颌面部及口腔","value": "4"},{"name":"颈部或甲状腺","value": "5"},{"name":"胸部(含肺部)","value": "6"}, + {"name":"心脏(含心脏介入)","value": "7"},{"name":"外周血管","value": "8"},{"name":"胃肠","value": "9"}, + {"name":"肝胆","value": "10"},{"name":"肾脏","value": "11"},{"name":"脊柱","value": "12"}, + {"name":"四肢及关节","value": "13"},{"name":"前列腺","value": "14"},{"name":"妇科","value": "15"},{"name":"乳腺","value": "16"} + ,{"name":"膀胱","value": "17"} +] + +export const longEatDrugClassifyArray = [ + {"name":"降压药","value": "1"},{"name":"降糖药","value": "2"},{"name":"降尿酸药","value": "3"}, + {"name":"抗心律失常药","value": "4"},{"name":"缓解哮喘药物","value": "5"},{"name":"抗压郁药物","value": "6"}, + {"name":"雌激素类药物","value": "7"},{"name":"利尿剂","value": "8"},{"name":"中草药","value": "9"}, + {"name":"避孕药","value": "10"},{"name":"强的松类药物","value": "11"},{"name":"镇静剂或安眠药","value": "12"}, + {"name":"调值药(降脂药)","value": "13"},{"name":"解热镇痛药(如布洛芬等)","value": "14"} +] + + export const allergenArray = [ + {"name":"青霉素","value": "1"},{"name":"磺胺类","value": "2"},{"name":"链霉素","value": "3"}, + {"name":"头孢类","value": "4"},{"name":"鸡蛋","value": "5"},{"name":"牛奶","value": "6"}, + {"name":"海鲜","value": "7"},{"name":"花粉或尘螨","value": "8"},{"name":"粉尘","value": "9"}, + {"name":"洗洁剂","value": "10"},{"name":"化妆品","value": "11"} +] + +//需要将数组转成字符串的属性名称,包含对象数组、字符串数组 +export const arrayName = [ + "condiment","cookingStyle","cookingStyleRate", "washVegetablesStyle","lunchType","dinner","dietFlavor", + "snacks","waterType","waterHabit","drinksNum","drinkWineClassify","drinkWineAmount","smokeRate", + "workType","defecationTime","aerobicMotionClassify","anaerobicMotionClassify","anaerobicAerobicMotionClassify", + "motionField","sleepQuality", "familyIllnessHistory", "operationHistory", "longEatDrugClassify", "allergen", "medicalReport" +] + +//需要将数字下标转成中文含义的属性名 +export const needAttrName = [ + "condiment","cookingStyle", "washVegetablesStyle","breakfastType","lunchType","dinner","dietFlavor","vegetablesRateType","dietHotAndCold", + "fruitsTime","fruitsRate","eatingSpeed", + "snacks","waterType","waterHabit","drinkWineFlag","drinkWineClassify", + "workType","defecationTime","aerobicMotionClassify","anaerobicMotionClassify","anaerobicAerobicMotionClassify", + "motionField","sleepQuality", "familyIllnessHistory", "operationHistory", "longEatDrugClassify", "allergen" +] + diff --git a/stdiet-ui/src/views/custom/customer/index.vue b/stdiet-ui/src/views/custom/customer/index.vue index 8a1c6e99e..d8330d6c7 100644 --- a/stdiet-ui/src/views/custom/customer/index.vue +++ b/stdiet-ui/src/views/custom/customer/index.vue @@ -69,7 +69,7 @@ 营养体征调查 + >营养体征调查 @@ -84,133 +84,133 @@ - + - - - - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + 客户健康评估表 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stdiet-ui/src/views/custom/investigate/questionnaire.vue b/stdiet-ui/src/views/custom/investigate/questionnaire.vue index 4a14780a2..a485b0128 100644 --- a/stdiet-ui/src/views/custom/investigate/questionnaire.vue +++ b/stdiet-ui/src/views/custom/investigate/questionnaire.vue @@ -280,7 +280,6 @@ export default { ], phone: [ { required: true, trigger: "blur", message: "请填写手机号" }, - { required: true, trigger: "blur", message: "请填写正确的手机号" }, { required: true, trigger: "blur", @@ -376,10 +375,15 @@ export default { }, addCustomer() { if (this.submitFlag) { - return; + this.$message({ + message: "请勿重复提交", + type: "warning", + }); + return; } this.$refs.form.validate((valid) => { if (valid) { + this.submitFlag = true; let cusMessage = Object.assign({}, this.form); cusMessage.bloodData = cusMessage.bloodData != null @@ -404,7 +408,8 @@ export default { message: "", type: "success", }); - this.submitFlag = true; + }else{ + this.submitFlag = false; } }); } else { diff --git a/stdiet-ui/src/views/custom/order/index.vue b/stdiet-ui/src/views/custom/order/index.vue index 76074813a..cf8a9b1e2 100644 --- a/stdiet-ui/src/views/custom/order/index.vue +++ b/stdiet-ui/src/views/custom/order/index.vue @@ -718,7 +718,13 @@ {required: true, message: "金额不能为空", trigger: "blur"} ], phone: [ - {required: true, message: "手机号不能为空", trigger: "blur"} + {required: true, message: "手机号不能为空", trigger: "blur"}, + { + required: true, + trigger: "blur", + pattern: /^[0-9]{5,11}$/, + message: "手机号格式不正确", + } ], orderTime: [ {required: true, message: "成交时间不能为空", trigger: "blur"}, diff --git a/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue b/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue index f4f4a7f64..46674b665 100644 --- a/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue +++ b/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue @@ -3,120 +3,108 @@
logo
+
+ + + +
-

基础信息

- - - - - - - - - - - - - - - -

一、食品安全评估

+
+

一、基础信息

+ + + + + + + + + + + + + + + + + + + + + +
+ +
+

二、食品安全评估

1、家庭调味品

- 鸡精 - 耗油 - 生抽 - 老抽 - 香油 - 浓汤宝 - 鸡粉 - 花椒 - 辣椒油 + {{item.name}}
其他调味品

2、喜好的烹调方式和周频次

- - - - - - - - - - 刺身 - 水煮 + {{item.name}}
- 煎  次 - 炸  次 + 煎  次 + 炸  次
卤  次 - 腌  次 + 腌  次
- 腊  次 - 煲  次 + 腊  次 + 煲  次

3、洗菜方式

- 先切后洗 - 先洗后切 - 切后浸泡 + {{item.name}}
其他洗菜方式
+
- -

二、饮食结构评估

+
+

三、饮食结构评估

1、您三餐的习惯

- - 不吃 - 偶尔吃 - 每天吃 + {{item.name}}
早餐通常吃 
- 外卖 - 自带餐 - 快餐 - 餐厅 + {{item.name}} - 餐馆吃 - 在家吃 - 丰盛 - 清淡 + {{item.name}} - +

2、您晚餐时间点和夜宵习惯

- + @@ -127,19 +115,12 @@

3、您的饮食偏好

- 偏冷食 - 偏烫食 - 正常 + {{item.name}} - 偏油 - 偏咸 - 偏辣 - 偏甜 - 偏酸 - 清淡 + {{item.name}}

4、生食果蔬状况

@@ -148,28 +129,28 @@
-
每天吃 - 经常吃 - 偶尔吃
-
从不吃
+ {{item.name}} +
- 餐前 - 餐后 - 餐间 + {{item.name}} -
- 每天吃 - 经常吃 - 偶尔吃 -
-
从不吃
+ {{item.name}} +

5、饮食习惯

@@ -181,32 +162,13 @@ -
- 很快 - 偏快 - 正常 -
-
- 偏慢 - 很慢 -
+ {{item.name}}

6、您常吃的零食

- 面包 - 蛋糕 - 饼干 - 冰淇淋 - 糖果 - 巧克力 - 方便面 - 薯条 - 肉干 - 饮料 - 果脯 - 牛奶 + {{item.name}}
其他零食
@@ -225,26 +187,21 @@  次/天
- -

三、生活习惯评估

+ +
+

四、生活习惯评估

1、您每天的饮水习惯

- 冰水 - 温水 - 常温水 + {{item.name}} - 均匀地喝 - 餐前多喝 - 餐后多喝 - 餐间多喝 - 随时喝 + {{item.name}}

2、您常喝的饮品和每周频次

@@ -277,16 +234,12 @@

3、您的饮酒习惯

- 经常饮酒 - 不饮酒 - 偶尔 + {{item.name}} - 白酒 - 红酒 - 啤酒 + {{item.name}}
其他酒
@@ -300,9 +253,9 @@
红酒 毫升
-
+

4、您的吸烟习惯

@@ -334,33 +287,24 @@ - 工作时间长 - 久坐 - 久站 - 走动多 - 强度大 - 用电脑多 - 体力工作多 + {{item.name}}

4、您的排便状况

- + +
排便次数 次/天
- 上午 - 中午 - 晚上 + {{item.name}} -
形状 @@ -375,8 +319,9 @@ 颜色
- -

四、运动习惯评估

+
+
+

五、运动习惯评估

1、运动频率

@@ -390,58 +335,47 @@

2、运动方式、项目

- + +
有氧运动 - 跳绳 - 跑步 - 游泳 + {{item.name}}
有氧运动 - 撸铁 - 俯卧撑 + {{item.name}}
有氧无氧结合运动 - 拳击 - 瑜伽 + {{item.name}}
其他项目
- 居家 - 健身房 - 居家 - 健身房 + {{item.name}}
其他场地
- -

五、睡眠质量评估

+
+
+

六、睡眠质量评估

1、您的睡眠状况

- - 一般 - 入睡难 - 失眠 - 易醒 - 多梦 + {{item.name}}

2、辅助入睡药物情况

@@ -462,12 +396,13 @@ 熬夜频率 次/周
- -

六、既往病史/用药史评估

+
+
+

七、既往病史/用药史评估

1、家族疾病史情况

- {{item}} + {{item.name}}
其他家族病史 2、手术情况

- {{item}} + {{item.name}}
其他手术史 - {{item}} + {{item.name}}
其他长期服用的药物 - {{item}} + {{item.name}}
其他过敏源
+
- +
+

八、体检报告

+

1、体检报告

+ + + 选取文件 + 重置 +
提示:最多可上传三份,且每份文件不超过5M
+
+
+
+ + 上一步 已填写完成,提交数据下一步 + 提交数据 +