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 a70738998..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 @@ -8,6 +8,7 @@ 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; @@ -28,7 +29,7 @@ import java.util.List; public class InvestigateController extends BaseController { @Autowired - private ISysCustomerService iSysCustomerService; + private ISysCustomerPhysicalSignsService sysCustomerPhysicalSignsService; @Autowired private ISysPhysicalSignsService iSysPhysicalSignsService; @@ -45,13 +46,8 @@ public class InvestigateController extends BaseController { @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); } /** @@ -80,8 +76,7 @@ public class InvestigateController extends BaseController { @PostMapping("/addCustomerHealthy") public AjaxResult addCustomerHealthy(@RequestBody SysCustomerHealthy sysCustomerHealthy) { - System.out.println(sysCustomerHealthy.getSex()); - return toAjax(1); + 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 index b61f9e02f..5ad21ebe8 100644 --- 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 @@ -27,7 +27,7 @@ import com.stdiet.common.core.page.TableDataInfo; * @date 2021-01-23 */ @RestController -@RequestMapping("/customer/healthy") +@RequestMapping("/custom/healthy") public class SysCustomerHealthyController extends BaseController { @Autowired @@ -36,7 +36,7 @@ public class SysCustomerHealthyController extends BaseController /** * 查询客户健康列表 */ - @PreAuthorize("@ss.hasPermi('customer:healthy:list')") + @PreAuthorize("@ss.hasPermi('custom:healthy:list')") @GetMapping("/list") public TableDataInfo list(SysCustomerHealthy sysCustomerHealthy) { @@ -48,7 +48,7 @@ public class SysCustomerHealthyController extends BaseController /** * 导出客户健康列表 */ - @PreAuthorize("@ss.hasPermi('customer:healthy:export')") + @PreAuthorize("@ss.hasPermi('custom:healthy:export')") @Log(title = "客户健康", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(SysCustomerHealthy sysCustomerHealthy) @@ -61,7 +61,7 @@ public class SysCustomerHealthyController extends BaseController /** * 获取客户健康详细信息 */ - @PreAuthorize("@ss.hasPermi('customer:healthy:query')") + @PreAuthorize("@ss.hasPermi('custom:healthy:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { @@ -76,24 +76,24 @@ public class SysCustomerHealthyController extends BaseController @PostMapping public AjaxResult add(@RequestBody SysCustomerHealthy sysCustomerHealthy) { - return toAjax(sysCustomerHealthyService.insertSysCustomerHealthy(sysCustomerHealthy)); + return sysCustomerHealthyService.insertOrUpdateSysCustomerHealthy(sysCustomerHealthy); } /** * 修改客户健康 */ - @PreAuthorize("@ss.hasPermi('customer:healthy:edit')") + @PreAuthorize("@ss.hasPermi('custom:healthy:edit')") @Log(title = "客户健康", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody SysCustomerHealthy sysCustomerHealthy) { - return toAjax(sysCustomerHealthyService.updateSysCustomerHealthy(sysCustomerHealthy)); + return sysCustomerHealthyService.insertOrUpdateSysCustomerHealthy(sysCustomerHealthy); } /** * 删除客户健康 */ - @PreAuthorize("@ss.hasPermi('customer:healthy:remove')") + @PreAuthorize("@ss.hasPermi('custom:healthy:remove')") @Log(title = "客户健康", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) 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 index b8e32cfcd..b56dfea86 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerHealthy.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerHealthy.java @@ -19,9 +19,17 @@ public class SysCustomerHealthy extends BaseEntity private Long id; /** 客户ID */ - @Excel(name = "客户ID") + //@Excel(name = "客户ID") private Long customerId; + /** 客户姓名,非持久化字段 */ + @Excel(name = "客户姓名") + private String name; + + /** 客户手机号,非持久化字段 */ + @Excel(name = "客户手机号") + private String phone; + /** 调理项目id */ @Excel(name = "调理项目id") private Long conditioningProjectId; @@ -1145,6 +1153,22 @@ public class SysCustomerHealthy extends BaseEntity 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; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 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 index 8b9d17154..9850eb379 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java @@ -1,7 +1,10 @@ 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接口 @@ -58,4 +61,10 @@ public interface SysCustomerHealthyMapper * @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 index 8f491c06d..4713cd90b 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java @@ -1,7 +1,10 @@ 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接口 @@ -28,20 +31,12 @@ public interface ISysCustomerHealthyService public List selectSysCustomerHealthyList(SysCustomerHealthy sysCustomerHealthy); /** - * 新增客户健康 + * 新增或修改客户健康 * * @param sysCustomerHealthy 客户健康 * @return 结果 */ - public int insertSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); - - /** - * 修改客户健康 - * - * @param sysCustomerHealthy 客户健康 - * @return 结果 - */ - public int updateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); + public AjaxResult insertOrUpdateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); /** * 批量删除客户健康 @@ -58,4 +53,10 @@ public interface ISysCustomerHealthyService * @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 index 3f1b86077..55a32214c 100644 --- 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 @@ -1,7 +1,12 @@ package com.stdiet.custom.service.impl; import java.util.List; -import com.stdiet.common.utils.DateUtils; + +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; @@ -20,6 +25,9 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService @Autowired private SysCustomerHealthyMapper sysCustomerHealthyMapper; + @Autowired + private ISysCustomerService sysCustomerService; + /** * 查询客户健康 * @@ -51,23 +59,64 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService * @return 结果 */ @Override - public int insertSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy) + public AjaxResult insertOrUpdateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy) { - sysCustomerHealthy.setCreateTime(DateUtils.getNowDate()); - return sysCustomerHealthyMapper.insertSysCustomerHealthy(sysCustomerHealthy); - } - - /** - * 修改客户健康 - * - * @param sysCustomerHealthy 客户健康 - * @return 结果 - */ - @Override - public int updateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy) - { - sysCustomerHealthy.setUpdateTime(DateUtils.getNowDate()); - return sysCustomerHealthyMapper.updateSysCustomerHealthy(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(); } /** @@ -93,4 +142,13 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService { 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 index 352d6afbd..26df193b7 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml @@ -7,6 +7,10 @@ + + + + @@ -99,19 +103,22 @@ - select 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 from sys_customer_healthy + 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 @@ -401,15 +408,23 @@ where id = #{id} - - delete from sys_customer_healthy where id = #{id} - + + update sys_customer_healthy set del_flag = 1 where id = #{id} + - - delete from sys_customer_healthy where id in + + 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-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/views/custom/customer/index.vue b/stdiet-ui/src/views/custom/customer/index.vue index 8a1c6e99e..e23500606 100644 --- a/stdiet-ui/src/views/custom/customer/index.vue +++ b/stdiet-ui/src/views/custom/customer/index.vue @@ -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 12f3734f5..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", 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 2da2c118d..9166db6d3 100644 --- a/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue +++ b/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue @@ -692,14 +692,14 @@ export default { {"name":"洗洁剂","value": "10"},{"name":"化妆品","value": "11"} ], conditioningProjectIdOption:[], - stepArray: [false,false,false,false,false,false,false,true], - stepActive: 7, + stepArray: [true,false,false,false,false,false,false,false], + stepActive: 0, form: { - name: "jun", - phone: "152708980", + name: null, + phone: null, conditioningProjectId: 0, sex: 1, - age: 18, + age: null, condiment:["1","5","9","6","1","3"], otherCondiment:null, cookingStyle: ["8","9","4","11"],