diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxClockImg.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxClockImg.java new file mode 100644 index 0000000..4c486b1 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxClockImg.java @@ -0,0 +1,83 @@ +package com.flossom.common.core.domain.entity; + +import com.flossom.common.core.annotation.Excel; +import com.flossom.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 用户打卡图片关联对象 wx_clock_img + * + * @author flossom + * @date 2024-01-27 + */ +public class WxClockImg extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * 打卡ID + */ + @Excel(name = "打卡ID") + private Long userClockId; + + /** + * 打卡图片 + */ + @Excel(name = "打卡图片") + private String clockImg; + + /** + * 状态(0正常 1停用) + */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private Long status; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setUserClockId(Long userClockId) { + this.userClockId = userClockId; + } + + public Long getUserClockId() { + return userClockId; + } + + public void setClockImg(String clockImg) { + this.clockImg = clockImg; + } + + public String getClockImg() { + return clockImg; + } + + public void setStatus(Long status) { + this.status = status; + } + + public Long getStatus() { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("userClockId", getUserClockId()) + .append("clockImg", getClockImg()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxClockInstrumentLog.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxClockInstrumentLog.java new file mode 100644 index 0000000..de2f4e9 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxClockInstrumentLog.java @@ -0,0 +1,98 @@ +package com.flossom.common.core.domain.entity; + +import com.flossom.common.core.annotation.Excel; +import com.flossom.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 微信用户使用仪器记录对象 wx_clock_instrument_log + * + * @author flossom + * @date 2024-01-29 + */ +public class WxClockInstrumentLog extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * 用户ID + */ + @Excel(name = "用户ID") + private Long userId; + + /** + * 仪器ID + */ + @Excel(name = "仪器ID") + private Long instrumentId; + + /** + * 仪器名称 + */ + @Excel(name = "仪器名称") + private String instrumentName; + + /** + * 状态(0正常 1停用) + */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private Long status; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getUserId() { + return userId; + } + + public void setInstrumentId(Long instrumentId) { + this.instrumentId = instrumentId; + } + + public Long getInstrumentId() { + return instrumentId; + } + + public void setInstrumentName(String instrumentName) { + this.instrumentName = instrumentName; + } + + public String getInstrumentName() { + return instrumentName; + } + + public void setStatus(Long status) { + this.status = status; + } + + public Long getStatus() { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("userId", getUserId()) + .append("instrumentId", getInstrumentId()) + .append("instrumentName", getInstrumentName()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxClockLog.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxClockLog.java new file mode 100644 index 0000000..80a5e38 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxClockLog.java @@ -0,0 +1,113 @@ +package com.flossom.common.core.domain.entity; + +import com.flossom.common.core.annotation.Excel; +import com.flossom.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 用户打卡对象 wx_clock_log + * + * @author flossom + * @date 2024-01-29 + */ +public class WxClockLog extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * 微信用户 + */ + @Excel(name = "微信用户") + private Long userId; + + /** + * 当天使用过的仪器 + */ + @Excel(name = "当天使用过的仪器") + private String instrumentId; + + /** + * 当天使用过的仪器 + */ + @Excel(name = "当天使用过的仪器") + private String instrumentName; + + /** + * 打卡心得 + */ + @Excel(name = "打卡心得") + private String clockContent; + + /** + * 状态(0正常 1停用) + */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private Long status; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getUserId() { + return userId; + } + + public void setInstrumentId(String instrumentId) { + this.instrumentId = instrumentId; + } + + public String getInstrumentId() { + return instrumentId; + } + + public void setInstrumentName(String instrumentName) { + this.instrumentName = instrumentName; + } + + public String getInstrumentName() { + return instrumentName; + } + + public void setClockContent(String clockContent) { + this.clockContent = clockContent; + } + + public String getClockContent() { + return clockContent; + } + + public void setStatus(Long status) { + this.status = status; + } + + public Long getStatus() { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("userId", getUserId()) + .append("instrumentId", getInstrumentId()) + .append("instrumentName", getInstrumentName()) + .append("clockContent", getClockContent()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxClockStatistics.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxClockStatistics.java new file mode 100644 index 0000000..9183888 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxClockStatistics.java @@ -0,0 +1,116 @@ +package com.flossom.common.core.domain.entity; + +import java.math.BigDecimal; + +import com.flossom.common.core.annotation.Excel; +import com.flossom.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 用户打卡统计信息对象 wx_clock_statistics + * + * @author flossom + * @date 2024-01-30 + */ +public class WxClockStatistics extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * 年份 + */ + @Excel(name = "年") + private Integer year; + + /** + * 月份 + */ + @Excel(name = "月份") + private Integer month; + + /** + * 微信用户 + */ + @Excel(name = "微信用户") + private Long userId; + + /** + * 打卡天数 + */ + @Excel(name = "打卡天数") + private Integer clockNum; + + /** + * 超越多少比例用户 + */ + @Excel(name = "超越多少比例用户") + private BigDecimal percentage; + + /** + * 状态(0正常 1停用) + */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private Long status; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setMonth(Integer month) { + this.month = month; + } + + public Integer getMonth() { + return month; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getUserId() { + return userId; + } + + public void setClockNum(Integer clockNum) { + this.clockNum = clockNum; + } + + public Integer getClockNum() { + return clockNum; + } + + public void setPercentage(BigDecimal percentage) { + this.percentage = percentage; + } + + public BigDecimal getPercentage() { + return percentage; + } + + public void setStatus(Long status) { + this.status = status; + } + + public Long getStatus() { + return status; + } + + public Integer getYear() { + return year; + } + + public void setYear(Integer year) { + this.year = year; + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java index e365cfc..15e458e 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java @@ -215,6 +215,21 @@ public class WxInstrument extends BaseEntity { */ private String scanCodeBinding; + /** + * we200iot版本 + */ + private String we200IotVersion; + + /** + * we200iot升级数据文件 + */ + private String we200IotUpgradeData; + + /** + * we200iot版本升级说明 + */ + private String we200IotVersionUpgrade; + public void setId(Long id) { this.id = id; } @@ -527,45 +542,27 @@ public class WxInstrument extends BaseEntity { this.bluetoothConnectFailContent = bluetoothConnectFailContent; } + public String getWe200IotVersion() { + return we200IotVersion; + } + + public void setWe200IotVersion(String we200IotVersion) { + this.we200IotVersion = we200IotVersion; + } + + public String getWe200IotUpgradeData() { + return we200IotUpgradeData; + } + + public void setWe200IotUpgradeData(String we200IotUpgradeData) { + this.we200IotUpgradeData = we200IotUpgradeData; + } + + public String getWe200IotVersionUpgrade() { + return we200IotVersionUpgrade; + } - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("name", getName()) - .append("type", getType()) - .append("model", getModel()) - .append("banner", getBanner()) - .append("logo", getLogo()) - .append("serial", getSerial()) - .append("guarantee", getGuarantee()) - .append("dailyClockCredit", getDailyClockCredit()) - .append("extraClockCredit", getExtraClockCredit()) - .append("startTime", getStartTime()) - .append("endTime", getEndTime()) - .append("miniTagIds", getMiniTagIds()) - .append("miniTagNames", getMiniTagNames()) - .append("wecomTagIds", getWecomTagIds()) - .append("wecomTagNames", getWecomTagNames()) - .append("nursingTime", getNursingTime()) - .append("iotVersion", getIotVersion()) - .append("iotUpgradeData", getIotUpgradeData()) - .append("isScanCode", getIsScanCode()) - .append("isPurchase", getIsPurchase()) - .append("shoppingAppid", getShoppingAppid()) - .append("shoppingPath", getShoppingPath()) - .append("bluetoothConnecting", getBluetoothConnecting()) - .append("bluetoothClosed", getBluetoothClosed()) - .append("iotVersionUpgrade", getIotVersionUpgrade()) - .append("sortNo", getSortNo()) - .append("status", getStatus()) - .append("manualCodeBinding", getManualCodeBinding()) - .append("scanCodeBinding", getScanCodeBinding()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + public void setWe200IotVersionUpgrade(String we200IotVersionUpgrade) { + this.we200IotVersionUpgrade = we200IotVersionUpgrade; } } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentInstructions.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentInstructions.java index c8aba42..f44b662 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentInstructions.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentInstructions.java @@ -37,6 +37,11 @@ public class WxInstrumentInstructions extends BaseEntity { @Excel(name = "说明书链接") private String link; + /** + * 拼接接口地址给用户复制使用 + */ + private String nameUrl; + /** * 状态(0正常 1停用) */ @@ -83,6 +88,14 @@ public class WxInstrumentInstructions extends BaseEntity { return status; } + public String getNameUrl() { + return nameUrl; + } + + public void setNameUrl(String nameUrl) { + this.nameUrl = nameUrl; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxNursingLog.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxNursingLog.java new file mode 100644 index 0000000..1d1a07b --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxNursingLog.java @@ -0,0 +1,164 @@ +package com.flossom.common.core.domain.entity; + +import com.flossom.common.core.annotation.Excel; +import com.flossom.common.core.web.domain.BaseEntity; + +import java.time.LocalTime; + +/** + * 用户护理日志对象 wx_nursing_log + * + * @author flossom + * @date 2024-01-29 + */ +public class WxNursingLog extends BaseEntity { + private static final long serialVersionUID = 1L; + + private Long id; + + /** + * 用户id + */ + @Excel(name = "用户id") + private Long userId; + + /** + * 设备id + */ + @Excel(name = "设备id") + private Long instrumentId; + + /** + * 设备名称 + */ + private String instrumentName; + + /** + * 是否在线,1在线,2离线 + */ + @Excel(name = "是否在线,1在线,2离线") + private Long online; + + /** + * 模式ID + */ + @Excel(name = "模式ID") + private Long modeId; + + /** + * 模式名称 + */ + @Excel(name = "模式名称") + private String modeName; + + /** + * 护理总时长 + */ + @Excel(name = "护理总时长") + private LocalTime nursingTime; + + /** + * 完成度 + */ + private Double completionPercentage; + + /** + * 模式图片 + */ + private String modeImage; + + /** + * 状态(0正常 1停用) + */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private Long status; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getUserId() { + return userId; + } + + public void setInstrumentId(Long instrumentId) { + this.instrumentId = instrumentId; + } + + public Long getInstrumentId() { + return instrumentId; + } + + public void setOnline(Long online) { + this.online = online; + } + + public Long getOnline() { + return online; + } + + public void setModeId(Long modeId) { + this.modeId = modeId; + } + + public Long getModeId() { + return modeId; + } + + public void setModeName(String modeName) { + this.modeName = modeName; + } + + public String getModeName() { + return modeName; + } + + public void setNursingTime(LocalTime nursingTime) { + this.nursingTime = nursingTime; + } + + public LocalTime getNursingTime() { + return nursingTime; + } + + public void setStatus(Long status) { + this.status = status; + } + + public Long getStatus() { + return status; + } + + + public Double getCompletionPercentage() { + return completionPercentage; + } + + public void setCompletionPercentage(Double completionPercentage) { + this.completionPercentage = completionPercentage; + } + + public String getInstrumentName() { + return instrumentName; + } + + public void setInstrumentName(String instrumentName) { + this.instrumentName = instrumentName; + } + + public String getModeImage() { + return modeImage; + } + + public void setModeImage(String modeImage) { + this.modeImage = modeImage; + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxClockLogReq.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxClockLogReq.java new file mode 100644 index 0000000..b7d625d --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxClockLogReq.java @@ -0,0 +1,45 @@ +package com.flossom.common.core.domain.req; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.ArrayList; +import java.util.List; + +/** + * 用户打卡对象 wx_clock_log + * + * @author flossom + * @date 2024-01-27 + */ +public class WxClockLogReq { + + /** + * 打卡心得 + */ + @NotBlank(message = "请输入打卡心得") + @Size(min = 1, max = 120, message = "内容限制120个字符以内") + private String clockContent; + + /** + * 打卡照片 + */ + List clockImageList = new ArrayList<>(); + + public String getClockContent() { + return clockContent; + } + + public void setClockContent(String clockContent) { + this.clockContent = clockContent; + } + + public List getClockImageList() { + return clockImageList; + } + + public void setClockImageList(List clockImageList) { + this.clockImageList = clockImageList; + } + +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java index 71dac62..efb29a3 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java @@ -208,6 +208,21 @@ public class WxInstrumentSaveReq { */ private String scanCodeBinding; + /** + * we200iot版本 + */ + private String we200IotVersion; + + /** + * we200iot升级数据文件 + */ + private String we200IotUpgradeData; + + /** + * we200iot版本升级说明 + */ + private String we200IotVersionUpgrade; + /** * 初次护理介绍视频/图片 @@ -541,4 +556,28 @@ public class WxInstrumentSaveReq { public void setNewModeIdList(List newModeIdList) { this.newModeIdList = newModeIdList; } + + public String getWe200IotVersion() { + return we200IotVersion; + } + + public void setWe200IotVersion(String we200IotVersion) { + this.we200IotVersion = we200IotVersion; + } + + public String getWe200IotUpgradeData() { + return we200IotUpgradeData; + } + + public void setWe200IotUpgradeData(String we200IotUpgradeData) { + this.we200IotUpgradeData = we200IotUpgradeData; + } + + public String getWe200IotVersionUpgrade() { + return we200IotVersionUpgrade; + } + + public void setWe200IotVersionUpgrade(String we200IotVersionUpgrade) { + this.we200IotVersionUpgrade = we200IotVersionUpgrade; + } } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxNursingLogReq.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxNursingLogReq.java new file mode 100644 index 0000000..d444b26 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxNursingLogReq.java @@ -0,0 +1,103 @@ +package com.flossom.common.core.domain.req; + +import com.flossom.common.core.annotation.Excel; +import com.flossom.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.time.LocalTime; + +/** + * 用户护理日志对象 wx_nursing_log + * + * @author flossom + * @date 2024-01-29 + */ +public class WxNursingLogReq { + + /** + * 设备id + */ + @NotNull(message = "请选择设备") + private Long instrumentId; + + /** + * 设备名称 + */ + @NotNull(message = "请选择设备") + private String instrumentName; + + /** + * 模式ID + */ + @NotNull(message = "请选择护理模式") + private Long modeId; + + /** + * 模式名称 + */ + @NotBlank(message = "请选择护理模式") + private String modeName; + + /** + * 护理总时长 + */ + @NotNull(message = "护理时长不能为空") + private LocalTime nursingTime; + + /** + * 完成度 + */ + private Double completionPercentage; + + + public void setInstrumentId(Long instrumentId) { + this.instrumentId = instrumentId; + } + + public Long getInstrumentId() { + return instrumentId; + } + + public void setModeId(Long modeId) { + this.modeId = modeId; + } + + public Long getModeId() { + return modeId; + } + + public void setModeName(String modeName) { + this.modeName = modeName; + } + + public String getModeName() { + return modeName; + } + + public void setNursingTime(LocalTime nursingTime) { + this.nursingTime = nursingTime; + } + + public LocalTime getNursingTime() { + return nursingTime; + } + + public String getInstrumentName() { + return instrumentName; + } + + public void setInstrumentName(String instrumentName) { + this.instrumentName = instrumentName; + } + + public Double getCompletionPercentage() { + return completionPercentage; + } + + public void setCompletionPercentage(Double completionPercentage) { + this.completionPercentage = completionPercentage; + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/ret/WxBindingInstrumentInfo.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/ret/WxBindingInstrumentInfo.java new file mode 100644 index 0000000..1199402 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/ret/WxBindingInstrumentInfo.java @@ -0,0 +1,223 @@ +package com.flossom.common.core.domain.ret; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.flossom.common.core.web.domain.BaseEntity; + +import java.time.LocalTime; +import java.util.Date; + +/** + * 用户绑定仪器信息 + */ +public class WxBindingInstrumentInfo extends BaseEntity { + + /** + * 仪器ID + */ + private Long instrumentId; + + /** + * 仪器名称 + */ + private String instrumentName; + + /** + * 仪器:1、普通仪器 2、iot仪器 + */ + private Integer instrumentType; + + /** + * iot仪器特有:仪器型号 + */ + private String instrumentModel; + + /** + * 仪器封面(图片地址) + */ + private String instrumentBanner; + + /** + * 仪器logo图(图片地址) + */ + private String instrumentLogo; + + /** + * 序列号位置图片(图片地址) + */ + private String instrumentSerialImageLocation; + + /** + * 序列号 + */ + private String bindingSerial; + + + /** + * 序列号图片 + */ + private String bindingSerialImage; + /** + * 保修日期 + */ + private Long instrumentGuarantee; + + + /** + * 护理时长 + */ + @JsonFormat(pattern = "HH:mm:ss") + private LocalTime instrumentNursingTime; + + /** + * iot版本 + */ + private String instrumentIotVersion; + + /** + * iot升级数据文件 + */ + private String instrumentIotUpgradeData; + + /** + * 是否开启扫机身码:0、关闭 1、开启 + */ + private Integer instrumentIsScanCode; + + /** + * 是否支持购买:0、不支持 1、支持 + */ + private Integer instrumentIsPurchase; + + /** + * 绑定时间 + */ + private Date bindingDateTime; + + public Long getInstrumentId() { + return instrumentId; + } + + public void setInstrumentId(Long instrumentId) { + this.instrumentId = instrumentId; + } + + public String getInstrumentName() { + return instrumentName; + } + + public void setInstrumentName(String instrumentName) { + this.instrumentName = instrumentName; + } + + public Integer getInstrumentType() { + return instrumentType; + } + + public void setInstrumentType(Integer instrumentType) { + this.instrumentType = instrumentType; + } + + public String getInstrumentModel() { + return instrumentModel; + } + + public void setInstrumentModel(String instrumentModel) { + this.instrumentModel = instrumentModel; + } + + public String getInstrumentBanner() { + return instrumentBanner; + } + + public void setInstrumentBanner(String instrumentBanner) { + this.instrumentBanner = instrumentBanner; + } + + public String getInstrumentLogo() { + return instrumentLogo; + } + + public void setInstrumentLogo(String instrumentLogo) { + this.instrumentLogo = instrumentLogo; + } + + public String getInstrumentSerialImageLocation() { + return instrumentSerialImageLocation; + } + + public void setInstrumentSerialImageLocation(String instrumentSerialImageLocation) { + this.instrumentSerialImageLocation = instrumentSerialImageLocation; + } + + public String getBindingSerial() { + return bindingSerial; + } + + public void setBindingSerial(String bindingSerial) { + this.bindingSerial = bindingSerial; + } + + public String getBindingSerialImage() { + return bindingSerialImage; + } + + public void setBindingSerialImage(String bindingSerialImage) { + this.bindingSerialImage = bindingSerialImage; + } + + public Long getInstrumentGuarantee() { + return instrumentGuarantee; + } + + public void setInstrumentGuarantee(Long instrumentGuarantee) { + this.instrumentGuarantee = instrumentGuarantee; + } + + public LocalTime getInstrumentNursingTime() { + return instrumentNursingTime; + } + + public void setInstrumentNursingTime(LocalTime instrumentNursingTime) { + this.instrumentNursingTime = instrumentNursingTime; + } + + public String getInstrumentIotVersion() { + return instrumentIotVersion; + } + + public void setInstrumentIotVersion(String instrumentIotVersion) { + this.instrumentIotVersion = instrumentIotVersion; + } + + public String getInstrumentIotUpgradeData() { + return instrumentIotUpgradeData; + } + + public void setInstrumentIotUpgradeData(String instrumentIotUpgradeData) { + this.instrumentIotUpgradeData = instrumentIotUpgradeData; + } + + public Integer getInstrumentIsScanCode() { + return instrumentIsScanCode; + } + + public void setInstrumentIsScanCode(Integer instrumentIsScanCode) { + this.instrumentIsScanCode = instrumentIsScanCode; + } + + public Integer getInstrumentIsPurchase() { + return instrumentIsPurchase; + } + + public void setInstrumentIsPurchase(Integer instrumentIsPurchase) { + this.instrumentIsPurchase = instrumentIsPurchase; + } + + public Date getBindingDateTime() { + return bindingDateTime; + } + + public void setBindingDateTime(Date bindingDateTime) { + this.bindingDateTime = bindingDateTime; + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/ret/WxClockLogRet.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/ret/WxClockLogRet.java new file mode 100644 index 0000000..215f8eb --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/ret/WxClockLogRet.java @@ -0,0 +1,98 @@ +package com.flossom.common.core.domain.ret; + +import com.flossom.common.core.annotation.Excel; +import com.flossom.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.ArrayList; +import java.util.List; + +/** + * 用户打卡对象 wx_clock_log + * + * @author flossom + * @date 2024-01-29 + */ +public class WxClockLogRet extends BaseEntity { + + /** + * $column.columnComment + */ + private Long id; + + /** + * 微信用户 + */ + @Excel(name = "微信用户") + private Long userId; + + /** + * 当天使用过的仪器 + */ + @Excel(name = "当天使用过的仪器") + private String instrumentId; + + /** + * 当天使用过的仪器 + */ + @Excel(name = "当天使用过的仪器") + private String instrumentName; + + /** + * 打卡心得 + */ + @Excel(name = "打卡心得") + private String clockContent; + + private List clockImg = new ArrayList<>(); + + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getUserId() { + return userId; + } + + public void setInstrumentId(String instrumentId) { + this.instrumentId = instrumentId; + } + + public String getInstrumentId() { + return instrumentId; + } + + public void setInstrumentName(String instrumentName) { + this.instrumentName = instrumentName; + } + + public String getInstrumentName() { + return instrumentName; + } + + public void setClockContent(String clockContent) { + this.clockContent = clockContent; + } + + public String getClockContent() { + return clockContent; + } + + public List getClockImg() { + return clockImg; + } + + public void setClockImg(List clockImg) { + this.clockImg = clockImg; + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/ret/WxNursingStatisticsRet.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/ret/WxNursingStatisticsRet.java new file mode 100644 index 0000000..207fea9 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/ret/WxNursingStatisticsRet.java @@ -0,0 +1,49 @@ +package com.flossom.common.core.domain.ret; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.flossom.common.core.annotation.Excel; + +import java.time.LocalTime; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 当月护理记录统计信息 + */ +public class WxNursingStatisticsRet { + + /** + * 当月护理天数 + */ + private Integer nursingNum; + + /** + * 当月护理时长 + */ + private LocalTime nursingTime; + + public WxNursingStatisticsRet() { + } + + public WxNursingStatisticsRet(Integer nursingNum, LocalTime nursingTime) { + this.nursingNum = nursingNum; + this.nursingTime = nursingTime; + } + + public Integer getNursingNum() { + return nursingNum; + } + + public void setNursingNum(Integer nursingNum) { + this.nursingNum = nursingNum; + } + + public LocalTime getNursingTime() { + return nursingTime; + } + + public void setNursingTime(LocalTime nursingTime) { + this.nursingTime = nursingTime; + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/enums/InstrumentHttpCodeEnum.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/enums/InstrumentHttpCodeEnum.java new file mode 100644 index 0000000..ba6ff48 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/enums/InstrumentHttpCodeEnum.java @@ -0,0 +1,30 @@ +package com.flossom.common.core.enums; + +public enum InstrumentHttpCodeEnum { + + TWO_HUNDRED_AND_ONE(201, "可以绑定,但是不立即绑定,页面需要询问用户是否绑定"), + TWO_HUNDRED_AND_TWO(202, "绑定过该类型仪器,但当前扫码的序列号与以前绑定的仪器的序列号不一致,询问用户是否换绑仪器"), + TWO_HUNDRED_AND_THREE(203, "当前序列码被别人绑定了,联系客服"), + TWO_HUNDRED_AND_FOUR(204, "用户选择的仪器与序列号对应的仪器不一致"), + TWO_HUNDRED_AND_FIVE(205, "序列号不存在,联系客服"), + TWO_HUNDRED_AND_SIX(206, "绑定失败,不存在该仪器,请联系客服"), + ; + + private final Integer code; + private final String info; + + InstrumentHttpCodeEnum(Integer code, String info) { + this.code = code; + this.info = info; + } + + public Integer getCode() { + return code; + } + + public String getInfo() { + return info; + } + + +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/SysTagMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/SysTagMapper.java index 472fdc1..1bc877b 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/SysTagMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/SysTagMapper.java @@ -117,4 +117,6 @@ public interface SysTagMapper { public int deleteDeptById(Long id); List selectSecondTagByType(@Param("type") Integer type); + + List selectByIdList(@Param("tagIdList") List tagIdList); } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockImgMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockImgMapper.java new file mode 100644 index 0000000..814ffd0 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockImgMapper.java @@ -0,0 +1,64 @@ +package com.flossom.common.core.mapper; + +import com.flossom.common.core.domain.entity.WxClockImg; + +import java.util.List; + + +/** + * 用户打卡图片关联Mapper接口 + * + * @author flossom + * @date 2024-01-27 + */ +public interface WxClockImgMapper { + /** + * 查询用户打卡图片关联 + * + * @param id 用户打卡图片关联主键 + * @return 用户打卡图片关联 + */ + public WxClockImg selectWxClockImgById(Long id); + + /** + * 查询用户打卡图片关联列表 + * + * @param wxClockImg 用户打卡图片关联 + * @return 用户打卡图片关联集合 + */ + public List selectWxClockImgList(WxClockImg wxClockImg); + + /** + * 新增用户打卡图片关联 + * + * @param wxClockImg 用户打卡图片关联 + * @return 结果 + */ + public int insertWxClockImg(WxClockImg wxClockImg); + + /** + * 修改用户打卡图片关联 + * + * @param wxClockImg 用户打卡图片关联 + * @return 结果 + */ + public int updateWxClockImg(WxClockImg wxClockImg); + + /** + * 删除用户打卡图片关联 + * + * @param id 用户打卡图片关联主键 + * @return 结果 + */ + public int deleteWxClockImgById(Long id); + + /** + * 批量删除用户打卡图片关联 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWxClockImgByIds(Long[] ids); + + void deleteByUserClockId(Long userClockId); +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockInstrumentLogMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockInstrumentLogMapper.java new file mode 100644 index 0000000..8afdaca --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockInstrumentLogMapper.java @@ -0,0 +1,62 @@ +package com.flossom.common.core.mapper; + +import com.flossom.common.core.domain.entity.WxClockInstrumentLog; + +import java.util.List; + + +/** + * 微信用户使用仪器记录Mapper接口 + * + * @author flossom + * @date 2024-01-29 + */ +public interface WxClockInstrumentLogMapper { + /** + * 查询微信用户使用仪器记录 + * + * @param id 微信用户使用仪器记录主键 + * @return 微信用户使用仪器记录 + */ + public WxClockInstrumentLog selectWxClockInstrumentLogById(Long id); + + /** + * 查询微信用户使用仪器记录列表 + * + * @param wxClockInstrumentLog 微信用户使用仪器记录 + * @return 微信用户使用仪器记录集合 + */ + public List selectWxClockInstrumentLogList(WxClockInstrumentLog wxClockInstrumentLog); + + /** + * 新增微信用户使用仪器记录 + * + * @param wxClockInstrumentLog 微信用户使用仪器记录 + * @return 结果 + */ + public int insertWxClockInstrumentLog(WxClockInstrumentLog wxClockInstrumentLog); + + /** + * 修改微信用户使用仪器记录 + * + * @param wxClockInstrumentLog 微信用户使用仪器记录 + * @return 结果 + */ + public int updateWxClockInstrumentLog(WxClockInstrumentLog wxClockInstrumentLog); + + /** + * 删除微信用户使用仪器记录 + * + * @param id 微信用户使用仪器记录主键 + * @return 结果 + */ + public int deleteWxClockInstrumentLogById(Long id); + + /** + * 批量删除微信用户使用仪器记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWxClockInstrumentLogByIds(Long[] ids); +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockLogMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockLogMapper.java new file mode 100644 index 0000000..8806fab --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockLogMapper.java @@ -0,0 +1,66 @@ +package com.flossom.common.core.mapper; + +import com.flossom.common.core.domain.entity.WxClockLog; +import com.flossom.common.core.domain.ret.WxClockLogRet; + +import java.util.List; + +/** + * 用户打卡Mapper接口 + * + * @author flossom + * @date 2024-01-29 + */ +public interface WxClockLogMapper { + /** + * 查询用户打卡 + * + * @param id 用户打卡主键 + * @return 用户打卡 + */ + public WxClockLog selectWxClockLogById(Long id); + + /** + * 查询用户打卡列表 + * + * @param wxClockLog 用户打卡 + * @return 用户打卡集合 + */ + public List selectWxClockLogList(WxClockLog wxClockLog); + + /** + * 新增用户打卡 + * + * @param wxClockLog 用户打卡 + * @return 结果 + */ + public int insertWxClockLog(WxClockLog wxClockLog); + + /** + * 修改用户打卡 + * + * @param wxClockLog 用户打卡 + * @return 结果 + */ + public int updateWxClockLog(WxClockLog wxClockLog); + + /** + * 删除用户打卡 + * + * @param id 用户打卡主键 + * @return 结果 + */ + public int deleteWxClockLogById(Long id); + + /** + * 批量删除用户打卡 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWxClockLogByIds(Long[] ids); + + Integer selectCountByUserId(WxClockLog queryClockLog); + + List selectWxClockImgRetList(WxClockLog queryClockLog); +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockStatisticsMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockStatisticsMapper.java new file mode 100644 index 0000000..0d0fd80 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockStatisticsMapper.java @@ -0,0 +1,65 @@ +package com.flossom.common.core.mapper; + +import com.flossom.common.core.domain.entity.WxClockStatistics; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + + +/** + * 用户打卡统计信息Mapper接口 + * + * @author flossom + * @date 2024-01-30 + */ +public interface WxClockStatisticsMapper { + /** + * 查询用户打卡统计信息 + * + * @param id 用户打卡统计信息主键 + * @return 用户打卡统计信息 + */ + public WxClockStatistics selectWxClockStatisticsById(Long id); + + /** + * 查询用户打卡统计信息列表 + * + * @param wxClockStatistics 用户打卡统计信息 + * @return 用户打卡统计信息集合 + */ + public List selectWxClockStatisticsList(WxClockStatistics wxClockStatistics); + + /** + * 新增用户打卡统计信息 + * + * @param wxClockStatistics 用户打卡统计信息 + * @return 结果 + */ + public int insertWxClockStatistics(WxClockStatistics wxClockStatistics); + + /** + * 修改用户打卡统计信息 + * + * @param wxClockStatistics 用户打卡统计信息 + * @return 结果 + */ + public int updateWxClockStatistics(WxClockStatistics wxClockStatistics); + + /** + * 删除用户打卡统计信息 + * + * @param id 用户打卡统计信息主键 + * @return 结果 + */ + public int deleteWxClockStatisticsById(Long id); + + /** + * 批量删除用户打卡统计信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWxClockStatisticsByIds(Long[] ids); + + List selectByUserIdAndYearMonth(@Param("userIdList") List userIdList, @Param("year") int year, @Param("month") int month); +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingLogMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingLogMapper.java new file mode 100644 index 0000000..968d90b --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingLogMapper.java @@ -0,0 +1,61 @@ +package com.flossom.common.core.mapper; + +import com.flossom.common.core.domain.entity.WxNursingLog; + +import java.util.List; + +/** + * 用户护理日志Mapper接口 + * + * @author flossom + * @date 2024-01-29 + */ +public interface WxNursingLogMapper { + /** + * 查询用户护理日志 + * + * @param id 用户护理日志主键 + * @return 用户护理日志 + */ + public WxNursingLog selectWxNursingLogById(Long id); + + /** + * 查询用户护理日志列表 + * + * @param wxNursingLog 用户护理日志 + * @return 用户护理日志集合 + */ + public List selectWxNursingLogList(WxNursingLog wxNursingLog); + + /** + * 新增用户护理日志 + * + * @param wxNursingLog 用户护理日志 + * @return 结果 + */ + public int insertWxNursingLog(WxNursingLog wxNursingLog); + + /** + * 修改用户护理日志 + * + * @param wxNursingLog 用户护理日志 + * @return 结果 + */ + public int updateWxNursingLog(WxNursingLog wxNursingLog); + + /** + * 删除用户护理日志 + * + * @param id 用户护理日志主键 + * @return 结果 + */ + public int deleteWxNursingLogById(Long id); + + /** + * 批量删除用户护理日志 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWxNursingLogByIds(Long[] ids); +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxUserMemberMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxUserMemberMapper.java index 88f2a38..e3b4c3e 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxUserMemberMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxUserMemberMapper.java @@ -89,4 +89,7 @@ public interface WxUserMemberMapper { List selectWxUserMemberRetByIdList(@Param("userIdList") List userIdList); List selectWxUserMemberRetListByVm(WxUserMemberVm wxUserMemberVm); + + Integer selectWxUserTotal(); + } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/utils/PageUtils.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/utils/PageUtils.java index da43468..b841efd 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/utils/PageUtils.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/utils/PageUtils.java @@ -15,7 +15,7 @@ public class PageUtils extends PageHelper /** * 设置请求分页数据 */ - public static void startPage() + public static Integer startPage() { PageDomain pageDomain = TableSupport.buildPageRequest(); Integer pageNum = pageDomain.getPageNum(); @@ -23,6 +23,7 @@ public class PageUtils extends PageHelper String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); Boolean reasonable = pageDomain.getReasonable(); PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable); + return pageNum; } /** diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/utils/file/MimeTypeUtils.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/utils/file/MimeTypeUtils.java index cca0a06..4e534c3 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/utils/file/MimeTypeUtils.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/utils/file/MimeTypeUtils.java @@ -35,6 +35,8 @@ public class MimeTypeUtils "rar", "zip", "gz", "bz2", // 视频格式 "mp4", "avi", "rmvb", + // bin文件 + "bin", // pdf "pdf" }; diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/web/controller/BaseController.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/web/controller/BaseController.java index 479ac4f..6878a5c 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/web/controller/BaseController.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/web/controller/BaseController.java @@ -44,9 +44,9 @@ public class BaseController /** * 设置请求分页数据 */ - protected void startPage() + protected Integer startPage() { - PageUtils.startPage(); + return PageUtils.startPage(); } /** diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/SiteInfoMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/SiteInfoMapper.xml index e035d12..2c43852 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/SiteInfoMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/SiteInfoMapper.xml @@ -206,10 +206,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" site_end_time = #{siteEndTime}, user_register_start_time = #{userRegisterStartTime}, user_register_end_time = #{userRegisterEndTime}, + push_number = #{pushNumber}, + push_timer = #{pushTimer}, open_type = #{openType}, push_type = #{pushType}, - push_number = #{pushNumber}, - push_timer = #{pushTimer}, show_wechat_tag = #{showWechatTag}, show_wechat_tag_id = #{showWechatTagId}, show_company_tag = #{showCompanyTag}, diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml index 1e0fa92..ca8909e 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml @@ -99,7 +99,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ORDER BY order_num asc - + + + insert into sys_tag( id, parent_id, diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxClockImgMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxClockImgMapper.xml new file mode 100644 index 0000000..fb91985 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxClockImgMapper.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + select id, user_clock_id, clock_img, status, create_by, create_time from wx_clock_img + + + + + + + + insert into wx_clock_img + + user_clock_id, + clock_img, + status, + create_by, + create_time, + + + #{userClockId}, + #{clockImg}, + #{status}, + #{createBy}, + #{createTime}, + + + + + update wx_clock_img + + user_clock_id = #{userClockId}, + clock_img = #{clockImg}, + status = #{status}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from wx_clock_img where id = #{id} + + + + delete from wx_clock_img where user_clock_id = #{userClockId} + + + + delete from wx_clock_img where id in + + #{id} + + + \ No newline at end of file diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxClockInstrumentLogMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxClockInstrumentLogMapper.xml new file mode 100644 index 0000000..7f89c92 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxClockInstrumentLogMapper.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + select id, user_id, instrument_id, instrument_name, status, create_by, create_time from wx_clock_instrument_log + + + + + + + + insert into wx_clock_instrument_log + + user_id, + instrument_id, + instrument_name, + status, + create_by, + create_time, + + + #{userId}, + #{instrumentId}, + #{instrumentName}, + #{status}, + #{createBy}, + #{createTime}, + + + + + update wx_clock_instrument_log + + user_id = #{userId}, + instrument_id = #{instrumentId}, + instrument_name = #{instrumentName}, + status = #{status}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from wx_clock_instrument_log where id = #{id} + + + + delete from wx_clock_instrument_log where id in + + #{id} + + + \ No newline at end of file diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxClockLogMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxClockLogMapper.xml new file mode 100644 index 0000000..4598318 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxClockLogMapper.xml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, user_id, instrument_id, instrument_name, clock_content, status, create_by, create_time, update_by, update_time from wx_clock_log + + + + + + + + + + + + + + SELECT LAST_INSERT_ID() + + insert into wx_clock_log + + user_id, + instrument_id, + instrument_name, + clock_content, + status, + create_by, + create_time, + update_by, + update_time, + + + #{userId}, + #{instrumentId}, + #{instrumentName}, + #{clockContent}, + #{status}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update wx_clock_log + + user_id = #{userId}, + instrument_id = #{instrumentId}, + instrument_name = #{instrumentName}, + clock_content = #{clockContent}, + status = #{status}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from wx_clock_log where id = #{id} + + + + delete from wx_clock_log where id in + + #{id} + + + \ No newline at end of file diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxClockStatisticsMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxClockStatisticsMapper.xml new file mode 100644 index 0000000..72c20b3 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxClockStatisticsMapper.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + select id, `year`, `month`, user_id, clock_num, percentage, status, create_by, create_time, update_by, update_time from wx_clock_statistics + + + + + + + + + + insert into wx_clock_statistics + + `year`, + `month`, + user_id, + clock_num, + percentage, + status, + create_by, + create_time, + update_by, + update_time, + + + #{year}, + #{month}, + #{userId}, + #{clockNum}, + #{percentage}, + #{status}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update wx_clock_statistics + + `year` = #{year}, + `month` = #{month}, + user_id = #{userId}, + clock_num = #{clockNum}, + percentage = #{percentage}, + status = #{status}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from wx_clock_statistics where id = #{id} + + + + delete from wx_clock_statistics where id in + + #{id} + + + \ No newline at end of file diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml index a288dfa..9b86309 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml @@ -49,10 +49,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + - select id, name, type, model, banner, logo, serial, guarantee, daily_clock_credit, is_extra_clock, binding_credit, extra_clock_credit, start_time, end_time, mini_tag_ids, mini_tag_names, wecom_tag_ids, wecom_tag_names, nursing_time, iot_version, iot_upgrade_data, is_scan_code, is_purchase, shopping_appid, shopping_path, bluetooth_connecting_title, bluetooth_connecting_content,bluetooth_connecting, bluetooth_closed_title, bluetooth_closed_content, bluetooth_closed, bluetooth_connect_fail_title, bluetooth_connect_fail_content, bluetooth_connect_fail, iot_version_upgrade, sort_no, status, manual_code_binding, scan_code_binding, create_by, create_time, update_by, update_time, remark from wx_instrument + select id, name, type, model, banner, logo, serial, guarantee, daily_clock_credit, is_extra_clock, binding_credit, extra_clock_credit, start_time, end_time, mini_tag_ids, mini_tag_names, wecom_tag_ids, wecom_tag_names, nursing_time, iot_version, iot_upgrade_data, is_scan_code, is_purchase, shopping_appid, shopping_path, bluetooth_connecting_title, bluetooth_connecting_content,bluetooth_connecting, bluetooth_closed_title, bluetooth_closed_content, bluetooth_closed, bluetooth_connect_fail_title, bluetooth_connect_fail_content, bluetooth_connect_fail, iot_version_upgrade, sort_no, status, manual_code_binding, scan_code_binding, create_by, create_time, update_by, update_time, remark, we200_iot_version, we200_iot_upgrade_data, we200_iot_version_upgrade from wx_instrument @@ -198,6 +204,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by, update_time, remark, + we200_iot_version, + we200_iot_upgrade_data, + we200_iot_version_upgrade, #{name}, @@ -243,6 +252,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateBy}, #{updateTime}, #{remark}, + #{we200IotVersion}, + #{we200IotUpgradeData}, + #{we200IotVersionUpgrade}, @@ -292,6 +304,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by = #{updateBy}, update_time = #{updateTime}, remark = #{remark}, + we200_iot_version = #{we200IotVersion}, + we200_iot_upgrade_data = #{we200IotUpgradeData}, + we200_iot_version_upgrade = #{we200IotVersionUpgrade}, where id = #{id} diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingLogMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingLogMapper.xml new file mode 100644 index 0000000..118b7b9 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingLogMapper.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, user_id, instrument_id, instrument_name, online, mode_id, mode_name, nursing_time, completion_percentage, status, create_by, create_time, update_by, update_time from wx_nursing_log + + + + + + + + insert into wx_nursing_log + + user_id, + instrument_id, + instrument_name, + online, + mode_id, + mode_name, + nursing_time, + completion_percentage, + status, + create_by, + create_time, + update_by, + update_time, + + + #{userId}, + #{instrumentId}, + #{instrumentName}, + #{online}, + #{modeId}, + #{modeName}, + #{nursingTime}, + #{completionPercentage}, + #{status}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update wx_nursing_log + + user_id = #{userId}, + instrument_id = #{instrumentId}, + instrument_name = #{instrumentName}, + online = #{online}, + mode_id = #{modeId}, + mode_name = #{modeName}, + nursing_time = #{nursingTime}, + completion_percentage = #{completionPercentage}, + status = #{status}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from wx_nursing_log where id = #{id} + + + + delete from wx_nursing_log where id in + + #{id} + + + \ No newline at end of file diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserMemberMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserMemberMapper.xml index 9374677..8aff65f 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserMemberMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserMemberMapper.xml @@ -341,6 +341,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT count(1) as count FROM `wx_user_member` WHERE devices_num > 0 + + diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxClockLogController.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxClockLogController.java new file mode 100644 index 0000000..b3b5b4a --- /dev/null +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxClockLogController.java @@ -0,0 +1,119 @@ +package com.flossom.miniProgram.controller; + +import com.flossom.common.core.constant.Constants; +import com.flossom.common.core.domain.R; +import com.flossom.common.core.domain.SysFile; +import com.flossom.common.core.domain.entity.WxClockStatistics; +import com.flossom.common.core.domain.req.WxClockLogReq; +import com.flossom.common.core.domain.ret.WxClockLogRet; +import com.flossom.common.core.exception.ServiceException; +import com.flossom.common.core.web.controller.BaseController; +import com.flossom.common.core.web.page.TableDataInfo; +import com.flossom.miniProgram.service.IWxClockLogService; +import com.flossom.system.api.RemoteFileService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.NotNull; +import java.util.ArrayList; +import java.util.List; + +/** + * 用户打卡Controller + * + * @author flossom + * @date 2024-01-27 + */ +@RestController +@RequestMapping("/clock") +public class WxClockLogController extends BaseController { + + @Autowired + private IWxClockLogService wxClockLogService; + + @Autowired + private RemoteFileService remoteFileService; + + /** + * 添加用户使用仪器记录表 + */ + @GetMapping("/addClockInstrument") + public R addClockInstrument(@NotNull(message = "请选择仪器ID") @RequestParam("instrumentId") Long instrumentId) { + wxClockLogService.addClockInstrument(instrumentId); + return R.ok(); + } + + /** + * 获取用户当天最新的一条打卡记录 + */ + @GetMapping("/latestClockRecord") + public R latestClockRecord() { + return R.ok(wxClockLogService.latestClockRecord()); + } + + /** + * 分页查询用户的打卡记录 + */ + @GetMapping("/list") + public TableDataInfo list() { + startPage(); + List list = wxClockLogService.selectWxClockLogList(); + return getDataTable(list); + } + + /** + * 上传打卡图片 + */ + @PostMapping("/upload") + public R insertClockLog(@RequestParam(value = "clockImg") MultipartFile clockImg) { + return remoteFileService.upload(clockImg); + } + + + /** + * 新增用户打卡 + * 需要记录当天使用过的全部仪器(打卡前后的全部仪器) + * firstClockImg 第一张图片是必须的 + */ + @PostMapping("/insertClockLog") + public R insertClockLog(@Validated WxClockLogReq wxClockLogReq) { + if (wxClockLogReq.getClockImageList() == null || wxClockLogReq.getClockImageList().size() == 0) { + logger.error("请上传打卡图片"); + throw new ServiceException("请上传打卡图片"); + } + if (wxClockLogReq.getClockImageList().size() > 3) { + logger.error("打卡图片只能上传3张以下"); + throw new ServiceException("打卡图片只能上传3张以下"); + } + wxClockLogService.insertWxClockLog(wxClockLogReq); + return R.ok(); + } + + + /** + * 获取打卡统计 + */ + @GetMapping("/clockStatistics") + public TableDataInfo clockStatistics(WxClockStatistics wxClockStatistics) { + Integer pageNum = startPage(); + List list = wxClockLogService.clockStatistics(wxClockStatistics, pageNum); + return getDataTable(list); + } + + + /** + * TODO: 后期迁移到 system 项目中 + * 定时任务接口 + * 每月第一天将上个月在redis中的数据同步到数据库中,计算打卡比率 + */ + @GetMapping("/clockStatisticsTimedTask") + public void clockStatisticsTimedTask(@RequestParam(value = "userIdList", required = false) List userIdList, + @RequestParam(value = "year", required = false) Integer year, + @RequestParam(value = "month", required = false) Integer month) { + wxClockLogService.clockStatisticsTimedTask(userIdList, year, month); + } + +} diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxInstrumentController.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxInstrumentController.java index 400f2d0..46679a7 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxInstrumentController.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxInstrumentController.java @@ -31,12 +31,21 @@ public class WxInstrumentController extends BaseController { @Autowired private RemoteFileService remoteFileService; + /** + * 判断用户是否绑定序列号 + */ + @GetMapping(value = "/isBindingSerial") + public R isBindingSerial(@NotBlank(message = "序列号不能为空") @RequestParam("serial") String serial) { + wxInstrumentService.binding(serial, null, false); + return R.ok(); + } + /** * 用户、序列号与仪器绑定 */ @GetMapping(value = "/binding") public R binding(@NotBlank(message = "序列号不能为空") @RequestParam("serial") String serial) { - wxInstrumentService.binding(serial, null); + wxInstrumentService.binding(serial, null, true); return R.ok(); } @@ -68,7 +77,7 @@ public class WxInstrumentController extends BaseController { serialImage = result.getData().getUrl(); } wxInstrumentService.determineSerialIsSameInstrument(serial, instrumentId); - wxInstrumentService.binding(serial, serialImage); + wxInstrumentService.binding(serial, serialImage, true); return R.ok(); } @@ -129,4 +138,22 @@ public class WxInstrumentController extends BaseController { return R.ok(wxInstrumentService.getInstrumentModeByInstrumentId(instrumentId)); } + /** + * 获取设备升级数据 + * 由小程序读取设备版本号,与后管的升级版本号做对比 + * 1)第一位不相同的情况下,判断后面两位,后台的比设备的大,则强行升级 + */ + @GetMapping(value = "/upgrade") + public R upgrade(@RequestParam("instrumentId") Long instrumentId, @RequestParam(value = "isWe200") Boolean isWe200) { + return R.ok(wxInstrumentService.upgrade(instrumentId, isWe200)); + } + + /** + * 根据仪器ID获取绑定记录 + */ + @GetMapping(value = "/bindingInstrumentInfo") + public R bindingInstrumentInfo(@NotBlank(message = "仪器ID不能为空") @RequestParam("instrumentId") Long instrumentId) { + return R.ok(wxInstrumentService.bindingInstrumentInfo(instrumentId)); + } + } diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxNursingLogController.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxNursingLogController.java new file mode 100644 index 0000000..6823100 --- /dev/null +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxNursingLogController.java @@ -0,0 +1,60 @@ +package com.flossom.miniProgram.controller; + +import java.util.List; + +import com.flossom.common.core.domain.R; +import com.flossom.common.core.domain.entity.WxNursingLog; +import com.flossom.common.core.domain.req.WxNursingLogReq; +import com.flossom.common.core.web.controller.BaseController; +import com.flossom.common.core.web.domain.AjaxResult; +import com.flossom.common.core.web.page.TableDataInfo; +import com.flossom.miniProgram.service.IWxNursingLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +/** + * 用户护理日志Controller + * + * @author flossom + * @date 2024-01-29 + */ +@RestController +@RequestMapping("/nursingLog") +public class WxNursingLogController extends BaseController { + + @Autowired + private IWxNursingLogService wxNursingLogService; + + /** + * 查询用户护理记录 + */ + @GetMapping("/record") + public TableDataInfo record(@NotNull(message = "请选择仪器") + @RequestParam(value = "instrumentId", required = false) Long instrumentId) { + startPage(); + List list = wxNursingLogService.selectWxNursingLogList(instrumentId); + return getDataTable(list); + } + + /** + * 查询用户护理记录的当月统计信息 + */ + @GetMapping("/statistics") + public R statistics(@NotNull(message = "请选择仪器") @RequestParam(value = "instrumentId") Long instrumentId) { + return R.ok(wxNursingLogService.statistics(instrumentId)); + } + + + /** + * 新增用户护理日志 + */ + @PostMapping("/add") + public R add(@Validated @RequestBody WxNursingLogReq wxNursingLogReq) { + wxNursingLogService.insertWxNursingLog(wxNursingLogReq); + return R.ok(); + } +} diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxClockLogService.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxClockLogService.java new file mode 100644 index 0000000..22830d1 --- /dev/null +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxClockLogService.java @@ -0,0 +1,23 @@ +package com.flossom.miniProgram.service; + +import com.flossom.common.core.domain.entity.WxClockLog; +import com.flossom.common.core.domain.entity.WxClockStatistics; +import com.flossom.common.core.domain.req.WxClockLogReq; +import com.flossom.common.core.domain.ret.WxClockLogRet; + +import java.util.List; + +public interface IWxClockLogService { + + public void insertWxClockLog(WxClockLogReq wxClockLogReq); + + void addClockInstrument(Long instrumentId); + + WxClockLogRet latestClockRecord(); + + List selectWxClockLogList(); + + List clockStatistics(WxClockStatistics wxClockStatistics, Integer pageNum); + + void clockStatisticsTimedTask(List userIdList, Integer year, Integer month); +} diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxInstrumentService.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxInstrumentService.java index d0c48fd..a67b808 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxInstrumentService.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxInstrumentService.java @@ -1,6 +1,7 @@ package com.flossom.miniProgram.service; import com.flossom.common.core.domain.entity.*; +import com.flossom.common.core.domain.ret.WxBindingInstrumentInfo; import com.flossom.common.core.domain.ret.WxModeRet; import java.util.List; @@ -14,7 +15,7 @@ import java.util.List; public interface IWxInstrumentService { WxInstrumentSerial getInstrumentInfoBySerial(String serial); - void binding(String serial, String serialImage); + void binding(String serial, String serialImage, Boolean isImmediatelyBinding); void exchangeBinding(String serial); @@ -27,4 +28,8 @@ public interface IWxInstrumentService { List getInstrumentModeByInstrumentId(Long instrumentId); WxInstrumentSerial determineSerialIsSameInstrument(String serial, Long instrumentId); + + String upgrade(Long instrumentId, Boolean isWe200); + + WxBindingInstrumentInfo bindingInstrumentInfo(Long instrumentId); } diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxNursingLogService.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxNursingLogService.java new file mode 100644 index 0000000..9f0cbab --- /dev/null +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxNursingLogService.java @@ -0,0 +1,29 @@ +package com.flossom.miniProgram.service; + +import com.flossom.common.core.domain.entity.WxNursingLog; +import com.flossom.common.core.domain.req.WxNursingLogReq; +import com.flossom.common.core.domain.ret.WxNursingStatisticsRet; + +import java.util.List; + + +/** + * 用户护理日志Service接口 + * + * @author flossom + * @date 2024-01-29 + */ +public interface IWxNursingLogService { + + /** + * 查询用户护理日志列表 + */ + public List selectWxNursingLogList(Long instrumentId); + + /** + * 新增用户护理日志 + */ + public void insertWxNursingLog(WxNursingLogReq wxNursingLogReq); + + WxNursingStatisticsRet statistics(Long instrumentId); +} diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxClockLogServiceImpl.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxClockLogServiceImpl.java new file mode 100644 index 0000000..0f47c58 --- /dev/null +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxClockLogServiceImpl.java @@ -0,0 +1,304 @@ +package com.flossom.miniProgram.service.impl; + +import com.flossom.common.core.domain.entity.*; +import com.flossom.common.core.domain.req.WxClockLogReq; +import com.flossom.common.core.domain.ret.WxClockLogRet; +import com.flossom.common.core.enums.Status; +import com.flossom.common.core.mapper.*; +import com.flossom.common.core.utils.DateUtils; +import com.flossom.common.security.utils.SecurityUtils; +import com.flossom.miniProgram.service.IWxClockLogService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cloud.context.config.annotation.RefreshScope; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +@Service +@RefreshScope +public class WxClockLogServiceImpl implements IWxClockLogService { + + @Autowired + private WxClockLogMapper wxClockLogMapper; + + @Autowired + private WxClockImgMapper wxClockImgMapper; + + @Autowired + private WxClockInstrumentLogMapper wxClockInstrumentLogMapper; + + @Autowired + private WxInstrumentMapper wxInstrumentMapper; + + @Autowired + private WxClockStatisticsMapper wxClockStatisticsMapper; + + @Autowired + private RedisTemplate redisTemplate; + + @Autowired + private WxUserMemberMapper wxUserMemberMapper; + + @Value("${rank.clock.redisKey}") + private String CLOCK_RANK_REDIS_KEY; + + + @Override + @Transactional + public void insertWxClockLog(WxClockLogReq wxClockLogReq) { + WxUserMember wxUserMember = SecurityUtils.getLoginUser().getWxUserMember(); + LocalDateTime now = LocalDateTime.now(); + + /* 查询当天是否有打卡 */ + WxClockLog queryClockLog = new WxClockLog(); + queryClockLog.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId()); + queryClockLog.getParams().put("beginTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MIN)); + queryClockLog.getParams().put("endTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MAX)); + List wxClockLogList = wxClockLogMapper.selectWxClockLogList(queryClockLog); + WxClockLog wxClockLog = new WxClockLog(); + if (wxClockLogList != null && wxClockLogList.size() == 1) { + // 打卡记录一天只有一条 + wxClockLog.setId(wxClockLogList.get(0).getId()); + } else { + /** + * TODO:当天首次打卡奖励积分 + */ + } + wxClockLog.setClockContent(wxClockLogReq.getClockContent()); + wxClockLog.setUserId(wxUserMember.getId()); + wxClockLog.setCreateBy(wxUserMember.getNickname()); + wxClockLog.setCreateTime(DateUtils.getNowDate()); + // 当天使用过的仪器 + WxClockInstrumentLog queryInstrumentLog = new WxClockInstrumentLog(); + queryInstrumentLog.setUserId(wxUserMember.getId()); + wxClockLog.getParams().put("beginTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MIN)); + wxClockLog.getParams().put("endTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MAX)); + queryInstrumentLog.setStatus(Status.OK.getCode().longValue()); + List wxClockInstrumentLogList = wxClockInstrumentLogMapper.selectWxClockInstrumentLogList(queryInstrumentLog); + if (wxClockInstrumentLogList != null && wxClockInstrumentLogList.size() > 0) { + String instrumentIdList = wxClockInstrumentLogList.stream() + .map(WxClockInstrumentLog::getInstrumentId) + .distinct() + .map(Objects::toString) + .collect(Collectors.joining(",")); + wxClockLog.setInstrumentId(instrumentIdList); + String instrumentNameList = wxClockInstrumentLogList.stream() + .map(WxClockInstrumentLog::getInstrumentName) + .distinct() + .map(Objects::toString) + .collect(Collectors.joining(",")); + wxClockLog.setInstrumentName(instrumentNameList); + } + + if (wxClockLog.getId() != null) { + wxClockLog.setUpdateBy(SecurityUtils.getLoginUser().getWxUserMember().getNickname()); + wxClockLog.setUpdateTime(DateUtils.getNowDate()); + wxClockLogMapper.updateWxClockLog(wxClockLog); + } else { + // 当天第一次打卡 + wxClockLogMapper.insertWxClockLog(wxClockLog); + + /* 保存redis构建排名 */ + String redisKey = CLOCK_RANK_REDIS_KEY + LocalDate.now().getYear() + LocalDate.now().getMonthValue(); + redisTemplate.opsForZSet().incrementScore(redisKey, wxUserMember.getId(), 1); + // 保存打卡记录,不计算比例 + List userIdList = Arrays.asList(wxUserMember.getId()); + List wxClockStatisticsList = wxClockStatisticsMapper.selectByUserIdAndYearMonth(userIdList, LocalDate.now().getYear(), LocalDate.now().getMonthValue()); + if (wxClockStatisticsList != null && wxClockStatisticsList.size() == 0) { + // 数据库不存在则新增,也就是当月第一次打卡 + WxClockStatistics save = new WxClockStatistics(); + save.setYear(LocalDate.now().getYear()); + save.setMonth(LocalDate.now().getMonthValue()); + save.setUserId(wxUserMember.getId()); + save.setClockNum(1); + save.setPercentage(new BigDecimal(0)); + save.setStatus(Status.OK.getCode().longValue()); + save.setCreateBy(wxUserMember.getNickname()); + save.setCreateTime(DateUtils.getNowDate()); + save.setUpdateBy(wxUserMember.getNickname()); + save.setUpdateTime(DateUtils.getNowDate()); + wxClockStatisticsMapper.insertWxClockStatistics(save); + } else { + // 数据库存在则更新打卡次数,也就是当月第二次以上打卡 + WxClockStatistics wxClockStatistics = wxClockStatisticsList.get(0); + WxClockStatistics update = new WxClockStatistics(); + update.setId(wxClockStatistics.getId()); + update.setClockNum(wxClockStatistics.getClockNum() + 1); + update.setUpdateBy(wxUserMember.getNickname()); + update.setUpdateTime(DateUtils.getNowDate()); + wxClockStatisticsMapper.updateWxClockStatistics(update); + } + } + + /* 先删除当天的打卡图片,保存打卡图片 */ + if (wxClockLogReq.getClockImageList() != null && wxClockLogReq.getClockImageList().size() > 0) { + wxClockImgMapper.deleteByUserClockId(wxClockLog.getId()); + for (String image : wxClockLogReq.getClockImageList()) { + WxClockImg wxClockImg = new WxClockImg(); + wxClockImg.setUserClockId(wxClockLog.getId()); + wxClockImg.setClockImg(image); + wxClockImg.setCreateBy(wxUserMember.getNickname()); + wxClockImg.setCreateTime(DateUtils.getNowDate()); + wxClockImgMapper.insertWxClockImg(wxClockImg); + } + } + } + + @Override + @Transactional + public void addClockInstrument(Long instrumentId) { + // 添加仪器使用记录 + WxClockInstrumentLog wxClockInstrumentLog = new WxClockInstrumentLog(); + wxClockInstrumentLog.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId()); + wxClockInstrumentLog.setInstrumentId(instrumentId); + WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(instrumentId); + if (wxInstrument != null) { + wxClockInstrumentLog.setInstrumentName(wxInstrument.getName()); + } + wxClockInstrumentLog.setStatus(Status.OK.getCode().longValue()); + wxClockInstrumentLog.setCreateBy(SecurityUtils.getLoginUser().getWxUserMember().getNickname()); + wxClockInstrumentLog.setCreateTime(DateUtils.getNowDate()); + wxClockInstrumentLogMapper.insertWxClockInstrumentLog(wxClockInstrumentLog); + + // 查询今天是否有打卡,存在打卡,则将仪器添加到最近一条打卡记录上 + WxClockLog queryClockLog = new WxClockLog(); + queryClockLog.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId()); + LocalDateTime now = LocalDateTime.now(); + queryClockLog.getParams().put("beginTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MIN)); + queryClockLog.getParams().put("endTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MAX)); + List wxClockLogList = wxClockLogMapper.selectWxClockLogList(queryClockLog); + if (wxClockLogList != null && wxClockLogList.size() > 0) { + // 直接获取最新的打卡记录 + WxClockLog updateClockLog = new WxClockLog(); + WxClockLog newWxClockLog = wxClockLogList.get(0); + // 获取打卡记录的使用过的仪器ID + List usedList = Arrays.asList(newWxClockLog.getInstrumentId().split(",")).stream().map(Long::valueOf).collect(Collectors.toList()); + if (!usedList.contains(instrumentId)) { + updateClockLog.setInstrumentId(newWxClockLog.getInstrumentId() + "," + instrumentId); + WxInstrument instrument = wxInstrumentMapper.selectWxInstrumentById(instrumentId); + if (instrument != null) { + updateClockLog.setInstrumentName(newWxClockLog.getInstrumentName() + "," + instrument.getName()); + } + updateClockLog.setId(newWxClockLog.getId()); + updateClockLog.setUpdateBy(SecurityUtils.getLoginUser().getWxUserMember().getNickname()); + updateClockLog.setUpdateTime(DateUtils.getNowDate()); + wxClockLogMapper.updateWxClockLog(updateClockLog); + } + } + } + + @Override + public WxClockLogRet latestClockRecord() { + WxClockLog queryClockLog = new WxClockLog(); + queryClockLog.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId()); + LocalDateTime now = LocalDateTime.now(); + queryClockLog.getParams().put("beginTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MIN)); + queryClockLog.getParams().put("endTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MAX)); + List wxClockLogList = wxClockLogMapper.selectWxClockLogList(queryClockLog); + if (wxClockLogList == null && wxClockLogList.size() == 0) { + return null; + } + WxClockLogRet wxClockLogRet = new WxClockLogRet(); + BeanUtils.copyProperties(wxClockLogList.get(0), wxClockLogRet); + + WxClockImg queryClockImg = new WxClockImg(); + queryClockImg.setUserClockId(wxClockLogRet.getId()); + List wxClockImgList = wxClockImgMapper.selectWxClockImgList(queryClockImg); + if (wxClockImgList != null && wxClockImgList.size() > 0) { + wxClockImgList.forEach(wxClockImg -> { + wxClockLogRet.getClockImg().add(wxClockImg.getClockImg()); + }); + } + return wxClockLogRet; + } + + @Override + public List selectWxClockLogList() { + WxClockLog queryClockLog = new WxClockLog(); + queryClockLog.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId()); + List list = wxClockLogMapper.selectWxClockImgRetList(queryClockLog); + if (list != null && list.size() > 0) { + for (WxClockLogRet wxClockLogRet : list) { + WxClockImg wxClockImg = new WxClockImg(); + wxClockImg.setUserClockId(wxClockLogRet.getId()); + List wxClockImgs = wxClockImgMapper.selectWxClockImgList(wxClockImg); + if (wxClockImgs != null && wxClockImgs.size() > 0) { + List collect = wxClockImgs.stream().map(WxClockImg::getClockImg).collect(Collectors.toList()); + wxClockLogRet.setClockImg(collect); + } + } + } + return list; + } + + @Override + public List clockStatistics(WxClockStatistics wxClockStatistics, Integer pageNum) { + // 获取历史统计信息,数据在数据库 + List list = wxClockStatisticsMapper.selectWxClockStatisticsList(wxClockStatistics); + if (list != null && list.size() > 0 && pageNum == 1) { + /* 当前月,则需要从redis中获取排名,计算比例 */ + WxClockStatistics isCurrent = list.get(0); + // 获取排名 + String redisKey = CLOCK_RANK_REDIS_KEY + LocalDate.now().getYear() + LocalDate.now().getMonthValue(); + Long rank = redisTemplate.opsForZSet().reverseRank(redisKey, SecurityUtils.getLoginUser().getWxUserMember().getId()); + if (rank != null) { + // 计算超越百分比 + Integer wxUserTotal = wxUserMemberMapper.selectWxUserTotal(); + BigDecimal percentage = new BigDecimal(wxUserTotal - (rank + 1)) + .divide(new BigDecimal(wxUserTotal), 3, RoundingMode.HALF_UP); + isCurrent.setPercentage(percentage); + } + } + return list; + } + + @Override + public void clockStatisticsTimedTask(List userIdList, Integer year, Integer month) { + if (year == null || month == null) { + LocalDate localDate = LocalDate.now().minusMonths(1); + year = localDate.getYear(); + month = localDate.getMonthValue(); + } + List wxClockStatisticsList = wxClockStatisticsMapper.selectByUserIdAndYearMonth(userIdList, year, month); + if (wxClockStatisticsList != null && wxClockStatisticsList.size() > 0) { + String redisKey = CLOCK_RANK_REDIS_KEY + year + month; + for (WxClockStatistics wxClockStatistics : wxClockStatisticsList) { + redisTemplate.opsForZSet().add(redisKey, wxClockStatistics.getUserId(), wxClockStatistics.getClockNum()); + } + } + if (wxClockStatisticsList != null && wxClockStatisticsList.size() > 0) { + String redisKey = CLOCK_RANK_REDIS_KEY + year + month; + WxClockStatistics update; + for (WxClockStatistics wxClockStatistics : wxClockStatisticsList) { + // 获取排名 + Long rank = redisTemplate.opsForZSet().reverseRank(redisKey, wxClockStatistics.getUserId()); + // 计算超越百分比 + Integer wxUserTotal = wxUserMemberMapper.selectWxUserTotal(); + BigDecimal percentage = new BigDecimal(wxUserTotal - (rank + 1)) + .divide(new BigDecimal(wxUserTotal), 3, RoundingMode.HALF_UP); + update = new WxClockStatistics(); + update.setPercentage(percentage); + update.setId(wxClockStatistics.getId()); + // update.setUpdateBy(SecurityUtils.getUsername()); + update.setUpdateTime(DateUtils.getNowDate()); + wxClockStatisticsMapper.updateWxClockStatistics(update); + } + } + redisTemplate.delete(CLOCK_RANK_REDIS_KEY + year + month); + } + + +} diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxInstrumentServiceImpl.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxInstrumentServiceImpl.java index 560eac4..c9e8de1 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxInstrumentServiceImpl.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxInstrumentServiceImpl.java @@ -1,7 +1,7 @@ package com.flossom.miniProgram.service.impl; -import com.alibaba.nacos.common.utils.CollectionUtils; import com.flossom.common.core.domain.entity.*; +import com.flossom.common.core.domain.ret.WxBindingInstrumentInfo; import com.flossom.common.core.domain.ret.WxModeRet; import com.flossom.common.core.enums.*; import com.flossom.common.core.exception.ServiceException; @@ -17,9 +17,14 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.FileCopyUtils; +import javax.xml.bind.DatatypeConverter; +import java.io.*; +import java.net.URL; import java.time.Instant; import java.time.LocalDateTime; +import java.time.LocalTime; import java.time.ZoneId; import java.util.ArrayList; import java.util.Date; @@ -75,13 +80,16 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { @Override public List bindingInstrumentList() { + /* 绑定了的仪器 不受 "可见小程序标签/可见外部标签" 影响, 去除仪器隐藏的 */ return wxInstrumentMapper.selectBindingInstrumentListByUserId(SecurityUtils.getLoginUser().getWxUserMember().getId()); } @Override public List unbindingInstrumentInfoList() { List returnList = new ArrayList<>(); + /* 去除仪器隐藏的 */ List wxInstrumentList = wxInstrumentMapper.selectUnbindingInstrumentListByUserId(SecurityUtils.getLoginUser().getWxUserMember().getId()); + /* 未绑定的仪器 受 "可见小程序标签/可见外部标签" 影响,需要用户拥有全部对应的标签才可见 */ if (wxInstrumentList != null && wxInstrumentList.size() > 0) { // 用户拥有的标签 WxUserTag wxUserTag = new WxUserTag(); @@ -119,15 +127,22 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { WxInstrumentSerial wxInstrumentSerial = wxInstrumentSerialMapper.selectEntityListBySerial(query); // 序列号唯一 if (wxInstrumentSerial == null) { - logger.info("serial:{}, 没有对应的数据", serial); - throw new ServiceReturnCodeException("没有对应的序列号,跳转联系客服", 203); + logger.info("serial:{}, 序列号不存在", serial); + throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_FIVE.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_FIVE.getCode()); } return wxInstrumentSerial; } + /** + * @param serial 序列号 + * @param serialImage 序列号图片 + * @param isImmediatelyBinding 不立即绑定仪器,页面需要询问用户是否绑定 + *

+ * 绑定流程中仪器 不受 "可见小程序标签/可见外部标签" 影响 + */ @Override @Transactional - public void binding(String serial, String serialImage) { + public void binding(String serial, String serialImage, Boolean isImmediatelyBinding) { WxUserMember wxUserMember = wxUserMemberMapper.selectWxUserMemberById(SecurityUtils.getLoginUser().getWxUserMember().getId()); /* 1、获取序列号信息 */ WxInstrumentSerial wxInstrumentSerial = getInstrumentInfoBySerial(serial); @@ -149,7 +164,7 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { userBindInstrumentQuery.setStatus(Status.OK.getCode().longValue()); List wxUserInstrumentList = wxUserInstrumentMapper.selectListByUserIdAndInstrumentId(userBindInstrumentQuery); // 2.1、当前用户绑定过序列号对应的仪器ID - if (wxUserInstrumentList != null) { + if (wxUserInstrumentList != null && wxUserInstrumentList.size() > 0) { if (wxUserInstrumentList.size() != 1) { logger.error("根据 用户id:{} 和 仪器id:{} 查询出来的数据为空或者数据量不止一条", wxUserMember.getId(), wxInstrumentSerial.getInstrumentId()); throw new ServiceException("绑定失败"); @@ -159,12 +174,18 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { if (!StringUtils.equals(wxUserInstrument.getSerial(), serial)) { /* 2.1.2、绑定过仪器,但不是同一个序列号,询问是否需要换绑 */ logger.info("绑定过该类型仪器,但当前扫码的序列号与以前绑定的仪器的序列号不一致,询问用户是否换绑仪器"); - throw new ServiceReturnCodeException("绑定过该类型仪器,但当前扫码的序列号与以前绑定的仪器的序列号不一致,询问用户是否换绑仪器", 202); + throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_TWO.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_TWO.getCode()); } logger.info("扫码序列号与当前用户绑定的序列号一致,无需绑定,返回响应"); } // 2.2、用户没有绑定过序列号对应的仪器ID else { + // 不立即绑定 + if (!isImmediatelyBinding) { + logger.info("可以绑定,但是不立即绑定,页面需要询问用户是否绑定"); + throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_ONE.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_ONE.getCode()); + } + /* 2.2.1、判断序列号是否被别人绑定了 */ WxUserInstrument query = new WxUserInstrument(); query.setUserId(wxUserMember.getId()); @@ -174,11 +195,15 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { Integer num = wxUserInstrumentMapper.selectUiByInstrumentId(query); if (num != null && num > 0) { logger.info("被别人绑定了,页面跳转联系客服"); - throw new ServiceReturnCodeException("当前序列码被别人绑定了,页面跳转联系客服", 203); + throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_THREE.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_THREE.getCode()); } /* 2.2.2、绑定仪器 */ else { WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(wxInstrumentSerial.getInstrumentId()); + if (wxInstrument != null && wxInstrument.getStatus().intValue() == Status.DISABLE.getCode()) { + logger.info("仪器({})被隐藏了,无法绑定", wxInstrumentSerial.getInstrumentId()); + throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_SIX.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_SIX.getCode()); + } WxUserInstrument saveEntity = new WxUserInstrument(); saveEntity.setUserId(wxUserMember.getId()); saveEntity.setSerial(serial); @@ -194,6 +219,8 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { saveEntity.setStatus(Status.OK.getCode().longValue()); saveEntity.setCreateBy(wxUserMember.getNickname()); saveEntity.setCreateTime(DateUtils.getNowDate()); + saveEntity.setUpdateBy(wxUserMember.getNickname()); + saveEntity.setUpdateTime(DateUtils.getNowDate()); wxUserInstrumentMapper.insertWxUserInstrument(saveEntity); // 更新仪器序列号绑定状态 @@ -218,6 +245,8 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { wxUserInstrumentLog.setStatus(Status.OK.getCode().longValue()); wxUserInstrumentLog.setCreateBy(wxUserMember.getNickname()); wxUserInstrumentLog.setCreateTime(DateUtils.getNowDate()); + wxUserInstrumentLog.setUpdateBy(wxUserMember.getNickname()); + wxUserInstrumentLog.setUpdateTime(DateUtils.getNowDate()); wxUserInstrumentLogMapper.insertWxUserInstrumentLog(wxUserInstrumentLog); // 会员信息中的仪器数量加1 @@ -267,7 +296,12 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { Integer num = wxUserInstrumentMapper.selectUiByInstrumentId(query); if (num != null && num > 0) { logger.info("被别人绑定了,页面跳转联系客服"); - throw new ServiceReturnCodeException("当前序列码被别人绑定了,页面跳转联系客服", 203); + throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_THREE.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_THREE.getCode()); + } + WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(newInstrumentSerial.getInstrumentId()); + if (wxInstrument != null && wxInstrument.getStatus().intValue() == Status.DISABLE.getCode()) { + logger.info("仪器({})被隐藏了,无法绑定", newInstrumentSerial.getInstrumentId()); + throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_SIX.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_SIX.getCode()); } /* 3、换绑 */ @@ -397,10 +431,73 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { public WxInstrumentSerial determineSerialIsSameInstrument(String serial, Long instrumentId) { /* 1、获取序列号信息 */ WxInstrumentSerial wxInstrumentSerial = getInstrumentInfoBySerial(serial); - if (wxInstrumentSerial.getInstrumentId() == instrumentId) { + if (wxInstrumentSerial.getInstrumentId() != instrumentId) { logger.info("用户选择的仪器与序列号对应的仪器不一致,序列号:{}, 仪器ID:{}", serial, instrumentId); - throw new ServiceReturnCodeException("用户选择的仪器与序列号对应的仪器不一致", 204); + throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_FOUR.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_FOUR.getCode()); + } + WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(wxInstrumentSerial.getInstrumentId()); + if (wxInstrument != null && wxInstrument.getStatus().intValue() == Status.DISABLE.getCode()) { + logger.info("仪器({})被隐藏了,无法绑定", wxInstrumentSerial.getInstrumentId()); + throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_SIX.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_SIX.getCode()); } return wxInstrumentSerial; } + + @Override + public String upgrade(Long instrumentId, Boolean isWe200) { + WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(instrumentId); + if (wxInstrument != null && StringUtils.isNotBlank(wxInstrument.getIotUpgradeData())) { + // 读取文件系统中的文件 + try { + byte[] byteArray; + if (isWe200) { + byteArray = FileCopyUtils.copyToByteArray(new URL(wxInstrument.getWe200IotUpgradeData()).openStream()); + } else { + byteArray = FileCopyUtils.copyToByteArray(new URL(wxInstrument.getIotUpgradeData()).openStream()); + } + return DatatypeConverter.printHexBinary(byteArray); + } catch (FileNotFoundException e) { + logger.error("instrumentId:{} 升级失败: {}", instrumentId, e.getMessage()); + throw new ServiceException("升级失败"); + } catch (IOException e) { + logger.error("instrumentId:{} 升级失败: {}", instrumentId, e.getMessage()); + throw new ServiceException("升级失败"); + } + } + return null; + } + + @Override + public WxBindingInstrumentInfo bindingInstrumentInfo(Long instrumentId) { + WxUserMember wxUserMember = SecurityUtils.getLoginUser().getWxUserMember(); + WxUserInstrument query = new WxUserInstrument(); + query.setUserId(wxUserMember.getId()); + query.setInstrumentId(instrumentId); + query.setBindingStatus(BindingStatusEnums.BINDED.getCode()); + List wxUserInstrumentList = wxUserInstrumentMapper.selectListByUserIdAndInstrumentId(query); + if (wxUserInstrumentList == null || wxUserInstrumentList.size() != 1) { + throw new ServiceException("没有绑定该仪器"); + } + WxUserInstrument wxUserInstrument = wxUserInstrumentList.get(0); + WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(instrumentId); + // 封装返回信息 + WxBindingInstrumentInfo wxBindingInstrumentInfo = new WxBindingInstrumentInfo(); + wxBindingInstrumentInfo.setInstrumentId(wxInstrument.getId()); + wxBindingInstrumentInfo.setInstrumentName(wxInstrument.getName()); + wxBindingInstrumentInfo.setInstrumentType(wxInstrument.getType()); + wxBindingInstrumentInfo.setInstrumentModel(wxInstrument.getModel()); + wxBindingInstrumentInfo.setInstrumentBanner(wxInstrument.getBanner()); + wxBindingInstrumentInfo.setInstrumentLogo(wxInstrument.getLogo()); + wxBindingInstrumentInfo.setInstrumentSerialImageLocation(wxInstrument.getSerial()); + wxBindingInstrumentInfo.setBindingSerial(wxUserInstrument.getSerial()); + wxBindingInstrumentInfo.setBindingSerialImage(wxUserInstrument.getSerialImage()); + wxBindingInstrumentInfo.setInstrumentGuarantee(wxUserInstrument.getGuarantee()); + wxBindingInstrumentInfo.setInstrumentNursingTime(wxInstrument.getNursingTime()); + wxBindingInstrumentInfo.setInstrumentIotVersion(wxInstrument.getIotVersion()); + wxBindingInstrumentInfo.setInstrumentIotUpgradeData(wxInstrument.getIotUpgradeData()); + wxBindingInstrumentInfo.setInstrumentIsScanCode(wxInstrument.getIsScanCode()); + wxBindingInstrumentInfo.setInstrumentIsPurchase(wxInstrument.getIsPurchase()); + wxBindingInstrumentInfo.setBindingDateTime(wxUserInstrument.getUpdateTime()); + return wxBindingInstrumentInfo; + } } diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxNursingLogServiceImpl.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxNursingLogServiceImpl.java new file mode 100644 index 0000000..5a94c35 --- /dev/null +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxNursingLogServiceImpl.java @@ -0,0 +1,189 @@ +package com.flossom.miniProgram.service.impl; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneId; +import java.time.temporal.TemporalAdjusters; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import com.flossom.common.core.domain.entity.*; +import com.flossom.common.core.domain.req.WxNursingLogReq; +import com.flossom.common.core.domain.ret.WxNursingStatisticsRet; +import com.flossom.common.core.enums.Status; +import com.flossom.common.core.exception.ServiceException; +import com.flossom.common.core.mapper.WxInstrumentMapper; +import com.flossom.common.core.mapper.WxModeMapper; +import com.flossom.common.core.mapper.WxNursingLogMapper; +import com.flossom.common.core.utils.DateUtils; +import com.flossom.common.core.utils.StringUtils; +import com.flossom.common.security.utils.DictUtils; +import com.flossom.common.security.utils.SecurityUtils; +import com.flossom.miniProgram.service.IWxNursingLogService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 用户护理日志Service业务层处理 + * + * @author flossom + * @date 2024-01-29 + */ +@Service +public class WxNursingLogServiceImpl implements IWxNursingLogService { + + @Autowired + private WxNursingLogMapper wxNursingLogMapper; + + @Autowired + private WxInstrumentMapper wxInstrumentMapper; + + @Autowired + private WxModeMapper wxModeMapper; + + @Override + public WxNursingStatisticsRet statistics(Long instrumentId) { + // 排序:最新的护理记录在最上方;图片由后台模式管理-模式封面图片进行配置; + WxNursingLog queryNursingLog = new WxNursingLog(); + queryNursingLog.setInstrumentId(instrumentId); + LocalDateTime now = LocalDateTime.now(); + queryNursingLog.getParams().put("beginTime", now.with(TemporalAdjusters.firstDayOfMonth()).with(LocalTime.MIN)); + queryNursingLog.getParams().put("endTime", now.with(TemporalAdjusters.lastDayOfMonth()).with(LocalTime.MAX)); + List wxNursingLogList = wxNursingLogMapper.selectWxNursingLogList(queryNursingLog); + if (wxNursingLogList != null && wxNursingLogList.size() > 0) { + WxNursingStatisticsRet wxNursingStatisticsRet = new WxNursingStatisticsRet(); + Map collect = wxNursingLogList.stream().collect( + Collectors.groupingBy( + log -> log.getCreateTime().toInstant() + .atZone(ZoneId.systemDefault()).toLocalDate(), Collectors.counting() + ) + ); + wxNursingStatisticsRet.setNursingNum(collect.size()); + Integer totalNursingSecond = 0; + for (WxNursingLog wxNursingLog : wxNursingLogList) { + if (wxNursingLog.getNursingTime() != null) { + totalNursingSecond += wxNursingLog.getNursingTime().toSecondOfDay(); + } + } + wxNursingStatisticsRet.setNursingTime(LocalTime.ofSecondOfDay(totalNursingSecond)); + return wxNursingStatisticsRet; + } + return new WxNursingStatisticsRet(0, LocalTime.ofSecondOfDay(0)); + } + + /** + * 查询用户护理日志列表 + */ + @Override + public List selectWxNursingLogList(Long instrumentId) { + // 排序:最新的护理记录在最上方;图片由后台模式管理-模式封面图片进行配置; + WxNursingLog wxNursingLog = new WxNursingLog(); + wxNursingLog.setInstrumentId(instrumentId); + List wxNursingLogList = wxNursingLogMapper.selectWxNursingLogList(wxNursingLog); + if (wxNursingLogList != null && wxNursingLogList.size() > 0) { + for (WxNursingLog nursingLog : wxNursingLogList) { + WxMode wxMode = wxModeMapper.selectWxModeById(nursingLog.getModeId()); + if (wxMode != null) { + nursingLog.setModeImage(wxMode.getModeBanner()); + } + } + } + return wxNursingLogList; + } + + /** + * 新增用户护理日志 + */ + @Override + public void insertWxNursingLog(WxNursingLogReq wxNursingLogReq) { + /* 查询 同一仪器,同一模式 下,是否有相同的记录,如果有合并护理时间 */ + WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(wxNursingLogReq.getInstrumentId()); + if (wxInstrument == null) { + throw new ServiceException("保存失败"); + } + WxNursingLog queryNursingLog = new WxNursingLog(); + queryNursingLog.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId()); + queryNursingLog.setInstrumentId(wxNursingLogReq.getInstrumentId()); + LocalDateTime now = LocalDateTime.now(); + queryNursingLog.getParams().put("beginTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MIN)); + queryNursingLog.getParams().put("endTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MAX)); + List wxNursingLogList = wxNursingLogMapper.selectWxNursingLogList(queryNursingLog); + + if (wxNursingLogList != null && wxNursingLogList.size() > 0) { + // 存在,修改 + WxNursingLog updateNursingLog = new WxNursingLog(); + WxNursingLog wxNursingLog = wxNursingLogList.get(0); + // 非IOT仪器没有护理时间 + if (wxNursingLog.getNursingTime() != null) { + if (wxNursingLogReq.getNursingTime() != null) { + updateNursingLog.setNursingTime(wxNursingLog.getNursingTime().plusSeconds(wxNursingLogReq.getNursingTime().toSecondOfDay())); + } + } else { + updateNursingLog.setNursingTime(wxNursingLogReq.getNursingTime()); + } + LocalTime nursingTime = wxInstrument.getNursingTime(); + if (nursingTime != null) { + Integer userNursingTime = updateNursingLog.getNursingTime().toSecondOfDay(); + Integer instrumentNursingTime = nursingTime.toSecondOfDay(); + if (userNursingTime != null && userNursingTime > instrumentNursingTime) { + updateNursingLog.setCompletionPercentage(1.0); + } else { + if (instrumentNursingTime != null && instrumentNursingTime != 0) { + updateNursingLog.setCompletionPercentage(Double.valueOf(userNursingTime) / instrumentNursingTime); + } + } + } + updateNursingLog.setId(wxNursingLog.getId()); + updateNursingLog.setUpdateBy(SecurityUtils.getLoginUser().getWxUserMember().getNickname()); + updateNursingLog.setUpdateTime(DateUtils.getNowDate()); + wxNursingLogMapper.updateWxNursingLog(updateNursingLog); + } else { + // 不存在,新增 + WxNursingLog wxNursingLog = new WxNursingLog(); + BeanUtils.copyProperties(wxNursingLogReq, wxNursingLog); + wxNursingLog.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId()); + // 非IOT仪器没有护理时间 + LocalTime nursingTime = wxInstrument.getNursingTime(); + if (nursingTime != null) { + Integer instrumentNursingTime = nursingTime.toSecondOfDay(); + Integer userNursingTime = wxNursingLog.getNursingTime().toSecondOfDay(); + if (instrumentNursingTime != null && instrumentNursingTime != 0) { + wxNursingLog.setCompletionPercentage(Double.valueOf(userNursingTime) / instrumentNursingTime); + } + } + // 离线状态/在线状态 + Boolean online = true; + List nursingOfflineInstrumentModelDict = DictUtils.getDictCache("nursing_offline_instrument_model"); + if (nursingOfflineInstrumentModelDict != null && nursingOfflineInstrumentModelDict.size() > 0) { + for (SysDictData sysDictData : nursingOfflineInstrumentModelDict) { + if (StringUtils.equals(sysDictData.getDictType(), wxInstrument.getModel())) { + List nursingOfflineInstrumentModeDict = DictUtils.getDictCache("nursing_offline_instrument_mode"); + if (nursingOfflineInstrumentModeDict != null && nursingOfflineInstrumentModeDict.size() > 0) { + for (SysDictData dictData : nursingOfflineInstrumentModeDict) { + if (StringUtils.equals(dictData.getDictType(), wxNursingLogReq.getModeName())) { + // 离线 + online = false; + wxNursingLog.setOnline(2L); + } + } + } + } + } + } + if (online) { + // 在线 + wxNursingLog.setOnline(1L); + } + wxNursingLog.setCreateBy(SecurityUtils.getLoginUser().getWxUserMember().getNickname()); + wxNursingLog.setCreateTime(DateUtils.getNowDate()); + wxNursingLog.setUpdateBy(SecurityUtils.getLoginUser().getWxUserMember().getNickname()); + wxNursingLog.setUpdateTime(DateUtils.getNowDate()); + wxNursingLog.setStatus(Status.OK.getCode().longValue()); + wxNursingLogMapper.insertWxNursingLog(wxNursingLog); + } + } + +} diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SiteInfoServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SiteInfoServiceImpl.java index 7d4f105..4ad1678 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SiteInfoServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SiteInfoServiceImpl.java @@ -491,6 +491,11 @@ public class SiteInfoServiceImpl implements ISiteInfoService // 保存新的关联关系 this.commonHandlerRelation(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew,wxInstrumentList); + if(SitePushTypeEnum.CUSTOM.getCode() != siteInfo.getPushType()) { + siteInfo.setPushNumber(null); + siteInfo.setPushTimer(null); + siteInfo.setPushTimerArray(null); + } return siteInfoMapper.updateSiteInfo(siteInfo); } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentInstructionsServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentInstructionsServiceImpl.java index 0f7ea9e..349ec03 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentInstructionsServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentInstructionsServiceImpl.java @@ -6,6 +6,8 @@ import com.flossom.common.core.domain.entity.WxInstrumentInstructions; import com.flossom.common.core.mapper.WxInstrumentInstructionsMapper; import com.flossom.common.core.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.stereotype.Service; import com.flossom.system.service.IWxInstrumentInstructionsService; @@ -16,11 +18,15 @@ import com.flossom.system.service.IWxInstrumentInstructionsService; * @date 2024-01-16 */ @Service +@RefreshScope public class WxInstrumentInstructionsServiceImpl implements IWxInstrumentInstructionsService { @Autowired private WxInstrumentInstructionsMapper wxInstrumentInstructionsMapper; + @Value("${instruction.domain}") + private String instructionDomain; + /** * 查询仪器说明书 * @@ -40,7 +46,15 @@ public class WxInstrumentInstructionsServiceImpl implements IWxInstrumentInstruc */ @Override public List selectWxInstrumentInstructionsList(WxInstrumentInstructions wxInstrumentInstructions) { - return wxInstrumentInstructionsMapper.selectWxInstrumentInstructionsList(wxInstrumentInstructions); + List instructionList = wxInstrumentInstructionsMapper.selectWxInstrumentInstructionsList(wxInstrumentInstructions); + if (instructionList != null && instructionList.size() > 0) { + for (WxInstrumentInstructions instrumentInstructions : instructionList) { + StringBuffer url = new StringBuffer(instructionDomain); + StringBuffer nameUrl = url.append("/book?type=").append(instrumentInstructions.getName()).append("&id=").append(instrumentInstructions.getInstrumentId()); + instrumentInstructions.setNameUrl(nameUrl.toString()); + } + } + return instructionList; } /** diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java index 4220795..527b107 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java @@ -5,18 +5,13 @@ import java.util.Iterator; import java.util.List; import java.util.stream.Collectors; -import com.flossom.common.core.domain.entity.SysTag; -import com.flossom.common.core.domain.entity.WxInstrument; -import com.flossom.common.core.domain.entity.WxInstrumentFileRelate; -import com.flossom.common.core.domain.entity.WxInstrumentMode; +import com.flossom.common.core.domain.entity.*; import com.flossom.common.core.domain.req.WxInstrumentReq; import com.flossom.common.core.domain.req.WxInstrumentSaveReq; import com.flossom.common.core.enums.InstrumentFileClassifyEnum; import com.flossom.common.core.enums.Status; -import com.flossom.common.core.mapper.SysTagMapper; -import com.flossom.common.core.mapper.WxInstrumentFileRelateMapper; -import com.flossom.common.core.mapper.WxInstrumentMapper; -import com.flossom.common.core.mapper.WxInstrumentModeMapper; +import com.flossom.common.core.enums.TagTypeStatusEnum; +import com.flossom.common.core.mapper.*; import com.flossom.common.core.utils.DateUtils; import com.flossom.common.core.utils.StringUtils; import com.flossom.common.security.utils.SecurityUtils; @@ -47,6 +42,9 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { @Autowired private WxInstrumentModeMapper wxInstrumentModeMapper; + @Autowired + private WxInstrumentTagMapper wxInstrumentTagMapper; + /** * 查询仪器列 * @@ -114,7 +112,30 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { @Override public List selectWxInstrumentPage(WxInstrumentReq wxInstrumentReq) { - return wxInstrumentMapper.selectWxInstrumentPage(wxInstrumentReq); + List wxInstruments = wxInstrumentMapper.selectWxInstrumentPage(wxInstrumentReq); + if (wxInstruments != null && wxInstruments.size() > 0) { + for (WxInstrument wxInstrument : wxInstruments) { + WxInstrumentTag query = new WxInstrumentTag(); + query.setInstrumentId(wxInstrument.getId()); + List wxInstrumentTagList = wxInstrumentTagMapper.selectWxInstrumentTagList(query); + if (wxInstrumentTagList != null && wxInstrumentTagList.size() > 0) { + List tagIdList = wxInstrumentTagList.stream().map(WxInstrumentTag::getTagId).collect(Collectors.toList()); + List sysTagList = sysTagMapper.selectByIdList(tagIdList); + + String miniProgramTags = sysTagList.stream() + .filter(tag -> Integer.valueOf(tag.getType()) == TagTypeStatusEnum.MINI_PROGRAM.getCode()) + .map(SysTag::getTagName) + .collect(Collectors.joining(",")); + wxInstrument.setMiniTagNames(miniProgramTags); + String wecomTags = sysTagList.stream() + .filter(tag -> Integer.valueOf(tag.getType()) == TagTypeStatusEnum.ENTERPRISE_WECHAT.getCode()) + .map(SysTag::getTagName) + .collect(Collectors.joining(",")); + wxInstrument.setWecomTagNames(wecomTags); + } + } + } + return wxInstruments; } /** diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxUserInstrumentServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxUserInstrumentServiceImpl.java index 831b356..27912f0 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxUserInstrumentServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxUserInstrumentServiceImpl.java @@ -6,10 +6,7 @@ import java.util.*; import java.util.stream.Collectors; import com.alibaba.nacos.shaded.com.google.common.collect.Maps; -import com.flossom.common.core.domain.entity.WxInstrumentSerial; -import com.flossom.common.core.domain.entity.WxUserInstrument; -import com.flossom.common.core.domain.entity.WxUserInstrumentLog; -import com.flossom.common.core.domain.entity.WxUserMember; +import com.flossom.common.core.domain.entity.*; import com.flossom.common.core.domain.req.WxUserInstrumentExportVm; import com.flossom.common.core.enums.BindingStatusEnums; import com.flossom.common.core.mapper.*; @@ -40,6 +37,7 @@ public class WxUserInstrumentServiceImpl implements IWxUserInstrumentService private WxInstrumentMapper wxInstrumentMapper; @Autowired private WxInstrumentSerialMapper instrumentSerialMapper; + private WxInstrumentSerialLogMapper instrumentSerialLogMapper; @Autowired private WxUserInstrumentLogMapper wxUserInstrumentLogMapper; @@ -157,6 +155,23 @@ public class WxUserInstrumentServiceImpl implements IWxUserInstrumentService // 更新处理 userMember.setDevicesNum(devicesNum); wxUserMemberMapper.updateWxUserMember(userMember); + + // 更新序列号绑定状态为解绑 + WxInstrumentSerial update = new WxInstrumentSerial(); + update.setSerial(userInstrument.getSerial()); + update.setBindingStatus(BindingStatusEnums.UN_BOUND.getCode()); + instrumentSerialMapper.updateBySerial(update); + // 保存序列号解绑记录 + WxInstrumentSerialLog wxInstrumentSerialLog = new WxInstrumentSerialLog(); + wxInstrumentSerialLog.setUserId(userMember.getId()); + wxInstrumentSerialLog.setUserName(userMember.getNickname()); + wxInstrumentSerialLog.setUserMobile(userMember.getMobile()); + wxInstrumentSerialLog.setUserHeadimg(userMember.getHeadimg()); + wxInstrumentSerialLog.setInstrumentId(userInstrument.getInstrumentId()); + wxInstrumentSerialLog.setInstrumentName(userInstrument.getInstrumentName()); + wxInstrumentSerialLog.setSerial(userInstrument.getSerial()); + wxInstrumentSerialLog.setBindingStatus(BindingStatusEnums.UN_BOUND.getCode()); + instrumentSerialLogMapper.insertWxInstrumentSerialLog(wxInstrumentSerialLog); } } } diff --git a/flossom-ui/src/components/Pagination/index.vue b/flossom-ui/src/components/Pagination/index.vue index 56f5a6b..4a86df5 100644 --- a/flossom-ui/src/components/Pagination/index.vue +++ b/flossom-ui/src/components/Pagination/index.vue @@ -36,7 +36,7 @@ export default { pageSizes: { type: Array, default() { - return [10, 20, 30, 50] + return [10, 20, 30, 50, 100, 500, 1000] } }, // 移动端页码按钮的数量端默认值5 diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index dd014b4..ed17aa2 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -129,7 +129,7 @@ 设置企微可见标签 + >设置外部可见标签 - -

- - - -
- - - -
- - - -
- - 点击上传 -
只能上传一个文件
-
-
+ +
+ + + +
+ +
+ +
+ + + +
+ + 点击上传 +
只能上传一个文件
+
+
+ + +
+ + + +
+ +
+ +
+ + + +
+ + 点击上传 +
只能上传一个文件
+
+
+ +
+ + + +
+ +