Merge branch 'master' of gitee.com:darlk/ShengTangManage into develop
This commit is contained in:
		@@ -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();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,66 @@
 | 
			
		||||
package com.stdiet.custom.domain;
 | 
			
		||||
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
import com.stdiet.common.annotation.Excel;
 | 
			
		||||
import com.stdiet.common.core.domain.BaseEntity;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 外食热量统计对象 sys_customer_heat_statistics
 | 
			
		||||
 *
 | 
			
		||||
 * @author xzj
 | 
			
		||||
 * @date 2021-02-20
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class SysCustomerHeatStatistics extends BaseEntity
 | 
			
		||||
{
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /** $column.columnComment */
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /** 客户ID */
 | 
			
		||||
    @Excel(name = "客户ID")
 | 
			
		||||
    private Long customerId;
 | 
			
		||||
 | 
			
		||||
    /** 日期 */
 | 
			
		||||
    @JsonFormat(pattern = "yyyy-MM-dd")
 | 
			
		||||
    @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
 | 
			
		||||
    private Date edibleDate;
 | 
			
		||||
 | 
			
		||||
    /** 最大可摄入量 */
 | 
			
		||||
    @Excel(name = "最大可摄入量")
 | 
			
		||||
    private Integer maxHeatValue;
 | 
			
		||||
 | 
			
		||||
    /** 当天食材总热量 */
 | 
			
		||||
    @Excel(name = "当天食材总热量")
 | 
			
		||||
    private Integer heatValue;
 | 
			
		||||
 | 
			
		||||
    /** 当天热量缺口 */
 | 
			
		||||
    @Excel(name = "当天热量缺口")
 | 
			
		||||
    private Integer heatGap;
 | 
			
		||||
 | 
			
		||||
    /** 删除标识 0未删除 1已删除 */
 | 
			
		||||
    private Integer delFlag;
 | 
			
		||||
 | 
			
		||||
    //食材热量ID
 | 
			
		||||
    private Long[] foodHeatIdList;
 | 
			
		||||
 | 
			
		||||
    //食材热量
 | 
			
		||||
    private Integer[] foodHeatList;
 | 
			
		||||
 | 
			
		||||
    //食材蛋白质质量
 | 
			
		||||
    private Integer[] proteinQualityList;
 | 
			
		||||
 | 
			
		||||
    //食材脂肪质量
 | 
			
		||||
    private Integer[] fatQualityList;
 | 
			
		||||
 | 
			
		||||
    //食材碳水质量
 | 
			
		||||
    private Integer[] carbonWaterQualityList;
 | 
			
		||||
 | 
			
		||||
    //具体食材集合
 | 
			
		||||
    private List<SysFoodHeatStatistics> foodHeatStatisticsList;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,68 @@
 | 
			
		||||
package com.stdiet.custom.domain;
 | 
			
		||||
 | 
			
		||||
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 customerHeatId;
 | 
			
		||||
 | 
			
		||||
    /** 食材 */
 | 
			
		||||
    @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;
 | 
			
		||||
 | 
			
		||||
    /** 类型,0早 1中 2晚 */
 | 
			
		||||
    @Excel(name = "类型,0早 1中 2晚")
 | 
			
		||||
    private Integer edibleType;
 | 
			
		||||
 | 
			
		||||
    /** 蛋白质质量,克 */
 | 
			
		||||
    @Excel(name = "蛋白质质量,克")
 | 
			
		||||
    private Integer proteinQuality;
 | 
			
		||||
 | 
			
		||||
    /** 脂肪质量,克 */
 | 
			
		||||
    @Excel(name = "脂肪质量,克")
 | 
			
		||||
    private Integer fatQuality;
 | 
			
		||||
 | 
			
		||||
    /** 碳水质量,克 */
 | 
			
		||||
    @Excel(name = "碳水质量,克")
 | 
			
		||||
    private Integer carbonWaterQuality;
 | 
			
		||||
 | 
			
		||||
    /** 热量数值 */
 | 
			
		||||
    @Excel(name = "热量数值")
 | 
			
		||||
    private Integer heatValue;
 | 
			
		||||
 | 
			
		||||
    /** 删除标识 0未删除 1已删除 */
 | 
			
		||||
    private Integer delFlag;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -93,6 +93,9 @@ public class SysOrder extends BaseEntity {
 | 
			
		||||
     */
 | 
			
		||||
    private Long nutritionistId;
 | 
			
		||||
 | 
			
		||||
    //营养师数组,比例拆分单时需要两个营养师,非持久化字段
 | 
			
		||||
    private Long[] nutritionistIdList;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 营养师
 | 
			
		||||
     */
 | 
			
		||||
@@ -227,11 +230,37 @@ public class SysOrder extends BaseEntity {
 | 
			
		||||
     * 订单暂停记录 非持久化字段
 | 
			
		||||
     * */
 | 
			
		||||
    private List<SysOrderPause> orderPauseList;
 | 
			
		||||
 | 
			
		||||
    //查询参数
 | 
			
		||||
    private Integer amountFlag;
 | 
			
		||||
 | 
			
		||||
    @JsonFormat(pattern = "yyyy-MM-dd")
 | 
			
		||||
    public Date getStartTime() {
 | 
			
		||||
        return startTime;
 | 
			
		||||
    }
 | 
			
		||||
    /**
 | 
			
		||||
     * 订单类型 0普通单 1比例拆分单 2售后二开提成单
 | 
			
		||||
     */
 | 
			
		||||
    private String orderType;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 订单次数类型 0一开单  1二开单
 | 
			
		||||
     */
 | 
			
		||||
    private String orderCountType;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 订单金额类型 0全款单  1定金单  2尾款单
 | 
			
		||||
     */
 | 
			
		||||
    private String orderMoneyType;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 拆分订单中的主订单id,非拆分订单时,该id都为0
 | 
			
		||||
     */
 | 
			
		||||
    private Long mainOrderId;
 | 
			
		||||
 | 
			
		||||
    //订单类型数组,用于接收订单类型、订单次数类型、订单金额类型,非持久化字段
 | 
			
		||||
    private Long[] orderTypeList;
 | 
			
		||||
 | 
			
		||||
    //是否自动创建售后二开提成单,非持久化字段
 | 
			
		||||
    private Integer secondAfterSaleFlag;
 | 
			
		||||
 | 
			
		||||
    //拆分比例,如:1,9就是按照比例10%、90%拆分,非持久化字段
 | 
			
		||||
    private Integer[] nutritionistRate;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -2,6 +2,7 @@ package com.stdiet.custom.domain;
 | 
			
		||||
 | 
			
		||||
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;
 | 
			
		||||
@@ -13,6 +14,7 @@ import com.stdiet.common.core.domain.BaseEntity;
 | 
			
		||||
 * @author xzj
 | 
			
		||||
 * @date 2021-01-15
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class SysRecipesPlan extends BaseEntity
 | 
			
		||||
{
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
@@ -24,6 +26,9 @@ public class SysRecipesPlan extends BaseEntity
 | 
			
		||||
    //@Excel(name = "订单ID")
 | 
			
		||||
    private Long orderId;
 | 
			
		||||
 | 
			
		||||
    //客户ID
 | 
			
		||||
    private Long customerId;
 | 
			
		||||
 | 
			
		||||
    //非持久化字段,客户姓名
 | 
			
		||||
    @Excel(name = "客户姓名")
 | 
			
		||||
    private String customer;
 | 
			
		||||
@@ -82,167 +87,4 @@ public class SysRecipesPlan extends BaseEntity
 | 
			
		||||
 | 
			
		||||
    /** 删除标识 0未删除 1已删除 默认0 */
 | 
			
		||||
    private Integer delFlag;
 | 
			
		||||
 | 
			
		||||
    public void setId(Long id)
 | 
			
		||||
    {
 | 
			
		||||
        this.id = id;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Long getId()
 | 
			
		||||
    {
 | 
			
		||||
        return id;
 | 
			
		||||
    }
 | 
			
		||||
    public void setOrderId(Long orderId)
 | 
			
		||||
    {
 | 
			
		||||
        this.orderId = orderId;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Long getOrderId()
 | 
			
		||||
    {
 | 
			
		||||
        return orderId;
 | 
			
		||||
    }
 | 
			
		||||
    public void setStartDate(Date startDate)
 | 
			
		||||
    {
 | 
			
		||||
        this.startDate = startDate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Date getStartDate()
 | 
			
		||||
    {
 | 
			
		||||
        return startDate;
 | 
			
		||||
    }
 | 
			
		||||
    public void setEndDate(Date endDate)
 | 
			
		||||
    {
 | 
			
		||||
        this.endDate = endDate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Date getEndDate()
 | 
			
		||||
    {
 | 
			
		||||
        return endDate;
 | 
			
		||||
    }
 | 
			
		||||
    public void setRecipesId(Long recipesId)
 | 
			
		||||
    {
 | 
			
		||||
        this.recipesId = recipesId;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Long getRecipesId()
 | 
			
		||||
    {
 | 
			
		||||
        return recipesId;
 | 
			
		||||
    }
 | 
			
		||||
    public void setSendFlag(Integer sendFlag)
 | 
			
		||||
    {
 | 
			
		||||
        this.sendFlag = sendFlag;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Integer getSendFlag()
 | 
			
		||||
    {
 | 
			
		||||
        return sendFlag;
 | 
			
		||||
    }
 | 
			
		||||
    public void setSendTime(Date sendTime)
 | 
			
		||||
    {
 | 
			
		||||
        this.sendTime = sendTime;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Date getSendTime()
 | 
			
		||||
    {
 | 
			
		||||
        return sendTime;
 | 
			
		||||
    }
 | 
			
		||||
    public void setDelFlag(Integer delFlag)
 | 
			
		||||
    {
 | 
			
		||||
        this.delFlag = delFlag;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Integer getDelFlag()
 | 
			
		||||
    {
 | 
			
		||||
        return delFlag;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getCustomer() {
 | 
			
		||||
        return customer;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setCustomer(String customer) {
 | 
			
		||||
        this.customer = customer;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Long getNutritionistId() {
 | 
			
		||||
        return nutritionistId;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setNutritionistId(Long nutritionistId) {
 | 
			
		||||
        this.nutritionistId = nutritionistId;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getNutritionist() {
 | 
			
		||||
        return nutritionist;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setNutritionist(String nutritionist) {
 | 
			
		||||
        this.nutritionist = nutritionist;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Long getNutritionistAssisId() {
 | 
			
		||||
        return nutritionistAssisId;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setNutritionistAssisId(Long nutritionistAssisId) {
 | 
			
		||||
        this.nutritionistAssisId = nutritionistAssisId;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getNutritionistAssis() {
 | 
			
		||||
        return nutritionistAssis;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setNutritionistAssis(String nutritionistAssis) {
 | 
			
		||||
        this.nutritionistAssis = nutritionistAssis;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Date getOrderStartDate() {
 | 
			
		||||
        return orderStartDate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setOrderStartDate(Date orderStartDate) {
 | 
			
		||||
        this.orderStartDate = orderStartDate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Date getOrderEndDate() {
 | 
			
		||||
        return orderEndDate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setOrderEndDate(Date orderEndDate) {
 | 
			
		||||
        this.orderEndDate = orderEndDate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getPhone() {
 | 
			
		||||
        return phone;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setPhone(String phone) {
 | 
			
		||||
        this.phone = phone;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getHidePhone() {
 | 
			
		||||
        return hidePhone;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setHidePhone(String hidePhone) {
 | 
			
		||||
        this.hidePhone = hidePhone;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
 | 
			
		||||
                .append("id", getId())
 | 
			
		||||
                .append("orderId", getOrderId())
 | 
			
		||||
                .append("startDate", getStartDate())
 | 
			
		||||
                .append("endDate", getEndDate())
 | 
			
		||||
                .append("recipesId", getRecipesId())
 | 
			
		||||
                .append("sendFlag", getSendFlag())
 | 
			
		||||
                .append("sendTime", getSendTime())
 | 
			
		||||
                .append("createTime", getCreateTime())
 | 
			
		||||
                .append("createBy", getCreateBy())
 | 
			
		||||
                .append("updateTime", getUpdateTime())
 | 
			
		||||
                .append("updateBy", getUpdateBy())
 | 
			
		||||
                .append("delFlag", getDelFlag())
 | 
			
		||||
                .toString();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -29,6 +29,8 @@ public class SysWxFanStatistics extends BaseEntity
 | 
			
		||||
    @Excel(name = "进粉账号")
 | 
			
		||||
    private String account;
 | 
			
		||||
 | 
			
		||||
    private Long accountId;
 | 
			
		||||
 | 
			
		||||
    //销售组别
 | 
			
		||||
    private String saleGroup;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,72 @@
 | 
			
		||||
package com.stdiet.custom.dto.response;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
public class NutritionalCalories implements Serializable {
 | 
			
		||||
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    //姓名
 | 
			
		||||
    public String name;
 | 
			
		||||
 | 
			
		||||
    //实际体重(斤)
 | 
			
		||||
    public double weight;
 | 
			
		||||
 | 
			
		||||
    //实际身高(厘米)
 | 
			
		||||
    public int tall;
 | 
			
		||||
 | 
			
		||||
    //年龄
 | 
			
		||||
    public int age;
 | 
			
		||||
 | 
			
		||||
    //标准体重(斤)
 | 
			
		||||
    public double standardWeight;
 | 
			
		||||
 | 
			
		||||
    //超重(斤)
 | 
			
		||||
    public double overWeight;
 | 
			
		||||
 | 
			
		||||
    //活动因子
 | 
			
		||||
    public double activityFactor;
 | 
			
		||||
 | 
			
		||||
    //基础代谢BMR(千卡)
 | 
			
		||||
    public int metabolizeHeat;
 | 
			
		||||
 | 
			
		||||
    //减脂最大摄入量(千卡)
 | 
			
		||||
    public int maxIntakeHeat;
 | 
			
		||||
 | 
			
		||||
    //不运动总热量(千卡)
 | 
			
		||||
    public int withoutExerciseHeat;
 | 
			
		||||
 | 
			
		||||
    //运动总热量(千卡)
 | 
			
		||||
    public int exerciseHeat;
 | 
			
		||||
 | 
			
		||||
    //每公斤体重占比(千卡/公斤)
 | 
			
		||||
    public double everyWeightHeat;
 | 
			
		||||
 | 
			
		||||
    //目标范围(千卡/公斤)
 | 
			
		||||
    public double[] targetEveryWeightHeat;
 | 
			
		||||
 | 
			
		||||
    //减脂热量标准范围(千卡/公斤)
 | 
			
		||||
    public double[] standardEveryWeightHeat;
 | 
			
		||||
 | 
			
		||||
    //蛋白质、脂肪、碳水比例
 | 
			
		||||
    public Integer[] nutritionalRate;
 | 
			
		||||
 | 
			
		||||
    //蛋白质、脂肪、碳水对应热量(千卡)
 | 
			
		||||
    public Integer[]  nutritionalHeat;
 | 
			
		||||
 | 
			
		||||
    //蛋白质、脂肪、碳水对应质量(克)
 | 
			
		||||
    public Integer[] nutritionalQuality;
 | 
			
		||||
 | 
			
		||||
    //每公斤体重对应蛋白质、脂肪、碳水占比(克/公斤)
 | 
			
		||||
    public double[] weightNutritionalRate;
 | 
			
		||||
 | 
			
		||||
    //蛋白质、脂肪、碳水已摄入热量(千卡)
 | 
			
		||||
    public Integer[] ingestedNutritionalHeat;
 | 
			
		||||
 | 
			
		||||
    //蛋白质、脂肪、碳水剩余可摄入热量
 | 
			
		||||
    public Integer[] surplusNutritionalHeat;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,71 @@
 | 
			
		||||
package com.stdiet.custom.mapper;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import com.stdiet.custom.domain.SysCustomer;
 | 
			
		||||
import com.stdiet.custom.domain.SysCustomerHeatStatistics;
 | 
			
		||||
import com.stdiet.custom.dto.response.NutritionalCalories;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 外食热量统计Mapper接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author xzj
 | 
			
		||||
 * @date 2021-02-20
 | 
			
		||||
 */
 | 
			
		||||
public interface SysCustomerHeatStatisticsMapper
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询外食热量统计
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 外食热量统计ID
 | 
			
		||||
     * @return 外食热量统计
 | 
			
		||||
     */
 | 
			
		||||
    public SysCustomerHeatStatistics selectSysCustomerHeatStatisticsById(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询外食热量统计列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param sysCustomerHeatStatistics 外食热量统计
 | 
			
		||||
     * @return 外食热量统计集合
 | 
			
		||||
     */
 | 
			
		||||
    public List<SysCustomerHeatStatistics> selectSysCustomerHeatStatisticsList(SysCustomerHeatStatistics sysCustomerHeatStatistics);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增外食热量统计
 | 
			
		||||
     *
 | 
			
		||||
     * @param sysCustomerHeatStatistics 外食热量统计
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    public int insertSysCustomerHeatStatistics(SysCustomerHeatStatistics sysCustomerHeatStatistics);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改外食热量统计
 | 
			
		||||
     *
 | 
			
		||||
     * @param sysCustomerHeatStatistics 外食热量统计
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    public int updateSysCustomerHeatStatistics(SysCustomerHeatStatistics sysCustomerHeatStatistics);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除外食热量统计
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 外食热量统计ID
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    public int deleteSysCustomerHeatStatisticsById(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 批量删除外食热量统计
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 需要删除的数据ID
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    public int deleteSysCustomerHeatStatisticsByIds(Long[] ids);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据客户ID、日期查询客户热量统计数据
 | 
			
		||||
     * @param sysCustomerHeatStatistics
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    public SysCustomerHeatStatistics getCustomerHeatStatisticsByDate(SysCustomerHeatStatistics sysCustomerHeatStatistics);
 | 
			
		||||
}
 | 
			
		||||
@@ -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<SysFoodHeatStatistics> 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<HashMap> sysFoodHeatStatisticsList);
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,83 @@
 | 
			
		||||
package com.stdiet.custom.service;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import com.stdiet.custom.domain.SysCustomerHeatStatistics;
 | 
			
		||||
import com.stdiet.custom.dto.response.NutritionalCalories;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 外食热量统计Service接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author xzj
 | 
			
		||||
 * @date 2021-02-20
 | 
			
		||||
 */
 | 
			
		||||
public interface ISysCustomerHeatStatisticsService
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询外食热量统计
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 外食热量统计ID
 | 
			
		||||
     * @return 外食热量统计
 | 
			
		||||
     */
 | 
			
		||||
    public SysCustomerHeatStatistics selectSysCustomerHeatStatisticsById(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询外食热量统计列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param sysCustomerHeatStatistics 外食热量统计
 | 
			
		||||
     * @return 外食热量统计集合
 | 
			
		||||
     */
 | 
			
		||||
    public List<SysCustomerHeatStatistics> selectSysCustomerHeatStatisticsList(SysCustomerHeatStatistics sysCustomerHeatStatistics);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增外食热量统计
 | 
			
		||||
     *
 | 
			
		||||
     * @param sysCustomerHeatStatistics 外食热量统计
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    public int insertSysCustomerHeatStatistics(SysCustomerHeatStatistics sysCustomerHeatStatistics);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改外食热量统计
 | 
			
		||||
     *
 | 
			
		||||
     * @param sysCustomerHeatStatistics 外食热量统计
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    public int updateSysCustomerHeatStatistics(SysCustomerHeatStatistics sysCustomerHeatStatistics);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 批量删除外食热量统计
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 需要删除的外食热量统计ID
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    public int deleteSysCustomerHeatStatisticsByIds(Long[] ids);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除外食热量统计信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 外食热量统计ID
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    public int deleteSysCustomerHeatStatisticsById(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 更新食材热量并计算当天总热量
 | 
			
		||||
     * @param sysCustomerHeatStatistics
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    public int calculateCustomerHeat(SysCustomerHeatStatistics sysCustomerHeatStatistics);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据日期查询是否客户热量统计
 | 
			
		||||
     * @param sysCustomerHeatStatistics
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    SysCustomerHeatStatistics getCustomerHeatStatisticsByDate(SysCustomerHeatStatistics sysCustomerHeatStatistics);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据客户热量食材统计ID查询详情
 | 
			
		||||
     * @param id
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    public NutritionalCalories getNutritionalCaloriesByCustomer(Long id);
 | 
			
		||||
}
 | 
			
		||||
@@ -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<SysFoodHeatStatistics> 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);
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,212 @@
 | 
			
		||||
package com.stdiet.custom.service.impl;
 | 
			
		||||
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import com.stdiet.common.utils.DateUtils;
 | 
			
		||||
import com.stdiet.common.utils.HealthyUtils;
 | 
			
		||||
import com.stdiet.custom.domain.SysCustomerHealthy;
 | 
			
		||||
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
 | 
			
		||||
import com.stdiet.custom.domain.SysFoodHeatStatistics;
 | 
			
		||||
import com.stdiet.custom.dto.response.NutritionalCalories;
 | 
			
		||||
import com.stdiet.custom.service.ISysCustomerHealthyService;
 | 
			
		||||
import com.stdiet.custom.service.ISysCustomerPhysicalSignsService;
 | 
			
		||||
import com.stdiet.custom.service.ISysFoodHeatStatisticsService;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import com.stdiet.custom.mapper.SysCustomerHeatStatisticsMapper;
 | 
			
		||||
import com.stdiet.custom.domain.SysCustomerHeatStatistics;
 | 
			
		||||
import com.stdiet.custom.service.ISysCustomerHeatStatisticsService;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 外食热量统计Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
 * @author xzj
 | 
			
		||||
 * @date 2021-02-20
 | 
			
		||||
 */
 | 
			
		||||
@Service
 | 
			
		||||
@Transactional
 | 
			
		||||
public class SysCustomerHeatStatisticsServiceImpl implements ISysCustomerHeatStatisticsService
 | 
			
		||||
{
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private SysCustomerHeatStatisticsMapper sysCustomerHeatStatisticsMapper;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private ISysFoodHeatStatisticsService sysFoodHeatStatisticsService;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private ISysCustomerPhysicalSignsService sysCustomerPhysicalSignsService;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private ISysCustomerHealthyService sysCustomerHealthyService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询外食热量统计
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 外食热量统计ID
 | 
			
		||||
     * @return 外食热量统计
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public SysCustomerHeatStatistics selectSysCustomerHeatStatisticsById(Long id)
 | 
			
		||||
    {
 | 
			
		||||
        return sysCustomerHeatStatisticsMapper.selectSysCustomerHeatStatisticsById(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询外食热量统计列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param sysCustomerHeatStatistics 外食热量统计
 | 
			
		||||
     * @return 外食热量统计
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<SysCustomerHeatStatistics> selectSysCustomerHeatStatisticsList(SysCustomerHeatStatistics sysCustomerHeatStatistics)
 | 
			
		||||
    {
 | 
			
		||||
        return sysCustomerHeatStatisticsMapper.selectSysCustomerHeatStatisticsList(sysCustomerHeatStatistics);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增外食热量统计
 | 
			
		||||
     *
 | 
			
		||||
     * @param sysCustomerHeatStatistics 外食热量统计
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public int insertSysCustomerHeatStatistics(SysCustomerHeatStatistics sysCustomerHeatStatistics)
 | 
			
		||||
    {
 | 
			
		||||
        sysCustomerHeatStatistics.setCreateTime(DateUtils.getNowDate());
 | 
			
		||||
        return sysCustomerHeatStatisticsMapper.insertSysCustomerHeatStatistics(sysCustomerHeatStatistics);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改外食热量统计
 | 
			
		||||
     *
 | 
			
		||||
     * @param sysCustomerHeatStatistics 外食热量统计
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public int updateSysCustomerHeatStatistics(SysCustomerHeatStatistics sysCustomerHeatStatistics)
 | 
			
		||||
    {
 | 
			
		||||
        sysCustomerHeatStatistics.setUpdateTime(DateUtils.getNowDate());
 | 
			
		||||
        return sysCustomerHeatStatisticsMapper.updateSysCustomerHeatStatistics(sysCustomerHeatStatistics);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 批量删除外食热量统计
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 需要删除的外食热量统计ID
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public int deleteSysCustomerHeatStatisticsByIds(Long[] ids)
 | 
			
		||||
    {
 | 
			
		||||
        return sysCustomerHeatStatisticsMapper.deleteSysCustomerHeatStatisticsByIds(ids);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除外食热量统计信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 外食热量统计ID
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public int deleteSysCustomerHeatStatisticsById(Long id)
 | 
			
		||||
    {
 | 
			
		||||
        return sysCustomerHeatStatisticsMapper.deleteSysCustomerHeatStatisticsById(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据日期查询是否客户热量统计
 | 
			
		||||
     * @param sysCustomerHeatStatistics
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    public SysCustomerHeatStatistics getCustomerHeatStatisticsByDate(SysCustomerHeatStatistics sysCustomerHeatStatistics){
 | 
			
		||||
        return sysCustomerHeatStatisticsMapper.getCustomerHeatStatisticsByDate(sysCustomerHeatStatistics);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 更新食材热量并计算当天总热量
 | 
			
		||||
     * @param sysCustomerHeatStatistics
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public int calculateCustomerHeat(SysCustomerHeatStatistics sysCustomerHeatStatistics){
 | 
			
		||||
        Long[] foodHeatId = sysCustomerHeatStatistics.getFoodHeatIdList();
 | 
			
		||||
        Integer[] foodHeat = sysCustomerHeatStatistics.getFoodHeatList();
 | 
			
		||||
        if(foodHeatId != null && foodHeatId.length > 0){
 | 
			
		||||
            SysFoodHeatStatistics sysFoodHeatStatistics = new SysFoodHeatStatistics();
 | 
			
		||||
            int totalHeatCalue = 0;
 | 
			
		||||
            for (int i = 0; i < foodHeatId.length; i++) {
 | 
			
		||||
                sysFoodHeatStatistics.setId(foodHeatId[i]);
 | 
			
		||||
                sysFoodHeatStatistics.setProteinQuality(sysCustomerHeatStatistics.getProteinQualityList()[i]);
 | 
			
		||||
                sysFoodHeatStatistics.setFatQuality(sysCustomerHeatStatistics.getFatQualityList()[i]);
 | 
			
		||||
                sysFoodHeatStatistics.setCarbonWaterQuality(sysCustomerHeatStatistics.getCarbonWaterQualityList()[i]);
 | 
			
		||||
                //根据蛋白质、脂肪、碳水计算热量
 | 
			
		||||
                sysFoodHeatStatistics.setHeatValue(HealthyUtils.calculateTotalHeatByProteinFatCarbonWater(sysCustomerHeatStatistics.getProteinQualityList()[i],
 | 
			
		||||
                        sysCustomerHeatStatistics.getFatQualityList()[i], sysCustomerHeatStatistics.getCarbonWaterQualityList()[i]));
 | 
			
		||||
                sysFoodHeatStatisticsService.updateSysFoodHeatStatistics(sysFoodHeatStatistics);
 | 
			
		||||
                totalHeatCalue += sysFoodHeatStatistics.getHeatValue();
 | 
			
		||||
            }
 | 
			
		||||
            sysCustomerHeatStatistics.setHeatValue(totalHeatCalue);
 | 
			
		||||
            sysCustomerHeatStatistics.setHeatGap(sysCustomerHeatStatistics.getMaxHeatValue() - totalHeatCalue);
 | 
			
		||||
            return sysCustomerHeatStatisticsMapper.updateSysCustomerHeatStatistics(sysCustomerHeatStatistics);
 | 
			
		||||
        }
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据客户热量食材统计ID查询详情
 | 
			
		||||
     * @param id
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    public NutritionalCalories getNutritionalCaloriesByCustomer(Long id){
 | 
			
		||||
        NutritionalCalories nutritionalCalories = new NutritionalCalories();
 | 
			
		||||
        SysCustomerHeatStatistics sysCustomerHeatStatistics = sysCustomerHeatStatisticsMapper.selectSysCustomerHeatStatisticsById(id);
 | 
			
		||||
        if(sysCustomerHeatStatistics != null){
 | 
			
		||||
            SysCustomerHealthy sysCustomerHealthy = getSysCustomerHealthy(sysCustomerHeatStatistics.getCustomerId());
 | 
			
		||||
            if(sysCustomerHealthy != null){
 | 
			
		||||
                nutritionalCalories.setName(sysCustomerHealthy.getName());
 | 
			
		||||
                nutritionalCalories.setAge(sysCustomerHealthy.getAge().intValue());
 | 
			
		||||
                nutritionalCalories.setTall(sysCustomerHealthy.getTall());
 | 
			
		||||
                nutritionalCalories.setWeight(sysCustomerHealthy.getWeight().doubleValue());
 | 
			
		||||
                nutritionalCalories.setStandardWeight(HealthyUtils.calculateStandardWeight(nutritionalCalories.getTall()));
 | 
			
		||||
                double overHeight = nutritionalCalories.getWeight() - nutritionalCalories.getStandardWeight();
 | 
			
		||||
                overHeight = overHeight > 0 ? overHeight : 0;
 | 
			
		||||
                nutritionalCalories.setOverWeight(overHeight);
 | 
			
		||||
                nutritionalCalories.setMetabolizeHeat(HealthyUtils.calculateMetabolizeHeat(nutritionalCalories.getAge(), nutritionalCalories.getTall(), nutritionalCalories.getWeight()).intValue());
 | 
			
		||||
                nutritionalCalories.setMaxIntakeHeat(sysCustomerHeatStatistics.getMaxHeatValue());
 | 
			
		||||
                nutritionalCalories.setEveryWeightHeat(HealthyUtils.calculateHeatRateByWeight(nutritionalCalories.getMetabolizeHeat(), nutritionalCalories.getWeight()));
 | 
			
		||||
                nutritionalCalories.setTargetEveryWeightHeat(HealthyUtils.calculateHeatTargetRate(nutritionalCalories.getEveryWeightHeat()));
 | 
			
		||||
                //nutritionalCalories.setStandardEveryWeightHeat(HealthyUtils.calculateHeatTargetRate() );
 | 
			
		||||
                nutritionalCalories.setNutritionalRate(HealthyUtils.nutritionRate);
 | 
			
		||||
                Integer[][] nutritionalHeatAndQuality = HealthyUtils.calculateNutritionHeatAndQuality(nutritionalCalories.getMetabolizeHeat());
 | 
			
		||||
                nutritionalCalories.setNutritionalHeat(nutritionalHeatAndQuality[0]);
 | 
			
		||||
                nutritionalCalories.setNutritionalQuality(nutritionalHeatAndQuality[1]);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return nutritionalCalories;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据用户ID查询该用户每天最大摄入量
 | 
			
		||||
     * @param customerId
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    private SysCustomerHealthy getSysCustomerHealthy(Long customerId){
 | 
			
		||||
        SysCustomerHealthy sysCustomerHealthy = sysCustomerHealthyService.selectSysCustomerHealthyByCustomerId(customerId);
 | 
			
		||||
        if(sysCustomerHealthy != null){
 | 
			
		||||
            return sysCustomerHealthy;
 | 
			
		||||
        }
 | 
			
		||||
        //查询体征信息
 | 
			
		||||
        SysCustomerPhysicalSigns sysCustomerPhysicalSigns = sysCustomerPhysicalSignsService.selectSysCustomerPhysicalSignsByCusId(customerId);
 | 
			
		||||
        if(sysCustomerPhysicalSigns != null){
 | 
			
		||||
            sysCustomerHealthy = new SysCustomerHealthy();
 | 
			
		||||
            sysCustomerHealthy.setName(sysCustomerPhysicalSigns.getName());
 | 
			
		||||
            sysCustomerHealthy.setTall(sysCustomerPhysicalSigns.getTall());
 | 
			
		||||
            sysCustomerHealthy.setAge(sysCustomerPhysicalSigns.getAge().longValue());
 | 
			
		||||
            sysCustomerHealthy.setWeight(BigDecimal.valueOf(sysCustomerPhysicalSigns.getWeight()));
 | 
			
		||||
        }
 | 
			
		||||
        return sysCustomerHealthy;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,194 @@
 | 
			
		||||
package com.stdiet.custom.service.impl;
 | 
			
		||||
 | 
			
		||||
import java.util.*;
 | 
			
		||||
 | 
			
		||||
import com.alibaba.fastjson.JSON;
 | 
			
		||||
import com.stdiet.common.utils.DateUtils;
 | 
			
		||||
import com.stdiet.common.utils.HealthyUtils;
 | 
			
		||||
import com.stdiet.common.utils.StringUtils;
 | 
			
		||||
import com.stdiet.common.utils.sign.AesUtils;
 | 
			
		||||
import com.stdiet.custom.domain.SysCustomerHealthy;
 | 
			
		||||
import com.stdiet.custom.domain.SysCustomerHeatStatistics;
 | 
			
		||||
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
 | 
			
		||||
import com.stdiet.custom.dto.request.FoodHeatCalculatorRequest;
 | 
			
		||||
import com.stdiet.custom.service.ISysCustomerHealthyService;
 | 
			
		||||
import com.stdiet.custom.service.ISysCustomerHeatStatisticsService;
 | 
			
		||||
import com.stdiet.custom.service.ISysCustomerPhysicalSignsService;
 | 
			
		||||
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;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
 | 
			
		||||
import javax.xml.crypto.Data;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 外食热量统计Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
 * @author xzj
 | 
			
		||||
 * @date 2021-02-19
 | 
			
		||||
 */
 | 
			
		||||
@Service
 | 
			
		||||
@Transactional
 | 
			
		||||
public class SysFoodHeatStatisticsServiceImpl implements ISysFoodHeatStatisticsService
 | 
			
		||||
{
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private SysFoodHeatStatisticsMapper sysFoodHeatStatisticsMapper;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private ISysCustomerHeatStatisticsService sysCustomerHeatStatisticsService;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private ISysCustomerPhysicalSignsService sysCustomerPhysicalSignsService;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private ISysCustomerHealthyService sysCustomerHealthyService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询外食热量统计
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 外食热量统计ID
 | 
			
		||||
     * @return 外食热量统计
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public SysFoodHeatStatistics selectSysFoodHeatStatisticsById(Long id)
 | 
			
		||||
    {
 | 
			
		||||
        return sysFoodHeatStatisticsMapper.selectSysFoodHeatStatisticsById(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询外食热量统计列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param sysFoodHeatStatistics 外食热量统计
 | 
			
		||||
     * @return 外食热量统计
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<SysFoodHeatStatistics> 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) || StringUtils.isEmpty(foodHeatCalculatorRequest.getIngredientArray())){
 | 
			
		||||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
        List<HashMap> foodHeatList = JSON.parseArray(foodHeatCalculatorRequest.getIngredientArray(), HashMap.class);
 | 
			
		||||
        if(foodHeatList == null || foodHeatList.size() == 0){
 | 
			
		||||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
        Map<String, List<HashMap>> dateFoodMap = new HashMap<>();
 | 
			
		||||
        //根据日期分类
 | 
			
		||||
        for(HashMap map : foodHeatList){
 | 
			
		||||
            String edibleDate = map.get("edibleDate").toString();
 | 
			
		||||
            if(dateFoodMap.containsKey(edibleDate)){
 | 
			
		||||
                dateFoodMap.get(edibleDate).add(map);
 | 
			
		||||
            }else{
 | 
			
		||||
                List<HashMap> list = new ArrayList<>();
 | 
			
		||||
                list.add(map);
 | 
			
		||||
                dateFoodMap.put(edibleDate, list);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        int row = 0;
 | 
			
		||||
        int maxHeatValue = getMaxHeatValue(Long.parseLong(customerId)).intValue();
 | 
			
		||||
        for (String dateKey : dateFoodMap.keySet()) {
 | 
			
		||||
            //先判断该日期下是否已存在
 | 
			
		||||
            SysCustomerHeatStatistics sysCustomerHeatStatistics = new SysCustomerHeatStatistics();
 | 
			
		||||
            sysCustomerHeatStatistics.setCustomerId(Long.parseLong(customerId));
 | 
			
		||||
            sysCustomerHeatStatistics.setEdibleDate(DateUtils.parseDate(dateKey));
 | 
			
		||||
            SysCustomerHeatStatistics customerHeatResult = sysCustomerHeatStatisticsService.getCustomerHeatStatisticsByDate(sysCustomerHeatStatistics);
 | 
			
		||||
            if(customerHeatResult == null){
 | 
			
		||||
                sysCustomerHeatStatistics.setMaxHeatValue(maxHeatValue);
 | 
			
		||||
                sysCustomerHeatStatisticsService.insertSysCustomerHeatStatistics(sysCustomerHeatStatistics);
 | 
			
		||||
            }else{
 | 
			
		||||
                sysCustomerHeatStatistics.setId(customerHeatResult.getId());
 | 
			
		||||
            }
 | 
			
		||||
            if(sysCustomerHeatStatistics.getId() != null){
 | 
			
		||||
                for(HashMap map : dateFoodMap.get(dateKey)){
 | 
			
		||||
                    map.put("customerHeatId", sysCustomerHeatStatistics.getId());
 | 
			
		||||
                    map.put("number", map.get("number") != null && "".equals(map.get("number").toString().trim()) ? null : map.get("number"));
 | 
			
		||||
                    map.put("unit", map.get("unit") != null && "".equals(map.get("unit").toString().trim()) ? null : map.get("unit"));
 | 
			
		||||
                    map.put("quantity", map.get("quantity") != null && "".equals(map.get("quantity").toString().trim()) ? null : map.get("quantity"));
 | 
			
		||||
                }
 | 
			
		||||
                row = sysFoodHeatStatisticsMapper.insertFoodHeatBatch(dateFoodMap.get(dateKey));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return row;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据用户ID查询该用户每天最大摄入量
 | 
			
		||||
     * @param customerId
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    private Long getMaxHeatValue(Long customerId){
 | 
			
		||||
        SysCustomerHealthy sysCustomerHealthy = sysCustomerHealthyService.selectSysCustomerHealthyByCustomerId(customerId);
 | 
			
		||||
        if(sysCustomerHealthy != null){
 | 
			
		||||
            return HealthyUtils.calculateMaxHeatEveryDay(sysCustomerHealthy.getAge().intValue(),sysCustomerHealthy.getTall(),sysCustomerHealthy.getWeight().doubleValue());
 | 
			
		||||
        }
 | 
			
		||||
        //查询体征信息
 | 
			
		||||
        SysCustomerPhysicalSigns sysCustomerPhysicalSigns = sysCustomerPhysicalSignsService.selectSysCustomerPhysicalSignsByCusId(customerId);
 | 
			
		||||
        if(sysCustomerPhysicalSigns != null){
 | 
			
		||||
            return HealthyUtils.calculateMaxHeatEveryDay(sysCustomerPhysicalSigns.getAge().intValue(),sysCustomerPhysicalSigns.getTall(),sysCustomerPhysicalSigns.getWeight().doubleValue());
 | 
			
		||||
        }
 | 
			
		||||
        return 0L;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user