Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104

master
elliott 2 years ago
commit 826b51d50d

@ -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();
}
}

@ -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();
}
}

@ -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();
}
}

@ -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;
}
}

@ -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;
}
}

@ -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)

@ -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;
}
}

@ -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<String> clockImageList = new ArrayList<>();
public String getClockContent() {
return clockContent;
}
public void setClockContent(String clockContent) {
this.clockContent = clockContent;
}
public List<String> getClockImageList() {
return clockImageList;
}
public void setClockImageList(List<String> clockImageList) {
this.clockImageList = clockImageList;
}
}

@ -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<Integer> 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;
}
}

@ -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;
}
}

@ -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 2iot
*/
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;
}
}

@ -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<String> 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<String> getClockImg() {
return clockImg;
}
public void setClockImg(List<String> clockImg) {
this.clockImg = clockImg;
}
}

@ -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;
}
}

@ -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;
}
}

@ -117,4 +117,6 @@ public interface SysTagMapper {
public int deleteDeptById(Long id);
List<SysTag> selectSecondTagByType(@Param("type") Integer type);
List<SysTag> selectByIdList(@Param("tagIdList") List<Long> tagIdList);
}

@ -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<WxClockImg> 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);
}

@ -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<WxClockInstrumentLog> 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);
}

@ -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<WxClockLog> 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<WxClockLogRet> selectWxClockImgRetList(WxClockLog queryClockLog);
}

@ -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<WxClockStatistics> 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<WxClockStatistics> selectByUserIdAndYearMonth(@Param("userIdList") List<Long> userIdList, @Param("year") int year, @Param("month") int month);
}

@ -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<WxNursingLog> 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);
}

@ -89,4 +89,7 @@ public interface WxUserMemberMapper {
List<WxUserMemberRet> selectWxUserMemberRetByIdList(@Param("userIdList") List<Integer> userIdList);
List<WxUserMemberRet> selectWxUserMemberRetListByVm(WxUserMemberVm wxUserMemberVm);
Integer selectWxUserTotal();
}

@ -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;
}
/**

@ -35,6 +35,8 @@ public class MimeTypeUtils
"rar", "zip", "gz", "bz2",
// 视频格式
"mp4", "avi", "rmvb",
// bin文件
"bin",
// pdf
"pdf" };

@ -44,9 +44,9 @@ public class BaseController
/**
*
*/
protected void startPage()
protected Integer startPage()
{
PageUtils.startPage();
return PageUtils.startPage();
}
/**

@ -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},
<if test="openType != null">open_type = #{openType},</if>
<if test="pushType != null">push_type = #{pushType},</if>
<if test="pushNumber != null">push_number = #{pushNumber},</if>
<if test="pushTimer != null">push_timer = #{pushTimer},</if>
<if test="showWechatTag != null">show_wechat_tag = #{showWechatTag},</if>
<if test="showWechatTagId != null">show_wechat_tag_id = #{showWechatTagId},</if>
<if test="showCompanyTag != null">show_company_tag = #{showCompanyTag},</if>

@ -99,7 +99,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY order_num asc
</select>
<insert id="insertDept" parameterType="SysTag">
<select id="selectByIdList" resultMap="SysTagResult">
<include refid="selectDeptVo"/>
where id in
<foreach collection="tagIdList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<insert id="insertDept" parameterType="SysTag">
insert into sys_tag(
<if test="id != null and id != 0">id,</if>
<if test="parentId != null and parentId != 0">parent_id,</if>

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.flossom.common.core.mapper.WxClockImgMapper">
<resultMap type="WxClockImg" id="WxClockImgResult">
<result property="id" column="id" />
<result property="userClockId" column="user_clock_id" />
<result property="clockImg" column="clock_img" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectWxClockImgVo">
select id, user_clock_id, clock_img, status, create_by, create_time from wx_clock_img
</sql>
<select id="selectWxClockImgList" parameterType="WxClockImg" resultMap="WxClockImgResult">
<include refid="selectWxClockImgVo"/>
<where>
<if test="userClockId != null "> and user_clock_id = #{userClockId}</if>
<if test="clockImg != null and clockImg != ''"> and clock_img = #{clockImg}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectWxClockImgById" parameterType="Long" resultMap="WxClockImgResult">
<include refid="selectWxClockImgVo"/>
where id = #{id}
</select>
<insert id="insertWxClockImg" parameterType="WxClockImg" useGeneratedKeys="true" keyProperty="id">
insert into wx_clock_img
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userClockId != null">user_clock_id,</if>
<if test="clockImg != null">clock_img,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userClockId != null">#{userClockId},</if>
<if test="clockImg != null">#{clockImg},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateWxClockImg" parameterType="WxClockImg">
update wx_clock_img
<trim prefix="SET" suffixOverrides=",">
<if test="userClockId != null">user_clock_id = #{userClockId},</if>
<if test="clockImg != null">clock_img = #{clockImg},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWxClockImgById" parameterType="Long">
delete from wx_clock_img where id = #{id}
</delete>
<delete id="deleteByUserClockId" parameterType="Long">
delete from wx_clock_img where user_clock_id = #{userClockId}
</delete>
<delete id="deleteWxClockImgByIds" parameterType="String">
delete from wx_clock_img where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.flossom.common.core.mapper.WxClockInstrumentLogMapper">
<resultMap type="WxClockInstrumentLog" id="WxClockInstrumentLogResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="instrumentId" column="instrument_id" />
<result property="instrumentName" column="instrument_name" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectWxClockInstrumentLogVo">
select id, user_id, instrument_id, instrument_name, status, create_by, create_time from wx_clock_instrument_log
</sql>
<select id="selectWxClockInstrumentLogList" parameterType="WxClockInstrumentLog" resultMap="WxClockInstrumentLogResult">
<include refid="selectWxClockInstrumentLogVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
<if test="instrumentName != null and instrumentName != ''"> and instrument_name like concat('%', #{instrumentName}, '%')</if>
<if test="status != null "> and status = #{status}</if>
<if test="params != null and params.beginTime != null">
and create_time &gt;= #{params.beginTime}
</if>
<if test="params != null and params.endTime != null">
and create_time &lt;= #{params.endTime}
</if>
</where>
</select>
<select id="selectWxClockInstrumentLogById" parameterType="Long" resultMap="WxClockInstrumentLogResult">
<include refid="selectWxClockInstrumentLogVo"/>
where id = #{id}
</select>
<insert id="insertWxClockInstrumentLog" parameterType="WxClockInstrumentLog" useGeneratedKeys="true" keyProperty="id">
insert into wx_clock_instrument_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="instrumentId != null">instrument_id,</if>
<if test="instrumentName != null">instrument_name,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="instrumentId != null">#{instrumentId},</if>
<if test="instrumentName != null">#{instrumentName},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateWxClockInstrumentLog" parameterType="WxClockInstrumentLog">
update wx_clock_instrument_log
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="instrumentId != null">instrument_id = #{instrumentId},</if>
<if test="instrumentName != null">instrument_name = #{instrumentName},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWxClockInstrumentLogById" parameterType="Long">
delete from wx_clock_instrument_log where id = #{id}
</delete>
<delete id="deleteWxClockInstrumentLogByIds" parameterType="String">
delete from wx_clock_instrument_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.flossom.common.core.mapper.WxClockLogMapper">
<resultMap type="WxClockLog" id="WxClockLogResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="instrumentId" column="instrument_id" />
<result property="instrumentName" column="instrument_name" />
<result property="clockContent" column="clock_content" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<resultMap type="WxClockLogRet" id="WxClockLogRetResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="instrumentId" column="instrument_id" />
<result property="instrumentName" column="instrument_name" />
<result property="clockContent" column="clock_content" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectWxClockLogVo">
select id, user_id, instrument_id, instrument_name, clock_content, status, create_by, create_time, update_by, update_time from wx_clock_log
</sql>
<select id="selectCountByUserId" parameterType="WxClockLog" resultType="Integer">
select count(1) from wx_clock_log
where
user_id = #{userId}
and create_time &gt;= #{params.beginTime}
and create_time &lt;= #{params.endTime}
</select>
<select id="selectWxClockLogList" parameterType="WxClockLog" resultMap="WxClockLogResult">
<include refid="selectWxClockLogVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="instrumentId != null and instrumentId != ''"> and instrument_id = #{instrumentId}</if>
<if test="instrumentName != null and instrumentName != ''"> and instrument_name like concat('%', #{instrumentName}, '%')</if>
<if test="clockContent != null and clockContent != ''"> and clock_content = #{clockContent}</if>
<if test="status != null "> and status = #{status}</if>
<if test="params != null and params.beginTime != null">
and create_time &gt;= #{params.beginTime}
</if>
<if test="params != null and params.endTime != null">
and create_time &lt;= #{params.endTime}
</if>
</where>
order by create_time desc
</select>
<select id="selectWxClockLogById" parameterType="Long" resultMap="WxClockLogResult">
<include refid="selectWxClockLogVo"/>
where id = #{id}
</select>
<select id="selectWxClockImgRetList" parameterType="WxClockLog" resultMap="WxClockLogRetResult">
<include refid="selectWxClockLogVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="instrumentId != null and instrumentId != ''"> and instrument_id = #{instrumentId}</if>
<if test="instrumentName != null and instrumentName != ''"> and instrument_name like concat('%', #{instrumentName}, '%')</if>
<if test="clockContent != null and clockContent != ''"> and clock_content = #{clockContent}</if>
<if test="status != null "> and status = #{status}</if>
<if test="params != null and params.beginTime != null">
and create_time &gt;= #{params.beginTime}
</if>
<if test="params != null and params.endTime != null">
and create_time &lt;= #{params.endTime}
</if>
</where>
order by create_time desc
</select>
<insert id="insertWxClockLog" parameterType="WxClockLog" useGeneratedKeys="true" keyProperty="id">
<selectKey keyProperty="id" resultType="Long" order="AFTER">
SELECT LAST_INSERT_ID()
</selectKey>
insert into wx_clock_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="instrumentId != null">instrument_id,</if>
<if test="instrumentName != null">instrument_name,</if>
<if test="clockContent != null">clock_content,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="instrumentId != null">#{instrumentId},</if>
<if test="instrumentName != null">#{instrumentName},</if>
<if test="clockContent != null">#{clockContent},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateWxClockLog" parameterType="WxClockLog">
update wx_clock_log
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="instrumentId != null">instrument_id = #{instrumentId},</if>
<if test="instrumentName != null">instrument_name = #{instrumentName},</if>
<if test="clockContent != null">clock_content = #{clockContent},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWxClockLogById" parameterType="Long">
delete from wx_clock_log where id = #{id}
</delete>
<delete id="deleteWxClockLogByIds" parameterType="String">
delete from wx_clock_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.flossom.common.core.mapper.WxClockStatisticsMapper">
<resultMap type="WxClockStatistics" id="WxClockStatisticsResult">
<result property="id" column="id" />
<result property="year" column="year" />
<result property="month" column="month" />
<result property="userId" column="user_id" />
<result property="clockNum" column="clock_num" />
<result property="percentage" column="percentage" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectWxClockStatisticsVo">
select id, `year`, `month`, user_id, clock_num, percentage, status, create_by, create_time, update_by, update_time from wx_clock_statistics
</sql>
<select id="selectWxClockStatisticsList" parameterType="WxClockStatistics" resultMap="WxClockStatisticsResult">
<include refid="selectWxClockStatisticsVo"/>
<where>
<if test="year != null "> and `year` = #{year}</if>
<if test="month != null "> and `month` = #{month}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="clockNum != null "> and clock_num = #{clockNum}</if>
<if test="percentage != null "> and percentage = #{percentage}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectWxClockStatisticsById" parameterType="Long" resultMap="WxClockStatisticsResult">
<include refid="selectWxClockStatisticsVo"/>
where id = #{id}
</select>
<select id="selectByUserIdAndYearMonth" resultMap="WxClockStatisticsResult">
<include refid="selectWxClockStatisticsVo"/>
<where>
`year` = #{year} and `month` = #{month}
<if test="userIdList != null and userIdList.size > 0">
and user_id in
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
#{userId}
</foreach>
</if>
</where>
</select>
<insert id="insertWxClockStatistics" parameterType="WxClockStatistics" useGeneratedKeys="true" keyProperty="id">
insert into wx_clock_statistics
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="year != null">`year`,</if>
<if test="month != null">`month`,</if>
<if test="userId != null">user_id,</if>
<if test="clockNum != null">clock_num,</if>
<if test="percentage != null">percentage,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="year != null">#{year},</if>
<if test="month != null">#{month},</if>
<if test="userId != null">#{userId},</if>
<if test="clockNum != null">#{clockNum},</if>
<if test="percentage != null">#{percentage},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateWxClockStatistics" parameterType="WxClockStatistics">
update wx_clock_statistics
<trim prefix="SET" suffixOverrides=",">
<if test="year != null">`year` = #{year},</if>
<if test="month != null">`month` = #{month},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="clockNum != null">clock_num = #{clockNum},</if>
<if test="percentage != null">percentage = #{percentage},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWxClockStatisticsById" parameterType="Long">
delete from wx_clock_statistics where id = #{id}
</delete>
<delete id="deleteWxClockStatisticsByIds" parameterType="String">
delete from wx_clock_statistics where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -49,10 +49,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="we200IotVersion" column="we200_iot_version" />
<result property="we200IotUpgradeData" column="we200_iot_upgrade_data" />
<result property="we200IotVersionUpgrade" column="we200_iot_version_upgrade" />
</resultMap>
<sql id="selectWxInstrumentVo">
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
</sql>
<select id="selectWxInstrumentList" parameterType="WxInstrument" resultMap="WxInstrumentResult">
@ -96,6 +99,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null "> and status = #{status}</if>
<if test="manualCodeBinding != null and manualCodeBinding != ''"> and manual_code_binding = #{manualCodeBinding}</if>
<if test="scanCodeBinding != null and scanCodeBinding != ''"> and scan_code_binding = #{scanCodeBinding}</if>
<if test="we200IotVersion != null and we200IotVersion != ''"> and we200_iot_version = #{we200IotVersion}</if>
<if test="we200IotUpgradeData != null and we200IotUpgradeData != ''"> and we200_iot_upgrade_data = #{we200IotUpgradeData}</if>
<if test="we200IotVersionUpgrade != null and we200IotVersionUpgrade != ''"> and we200_iot_version_upgrade = #{we200IotVersionUpgrade}</if>
</where>
order by create_time desc
</select>
@ -198,6 +204,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="we200IotVersion != null">we200_iot_version,</if>
<if test="we200IotUpgradeData != null">we200_iot_upgrade_data,</if>
<if test="we200IotVersionUpgrade != null">we200_iot_version_upgrade,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if>
@ -243,6 +252,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="we200IotVersion != null">#{we200IotVersion},</if>
<if test="we200IotUpgradeData != null">#{we200IotUpgradeData},</if>
<if test="we200IotVersionUpgrade != null">#{we200IotVersionUpgrade},</if>
</trim>
</insert>
@ -292,6 +304,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="we200IotVersion != null">we200_iot_version = #{we200IotVersion},</if>
<if test="we200IotUpgradeData != null">we200_iot_upgrade_data = #{we200IotUpgradeData},</if>
<if test="we200IotVersionUpgrade != null">we200_iot_version_upgrade = #{we200IotVersionUpgrade},</if>
</trim>
where id = #{id}
</update>

@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.flossom.common.core.mapper.WxNursingLogMapper">
<resultMap type="WxNursingLog" id="WxNursingLogResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="instrumentId" column="instrument_id" />
<result property="instrumentName" column="instrument_name" />
<result property="online" column="online" />
<result property="modeId" column="mode_id" />
<result property="modeName" column="mode_name" />
<result property="nursingTime" column="nursing_time" />
<result property="completionPercentage" column="completion_percentage" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectWxNursingLogVo">
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
</sql>
<select id="selectWxNursingLogList" parameterType="WxNursingLog" resultMap="WxNursingLogResult">
<include refid="selectWxNursingLogVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
<if test="instrumentName != null "> and instrument_name = #{instrumentName}</if>
<if test="online != null "> and online = #{online}</if>
<if test="modeId != null "> and mode_id = #{modeId}</if>
<if test="modeName != null and modeName != ''"> and mode_name like concat('%', #{modeName}, '%')</if>
<if test="nursingTime != null "> and nursing_time = #{nursingTime}</if>
<if test="completionPercentage != null "> and completion_percentage = #{completionPercentage}</if>
<if test="status != null "> and status = #{status}</if>
<if test="params != null and params.beginTime != null">
and create_time &gt;= #{params.beginTime}
</if>
<if test="params != null and params.endTime != null">
and create_time &lt;= #{params.endTime}
</if>
</where>
ORDER BY update_time DESC
</select>
<select id="selectWxNursingLogById" parameterType="Long" resultMap="WxNursingLogResult">
<include refid="selectWxNursingLogVo"/>
where id = #{id}
</select>
<insert id="insertWxNursingLog" parameterType="WxNursingLog" useGeneratedKeys="true" keyProperty="id">
insert into wx_nursing_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="instrumentId != null">instrument_id,</if>
<if test="instrumentName != null">instrument_name,</if>
<if test="online != null">online,</if>
<if test="modeId != null">mode_id,</if>
<if test="modeName != null">mode_name,</if>
<if test="nursingTime != null">nursing_time,</if>
<if test="completionPercentage != null">completion_percentage,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="instrumentId != null">#{instrumentId},</if>
<if test="instrumentName != null">#{instrumentName},</if>
<if test="online != null">#{online},</if>
<if test="modeId != null">#{modeId},</if>
<if test="modeName != null">#{modeName},</if>
<if test="nursingTime != null">#{nursingTime},</if>
<if test="completionPercentage != null">#{completionPercentage},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateWxNursingLog" parameterType="WxNursingLog">
update wx_nursing_log
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="instrumentId != null">instrument_id = #{instrumentId},</if>
<if test="instrumentName != null">instrument_name = #{instrumentName},</if>
<if test="online != null">online = #{online},</if>
<if test="modeId != null">mode_id = #{modeId},</if>
<if test="modeName != null">mode_name = #{modeName},</if>
<if test="nursingTime != null">nursing_time = #{nursingTime},</if>
<if test="completionPercentage != null">completion_percentage = #{completionPercentage},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWxNursingLogById" parameterType="Long">
delete from wx_nursing_log where id = #{id}
</delete>
<delete id="deleteWxNursingLogByIds" parameterType="String">
delete from wx_nursing_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -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
</select>
<select id="selectWxUserTotal" resultType="integer">
SELECT count(1) as count FROM `wx_user_member` WHERE status = 0 and user_type = 1
</select>
<select id="selectWxUserMemberIdList" resultType="java.lang.Integer">
SELECT id FROM `wx_user_member`
</select>

@ -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<WxClockLogRet> 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<WxClockStatistics> list = wxClockLogService.clockStatistics(wxClockStatistics, pageNum);
return getDataTable(list);
}
/**
* TODO system
*
* redis
*/
@GetMapping("/clockStatisticsTimedTask")
public void clockStatisticsTimedTask(@RequestParam(value = "userIdList", required = false) List<Long> userIdList,
@RequestParam(value = "year", required = false) Integer year,
@RequestParam(value = "month", required = false) Integer month) {
wxClockLogService.clockStatisticsTimedTask(userIdList, year, month);
}
}

@ -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));
}
}

@ -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<WxNursingLog> 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();
}
}

@ -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<WxClockLogRet> selectWxClockLogList();
List<WxClockStatistics> clockStatistics(WxClockStatistics wxClockStatistics, Integer pageNum);
void clockStatisticsTimedTask(List<Long> userIdList, Integer year, Integer month);
}

@ -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<WxModeRet> getInstrumentModeByInstrumentId(Long instrumentId);
WxInstrumentSerial determineSerialIsSameInstrument(String serial, Long instrumentId);
String upgrade(Long instrumentId, Boolean isWe200);
WxBindingInstrumentInfo bindingInstrumentInfo(Long instrumentId);
}

@ -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<WxNursingLog> selectWxNursingLogList(Long instrumentId);
/**
*
*/
public void insertWxNursingLog(WxNursingLogReq wxNursingLogReq);
WxNursingStatisticsRet statistics(Long instrumentId);
}

@ -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<WxClockLog> 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<WxClockInstrumentLog> 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<Long> userIdList = Arrays.asList(wxUserMember.getId());
List<WxClockStatistics> 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<WxClockLog> wxClockLogList = wxClockLogMapper.selectWxClockLogList(queryClockLog);
if (wxClockLogList != null && wxClockLogList.size() > 0) {
// 直接获取最新的打卡记录
WxClockLog updateClockLog = new WxClockLog();
WxClockLog newWxClockLog = wxClockLogList.get(0);
// 获取打卡记录的使用过的仪器ID
List<Long> 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<WxClockLog> 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<WxClockImg> wxClockImgList = wxClockImgMapper.selectWxClockImgList(queryClockImg);
if (wxClockImgList != null && wxClockImgList.size() > 0) {
wxClockImgList.forEach(wxClockImg -> {
wxClockLogRet.getClockImg().add(wxClockImg.getClockImg());
});
}
return wxClockLogRet;
}
@Override
public List<WxClockLogRet> selectWxClockLogList() {
WxClockLog queryClockLog = new WxClockLog();
queryClockLog.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId());
List<WxClockLogRet> list = wxClockLogMapper.selectWxClockImgRetList(queryClockLog);
if (list != null && list.size() > 0) {
for (WxClockLogRet wxClockLogRet : list) {
WxClockImg wxClockImg = new WxClockImg();
wxClockImg.setUserClockId(wxClockLogRet.getId());
List<WxClockImg> wxClockImgs = wxClockImgMapper.selectWxClockImgList(wxClockImg);
if (wxClockImgs != null && wxClockImgs.size() > 0) {
List<String> collect = wxClockImgs.stream().map(WxClockImg::getClockImg).collect(Collectors.toList());
wxClockLogRet.setClockImg(collect);
}
}
}
return list;
}
@Override
public List<WxClockStatistics> clockStatistics(WxClockStatistics wxClockStatistics, Integer pageNum) {
// 获取历史统计信息,数据在数据库
List<WxClockStatistics> 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<Long> userIdList, Integer year, Integer month) {
if (year == null || month == null) {
LocalDate localDate = LocalDate.now().minusMonths(1);
year = localDate.getYear();
month = localDate.getMonthValue();
}
List<WxClockStatistics> 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);
}
}

@ -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<WxInstrument> bindingInstrumentList() {
/* 绑定了的仪器 不受 "可见小程序标签/可见外部标签" 影响, 去除仪器隐藏的 */
return wxInstrumentMapper.selectBindingInstrumentListByUserId(SecurityUtils.getLoginUser().getWxUserMember().getId());
}
@Override
public List<WxInstrument> unbindingInstrumentInfoList() {
List<WxInstrument> returnList = new ArrayList<>();
/* 去除仪器隐藏的 */
List<WxInstrument> 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
* <p>
* "可见小程序标签/可见外部标签"
*/
@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<WxUserInstrument> 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<WxUserInstrument> 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;
}
}

@ -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<WxNursingLog> wxNursingLogList = wxNursingLogMapper.selectWxNursingLogList(queryNursingLog);
if (wxNursingLogList != null && wxNursingLogList.size() > 0) {
WxNursingStatisticsRet wxNursingStatisticsRet = new WxNursingStatisticsRet();
Map<LocalDate, Long> 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<WxNursingLog> selectWxNursingLogList(Long instrumentId) {
// 排序:最新的护理记录在最上方;图片由后台模式管理-模式封面图片进行配置;
WxNursingLog wxNursingLog = new WxNursingLog();
wxNursingLog.setInstrumentId(instrumentId);
List<WxNursingLog> 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<WxNursingLog> 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<SysDictData> 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<SysDictData> 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);
}
}
}

@ -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);
}

@ -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<WxInstrumentInstructions> selectWxInstrumentInstructionsList(WxInstrumentInstructions wxInstrumentInstructions) {
return wxInstrumentInstructionsMapper.selectWxInstrumentInstructionsList(wxInstrumentInstructions);
List<WxInstrumentInstructions> 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;
}
/**

@ -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<WxInstrument> selectWxInstrumentPage(WxInstrumentReq wxInstrumentReq) {
return wxInstrumentMapper.selectWxInstrumentPage(wxInstrumentReq);
List<WxInstrument> wxInstruments = wxInstrumentMapper.selectWxInstrumentPage(wxInstrumentReq);
if (wxInstruments != null && wxInstruments.size() > 0) {
for (WxInstrument wxInstrument : wxInstruments) {
WxInstrumentTag query = new WxInstrumentTag();
query.setInstrumentId(wxInstrument.getId());
List<WxInstrumentTag> wxInstrumentTagList = wxInstrumentTagMapper.selectWxInstrumentTagList(query);
if (wxInstrumentTagList != null && wxInstrumentTagList.size() > 0) {
List<Long> tagIdList = wxInstrumentTagList.stream().map(WxInstrumentTag::getTagId).collect(Collectors.toList());
List<SysTag> 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;
}
/**

@ -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);
}
}
}

@ -36,7 +36,7 @@ export default {
pageSizes: {
type: Array,
default() {
return [10, 20, 30, 50]
return [10, 20, 30, 50, 100, 500, 1000]
}
},
// 5

@ -129,7 +129,7 @@
</template>
</el-table-column>
<el-table-column
label="小程序标签"
label="可见小程序标签"
align="center"
prop="miniTagNames"
width="150px"
@ -144,7 +144,7 @@
</template>
</el-table-column>
<el-table-column
label="外部标签"
label="可见外部标签"
align="center"
prop="wecomTagNames"
width="150px"
@ -197,7 +197,7 @@
type="text"
icon="el-icon-edit"
@click="editWecomTags(scope.row)"
>设置企微可见标签
>设置外部可见标签
</el-button>
<el-button
size="mini"
@ -571,48 +571,6 @@
>
</el-time-picker>
</el-form-item>
<el-form-item v-if="form.type == 2" label="IOT版本" prop="iotVersion">
<div style="position: relative">
<el-tooltip
class="item"
effect="dark"
content="此项仅研发可以配置,其他用户勿操作"
placement="top-start"
>
<i class="iotVersion-absolute-info el-icon-info"></i>
</el-tooltip>
</div>
<el-input v-model="form.iotVersion" placeholder="请输入IOT版本" />
</el-form-item>
<el-form-item
v-if="form.type == 2"
label="IOT升级数据文件"
prop="iotUpgradeData"
>
<div style="position: relative">
<el-tooltip
class="item"
effect="dark"
content="此项仅研发可以配置,其他用户勿操作"
placement="top-start"
>
<i class="iotUpgradeData-absolute-info el-icon-info"></i>
</el-tooltip>
</div>
<el-upload
class="upload-demo"
:action="uploadUrl"
:headers="headers"
:limit="1"
:on-exceed="iotUpgradeUploadExceed"
:on-success="iotUpgradeUploadSuccess"
:on-error="uploadError"
:file-list="iotUpgradeFile.fileList"
>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传一个文件</div>
</el-upload>
</el-form-item>
<el-form-item label="扫机身码" prop="isScanCode">
<el-switch
v-model="form.isScanCode"
@ -918,6 +876,48 @@
placeholder="请输入蓝牙断开连接文案"
/>
</el-form-item>
<el-form-item v-if="form.type == 2" label="IOT版本" prop="iotVersion">
<div style="position: relative">
<el-tooltip
class="item"
effect="dark"
content="此项仅研发可以配置,其他用户勿操作"
placement="top-start"
>
<i class="iotVersion-absolute-info el-icon-info"></i>
</el-tooltip>
</div>
<el-input v-model="form.iotVersion" placeholder="请输入IOT版本" />
</el-form-item>
<el-form-item
v-if="form.type == 2"
label="IOT升级数据文件"
prop="iotUpgradeData"
>
<div style="position: relative">
<el-tooltip
class="item"
effect="dark"
content="此项仅研发可以配置,其他用户勿操作"
placement="top-start"
>
<i class="iotUpgradeData-absolute-info el-icon-info"></i>
</el-tooltip>
</div>
<el-upload
class="upload-demo"
:action="uploadUrl"
:headers="headers"
:limit="1"
:on-exceed="iotUpgradeUploadExceed"
:on-success="iotUpgradeUploadSuccess"
:on-error="uploadError"
:file-list="iotUpgradeFile.fileList"
>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传一个文件</div>
</el-upload>
</el-form-item>
<el-form-item
v-if="form.type == 2"
label="IOT版本升级介绍"
@ -939,6 +939,70 @@
:min-height="192"
/>
</el-form-item>
<!-- WE200 -->
<el-form-item v-if="form.type == 2" label="WE200IOT版本" prop="we200IotVersion">
<div style="position: relative">
<el-tooltip
class="item"
effect="dark"
content="此项仅研发可以配置,其他用户勿操作"
placement="top-start"
>
<i class="we200-iotVersion-absolute-info el-icon-info"></i>
</el-tooltip>
</div>
<el-input v-model="form.we200IotVersion" placeholder="请输入WE200IOT版本" />
</el-form-item>
<el-form-item
v-if="form.type == 2"
label="WE200IOT升级数据文件"
prop="we200IotUpgradeData"
>
<div style="position: relative">
<el-tooltip
class="item"
effect="dark"
content="此项仅研发可以配置,其他用户勿操作"
placement="top-start"
>
<i class="we200-iotUpgradeData-absolute-info el-icon-info"></i>
</el-tooltip>
</div>
<el-upload
class="upload-demo"
:action="uploadUrl"
:headers="headers"
:limit="1"
:on-exceed="we200IotUpgradeUploadExceed"
:on-success="we200IotUpgradeUploadSuccess"
:on-error="uploadError"
:file-list="we200IotUpgradeFile.fileList"
>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传一个文件</div>
</el-upload>
</el-form-item>
<el-form-item
v-if="form.type == 2"
label="WE200IOT版本升级介绍"
prop="we200IotVersionUpgrade"
>
<div style="position: relative">
<el-tooltip
class="item"
effect="dark"
content="此项仅研发可以配置,其他用户勿操作"
placement="top-start"
>
<i class="we200-absolute-info el-icon-info"></i>
</el-tooltip>
</div>
<editor
v-model="form.we200IotVersionUpgrade"
placeholder="请输入内容"
:min-height="192"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -1124,26 +1188,33 @@
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
v-if="scope.row.link != null"
size="mini"
type="text"
@click="copyInstructionNameUrl(scope.row)"
>复制说明书
</el-button>
<el-button
v-if="scope.row.link != null"
size="mini"
type="text"
icon="el-icon-save"
@click="viewInstrumentInstruction(scope.row)"
>查看
>查看说明书
</el-button>
<el-button
v-if="scope.row.link != null"
size="mini"
type="text"
icon="el-icon-save"
@click="saveInstrumentInstruction(scope.row)"
>保存
>保存说明书
</el-button>
<el-button
v-if="scope.row.link != null"
size="mini"
type="text"
icon="el-icon-delete"
@click="delInstrumentInstruction(scope)"
>删除
>删除说明书
</el-button>
</template>
</el-table-column>
@ -1278,6 +1349,11 @@ export default {
uploadHide: false,
fileList: [],
},
/* we200iot升级数据文件 */
we200IotUpgradeFile: {
uploadHide: false,
fileList: [],
},
/* 蓝牙连接文件 */
bluetoothConnectFile: {
uploadHide: false,
@ -1510,6 +1586,9 @@ export default {
introduceList: null,
modeIdsValue: [],
newModeIdList: [],
we200IotVersion: null,
we200IotUpgradeData: null,
we200IotVersionUpgrade: null,
}
/* 仪器封面 */
this.bannerFile = {
@ -1878,6 +1957,17 @@ export default {
this.$message.error('图片插入失败')
}
},
/* iot升级数据文件 */
we200IotUpgradeUploadExceed(files, fileList) {
this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`)
},
we200IotUpgradeUploadSuccess(response, file) {
if (response.code == 200) {
this.form.we200IotUpgradeData = response.data.url
} else {
this.$message.error('图片插入失败')
}
},
/* 蓝牙连接图片 */
bluetoothConnectUploadExceed(files, fileList) {
this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`)
@ -2196,7 +2286,7 @@ export default {
for (let i = 0; i < response.data.length; i++) {
this.instrumentInstructions.instructionList[i].fileList = [
{
name: response.data[i].name + '.pdf',
name: response.data[i].name,
url: response.data[i].url,
},
]
@ -2263,8 +2353,13 @@ export default {
}
},
viewInstrumentInstruction(item) {
window.open(item.link, '_blank')
window.open(item.nameUrl, '_blank')
},
copyInstructionNameUrl(item) {
navigator.clipboard.writeText(item.nameUrl).then(() => {
this.$message.success('已成功复制到剪贴板')
});
},
/* 模式 */
openModeIdDialog() {
this.mode.modeIdsValueTemp = []
@ -2351,4 +2446,25 @@ video {
left: -140px;
color: #FAAD14;
}
.we200-absolute-info {
position: absolute;
top: 10px;
left: -183px;
color: #FAAD14;
}
.we200-iotVersion-absolute-info {
position: absolute;
top: 10px;
left: -128px;
color: #FAAD14;
}
.we200-iotUpgradeData-absolute-info {
position: absolute;
top: 10px;
left: -184px;
color: #FAAD14;
}
</style>

File diff suppressed because it is too large Load Diff

@ -827,7 +827,6 @@ export default {
updateTime: null,
}
this.resetForm('form');
this.$refs.upload.clearFiles();
},
/** 搜索按钮操作 */
handleQuery() {

@ -341,7 +341,7 @@
</el-select>
</el-form-item>
<el-form-item label="推送次数" prop="pushType">
<el-radio-group v-model="form.pushType" @input="pushTypeChange">
<el-radio-group v-model="form.pushType" >
<el-radio :label="1">永久一次</el-radio>
<el-radio :label="2">每次进入</el-radio>
<el-radio :label="3">自定义频次</el-radio>
@ -933,6 +933,7 @@ export default {
this.getList()
})
}
this.$refs.upload.clearFiles();
}
})
},
@ -993,12 +994,7 @@ export default {
},
`info_${new Date().getTime()}.xlsx`
)
},
pushTypeChange() {
this.form.pushTimerArray = null;
this.form.pushTimer = null;
this.form.pushNumber = 1;
}
}
},
}
</script>

@ -44,6 +44,7 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://110.41.134.131:8080`,
// target: `http://localhost:8080`,
// target: `http://192.168.10.147:8080`,
changeOrigin: true,
pathRewrite: {

Loading…
Cancel
Save