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 83f151ba0..e53782b46 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 @@ -3,17 +3,16 @@ package com.stdiet.web.controller.common; import com.stdiet.common.core.controller.BaseController; import com.stdiet.common.core.domain.AjaxResult; import com.stdiet.common.core.page.TableDataInfo; +import com.stdiet.common.enums.BusinessType; import com.stdiet.common.utils.StringUtils; import com.stdiet.common.utils.sign.AesUtils; -import com.stdiet.custom.domain.SysCustomer; -import com.stdiet.custom.domain.SysCustomerHealthy; -import com.stdiet.custom.domain.SysOrder; -import com.stdiet.custom.domain.SysPhysicalSigns; +import com.stdiet.custom.domain.*; import com.stdiet.custom.dto.request.CustomerInvestigateRequest; import com.stdiet.custom.dto.request.FoodHeatCalculatorRequest; import com.stdiet.custom.service.*; import com.stdiet.system.service.ISysDictTypeService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import java.util.HashMap; @@ -51,6 +50,9 @@ public class InvestigateController extends BaseController { @Autowired private ISysOrderService sysOrderService; + @Autowired + private ISysPreSaleSurveyService sysPreSaleSurveyService; + /** * 建立客户信息档案 */ @@ -123,4 +125,34 @@ public class InvestigateController extends BaseController { return toAjax(sysFoodHeatStatisticsService.addMuchFoodHeat(foodHeatCalculatorRequest)); } + /** + * 添加用户基础信息问卷调查表 + */ + @PostMapping(value = "/addCustomerSurvey") + public AjaxResult addCustomerSurvey(@RequestBody SysPreSaleSurvey sysPreSaleSurvey) + { + //判断客户唯一标识是否为空 + if(StringUtils.isEmpty(sysPreSaleSurvey.getCustomerKey())){ + return AjaxResult.error("操作失败,缺少必要参数"); + } + SysPreSaleSurvey oldSysPreSale = sysPreSaleSurveyService.getSysPreSaleSurveyByKey(sysPreSaleSurvey.getCustomerKey()); + if(oldSysPreSale != null){ + return AjaxResult.error("已提交过问卷,无法重复提交"); + } + return toAjax(sysPreSaleSurveyService.insertSysPreSaleSurvey(sysPreSaleSurvey)); + } + + /** + * 根据客户唯一标识 + */ + @GetMapping("/getCustomerSurvey/{customerKey}") + public AjaxResult getCustomerSurvey(@PathVariable("customerKey")String customerKey) + { + //判断客户唯一标识是否为空 + if(StringUtils.isEmpty(customerKey)){ + return AjaxResult.error("操作失败,缺少必要参数"); + } + SysPreSaleSurvey preSaleSurvey = sysPreSaleSurveyService.getSysPreSaleSurveyByKey(customerKey); + return AjaxResult.success(preSaleSurvey); + } } diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java index a94f16d44..178c563c3 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java @@ -83,6 +83,8 @@ public class WechatAppletController extends BaseController { @RequestParam(value="randomFlag",required = false,defaultValue = "false") boolean randomFlag) { if(randomFlag){ List reponseList = sysCustomerCaseService.getWxCustomerCaseByRandom(pageSize); + //处理ID加密 + dealIdEnc(reponseList); TableDataInfo rspData = new TableDataInfo(); rspData.setCode(HttpStatus.SUCCESS); rspData.setMsg("查询成功"); @@ -305,8 +307,10 @@ public class WechatAppletController extends BaseController { * @return */ private void dealIdEnc(List list) { - for (CustomerCaseResponse cus : list) { - cus.setId(AesUtils.encrypt(cus.getId() + "", null)); + if(list != null){ + for (CustomerCaseResponse cus : list) { + cus.setId(AesUtils.encrypt(cus.getId() + "", null)); + } } } diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysPreSaleSurvey.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysPreSaleSurvey.java new file mode 100644 index 000000000..c1efc3110 --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysPreSaleSurvey.java @@ -0,0 +1,85 @@ +package com.stdiet.custom.domain; + +import com.stdiet.common.annotation.Excel; +import com.stdiet.common.core.domain.BaseEntity; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 售前调查,销售给客户发送简易信息调查链接对象 sys_pre_sale_survey + * + * @author xzj + * @date 2021-07-05 + */ +@Data +public class SysPreSaleSurvey extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 客户唯一标识 */ + @Excel(name = "客户唯一标识") + private String customerKey; + + /** 姓名 */ + @Excel(name = "姓名") + private String name; + + /** 身高,厘米 */ + @Excel(name = "身高,厘米") + private Integer tall; + + /** 体重 */ + @Excel(name = "体重") + private BigDecimal weight; + + /** 年龄 */ + @Excel(name = "年龄") + private Integer age; + + /** 0男 1女 */ + @Excel(name = "0男 1女") + private Integer sex; + + /** 电话 */ + @Excel(name = "电话") + private String phone; + + /** 特殊体征ID */ + @Excel(name = "特殊体征ID") + private String physicalSignsId; + + /** 其他体征 */ + @Excel(name = "其他体征") + private String otherPhysicalSigns; + + /** 作息时间 */ + @Excel(name = "作息时间") + private String timeTable; + + /** 减脂或慢病调理经历 */ + @Excel(name = "减脂或慢病调理经历") + private String experience; + + /** 职业 */ + @Excel(name = "职业") + private String occupation; + + /** 气血数据 */ + @Excel(name = "气血数据") + private String bloodData; + + /** 湿气数据 */ + @Excel(name = "湿气数据") + private String moistureData; + + /** 售前ID */ + @Excel(name = "售前ID") + private Long preSaleId; + + /** 删除标识 0未删除 1已删除 */ + private Integer delFlag; +} diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysPreSaleSurveyMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysPreSaleSurveyMapper.java new file mode 100644 index 000000000..7996395dd --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysPreSaleSurveyMapper.java @@ -0,0 +1,68 @@ +package com.stdiet.custom.mapper; + +import java.util.List; +import com.stdiet.custom.domain.SysPreSaleSurvey; +import org.apache.ibatis.annotations.Param; + +/** + * 售前调查,销售给客户发送简易信息调查链接Mapper接口 + * + * @author xzj + * @date 2021-07-05 + */ +public interface SysPreSaleSurveyMapper +{ + /** + * 查询售前调查,销售给客户发送简易信息调查链接 + * + * @param id 售前调查,销售给客户发送简易信息调查链接ID + * @return 售前调查,销售给客户发送简易信息调查链接 + */ + public SysPreSaleSurvey selectSysPreSaleSurveyById(Long id); + + /** + * 查询售前调查,销售给客户发送简易信息调查链接列表 + * + * @param sysPreSaleSurvey 售前调查,销售给客户发送简易信息调查链接 + * @return 售前调查,销售给客户发送简易信息调查链接集合 + */ + public List selectSysPreSaleSurveyList(SysPreSaleSurvey sysPreSaleSurvey); + + /** + * 新增售前调查,销售给客户发送简易信息调查链接 + * + * @param sysPreSaleSurvey 售前调查,销售给客户发送简易信息调查链接 + * @return 结果 + */ + public int insertSysPreSaleSurvey(SysPreSaleSurvey sysPreSaleSurvey); + + /** + * 修改售前调查,销售给客户发送简易信息调查链接 + * + * @param sysPreSaleSurvey 售前调查,销售给客户发送简易信息调查链接 + * @return 结果 + */ + public int updateSysPreSaleSurvey(SysPreSaleSurvey sysPreSaleSurvey); + + /** + * 删除售前调查,销售给客户发送简易信息调查链接 + * + * @param id 售前调查,销售给客户发送简易信息调查链接ID + * @return 结果 + */ + public int deleteSysPreSaleSurveyById(Long id); + + /** + * 批量删除售前调查,销售给客户发送简易信息调查链接 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteSysPreSaleSurveyByIds(Long[] ids); + + /** + * 根据客户唯一标识查询问卷 + * @return + */ + public SysPreSaleSurvey getSysPreSaleSurveyByKey(@Param("customerKey")String customerKey); +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysPreSaleSurveyService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysPreSaleSurveyService.java new file mode 100644 index 000000000..3db85be46 --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysPreSaleSurveyService.java @@ -0,0 +1,67 @@ +package com.stdiet.custom.service; + +import java.util.List; +import com.stdiet.custom.domain.SysPreSaleSurvey; + +/** + * 售前调查,销售给客户发送简易信息调查链接Service接口 + * + * @author xzj + * @date 2021-07-05 + */ +public interface ISysPreSaleSurveyService +{ + /** + * 查询售前调查,销售给客户发送简易信息调查链接 + * + * @param id 售前调查,销售给客户发送简易信息调查链接ID + * @return 售前调查,销售给客户发送简易信息调查链接 + */ + public SysPreSaleSurvey selectSysPreSaleSurveyById(Long id); + + /** + * 查询售前调查,销售给客户发送简易信息调查链接列表 + * + * @param sysPreSaleSurvey 售前调查,销售给客户发送简易信息调查链接 + * @return 售前调查,销售给客户发送简易信息调查链接集合 + */ + public List selectSysPreSaleSurveyList(SysPreSaleSurvey sysPreSaleSurvey); + + /** + * 新增售前调查,销售给客户发送简易信息调查链接 + * + * @param sysPreSaleSurvey 售前调查,销售给客户发送简易信息调查链接 + * @return 结果 + */ + public int insertSysPreSaleSurvey(SysPreSaleSurvey sysPreSaleSurvey); + + /** + * 修改售前调查,销售给客户发送简易信息调查链接 + * + * @param sysPreSaleSurvey 售前调查,销售给客户发送简易信息调查链接 + * @return 结果 + */ + public int updateSysPreSaleSurvey(SysPreSaleSurvey sysPreSaleSurvey); + + /** + * 批量删除售前调查,销售给客户发送简易信息调查链接 + * + * @param ids 需要删除的售前调查,销售给客户发送简易信息调查链接ID + * @return 结果 + */ + public int deleteSysPreSaleSurveyByIds(Long[] ids); + + /** + * 删除售前调查,销售给客户发送简易信息调查链接信息 + * + * @param id 售前调查,销售给客户发送简易信息调查链接ID + * @return 结果 + */ + public int deleteSysPreSaleSurveyById(Long id); + + /** + * 根据客户唯一标识查询问卷 + * @return + */ + public SysPreSaleSurvey getSysPreSaleSurveyByKey(String customerKey); +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysPreSaleSurveyServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysPreSaleSurveyServiceImpl.java new file mode 100644 index 000000000..d35117f8a --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysPreSaleSurveyServiceImpl.java @@ -0,0 +1,105 @@ +package com.stdiet.custom.service.impl; + +import java.util.List; +import com.stdiet.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.stdiet.custom.mapper.SysPreSaleSurveyMapper; +import com.stdiet.custom.domain.SysPreSaleSurvey; +import com.stdiet.custom.service.ISysPreSaleSurveyService; + +/** + * 售前调查,销售给客户发送简易信息调查链接Service业务层处理 + * + * @author xzj + * @date 2021-07-05 + */ +@Service +public class SysPreSaleSurveyServiceImpl implements ISysPreSaleSurveyService +{ + @Autowired + private SysPreSaleSurveyMapper sysPreSaleSurveyMapper; + + /** + * 查询售前调查,销售给客户发送简易信息调查链接 + * + * @param id 售前调查,销售给客户发送简易信息调查链接ID + * @return 售前调查,销售给客户发送简易信息调查链接 + */ + @Override + public SysPreSaleSurvey selectSysPreSaleSurveyById(Long id) + { + return sysPreSaleSurveyMapper.selectSysPreSaleSurveyById(id); + } + + /** + * 查询售前调查,销售给客户发送简易信息调查链接列表 + * + * @param sysPreSaleSurvey 售前调查,销售给客户发送简易信息调查链接 + * @return 售前调查,销售给客户发送简易信息调查链接 + */ + @Override + public List selectSysPreSaleSurveyList(SysPreSaleSurvey sysPreSaleSurvey) + { + return sysPreSaleSurveyMapper.selectSysPreSaleSurveyList(sysPreSaleSurvey); + } + + /** + * 新增售前调查,销售给客户发送简易信息调查链接 + * + * @param sysPreSaleSurvey 售前调查,销售给客户发送简易信息调查链接 + * @return 结果 + */ + @Override + public int insertSysPreSaleSurvey(SysPreSaleSurvey sysPreSaleSurvey) + { + sysPreSaleSurvey.setCreateTime(DateUtils.getNowDate()); + return sysPreSaleSurveyMapper.insertSysPreSaleSurvey(sysPreSaleSurvey); + } + + /** + * 修改售前调查,销售给客户发送简易信息调查链接 + * + * @param sysPreSaleSurvey 售前调查,销售给客户发送简易信息调查链接 + * @return 结果 + */ + @Override + public int updateSysPreSaleSurvey(SysPreSaleSurvey sysPreSaleSurvey) + { + sysPreSaleSurvey.setUpdateTime(DateUtils.getNowDate()); + return sysPreSaleSurveyMapper.updateSysPreSaleSurvey(sysPreSaleSurvey); + } + + /** + * 批量删除售前调查,销售给客户发送简易信息调查链接 + * + * @param ids 需要删除的售前调查,销售给客户发送简易信息调查链接ID + * @return 结果 + */ + @Override + public int deleteSysPreSaleSurveyByIds(Long[] ids) + { + return sysPreSaleSurveyMapper.deleteSysPreSaleSurveyByIds(ids); + } + + /** + * 删除售前调查,销售给客户发送简易信息调查链接信息 + * + * @param id 售前调查,销售给客户发送简易信息调查链接ID + * @return 结果 + */ + @Override + public int deleteSysPreSaleSurveyById(Long id) + { + return sysPreSaleSurveyMapper.deleteSysPreSaleSurveyById(id); + } + + /** + * 根据客户唯一标识查询问卷 + * @return + */ + @Override + public SysPreSaleSurvey getSysPreSaleSurveyByKey(String customerKey){ + return sysPreSaleSurveyMapper.getSysPreSaleSurveyByKey(customerKey); + } +} \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysPreSaleSurveyMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysPreSaleSurveyMapper.xml new file mode 100644 index 000000000..4b33f45f6 --- /dev/null +++ b/stdiet-custom/src/main/resources/mapper/custom/SysPreSaleSurveyMapper.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, customer_key, name, tall, weight, age, sex, phone, physical_signs_id, other_physical_signs, time_table, experience, occupation, blood_data, moisture_data, pre_sale_id, create_time, update_time, create_by, update_by, del_flag from sys_pre_sale_survey + + + + + + + + insert into sys_pre_sale_survey + + customer_key, + name, + tall, + weight, + age, + sex, + phone, + physical_signs_id, + other_physical_signs, + time_table, + experience, + occupation, + blood_data, + moisture_data, + pre_sale_id, + create_time, + update_time, + create_by, + update_by, + del_flag, + + + #{customerKey}, + #{name}, + #{tall}, + #{weight}, + #{age}, + #{sex}, + #{phone}, + #{physicalSignsId}, + #{otherPhysicalSigns}, + #{timeTable}, + #{experience}, + #{occupation}, + #{bloodData}, + #{moistureData}, + #{preSaleId}, + #{createTime}, + #{updateTime}, + #{createBy}, + #{updateBy}, + #{delFlag}, + + + + + update sys_pre_sale_survey + + customer_key = #{customerKey}, + name = #{name}, + tall = #{tall}, + weight = #{weight}, + age = #{age}, + sex = #{sex}, + phone = #{phone}, + physical_signs_id = #{physicalSignsId}, + other_physical_signs = #{otherPhysicalSigns}, + time_table = #{timeTable}, + experience = #{experience}, + occupation = #{occupation}, + blood_data = #{bloodData}, + moisture_date = #{moistureData}, + pre_sale_id = #{preSaleId}, + create_time = #{createTime}, + update_time = #{updateTime}, + create_by = #{createBy}, + update_by = #{updateBy}, + del_flag = #{delFlag}, + + where id = #{id} + + + + update sys_pre_sale_survey set del_flag = 1 where id = #{id} + + + + update sys_pre_sale_survey set del_flag = 1 where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/stdiet-ui/src/api/custom/customerInvestigation.js b/stdiet-ui/src/api/custom/customerInvestigation.js index 7142da67f..fe0d36d77 100644 --- a/stdiet-ui/src/api/custom/customerInvestigation.js +++ b/stdiet-ui/src/api/custom/customerInvestigation.js @@ -52,3 +52,22 @@ export function addFoodHeatStatistics(data) { }) } + +// 根据客户唯一标识查询对应基础信息问卷调查表 +export function getCustomerSurvey(customerKey) { + return request({ + url: '/investigate/getCustomerSurvey/'+(customerKey != undefined && customerKey != null ? customerKey : ""), + method: 'get' + }) +} + +// 添加客户基础信息问卷,携带者客户唯一标识 +export function addCustomerSurvey(customerSurvey) { + return request({ + url: '/investigate/addCustomerSurvey', + method: 'post', + data: customerSurvey + }) +} + + diff --git a/stdiet-ui/src/api/custom/preSaleSurvey.js b/stdiet-ui/src/api/custom/preSaleSurvey.js new file mode 100644 index 000000000..da2b1ee16 --- /dev/null +++ b/stdiet-ui/src/api/custom/preSaleSurvey.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询售前调查,销售给客户发送简易信息调查链接列表 +export function listPreSaleSurvey(query) { + return request({ + url: '/custom/preSaleSurvey/list', + method: 'get', + params: query + }) +} + +// 查询售前调查,销售给客户发送简易信息调查链接详细 +export function getPreSaleSurvey(id) { + return request({ + url: '/custom/preSaleSurvey/' + id, + method: 'get' + }) +} + +// 新增售前调查,销售给客户发送简易信息调查链接 +export function addPreSaleSurvey(data) { + return request({ + url: '/custom/preSaleSurvey', + method: 'post', + data: data + }) +} + +// 修改售前调查,销售给客户发送简易信息调查链接 +export function updatePreSaleSurvey(data) { + return request({ + url: '/custom/preSaleSurvey', + method: 'put', + data: data + }) +} + +// 删除售前调查,销售给客户发送简易信息调查链接 +export function delPreSaleSurvey(id) { + return request({ + url: '/custom/preSaleSurvey/' + id, + method: 'delete' + }) +} + +// 导出售前调查,销售给客户发送简易信息调查链接 +export function exportPreSaleSurvey(query) { + return request({ + url: '/custom/preSaleSurvey/export', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/stdiet-ui/src/components/OrderAdd/index.vue b/stdiet-ui/src/components/OrderAdd/index.vue index 4106ea2a0..35dc68352 100644 --- a/stdiet-ui/src/components/OrderAdd/index.vue +++ b/stdiet-ui/src/components/OrderAdd/index.vue @@ -275,6 +275,14 @@ + + + + + + + + + @@ -724,6 +733,7 @@ export default { payTypeId: defaultPayType ? parseInt(defaultPayType.dictValue) : null, preSaleId: defaultPresale ? parseInt(defaultPresale.dictValue) : null, pushPreSaleId: null, + recipesPlanContinue: 1, createBy: null, createTime: null, onSaleId: null, diff --git a/stdiet-ui/src/components/PhysicalSignsDialog/index.vue b/stdiet-ui/src/components/PhysicalSignsDialog/index.vue index 897c203a2..519fb6747 100644 --- a/stdiet-ui/src/components/PhysicalSignsDialog/index.vue +++ b/stdiet-ui/src/components/PhysicalSignsDialog/index.vue @@ -679,7 +679,8 @@ export default { (detailHealthy.tall / 100) ).toFixed(1); - this.detailHealthy = healthyData.dealHealthyExtend(detailHealthy); + healthyData.dealHealthyExtend(detailHealthy); + this.detailHealthy = detailHealthy; for (let i = 0; i < this.healthyTitleData.length; i++) { let stepArray = []; for (let j = 0; j < this.healthyTitleData[i].length; j++) { @@ -750,6 +751,7 @@ export default { }, generateReport() { let data = this.detailHealthy; + console.log(this.detailHealthy); if ( !this.guidanceList[0].guidanceValue || this.guidanceList[0].guidanceValue.length == 0 diff --git a/stdiet-ui/src/permission.js b/stdiet-ui/src/permission.js index 110ddb218..a36de713b 100644 --- a/stdiet-ui/src/permission.js +++ b/stdiet-ui/src/permission.js @@ -64,7 +64,8 @@ router.beforeEach((to, from, next) => { to.path.startsWith("/f/contract/") || to.path.startsWith("/recipes/detail/") || to.path.startsWith("/subhealthyInvestigation/") || - to.path.startsWith("/foodHeatCalculator/") + to.path.startsWith("/foodHeatCalculator/") || + to.path.startsWith("/preSaleSurvey/") ) { // 在免登录白名单,直接进入 next(); diff --git a/stdiet-ui/src/router/index.js b/stdiet-ui/src/router/index.js index cd5169b06..a9dc8f184 100644 --- a/stdiet-ui/src/router/index.js +++ b/stdiet-ui/src/router/index.js @@ -179,7 +179,14 @@ export const constantRoutes = [ require(["@/views/custom/foodHeatStatistics/investigate"], resolve), hidden: true, meta: { title: "外食计算器" } - } + }, + { + path: "/preSaleSurvey/:customerKey", + component: resolve => + require(["@/views/custom/preSaleSurvey/survey"], resolve), + hidden: true, + meta: { title: "胜唐体控基础问卷表" } + }, ]; export default new Router({ diff --git a/stdiet-ui/src/views/custom/preSaleSurvey/index.vue b/stdiet-ui/src/views/custom/preSaleSurvey/index.vue new file mode 100644 index 000000000..e69de29bb diff --git a/stdiet-ui/src/views/custom/preSaleSurvey/survey/index.vue b/stdiet-ui/src/views/custom/preSaleSurvey/survey/index.vue new file mode 100644 index 000000000..95dbd66d4 --- /dev/null +++ b/stdiet-ui/src/views/custom/preSaleSurvey/survey/index.vue @@ -0,0 +1,349 @@ + + + +