From 20371f9469e4ef5fc97e066a1aaa523d22b97c51 Mon Sep 17 00:00:00 2001 From: xiezhijun <15270898033@163.com> Date: Fri, 19 Feb 2021 19:14:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=96=E9=A3=9F=E8=AE=A1=E7=AE=97=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/InvestigateController.java | 19 +- .../custom/SysCustomerController.java | 9 +- .../SysFoodHeatStatisticsController.java | 103 +++++++ .../com/stdiet/custom/domain/SysCustomer.java | 189 +------------ .../custom/domain/SysFoodHeatStatistics.java | 65 +++++ .../custom/domain/SysWxFanStatistics.java | 2 + .../request/FoodHeatCalculatorRequest.java | 16 ++ .../mapper/SysFoodHeatStatisticsMapper.java | 68 +++++ .../ISysFoodHeatStatisticsService.java | 69 +++++ .../SysFoodHeatStatisticsServiceImpl.java | 128 +++++++++ .../custom/SysFoodHeatStatisticsMapper.xml | 119 +++++++++ .../custom/SysWxFanStatisticsMapper.xml | 1 + .../src/api/custom/customerInvestigation.js | 9 + .../src/api/custom/foodHeatStatistics.js | 53 ++++ .../components/HeatStatisticsDrawer/index.vue | 148 ++++++++++ .../src/components/OrderDrawer/index.vue | 8 +- .../components/PhysicalSignsDialog/index.vue | 9 +- stdiet-ui/src/permission.js | 3 +- stdiet-ui/src/router/index.js | 10 +- stdiet-ui/src/views/custom/customer/index.vue | 19 +- .../src/views/custom/fanStatistics/index.vue | 30 ++- .../views/custom/foodHeatStatistics/index.vue | 21 ++ .../foodHeatStatistics/investigate/index.vue | 252 ++++++++++++++++++ 23 files changed, 1141 insertions(+), 209 deletions(-) create mode 100644 stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysFoodHeatStatisticsController.java create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/domain/SysFoodHeatStatistics.java create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/dto/request/FoodHeatCalculatorRequest.java create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysFoodHeatStatisticsMapper.java create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/service/ISysFoodHeatStatisticsService.java create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysFoodHeatStatisticsServiceImpl.java create mode 100644 stdiet-custom/src/main/resources/mapper/custom/SysFoodHeatStatisticsMapper.xml create mode 100644 stdiet-ui/src/api/custom/foodHeatStatistics.js create mode 100644 stdiet-ui/src/components/HeatStatisticsDrawer/index.vue create mode 100644 stdiet-ui/src/views/custom/foodHeatStatistics/index.vue create mode 100644 stdiet-ui/src/views/custom/foodHeatStatistics/investigate/index.vue 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 e262c25ba..1e07cbb69 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 @@ -9,14 +9,11 @@ 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.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.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; import java.util.HashMap; import java.util.List; @@ -47,6 +44,9 @@ public class InvestigateController extends BaseController { @Autowired private ISysCustomerService sysCustomerService; + @Autowired + private ISysFoodHeatStatisticsService sysFoodHeatStatisticsService; + /** * 建立客户信息档案 */ @@ -107,4 +107,13 @@ public class InvestigateController extends BaseController { return sysCustomerHealthyService.insertSysCustomerHealthy(sysCustomerHealthy); } + /** + * 新增客户外食计算统计 + */ + @PostMapping("/addFoodHeatStatistics") + public AjaxResult addFoodHeatStatistics(@RequestBody FoodHeatCalculatorRequest foodHeatCalculatorRequest) + { + return toAjax(sysFoodHeatStatisticsService.addMuchFoodHeat(foodHeatCalculatorRequest)); + } + } 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 e559be4f7..e97616b3e 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 @@ -53,6 +53,7 @@ public class SysCustomerController extends BaseController { for (SysCustomer sysCus : list) { if (StringUtils.isNotEmpty(sysCus.getPhone())) { sysCus.setPhone(StringUtils.hiddenPhoneNumber(sysCus.getPhone())); + sysCus.setEncId(sysCus.getId() != null ? AesUtils.encrypt(sysCus.getId()+"", null) : ""); } } } @@ -143,17 +144,17 @@ public class SysCustomerController extends BaseController { //查询健康评估信息 SysCustomerHealthy sysCustomerHealthy = sysCustomerHealthyService.selectSysCustomerHealthyByCustomerId(id); if(sysCustomerHealthy != null){ - if (StringUtils.isNotEmpty(sysCustomerHealthy.getPhone())) { + /* if (StringUtils.isNotEmpty(sysCustomerHealthy.getPhone())) { sysCustomerHealthy.setPhone(StringUtils.hiddenPhoneNumber(sysCustomerHealthy.getPhone())); - } + }*/ result.put(key, sysCustomerHealthy); }else{ //查询体征信息 SysCustomerPhysicalSigns sysCustomerPhysicalSigns = sysCustomerPhysicalSignsService.selectSysCustomerPhysicalSignsByCusId(id); if(sysCustomerPhysicalSigns != null){ - if (StringUtils.isNotEmpty(sysCustomerPhysicalSigns.getPhone())) { + /* if (StringUtils.isNotEmpty(sysCustomerPhysicalSigns.getPhone())) { sysCustomerPhysicalSigns.setPhone(StringUtils.hiddenPhoneNumber(sysCustomerPhysicalSigns.getPhone())); - } + }*/ result.put("type", 1); } result.put(key, sysCustomerPhysicalSigns); diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysFoodHeatStatisticsController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysFoodHeatStatisticsController.java new file mode 100644 index 000000000..59cc986e7 --- /dev/null +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysFoodHeatStatisticsController.java @@ -0,0 +1,103 @@ +package com.stdiet.web.controller.custom; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import 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.SysFoodHeatStatistics; +import com.stdiet.custom.service.ISysFoodHeatStatisticsService; +import com.stdiet.common.utils.poi.ExcelUtil; +import com.stdiet.common.core.page.TableDataInfo; + +/** + * 外食热量统计Controller + * + * @author xzj + * @date 2021-02-19 + */ +@RestController +@RequestMapping("/custom/foodHeatStatistics") +public class SysFoodHeatStatisticsController extends BaseController +{ + @Autowired + private ISysFoodHeatStatisticsService sysFoodHeatStatisticsService; + + /** + * 查询外食热量统计列表 + */ + @PreAuthorize("@ss.hasPermi('custom:foodHeatStatistics:list')") + @GetMapping("/list") + public TableDataInfo list(SysFoodHeatStatistics sysFoodHeatStatistics) + { + startPage(); + List list = sysFoodHeatStatisticsService.selectSysFoodHeatStatisticsList(sysFoodHeatStatistics); + return getDataTable(list); + } + + /** + * 导出外食热量统计列表 + */ + @PreAuthorize("@ss.hasPermi('custom:foodHeatStatistics:export')") + @Log(title = "外食热量统计", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(SysFoodHeatStatistics sysFoodHeatStatistics) + { + List list = sysFoodHeatStatisticsService.selectSysFoodHeatStatisticsList(sysFoodHeatStatistics); + ExcelUtil util = new ExcelUtil(SysFoodHeatStatistics.class); + return util.exportExcel(list, "foodHeatStatistics"); + } + + /** + * 获取外食热量统计详细信息 + */ + @PreAuthorize("@ss.hasPermi('custom:foodHeatStatistics:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(sysFoodHeatStatisticsService.selectSysFoodHeatStatisticsById(id)); + } + + /** + * 新增外食热量统计 + */ + @PreAuthorize("@ss.hasPermi('custom:foodHeatStatistics:add')") + @Log(title = "外食热量统计", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SysFoodHeatStatistics sysFoodHeatStatistics) + { + return toAjax(sysFoodHeatStatisticsService.insertSysFoodHeatStatistics(sysFoodHeatStatistics)); + } + + /** + * 修改外食热量统计 + */ + @PreAuthorize("@ss.hasPermi('custom:foodHeatStatistics:edit')") + @Log(title = "外食热量统计", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SysFoodHeatStatistics sysFoodHeatStatistics) + { + return toAjax(sysFoodHeatStatisticsService.updateSysFoodHeatStatistics(sysFoodHeatStatistics)); + } + + /** + * 删除外食热量统计 + */ + @PreAuthorize("@ss.hasPermi('custom:foodHeatStatistics:remove')") + @Log(title = "外食热量统计", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(sysFoodHeatStatisticsService.deleteSysFoodHeatStatisticsByIds(ids)); + } +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomer.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomer.java index e57f75aba..d97e1cd66 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomer.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomer.java @@ -3,6 +3,7 @@ package com.stdiet.custom.domain; import java.math.BigDecimal; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.stdiet.common.annotation.Excel; @@ -14,6 +15,7 @@ import com.stdiet.common.core.domain.BaseEntity; * @author xzj * @date 2020-12-31 */ +@Data public class SysCustomer extends BaseEntity { private static final long serialVersionUID = 1L; @@ -21,6 +23,9 @@ public class SysCustomer extends BaseEntity /** $column.columnComment */ private Long id; + //加密ID + private String encId; + /** 名字 */ @Excel(name = "名字") private String name; @@ -90,188 +95,4 @@ public class SysCustomer extends BaseEntity /** 体征数据,非持久化字段 */ private SysCustomerPhysicalSigns sign; - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - public void setName(String name) - { - this.name = name; - } - - public String getName() - { - return name; - } - public void setPhone(String phone) - { - this.phone = phone; - } - - public String getPhone() - { - return phone; - } - public void setEmail(String email) - { - this.email = email; - } - - public String getEmail() - { - return email; - } - public void setAddress(String address) - { - this.address = address; - } - - public String getAddress() - { - return address; - } - public void setPayDate(Date payDate) - { - this.payDate = payDate; - } - - public Date getPayDate() - { - return payDate; - } - public void setStartDate(Date startDate) - { - this.startDate = startDate; - } - - public Date getStartDate() - { - return startDate; - } - public void setPurchaseNum(Long purchaseNum) - { - this.purchaseNum = purchaseNum; - } - - public Long getPurchaseNum() - { - return purchaseNum; - } - public void setPayTotal(BigDecimal payTotal) - { - this.payTotal = payTotal; - } - - public BigDecimal getPayTotal() - { - return payTotal; - } - public void setMainDietitian(Long mainDietitian) - { - this.mainDietitian = mainDietitian; - } - - public Long getMainDietitian() - { - return mainDietitian; - } - public void setAssistantDietitian(Long assistantDietitian) - { - this.assistantDietitian = assistantDietitian; - } - - public Long getAssistantDietitian() - { - return assistantDietitian; - } - public void setAfterDietitian(Long afterDietitian) - { - this.afterDietitian = afterDietitian; - } - - public Long getAfterDietitian() - { - return afterDietitian; - } - public void setSalesman(Long salesman) - { - this.salesman = salesman; - } - - public Long getSalesman() - { - return salesman; - } - public void setChargePerson(Long chargePerson) - { - this.chargePerson = chargePerson; - } - - public Long getChargePerson() - { - return chargePerson; - } - public void setFollowStatus(Long followStatus) - { - this.followStatus = followStatus; - } - - public Long getFollowStatus() - { - return followStatus; - } - - public SysCustomerPhysicalSigns getSign() { - return sign; - } - - public void setSign(SysCustomerPhysicalSigns sign) { - this.sign = sign; - } - - public Integer getDelFlag() { - return delFlag; - } - - public void setDelFlag(Integer delFlag) { - this.delFlag = delFlag; - } - - public Date getFansTime() { - return fansTime; - } - - public void setFansTime(Date fansTime) { - this.fansTime = fansTime; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("name", getName()) - .append("phone", getPhone()) - .append("email", getEmail()) - .append("address", getAddress()) - .append("payDate", getPayDate()) - .append("startDate", getStartDate()) - .append("purchaseNum", getPurchaseNum()) - .append("payTotal", getPayTotal()) - .append("mainDietitian", getMainDietitian()) - .append("assistantDietitian", getAssistantDietitian()) - .append("afterDietitian", getAfterDietitian()) - .append("salesman", getSalesman()) - .append("chargePerson", getChargePerson()) - .append("followStatus", getFollowStatus()) - .append("createTime", getCreateTime()) - .append("createBy", getCreateBy()) - .append("updateTime", getUpdateTime()) - .append("updateBy", getUpdateBy()) - .toString(); - } } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysFoodHeatStatistics.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysFoodHeatStatistics.java new file mode 100644 index 000000000..c65e8060b --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysFoodHeatStatistics.java @@ -0,0 +1,65 @@ +package com.stdiet.custom.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.stdiet.common.annotation.Excel; +import com.stdiet.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * 外食热量统计对象 sys_food_heat_statistics + * + * @author xzj + * @date 2021-02-19 + */ +@Data +public class SysFoodHeatStatistics extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 客户ID */ + @Excel(name = "客户ID") + private Long customerId; + + /** 食材 */ + @Excel(name = "食材") + private String ingredient; + + /** 通俗单位ID */ + @Excel(name = "通俗单位ID") + private Long unit; + + private String unitName; + + /** 通俗单位数量 */ + @Excel(name = "通俗单位数量") + private Integer number; + + /** 具体质量,单位:克 */ + @Excel(name = "具体质量,单位:克") + private Integer quantity; + + /** 食用日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "食用日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date edibleDate; + + /** 类型,0早 1中 2晚 */ + @Excel(name = "类型,0早 1中 2晚") + private Integer edibleType; + + /** 热量数值 */ + @Excel(name = "热量数值") + private Integer heatValue; + + /** 热量缺口 */ + @Excel(name = "热量缺口") + private Integer heatGap; + + /** 删除标识 0未删除 1已删除 */ + private Integer delFlag; + +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysWxFanStatistics.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysWxFanStatistics.java index c92392aaa..47df2784e 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysWxFanStatistics.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysWxFanStatistics.java @@ -29,6 +29,8 @@ public class SysWxFanStatistics extends BaseEntity @Excel(name = "进粉账号") private String account; + private Long accountId; + //销售组别 private String saleGroup; diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/dto/request/FoodHeatCalculatorRequest.java b/stdiet-custom/src/main/java/com/stdiet/custom/dto/request/FoodHeatCalculatorRequest.java new file mode 100644 index 000000000..cf5aeb826 --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/dto/request/FoodHeatCalculatorRequest.java @@ -0,0 +1,16 @@ +package com.stdiet.custom.dto.request; + +import com.stdiet.common.core.domain.BaseEntity; +import lombok.Data; + +@Data +public class FoodHeatCalculatorRequest extends BaseEntity { + + private static final long serialVersionUID = 1L; + + //客户ID加密串 + private String customerEncId; + + //食材数据对应JSON数组字符串 + private String ingredientArray; +} diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysFoodHeatStatisticsMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysFoodHeatStatisticsMapper.java new file mode 100644 index 000000000..c3f7e2acf --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysFoodHeatStatisticsMapper.java @@ -0,0 +1,68 @@ +package com.stdiet.custom.mapper; + +import java.util.HashMap; +import java.util.List; +import com.stdiet.custom.domain.SysFoodHeatStatistics; + +/** + * 外食热量统计Mapper接口 + * + * @author xzj + * @date 2021-02-19 + */ +public interface SysFoodHeatStatisticsMapper { + /** + * 查询外食热量统计 + * + * @param id 外食热量统计ID + * @return 外食热量统计 + */ + public SysFoodHeatStatistics selectSysFoodHeatStatisticsById(Long id); + + /** + * 查询外食热量统计列表 + * + * @param sysFoodHeatStatistics 外食热量统计 + * @return 外食热量统计集合 + */ + public List selectSysFoodHeatStatisticsList(SysFoodHeatStatistics sysFoodHeatStatistics); + + /** + * 新增外食热量统计 + * + * @param sysFoodHeatStatistics 外食热量统计 + * @return 结果 + */ + public int insertSysFoodHeatStatistics(SysFoodHeatStatistics sysFoodHeatStatistics); + + /** + * 修改外食热量统计 + * + * @param sysFoodHeatStatistics 外食热量统计 + * @return 结果 + */ + public int updateSysFoodHeatStatistics(SysFoodHeatStatistics sysFoodHeatStatistics); + + /** + * 删除外食热量统计 + * + * @param id 外食热量统计ID + * @return 结果 + */ + public int deleteSysFoodHeatStatisticsById(Long id); + + /** + * 批量删除外食热量统计 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteSysFoodHeatStatisticsByIds(Long[] ids); + + /** + * 批量添加 + * @param sysFoodHeatStatisticsList + * @return + */ + public int insertFoodHeatBatch(List sysFoodHeatStatisticsList); +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysFoodHeatStatisticsService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysFoodHeatStatisticsService.java new file mode 100644 index 000000000..e72ef4e77 --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysFoodHeatStatisticsService.java @@ -0,0 +1,69 @@ +package com.stdiet.custom.service; + +import java.util.List; +import com.stdiet.custom.domain.SysFoodHeatStatistics; +import com.stdiet.custom.dto.request.FoodHeatCalculatorRequest; + +/** + * 外食热量统计Service接口 + * + * @author xzj + * @date 2021-02-19 + */ +public interface ISysFoodHeatStatisticsService +{ + /** + * 查询外食热量统计 + * + * @param id 外食热量统计ID + * @return 外食热量统计 + */ + public SysFoodHeatStatistics selectSysFoodHeatStatisticsById(Long id); + + /** + * 查询外食热量统计列表 + * + * @param sysFoodHeatStatistics 外食热量统计 + * @return 外食热量统计集合 + */ + public List selectSysFoodHeatStatisticsList(SysFoodHeatStatistics sysFoodHeatStatistics); + + /** + * 新增外食热量统计 + * + * @param sysFoodHeatStatistics 外食热量统计 + * @return 结果 + */ + public int insertSysFoodHeatStatistics(SysFoodHeatStatistics sysFoodHeatStatistics); + + /** + * 修改外食热量统计 + * + * @param sysFoodHeatStatistics 外食热量统计 + * @return 结果 + */ + public int updateSysFoodHeatStatistics(SysFoodHeatStatistics sysFoodHeatStatistics); + + /** + * 批量删除外食热量统计 + * + * @param ids 需要删除的外食热量统计ID + * @return 结果 + */ + public int deleteSysFoodHeatStatisticsByIds(Long[] ids); + + /** + * 删除外食热量统计信息 + * + * @param id 外食热量统计ID + * @return 结果 + */ + public int deleteSysFoodHeatStatisticsById(Long id); + + /** + * 客户自己添加外食计算数据,批量添加 + * @param foodHeatCalculatorRequest + * @return + */ + public int addMuchFoodHeat(FoodHeatCalculatorRequest foodHeatCalculatorRequest); +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysFoodHeatStatisticsServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysFoodHeatStatisticsServiceImpl.java new file mode 100644 index 000000000..d813fa02e --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysFoodHeatStatisticsServiceImpl.java @@ -0,0 +1,128 @@ +package com.stdiet.custom.service.impl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.stdiet.common.utils.DateUtils; +import com.stdiet.common.utils.StringUtils; +import com.stdiet.common.utils.sign.AesUtils; +import com.stdiet.custom.dto.request.FoodHeatCalculatorRequest; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.stdiet.custom.mapper.SysFoodHeatStatisticsMapper; +import com.stdiet.custom.domain.SysFoodHeatStatistics; +import com.stdiet.custom.service.ISysFoodHeatStatisticsService; + +/** + * 外食热量统计Service业务层处理 + * + * @author xzj + * @date 2021-02-19 + */ +@Service +public class SysFoodHeatStatisticsServiceImpl implements ISysFoodHeatStatisticsService +{ + @Autowired + private SysFoodHeatStatisticsMapper sysFoodHeatStatisticsMapper; + + /** + * 查询外食热量统计 + * + * @param id 外食热量统计ID + * @return 外食热量统计 + */ + @Override + public SysFoodHeatStatistics selectSysFoodHeatStatisticsById(Long id) + { + return sysFoodHeatStatisticsMapper.selectSysFoodHeatStatisticsById(id); + } + + /** + * 查询外食热量统计列表 + * + * @param sysFoodHeatStatistics 外食热量统计 + * @return 外食热量统计 + */ + @Override + public List selectSysFoodHeatStatisticsList(SysFoodHeatStatistics sysFoodHeatStatistics) + { + return sysFoodHeatStatisticsMapper.selectSysFoodHeatStatisticsList(sysFoodHeatStatistics); + } + + /** + * 新增外食热量统计 + * + * @param sysFoodHeatStatistics 外食热量统计 + * @return 结果 + */ + @Override + public int insertSysFoodHeatStatistics(SysFoodHeatStatistics sysFoodHeatStatistics) + { + sysFoodHeatStatistics.setCreateTime(DateUtils.getNowDate()); + return sysFoodHeatStatisticsMapper.insertSysFoodHeatStatistics(sysFoodHeatStatistics); + } + + /** + * 修改外食热量统计 + * + * @param sysFoodHeatStatistics 外食热量统计 + * @return 结果 + */ + @Override + public int updateSysFoodHeatStatistics(SysFoodHeatStatistics sysFoodHeatStatistics) + { + sysFoodHeatStatistics.setUpdateTime(DateUtils.getNowDate()); + return sysFoodHeatStatisticsMapper.updateSysFoodHeatStatistics(sysFoodHeatStatistics); + } + + /** + * 批量删除外食热量统计 + * + * @param ids 需要删除的外食热量统计ID + * @return 结果 + */ + @Override + public int deleteSysFoodHeatStatisticsByIds(Long[] ids) + { + return sysFoodHeatStatisticsMapper.deleteSysFoodHeatStatisticsByIds(ids); + } + + /** + * 删除外食热量统计信息 + * + * @param id 外食热量统计ID + * @return 结果 + */ + @Override + public int deleteSysFoodHeatStatisticsById(Long id) + { + return sysFoodHeatStatisticsMapper.deleteSysFoodHeatStatisticsById(id); + } + + /** + * 客户自己添加外食计算数据,批量添加 + * @param foodHeatCalculatorRequest + * @return + */ + @Override + public int addMuchFoodHeat(FoodHeatCalculatorRequest foodHeatCalculatorRequest){ + //客户ID解密 + String customerId = StringUtils.isNotEmpty(foodHeatCalculatorRequest.getCustomerEncId()) ? AesUtils.decrypt(foodHeatCalculatorRequest.getCustomerEncId(), null) : ""; + if(StringUtils.isEmpty(customerId)){ + return 0; + } + List list = new ArrayList<>(); + if(StringUtils.isNotEmpty(foodHeatCalculatorRequest.getIngredientArray())){ + List foodHeatList = JSON.parseArray(foodHeatCalculatorRequest.getIngredientArray(), HashMap.class); + for(HashMap map : foodHeatList){ + map.put("customerId", customerId); + } + return sysFoodHeatStatisticsMapper.insertFoodHeatBatch(foodHeatList); + } + return 0; + } +} \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysFoodHeatStatisticsMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysFoodHeatStatisticsMapper.xml new file mode 100644 index 000000000..fcd71fd76 --- /dev/null +++ b/stdiet-custom/src/main/resources/mapper/custom/SysFoodHeatStatisticsMapper.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select id, customer_id, ingredient, unit, number, quantity, edible_date, edible_type, heat_value, heat_gap, create_time, create_by, update_time, update_by, del_flag from sys_food_heat_statistics + + + + + + + + insert into sys_food_heat_statistics + + customer_id, + ingredient, + unit, + number, + quantity, + edible_date, + edible_type, + heat_value, + heat_gap, + create_time, + create_by, + update_time, + update_by, + del_flag, + + + #{customerId}, + #{ingredient}, + #{unit}, + #{number}, + #{quantity}, + #{edibleDate}, + #{edibleType}, + #{heatValue}, + #{heatGap}, + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + #{delFlag}, + + + + + update sys_food_heat_statistics + + customer_id = #{customerId}, + ingredient = #{ingredient}, + unit = #{unit}, + number = #{number}, + quantity = #{quantity}, + edible_date = #{edibleDate}, + edible_type = #{edibleType}, + heat_value = #{heatValue}, + heat_gap = #{heatGap}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + del_flag = #{delFlag}, + + where id = #{id} + + + + update sys_food_heat_statistics set del_flag = 1 where id = #{id} + + + + update sys_food_heat_statistics set del_flag = 1 where id in + + #{id} + + + + + insert into sys_food_heat_statistics(customer_id,ingredient,unit,number,quantity) values + + (#{food.customerId}, #{food.ingredient},#{food.unit},#{food.number},#{food.quantity}) + + + + \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysWxFanStatisticsMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysWxFanStatisticsMapper.xml index a1470da89..7c3cf6ec2 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysWxFanStatisticsMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysWxFanStatisticsMapper.xml @@ -44,6 +44,7 @@ where swfs.del_flag = 0 and swfs.fan_time = #{fanTime} and su.user_id = #{userId} + and swd.account_id = #{accountId} order by swfs.id desc diff --git a/stdiet-ui/src/api/custom/customerInvestigation.js b/stdiet-ui/src/api/custom/customerInvestigation.js index 05fd7dd6e..7142da67f 100644 --- a/stdiet-ui/src/api/custom/customerInvestigation.js +++ b/stdiet-ui/src/api/custom/customerInvestigation.js @@ -43,3 +43,12 @@ export function getCustomerBaseMessage(id) { }) } +// 新增客户外食热量计算统计 +export function addFoodHeatStatistics(data) { + return request({ + url: '/investigate/addFoodHeatStatistics', + method: 'post', + data: data + }) +} + diff --git a/stdiet-ui/src/api/custom/foodHeatStatistics.js b/stdiet-ui/src/api/custom/foodHeatStatistics.js new file mode 100644 index 000000000..81e1bb5f7 --- /dev/null +++ b/stdiet-ui/src/api/custom/foodHeatStatistics.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询外食热量统计列表 +export function listFoodHeatStatistics(query) { + return request({ + url: '/custom/foodHeatStatistics/list', + method: 'get', + params: query + }) +} + +// 查询外食热量统计详细 +export function getFoodHeatStatistics(id) { + return request({ + url: '/custom/foodHeatStatistics/' + id, + method: 'get' + }) +} + +// 新增外食热量统计 +export function addFoodHeatStatistics(data) { + return request({ + url: '/custom/foodHeatStatistics', + method: 'post', + data: data + }) +} + +// 修改外食热量统计 +export function updateFoodHeatStatistics(data) { + return request({ + url: '/custom/foodHeatStatistics', + method: 'put', + data: data + }) +} + +// 删除外食热量统计 +export function delFoodHeatStatistics(id) { + return request({ + url: '/custom/foodHeatStatistics/' + id, + method: 'delete' + }) +} + +// 导出外食热量统计 +export function exportFoodHeatStatistics(query) { + return request({ + url: '/custom/foodHeatStatistics/export', + method: 'get', + params: query + }) +} diff --git a/stdiet-ui/src/components/HeatStatisticsDrawer/index.vue b/stdiet-ui/src/components/HeatStatisticsDrawer/index.vue new file mode 100644 index 000000000..72cb90f7e --- /dev/null +++ b/stdiet-ui/src/components/HeatStatisticsDrawer/index.vue @@ -0,0 +1,148 @@ + + + diff --git a/stdiet-ui/src/components/OrderDrawer/index.vue b/stdiet-ui/src/components/OrderDrawer/index.vue index 9bded7130..7c01b3d0f 100644 --- a/stdiet-ui/src/components/OrderDrawer/index.vue +++ b/stdiet-ui/src/components/OrderDrawer/index.vue @@ -92,7 +92,7 @@ - + @@ -110,7 +110,7 @@ export default { components: { "edit-order-dialog": OrderEdit, "order-detail": OrderDetail, - "create-order-dialog": OrderAdd + //"create-order-dialog": OrderAdd }, data() { return { @@ -154,13 +154,13 @@ export default { }); }, handleAdd() { - this.$refs.cusCreateOrderDialogRef.showDialog( + this.$refs.cusEditOrderDialogRef.showDialog( { customer: this.data.name, cusId: this.data.id, preSaleId: this.data.salesman, afterSaleId: this.data.afterDietitian, - nutritionistId: [this.data.mainDietitian], + nutritionistId: this.data.mainDietitian, nutriAssisId: this.data.assistantDietitian, }, () => { diff --git a/stdiet-ui/src/components/PhysicalSignsDialog/index.vue b/stdiet-ui/src/components/PhysicalSignsDialog/index.vue index a21c58626..f20b811b1 100644 --- a/stdiet-ui/src/components/PhysicalSignsDialog/index.vue +++ b/stdiet-ui/src/components/PhysicalSignsDialog/index.vue @@ -203,8 +203,7 @@ export default { ["medicalReport_one","medicalReport_two","medicalReport_three"] ] ], - copyValue: "", - enc_id: "" + copyValue: "" }; }, methods: { @@ -245,7 +244,7 @@ export default { this.getDataListBySignMessage(res.data.customerHealthy) } } - this.enc_id = res.data.enc_id; + //this.enc_id = res.data.enc_id; this.showFlag = true; this.visible = true; }); @@ -253,7 +252,7 @@ export default { onClosed() { this.dataList = []; this.data = null; - this.enc_id = ""; + //this.enc_id = ""; this.copyValue = ""; }, //对体征信息进行处理 @@ -437,7 +436,7 @@ export default { return str; }, handleCopy() { - this.copyValue = window.location.origin.replace('manage', 'sign') + "/subhealthyInvestigation/"+this.enc_id; + this.copyValue = window.location.origin.replace('manage', 'sign') + "/subhealthyInvestigation/"+this.data.encId; const btnCopy = new Clipboard('.copyBtn'); this.$message({ message: '拷贝成功', diff --git a/stdiet-ui/src/permission.js b/stdiet-ui/src/permission.js index e1be14bf1..c1c9875bb 100644 --- a/stdiet-ui/src/permission.js +++ b/stdiet-ui/src/permission.js @@ -49,7 +49,8 @@ router.beforeEach((to, from, next) => { } } else { // 没有token - if (whiteList.indexOf(to.path) !== -1 || to.path.startsWith('/f/contract/') || to.path.startsWith('/subhealthyInvestigation/')) { + if (whiteList.indexOf(to.path) !== -1 || to.path.startsWith('/f/contract/') || to.path.startsWith('/subhealthyInvestigation/') + || to.path.startsWith('/foodHeatCalculator/')) { // 在免登录白名单,直接进入 next() } else { diff --git a/stdiet-ui/src/router/index.js b/stdiet-ui/src/router/index.js index 44c8612d2..707ae53ca 100644 --- a/stdiet-ui/src/router/index.js +++ b/stdiet-ui/src/router/index.js @@ -173,7 +173,15 @@ export const constantRoutes = [ require(["@/views/custom/subhealthy/investigation"], resolve), hidden: true, meta: { title: "胜唐体控健康评估表" } - } + }, +{ + path: "/foodHeatCalculator/:id", + component: resolve => + require(["@/views/custom/foodHeatStatistics/investigate"], resolve), + hidden: true, + meta: { title: "外食计算器" } +}, + ]; export default new Router({ diff --git a/stdiet-ui/src/views/custom/customer/index.vue b/stdiet-ui/src/views/custom/customer/index.vue index 8856647a8..764766b48 100644 --- a/stdiet-ui/src/views/custom/customer/index.vue +++ b/stdiet-ui/src/views/custom/customer/index.vue @@ -179,6 +179,16 @@ + + + @@ -333,13 +345,15 @@ import { getOptions } from "@/api/custom/order"; import OrderDrawer from "@/components/OrderDrawer"; import PhysicalSignsDialog from "@/components/PhysicalSignsDialog"; import ContractDrawer from "@/components/ContractDrawer"; +import HeatStatisticsDrawer from "@/components/HeatStatisticsDrawer"; export default { name: "Customer", components: { "order-drawer": OrderDrawer, "physical-signs-dialog": PhysicalSignsDialog, - "contract-drawer": ContractDrawer + "contract-drawer": ContractDrawer, + "heatStatisticsDrawer": HeatStatisticsDrawer }, data() { const userId = store.getters && store.getters.userId; @@ -490,6 +504,9 @@ export default { handleOnMenuClick(row) { // console.log(row); }, + handleClickHeatStatistics(row){ + this.$refs["heatStatisticsRef"].showDrawer(row); + }, // 取消按钮 cancel() { this.open = false; diff --git a/stdiet-ui/src/views/custom/fanStatistics/index.vue b/stdiet-ui/src/views/custom/fanStatistics/index.vue index 47e8f9e80..8ccdc490c 100644 --- a/stdiet-ui/src/views/custom/fanStatistics/index.vue +++ b/stdiet-ui/src/views/custom/fanStatistics/index.vue @@ -9,7 +9,7 @@ placeholder="选择日期"> - + - + + + + + + 搜索 重置 @@ -128,7 +138,7 @@ - + { + this.accountIdOptions = response.data; + }); }, methods: { /** 查询进粉统计列表 */ @@ -444,6 +460,12 @@ } }); }, + }, + watch: { + // 监听用户ID变化 + "form.userId": function (newVal, oldVal) { + this.getWxByUserId(newVal); + }, } }; diff --git a/stdiet-ui/src/views/custom/foodHeatStatistics/index.vue b/stdiet-ui/src/views/custom/foodHeatStatistics/index.vue new file mode 100644 index 000000000..18cd1cb41 --- /dev/null +++ b/stdiet-ui/src/views/custom/foodHeatStatistics/index.vue @@ -0,0 +1,21 @@ + + + diff --git a/stdiet-ui/src/views/custom/foodHeatStatistics/investigate/index.vue b/stdiet-ui/src/views/custom/foodHeatStatistics/investigate/index.vue new file mode 100644 index 000000000..cdc24c59e --- /dev/null +++ b/stdiet-ui/src/views/custom/foodHeatStatistics/investigate/index.vue @@ -0,0 +1,252 @@ + + + +