diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/constant/CacheConstants.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/constant/CacheConstants.java index da4c1a5..a2d6322 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/constant/CacheConstants.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/constant/CacheConstants.java @@ -90,4 +90,9 @@ public class CacheConstants * 数云 access_token 有效期 HKey缓存 */ public static final String SHUYUN_ACCESS_TOKEN_CACHE_EXPIRY = "expiry"; + + /** + * 缓存微信用户的unionid_openid key + */ + public static final String WX_UNIONID_OPENID_KEY = "wx_unionid_openid_key"; } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxNursingPlanJoinProgressDetail.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxNursingPlanJoinProgressDetail.java index ce0af64..a504062 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxNursingPlanJoinProgressDetail.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxNursingPlanJoinProgressDetail.java @@ -82,7 +82,6 @@ public class WxNursingPlanJoinProgressDetail extends BaseEntity { */ private int status; - public void setId(Long id) { this.id = id; } @@ -192,6 +191,54 @@ public class WxNursingPlanJoinProgressDetail extends BaseEntity { //模式时长 private Integer modeTime; + /** + * 蓝牙连接中标题 + */ + private String bluetoothConnectingTitle; + + /** + * 蓝牙连接中图片 + */ + private String bluetoothConnecting; + + /** + * 蓝牙连接中文案 + */ + private String bluetoothConnectingContent; + + /** + * 蓝牙关闭标题 + */ + private String bluetoothClosedTitle; + + /** + * 蓝牙关闭图片 + */ + private String bluetoothClosed; + + /** + * 蓝牙关闭文案 + */ + private String bluetoothClosedContent; + + /** + * 蓝牙连接失败标题 + */ + private String bluetoothConnectFailTitle; + + /** + * 蓝牙连接失败图片 + */ + private String bluetoothConnectFail; + + /** + * 蓝牙连接失败文案 + */ + private String bluetoothConnectFailContent; + + private String modeType; + + public String getProductName() { return productName; } @@ -272,6 +319,86 @@ public class WxNursingPlanJoinProgressDetail extends BaseEntity { this.modeTime = modeTime; } + public String getBluetoothConnectingTitle() { + return bluetoothConnectingTitle; + } + + public void setBluetoothConnectingTitle(String bluetoothConnectingTitle) { + this.bluetoothConnectingTitle = bluetoothConnectingTitle; + } + + public String getBluetoothConnecting() { + return bluetoothConnecting; + } + + public void setBluetoothConnecting(String bluetoothConnecting) { + this.bluetoothConnecting = bluetoothConnecting; + } + + public String getBluetoothConnectingContent() { + return bluetoothConnectingContent; + } + + public void setBluetoothConnectingContent(String bluetoothConnectingContent) { + this.bluetoothConnectingContent = bluetoothConnectingContent; + } + + public String getBluetoothClosedTitle() { + return bluetoothClosedTitle; + } + + public void setBluetoothClosedTitle(String bluetoothClosedTitle) { + this.bluetoothClosedTitle = bluetoothClosedTitle; + } + + public String getBluetoothClosed() { + return bluetoothClosed; + } + + public void setBluetoothClosed(String bluetoothClosed) { + this.bluetoothClosed = bluetoothClosed; + } + + public String getBluetoothClosedContent() { + return bluetoothClosedContent; + } + + public void setBluetoothClosedContent(String bluetoothClosedContent) { + this.bluetoothClosedContent = bluetoothClosedContent; + } + + public String getBluetoothConnectFailTitle() { + return bluetoothConnectFailTitle; + } + + public void setBluetoothConnectFailTitle(String bluetoothConnectFailTitle) { + this.bluetoothConnectFailTitle = bluetoothConnectFailTitle; + } + + public String getBluetoothConnectFail() { + return bluetoothConnectFail; + } + + public void setBluetoothConnectFail(String bluetoothConnectFail) { + this.bluetoothConnectFail = bluetoothConnectFail; + } + + public String getBluetoothConnectFailContent() { + return bluetoothConnectFailContent; + } + + public void setBluetoothConnectFailContent(String bluetoothConnectFailContent) { + this.bluetoothConnectFailContent = bluetoothConnectFailContent; + } + + public String getModeType() { + return modeType; + } + + public void setModeType(String modeType) { + this.modeType = modeType; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxNursingPlanJoinUserReq.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxNursingPlanJoinUserReq.java index 887a0eb..43f31e9 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxNursingPlanJoinUserReq.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxNursingPlanJoinUserReq.java @@ -13,6 +13,7 @@ public class WxNursingPlanJoinUserReq { private String userId; //护理计划标题 private String planTitle; + private String nickName; //手机号码 private String mobile; //参与开始时间 @@ -34,6 +35,7 @@ public class WxNursingPlanJoinUserReq { private Integer miniProgramTagNum; private List ids; + private List planIds; public String getPlanId() { return planId; @@ -146,4 +148,20 @@ public class WxNursingPlanJoinUserReq { public void setIds(List ids) { this.ids = ids; } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public List getPlanIds() { + return planIds; + } + + public void setPlanIds(List planIds) { + this.planIds = planIds; + } } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/ret/WxNursingPlanUserJoinDayRet.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/ret/WxNursingPlanUserJoinDayRet.java new file mode 100644 index 0000000..50088ca --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/ret/WxNursingPlanUserJoinDayRet.java @@ -0,0 +1,124 @@ +package com.flossom.common.core.domain.ret; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.time.LocalDateTime; + +public class WxNursingPlanUserJoinDayRet { + + private Long planId; + private Integer status; + + private Integer isDayOff; + + private Long progressId; + + private Long cycleId; + + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDateTime startTime; + private Long instrumentId; + private Long modeId; + private String instrumentName; + private String mode; + private String modeName; + + private String colorCode; + + public Long getPlanId() { + return planId; + } + + public void setPlanId(Long planId) { + this.planId = planId; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getIsDayOff() { + return isDayOff; + } + + public void setIsDayOff(Integer isDayOff) { + this.isDayOff = isDayOff; + } + + public Long getProgressId() { + return progressId; + } + + public void setProgressId(Long progressId) { + this.progressId = progressId; + } + + public Long getCycleId() { + return cycleId; + } + + public void setCycleId(Long cycleId) { + this.cycleId = cycleId; + } + + public LocalDateTime getStartTime() { + return startTime; + } + + public void setStartTime(LocalDateTime startTime) { + this.startTime = startTime; + } + + public Long getInstrumentId() { + return instrumentId; + } + + public void setInstrumentId(Long instrumentId) { + this.instrumentId = instrumentId; + } + + public Long getModeId() { + return modeId; + } + + public void setModeId(Long modeId) { + this.modeId = modeId; + } + + public String getInstrumentName() { + return instrumentName; + } + + public void setInstrumentName(String instrumentName) { + this.instrumentName = instrumentName; + } + + public String getMode() { + return mode; + } + + public void setMode(String mode) { + this.mode = mode; + } + + public String getModeName() { + return modeName; + } + + public void setModeName(String modeName) { + this.modeName = modeName; + } + + public String getColorCode() { + return colorCode; + } + + public void setColorCode(String colorCode) { + this.colorCode = colorCode; + } + +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/ret/WxNursingPlanUserJoinRet.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/ret/WxNursingPlanUserJoinRet.java new file mode 100644 index 0000000..fef8ecf --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/ret/WxNursingPlanUserJoinRet.java @@ -0,0 +1,60 @@ +package com.flossom.common.core.domain.ret; + +import java.time.LocalDateTime; + +public class WxNursingPlanUserJoinRet { + private Long planId; + private Long joinId; + private LocalDateTime activeStartTime; + private LocalDateTime activeEndTime; + private LocalDateTime joinTime; + private Integer status; + + public Long getPlanId() { + return planId; + } + + public void setPlanId(Long planId) { + this.planId = planId; + } + + public Long getJoinId() { + return joinId; + } + + public void setJoinId(Long joinId) { + this.joinId = joinId; + } + + public LocalDateTime getActiveStartTime() { + return activeStartTime; + } + + public void setActiveStartTime(LocalDateTime activeStartTime) { + this.activeStartTime = activeStartTime; + } + + public LocalDateTime getActiveEndTime() { + return activeEndTime; + } + + public void setActiveEndTime(LocalDateTime activeEndTime) { + this.activeEndTime = activeEndTime; + } + + public LocalDateTime getJoinTime() { + return joinTime; + } + + public void setJoinTime(LocalDateTime joinTime) { + this.joinTime = joinTime; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/WxNursingPlanJoinUserVo.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/WxNursingPlanJoinUserVo.java index 11921f4..86712a8 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/WxNursingPlanJoinUserVo.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/WxNursingPlanJoinUserVo.java @@ -69,26 +69,35 @@ public class WxNursingPlanJoinUserVo { /** * 状态 */ - @Excel(name = "状态 1参与中 2待审核 3审核通过 4审核未通过 5已终止 6已过期 7已结束") private Integer status; + @Excel(name = "状态") + private String statusStr; /** * 小程序标签 */ private List miniProgramTags; + @Excel(name = "小程序标签") + private String miniProgramTagName; + /** * 外部标签 */ private List companyTags; + @Excel(name = "外部标签") + private String companyTagName; + /** * 参与时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "参与时间") private Date joinTime; + @Excel(name = "参与时间") + private String joinTimeStr; + /** * 护理计划标题 */ @@ -105,6 +114,8 @@ public class WxNursingPlanJoinUserVo { * 是否有奖励 */ private Integer isReward; + @Excel(name = "是否有奖励") + private String isRewardStr; /** * 领取奖励天数 @@ -115,20 +126,26 @@ public class WxNursingPlanJoinUserVo { /** * 当前计划完进度 */ - @Excel(name = "当前计划完进度") private Integer currentProgress; + @Excel(name = "当前计划完进度") + private String currentProgressStr; + /** * 是否填写奖励登记星卷问卷 */ - @Excel(name = "是否填写奖励登记星卷问卷 1是 0否") + private Integer isWriteSurvey; + @Excel(name = "是否填写奖励登记星卷问卷") + private String isWriteSurveyStr; /** * 是否有领取奖励资格 */ - @Excel(name = "是否有领取奖励资格 1是 0否") + private Integer isQualifyFor; + @Excel(name = "是否有领取奖励资格") + private String isQualifyForStr; /** * 护理过程中使用过的仪器名称 @@ -320,4 +337,68 @@ public class WxNursingPlanJoinUserVo { public void setIsReward(Integer isReward) { this.isReward = isReward; } + + public String getStatusStr() { + return statusStr; + } + + public void setStatusStr(String statusStr) { + this.statusStr = statusStr; + } + + public String getIsRewardStr() { + return isRewardStr; + } + + public void setIsRewardStr(String isRewardStr) { + this.isRewardStr = isRewardStr; + } + + public String getIsQualifyForStr() { + return isQualifyForStr; + } + + public void setIsQualifyForStr(String isQualifyForStr) { + this.isQualifyForStr = isQualifyForStr; + } + + public String getCurrentProgressStr() { + return currentProgressStr; + } + + public void setCurrentProgressStr(String currentProgressStr) { + this.currentProgressStr = currentProgressStr; + } + + public String getIsWriteSurveyStr() { + return isWriteSurveyStr; + } + + public void setIsWriteSurveyStr(String isWriteSurveyStr) { + this.isWriteSurveyStr = isWriteSurveyStr; + } + + public String getMiniProgramTagName() { + return miniProgramTagName; + } + + public void setMiniProgramTagName(String miniProgramTagName) { + this.miniProgramTagName = miniProgramTagName; + } + + public String getCompanyTagName() { + return companyTagName; + } + + public void setCompanyTagName(String companyTagName) { + this.companyTagName = companyTagName; + } + + public String getJoinTimeStr() { + return joinTimeStr; + } + + public void setJoinTimeStr(String joinTimeStr) { + this.joinTimeStr = joinTimeStr; + } } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/WxNursingPlanUserProgressVo.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/WxNursingPlanUserProgressVo.java index c5ad402..93c5d1f 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/WxNursingPlanUserProgressVo.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/WxNursingPlanUserProgressVo.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.flossom.common.core.domain.entity.WxNursingPlanJoinProgressDetail; import java.time.LocalDateTime; +import java.util.Date; import java.util.List; public class WxNursingPlanUserProgressVo { @@ -44,11 +45,14 @@ public class WxNursingPlanUserProgressVo { private String surveyRewardUrl;//奖励登记星卷问卷地址 - - @JsonFormat(pattern = "yyyy-MM-dd HH:00:00") + private Integer day; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime nextTime; List details;//护理任务 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date joinTime; + public long getPlanId() { return planId; } @@ -248,4 +252,20 @@ public class WxNursingPlanUserProgressVo { public void setSurveyRewardUrl(String surveyRewardUrl) { this.surveyRewardUrl = surveyRewardUrl; } + + public Integer getDay() { + return day; + } + + public void setDay(Integer day) { + this.day = day; + } + + public Date getJoinTime() { + return joinTime; + } + + public void setJoinTime(Date joinTime) { + this.joinTime = joinTime; + } } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/SysTagMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/SysTagMapper.java index be51623..d3386f4 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/SysTagMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/SysTagMapper.java @@ -139,4 +139,8 @@ public interface SysTagMapper { List selectByIdList(@Param("tagIdList") List tagIdList); SysTag selectTagByShuyunTagId(@Param("tagId") String tagId); + + int selectCount(@Param("parentId")Long parentId,@Param("type")Integer type); + + int findTagCount(@Param("type")String type,@Param("tagName")String tagName,@Param("notId")Long notId); } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentModeMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentModeMapper.java index daca1d1..67a4765 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentModeMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentModeMapper.java @@ -2,6 +2,7 @@ package com.flossom.common.core.mapper; import com.flossom.common.core.domain.entity.WxInstrumentMode; import com.flossom.common.core.domain.vo.InstrumentModeVo; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -62,6 +63,6 @@ public interface WxInstrumentModeMapper { public int deleteByInstrumentId(Long instrumentId); - List getInstrumentModeList(Integer type); + List getInstrumentModeList(@Param("ids") List ids); } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanCycleMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanCycleMapper.java index 91c6439..b1f6c19 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanCycleMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanCycleMapper.java @@ -72,4 +72,6 @@ public interface WxNursingPlanCycleMapper int findCycleMarkerCount(@Param("planId")Long planId, @Param("cycleMarker")Long cycleMarker, @Param("notId")Long notId); + + List findDayNumList(@Param("planId")Long planId); } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanInstrumentMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanInstrumentMapper.java index b3a1258..861ec55 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanInstrumentMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanInstrumentMapper.java @@ -69,4 +69,6 @@ public interface WxNursingPlanInstrumentMapper { List getWxNursingPlanIdsByInstrumentName(String instrumentName); int findCountByInstrumentId(@Param("planId") Long planId,@Param("instrumentId") Long instrumentId); + + List findPlanIdsByInstrumentIds(@Param("instrumentIds")List instrumentIds); } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanJoinMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanJoinMapper.java index 485da81..fe1cb57 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanJoinMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanJoinMapper.java @@ -3,10 +3,12 @@ package com.flossom.common.core.mapper; import com.flossom.common.core.domain.entity.WxNursingPlanJoin; import com.flossom.common.core.domain.req.WxNursingPlanJoinUserReq; import com.flossom.common.core.domain.ret.WxNursingPlanJoinRet; +import com.flossom.common.core.domain.ret.WxNursingPlanUserJoinRet; import com.flossom.common.core.domain.vo.WxNursingPlanJoinUserVo; import com.flossom.common.core.domain.vo.WxNursingPlanUserProgressVo; import org.apache.ibatis.annotations.Param; +import java.time.LocalDateTime; import java.util.List; /** @@ -82,4 +84,10 @@ public interface WxNursingPlanJoinMapper { int getUserCountByPlanId(@Param("planId")Long planId); List getWxNursingPlanUserProgressVo(@Param("statusArr")Integer[] statusArr,@Param("userId")Long userId); + + List findJoinStatusByCond(@Param("userId")Long userId,@Param("statusArr")Integer[] statusArr); + + List findWxNursingPlanUserJoinRet(@Param("userId")Long userId, + @Param("startTime")LocalDateTime startTime, + @Param("endTime")LocalDateTime endTime); } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanJoinProgressDetailMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanJoinProgressDetailMapper.java index b2a01c8..5a706cc 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanJoinProgressDetailMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanJoinProgressDetailMapper.java @@ -1,6 +1,7 @@ package com.flossom.common.core.mapper; import com.flossom.common.core.domain.entity.WxNursingPlanJoinProgressDetail; +import com.flossom.common.core.domain.ret.WxNursingPlanUserJoinDayRet; import org.apache.ibatis.annotations.Param; import java.time.LocalDateTime; @@ -73,4 +74,11 @@ public interface WxNursingPlanJoinProgressDetailMapper { int deleteWxNursingPlanJoinProgressDetailByProgressIds(@Param("progressIds")List progressIds); List getNursingTimeList(@Param("progressIds") List progressIds); + + List listWxNursingPlanJoinProgressDetailCond(WxNursingPlanJoinProgressDetail detail); + + List findJoinProgressDetailList(@Param("planId")Long planId, + @Param("userId")Long userId, + @Param("startTime")LocalDateTime startTime, + @Param("endTime")LocalDateTime endTime); } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanJoinProgressMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanJoinProgressMapper.java index 966bb19..7da8ed4 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanJoinProgressMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxNursingPlanJoinProgressMapper.java @@ -61,9 +61,9 @@ public interface WxNursingPlanJoinProgressMapper { */ public int deleteWxNursingPlanJoinProgressByIds(Long[] ids); - List findProgressIdsByJoinIds(List joinIds); + List findProgressIdsByJoinIds(@Param("joinIds") List joinIds); - int deleteWxNursingPlanJoinProgressByJoinIds(List joinIds); + int deleteWxNursingPlanJoinProgressByJoinIds(@Param("joinIds") List joinIds); WxNursingPlanJoinProgress getLastProgress(Long planJoinId); @@ -71,7 +71,8 @@ public interface WxNursingPlanJoinProgressMapper { @Param("status")Integer status, @Param("isWarn")Integer isWarn, @Param("isDayOff")Integer isDayOff, - @Param("nextTime") LocalDateTime nextTime); + @Param("nextTime") LocalDateTime nextTime, + @Param("joinStatus")Integer joinStatus); List selectNowProgressList(@Param("planJoinId")Long planJoinId, @Param("nowStartTime")LocalDateTime nowStartTime, diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxUserInstrumentMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxUserInstrumentMapper.java index e93dedb..fd687d7 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxUserInstrumentMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxUserInstrumentMapper.java @@ -75,4 +75,6 @@ public interface WxUserInstrumentMapper * @return 用户关联的仪器id */ List selectInstrumentIdListByUserId(@Param("userId") Long userId); + + List findInstrumentList(WxUserInstrument wxUserInstrument); } diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml index e499aa2..e0e5a67 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml @@ -220,4 +220,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update sys_tag set del_flag = '2' where id = #{id} + + + diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentModeMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentModeMapper.xml index b64c0a9..3d25e62 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentModeMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentModeMapper.xml @@ -97,7 +97,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" inner join wx_instrument_mode wim on wi.id=wim.instrument_id inner join wx_mode wm on wm.id=wim.mode_id - and wi.type = #{type} + + and wi.id in + + #{id} + + \ No newline at end of file diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanCycleMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanCycleMapper.xml index 060c3e5..05167fe 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanCycleMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanCycleMapper.xml @@ -147,4 +147,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and id != #{notId} + + \ No newline at end of file diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanInstrumentMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanInstrumentMapper.xml index b0ea603..02c33df 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanInstrumentMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanInstrumentMapper.xml @@ -89,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select count(*) from wx_nursing_plan_instrument where plan_id = #{planId} and instrument_id = #{instrumentId} + + \ No newline at end of file diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanJoinMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanJoinMapper.xml index e05584f..c525cf5 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanJoinMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanJoinMapper.xml @@ -144,6 +144,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join wx_user_member m on pj.user_id = m.id left join wx_nursing_plan p on pj.plan_id = p.id + and m.nickname like concat('%', #{nickName}, '%') and p.title like concat('%', #{planTitle}, '%') @@ -203,10 +204,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) - and pj.create_time < = #{joinStartTime} + and pj.create_time <= #{joinStartTime} - and pj.create_time > = #{joinStartTime} + and pj.create_time >= #{joinEndTime} and pj.status = #{status} @@ -215,6 +216,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{pjId} + + and p.id in + + #{planId} + + order by pj.create_time desc @@ -307,7 +314,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" p.is_survey as 'isSurvey',p.reward_type as 'rewardType', p.prize_name as 'prizeName',p.reward_points as 'rewardPoints', p.survey_reward_url as 'surveyRewardUrl',p.is_survey_reward as 'isSurveyReward', - pj.is_warn as 'isWarn',pj.id as 'planJoinId',pj.is_set_reward as 'isSetReward', + pj.is_warn as 'isWarn',pj.id as 'planJoinId',pj.is_set_reward as 'isSetReward',pj.create_time as 'joinTime', pj.is_points_reward as 'isPointsReward',pj.is_write_survey as 'isWriteSurvey',pj.status as 'joinStatus' FROM wx_nursing_plan_join pj LEFT JOIN wx_nursing_plan p ON p.id = pj.plan_id @@ -320,4 +327,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ORDER BY pj.create_time DESC + + + + \ No newline at end of file diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanJoinProgressDetailMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanJoinProgressDetailMapper.xml index b887675..4ccfd47 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanJoinProgressDetailMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanJoinProgressDetailMapper.xml @@ -126,8 +126,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select d.id, d.progress_id, d.user_id, d.step_type, d.`index`, d.product_id, d.instrument_id, d.mode_id, d.status, d.create_by, d.create_time, d.update_by, d.update_time, d.remark,d.log_id, i.`name` AS 'instrumentName',i.banner AS 'instrumentBanner',i.model,i.color_code AS 'colorCode', - m.mode_name AS 'modeName',m.mode_banner AS 'modeBanner',m.mode_time AS 'modeTime', - p.product_name AS 'productName',p.product_img AS 'productImg',p.introduce + m.mode_name AS 'modeName',m.mode_banner AS 'modeBanner',m.mode_time AS 'modeTime',m.mode_type as'modeType', + p.product_name AS 'productName',p.product_img AS 'productImg',p.introduce, + i.bluetooth_connecting_title AS 'bluetoothConnectingTitle', + i.bluetooth_connecting_content AS 'bluetoothConnectingContent', + i.bluetooth_connecting AS 'bluetoothConnecting', + i.bluetooth_closed_title AS 'bluetoothClosedTitle', + i.bluetooth_closed_content AS 'bluetoothConnectingContent', + i.bluetooth_closed AS 'bluetoothClosed', + i.bluetooth_connect_fail_title AS 'bluetoothConnectFailTitle', + i.bluetooth_connect_fail_content AS 'bluetoothConnectFailContent', + i.bluetooth_connect_fail AS 'bluetoothConnectFail' from wx_nursing_plan_join_progress_detail d LEFT JOIN wx_instrument i ON d.instrument_id = i.id LEFT JOIN wx_mode m ON d.mode_id = m.id AND d.step_type = 2 @@ -179,4 +188,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + + + \ No newline at end of file diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanJoinProgressMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanJoinProgressMapper.xml index 32a7893..c2a68af 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanJoinProgressMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanJoinProgressMapper.xml @@ -130,14 +130,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id from wx_nursing_plan_join_progress where id in + delete from wx_nursing_plan_join_progress where id in #{id} @@ -158,6 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and p.status = #{status} and j.is_warn = #{isWarn} and p.next_time =#{nextTime} + and j.status = #{joinStatus} @@ -165,8 +166,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and plan_join_id = #{planJoinId} - and start_time > = #{nowStartTime} - and start_time < = #{nowEndTime} + and start_time >= #{nowStartTime} + and start_time <= #{nowEndTime} \ No newline at end of file diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanMapper.xml index e767c27..6599fcb 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingPlanMapper.xml @@ -280,17 +280,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" p.reward_jump_video_feed_id, p.reward_conditions, p.reward_restrict_time, p.reward_restrict_number, p.basic_number,p.is_survey, p.survey_url, p.survey_reward_url, p.active_detail, p.status, p.create_by, p.create_time, p.update_by, p.update_time,is_survey_reward, + if(isnull(pj.`status`),0,pj.`status`) as 'joinStatus', (select GROUP_CONCAT(tag_id) from wx_nursing_plan_tag where plan_id = p.id and tag_type = 1 GROUP BY plan_id) as 'joinWechatTagArrayStr', (select GROUP_CONCAT(tag_id) from wx_nursing_plan_tag where plan_id = p.id and tag_type = 2 GROUP BY plan_id) as 'joinCompanyTagArrayStr', (select GROUP_CONCAT(tag_id) from wx_nursing_plan_tag where plan_id = p.id and tag_type = 3 GROUP BY plan_id) as 'unJoinWechatTagArrayStr', (select GROUP_CONCAT(tag_id) from wx_nursing_plan_tag where plan_id = p.id and tag_type = 4 GROUP BY plan_id) as 'unJoinCompanyTagArrayStr', (select GROUP_CONCAT(tag_id) from wx_nursing_plan_tag where plan_id = p.id and tag_type = 5 GROUP BY plan_id) as 'browseWechatTagArrayStr' from wx_nursing_plan p + left join wx_nursing_plan_join pj on pj.plan_id = p.id + and pj.user_id = #{userId} and p.id = #{planId} and p.status = #{status} and p.active_start_time <= #{activeTime} and p.active_end_time > #{activeTime} and p.user_registration_start_time <= #{userRegistrationTime} and p.user_registration_end_time > #{userRegistrationTime} + + and pj.`status` in + #{statusItem} + order by p.order_num desc diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserInstrumentMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserInstrumentMapper.xml index b6dde36..24ca8fa 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserInstrumentMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserInstrumentMapper.xml @@ -200,4 +200,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + diff --git a/flossom-modules/flossom-job/src/main/java/com/flossom/job/config/WxConfig.java b/flossom-modules/flossom-job/src/main/java/com/flossom/job/config/WxConfig.java index c5b5581..b0cae4b 100644 --- a/flossom-modules/flossom-job/src/main/java/com/flossom/job/config/WxConfig.java +++ b/flossom-modules/flossom-job/src/main/java/com/flossom/job/config/WxConfig.java @@ -46,6 +46,11 @@ public class WxConfig { */ private String NursingPlanWarnMessageTemplateId; + /** + * 通过消息模版去发送指定的消息 + */ + private String messageTemplateSendUrl; + public String getLoginUrl() { return loginUrl; @@ -110,4 +115,12 @@ public class WxConfig { public void setNursingPlanWarnMessageTemplateId(String nursingPlanWarnMessageTemplateId) { NursingPlanWarnMessageTemplateId = nursingPlanWarnMessageTemplateId; } + + public String getMessageTemplateSendUrl() { + return messageTemplateSendUrl; + } + + public void setMessageTemplateSendUrl(String messageTemplateSendUrl) { + this.messageTemplateSendUrl = messageTemplateSendUrl; + } } diff --git a/flossom-modules/flossom-job/src/main/java/com/flossom/job/controller/SysJobLogController.java b/flossom-modules/flossom-job/src/main/java/com/flossom/job/controller/SysJobLogController.java index 005f972..4c06943 100644 --- a/flossom-modules/flossom-job/src/main/java/com/flossom/job/controller/SysJobLogController.java +++ b/flossom-modules/flossom-job/src/main/java/com/flossom/job/controller/SysJobLogController.java @@ -1,17 +1,5 @@ package com.flossom.job.controller; -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -import com.flossom.job.domain.SysJobLog; -import com.flossom.job.service.ISysJobLogService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import com.flossom.common.core.utils.poi.ExcelUtil; import com.flossom.common.core.web.controller.BaseController; import com.flossom.common.core.web.domain.AjaxResult; @@ -19,6 +7,13 @@ import com.flossom.common.core.web.page.TableDataInfo; import com.flossom.common.log.annotation.Log; import com.flossom.common.log.enums.BusinessType; import com.flossom.common.security.annotation.RequiresPermissions; +import com.flossom.job.domain.SysJobLog; +import com.flossom.job.service.ISysJobLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 调度日志操作处理 @@ -89,4 +84,5 @@ public class SysJobLogController extends BaseController jobLogService.cleanJobLog(); return success(); } + } diff --git a/flossom-modules/flossom-job/src/main/java/com/flossom/job/domain/OfficialAccountUserDetailRet.java b/flossom-modules/flossom-job/src/main/java/com/flossom/job/domain/OfficialAccountUserDetailRet.java new file mode 100644 index 0000000..6a620d0 --- /dev/null +++ b/flossom-modules/flossom-job/src/main/java/com/flossom/job/domain/OfficialAccountUserDetailRet.java @@ -0,0 +1,178 @@ +package com.flossom.job.domain; + +import com.flossom.common.core.utils.StringUtils; + +import java.util.List; + +/** + * 分页获取 微信公众号 的关注者用户详情 + */ +public class OfficialAccountUserDetailRet { + + private List user_info_list; + + private Integer errcode; + + private String errmsg; + + public OfficialAccountUserDetailRet() { + } + + public OfficialAccountUserDetailRet(List user_info_list, Integer errcode, String errmsg) { + this.user_info_list = user_info_list; + this.errcode = errcode; + this.errmsg = errmsg; + } + + public List getUser_info_list() { + return user_info_list; + } + + public void setUser_info_list(List user_info_list) { + this.user_info_list = user_info_list; + } + + public Integer getErrcode() { + return errcode; + } + + public void setErrcode(Integer errcode) { + this.errcode = errcode; + } + + public String getErrmsg() { + return errmsg; + } + + public void setErrmsg(String errmsg) { + this.errmsg = errmsg; + } + + public Boolean isContainUnionid(String unionid) { + for (userInfoList userInfoList : this.getUser_info_list()) { + if (StringUtils.equals(userInfoList.getUnionid(), unionid)) { + return true; + } + } + return false; + } + + public class userInfoList { + private Integer subscribe; + private String openid; + private String language; + private String subscribe_time; + private String unionid; + private String remark; + private Integer groupid; + private List tagid_list; + private String subscribe_scene; + private String qr_scene; + private String qr_scene_str; + + public userInfoList() { + } + + public userInfoList(Integer subscribe, String openid, String language, String subscribe_time, String unionid, String remark, Integer groupid, List tagid_list, String subscribe_scene, String qr_scene, String qr_scene_str) { + this.subscribe = subscribe; + this.openid = openid; + this.language = language; + this.subscribe_time = subscribe_time; + this.unionid = unionid; + this.remark = remark; + this.groupid = groupid; + this.tagid_list = tagid_list; + this.subscribe_scene = subscribe_scene; + this.qr_scene = qr_scene; + this.qr_scene_str = qr_scene_str; + } + + public Integer getSubscribe() { + return subscribe; + } + + public void setSubscribe(Integer subscribe) { + this.subscribe = subscribe; + } + + public String getOpenid() { + return openid; + } + + public void setOpenid(String openid) { + this.openid = openid; + } + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } + + public String getSubscribe_time() { + return subscribe_time; + } + + public void setSubscribe_time(String subscribe_time) { + this.subscribe_time = subscribe_time; + } + + public String getUnionid() { + return unionid; + } + + public void setUnionid(String unionid) { + this.unionid = unionid; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Integer getGroupid() { + return groupid; + } + + public void setGroupid(Integer groupid) { + this.groupid = groupid; + } + + public List getTagid_list() { + return tagid_list; + } + + public void setTagid_list(List tagid_list) { + this.tagid_list = tagid_list; + } + + public String getSubscribe_scene() { + return subscribe_scene; + } + + public void setSubscribe_scene(String subscribe_scene) { + this.subscribe_scene = subscribe_scene; + } + + public String getQr_scene() { + return qr_scene; + } + + public void setQr_scene(String qr_scene) { + this.qr_scene = qr_scene; + } + + public String getQr_scene_str() { + return qr_scene_str; + } + + public void setQr_scene_str(String qr_scene_str) { + this.qr_scene_str = qr_scene_str; + } + } +} diff --git a/flossom-modules/flossom-job/src/main/java/com/flossom/job/domain/OfficialAccountUserReq.java b/flossom-modules/flossom-job/src/main/java/com/flossom/job/domain/OfficialAccountUserReq.java new file mode 100644 index 0000000..de176e2 --- /dev/null +++ b/flossom-modules/flossom-job/src/main/java/com/flossom/job/domain/OfficialAccountUserReq.java @@ -0,0 +1,32 @@ +package com.flossom.job.domain; + +/** + * 获取 微信公众号关注者详情 请求对象 + */ +public class OfficialAccountUserReq { + private String openid; + private String lang = "zh_CN"; + + public OfficialAccountUserReq() { + } + + public OfficialAccountUserReq(String openid) { + this.openid = openid; + } + + public String getOpenid() { + return openid; + } + + public void setOpenid(String openid) { + this.openid = openid; + } + + public String getLang() { + return lang; + } + + public void setLang(String lang) { + this.lang = lang; + } +} diff --git a/flossom-modules/flossom-job/src/main/java/com/flossom/job/domain/OfficialAccountUserRet.java b/flossom-modules/flossom-job/src/main/java/com/flossom/job/domain/OfficialAccountUserRet.java new file mode 100644 index 0000000..db3730f --- /dev/null +++ b/flossom-modules/flossom-job/src/main/java/com/flossom/job/domain/OfficialAccountUserRet.java @@ -0,0 +1,100 @@ +package com.flossom.job.domain; + +import java.util.List; + +/** + * 分页获取 微信公众号 的关注者 + */ +public class OfficialAccountUserRet { + + private Integer total; + private Integer count; + private data data; + private String next_openid; + private Integer errcode; + private String errmsg; + + public OfficialAccountUserRet() { + } + + public OfficialAccountUserRet(Integer total, Integer count, OfficialAccountUserRet.data data, String next_openid, Integer errcode, String errmsg) { + this.total = total; + this.count = count; + this.data = data; + this.next_openid = next_openid; + this.errcode = errcode; + this.errmsg = errmsg; + } + + public Integer getTotal() { + return total; + } + + public void setTotal(Integer total) { + this.total = total; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } + + public OfficialAccountUserRet.data getData() { + return data; + } + + public void setData(OfficialAccountUserRet.data data) { + this.data = data; + } + + public String getNext_openid() { + return next_openid; + } + + public void setNext_openid(String next_openid) { + this.next_openid = next_openid; + } + + public Integer getErrcode() { + return errcode; + } + + public void setErrcode(Integer errcode) { + this.errcode = errcode; + } + + public String getErrmsg() { + return errmsg; + } + + public void setErrmsg(String errmsg) { + this.errmsg = errmsg; + } + + public List getOpenidList() { + return getData().getOpenid(); + } + + class data { + private List openid; + + public data() { + } + + public data(List openid) { + this.openid = openid; + } + + public List getOpenid() { + return openid; + } + + public void setOpenid(List openid) { + this.openid = openid; + } + } + +} diff --git a/flossom-modules/flossom-job/src/main/java/com/flossom/job/task/NursingPlanTask.java b/flossom-modules/flossom-job/src/main/java/com/flossom/job/task/NursingPlanTask.java index 2b3cbdc..ce2b9a1 100644 --- a/flossom-modules/flossom-job/src/main/java/com/flossom/job/task/NursingPlanTask.java +++ b/flossom-modules/flossom-job/src/main/java/com/flossom/job/task/NursingPlanTask.java @@ -1,6 +1,7 @@ package com.flossom.job.task; import com.alibaba.fastjson.JSONObject; +import com.flossom.common.core.constant.CacheConstants; import com.flossom.common.core.constant.IntegralChangTextConstants; import com.flossom.common.core.domain.entity.*; import com.flossom.common.core.domain.ret.WxNursingPlanCycleDetailRet; @@ -11,11 +12,14 @@ import com.flossom.common.core.mapper.*; import com.flossom.common.core.utils.DateUtils; import com.flossom.common.core.utils.StringUtils; import com.flossom.common.core.utils.uuid.IdUtils; +import com.flossom.common.redis.service.RedisService; import com.flossom.common.security.utils.SecurityUtils; import com.flossom.common.security.utils.shuyun.ShuYunApiUtils; import com.flossom.common.security.utils.shuyun.ShuYunConfig; import com.flossom.job.component.TagComponent; import com.flossom.job.util.MiniProgramUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -24,15 +28,14 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAdjusters; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; @Component("NursingPlanTask") public class NursingPlanTask { - + protected final Logger logger = LoggerFactory.getLogger(this.getClass()); + @Autowired + private RedisService redisService; @Autowired private WxUserMemberMapper wxUserMemberMapper; @Autowired @@ -57,6 +60,8 @@ public class NursingPlanTask { private ShuYunConfig shuYunConfig; @Autowired private WxNursingPlanCycleMapper wxNursingPlanCycleMapper; + @Autowired + private WxUserIntegralLogMapper wxUserIntegralLogMapper; /** * 每天凌晨处理昨日未完成的护理计划进度,并且替换生成新的进度记录 @@ -211,6 +216,16 @@ public class NursingPlanTask { LocalDateTime.now().format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD_HH_MM_SS)), IntegralChangTextConstants.NURSING_ACTIVITY_CLOCK_REWARD_POINTS); ShuYunApiUtils.pointChange(shuYunPointChange); join.setIsSetReward(1); + WxUserIntegralLog wxUserIntegralLog = new WxUserIntegralLog(); + wxUserIntegralLog.setUserId(join.getUserId()); + wxUserIntegralLog.setUserName(wxUserMember.getNickname()); + wxUserIntegralLog.setUserPhone(wxUserMember.getMobile()); + wxUserIntegralLog.setSource("1"); + wxUserIntegralLog.setFloatScore(Long.valueOf(plan.getRewardPoints())); + wxUserIntegralLog.setCreateTime(DateUtils.getNowDate()); + wxUserIntegralLog.setCreateBy(SecurityUtils.getUsername()); + wxUserIntegralLog.setRemarkContent(IntegralChangTextConstants.NURSING_ACTIVITY_CLOCK_REWARD_POINTS); + wxUserIntegralLogMapper.insertWxUserIntegralLog(wxUserIntegralLog); } } } @@ -344,12 +359,15 @@ public class NursingPlanTask { * 定时发送今日未完成任务的消息 */ public void sendNursingPlanWarnMessage() { + logger.info("---------定时发送今日未完成任务消息任务开始-------------"); //查询出开启定时推送的用户 + Map wxUserMap = redisService.getCacheMap(CacheConstants.WX_UNIONID_OPENID_KEY); + logger.info("---------定时发送今日未完成任务消息任务,获得"+wxUserMap.size()+"条微信数据-------------"); LocalDateTime now = LocalDateTime.now(); LocalDateTime nowTime = LocalDate.now().atTime(0, 0); - LocalDateTime warnTime = LocalDate.now().atTime(now.getHour(), now.getMinute()); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:00"); - List progressList = wxNursingPlanJoinProgressMapper.selectNursingPlanWarnList(nowTime, 0, 1, 0, warnTime); + LocalDateTime warnTime = LocalDateTime.of(now.getYear(),now.getMonth(),now.getDayOfMonth(),now.getHour(),now.getMinute(),0); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm"); + List progressList = wxNursingPlanJoinProgressMapper.selectNursingPlanWarnList(nowTime, 0, 1, 0, warnTime,1); progressList.forEach(item -> { //查询今日需要执行的包括仪器的任务 WxNursingPlanJoinProgressDetail queryDetail = new WxNursingPlanJoinProgressDetail(); @@ -360,12 +378,17 @@ public class NursingPlanTask { WxNursingPlanJoinProgressDetail detail = details.get(0); WxUserMember wxUserMember = wxUserMemberMapper.selectWxUserMemberById(detail.getUserId()); try { - MiniProgramUtils.sendPlanWarnMessage(wxUserMember.getOpenid(), detail.getModeName(), "1次", warnTime.format(formatter)); + //根据unionid获取公众号的openid + String openid = wxUserMap.get(wxUserMember.getUnionid()); + if(StringUtils.isNotEmpty(openid)){ + MiniProgramUtils.sendPlanWarnMessage(openid, detail.getModeName(), "1", warnTime.format(formatter)); + } } catch (Exception e) { throw new RuntimeException(e); } } }); + logger.info("---------定时发送今日未完成任务消息任务结束-------------"); } /** diff --git a/flossom-modules/flossom-job/src/main/java/com/flossom/job/task/WxUserTask.java b/flossom-modules/flossom-job/src/main/java/com/flossom/job/task/WxUserTask.java new file mode 100644 index 0000000..d903c21 --- /dev/null +++ b/flossom-modules/flossom-job/src/main/java/com/flossom/job/task/WxUserTask.java @@ -0,0 +1,99 @@ +package com.flossom.job.task; + +import com.flossom.common.core.constant.CacheConstants; +import com.flossom.common.core.utils.StringUtils; +import com.flossom.common.redis.service.RedisService; +import com.flossom.job.domain.OfficialAccountUserDetailRet; +import com.flossom.job.domain.OfficialAccountUserReq; +import com.flossom.job.domain.OfficialAccountUserRet; +import com.flossom.job.util.MiniProgramUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 微信服务的定时任务 + */ +@Component("WxUserTask") +public class WxUserTask { + + protected final Logger logger = LoggerFactory.getLogger(this.getClass()); + @Autowired + private RedisService redisService; + + /** + * 定时轮询小程序关注公众号的信息 + * + * @throws Exception + */ + public void cacheWxUserMap() throws Exception { + logger.info("--------定时轮询小程序关注公众号的任务开始-----------"); + //第一步获取公众号关注用户的openid列表,一直遍历直到获取完毕为止 + String nextOpenid = null; + Integer currentTotal = 0; + int total = 0; + //第一次获取首批关注的用户openid + OfficialAccountUserRet officialAccountUserRet = MiniProgramUtils.obtainWxOfficialAccountUser(null); + if (officialAccountUserRet.getCount() == null || officialAccountUserRet.getCount() == 0) { + logger.info("--------定时轮询小程序关注公众号的任务终止-----------"); + return; + } + currentTotal += officialAccountUserRet.getCount();//当前的累计获取的总数 + nextOpenid = officialAccountUserRet.getNext_openid();//下一次获取的起始位置 + total = officialAccountUserRet.getTotal();//总条数 + List openidList = officialAccountUserRet.getOpenidList();//初始化总openid列表集合 + //遍历获取全部关注用户列表 + while (currentTotal < total) { + officialAccountUserRet = MiniProgramUtils.obtainWxOfficialAccountUser(nextOpenid); + if (officialAccountUserRet.getCount() == null || officialAccountUserRet.getCount() == 0) { + break; + } + currentTotal += officialAccountUserRet.getCount();//当前的累计获取的总数 + nextOpenid = officialAccountUserRet.getNext_openid();//下一次获取的起始位置 + openidList.addAll(officialAccountUserRet.getOpenidList()); + } + + //第二步,对openid分页查询相关的unionid + List userInfoList = new ArrayList<>(); + int pageSize = 100; + int page = total % pageSize == 0 ? total / pageSize : total / pageSize + 1; + for (int pageNo = 1; pageNo <= page; pageNo++) { + List pageList = openidList.stream().skip((long) (pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); + if(pageList.isEmpty()){ + break; + } + // 获取 unionid 集合 + List officialAccountUserReqList = new ArrayList<>(); + for (String openid : pageList) { + OfficialAccountUserReq officialAccountUserReq = new OfficialAccountUserReq(openid); + officialAccountUserReqList.add(officialAccountUserReq); + } + OfficialAccountUserDetailRet officialAccountUserDetailRet = MiniProgramUtils.ObtainUserInfoByOpenid(officialAccountUserReqList); + userInfoList.addAll(officialAccountUserDetailRet.getUser_info_list()); + } + + //第三步,将微信公众号的用户相关信息缓存进redis + if (userInfoList.isEmpty()) { + logger.info("--------定时轮询小程序关注公众号的任务终止-----------"); + return; + } + + Map wxUserMap = new HashMap<>(); + userInfoList.forEach(item -> { + //保存已经关注公众号的用户标记 + if (StringUtils.isNotEmpty(item.getUnionid()) && item.getSubscribe() != 0) { + wxUserMap.put(item.getUnionid(), item.getOpenid()); + } + }); + redisService.setCacheMap(CacheConstants.WX_UNIONID_OPENID_KEY, wxUserMap); + logger.info("--------定时轮询小程序关注公众号缓存成功,总共" + wxUserMap.size() + "条数据-----------"); + logger.info("--------定时轮询小程序关注公众号的任务结束-----------"); + } +} diff --git a/flossom-modules/flossom-job/src/main/java/com/flossom/job/util/MiniProgramUtils.java b/flossom-modules/flossom-job/src/main/java/com/flossom/job/util/MiniProgramUtils.java index 19a391e..8cab157 100644 --- a/flossom-modules/flossom-job/src/main/java/com/flossom/job/util/MiniProgramUtils.java +++ b/flossom-modules/flossom-job/src/main/java/com/flossom/job/util/MiniProgramUtils.java @@ -10,15 +10,21 @@ import com.flossom.common.core.utils.HttpClientUtils; import com.flossom.common.core.utils.StringUtils; import com.flossom.common.redis.service.RedisService; import com.flossom.job.config.WxConfig; +import com.flossom.job.domain.OfficialAccountUserDetailRet; +import com.flossom.job.domain.OfficialAccountUserReq; +import com.flossom.job.domain.OfficialAccountUserRet; import com.flossom.job.domain.WxAccessTokenRet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; /** * 小程序工具类 @@ -157,40 +163,104 @@ public class MiniProgramUtils { return HttpClientUtils.postParameters(wxConfig.getObtainPhoneUrl() + "?access_token=" + accessToken, JSON.toJSONString(params)); } + /** + * 获取 关注微信公众号用户的 unionid + * TODO: officialAccountUserReqList 最多支持 100 条 + */ + public static OfficialAccountUserDetailRet ObtainUserInfoByOpenid(List officialAccountUserReqList) throws Exception { + String accessToken = getAccessToken(wxConfig.getOfficialAccountAppid(), wxConfig.getOfficialAccountAppSecret(), CacheConstants.WX_OFFICIAL_ACCOUNT_ACCESS_TOKEN_CACHE); + if (StringUtils.isBlank(accessToken)) { + logger.error("获取关注微信公众号用户的unionid,获取accessToken失败!"); + throw new ServiceException("操作失败"); + } + + Map params = new HashMap(); + params.put("user_list", officialAccountUserReqList); +// String result = HttpClientUtils.postJsonParameters(wxConfig.getObtainUserInfoByOpenidUrl() + "?access_token=" + accessToken, JSON.toJSONString(params)); + String result = HttpClientUtils.postParameters(wxConfig.getObtainUserInfoByOpenidUrl() + "?access_token=" + accessToken, JSON.toJSONString(params)); + logger.info("请求微信服务器获获取 关注微信公众号用户的 unionid列表:{}", result); + OfficialAccountUserDetailRet officialAccountUserDetailRet = JSON.parseObject(result, OfficialAccountUserDetailRet.class); + if (officialAccountUserDetailRet.getErrcode() != null) { + logger.error("获取 关注微信公众号的用户列表 失败: {}", officialAccountUserDetailRet.getErrmsg()); + throw new ServiceException("操作失败"); + } + return officialAccountUserDetailRet; + } + + /** + * 分页 获取关注微信公众号的用户列表 + * TODO: 一次拉取调用最多拉取10000个关注者的OpenID + * + * @param nextOpenid 下一个用户openid + * @return + * @throws Exception + */ + public static OfficialAccountUserRet obtainWxOfficialAccountUser(String nextOpenid) throws Exception { + String accessToken = getAccessToken(wxConfig.getOfficialAccountAppid(), wxConfig.getOfficialAccountAppSecret(), CacheConstants.WX_OFFICIAL_ACCOUNT_ACCESS_TOKEN_CACHE); + if (StringUtils.isBlank(accessToken)) { + logger.error("获取关注微信公众号用户列表失败,获取accessToken失败!"); + throw new ServiceException("操作失败"); + } + + Map params = new HashMap(); + params.put("access_token", accessToken); + if (StringUtils.isNotBlank(nextOpenid)) { + params.put("next_openid", nextOpenid); + } + String result = HttpClientUtils.getParameters(wxConfig.getObtainWxOfficialAccountUserUrl(), params); + logger.info("请求微信服务器获取关注微信公众号的用户列表:{}", result); + OfficialAccountUserRet officialAccountUserRet = JSON.parseObject(result, OfficialAccountUserRet.class); + if (officialAccountUserRet.getErrcode() != null) { + logger.error("获取 关注微信公众号的用户列表 失败: {}", officialAccountUserRet.getErrmsg()); + throw new ServiceException("操作失败"); + } + return officialAccountUserRet; + } + /** * 发送护理计划的提醒消息 - * @param openid 用户openid + * + * @param openid 用户openid * @param keyword1 护理类型 * @param keyword2 护理次数 * @param keyword3 有效期 格式:yyyy-MM-dd HH:mm:ss * @return * @throws Exception */ - public static boolean sendPlanWarnMessage(String openid,String keyword1,String keyword2,String keyword3) throws Exception { + public static boolean sendPlanWarnMessage(String openid, String keyword1, String keyword2, String keyword3) throws Exception { String accessToken = getAccessToken(wxConfig.getOfficialAccountAppid(), wxConfig.getOfficialAccountAppSecret(), CacheConstants.WX_OFFICIAL_ACCOUNT_ACCESS_TOKEN_CACHE); if (StringUtils.isBlank(accessToken)) { logger.error("发现微信公众号的模版消息失败,获取accessToken失败!"); throw new ServiceException("操作失败"); } JSONObject jsonObject = new JSONObject(); - jsonObject.put("touser",openid); - jsonObject.put("template_id",wxConfig.getNursingPlanWarnMessageTemplateId()); + jsonObject.put("touser", openid); + jsonObject.put("template_id", wxConfig.getNursingPlanWarnMessageTemplateId()); //跳转小程序参数 + WxParameterSetting wxParameterSetting = wxParameterSettingMapper.selectWxParameterSettingById(1L); JSONObject miniprogram = new JSONObject(); - miniprogram.put("appid",wxConfig.getOfficialAccountAppid()); + miniprogram.put("appid", wxParameterSetting.getAppid()); // miniprogram.put("pagepath",""); - jsonObject.put("miniprogram",miniprogram); - Map data = new HashMap<>(); - data.put("hrst","美容护理提醒"); - data.put("keyword1",keyword1); - data.put("keyword2",keyword2); - data.put("keyword3",keyword3); - data.put("remark",""); - jsonObject.put("data",data); - String result = HttpClientUtils.postParameters(wxConfig.getObtainWxOfficialAccountUserUrl(), jsonObject.toJSONString()); + jsonObject.put("miniprogram", miniprogram); + Map data = new HashMap<>(); +// data.put("hrst","美容护理提醒"); + JSONObject value = new JSONObject(); + value.put("value",keyword1); + data.put("thing4", value); + value = new JSONObject(); + value.put("value",keyword2); + data.put("character_string5", value); + value = new JSONObject(); + value.put("value",keyword3); + data.put("time2", value); + jsonObject.put("data", data); + logger.info("发送护理计划的提醒消息参数:{}",jsonObject); + String result = HttpClientUtils.postParameters(wxConfig.getMessageTemplateSendUrl() + "?access_token=" + accessToken, jsonObject.toJSONString()); logger.info("发送护理计划的提醒消息:{}", result); JSONObject resultJson = JSONObject.parseObject(result); return resultJson.getLong("errcode") == 0; } + + } diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxNursingPlanController.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxNursingPlanController.java index 7f062f6..5ef0a27 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxNursingPlanController.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxNursingPlanController.java @@ -16,10 +16,9 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import java.io.IOException; +import java.time.LocalDate; import java.time.LocalTime; import java.time.format.DateTimeFormatter; -import java.util.HashMap; -import java.util.Map; import java.util.Objects; /** @@ -82,8 +81,9 @@ public class WxNursingPlanController { */ @GetMapping("/getPlanCycleList") public R getPlanCycleList(@RequestParam(value = "planId") Long planId, + @RequestParam(value = "isShare",defaultValue = "0",required = false) Integer isShare, @RequestParam(value = "surveyNumber", required = false) Integer surveyNumber) { - return R.ok(wxNursingPlanService.getPlanCycleList(planId, surveyNumber)); + return R.ok(wxNursingPlanService.getPlanCycleList(planId,isShare, surveyNumber)); } /** @@ -223,11 +223,7 @@ public class WxNursingPlanController { */ @GetMapping("/setReward") public R setReward(@RequestParam("planId") Long planId, @RequestParam("planJoinId") Long planJoinId) { - int code = wxNursingPlanService.setReward(planId, planId); - if (code > 0) { - return R.ok(); - } - return R.fail(); + return wxNursingPlanService.setReward(planId, planJoinId); } /** @@ -368,6 +364,17 @@ public class WxNursingPlanController { return R.ok(); } + /** + * 查询用户指定月份的护理任务列表 + * @param dateStr + * @return + */ + @GetMapping("/listCalendar") + public R listCalendar(@RequestParam("date") String dateStr){ + LocalDate date = LocalDate.parse(dateStr+"-01",DateTimeFormatter.ofPattern("yyyy-MM-dd")); + return R.ok(wxNursingPlanService.listCalendar(date)); + } + @GetMapping("/test") public R testUpdate(Long userId, Long logId, Long instrumentId, Long modelId) { wxNursingPlanService.updateProgressStatus(userId, logId, instrumentId, modelId); diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/domain/vo/LoginUserVo.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/domain/vo/LoginUserVo.java index 91c7b9a..682519b 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/domain/vo/LoginUserVo.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/domain/vo/LoginUserVo.java @@ -91,6 +91,16 @@ public class LoginUserVo { @Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd") private Date birthday; + /** + * 打卡:1可以2不可以 + */ + private Integer clock; + + /** + * 活动:1可以2不可以 + */ + private Integer activity; + private String token; /** @@ -117,7 +127,7 @@ public class LoginUserVo { public LoginUserVo() { } - public LoginUserVo(Long id, String nickname, String headimg, String username, Integer credit, Integer expireCredit, String mobile, Long provinceId, String province, Long cityId, String city, Long areaId, String area, Date birthday, String token, String integralText) { + public LoginUserVo(Long id, String nickname, String headimg, String username, Integer credit, Integer expireCredit, String mobile, Long provinceId, String province, Long cityId, String city, Long areaId, String area, Date birthday, String token, String integralText,Integer clock,Integer activity) { this.id = id; this.nickname = nickname; this.headimg = headimg; @@ -134,6 +144,8 @@ public class LoginUserVo { this.birthday = birthday; this.token = token; this.integralText = integralText; + this.activity = activity; + this.clock = clock; } public Long getId() { @@ -287,4 +299,20 @@ public class LoginUserVo { public void setCompleteInformationIntegral(Integer completeInformationIntegral) { this.completeInformationIntegral = completeInformationIntegral; } + + public void setClock(Integer clock) { + this.clock = clock; + } + + public void setActivity(Integer activity) { + this.activity = activity; + } + + public Integer getActivity(){ + return activity; + } + + public Integer getClock(){ + return clock; + } } diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxNursingPlanService.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxNursingPlanService.java index 03392a7..57c782e 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxNursingPlanService.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxNursingPlanService.java @@ -1,14 +1,17 @@ package com.flossom.miniProgram.service; import com.alibaba.fastjson.JSONObject; +import com.flossom.common.core.domain.R; import com.flossom.common.core.domain.entity.WxNursingPlan; import com.flossom.common.core.domain.entity.WxNursingPlanCycleDetailStep; import com.flossom.common.core.domain.entity.WxNursingPlanJoin; +import com.flossom.common.core.domain.ret.WxNursingPlanUserJoinDayRet; import com.flossom.miniProgram.domain.vo.WxNursingPlanCalendarVo; import com.flossom.miniProgram.domain.vo.WxNursingPlanCycleEndReportVo; import com.flossom.miniProgram.domain.vo.WxNursingPlanNextCycleVo; import com.flossom.common.core.domain.vo.WxNursingPlanUserProgressVo; +import java.time.LocalDate; import java.time.LocalTime; import java.util.List; @@ -24,7 +27,7 @@ public interface IWxNursingPlanService { List getBindInstrumentListByPlanId(Long planId,Long cycleId); - JSONObject getPlanCycleList(Long planId, Integer surveyNumber); + JSONObject getPlanCycleList(Long planId,Integer isShare, Integer surveyNumber); JSONObject getPlayDetail(Long planId); @@ -48,7 +51,7 @@ public interface IWxNursingPlanService { WxNursingPlanNextCycleVo checkCycleEnd(Long planId); - int setReward(Long planId,Long planJoinId); + R setReward(Long planId, Long planJoinId); int setRewardSurvey(Long planJoinId); @@ -59,4 +62,6 @@ public interface IWxNursingPlanService { int setRewardSurveyJson(Long planId,Long userId,String json); int setSurveyJson(Long planId,Long userId,String json); + + List listCalendar(LocalDate date); } diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxNursingLogServiceImpl.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxNursingLogServiceImpl.java index 98e025f..97d9e92 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxNursingLogServiceImpl.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxNursingLogServiceImpl.java @@ -21,6 +21,7 @@ import com.flossom.common.security.utils.shuyun.ShuYunApiUtils; import com.flossom.common.security.utils.shuyun.ShuYunConfig; import com.flossom.miniProgram.service.IWxNursingLogService; import com.flossom.miniProgram.service.IWxNursingPlanService; +import io.swagger.models.auth.In; import org.apache.commons.lang3.time.DateFormatUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -72,6 +73,7 @@ public class WxNursingLogServiceImpl implements IWxNursingLogService { // 排序:最新的护理记录在最上方;图片由后台模式管理-模式封面图片进行配置; WxNursingLog queryNursingLog = new WxNursingLog(); queryNursingLog.setInstrumentId(instrumentId); + queryNursingLog.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId()); 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)); @@ -610,10 +612,10 @@ public class WxNursingLogServiceImpl implements IWxNursingLogService { String modeType = wxMode.getModeType(); // 判断当前模式是否设置了能量图谱 int maxEnergySize = 0;// 能量图谱最大值 - Boolean isEnergyAtlas = false;//是否设置了最大值 + boolean isEnergyAtlas = false;//是否设置了最大值 List fr200EnergyAtlas = DictUtils.getDictCache("fr200_energy_atlas"); for (SysDictData energyAtlas : fr200EnergyAtlas) { - if (StringUtils.equals(modeType, energyAtlas.getDictType())) { + if (StringUtils.equals(modeType, energyAtlas.getDictLabel())) { maxEnergySize = Integer.valueOf(energyAtlas.getDictValue()); isEnergyAtlas = true; } @@ -633,36 +635,46 @@ public class WxNursingLogServiceImpl implements IWxNursingLogService { } } } else { + //新数据 String newNursingData = wxNursingLogReq.getNursingData(); JSONObject newJsonObject = JSON.parseObject(newNursingData); - String newGearData = newJsonObject.get("groupedAa").toString(); + List newGearDataList = JSON.parseArray(newJsonObject.getString("groupedAa"),Integer.class); + List newJoulePerSecondList = JSON.parseArray(newJsonObject.getString("joulePerSecond"),Integer.class); + List newImpedanceList = JSON.parseArray(newJsonObject.getString("impedanceList"),Integer.class); + + //旧数据 JSONObject oldNursingDataJsonObject = JSON.parseObject(oldNursingData); - String oldGearData = oldNursingDataJsonObject.get("groupedAa").toString(); - if (StringUtils.isBlank(newGearData)) { - if (StringUtils.isBlank(oldGearData)) { - // 1、两个都是空的,直接保存最新的 - updateNursingLog.setNursingData(wxNursingLog.getNursingData()); - } else { - // 2、新的是空的,旧的不是空的,将旧的补充过来 - JSONArray oldGearDataJsonArray = JSON.parseArray(oldGearData); - newJsonObject.put("groupedAa", oldGearDataJsonArray.subList(0, Math.min(maxEnergySize, oldGearDataJsonArray.size()))); - updateNursingLog.setNursingData(newJsonObject.toJSONString()); - } - } else { - if (StringUtils.isBlank(oldGearData)) { - // 4、新的不是空的,旧的是空的,直接保存新的(判断新的是否符合规定) - JSONArray newGearDataJsonArray = JSON.parseArray(newGearData); - newJsonObject.put("groupedAa", newGearDataJsonArray.subList(0, Math.min(maxEnergySize, newGearDataJsonArray.size()))); - updateNursingLog.setNursingData(newJsonObject.toJSONString()); - } else { - // 3、新的不是空的,旧的不是空的,将旧的补充过来 - JSONArray newGearDataJsonArray = JSON.parseArray(newGearData); - JSONArray oldGearDataJsonArray = JSON.parseArray(oldGearData); - oldGearDataJsonArray.addAll(newGearDataJsonArray.subList(0, Math.min(maxEnergySize - oldGearDataJsonArray.size(), newGearDataJsonArray.size()))); - newJsonObject.put("groupedAa", oldGearDataJsonArray); - updateNursingLog.setNursingData(newJsonObject.toJSONString()); - } + List oldGearDataList = JSON.parseArray(oldNursingDataJsonObject.getString("groupedAa"),Integer.class); + List oldJoulePerSecondList = new ArrayList<>(); + if(oldNursingDataJsonObject.containsKey("joulePerSecond")){ + oldJoulePerSecondList = JSON.parseArray(oldNursingDataJsonObject.getString("joulePerSecond"),Integer.class); + } + List oldImpedanceList = new ArrayList<>(); + if(oldNursingDataJsonObject.containsKey("impedanceList")){ + oldImpedanceList = JSON.parseArray(oldNursingDataJsonObject.getString("impedanceList"),Integer.class); + } + + //计算 + oldGearDataList.addAll(newGearDataList); + oldJoulePerSecondList.addAll(newJoulePerSecondList); + oldImpedanceList.addAll(newImpedanceList); + //判断是否超出长度 + if(oldGearDataList.size()>maxEnergySize){ + int startIndex = oldGearDataList.size()- maxEnergySize; + oldGearDataList = oldGearDataList.stream().skip(startIndex).collect(Collectors.toList()); + } + if(oldJoulePerSecondList.size()>maxEnergySize){ + int startIndex = oldJoulePerSecondList.size()-maxEnergySize; + oldJoulePerSecondList = oldJoulePerSecondList.stream().skip(startIndex).collect(Collectors.toList()); + } + if(oldImpedanceList.size()>maxEnergySize){ + int startIndex = oldImpedanceList.size()-maxEnergySize; + oldImpedanceList = oldImpedanceList.stream().skip(startIndex).collect(Collectors.toList()); } + newJsonObject.put("groupedAa",oldGearDataList); + newJsonObject.put("joulePerSecond",oldJoulePerSecondList); + newJsonObject.put("impedanceList",oldImpedanceList); + updateNursingLog.setNursingData(newJsonObject.toJSONString()); } } else { // 其他模式取最新的 diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxNursingPlanService.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxNursingPlanService.java index fb4b831..f3c722c 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxNursingPlanService.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxNursingPlanService.java @@ -2,11 +2,15 @@ package com.flossom.miniProgram.service.impl; import com.alibaba.fastjson.JSONObject; import com.flossom.common.core.constant.IntegralChangTextConstants; +import com.flossom.common.core.domain.R; import com.flossom.common.core.domain.entity.*; import com.flossom.common.core.domain.req.WxNursingPlanReq; import com.flossom.common.core.domain.ret.WxNursingPlanCycleDetailRet; import com.flossom.common.core.domain.ret.WxNursingPlanJoinRet; +import com.flossom.common.core.domain.ret.WxNursingPlanUserJoinDayRet; +import com.flossom.common.core.domain.ret.WxNursingPlanUserJoinRet; import com.flossom.common.core.domain.shuyun.ShuYunPointChange; +import com.flossom.common.core.domain.vo.WxNursingPlanUserProgressVo; import com.flossom.common.core.enums.*; import com.flossom.common.core.exception.ServiceException; import com.flossom.common.core.mapper.*; @@ -14,6 +18,7 @@ import com.flossom.common.core.utils.DateUtils; import com.flossom.common.core.utils.StringUtils; import com.flossom.common.core.utils.bean.BeanUtils; import com.flossom.common.core.utils.uuid.IdUtils; +import com.flossom.common.security.utils.DictUtils; import com.flossom.common.security.utils.SecurityUtils; import com.flossom.common.security.utils.shuyun.ShuYunApiUtils; import com.flossom.common.security.utils.shuyun.ShuYunConfig; @@ -21,7 +26,6 @@ import com.flossom.miniProgram.component.TagComponent; import com.flossom.miniProgram.domain.vo.WxNursingPlanCalendarVo; import com.flossom.miniProgram.domain.vo.WxNursingPlanCycleEndReportVo; import com.flossom.miniProgram.domain.vo.WxNursingPlanNextCycleVo; -import com.flossom.common.core.domain.vo.WxNursingPlanUserProgressVo; import com.flossom.miniProgram.service.IWxNursingPlanService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -77,6 +81,8 @@ public class WxNursingPlanService implements IWxNursingPlanService { private ShuYunConfig shuYunConfig; @Autowired private TagComponent tagComponent; + @Autowired + private WxUserIntegralLogMapper wxUserIntegralLogMapper; @Override public List listPlan() { @@ -100,30 +106,30 @@ public class WxNursingPlanService implements IWxNursingPlanService { Iterator iterator = planList.iterator(); while (iterator.hasNext()) { WxNursingPlan item = iterator.next(); - //判断是否存在 可参加人群(小程序标签) + // 判断是否存在 可参加人群(小程序标签) if (item.getJoinWechatTagArray() != null && !item.getJoinWechatTagArray().isEmpty()) { boolean flag = false; if (!userWxTags.isEmpty()) { - flag = userWxTags.containsAll(item.getJoinWechatTagArray()); + flag = new HashSet<>(userWxTags).containsAll(item.getJoinWechatTagArray()); } //不符合,删除并跳出此次循环 if (!flag) { logger.info("可参加人群(小程序标签)不符合,删除并跳出此次循环"); iterator.remove(); - break; + continue; } } // 判断是否存在 可参加人群(外部标签) if (item.getJoinCompanyTagArray() != null && !item.getJoinCompanyTagArray().isEmpty()) { boolean flag = false; if (!userCompanyTags.isEmpty()) { - flag = userCompanyTags.containsAll(item.getJoinCompanyTagArray()); + flag = new HashSet<>(userCompanyTags).containsAll(item.getJoinCompanyTagArray()); } //不符合,删除并跳出此次循环 if (!flag) { logger.info("可参加人群(外部标签)不符合,删除并跳出此次循环"); iterator.remove(); - break; + continue; } } // 判断是否存在 不可参加人群(小程序标签) @@ -136,7 +142,7 @@ public class WxNursingPlanService implements IWxNursingPlanService { if (flag) { logger.info("不可参加人群(小程序标签)符合,删除并跳出此次循环"); iterator.remove(); - break; + continue; } } // 判断是否存在 不可参加人群(外部标签) @@ -149,34 +155,37 @@ public class WxNursingPlanService implements IWxNursingPlanService { if (flag) { logger.info("不可参加人群(外部标签)符合,删除并跳出此次循环"); iterator.remove(); - break; + continue; } } - //判断用户绑定的仪器和计划要求的仪器是否匹配 + // 判断用户绑定的仪器和计划要求的仪器是否匹配 if (item.getInstrumentIds() != null) { boolean flag = false; - if (!userInstrumentList.isEmpty() && userInstrumentList.containsAll(item.getInstrumentIds())) { + if (!userInstrumentList.isEmpty() && !userInstrumentList.isEmpty()&& new HashSet<>(userInstrumentList).containsAll(item.getInstrumentIds())) { flag = true; } //不符合,删除并跳出此次循环 - if (flag) { + if (!flag) { logger.info("用户绑定的仪器和计划需要的仪器无法匹配,删除并跳出此次循环"); iterator.remove(); - break; + continue; } } + // 判断用户是否符合参加时间要求 + /* boolean isJoin = this.checkJoinPlanTime(item,userId); + if(!isJoin){ + iterator.remove(); + continue; + }*/ } //查询用户正在进行中的护理计划 - List joinStatusList = new ArrayList<>(); - joinStatusList.add(1); - joinStatusList.add(2); queryWxNursingPlan = new WxNursingPlanReq(); - queryWxNursingPlan.setJoinStatusList(joinStatusList); + queryWxNursingPlan.setJoinStatusList(Arrays.asList(1, 2)); queryWxNursingPlan.setUserId(userId); - List joinPlanList = this.getPlanListByCond(queryWxNursingPlan); - if (!joinPlanList.isEmpty()) { - WxNursingPlan plan = joinPlanList.get(0);//用户每次只能参与一个护理计划 + List nursingPlanList = this.getPlanListByCond(queryWxNursingPlan); + if (!nursingPlanList.isEmpty()) { + WxNursingPlan plan = nursingPlanList.get(0); iterator = planList.iterator(); while (iterator.hasNext()) { WxNursingPlan item = iterator.next(); @@ -202,7 +211,14 @@ public class WxNursingPlanService implements IWxNursingPlanService { List planList = wxNursingPlanMapper.findWxNursingPlanList(queryWxNursingPlan); planList.forEach(item -> { //计算周期时长,计算公式:活动的总天数*日程循环次数 - item.setCycleTime(DateUtils.timeDistanceDay(item.getActiveEndTime(), item.getActiveStartTime()) * item.getCycleNumber()); + List days = wxNursingPlanCycleMapper.findDayNumList(item.getId()); + if (days.isEmpty()) { + item.setCycleTime(0); + } else { + //计算周期时长,计算公式:日程最大的总天数*日程循环次数 + int day = days.stream().max(Comparator.comparingInt(_item -> _item)).get(); + item.setCycleTime((long) day * item.getCycleNumber()); + } if (StringUtils.isNotEmpty(item.getJoinCompanyTagArrayStr())) { String[] array = item.getJoinCompanyTagArrayStr().split(","); item.setJoinCompanyTagArray(Arrays.stream(array).map(Long::parseLong).collect(Collectors.toList())); @@ -228,7 +244,6 @@ public class WxNursingPlanService implements IWxNursingPlanService { item.setInstrumentIds(ids); int joinNumber = wxNursingPlanJoinMapper.getUserCountByPlanId(item.getId()); item.setJoinNumber(joinNumber); -// item.setActiveDetail(StringUtils.decodeURIComponent(item.getActiveDetail()));//针对富文本内容进行解密 }); return planList; } @@ -239,28 +254,43 @@ public class WxNursingPlanService implements IWxNursingPlanService { } @Override - public JSONObject getPlanCycleList(Long planId, Integer surveyNumber) { + public JSONObject getPlanCycleList(Long planId,Integer isShare, Integer surveyNumber) { JSONObject object = new JSONObject(); //查询指定的护理计划 WxNursingPlan plan = wxNursingPlanMapper.selectWxNursingPlanById(planId); - if (plan == null || !plan.getStatus().equals(1)) { - throw new ServiceException("暂时不能参加该护理计划"); + if (plan == null) { + object.put("isJoin", false); + object.put("message","暂时不能参加该护理计划"); + return object; + } + if(isShare == 0 && !plan.getStatus().equals(1)){ + object.put("isJoin", false); + object.put("message","暂时不能参加该护理计划"); + return object; + } else if (isShare == 1 && plan.getStatus()>1) { + object.put("isJoin", false); + object.put("message","暂时不能参加该护理计划"); + return object; } //查询用户是否加入过别的护理计划 List joinPlanIds = wxNursingPlanJoinMapper.listJoinPlanIds(SecurityUtils.getLoginUser().getWxUserMember().getId(), new Integer[]{1, 2}); if (!joinPlanIds.isEmpty()) { object.put("isJoin", false); + object.put("message","不能同时参加两个护理计划"); return object; } if (!this.checkJoinPlan(plan)) { - throw new ServiceException("超过参加次数,无法参加"); + object.put("isJoin", false); + object.put("message","不符合参加条件,无法参加"); + return object; } //查询用户可以加入的日程列表 List cycleList = wxNursingPlanCycleMapper.findPlanCycleList(planId, plan.getIsSurvey(), surveyNumber); if (cycleList.isEmpty()) { object.put("isJoin", false); + object.put("message","没有符合条件的日程"); return object; } object.put("isJoin", true); @@ -275,9 +305,94 @@ public class WxNursingPlanService implements IWxNursingPlanService { * @return */ private boolean checkJoinPlan(WxNursingPlan plan) { + Long userId = SecurityUtils.getLoginUser().getWxUserMember().getId(); + //判断是否符合参加条件限制 + List planTagList = wxNursingPlanTagMapper.listTagByPlanId(plan.getId()); + if(!planTagList.isEmpty()){ + //护理计划有标签限制 + WxUserTag queryTag = new WxUserTag(); + queryTag.setUserId(userId); + List tags = wxUserTagMapper.selectWxUserTagList(queryTag); + List userWxTags = tags.stream().filter(item -> item.getType() == 1).map(WxUserTag::getTagId).collect(Collectors.toList()); + List userCompanyTags = tags.stream().filter(item -> item.getType() == 2).map(WxUserTag::getTagId).collect(Collectors.toList()); + + // 判断是否存在 可参加人群(小程序标签) + List joinWechatTags = planTagList.stream().filter(item->item.getTagType()==1).map(WxNursingPlanTag::getTagId).collect(Collectors.toList()); + if(!joinWechatTags.isEmpty()){ + boolean flag = false; + if (!userWxTags.isEmpty()) { + flag = new HashSet<>(userWxTags).containsAll(joinWechatTags); + } + if(!flag){ + logger.info("可参加人群(小程序标签)不符合"); + return false; + } + } + + // 判断是否存在 可参加人群(外部标签) + List joinCompanyTags = planTagList.stream().filter(item->item.getTagType()==2).map(WxNursingPlanTag::getTagId).collect(Collectors.toList()); + if(!joinCompanyTags.isEmpty()){ + boolean flag = false; + if (!userCompanyTags.isEmpty()) { + flag = new HashSet<>(userCompanyTags).containsAll(joinCompanyTags); + } + if(!flag){ + logger.info("可参加人群(外部标签)不符合"); + return false; + } + } + + // 判断是否存在 不可参加人群(小程序标签) + List unJoinWechatTags = planTagList.stream().filter(item->item.getTagType()==3).map(WxNursingPlanTag::getTagId).collect(Collectors.toList()); + if(!unJoinWechatTags.isEmpty()){ + boolean flag = false; + if (!userWxTags.isEmpty()) { + flag = unJoinWechatTags.stream().anyMatch(userWxTags::contains); + } + //符合,删除并跳出此次循环 + if (flag) { + logger.info("不可参加人群(小程序标签)符合"); + return false; + } + } + + // 判断是否存在 不可参加人群(外部标签) + List unJoinCompanyTags = planTagList.stream().filter(item->item.getTagType()==4).map(WxNursingPlanTag::getTagId).collect(Collectors.toList()); + if(!unJoinCompanyTags.isEmpty()){ + boolean flag = false; + if (!userCompanyTags.isEmpty()) { + flag = unJoinCompanyTags.stream().anyMatch(userCompanyTags::contains); + } + //符合,删除并跳出此次循环 + if (flag) { + logger.info("不可参加人群(小程序标签)符合"); + return false; + } + } + } + + List planInstrumentIds = wxNursingPlanInstrumentMapper.getWxNursingPlanInstrumentIdsByPlanId(plan.getId()); + if(!planInstrumentIds.isEmpty()){ + //护理计划有仪器限制 + List userInstrumentList = wxUserInstrumentMapper.selectInstrumentIdListByUserId(userId);//用户绑定的仪器id + if(!new HashSet<>(userInstrumentList).containsAll(planInstrumentIds)){ + logger.info("仪器要求不符合"); + return false; + } + } + + return this.checkJoinPlanTime(plan,userId); + } + + /** + * 检查用户是否符合参加护理计划的时间限制 + * @param plan + * @return + */ + private boolean checkJoinPlanTime(WxNursingPlan plan,Long userId){ //查询历史加入记录 WxNursingPlanJoin queryJoin = new WxNursingPlanJoin(); - queryJoin.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId()); + queryJoin.setUserId(userId); queryJoin.setPlanId(plan.getId()); List joinList = wxNursingPlanJoinMapper.selectWxNursingPlanJoinList(queryJoin); if (joinList.isEmpty()) { @@ -337,8 +452,10 @@ public class WxNursingPlanService implements IWxNursingPlanService { List joinList = wxNursingPlanJoinMapper.selectWxNursingPlanJoinList(queryJoin); if (!joinList.isEmpty()) { WxNursingPlanJoin join = joinList.get(joinList.size() - 1); - plan.setJoinStatus(join.getStatus()); - } else { + if(join.getStatus()<=2) plan.setJoinStatus(join.getStatus()); + } + + if(plan.getJoinStatus() == 0){ //判断是否参加过别的计划 List joinPlanIds = wxNursingPlanJoinMapper.listJoinPlanIds(SecurityUtils.getLoginUser().getWxUserMember().getId(), new Integer[]{1, 2}); if (!joinPlanIds.isEmpty()) { @@ -452,7 +569,7 @@ public class WxNursingPlanService implements IWxNursingPlanService { @Override public void browseSetWechatTag(Long planId) { Long userId = SecurityUtils.getLoginUser().getWxUserMember().getId(); - List wxTagIds = wxNursingPlanTagMapper.listTagIdsByPlanId(planId, 6); + List wxTagIds = wxNursingPlanTagMapper.listTagIdsByPlanId(planId, 5); if (!wxTagIds.isEmpty()) { tagComponent.batchAddTag(wxTagIds, userId, TagTypeStatusEnum.MINI_PROGRAM.getCode()); } @@ -469,15 +586,15 @@ public class WxNursingPlanService implements IWxNursingPlanService { } //查询今日是否有护理记录 - LocalDateTime nowStartTime = LocalDateTime.of(LocalDate.now(),LocalTime.MIN); - LocalDateTime nowEndTime = LocalDateTime.of(LocalDate.now(),LocalTime.MAX); - List nowProgressList = wxNursingPlanJoinProgressMapper.selectNowProgressList(planJoinId,nowStartTime,nowEndTime); + LocalDateTime nowStartTime = LocalDateTime.of(LocalDate.now(), LocalTime.MIN); + LocalDateTime nowEndTime = LocalDateTime.of(LocalDate.now(), LocalTime.MAX); + List nowProgressList = wxNursingPlanJoinProgressMapper.selectNowProgressList(planJoinId, nowStartTime, nowEndTime); //进度的开始时间和提醒时间 - LocalDateTime startTime = LocalDateTime.of(LocalDate.now(),LocalTime.MIN); - LocalDateTime warnTime = LocalDate.now().atTime(20,0);//默认晚上8点 - if(!nowProgressList.isEmpty()){ - startTime = LocalDateTime.of(LocalDate.now().plusDays(1),LocalTime.MIN);//设置明天 - warnTime = LocalDate.now().plusDays(1).atTime(20,0);//设置明天晚上8点 + LocalDateTime startTime = LocalDateTime.of(LocalDate.now(), LocalTime.MIN); + LocalDateTime warnTime = LocalDate.now().atTime(20, 0);//默认晚上8点 + if (!nowProgressList.isEmpty()) { + startTime = LocalDateTime.of(LocalDate.now().plusDays(1), LocalTime.MIN);//设置明天 + warnTime = LocalDate.now().plusDays(1).atTime(20, 0);//设置明天晚上8点 } //查询第一天的日程 @@ -535,11 +652,15 @@ public class WxNursingPlanService implements IWxNursingPlanService { public WxNursingPlanUserProgressVo getPlanProgress() { Long userId = SecurityUtils.getLoginUser().getWxUserMember().getId(); //查询展示出首页的数据集合 - List progressVoList = wxNursingPlanJoinMapper.getWxNursingPlanUserProgressVo(new Integer[]{1, 2, 3}, userId); + List progressVoList = wxNursingPlanJoinMapper.getWxNursingPlanUserProgressVo(null, userId); if (progressVoList.isEmpty()) { return null; } + List joinStatusList = Arrays.asList(1, 2, 3, 7); WxNursingPlanUserProgressVo vo = progressVoList.get(0); + if (!joinStatusList.contains(vo.getJoinStatus())) { + return null; + } WxNursingPlan plan = wxNursingPlanMapper.selectWxNursingPlanById(vo.getPlanId()); //查询用户的进度列表 WxNursingPlanJoinProgress queryProgress = new WxNursingPlanJoinProgress(); @@ -558,7 +679,8 @@ public class WxNursingPlanService implements IWxNursingPlanService { } else { vo.setCurrentProgress(Math.toIntExact(count)); } - if (vo.getCurrentProgress() >= plan.getRewardConditions()) { //判断是否具备领奖资格 + //判断是否具备领奖资格 + if (this.checkRewardRestrict(plan)) { vo.setIsQualifyFor(1); } } @@ -566,29 +688,30 @@ public class WxNursingPlanService implements IWxNursingPlanService { //设置计划安排的时间 long totalDay = DateUtils.timeDistanceDay(plan.getActiveEndTime(), plan.getActiveStartTime()); vo.setTotalDay((int) totalDay); - long currentDay = DateUtils.timeDistanceDay(new Date(), plan.getActiveStartTime()); - vo.setCurrentDay((int) currentDay); + long currentDay = DateUtils.timeDistanceDay(new Date(), vo.getJoinTime()); + vo.setCurrentDay((int) (currentDay+1)); //当前用户是需要显示进行中的计划安排 WxNursingPlanJoinProgress progress = null; - if(vo.getJoinStatus() == 1){ + if (vo.getJoinStatus() == 1) { //查询今日的护理进度 - LocalDateTime nowStartTime = LocalDateTime.of(LocalDate.now(),LocalTime.MIN); - LocalDateTime nowEndTime = LocalDateTime.of(LocalDate.now(),LocalTime.MAX); - if(progressList.size()>1){ - progress = progressList.stream().filter(item->{ - if(item.getStartTime() != null){ - return item.getStartTime().compareTo(nowStartTime)>=0 && item.getStartTime().compareTo(nowEndTime)<=0; + LocalDateTime nowStartTime = LocalDateTime.of(LocalDate.now(), LocalTime.MIN); + LocalDateTime nowEndTime = LocalDateTime.of(LocalDate.now(), LocalTime.MAX); + if (progressList.size() > 1) { + progress = progressList.stream().filter(item -> { + if (item.getStartTime() != null) { + return item.getStartTime().compareTo(nowStartTime) >= 0 && item.getStartTime().compareTo(nowEndTime) <= 0; } return false; }).findFirst().orElse(null); - }else { + } else { progress = progressList.get(0);//只有一条的情况下,不可能通过时间条件判断 } } - if(progress != null){ + if (progress != null) { + vo.setDay(progress.getJoinDay()); vo.setUseIsShow(progress.getUseIsShow()); vo.setCycleId(progress.getCycleId()); vo.setProgressId(progress.getId()); @@ -635,10 +758,10 @@ public class WxNursingPlanService implements IWxNursingPlanService { WxNursingPlanJoinProgressDetail queryDetail = new WxNursingPlanJoinProgressDetail(); queryDetail.setUserId(userId); queryDetail.setInstrumentId(instrumentId); - queryDetail.setModeId(modeId); +// queryDetail.setModeId(modeId); queryDetail.setStatus(0); queryDetail.setStepType(2); - List detailList = wxNursingPlanJoinProgressDetailMapper.selectWxNursingPlanJoinProgressDetailList(queryDetail); + List detailList = wxNursingPlanJoinProgressDetailMapper.listWxNursingPlanJoinProgressDetailCond(queryDetail); if (detailList.isEmpty()) { return; } @@ -649,20 +772,19 @@ public class WxNursingPlanService implements IWxNursingPlanService { if (progress.getStatus() == 1) { return; } - if(progress.getJoinDay() != 1&&progress.getStartTime() !=null){ - LocalDateTime nowStartTime = LocalDateTime.of(LocalDate.now(),LocalTime.MIN); - LocalDateTime nowEndTime = LocalDateTime.of(LocalDate.now(),LocalTime.MAX); - if(progress.getStartTime().isBefore(nowStartTime) || progress.getStartTime().isAfter(nowEndTime)){ + if (progress.getJoinDay() != 1 && progress.getStartTime() != null) { + LocalDateTime nowStartTime = LocalDateTime.of(LocalDate.now(), LocalTime.MIN); + LocalDateTime nowEndTime = LocalDateTime.of(LocalDate.now(), LocalTime.MAX); + if (progress.getStartTime().isBefore(nowStartTime) || progress.getStartTime().isAfter(nowEndTime)) { return;//不是今日的任务,不处理,返回 } } - //设置仪器完成 - detailList.forEach(item -> { - item.setStatus(1); - item.setLogId(logId); - item.setUpdateTime(new Date()); - wxNursingPlanJoinProgressDetailMapper.updateWxNursingPlanJoinProgressDetail(item); - }); + //设置第一个符合条件的仪器完成 + WxNursingPlanJoinProgressDetail oneDetail = detailList.get(0); + oneDetail.setStatus(1); + oneDetail.setLogId(logId); + oneDetail.setUpdateTime(new Date()); + wxNursingPlanJoinProgressDetailMapper.updateWxNursingPlanJoinProgressDetail(oneDetail); progress.setStatus(1); progress.setStartTime(LocalDateTime.now());//更新实际完成时间 @@ -824,6 +946,7 @@ public class WxNursingPlanService implements IWxNursingPlanService { if (progressList.size() >= plan.getRewardConditions()) { //判断是否有资格领取奖励 if (this.checkRewardRestrict(plan)) { + this.setRewardJson(plan,join); //判断奖励当中是否存在积分 String[] rewardType = plan.getRewardType().split(","); boolean isPoints = false;//奖励是否包括积分 @@ -856,6 +979,16 @@ public class WxNursingPlanService implements IWxNursingPlanService { LocalDateTime.now().format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD_HH_MM_SS)), IntegralChangTextConstants.NURSING_ACTIVITY_CLOCK_REWARD_POINTS); ShuYunApiUtils.pointChange(shuYunPointChange); join.setIsSetReward(1); + WxUserIntegralLog wxUserIntegralLog = new WxUserIntegralLog(); + wxUserIntegralLog.setUserId(join.getUserId()); + wxUserIntegralLog.setUserName(wxUserMember.getNickname()); + wxUserIntegralLog.setUserPhone(wxUserMember.getMobile()); + wxUserIntegralLog.setSource("1"); + wxUserIntegralLog.setFloatScore(Long.valueOf(plan.getRewardPoints())); + wxUserIntegralLog.setCreateTime(DateUtils.getNowDate()); + wxUserIntegralLog.setCreateBy(SecurityUtils.getUsername()); + wxUserIntegralLog.setRemarkContent("护理计划奖励积分"); + wxUserIntegralLogMapper.insertWxUserIntegralLog(wxUserIntegralLog); } } } @@ -964,9 +1097,7 @@ public class WxNursingPlanService implements IWxNursingPlanService { vo.setStatus(join.getStatus()); vo.setIsSetReward(join.getIsSetReward()); vo.setIsQualifyFor(0); - if (vo.getIsSetReward() == 1) { - vo.setIsQualifyFor(1);//已经领奖了 - } else if (vo.getIsReward() == 1 && progressList.size() >= vo.getRewardConditions()) { + if (vo.getIsReward() == 1 && vo.getIsSetReward() ==0 && progressList.size() >= vo.getRewardConditions()) { //判断用户是否已经超出了领奖的次数上限 if (this.checkRewardRestrict(plan)) { vo.setIsQualifyFor(1); @@ -1076,26 +1207,25 @@ public class WxNursingPlanService implements IWxNursingPlanService { } @Override - public int setReward(Long planId, Long planJoinId) { + public R setReward(Long planId, Long planJoinId) { WxNursingPlan plan = wxNursingPlanMapper.selectWxNursingPlanById(planId); if (plan == null) { - throw new ServiceException("数据错误"); + return R.fail("系统异常,请联系管理员"); } if (plan.getIsReward() == 0) { - throw new ServiceException("护理计划没有奖励"); + return R.fail("护理计划没有奖励"); } WxNursingPlanJoin join = wxNursingPlanJoinMapper.selectWxNursingPlanJoinById(planJoinId); //检查是否达到领奖标准 //查询完成的护理记录 WxNursingPlanJoinProgress queryProgress = new WxNursingPlanJoinProgress(); - queryProgress.setPlanJoinId(join.getId()); + queryProgress.setPlanJoinId(planJoinId); queryProgress.setStatus(1); List progressList = wxNursingPlanJoinProgressMapper.selectWxNursingPlanJoinProgressList(queryProgress); if (progressList.size() < plan.getRewardConditions()) { - throw new ServiceException("护理时间没有达到领奖要求"); + return R.fail("护理时间没有达到领奖要求"); } - String[] rewardType = plan.getRewardType().split(","); boolean isPoints = false;//奖励是否包括积分 for (String type : rewardType) { @@ -1105,13 +1235,13 @@ public class WxNursingPlanService implements IWxNursingPlanService { } if (plan.getIsExamine() == 1 && join.getStatus() != 3) { - throw new ServiceException("审核不通过"); + return R.fail("审核不通过"); } if (plan.getIsSurvey() == 1 && join.getIsWriteSurvey() == 0) { - throw new ServiceException("请填写奖励登记问卷"); + return R.fail("请填写奖励登记问卷"); } if (join.getIsSetReward() == 1) { - throw new ServiceException("不能重复领取奖励"); + return R.fail("不能重复领取奖励"); } if (!isPoints) { join.setIsPointsReward(0); @@ -1125,10 +1255,46 @@ public class WxNursingPlanService implements IWxNursingPlanService { LocalDateTime.now().format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD_HH_MM_SS)), IntegralChangTextConstants.NURSING_ACTIVITY_CLOCK_REWARD_POINTS); ShuYunApiUtils.pointChange(shuYunPointChange); join.setIsPointsReward(1); + WxUserMember wxUserMember = wxUserMemberMapper.selectWxUserMemberById(join.getUserId()); + WxUserIntegralLog wxUserIntegralLog = new WxUserIntegralLog(); + wxUserIntegralLog.setUserId(join.getUserId()); + wxUserIntegralLog.setUserName(wxUserMember.getNickname()); + wxUserIntegralLog.setUserPhone(wxUserMember.getMobile()); + wxUserIntegralLog.setSource("1"); + wxUserIntegralLog.setFloatScore(Long.valueOf(plan.getRewardPoints())); + wxUserIntegralLog.setCreateTime(DateUtils.getNowDate()); + wxUserIntegralLog.setCreateBy(SecurityUtils.getUsername()); + wxUserIntegralLog.setRemarkContent(IntegralChangTextConstants.NURSING_ACTIVITY_CLOCK_REWARD_POINTS); + wxUserIntegralLogMapper.insertWxUserIntegralLog(wxUserIntegralLog); } join.setRewardJson(JSONObject.toJSONString(plan));//保存整个护理计划对象,预防数据问题 join.setIsSetReward(1);//不管是什么奖励都需要修改状态 - return wxNursingPlanJoinMapper.updateWxNursingPlanJoin(join); + this.setRewardJson(plan,join); + return R.ok(wxNursingPlanJoinMapper.updateWxNursingPlanJoin(join)); + } + + /** + * 保存领奖的json,备份 + * @param plan + * @param join + */ + private void setRewardJson(WxNursingPlan plan,WxNursingPlanJoin join){ + JSONObject rewardJson = new JSONObject(); + rewardJson.put("rewardType",plan.getRewardType()); + rewardJson.put("rewardConditions",plan.getRewardConditions()); + rewardJson.put("prizeName",plan.getPrizeName()); + rewardJson.put("rewardPoints",plan.getRewardPoints()); + rewardJson.put("wxAppid",plan.getWxAppid()); + rewardJson.put("rewardEntityUrl",plan.getRewardEntityUrl()); + rewardJson.put("rewardJumpType",plan.getRewardJumpType()); + rewardJson.put("rewardJumpUrl",plan.getRewardJumpUrl()); + rewardJson.put("rewardJumpWithoutUrl",plan.getRewardJumpWithoutUrl()); + rewardJson.put("rewardJumpParam",plan.getRewardJumpParam()); + rewardJson.put("rewardJumpTitle",plan.getRewardJumpTitle()); + rewardJson.put("rewardJumpContent",plan.getRewardJumpContent()); + rewardJson.put("rewardJumpVideoId",plan.getRewardJumpVideoId()); + rewardJson.put("rewardJumpVideoFeedId",plan.getRewardJumpVideoFeedId()); + join.setRewardJson(rewardJson.toJSONString()); } @Override @@ -1198,4 +1364,61 @@ public class WxNursingPlanService implements IWxNursingPlanService { join.setUpdateTime(new Date()); return wxNursingPlanJoinMapper.updateWxNursingPlanJoin(join); } + + @Override + public List listCalendar(LocalDate date) { + //计算一个月的第一天和最后一天 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + LocalDate monthStartDay = LocalDate.parse(date.format(formatter), formatter).with(TemporalAdjusters.firstDayOfMonth()); + LocalDate monthEndDay = LocalDate.parse(date.format(formatter), formatter).with(TemporalAdjusters.lastDayOfMonth()); + LocalDateTime monthStartDayTime = monthStartDay.atTime(0, 0); + LocalDateTime monthEndDayTime = LocalDateTime.of(monthEndDay.getYear(), monthEndDay.getMonth(), monthEndDay.getDayOfMonth(), 23, 59, 59); + //先查询出符合时间的护理计划 + Long userId = SecurityUtils.getLoginUser().getWxUserMember().getId(); + List userJoinRetList = wxNursingPlanJoinMapper.findWxNursingPlanUserJoinRet(userId, monthStartDayTime, monthEndDayTime); + if (userJoinRetList.isEmpty()) { + return null;//没有符合条件的参与记录 + } + //查询出指定范围内的进度记录 + List dayRetList = wxNursingPlanJoinProgressDetailMapper.findJoinProgressDetailList(null, userId, monthStartDayTime, monthEndDayTime); + List joinDayPlanIds = dayRetList.stream().map(WxNursingPlanUserJoinDayRet::getPlanId).collect(Collectors.toList()); + //取差集,判断是哪个护理计划尚未开始 + List unStartPlanList = userJoinRetList.stream().filter(item -> !joinDayPlanIds.contains(item.getPlanId())).collect(Collectors.toList()); + for (WxNursingPlanUserJoinRet item : unStartPlanList) { + List _dayRetList = wxNursingPlanJoinProgressDetailMapper.findJoinProgressDetailList(item.getPlanId(), userId, null, null); + //以参加的第一天为标准虚构日历 + if (_dayRetList.size() == 1) { + WxNursingPlanJoin join = wxNursingPlanJoinMapper.selectWxNursingPlanJoinById(item.getJoinId()); + if (join == null) { + break; + } + //以今日为开始填充时间 + WxNursingPlanUserJoinDayRet dayRet = _dayRetList.get(0); + dayRet.setStartTime(LocalDate.now().atTime(0, 0)); + //按照护理计划要求生成预留效果 + List detailRetList = wxNursingPlanCycleDetailMapper.getCalendarList(dayRet.getCycleId(), null); + detailRetList.forEach(_item -> { + if (_item.getStepType() == 2 && _item.getDay() != 1) { + WxNursingPlanUserJoinDayRet _dayRet = new WxNursingPlanUserJoinDayRet(); + BeanUtils.copyBeanProp(_item, _dayRet); + _dayRet.setStartTime(dayRet.getStartTime().plusDays(_item.getDay()));//日期移动 + _dayRet.setStatus(0);//默认未开始 + _dayRetList.add(_dayRet); + } + }); + dayRetList.addAll(_dayRetList); + } + } + //剔除掉不符合时间范围的数据 + return dayRetList.stream().filter(item -> item.getStartTime() != null + && item.getStartTime().compareTo(monthStartDayTime) >= 0 + && item.getStartTime().compareTo(monthEndDayTime) <= 0) + .peek(item -> { + if(item.getStatus() == null && item.getIsDayOff() == 1){ + item.setStatus(1); + }else if (item.getStatus() < 0) { + item.setStatus(0); + } + }).collect(Collectors.toList()); + } } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/ShuYunController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/ShuYunController.java index 25ad264..0602e19 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/ShuYunController.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/ShuYunController.java @@ -75,14 +75,14 @@ public class ShuYunController { return R.ok(); } - @PostMapping(value = "markUserTag/") + @PostMapping(value = "/markUserTag") public R markUserTag(@RequestBody ShuYunUserTagCallbackReq shuYunUserTag) { logger.info("数云标记用户标签: {}", JSON.toJSONString(shuYunUserTag)); shuYunService.markUserTag(shuYunUserTag); return R.ok(); } - @PostMapping(value = "delUserTag/") + @PostMapping(value = "/delUserTag") public R delUserTag(@RequestBody ShuYunUserTagCallbackReq shuYunUserTag) { logger.info("数云删除用户标签: {}", JSON.toJSONString(shuYunUserTag)); shuYunService.delUserTag(shuYunUserTag); diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/SysTagController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/SysTagController.java index af8dd2c..646351d 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/SysTagController.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/SysTagController.java @@ -85,7 +85,7 @@ public class SysTagController extends BaseController { @Log(title = "标签管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysTag tag) { - if (!tagService.checkDeptNameUnique(tag)) { + if (tagService.findTagCount(tag.getType(),tag.getTagName(),null)>0) { return error("新增标签'" + tag.getTagName() + "'失败,标签名称已存在"); } // 获取到父标签,检查是否顶级标签 @@ -112,7 +112,7 @@ public class SysTagController extends BaseController { public AjaxResult edit(@Validated @RequestBody SysTag tag) { Long id = tag.getId(); tagService.checkDeptDataScope(id); - if (!tagService.checkDeptNameUnique(tag)) { + if (tagService.findTagCount(tag.getType(),tag.getTagName(),tag.getId())>0) { return error("修改标签'" + tag.getTagName() + "'失败,标签名称已存在"); } else if (tag.getParentId().equals(id)) { return error("修改标签'" + tag.getTagName() + "'失败,上级标签不能是自己"); diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxModeController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxModeController.java index 3d8c357..c43c391 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxModeController.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxModeController.java @@ -178,29 +178,5 @@ public class WxModeController extends BaseController return toAjax(wxModeService.deleteWxModeByIds(ids)); } - @GetMapping("/instrumentModeTree") - public AjaxResult instrumentModeTree(@RequestParam(value = "type",required = false) Integer type) { - List voList = wxInstrumentModeService.getInstrumentModeList(type); - //转换成为map - Map> map = new HashMap<>(); - voList.forEach(item->{ - if(map.containsKey(item.getInstrumentId().toString())){ - List list= map.get(item.getInstrumentId().toString()); - list.add(item); - }else { - List list = new ArrayList<>(); - list.add(item); - map.put(item.getInstrumentId().toString(),list); - } - }); - JSONArray jsonArray = new JSONArray(); - map.forEach((key,value)->{ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("instrumentId",value.get(0).getInstrumentId()); - jsonObject.put("instrumentName",value.get(0).getInstrumentName()); - jsonObject.put("children",value); - jsonArray.add(jsonObject); - }); - return success(jsonArray); - } + } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxNursingPlanController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxNursingPlanController.java index 41a1285..194dbdb 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxNursingPlanController.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxNursingPlanController.java @@ -1,7 +1,10 @@ package com.flossom.system.controller; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.flossom.common.core.domain.entity.WxNursingPlan; import com.flossom.common.core.domain.req.WxNursingPlanReq; +import com.flossom.common.core.domain.vo.InstrumentModeVo; import com.flossom.common.core.utils.poi.ExcelUtil; import com.flossom.common.core.web.controller.BaseController; import com.flossom.common.core.web.domain.AjaxResult; @@ -14,8 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; -import java.util.Date; -import java.util.List; +import java.util.*; /** * 护理计划Controller @@ -124,4 +126,30 @@ public class WxNursingPlanController extends BaseController { public AjaxResult remove(@PathVariable Long id) { return toAjax(wxNursingPlanService.deleteWxNursingPlanById(id)); } + + @GetMapping("/instrumentModeTree") + public AjaxResult instrumentModeTree(@RequestParam("planId") Long planId) { + List voList = wxNursingPlanService.getInstrumentModeList(planId); + //转换成为map + Map> map = new HashMap<>(); + voList.forEach(item->{ + if(map.containsKey(item.getInstrumentId().toString())){ + List list= map.get(item.getInstrumentId().toString()); + list.add(item); + }else { + List list = new ArrayList<>(); + list.add(item); + map.put(item.getInstrumentId().toString(),list); + } + }); + JSONArray jsonArray = new JSONArray(); + map.forEach((key,value)->{ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("instrumentId",value.get(0).getInstrumentId()); + jsonObject.put("instrumentName",value.get(0).getInstrumentName()); + jsonObject.put("children",value); + jsonArray.add(jsonObject); + }); + return success(jsonArray); + } } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxNursingPlanJoinController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxNursingPlanJoinController.java index e7eeac1..1f91e81 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxNursingPlanJoinController.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxNursingPlanJoinController.java @@ -1,9 +1,11 @@ package com.flossom.system.controller; import com.flossom.common.core.domain.entity.WxNursingPlanJoin; +import com.flossom.common.core.domain.entity.WxUserTag; import com.flossom.common.core.domain.req.WxNursingPlanJoinUserExportVm; import com.flossom.common.core.domain.req.WxNursingPlanJoinUserReq; import com.flossom.common.core.domain.vo.WxNursingPlanJoinUserVo; +import com.flossom.common.core.utils.DateUtils; import com.flossom.common.core.utils.poi.ExcelUtil; import com.flossom.common.core.web.controller.BaseController; import com.flossom.common.core.web.domain.AjaxResult; @@ -16,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.time.format.DateTimeFormatter; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @@ -52,8 +55,61 @@ public class WxNursingPlanJoinController extends BaseController { @PostMapping("/export") public void export(HttpServletResponse response, WxNursingPlanJoinUserExportVm req) { List list = wxNursingPlanJoinService.selectWxNursingPlanJoinUserList(req); + list.forEach(item->{ + // 1参与中 2待审核 3审核通过 4审核未通过 5已终止 6已过期 7已结束 + switch (item.getStatus()){ + case 1: + item.setStatusStr("参与中"); + break; + case 2: + item.setStatusStr("待审核"); + break; + case 3: + item.setStatusStr("审核通过"); + break; + case 4: + item.setStatusStr("审核未通过"); + break; + case 5: + item.setStatusStr("已终止"); + break; + case 6: + item.setStatusStr("已过期"); + break; + case 7: + item.setStatusStr("已结束"); + break; + } + if(item.getIsReward() == 1){ + item.setCurrentProgressStr(item.getCurrentProgress()+"/"+item.getRewardConditions()); + item.setIsRewardStr("是"); + }else { + item.setIsRewardStr("否"); + } + if(item.getIsWriteSurvey() == 1){ + item.setIsWriteSurveyStr("是"); + }else { + item.setIsWriteSurveyStr("否"); + } + if(item.getIsQualifyFor() != null){ + if(item.getIsQualifyFor() == 1){ + item.setIsQualifyForStr("是"); + }else { + item.setIsQualifyForStr("否"); + } + } + if(item.getCompanyTags() != null && !item.getCompanyTags().isEmpty()){ + item.setCompanyTagName(item.getCompanyTags().stream().map(WxUserTag::getTagName).collect(Collectors.joining(","))); + } + if(item.getMiniProgramTags() != null && !item.getMiniProgramTags().isEmpty()){ + item.setMiniProgramTagName(item.getMiniProgramTags().stream().map(WxUserTag::getTagName).collect(Collectors.joining(","))); + } + if(item.getJoinTime() != null){ + item.setJoinTimeStr(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",item.getJoinTime())); + } + }); ExcelUtil util = new ExcelUtil(WxNursingPlanJoinUserVo.class); - util.exportExcel(response, list, "用户参加护理计划", req.getExportFields()); + util.exportExcel(response, list, "护理计划记录", req.getExportFields()); } /** diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/ISysTagService.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/ISysTagService.java index b4817b4..f4af8e5 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/ISysTagService.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/ISysTagService.java @@ -138,4 +138,6 @@ public interface ISysTagService List> getWecomTags(); + int findTagCount(String type,String tagName,Long notId); + } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentModeService.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentModeService.java index 70a8656..0952ec3 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentModeService.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentModeService.java @@ -1,7 +1,6 @@ package com.flossom.system.service; import com.flossom.common.core.domain.entity.WxInstrumentMode; -import com.flossom.common.core.domain.vo.InstrumentModeVo; import java.util.List; @@ -61,5 +60,4 @@ public interface IWxInstrumentModeService { */ public int deleteWxInstrumentModeById(Long id); - List getInstrumentModeList(Integer type); } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxNursingPlanCycleService.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxNursingPlanCycleService.java index 09c610f..97e785a 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxNursingPlanCycleService.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxNursingPlanCycleService.java @@ -61,4 +61,6 @@ public interface IWxNursingPlanCycleService public int deleteWxNursingPlanCycleById(Long id); int deleteWxNursingPlanCycleByPlanId(Long planId); + + List findDayList(Long planId); } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxNursingPlanInstrumentService.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxNursingPlanInstrumentService.java index 3c7ed9f..b172ef7 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxNursingPlanInstrumentService.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxNursingPlanInstrumentService.java @@ -67,4 +67,6 @@ public interface IWxNursingPlanInstrumentService List getWxNursingPlanIdsByInstrumentName(String instrumentName); void batchInsertWxNursingPlanInstrument(Long planId,List instrumentIds); + + List getWxNursingPlanInstrumentIdsByPlanId(Long planId); } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxNursingPlanService.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxNursingPlanService.java index e371122..2f876b5 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxNursingPlanService.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxNursingPlanService.java @@ -2,6 +2,7 @@ package com.flossom.system.service; import com.flossom.common.core.domain.entity.WxNursingPlan; import com.flossom.common.core.domain.req.WxNursingPlanReq; +import com.flossom.common.core.domain.vo.InstrumentModeVo; import java.util.List; @@ -63,4 +64,6 @@ public interface IWxNursingPlanService { * @return 结果 */ public int deleteWxNursingPlanById(Long id); + + List getInstrumentModeList(Long planId); } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SysTagServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SysTagServiceImpl.java index 5c8a46b..9000aa1 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SysTagServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SysTagServiceImpl.java @@ -215,19 +215,18 @@ public class SysTagServiceImpl implements ISysTagService { tag.setParentName(info.getTagName()); tag.setShuyunParentId(info.getShuyunTagId()); } - SysTag querySysTag = new SysTag(); - querySysTag.setParentId(tag.getParentId()); - querySysTag.setDelFlag("0"); - List sysTags = tagMapper.selectDeptList(querySysTag); - if(sysTags.size()>=10){ - throw new ServiceException(tag.getParentId() == 0?"一级标签最多只能有10个":"一级标签下最多只能有10个二级标签"); + if(Objects.equals(tag.getType(), "1")){ + int count = tagMapper.selectCount(tag.getParentId(),1); + if(count>=10){ + throw new ServiceException(tag.getParentId() == 0?"一级标签最多只能有10个":"一级标签下最多只能有10个二级标签"); + } } int i = tagMapper.insertDept(tag); /** * TODO: 标签新增同步数云(已完成) */ - if (!Objects.isNull(info) && !Objects.equals(info.getType(),"2")) {//外部标签不同步数云 + if (!Objects.equals(tag.getType(),"2")) {//外部标签不同步数云 ShuYunTag shuYunTag = new ShuYunTag(shuYunConfig.getWxTagGroupId(), tag.getTagName()); //一级标签必须是从属类型,二级标签不能是从属类型 if(tag.getParentId() == 0){ @@ -409,5 +408,7 @@ public class SysTagServiceImpl implements ISysTagService { return getChildList(list, t).size() > 0 ? true : false; } - + public int findTagCount(String type,String tagName,Long notId){ + return tagMapper.findTagCount(type, tagName, notId); + } } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentModeServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentModeServiceImpl.java index 0543fe8..452bca5 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentModeServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentModeServiceImpl.java @@ -1,14 +1,13 @@ package com.flossom.system.service.impl; -import java.util.List; - import com.flossom.common.core.domain.entity.WxInstrumentMode; -import com.flossom.common.core.domain.vo.InstrumentModeVo; import com.flossom.common.core.mapper.WxInstrumentModeMapper; import com.flossom.common.core.utils.DateUtils; +import com.flossom.system.service.IWxInstrumentModeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.flossom.system.service.IWxInstrumentModeService; + +import java.util.List; /** * 仪器与模式的关联Service业务层处理 @@ -89,7 +88,4 @@ public class WxInstrumentModeServiceImpl implements IWxInstrumentModeService { return wxInstrumentModeMapper.deleteWxInstrumentModeById(id); } - public List getInstrumentModeList(Integer type){ - return wxInstrumentModeMapper.getInstrumentModeList(type); - } } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanCycleServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanCycleServiceImpl.java index 0a52c5d..220cd91 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanCycleServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanCycleServiceImpl.java @@ -16,6 +16,7 @@ import com.flossom.common.core.mapper.WxNursingPlanCycleDetailStepMapper; import com.flossom.common.core.mapper.WxNursingPlanCycleMapper; import com.flossom.common.core.utils.DateUtils; import com.flossom.common.core.utils.StringUtils; +import io.swagger.models.auth.In; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.flossom.system.service.IWxNursingPlanCycleService; @@ -171,4 +172,8 @@ public class WxNursingPlanCycleServiceImpl implements IWxNursingPlanCycleService } return wxNursingPlanCycleMapper.deleteWxNursingPlanCycleByPlanId(planId); } + + public List findDayList(Long planId){ + return wxNursingPlanCycleMapper.findDayNumList(planId); + } } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanInstrumentServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanInstrumentServiceImpl.java index 44059f3..494624c 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanInstrumentServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanInstrumentServiceImpl.java @@ -116,4 +116,8 @@ public class WxNursingPlanInstrumentServiceImpl implements IWxNursingPlanInstrum wxNursingPlanInstrumentMapper.insertWxNursingPlanInstrument(instrument); }); } + + public List getWxNursingPlanInstrumentIdsByPlanId(Long planId){ + return wxNursingPlanInstrumentMapper.getWxNursingPlanInstrumentIdsByPlanId(planId); + } } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanJoinServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanJoinServiceImpl.java index 5132b24..b3aea75 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanJoinServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanJoinServiceImpl.java @@ -1,5 +1,6 @@ package com.flossom.system.service.impl; +import com.alibaba.fastjson.JSONObject; import com.flossom.common.core.constant.IntegralChangTextConstants; import com.flossom.common.core.domain.entity.*; import com.flossom.common.core.domain.req.WxNursingPlanJoinUserReq; @@ -10,6 +11,7 @@ import com.flossom.common.core.domain.shuyun.ShuYunPointChange; import com.flossom.common.core.domain.vo.WxNursingPlanJoinUserVo; import com.flossom.common.core.enums.ShuYunPointSourceEnum; import com.flossom.common.core.enums.TagTypeStatusEnum; +import com.flossom.common.core.exception.ServiceException; import com.flossom.common.core.mapper.*; import com.flossom.common.core.utils.DateUtils; import com.flossom.common.core.utils.StringUtils; @@ -20,6 +22,7 @@ import com.flossom.common.security.utils.shuyun.ShuYunConfig; import com.flossom.system.service.IWxNursingPlanJoinService; import com.flossom.system.service.IWxUserMemberService; import com.flossom.system.service.IWxUserScriptLogService; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -57,6 +60,10 @@ public class WxNursingPlanJoinServiceImpl implements IWxNursingPlanJoinService { private WxUserMemberMapper wxUserMemberMapper; @Autowired private ShuYunConfig shuYunConfig; + @Autowired + private WxNursingPlanInstrumentMapper wxNursingPlanInstrumentMapper; + @Autowired + private WxUserIntegralLogMapper wxUserIntegralLogMapper; public List selectWxNursingPlanJoinList(WxNursingPlanJoin join) { return wxNursingPlanJoinMapper.selectWxNursingPlanJoinList(join); @@ -80,10 +87,10 @@ public class WxNursingPlanJoinServiceImpl implements IWxNursingPlanJoinService { if (req.getMiniProgramTags() != null) { req.setMiniProgramTagNum(req.getMiniProgramTags().size()); } - if (req.getInstrumentIds() != null) { - List userIds = wxNursingPlanJoinProgressDetailMapper.getUserIdsByInstrumentIds(req.getInstrumentIds(), 1); - userIds.add(0L); - req.setUserIds(userIds); + if (req.getInstrumentIds() != null && !req.getInstrumentIds().isEmpty()) { + List planIds = wxNursingPlanInstrumentMapper.findPlanIdsByInstrumentIds(req.getInstrumentIds()); + planIds.add(0L); + req.setPlanIds(planIds); } List voList = wxNursingPlanJoinMapper.selectWxNursingPlanJoinUserList(req); StringBuffer sb = new StringBuffer(); @@ -95,10 +102,10 @@ public class WxNursingPlanJoinServiceImpl implements IWxNursingPlanJoinService { item.setMiniProgramTags(wxUserTagMapper.selectWxUserTagList(wxUserTag)); wxUserTag.setType(TagTypeStatusEnum.ENTERPRISE_WECHAT.getCode()); item.setCompanyTags(wxUserTagMapper.selectWxUserTagList(wxUserTag)); + List instrumentNameList = wxNursingPlanInstrumentMapper.getWxNursingPlanInstrumentNameByPlanId(item.getPlanId()); //绑定使用过的仪器 - List detailList = wxNursingPlanJoinProgressDetailMapper.getInstrumentList(item.getId(), 1); - if (!detailList.isEmpty()) { - detailList.forEach(detail -> sb.append(detail.getInstrumentName()).append(",")); + if (!instrumentNameList.isEmpty()) { + instrumentNameList.forEach(detail -> sb.append(detail).append(",")); sb.deleteCharAt(sb.length() - 1); item.setInstrumentNames(sb.toString()); sb.delete(0, sb.length()); @@ -127,8 +134,10 @@ public class WxNursingPlanJoinServiceImpl implements IWxNursingPlanJoinService { @Override public int deleteWxNursingPlanJoinByIds(List ids) { List progressIds = wxNursingPlanJoinProgressMapper.findProgressIdsByJoinIds(ids); - wxNursingPlanJoinProgressDetailMapper.deleteWxNursingPlanJoinProgressDetailByProgressIds(progressIds); - wxNursingPlanJoinProgressMapper.deleteWxNursingPlanJoinProgressByJoinIds(progressIds); + if (!progressIds.isEmpty()) { + wxNursingPlanJoinProgressDetailMapper.deleteWxNursingPlanJoinProgressDetailByProgressIds(progressIds); + wxNursingPlanJoinProgressMapper.deleteWxNursingPlanJoinProgressByJoinIds(progressIds); + } return wxNursingPlanJoinMapper.deleteWxNursingPlanJoinByIds(ids); } @@ -156,10 +165,8 @@ public class WxNursingPlanJoinServiceImpl implements IWxNursingPlanJoinService { String[] array = item.getCheckWechatTagArrayStr().split(","); item.setCheckWechatTagArray(Arrays.stream(array).map(Long::parseLong).collect(Collectors.toList())); } - //特殊处理参与中的用户 - if (item.getJoinStatus() == 1) { - this.handleJoin(item.getPlanId(),item.getId(),item.getUserId()); - } + //处理审核奖励相关 + this.handleJoin(item.getPlanId(), item.getId(), item.getUserId()); //保存话术-用户的映射关系 if (item.getScriptId() != null) { List userIds = null; @@ -222,19 +229,20 @@ public class WxNursingPlanJoinServiceImpl implements IWxNursingPlanJoinService { } /** - * 特殊处理仅在参与中的状态 + * 处理奖励相关的 + * * @param planId * @param planJoinId * @param userId */ - private void handleJoin(long planId, long planJoinId,long userId) { + private void handleJoin(long planId, long planJoinId, long userId) { //计算是否可以领取奖励 WxNursingPlan plan = wxNursingPlanMapper.selectWxNursingPlanById(planId); if (plan.getIsReward() == 0) { return; } WxNursingPlanJoin join = wxNursingPlanJoinMapper.selectWxNursingPlanJoinById(planJoinId); - if(join.getStatus() == 3){ + if (join.getStatus() == 3) { return; } @@ -247,9 +255,26 @@ public class WxNursingPlanJoinServiceImpl implements IWxNursingPlanJoinService { return; } //检查是否具备领奖资格 - if (!this.checkRewardRestrict(plan,userId)) { + if (!this.checkRewardRestrict(plan, userId)) { return; } + //保存领奖的json,备份 + JSONObject rewardJson = new JSONObject(); + rewardJson.put("rewardType", plan.getRewardType()); + rewardJson.put("rewardConditions", plan.getRewardConditions()); + rewardJson.put("prizeName", plan.getPrizeName()); + rewardJson.put("rewardPoints", plan.getRewardPoints()); + rewardJson.put("wxAppid", plan.getWxAppid()); + rewardJson.put("rewardEntityUrl", plan.getRewardEntityUrl()); + rewardJson.put("rewardJumpType", plan.getRewardJumpType()); + rewardJson.put("rewardJumpUrl", plan.getRewardJumpUrl()); + rewardJson.put("rewardJumpWithoutUrl", plan.getRewardJumpWithoutUrl()); + rewardJson.put("rewardJumpParam", plan.getRewardJumpParam()); + rewardJson.put("rewardJumpTitle", plan.getRewardJumpTitle()); + rewardJson.put("rewardJumpContent", plan.getRewardJumpContent()); + rewardJson.put("rewardJumpVideoId", plan.getRewardJumpVideoId()); + rewardJson.put("rewardJumpVideoFeedId", plan.getRewardJumpVideoFeedId()); + join.setRewardJson(rewardJson.toJSONString()); //判断奖励当中是否存在积分 String[] rewardType = plan.getRewardType().split(","); boolean isPoints = false;//奖励是否包括积分 @@ -272,6 +297,16 @@ public class WxNursingPlanJoinServiceImpl implements IWxNursingPlanJoinService { LocalDateTime.now().format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD_HH_MM_SS)), IntegralChangTextConstants.NURSING_ACTIVITY_CLOCK_REWARD_POINTS); ShuYunApiUtils.pointChange(shuYunPointChange); join.setIsSetReward(1); + WxUserIntegralLog wxUserIntegralLog = new WxUserIntegralLog(); + wxUserIntegralLog.setUserId(userId); + wxUserIntegralLog.setUserName(wxUserMember.getNickname()); + wxUserIntegralLog.setUserPhone(wxUserMember.getMobile()); + wxUserIntegralLog.setSource("1"); + wxUserIntegralLog.setFloatScore(Long.valueOf(plan.getRewardPoints())); + wxUserIntegralLog.setCreateTime(DateUtils.getNowDate()); + wxUserIntegralLog.setCreateBy(SecurityUtils.getUsername()); + wxUserIntegralLog.setRemarkContent(IntegralChangTextConstants.NURSING_ACTIVITY_CLOCK_REWARD_POINTS); + wxUserIntegralLogMapper.insertWxUserIntegralLog(wxUserIntegralLog); } } wxNursingPlanJoinMapper.updateWxNursingPlanJoin(join); @@ -283,7 +318,7 @@ public class WxNursingPlanJoinServiceImpl implements IWxNursingPlanJoinService { * @param plan * @return */ - private boolean checkRewardRestrict(WxNursingPlan plan,long userId) { + private boolean checkRewardRestrict(WxNursingPlan plan, long userId) { //查询历史领奖的记录 WxNursingPlanJoin queryJoin = new WxNursingPlanJoin(); queryJoin.setUserId(userId); diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanServiceImpl.java index 6d716c5..4eaa951 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxNursingPlanServiceImpl.java @@ -1,25 +1,27 @@ package com.flossom.system.service.impl; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.stream.Collectors; - import com.flossom.common.core.domain.entity.WxNursingPlan; import com.flossom.common.core.domain.entity.WxNursingPlanInstrument; import com.flossom.common.core.domain.entity.WxNursingPlanJoin; import com.flossom.common.core.domain.entity.WxNursingPlanTag; import com.flossom.common.core.domain.req.WxNursingPlanReq; +import com.flossom.common.core.domain.vo.InstrumentModeVo; +import com.flossom.common.core.exception.ServiceException; +import com.flossom.common.core.mapper.WxInstrumentModeMapper; import com.flossom.common.core.mapper.WxNursingPlanMapper; import com.flossom.common.core.utils.DateUtils; import com.flossom.common.core.utils.StringUtils; import com.flossom.system.service.*; -import io.swagger.models.auth.In; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + /** * 护理计划Service业务层处理 * @@ -38,6 +40,8 @@ public class WxNursingPlanServiceImpl implements IWxNursingPlanService { private IWxNursingPlanCycleService wxNursingPlanCycleService; @Autowired private IWxNursingPlanJoinService wxNursingPlanJoinService; + @Autowired + private WxInstrumentModeMapper wxInstrumentModeMapper; /** * 查询护理计划 @@ -101,8 +105,14 @@ public class WxNursingPlanServiceImpl implements IWxNursingPlanService { } List wxNursingPlanList = wxNursingPlanMapper.selectWxNursingPlanReqList(wxNursingPlanReq); wxNursingPlanList.forEach(item -> { - //计算周期时长,计算公式:活动的总天数*日程循环次数 - item.setCycleTime(DateUtils.timeDistanceDay(item.getActiveEndTime(), item.getActiveStartTime()) * item.getCycleNumber()); + List days = wxNursingPlanCycleService.findDayList(item.getId()); + if(days.isEmpty()){ + item.setCycleTime(0); + }else { + //计算周期时长,计算公式:日程最大的总天数*日程循环次数 + int day = days.stream().max(Comparator.comparingInt(_item->_item)).get(); + item.setCycleTime((long) day * item.getCycleNumber()); + } //查询关联的仪器名称 String instrumentName = wxNursingPlanInstrumentService.getWxNursingPlanInstrumentNameByPlanId(item.getId()); @@ -196,14 +206,23 @@ public class WxNursingPlanServiceImpl implements IWxNursingPlanService { @Transactional @Override public int deleteWxNursingPlanById(Long id) { + //查询是否有用户正在使用该护理计划 + WxNursingPlanJoin queryJoin = new WxNursingPlanJoin(); + queryJoin.setPlanId(id); + queryJoin.setStatus(1); + List joinList = wxNursingPlanJoinService.selectWxNursingPlanJoinList(queryJoin); + if(!joinList.isEmpty()){ + throw new ServiceException("选择的数据正在使用中,不支持删除"); + } + int code = wxNursingPlanMapper.deleteWxNursingPlanById(id); wxNursingPlanInstrumentService.deleteWxNursingPlanInstrumentByPlanId(id); wxNursingPlanTagService.deleteWxNursingPlanTagByPlanId(id); wxNursingPlanCycleService.deleteWxNursingPlanCycleByPlanId(id); //删除护理记录相关的信息 - WxNursingPlanJoin queryJoin = new WxNursingPlanJoin(); + queryJoin = new WxNursingPlanJoin(); queryJoin.setPlanId(id); - List joinList = wxNursingPlanJoinService.selectWxNursingPlanJoinList(queryJoin); + joinList = wxNursingPlanJoinService.selectWxNursingPlanJoinList(queryJoin); if(!joinList.isEmpty()){ List joinIds = joinList.stream().map(WxNursingPlanJoin::getId).collect(Collectors.toList()); wxNursingPlanJoinService.deleteWxNursingPlanJoinByIds(joinIds); @@ -252,4 +271,12 @@ public class WxNursingPlanServiceImpl implements IWxNursingPlanService { tags.add(tag); }); } + + public List getInstrumentModeList(Long planId){ + List instrumentIds = wxNursingPlanInstrumentService.getWxNursingPlanInstrumentIdsByPlanId(planId); + if(instrumentIds.isEmpty()){ + return new ArrayList<>(); + } + return wxInstrumentModeMapper.getInstrumentModeList(instrumentIds); + } } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxUserMemberServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxUserMemberServiceImpl.java index 3b12135..ad0b2e0 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxUserMemberServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxUserMemberServiceImpl.java @@ -740,7 +740,7 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService { wxUserInstrument.setUserId(wxUserMemberRet.getId()); wxUserInstrument.setBindingStatus(BindingStatusEnums.BINDED.getCode()); wxUserInstrument.setStatus(Status.OK.getCode().longValue()); - wxUserMemberRet.setInstrumentList(wxUserInstrumentMapper.selectWxUserInstrumentList(wxUserInstrument)); + wxUserMemberRet.setInstrumentList(wxUserInstrumentMapper.findInstrumentList(wxUserInstrument)); list.add(wxUserMemberRet); } } diff --git a/flossom-transfer/.gitignore b/flossom-transfer/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/flossom-transfer/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/flossom-transfer/.mvn/wrapper/maven-wrapper.properties b/flossom-transfer/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..aeccdfd --- /dev/null +++ b/flossom-transfer/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +wrapperVersion=3.3.1 +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip diff --git a/flossom-transfer/mvnw b/flossom-transfer/mvnw new file mode 100644 index 0000000..ba9212a --- /dev/null +++ b/flossom-transfer/mvnw @@ -0,0 +1,250 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.3.1 +# +# Optional ENV vars +# ----------------- +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output +# ---------------------------------------------------------------------------- + +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x + +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; +esac + +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" + else + JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi + fi + else + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi + fi +} + +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" + done + printf %x\\n $h +} + +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 +} + +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl="${value-}" ;; + distributionSha256Sum) distributionSha256Sum="${value-}" ;; + esac +done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_HOME="$HOME/.m2/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" +} + +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" +fi + +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac + +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT +else + die "cannot create temp dir" +fi + +mkdir -p -- "${MAVEN_HOME%/*}" + +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" +fi + +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 + fi +fi + +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" +fi +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" + +clean || : +exec_maven "$@" diff --git a/flossom-transfer/mvnw.cmd b/flossom-transfer/mvnw.cmd new file mode 100644 index 0000000..406932d --- /dev/null +++ b/flossom-transfer/mvnw.cmd @@ -0,0 +1,146 @@ +<# : batch portion +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.3.1 +@REM +@REM Optional ENV vars +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output +@REM ---------------------------------------------------------------------------- + +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) +) +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' +$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" +$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" diff --git a/flossom-transfer/pom.xml b/flossom-transfer/pom.xml new file mode 100644 index 0000000..5aa7a76 --- /dev/null +++ b/flossom-transfer/pom.xml @@ -0,0 +1,124 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.3.0 + + + com.example + flossom-transfer + 0.0.1-SNAPSHOT + flossom-transfer + flossom-transfer + + 1.8 + 3.3.0 + + + + com.mysql + mysql-connector-j + runtime + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-autoconfigure + + + com.baomidou + dynamic-datasource-spring-boot3-starter + 4.2.0 + + + com.baomidou + mybatis-plus-spring-boot3-starter + 3.5.6 + + + com.alibaba + druid-spring-boot-starter + 1.2.23 + + + junit + junit + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.version} + ${java.version} + ${project.build.sourceEncoding} + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + org.projectlombok + lombok + + + + + + + repackage + + + + + + + + + + + public + aliyun nexus + https://maven.aliyun.com/repository/public + + true + + + + + + + public + aliyun nexus + https://maven.aliyun.com/repository/public + + true + + + false + + + + diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/FlossomTransferApplication.java b/flossom-transfer/src/main/java/com/flossom/transfer/FlossomTransferApplication.java new file mode 100644 index 0000000..20eddba --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/FlossomTransferApplication.java @@ -0,0 +1,15 @@ +package com.flossom.transfer; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@MapperScan(basePackages = "com.flossom.transfer.*.mapper") +public class FlossomTransferApplication { + + public static void main(String[] args) { + SpringApplication.run(FlossomTransferApplication.class, args); + } + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivity.java b/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivity.java new file mode 100644 index 0000000..660a710 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivity.java @@ -0,0 +1,194 @@ +package com.flossom.transfer.original.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动列对象 hz_activity + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = false) +@Data +@TableName("hz_activity") +public class HzActivity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 活动标题 + */ + private String titile; + + /** + * 活动banner + */ + private String mianBanner; + + /** + * 打卡线上活动保存添加一个字段,存一张图片 + */ + private String banner; + + /** + * 打卡活动保存添加一个字段,完成活动后自动帮用户添加标签,字符串逗号分隔 + */ + private String miniPrograms; + + /** + * 打卡活动保存添加一个字段,完成活动后自动帮用户添加标签,字符串逗号分隔 + */ + private String userPrograms; + + /** + * 参与活动标签 + */ + private String addUserPrograms; + + /** + * 参与活动标签 + */ + private String addMiniPrograms; + + /** + * 活动开始时间 + */ + private Date startime; + + /** + * 活动截至时间 + */ + private Date endtime; + + /** + * 参与人数 + */ + private Long participants; + + /** + * 有效天数 + */ + private Long validDay; + + /** + * 打卡天数 + */ + private Long clockDay; + + /** + * 奖励积分 + */ + private BigDecimal credit; + + /** + * 活动详情 + */ + private String content; + + /** + * 1打卡活动 2线上活动问卷活动 3线上活动企微活动 4共创-使用反馈 5共创-共创话题 + */ + private Integer type; + + /** + * 仪器id + */ + private String instrumentId; + + /** + * $column.columnComment + */ + private Date addtime; + + /** + * 1未开放 2可参与 + */ + private Integer status; + + private String json; + + /** + * 用户注册时间开始 + */ + private Date userRegisterStar; + + /** + * 用户注册时间结束 + */ + private Date userRegisterEnd; + + /** + * 人数上线 + */ + private Long numberPeople; + + /** + * 话术id + */ + private Long verbalid; + + /** + * 用户打卡次数 权限必须大于这个才能看到该活动 + */ + private Long permissionDay; + + /** + * appid + */ + private String appid; + + /** + * 问卷路径 + */ + private String path; + + /** + * 商城跳转appid + */ + private String skipAppid; + + /** + * 商城路径 + */ + private String skipPath; + + /** + * 1 需要审核 2不需要审核 + */ + private Integer audit; + + /** + * $column.columnComment + */ + private Long sort; + + /** + * $column.columnComment + */ + private Long weekId; + + /** + * 首页推荐封面 + */ + private String indexBanner; + + /** + * 虚拟人数 + */ + private Long virtualParticipants; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivityAddCondition.java b/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivityAddCondition.java new file mode 100644 index 0000000..84b0d64 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivityAddCondition.java @@ -0,0 +1,45 @@ +package com.flossom.transfer.original.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * 活动打卡人员设置对象 hz_activity_add_condition + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = false) +@Data +@TableName("hz_activity_add_condition") +public class HzActivityAddCondition implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 1企微标签 2小程序标签 3购买渠道 + */ + private Integer type; + + /** + * 活动id + */ + private Long activityId; + + /** + * 标识id + */ + private Long cateId; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivityCarePlan.java b/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivityCarePlan.java new file mode 100644 index 0000000..6693521 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivityCarePlan.java @@ -0,0 +1,90 @@ +package com.flossom.transfer.original.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * 护理计划信息对象 hz_activity_care_plan + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = false) +@Data +@TableName("hz_activity_care_plan") +public class HzActivityCarePlan implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 活动ID + */ + private Long activityId; + + /** + * 计划天数 + */ + private Long totalDay; + + /** + * 计划前言 + */ + private String prefaceBanner; + + /** + * 参与模式 1.终身 2.每月 3.每年 + */ + private Long joinMode; + + /** + * 参与次数 + */ + private Long joinTimes; + + /** + * 奖励模式 1.终身 2.每月 3.每年 + */ + private Long giftMode; + + /** + * 奖励次数 + */ + private Long giftTimes; + + /** + * 日程设置 + */ + private String daySetting; + + /** + * 循环次数 + */ + private Long circleTimes; + + /** + * 日程名称 + */ + private String dayName; + + /** + * 任务奖励 + */ + private String giftInfo; + + /** + * 护理前问卷 + */ + private String precheckSojumpPath; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivityClock.java b/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivityClock.java new file mode 100644 index 0000000..70c224b --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivityClock.java @@ -0,0 +1,106 @@ +package com.flossom.transfer.original.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户打卡记录对象 hz_activity_clock + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = false) +@Data +@TableName("hz_activity_clock") +public class HzActivityClock implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * $column.columnComment + */ + private Long userId; + + /** + * 打卡图片 + */ + private String clockImg; + + /** + * 打卡心得 + */ + private String clockContent; + + /** + * 打卡时间 + */ + private Date addtime; + + /** + * 1 待审核 2审核通过 3不通过 + */ + private Integer status; + + /** + * 1打卡活动 2 线上活动 + */ + private Integer type; + + /** + * 活动id + */ + private Long activityId; + + /** + * 线上活动参与打卡保存json + */ + private String json; + + /** + * 仪器id + */ + private Long instrumentId; + + /** + * 1是否历史补卡 + */ + private Integer isHistory; + + /** + * $column.columnComment + */ + private String report; + + /** + * 场景id + */ + private Long screneId; + + /** + * 护理时长 + */ + private Long nursingTime; + + /** + * 场景名称 + */ + private String screneName; + + /** + * 是否在线,1在线,2离线 + */ + private Long online; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivityClockTimes.java b/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivityClockTimes.java new file mode 100644 index 0000000..683ee20 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivityClockTimes.java @@ -0,0 +1,116 @@ +package com.flossom.transfer.original.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 【请填写功能名称】对象 hz_activity_clock_times + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = false) +@Data +@TableName("hz_activity_clock_times") +public class HzActivityClockTimes implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 仪器id + */ + private Long instrumentId; + + /** + * 1脸部 2眼部 模式id + */ + private Long type; + + /** + * 小时 + */ + private Long hour; + + /** + * 分钟 + */ + private Long minute; + + /** + * 秒 + */ + private Long second; + + /** + * 打卡时间 + */ + private Date addtime; + + /** + * 打卡id + */ + private Long clockId; + + /** + * 用户id + */ + private Long userId; + + /** + * 场景id + */ + private Long screneId; + + /** + * 场景名称 + */ + private String screneName; + + /** + * 脸部场景挡位 + */ + private Long modelFaceWard; + + /** + * 脸部场景使用时长 + */ + private Long modelFaceUse; + + /** + * 脸部模式类型 + */ + private Long modelFaceType; + + /** + * 眼部场景挡位 + */ + private Long modelEyeWard; + + /** + * 眼部场景使用时长 + */ + private Long modelEyeUse; + + /** + * 眼部模式类型 + */ + private Long modelEyeType; + + /** + * led模式使用时长 + */ + private Long modelLedUse; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivityUser.java b/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivityUser.java new file mode 100644 index 0000000..cda17e0 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzActivityUser.java @@ -0,0 +1,56 @@ +package com.flossom.transfer.original.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户活动参与对象 hz_activity_user + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = false) +@Data +@TableName("hz_activity_user") +public class HzActivityUser implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 活动id + */ + private Long activityId; + + /** + * 用户id + */ + private Long userId; + + /** + * $column.columnComment + */ + private Date addtime; + + /** + * 1审核中2未通过3已通过4参与中 + */ + private Integer status; + + /** + * 仪器id + */ + private Long instrumentId; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzUserPermissionLog.java b/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzUserPermissionLog.java new file mode 100644 index 0000000..217b934 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/original/domain/HzUserPermissionLog.java @@ -0,0 +1,122 @@ +package com.flossom.transfer.original.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 用户权限禁用 活动规则是否已读对象 hz_user_permission_log + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = false) +@Data +@TableName("hz_user_permission_log") +public class HzUserPermissionLog implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * $column.columnComment + */ + private Long userId; + + /** + * 1禁止打卡 2禁止参与活动 3活动规则已读处理 + */ + private Integer type; + + /** + * 活动id + */ + private Long activeId; + + /** + * 参与时间 + */ + private Date addtime; + + /** + * 1参与中 2审核通过 3审核失败 4过期 5审核中 6终止 + */ + private Integer status; + + /** + * 仪器id + */ + private String instrumentId; + + /** + * 活动类型1打卡活动 2线上活动问卷活动 3线上活动企微活动 4共创-使用反馈 5共创-共创话题 + */ + private Long activeType; + + /** + * 问卷星id + */ + private Long sojumpId; + + /** + * 奖励积分 + */ + private BigDecimal credit; + + /** + * 跳转appid + */ + private String skipAppid; + + /** + * 跳转路径 + */ + private String skipPath; + + /** + * appid + */ + private String appid; + + /** + * 路径 + */ + private String path; + + /** + * $column.columnComment + */ + private String json; + + /** + * 1不需要提示 2需要提示 + */ + private Integer hint; + + /** + * 提示时间 + */ + private String tipTime; + + /** + * 1不需要提示 2需要提示 + */ + private Integer wcHint; + + /** + * 实物奖励是否点击 2是 + */ + private Integer isClickObject; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityAddConditionMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityAddConditionMapper.java new file mode 100644 index 0000000..c045871 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityAddConditionMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.original.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.original.domain.HzActivityAddCondition; +import org.apache.ibatis.annotations.Mapper; + +@DS("slave") +@Mapper +public interface HzActivityAddConditionMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityCarePlanMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityCarePlanMapper.java new file mode 100644 index 0000000..dd51ff0 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityCarePlanMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.original.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.original.domain.HzActivityCarePlan; +import org.apache.ibatis.annotations.Mapper; + +@DS("slave") +@Mapper +public interface HzActivityCarePlanMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityClockMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityClockMapper.java new file mode 100644 index 0000000..d6837b5 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityClockMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.original.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.original.domain.HzActivityClock; +import org.apache.ibatis.annotations.Mapper; + +@DS("slave") +@Mapper +public interface HzActivityClockMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityClockTimesMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityClockTimesMapper.java new file mode 100644 index 0000000..ea0b5b7 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityClockTimesMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.original.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.original.domain.HzActivityClockTimes; +import org.apache.ibatis.annotations.Mapper; + +@DS("slave") +@Mapper +public interface HzActivityClockTimesMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityMapper.java new file mode 100644 index 0000000..489c85a --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.original.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.original.domain.HzActivity; +import org.apache.ibatis.annotations.Mapper; + +@DS("slave") +@Mapper +public interface HzActivityMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityUserMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityUserMapper.java new file mode 100644 index 0000000..3b63bbc --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzActivityUserMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.original.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.original.domain.HzActivityUser; +import org.apache.ibatis.annotations.Mapper; + +@DS("slave") +@Mapper +public interface HzActivityUserMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzUserPermissionLogMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzUserPermissionLogMapper.java new file mode 100644 index 0000000..8b16c83 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/original/mapper/HzUserPermissionLogMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.original.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.original.domain.HzUserPermissionLog; +import org.apache.ibatis.annotations.Mapper; + +@DS("slave") +@Mapper +public interface HzUserPermissionLogMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/BaseEntity.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/BaseEntity.java new file mode 100644 index 0000000..3e04d0a --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/BaseEntity.java @@ -0,0 +1,49 @@ +package com.flossom.transfer.target.domain; + + +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * Entity基类 + * + * @author flossom + */ +@Data +public class BaseEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 搜索值 + */ + private String searchValue; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxDailyCareProducts.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxDailyCareProducts.java new file mode 100644 index 0000000..db85f40 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxDailyCareProducts.java @@ -0,0 +1,43 @@ +package com.flossom.transfer.target.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 日化产品信息对象 wx_daily_care_products + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("wx_daily_care_products") +public class WxDailyCareProducts extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 日化产品名称 + */ + private String productName; + + /** + * 日化产品图片 + */ + private String productImg; + + /** + * 介绍文案 + */ + private String introduce; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlan.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlan.java new file mode 100644 index 0000000..48d49fd --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlan.java @@ -0,0 +1,215 @@ +package com.flossom.transfer.target.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.time.LocalDateTime; + +/** + * 护理计划对象 wx_nursing_plan + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("wx_nursing_plan") +public class WxNursingPlan extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 显示顺序 + */ + private Long orderNum; + + /** + * 标题 + */ + private String title; + + /** + * 封面图片 + */ + private String banner; + + /** + * 活动详情图 + */ + private String detailChart; + + /** + * 活动开始时间 + */ + private LocalDateTime activeStartTime; + + /** + * 活动结束时间 + */ + private LocalDateTime activeEndTime; + + /** + * 日程循环次数 + */ + private Long cycleNumber; + + /** + * 参与限制时间间隔 1每月 2每年 3终生 + */ + private Long restrictTime; + + /** + * 参与限制次数 + */ + private Long restrictNumber; + + /** + * 用户注册开始时间 + */ + private LocalDateTime userRegistrationStartTime; + + /** + * 用户注册结束时间 + */ + private LocalDateTime userRegistrationEndTime; + + /** + * 话术主键 + */ + private Long scriptId; + + /** + * 是否需要审核 1是 0否 + */ + private Long isExamine; + + /** + * 是否有计划奖励 1是 0否 + */ + private Long isReward; + + /** + * 奖励类型 1积分 2实物 3跳转奖励 + */ + private String rewardType; + + /** + * 奖品名称 + */ + private String prizeName; + + /** + * 奖励积分 + */ + private Long rewardPoints; + + /** + * 小程序appid + */ + private String wxAppid; + + /** + * 奖励实物路径 + */ + private String rewardEntityUrl; + + /** + * 奖励跳转类型 1跳转内部链接、3跳转外部链接、4跳转小程序、5导向视频号、6导向视频号直播间 + */ + private Long rewardJumpType; + + /** + * 奖励跳转外部路径 + */ + private String rewardJumpWithoutUrl; + + /** + * 奖励跳转路径 + */ + private String rewardJumpUrl; + + /** + * 奖励跳转参数 + */ + private String rewardJumpParam; + + /** + * 奖励跳转标题 + */ + private String rewardJumpTitle; + + /** + * 奖励跳转内容 + */ + private String rewardJumpContent; + + /** + * 奖励跳转视频号id + */ + private String rewardJumpVideoId; + + /** + * 奖励跳转视频号feedId + */ + private String rewardJumpVideoFeedId; + + /** + * 领取奖励的护理天数 + */ + private Long rewardConditions; + + /** + * 获取奖励间隔时间 1每月 2每年 3终生 + */ + private Long rewardRestrictTime; + + /** + * 获取奖励次数 + */ + private Long rewardRestrictNumber; + + /** + * 基础参与人数 + */ + private Long basicNumber; + + /** + * 是否定制计划问卷星链接 1是 0否 + */ + private Long isSurvey; + + /** + * 定制计划星卷问卷地址 + */ + private String surveyUrl; + + /** + * 是否奖励登记问卷星链接 1是 0否 + */ + private Long isSurveyReward; + + /** + * 奖励登记星卷问卷地址 + */ + private String surveyRewardUrl; + + /** + * 活动详情 + */ + private String activeDetail; + + /** + * 状态 0隐藏中 1发布中 2已结束 3暂停中 + */ + private Long status; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanCycle.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanCycle.java new file mode 100644 index 0000000..cda7726 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanCycle.java @@ -0,0 +1,73 @@ +package com.flossom.transfer.target.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 护理计划日程对象 wx_nursing_plan_cycle + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("wx_nursing_plan_cycle") +public class WxNursingPlanCycle extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 护理计划主键 + */ + private Long planId; + + /** + * 日程名称 + */ + private String cycleName; + + /** + * 日程标记 + */ + private Long cycleMarker; + + /** + * 定制计划问卷星分值最小值 + */ + private Long surveyMin; + + /** + * 定制计划问卷星分值最大值 + */ + private Long surveyMax; + + /** + * 是否显示单日程结束后问卷 1是 0否 + */ + private Long optionShow; + + /** + * 单日程结束问卷标题 + */ + private String optionTitle; + + /** + * 单日程结束问卷的json内容 + */ + private String optionContent; + + /** + * 顺序 + */ + private Long index; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanCycleDetail.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanCycleDetail.java new file mode 100644 index 0000000..4bbcdaf --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanCycleDetail.java @@ -0,0 +1,48 @@ +package com.flossom.transfer.target.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 护理计划日程详情对象 wx_nursing_plan_cycle_detail + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("wx_nursing_plan_cycle_detail") +public class WxNursingPlanCycleDetail extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 日程主键 + */ + private Long cycleId; + + /** + * 天数 + */ + private Long day; + + /** + * 是否休息日 1是 0否 + */ + private Long isDayOff; + + /** + * 护理前弹窗是否展示 1是 0否 + */ + private Long useIsShow; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanCycleDetailStep.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanCycleDetailStep.java new file mode 100644 index 0000000..bb6ee05 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanCycleDetailStep.java @@ -0,0 +1,48 @@ +package com.flossom.transfer.target.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 护理计划日程详情对象 wx_nursing_plan_cycle_detail_step + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("wx_nursing_plan_cycle_detail_step") +public class WxNursingPlanCycleDetailStep extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + @TableId(type = IdType.AUTO) + private Long id; + + /** 日程主键 */ + private Long cycleId; + + /** 日程详情主键 */ + private Long cycleDetailId; + + /** 分类 */ + private Long stepType; + + /** 顺序 */ + private Long index; + + /** 日化产品id */ + private Long productId; + + /** 仪器id */ + private Long instrumentId; + + /** 模式id */ + private Long modeId; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanInstrument.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanInstrument.java new file mode 100644 index 0000000..01a246c --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanInstrument.java @@ -0,0 +1,38 @@ +package com.flossom.transfer.target.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 护理计划与仪器关联对象 wx_nursing_plan_instrument + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("wx_nursing_plan_instrument") +public class WxNursingPlanInstrument extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 护理计划主键 + */ + private Long planId; + + /** + * 仪器主键 + */ + private Long instrumentId; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanJoin.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanJoin.java new file mode 100644 index 0000000..4c422ab --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanJoin.java @@ -0,0 +1,93 @@ +package com.flossom.transfer.target.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户参加护理计划对象 wx_nursing_plan_join + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("wx_nursing_plan_join") +public class WxNursingPlanJoin extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 护理计划主键 + */ + private Long planId; + + /** + * 用户主键 + */ + private Long userId; + + /** + * 状态 1参与中 2待审核 3审核通过 4审核未通过 5已终止 6已过期 7已结束 + */ + private Long status; + + /** + * 奖励json + */ + private String rewardJson; + + /** + * 是否有积分奖励 + */ + private Long isPointsReward; + + /** + * 是否获得计划奖励(积分) + */ + private Long isSetReward; + + /** + * 是否填写奖励登记星卷问卷 + */ + private Long isWriteSurvey; + + /** + * 奖励登记问卷json参数 + */ + private String rewardSurveyJson; + + /** + * 是否提醒 + */ + private Long isWarn; + + /** + * 定制计划问卷json参数 + */ + private String surveyJson; + + /** + * 定制计划问卷星问卷星值 + */ + private Long surveyNumber; + + /** + * 周期完成次数 + */ + private Long cycleNumber; + + /** + * 是否等待周期循环 + */ + private Long isAwaitCycle; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanJoinProgress.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanJoinProgress.java new file mode 100644 index 0000000..a7b0da7 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanJoinProgress.java @@ -0,0 +1,88 @@ +package com.flossom.transfer.target.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 用户参加护理计划进度对象 wx_nursing_plan_join_progress + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("wx_nursing_plan_join_progress") +public class WxNursingPlanJoinProgress extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * + */ + private Long id; + + /** + * 护理计划主键 + */ + private Long planJoinId; + + /** + * 用户主键 + */ + private Long userId; + + /** + * 执行原定护理日程的天数 + */ + private Long joinDay; + + /** + * 实际开始护理的时间 + */ + private LocalDateTime startTime; + + /** + * 原定护理计划的json参数 + */ + private String dayCycleParams; + + /** + * 状态 1完成 0未完成 -1已过期 + */ + private Long status; + + /** + * 护理计划主键 + */ + private Long planId; + + /** + * 日程标记 + */ + private Long cycleMarker; + + /** + * 日程id + */ + private Long cycleId; + + /** + * 下次护理计划提醒时间 + */ + private LocalDateTime nextTime; + + /** + * 是否休息日 1是 0否 + */ + private Long isDayOff; + + /** + * 护理前弹窗是否展示 1是 0否 + */ + private Long useIsShow; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanJoinProgressDetail.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanJoinProgressDetail.java new file mode 100644 index 0000000..b6ec055 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanJoinProgressDetail.java @@ -0,0 +1,54 @@ +package com.flossom.transfer.target.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户参加护理计划每日详情对象 wx_nursing_plan_join_progress_detail + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("wx_nursing_plan_join_progress_detail") +public class WxNursingPlanJoinProgressDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + @TableId(type = IdType.AUTO) + private Long id; + + /** 护理进度主键 */ + private Long progressId; + + /** 用户主键 */ + private Long userId; + + /** step分类 */ + private Long stepType; + + /** 顺序 */ + private Long index; + + /** 日化产品id */ + private Long productId; + + /** 仪器id */ + private Long instrumentId; + + /** 模式id */ + private Long modeId; + + /** 护理记录id */ + private Long logId; + + /** 状态 1完成 0未完成 -1过期 */ + private Long status; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanTag.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanTag.java new file mode 100644 index 0000000..d36bc1f --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/domain/WxNursingPlanTag.java @@ -0,0 +1,48 @@ +package com.flossom.transfer.target.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 护理计划与标签关联对象 wx_nursing_plan_tag + * + * @author flossom + * @date 2024-05-27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("wx_nursing_plan_tag") +public class WxNursingPlanTag extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 护理计划主键 + */ + private Long planId; + + /** + * 标签主键 + */ + private Long tagId; + + /** + * 标签类型 1可参加人群(小程序标签) 2可参加人群(外部标签) 3不可参加人群(小程序标签) 4不可参加人群(外部标签) 5点击浏览获得小程序标签 6参与获得小程序标签 7审核通过获得小程序标签 + */ + private Long tagType; + + /** + * 状态(0正常 1禁用) + */ + private Long status; + + +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxDailyCareProductsMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxDailyCareProductsMapper.java new file mode 100644 index 0000000..78492cf --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxDailyCareProductsMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.target.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.target.domain.WxDailyCareProducts; +import org.apache.ibatis.annotations.Mapper; + +@DS("master") +@Mapper +public interface WxDailyCareProductsMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanCycleDetailMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanCycleDetailMapper.java new file mode 100644 index 0000000..8c29ee5 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanCycleDetailMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.target.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.target.domain.WxNursingPlanCycleDetail; +import org.apache.ibatis.annotations.Mapper; + +@DS("master") +@Mapper +public interface WxNursingPlanCycleDetailMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanCycleDetailStepMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanCycleDetailStepMapper.java new file mode 100644 index 0000000..8e7a3f0 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanCycleDetailStepMapper.java @@ -0,0 +1,10 @@ +package com.flossom.transfer.target.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.target.domain.WxNursingPlanCycleDetailStep; +import org.apache.ibatis.annotations.Mapper; +@DS("master") +@Mapper +public interface WxNursingPlanCycleDetailStepMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanCycleMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanCycleMapper.java new file mode 100644 index 0000000..a20d5e2 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanCycleMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.target.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.target.domain.WxNursingPlanCycle; +import org.apache.ibatis.annotations.Mapper; + +@DS("master") +@Mapper +public interface WxNursingPlanCycleMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanInstrumentMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanInstrumentMapper.java new file mode 100644 index 0000000..35603fe --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanInstrumentMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.target.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.target.domain.WxNursingPlanInstrument; +import org.apache.ibatis.annotations.Mapper; + +@DS("master") +@Mapper +public interface WxNursingPlanInstrumentMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanJoinMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanJoinMapper.java new file mode 100644 index 0000000..fac3149 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanJoinMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.target.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.target.domain.WxNursingPlanJoin; +import org.apache.ibatis.annotations.Mapper; + +@DS("master") +@Mapper +public interface WxNursingPlanJoinMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanJoinProgressDetailMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanJoinProgressDetailMapper.java new file mode 100644 index 0000000..32fe40e --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanJoinProgressDetailMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.target.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.target.domain.WxNursingPlanJoinProgressDetail; +import org.apache.ibatis.annotations.Mapper; + +@DS("master") +@Mapper +public interface WxNursingPlanJoinProgressDetailMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanJoinProgressMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanJoinProgressMapper.java new file mode 100644 index 0000000..412ac55 --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanJoinProgressMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.target.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.target.domain.WxNursingPlanJoinProgress; +import org.apache.ibatis.annotations.Mapper; + +@DS("master") +@Mapper +public interface WxNursingPlanJoinProgressMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanMapper.java new file mode 100644 index 0000000..a1e5e0d --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.target.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.target.domain.WxNursingPlan; +import org.apache.ibatis.annotations.Mapper; + +@DS("master") +@Mapper +public interface WxNursingPlanMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanTagMapper.java b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanTagMapper.java new file mode 100644 index 0000000..775900f --- /dev/null +++ b/flossom-transfer/src/main/java/com/flossom/transfer/target/mapper/WxNursingPlanTagMapper.java @@ -0,0 +1,11 @@ +package com.flossom.transfer.target.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.flossom.transfer.target.domain.WxNursingPlanTag; +import org.apache.ibatis.annotations.Mapper; + +@DS("master") +@Mapper +public interface WxNursingPlanTagMapper extends BaseMapper { +} diff --git a/flossom-transfer/src/main/resources/application.yml b/flossom-transfer/src/main/resources/application.yml new file mode 100644 index 0000000..091c43d --- /dev/null +++ b/flossom-transfer/src/main/resources/application.yml @@ -0,0 +1,27 @@ +server: + port: 8087 + +spring: + application: + name: flossom-transfer + datasource: + dynamic: + primary: master #设置默认的数据源或者数据源组,默认值即为master + strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源 + datasource: + master: + driver-class-name: com.mysql.cj.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 + url: jdbc:mysql://110.41.134.131:3306/uat-flossom2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: YQGZxh#m0ss + type: com.alibaba.druid.pool.DruidDataSource + slave: + driver-class-name: com.mysql.cj.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 + url: jdbc:mysql://110.41.134.131:3306/pro-flossom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: YQGZxh#m0ss + type: com.alibaba.druid.pool.DruidDataSource + +mybatis-plus: + type-aliases-package: com.flossom.transfer.*.domain + mapper-locations: classpath:mapper/*.xml diff --git a/flossom-transfer/src/test/java/com/flossom/transfer/DaoTransferTest.java b/flossom-transfer/src/test/java/com/flossom/transfer/DaoTransferTest.java new file mode 100644 index 0000000..5643d34 --- /dev/null +++ b/flossom-transfer/src/test/java/com/flossom/transfer/DaoTransferTest.java @@ -0,0 +1,30 @@ +package com.flossom.transfer; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.flossom.transfer.original.mapper.HzActivityMapper; +import com.flossom.transfer.target.mapper.WxNursingPlanMapper; +import lombok.extern.log4j.Log4j2; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@Log4j2 +@RunWith(SpringRunner.class) +@SpringBootTest +public class DaoTransferTest { + + @Autowired + private HzActivityMapper hzActivityMapper; + @Autowired + private WxNursingPlanMapper wxNursingPlanMapper; + + @Test + public void db_test(){ + long count = hzActivityMapper.selectCount(new QueryWrapper<>()); + long _count =wxNursingPlanMapper.selectCount(new QueryWrapper<>()); + log.info("输出="+count); + log.info("输出="+_count); + } +} diff --git a/flossom-ui/dist.zip b/flossom-ui/dist.zip new file mode 100644 index 0000000..8052a2a Binary files /dev/null and b/flossom-ui/dist.zip differ diff --git a/flossom-ui/src/api/system/mode.js b/flossom-ui/src/api/system/mode.js index cb73ad5..06f3662 100644 --- a/flossom-ui/src/api/system/mode.js +++ b/flossom-ui/src/api/system/mode.js @@ -54,10 +54,4 @@ export function delMode(id) { } //获取仪器与模式的标签树 -export function instrumentModeTree(query){ - return request({ - url: '/system/mode/instrumentModeTree', - method: 'get', - params: query - }) -} + diff --git a/flossom-ui/src/api/system/nursingLog.js b/flossom-ui/src/api/system/nursingLog.js index 94b0dae..225e9bc 100644 --- a/flossom-ui/src/api/system/nursingLog.js +++ b/flossom-ui/src/api/system/nursingLog.js @@ -44,19 +44,21 @@ export function delNursingLog(id) { } // 全量添加小程序标签 -export function allAddMiniProgramTag(tagIdList, data) { +export function allAddMiniProgramTag(tagIdList, data,timeout =60 * 10000) { return request({ url: '/system/nursingLog/allAddMiniProgramTag?tagIdList=' + tagIdList, method: 'post', - data: data + data: data,timeout + }) } // 全量删除小程序标签 -export function allDelMiniProgramTag(tagIdList, data) { +export function allDelMiniProgramTag(tagIdList, data,timeout =60 * 10000 ) { return request({ url: '/system/nursingLog/allDelMiniProgramTag?tagIdList=' + tagIdList, method: 'post', - data: data + data: data, + timeout }) } diff --git a/flossom-ui/src/api/system/nursingPlan.js b/flossom-ui/src/api/system/nursingPlan.js index a67bc82..5365cee 100644 --- a/flossom-ui/src/api/system/nursingPlan.js +++ b/flossom-ui/src/api/system/nursingPlan.js @@ -1,128 +1,141 @@ -import request from '@/utils/request' +import request from "@/utils/request"; // 查询护理计划列表 export function listNursingPlan(query) { return request({ - url: '/system/nursingPlan/listRet', - method: 'get', - params: query - }) + url: "/system/nursingPlan/listRet", + method: "get", + params: query, + }); } // 查询护理计划详细 export function getNursingPlan(id) { return request({ - url: '/system/nursingPlan/' + id, - method: 'get' - }) + url: "/system/nursingPlan/" + id, + method: "get", + }); } // 新增护理计划 export function addNursingPlan(data) { return request({ - url: '/system/nursingPlan', - method: 'post', - data: data - }) + url: "/system/nursingPlan", + method: "post", + data: data, + }); } // 修改护理计划 export function updateNursingPlan(data) { return request({ - url: '/system/nursingPlan', - method: 'put', - data: data - }) + url: "/system/nursingPlan", + method: "put", + data: data, + }); } export function updateNursingPlanOrderNum(data) { return request({ - url: '/system/nursingPlan/editOrderNum?id='+data.id+"&orderNum="+data.orderNum, - method: 'put' - }) + url: + "/system/nursingPlan/editOrderNum?id=" + + data.id + + "&orderNum=" + + data.orderNum, + method: "put", + }); } // 删除护理计划 export function delNursingPlan(id) { return request({ - url: '/system/nursingPlan/' + id, - method: 'delete' - }) + url: "/system/nursingPlan/" + id, + method: "delete", + }); } // 修改护理计划的状态 export function updateNursingPlanStatus(data) { return request({ - url: '/system/nursingPlan/editStatus?id='+data.id+"&status="+data.status, - method: 'put' - }) + url: + "/system/nursingPlan/editStatus?id=" + data.id + "&status=" + data.status, + method: "put", + }); } // 查询护理计划日程列表 export function listCycle(query) { return request({ - url: '/system/nursingPlan/cycle/listAll', - method: 'get', - params: query - }) + url: "/system/nursingPlan/cycle/listAll", + method: "get", + params: query, + }); } // 查询护理计划日程详细 export function getCycle(id) { return request({ - url: '/system/nursingPlan/cycle/' + id, - method: 'get' - }) + url: "/system/nursingPlan/cycle/" + id, + method: "get", + }); } // 新增护理计划日程 export function addCycle(data) { return request({ - url: '/system/nursingPlan/cycle', - method: 'post', - data: data - }) + url: "/system/nursingPlan/cycle", + method: "post", + data: data, + }); } // 修改护理计划日程 export function updateCycle(data) { return request({ - url: '/system/nursingPlan/cycle', - method: 'put', - data: data - }) + url: "/system/nursingPlan/cycle", + method: "put", + data: data, + }); } // 删除护理计划日程 export function delCycle(id) { return request({ - url: '/system/nursingPlan/cycle/' + id, - method: 'delete' - }) + url: "/system/nursingPlan/cycle/" + id, + method: "delete", + }); } // 查询护理计划日程详情列表 export function listDetail(query) { return request({ - url: '/system/nursingPlan/cycle/detail/list', - method: 'get', - params: query - }) + url: "/system/nursingPlan/cycle/detail/list", + method: "get", + params: query, + }); } // 查询护理计划日程详情详细 export function getDetail(id) { return request({ - url: '/system/nursingPlan/cycle/detail/' + id, - method: 'get' - }) + url: "/system/nursingPlan/cycle/detail/" + id, + method: "get", + }); } // 新增护理计划日程详情 export function batchAddDetail(data) { return request({ - url: '/system/nursingPlan/cycle/detail/batchAdd', - method: 'post', - data: data + url: "/system/nursingPlan/cycle/detail/batchAdd", + method: "post", + data: data, + }); +} + +export function instrumentModeTree(query){ + return request({ + url: '/system/nursingPlan/instrumentModeTree', + method: 'get', + params: query }) } diff --git a/flossom-ui/src/views/system/firing/index.vue b/flossom-ui/src/views/system/firing/index.vue index f156af7..47a18c2 100644 --- a/flossom-ui/src/views/system/firing/index.vue +++ b/flossom-ui/src/views/system/firing/index.vue @@ -11,7 +11,7 @@ width="337px" height="600px" > - +
@@ -26,9 +26,9 @@ :on-success="handleFileSuccess" drag > - +
将文件拖到此处,或点击上传
-
请上传视频,用于启动页显示,比例建议为16: 9
+
请上传视频,用于启动页显示,比例建议为16: 9
-
-
+
+
-
+
@@ -56,12 +56,12 @@ :on-success="handleFileSuccess" drag > - +
将文件拖到此处,或点击上传
-
请上传启动页介绍图片,建议尺寸为330px*460px
+
请上传启动页介绍图片,建议尺寸为330px*460px
-
+
@@ -77,7 +77,7 @@
@@ -85,7 +85,7 @@
-
+
@@ -101,9 +101,9 @@ :on-success="handleFileSuccess" drag > - +
将文件拖到此处,或点击上传
-
请上传登录页背景图片,建议尺寸为375px*471px
+
请上传登录页背景图片,建议尺寸为375px*471px
@@ -111,15 +111,14 @@ -
diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index a92bf90..8b7bd47 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -41,10 +41,13 @@ icon="el-icon-search" size="mini" @click="handleQuery" - >搜索 + >搜索 - 重置 + 重置 @@ -58,7 +61,7 @@ icon="el-icon-plus" size="mini" @click="handleAdd" - >新增 + >新增 @@ -129,9 +132,9 @@ 编辑 + >编辑 设置外部可见标签 + >设置外部可见标签 隐藏 + >隐藏 解除隐藏 + >解除隐藏 @@ -309,7 +312,7 @@ class="el-upload-list__item-thumbnail" :src="file.url" alt="" - /> + > - + @@ -359,7 +362,7 @@ class="el-upload-list__item-thumbnail" :src="file.url" alt="" - /> + > - + @@ -409,7 +412,7 @@ class="el-upload-list__item-thumbnail" :src="file.url" alt="" - /> + > - + - + 删除膜布 + >删除膜布 排序 + >排序 @@ -663,13 +665,13 @@ 排序 + >排序 @@ -739,8 +741,11 @@ - 添加规则 + 添加规则 + > 上传文件 + >上传文件 @@ -814,8 +822,11 @@ - 添加介绍 + 添加介绍 + > 上传文件 + >上传文件 @@ -1244,8 +1258,10 @@ @@ -1294,8 +1310,7 @@ type="primary" icon="el-icon-add" @click="addInstrumentNameline()" - >新增 + >新增 保存 + >保存 删除 + >删除 @@ -1343,7 +1357,7 @@ type="primary" icon="el-icon-add" @click="addInstrumentInstructionLine()" - >添加说明书 + >添加说明书 点击上传 + >点击上传 @@ -1409,37 +1422,37 @@ size="mini" type="text" @click="copyInstructionNameUrl(scope.row)" - >复制说明书 + >复制说明书 查看说明书 + >查看说明书 -
+
保存说明书 + >保存说明书 删除说明书 + >删除说明书
- 取 消 + 取 消 确 定 @@ -1455,8 +1468,7 @@
@@ -1477,8 +1489,7 @@
@@ -1510,54 +1521,54 @@ import { updateInstructions, listAllMode, addInstrumentTag, - listInstrumentTag, -} from "@/api/system/instrument"; -import { getToken } from "@/utils/auth"; -import Treeselect from "@riophae/vue-treeselect"; -import "@riophae/vue-treeselect/dist/vue-treeselect.css"; -import { listLining } from "@/api/system/lining"; -import { upload } from "@/api/upload"; - -import draggable from "vuedraggable"; -import log from "@/views/monitor/job/log.vue"; + listInstrumentTag +} from '@/api/system/instrument' +import { getToken } from '@/utils/auth' +import Treeselect from '@riophae/vue-treeselect' +import '@riophae/vue-treeselect/dist/vue-treeselect.css' +import { listLining } from '@/api/system/lining' +import { upload } from '@/api/upload' + +import draggable from 'vuedraggable' +import log from '@/views/monitor/job/log.vue' const validateArrayNotEmpty = (rule, value, callback) => { - console.log(rule, value, callback, "查看"); + console.log(rule, value, callback, '查看') if (this.wxLiningList.length === 0) { - callback(new Error("数组不能为空")); + callback(new Error('数组不能为空')) } else { - callback(); + callback() } -}; +} export default { - name: "Instrument", + name: 'Instrument', components: { Treeselect, draggable }, - dicts: ["instrument_model"], + dicts: ['instrument_model'], props: { // 大小限制(MB) imageFileSize: { type: Number, - default: 5, + default: 5 }, imageFileType: { type: Array, - default: () => ["bmp", "gif", "jpg", "jpeg", "png"], + default: () => ['bmp', 'gif', 'jpg', 'jpeg', 'png'] }, videoFileSize: { type: Number, - default: 10, + default: 10 }, videoFileType: { type: Array, - default: () => ["mp4", "avi", "rmvb"], + default: () => ['mp4', 'avi', 'rmvb'] }, pdfFileSize: { type: Number, - default: 10, + default: 10 }, pdfFileType: { type: Array, - default: () => ["pdf", "PDF"], - }, + default: () => ['pdf', 'PDF'] + } }, data() { return { @@ -1576,7 +1587,7 @@ export default { // 仪器列表格数据 instrumentList: [], // 弹出层标题 - title: "", + title: '', // 是否显示弹出层 open: false, // 查询参数 @@ -1585,90 +1596,90 @@ export default { pageSize: 10, id: null, name: null, - type: null, + type: null }, /* 文件上传地址 */ - uploadUrl: process.env.VUE_APP_BASE_API + "/file/upload", + uploadUrl: process.env.VUE_APP_BASE_API + '/file/upload', headers: { - Authorization: "Bearer " + getToken(), + Authorization: 'Bearer ' + getToken() }, /* 仪器封面 */ bannerFile: { uploadHide: false, - dialogImageUrl: "", + dialogImageUrl: '', dialogVisible: false, disabled: false, - fileList: [], + fileList: [] }, /* 仪器logo */ logoFile: { uploadHide: false, - dialogImageUrl: "", + dialogImageUrl: '', dialogVisible: false, disabled: false, - fileList: [], + fileList: [] }, /* 序列号图片 */ serialFile: { uploadHide: false, - dialogImageUrl: "", + dialogImageUrl: '', dialogVisible: false, disabled: false, - fileList: [], + fileList: [] }, /* 手写绑定介绍视频/图片 */ manualFile: { uploadHide: false, - fileList: [], + fileList: [] }, /* 扫码绑定介绍视频/图片 */ scanFile: { uploadHide: false, - fileList: [], + fileList: [] }, /* iot升级数据文件 */ iotUpgradeFile: { uploadHide: false, - fileList: [], + fileList: [] }, /* we200iot升级数据文件 */ we200IotUpgradeFile: { uploadHide: false, - fileList: [], + fileList: [] }, /* 蓝牙连接文件 */ bluetoothConnectFile: { uploadHide: false, - fileList: [], + fileList: [] }, /* 蓝牙断开连接文件 */ bluetoothConnectFailFile: { uploadHide: false, - fileList: [], + fileList: [] }, /* 蓝牙断开连接文件 */ bluetoothClosedFile: { uploadHide: false, - fileList: [], + fileList: [] }, /* 蓝牙连接文件 */ we200BluetoothConnectFile: { uploadHide: false, - fileList: [], + fileList: [] }, /* 小程序可见标签 */ miniProgramTag: { instrumentId: null, selectTagList: null, visible: false, - optionTree: [], + optionTree: [] }, /* 企微可见标签 */ wecomTag: { instrumentId: null, selectTagList: null, visible: false, - optionTree: [], + optionTree: [] }, // 表单参数 form: {}, @@ -1680,49 +1691,49 @@ export default { NewOptions: [], // 表单校验 rules: { - sortNo: [{ required: true, message: "排序不能为空", trigger: "blur" }], - banner: [{ required: true, message: "仪器封面不能为空" }], - logo: [{ required: true, message: "仪器logo不能为空" }], - serial: [{ required: true, message: "序列号图片不能为空" }], + sortNo: [{ required: true, message: '排序不能为空', trigger: 'blur' }], + banner: [{ required: true, message: '仪器封面不能为空' }], + logo: [{ required: true, message: '仪器logo不能为空' }], + serial: [{ required: true, message: '序列号图片不能为空' }], name: [ - { required: true, message: "仪器名称不能为空", trigger: "blur" }, + { required: true, message: '仪器名称不能为空', trigger: 'blur' } ], guarantee: [ - { required: true, message: "请选择保修日期", trigger: "blur" }, + { required: true, message: '请选择保修日期', trigger: 'blur' } ], dailyClockCredit: [ { required: true, - message: "日常打卡奖励积分不能为空", - trigger: "blur", - }, + message: '日常打卡奖励积分不能为空', + trigger: 'blur' + } ], isExtraClock: [ - { required: true, message: "请选择是否开启额外打卡奖励" }, + { required: true, message: '请选择是否开启额外打卡奖励' } ], bindingCredit: [ { required: true, - message: "仪器绑定奖励积分", - trigger: "blur", - }, + message: '仪器绑定奖励积分', + trigger: 'blur' + } ], extraClockCredit: [ { required: true, - message: "额外打卡奖励积分不能为空", - trigger: "blur", - }, + message: '额外打卡奖励积分不能为空', + trigger: 'blur' + } ], extraClockTimeRange: [ { required: true, - message: "额外打卡时间段不能为空", - trigger: "blur", - }, + message: '额外打卡时间段不能为空', + trigger: 'blur' + } ], type: [ - { required: true, message: "仪器类型不能为空", trigger: "change" }, + { required: true, message: '仪器类型不能为空', trigger: 'change' } ], /* FilmClothName: [ { required: true, message: '请选择膜布名称', trigger: 'change' } @@ -1732,53 +1743,53 @@ export default { // { validator: validateArrayNotEmpty, trigger: 'change' } ],*/ model: [ - { required: true, message: "仪器型号不能为空", trigger: "change" }, + { required: true, message: '仪器型号不能为空', trigger: 'change' } ], modeIdsValue: [ - { required: true, message: "仪器模式不能为空", trigger: "change" }, + { required: true, message: '仪器模式不能为空', trigger: 'change' } ], nursingTime: [ { required: true, - message: "生成护理记录最短时长不能为空", - trigger: "change", - }, + message: '生成护理记录最短时长不能为空', + trigger: 'change' + } ], - isPurchase: [{ required: true, message: "是否支持购买" }], + isPurchase: [{ required: true, message: '是否支持购买' }], shoppingAppid: [ - { required: true, message: "购买商城APPID不能为空", trigger: "blur" }, + { required: true, message: '购买商城APPID不能为空', trigger: 'blur' } ], shoppingPath: [ - { required: true, message: "购买商城PATH不能为空", trigger: "blur" }, - ], + { required: true, message: '购买商城PATH不能为空', trigger: 'blur' } + ] }, /** 初次护理规则 */ nurseIndex: 0, nurseList: [ { - file: "", - fileType: "", - message: "", - }, + file: '', + fileType: '', + message: '' + } ], /** 仪器介绍规则 */ introduceIndex: 0, introduceList: [ { - file: "", - fileType: "", - message: "", - }, + file: '', + fileType: '', + message: '' + } ], /* 正品控商品名 */ instrumentName: { visible: false, instrumentId: null, - nameForm: [], + nameForm: [] }, // 预览弹窗 - previewSrc: "", // 预览地址 + previewSrc: '', // 预览地址 isPreviewVideo: true, // 预览开关 /* 仪器说明书 */ instrumentInstructions: { @@ -1791,9 +1802,9 @@ export default { instrumentId: null, name: null, link: null, - save: false, - }, - ], + save: false + } + ] }, /* 模式 */ mode: { @@ -1801,61 +1812,61 @@ export default { modeSortVisible2: false, modeIdsValueTemp: [], modeIdsOptions: [], - sortMode: [], + sortMode: [] }, sortIndex: 0, newModeOptionList: [], innerVisible: false, - innerImg: "", - innerVideo: "", - }; + innerImg: '', + innerVideo: '' + } }, created() { - this.getList(); + this.getList() }, methods: { /** 查询仪器列列表 */ getList() { - this.loading = true; + this.loading = true listInstrument(this.queryParams) .then((response) => { - this.instrumentList = response.rows; - this.total = response.total; + this.instrumentList = response.rows + this.total = response.total }) .finally(() => { - this.loading = false; - }); + this.loading = false + }) }, // 取消按钮 cancel() { - this.open = false; - this.reset(); + this.open = false + this.reset() }, // 表单重置 reset() { - this.WEClothShow = false; - this.nurseIndex = 0; + this.WEClothShow = false + this.nurseIndex = 0 this.nurseList = [ { - file: "", - fileType: "", - message: "", - }, - ]; - this.introduceIndex = 0; + file: '', + fileType: '', + message: '' + } + ] + this.introduceIndex = 0 this.introduceList = [ { - file: "", - fileType: "", - message: "", - }, - ]; + file: '', + fileType: '', + message: '' + } + ] this.form = { id: null, name: null, type: 1, - model: "WL200", + model: 'WL200', banner: null, logo: null, serial: null, @@ -1872,7 +1883,7 @@ export default { wecomTagNames: null, sceneIds: null, sceneNames: null, - nursingTime: "00:00:00", + nursingTime: '00:00:00', iotVersion: null, iotVersionName: null, iotUpgradeData: null, @@ -1906,78 +1917,78 @@ export default { we200BluetoothConnectingTitle: null, we200BluetoothConnectingContent: null, wxLiningList: null, - colorCode: null, - }; + colorCode: null + } /* 仪器封面 */ this.bannerFile = { uploadHide: false, - dialogImageUrl: "", + dialogImageUrl: '', dialogVisible: false, disabled: false, - fileList: [], - }; + fileList: [] + } /* 仪器logo */ this.logoFile = { uploadHide: false, - dialogImageUrl: "", + dialogImageUrl: '', dialogVisible: false, disabled: false, - fileList: [], - }; + fileList: [] + } /* 序列号图片 */ this.serialFile = { uploadHide: false, - dialogImageUrl: "", + dialogImageUrl: '', dialogVisible: false, disabled: false, - fileList: [], - }; + fileList: [] + } /* 手写绑定介绍视频/图片 */ this.manualFile = { uploadHide: false, - fileList: [], - }; + fileList: [] + } /* 扫码绑定介绍视频/图片 */ this.scanFile = { uploadHide: false, - fileList: [], - }; + fileList: [] + } /* iot升级数据文件 */ this.iotUpgradeFile = { uploadHide: false, - fileList: [], - }; + fileList: [] + } /* 蓝牙连接文件 */ this.bluetoothConnectFile = { uploadHide: false, - fileList: [], - }; + fileList: [] + } /* 蓝牙连接失败文件 */ this.bluetoothConnectFailFile = { uploadHide: false, - fileList: [], - }; + fileList: [] + } /* 蓝牙断开连接文件 */ this.bluetoothClosedFile = { uploadHide: false, - fileList: [], - }; + fileList: [] + } /* 模式 */ this.mode = { modeSortVisible: false, modeSortVisible2: false, modeIdsValueTemp: [], modeIdsOptions: [], - sortMode: [], - }; - this.newModeOptionList = []; - this.resetForm("form"); + sortMode: [] + } + this.newModeOptionList = [] + this.resetForm('form') }, /** 搜索按钮操作 */ handleQuery() { - this.queryParams.pageNum = 1; - this.getList(); + this.queryParams.pageNum = 1 + this.getList() }, /** 重置按钮操作 */ resetQuery() { @@ -1986,150 +1997,156 @@ export default { pageSize: 10, id: null, name: null, - type: null, - }; - this.resetForm("queryForm"); - this.handleQuery(); + type: null + } + this.resetForm('queryForm') + this.handleQuery() }, // 多选框选中数据 handleSelectionChange(selection) { - this.ids = selection.map((item) => item.id); - this.single = selection.length !== 1; - this.multiple = !selection.length; + this.ids = selection.map((item) => item.id) + this.single = selection.length !== 1 + this.multiple = !selection.length }, /** 新增按钮操作 */ handleAdd() { - this.wxLiningList = []; - this.Modetions = []; - this.NewOptions = []; - this.ClothOptions = []; + this.wxLiningList = [] + this.Modetions = [] + this.NewOptions = [] + this.ClothOptions = [] // debugger - this.reset(); - this.open = true; - this.title = "添加仪器列"; + this.reset() + this.open = true + this.title = '添加仪器列' /* 所有模式选项 */ - this.mode.modeIdsOptions = []; + this.mode.modeIdsOptions = [] listAllMode({ - instrumentType: this.form.type, + instrumentType: this.form.type }).then((response) => { if (response.code != 200) { - this.$message.error("模式获取失败"); + this.$message.error('模式获取失败') } if (response.data.length > 0) { response.data.map((item) => { if (item.modeDesc != null) { - item.modeName = item.modeName + "(" + item.modeDesc + ")"; + item.modeName = item.modeName + '(' + item.modeDesc + ')' } - }); - this.mode.modeIdsOptions = response.data; + }) + this.mode.modeIdsOptions = response.data } - }); + }) listLining().then((e) => { e.rows.forEach((item) => { this.ClothOptions.push({ value: item.id, - label: item.name, - }); - }); - console.log(this.ClothOptions, "111111"); - }); + label: item.name + }) + }) + console.log(this.ClothOptions, '111111') + }) }, /** 修改按钮操作 */ handleUpdate(row) { - this.wxLiningList = []; - this.Modetions = []; - this.NewOptions = []; - this.ClothOptions = []; - this.loading = true; - this.reset(); - const id = row.id || this.ids; + this.wxLiningList = [] + this.Modetions = [] + this.NewOptions = [] + this.ClothOptions = [] + this.loading = true + this.reset() + const id = row.id || this.ids getInstrument(id).then((response) => { - console.log(response, 555555555555555); - this.loading = false; - if (response.data.model === "WE200") { - this.WEClothShow = true; - this.wxLiningList = response.data.wxLiningList; + console.log(response, 555555555555555) + this.loading = false + if (response.data.model === 'WE200') { + this.WEClothShow = true + this.wxLiningList = response.data.wxLiningList } - this.form = response.data; + this.form = response.data // 仪器封面回显 this.bannerFile = { uploadHide: true, dialogImageUrl: this.form.banner, dialogVisible: false, disabled: false, - fileList: [{ name: "", url: this.form.banner }], - }; + fileList: [{ name: '', url: this.form.banner }] + } /* 仪器logo */ this.logoFile = { uploadHide: true, dialogImageUrl: this.form.logo, dialogVisible: false, disabled: false, - fileList: [{ name: "", url: this.form.logo }], - }; + fileList: [{ name: '', url: this.form.logo }] + } /* 序列号图片 */ this.serialFile = { uploadHide: true, dialogImageUrl: this.form.serial, dialogVisible: false, disabled: false, - fileList: [{ name: "", url: this.form.serial }], - }; + fileList: [{ name: '', url: this.form.serial }] + } /* 手写绑定介绍视频/图片 */ if (this.form.manualCodeBinding != null) { this.manualFile = { uploadHide: true, fileList: [ { - name: "手写绑定介绍视频/图片", - url: this.form.manualCodeBinding, - }, - ], - }; + name: '手写绑定介绍视频/图片', + url: this.form.manualCodeBinding + } + ] + } } /* 扫码绑定介绍视频/图片 */ if (this.form.scanCodeBinding != null) { this.scanFile = { uploadHide: true, fileList: [ - { name: "扫码绑定介绍视频/图片", url: this.form.scanCodeBinding }, - ], - }; + { name: '扫码绑定介绍视频/图片', url: this.form.scanCodeBinding } + ] + } } /* iot升级数据文件 */ if ( this.form.iotUpgradeData != null && - this.form.iotUpgradeData != "" + this.form.iotUpgradeData != '' ) { this.iotUpgradeFile = { uploadHide: true, fileList: [ { - name: this.form.iotUpgradeData - ? this.form.iotVersionName || "iot升级数据文件" - : "", - url: this.form.iotUpgradeData, - }, - ], - }; + name: this.form.iotUpgradeData != null && + this.form.iotUpgradeData != '' + ? this.form.iotVersionName || 'iot升级数据文件' + : '', + url: this.form.iotUpgradeData ? this.form.iotUpgradeData : null + } + ] + } } // /* WE200IOT升级数据文件 */ if ( this.form.we200IotUpgradeData != null && - this.form.we200IotUpgradeData != "" + this.form.we200IotUpgradeData != '' ) { + console.log(this.form.we200IotVersionName, 111111111) this.we200IotUpgradeFile = { uploadHide: true, fileList: [ { - name: this.form.we200iotUpgradeData - ? this.form.we200IotVersionName || "We200iot升级数据文件" - : "", - url: this.form.we200IotUpgradeData, - }, - ], - }; + name: this.form.we200IotUpgradeData != null && + this.form.we200IotUpgradeData != '' + ? this.form.we200IotVersionName || 'We200iot升级数据文件' + : '', + url: this.form.we200IotUpgradeData ? this.form.we200IotUpgradeData : null + } + ] + } + console.log(this.we200IotUpgradeFile, 2222222222) + }else{ + } /* 蓝牙连接文件 */ @@ -2137,27 +2154,27 @@ export default { this.bluetoothConnectFile = { uploadHide: true, fileList: [ - { name: "蓝牙连接文件", url: this.form.bluetoothConnecting }, - ], - }; + { name: '蓝牙连接文件', url: this.form.bluetoothConnecting } + ] + } } /* 蓝牙连接失败文件 */ if (this.form.bluetoothConnectFail != null) { this.bluetoothConnectFailFile = { uploadHide: true, fileList: [ - { name: "蓝牙连接失败文件", url: this.form.bluetoothConnectFail }, - ], - }; + { name: '蓝牙连接失败文件', url: this.form.bluetoothConnectFail } + ] + } } /* 蓝牙断开连接文件 */ if (this.form.bluetoothClosed != null) { this.bluetoothClosedFile = { uploadHide: false, fileList: [ - { name: "蓝牙断开连接文件", url: this.form.bluetoothClosed }, - ], - }; + { name: '蓝牙断开连接文件', url: this.form.bluetoothClosed } + ] + } } /* we200蓝牙连接文件 */ if (this.form.we200BluetoothConnecting != null) { @@ -2165,48 +2182,48 @@ export default { uploadHide: true, fileList: [ { - name: "we200蓝牙连接文件", - url: this.form.we200BluetoothConnecting, - }, - ], - }; + name: 'we200蓝牙连接文件', + url: this.form.we200BluetoothConnecting + } + ] + } } // 额外打卡时间 if (this.form.isExtraClock == 1) { - this.form.extraClockTimeRange = response.data.extraClockTimeRange; + this.form.extraClockTimeRange = response.data.extraClockTimeRange } - this.open = true; - this.title = "修改仪器列"; + this.open = true + this.title = '修改仪器列' /* 首次护理管理视频 */ if (response.data.nurseList != null) { - this.nurseIndex = response.data.nurseList.length; - this.nurseList = response.data.nurseList; + this.nurseIndex = response.data.nurseList.length + this.nurseList = response.data.nurseList } /* 仪器介绍视频 */ if (response.data.introduceList != null) { - this.introduceIndex = response.data.introduceList.length; - this.introduceList = response.data.introduceList; + this.introduceIndex = response.data.introduceList.length + this.introduceList = response.data.introduceList } /* 模式选项 */ - this.mode.modeIdsOptions = []; + this.mode.modeIdsOptions = [] listAllMode({ instrumentType: this.form.type, - instrumentModel: this.form.model, + instrumentModel: this.form.model }).then((response) => { if (response.code != 200) { - this.$message.error("模式获取失败"); + this.$message.error('模式获取失败') } if (response.data.length > 0) { response.data.map((item) => { if (item.modeDesc != null) { - item.modeName = item.modeName + "(" + item.modeDesc + ")"; + item.modeName = item.modeName + '(' + item.modeDesc + ')' } - }); - this.mode.modeIdsOptions = response.data; - this.Modetions = JSON.parse(JSON.stringify(response.data)); + }) + this.mode.modeIdsOptions = response.data + this.Modetions = JSON.parse(JSON.stringify(response.data)) } /* 带new标识选项回显 */ @@ -2214,336 +2231,344 @@ export default { this.form.modeIdsValue != null && this.form.modeIdsValue.length > 0 ) { - const temp = []; + const temp = [] for (let i = 0; i < this.form.modeIdsValue.length; i++) { const filterModeArr = this.mode.modeIdsOptions.filter( (item) => item !== undefined && this.form.modeIdsValue[i] === item.id - ); + ) if (filterModeArr !== undefined && filterModeArr.length > 0) { - temp.push(filterModeArr[0]); + temp.push(filterModeArr[0]) } } if (temp !== undefined && temp.length > 0) { - this.newModeOptionList = temp; + this.newModeOptionList = temp - this.NewOptions = JSON.parse(JSON.stringify(temp)); + this.NewOptions = JSON.parse(JSON.stringify(temp)) } } /* 带new标识选项回显 */ if (this.wxLiningList != null && this.wxLiningList.length > 0) { - const temp = []; + const temp = [] for (let j = 0; j < this.wxLiningList.length; j++) { for (let i = 0; i < this.wxLiningList[j].modeList.length; i++) { const filterModeArr = this.Modetions.filter( (item) => item !== undefined && this.wxLiningList[j].modeList[i] === item.id - ); + ) if (filterModeArr !== undefined && filterModeArr.length > 0) { - temp.push(filterModeArr[0]); + temp.push(filterModeArr[0]) } } } if (temp !== undefined && temp.length > 0) { // this.newModeOptionList = temp - this.NewOptions = JSON.parse(JSON.stringify(temp)); + this.NewOptions = JSON.parse(JSON.stringify(temp)) } } - }); + }) // IOT版本升级介绍 this.form.iotVersionUpgrade = decodeURIComponent( this.form.iotVersionUpgrade - ); + ) // WE200IOT版本升级介绍 this.form.we200IotVersionUpgrade = decodeURIComponent( this.form.we200IotVersionUpgrade - ); + ) listLining().then((e) => { e.rows.forEach((item) => { this.ClothOptions.push({ value: item.id, - label: item.name, - }); - }); - }); - console.log(this.ClothOptions, 333333333333333); - }); + label: item.name + }) + }) + }) + console.log(this.ClothOptions, 333333333333333) + }) }, /** 提交按钮 */ submitForm() { // 初次护理弹窗检验 for (let i = 0; i < this.nurseList.length; i++) { - if (this.nurseList[i].file != "" || this.nurseList[i].message != "") { - if (this.nurseList[i].file == "") { - this.$modal.msgError("请上传初次护理弹窗提示视频或图片"); - return; + if (this.nurseList[i].file != '' || this.nurseList[i].message != '') { + if (this.nurseList[i].file == '') { + this.$modal.msgError('请上传初次护理弹窗提示视频或图片') + return } - if (this.nurseList[i].message == "") { - this.$modal.msgError("请输入初次护理规则提示内容"); - return; + if (this.nurseList[i].message == '') { + this.$modal.msgError('请输入初次护理规则提示内容') + return } } } // 仪器介绍校验 for (let i = 0; i < this.introduceList.length; i++) { if ( - this.introduceList[i].file != "" || - this.introduceList[i].message != "" + this.introduceList[i].file != '' || + this.introduceList[i].message != '' ) { - if (this.introduceList[i].file == "") { - this.$modal.msgError("请上传仪器介绍弹窗提示视频或图片"); - return; + if (this.introduceList[i].file == '') { + this.$modal.msgError('请上传仪器介绍弹窗提示视频或图片') + return } - if (this.introduceList[i].message == "") { - this.$modal.msgError("请输入仪器介绍规则提示内容"); - return; + if (this.introduceList[i].message == '') { + this.$modal.msgError('请输入仪器介绍规则提示内容') + return } } } - this.form.nurseList = this.nurseList; - this.form.introduceList = this.introduceList; + this.form.nurseList = this.nurseList + this.form.introduceList = this.introduceList - if (this.form.model == "WE200") { + if (this.form.model == 'WE200') { if (this.wxLiningList.length == 0) { - this.$modal.msgError("请添加膜布"); - return; + this.$modal.msgError('请添加膜布') + return } - console.log("wxLiningList => ", this.wxLiningList); + console.log('wxLiningList => ', this.wxLiningList) if (this.wxLiningList.length > 0) { for (let i = 0; i < this.wxLiningList.length; i++) { - if (this.wxLiningList[i].id == "") { - this.$modal.msgError("请选择第" + (i + 1) + "组膜布组的膜布名称"); - return; + if (this.wxLiningList[i].id == '') { + this.$modal.msgError('请选择第' + (i + 1) + '组膜布组的膜布名称') + return } if (this.wxLiningList[i].modeList.length == 0) { - this.$modal.msgError("请选择第" + (i + 1) + "组膜布组的模式名称"); - return; + this.$modal.msgError('请选择第' + (i + 1) + '组膜布组的模式名称') + return } } - this.form.wxLiningList = this.wxLiningList; + this.form.wxLiningList = this.wxLiningList } } - console.log(this.form); - this.$refs["form"].validate((valid) => { + console.log(this.form) + this.$refs['form'].validate((valid) => { if (valid) { if (this.form.id != null) { updateInstrument(this.form).then((response) => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); + this.$modal.msgSuccess('修改成功') + this.open = false + this.getList() + }) } else { addInstrument(this.form).then((response) => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); + this.$modal.msgSuccess('新增成功') + this.open = false + this.getList() + }) } } - }); + }) }, /** 删除按钮操作 */ handleDelete(row) { - const ids = row.id; + const ids = row.id this.$modal .confirm('是否确认隐藏仪器列编号为"' + ids + '"的数据项?') - .then(function () { - return delInstrument(ids); + .then(function() { + return delInstrument(ids) }) .then(() => { - this.getList(); - this.$modal.msgSuccess("操作成功"); + this.getList() + this.$modal.msgSuccess('操作成功') }) - .catch(() => {}); + .catch(() => {}) }, /* 文件上传失败 */ uploadError() { - this.$message.error("文件上传失败"); + this.$message.error('文件上传失败') }, /** 仪器封面操作 */ bannerPicturePreview(file) { - this.bannerFile.dialogImageUrl = file.url; - this.bannerFile.dialogVisible = true; + this.bannerFile.dialogImageUrl = file.url + this.bannerFile.dialogVisible = true }, bannerUploadRemove(file) { - this.bannerFile.fileList = []; - this.bannerFile.uploadHide = this.bannerFile.fileList.length >= 1; + this.bannerFile.fileList = [] + this.bannerFile.uploadHide = this.bannerFile.fileList.length >= 1 }, bannerUploadChange(file, fileList) { - this.bannerFile.fileList = fileList; - this.bannerFile.uploadHide = this.bannerFile.fileList.length >= 1; + this.bannerFile.fileList = fileList + this.bannerFile.uploadHide = this.bannerFile.fileList.length >= 1 }, bannerUploadSuccess(response, file) { if (response.code == 200) { - this.form.banner = response.data.url; + this.form.banner = response.data.url } else { - this.$message.error("图片插入失败"); + this.$message.error('图片插入失败') } }, /** logo 操作 */ logoPicturePreview(file) { - this.logoFile.dialogImageUrl = file.url; - this.logoFile.dialogVisible = true; + this.logoFile.dialogImageUrl = file.url + this.logoFile.dialogVisible = true }, logoUploadRemove(file) { - this.logoFile.fileList = []; - this.logoFile.uploadHide = this.logoFile.fileList.length >= 1; + this.logoFile.fileList = [] + this.logoFile.uploadHide = this.logoFile.fileList.length >= 1 }, logoUploadChange(file, fileList) { - this.logoFile.fileList = fileList; - this.logoFile.uploadHide = this.logoFile.fileList.length >= 1; + this.logoFile.fileList = fileList + this.logoFile.uploadHide = this.logoFile.fileList.length >= 1 }, logoUploadSuccess(response, file) { - console.log(111111111111111, response); + console.log(111111111111111, response) if (response.code == 200) { - this.form.logo = response.data.url; + this.form.logo = response.data.url } else { - this.$message.error("图片插入失败"); + this.$message.error('图片插入失败') } }, /** 序列号图片 操作 */ serialPicturePreview(file) { - this.serialFile.dialogImageUrl = file.url; - this.serialFile.dialogVisible = true; + this.serialFile.dialogImageUrl = file.url + this.serialFile.dialogVisible = true }, serialUploadRemove(file) { - this.serialFile.fileList = []; - this.serialFile.uploadHide = this.serialFile.fileList.length >= 1; + this.serialFile.fileList = [] + this.serialFile.uploadHide = this.serialFile.fileList.length >= 1 }, serialUploadChange(file, fileList) { - this.serialFile.fileList = fileList; - this.serialFile.uploadHide = this.serialFile.fileList.length >= 1; + this.serialFile.fileList = fileList + this.serialFile.uploadHide = this.serialFile.fileList.length >= 1 }, serialUploadSuccess(response, file) { if (response.code == 200) { - this.form.serial = response.data.url; + this.form.serial = response.data.url } else { - this.$message.error("文件上传失败"); + this.$message.error('文件上传失败') } }, /** 手写绑定介绍视频/图片 操作 */ manualUploadExceed(files, fileList) { - console.log(files, fileList); - this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`); + console.log(files, fileList) + this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`) }, manualUploadSuccess(response, file) { if (response.code == 200) { - this.manualFile.fileList = []; + this.manualFile.fileList = [] this.manualFile.fileList.push({ name: response.data.name, - url: response.data.url, - }); - this.form.manualCodeBinding = response.data.url; + url: response.data.url + }) + this.form.manualCodeBinding = response.data.url } else { - this.$message.error("文件上传失败"); + this.$message.error('文件上传失败') } }, /** 扫码绑定介绍视频/图片 操作 */ scanUploadExceed(files, fileList) { - this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`); + this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`) }, scanUploadSuccess(response, file) { if (response.code == 200) { - this.scanFile.fileList = []; + this.scanFile.fileList = [] this.scanFile.fileList.push({ name: response.data.name, - url: response.data.url, - }); - this.form.scanCodeBinding = response.data.url; + url: response.data.url + }) + this.form.scanCodeBinding = response.data.url } else { - this.$message.error("文件上传失败"); + this.$message.error('文件上传失败') } }, /* iot升级数据文件 */ iotUpgradeUploadExceed(files, fileList) { - this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`); + this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`) }, iotUpgradeUploadSuccess(response, file) { - console.log("iotUpgradeUploadSuccess file", file); + console.log('iotUpgradeUploadSuccess file', file) if (response.code == 200) { - this.form.iotUpgradeData = response.data.url; - this.form.iotVersionName = file.name; + this.form.iotUpgradeData = response.data.url + this.form.iotVersionName = file.name } else { - this.$message.error("文件上传失败"); + this.$message.error('文件上传失败') } }, iotUpgradeRemove(file, fileList) { - this.form.iotUpgradeData = ""; - this.form.iotVersionName = ""; + this.form.iotUpgradeData = '' + this.form.iotVersionName = '' + this.IotUpgradeFile = { + uploadHide: false, + fileList: [] + } }, we200iotUpgradeRemove(file, fileList) { - this.form.we200IotUpgradeData = ""; - this.form.we200IotVersionName = ""; + this.form.we200IotUpgradeData = '' + this.form.we200IotVersionName = '' + this.we200IotUpgradeFile = { + uploadHide: false, + fileList: [] + } }, /* iot升级数据文件 */ we200IotUpgradeUploadExceed(files, fileList) { - this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`); + this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`) }, we200IotUpgradeUploadSuccess(response, file) { if (response.code == 200) { - this.form.we200IotUpgradeData = response.data.url; - this.form.we200IotVersionName = file.name; + this.form.we200IotUpgradeData = response.data.url + this.form.we200IotVersionName = file.name } else { - this.$message.error("文件上传失败"); + this.$message.error('文件上传失败') } }, /* 蓝牙连接图片 */ bluetoothConnectUploadExceed(files, fileList) { - this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`); + this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`) }, bluetoothConnectUploadSuccess(response, file) { if (response.code == 200) { - this.form.bluetoothConnecting = response.data.url; + this.form.bluetoothConnecting = response.data.url } else { - this.$message.error("文件上传失败"); + this.$message.error('文件上传失败') } }, /* 蓝牙断开连接图片 */ bluetoothFailUploadExceed(files, fileList) { - this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`); + this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`) }, bluetoothFailUploadSuccess(response, file) { if (response.code == 200) { - this.form.bluetoothConnectFail = response.data.url; + this.form.bluetoothConnectFail = response.data.url } else { - this.$message.error("文件上传失败"); + this.$message.error('文件上传失败') } }, /* 蓝牙断开连接图片 */ bluetoothClosedUploadExceed(files, fileList) { - this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`); + this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`) }, bluetoothClosedUploadSuccess(response, file) { if (response.code == 200) { - this.form.bluetoothClosed = response.data.url; + this.form.bluetoothClosed = response.data.url } else { - this.$message.error("文件上传失败"); + this.$message.error('文件上传失败') } }, /* we200蓝牙连接图片 */ we200BluetoothConnectUploadExceed(files, fileList) { - this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`); + this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`) }, we200BluetoothConnectUploadSuccess(response, file) { if (response.code == 200) { - this.form.we200BluetoothConnecting = response.data.url; + this.form.we200BluetoothConnecting = response.data.url } else { - this.$message.error("文件上传失败"); + this.$message.error('文件上传失败') } }, /* 是否开启额外打卡奖励 */ isExtraClockChange() { if (this.form.isExtraClock == 0) { - this.form.extraClockCredit = 0; - this.form.extraClockTimeRange = []; + this.form.extraClockCredit = 0 + this.form.extraClockTimeRange = [] } }, /* 仪器类型切换 */ @@ -2584,303 +2609,303 @@ export default { // IOT仪器,模型默认 WL200 if (this.form.type == 2) { - console.log("进来了"); - this.form.model = "WL200"; + console.log('进来了') + this.form.model = 'WL200' } else { - this.form.model = null; + this.form.model = null } /* 模式选项 */ // 模式清空 - this.form.modeIdsValue = []; - this.modeIdsOptions = []; + this.form.modeIdsValue = [] + this.modeIdsOptions = [] // 带 new 标识模式清空 - this.form.newModeIdList = []; - this.newModeOptionList = []; + this.form.newModeIdList = [] + this.newModeOptionList = [] listAllMode({ instrumentType: this.form.type, - instrumentModel: this.form.model, + instrumentModel: this.form.model }).then((response) => { if (response.code != 200) { - this.$message.error("模式获取失败"); + this.$message.error('模式获取失败') } - this.mode.modeIdsOptions = response.data; - }); + this.mode.modeIdsOptions = response.data + }) // 仪器数据清空 // this.form.model = null - this.form.nursingTime = "00:00:00"; - this.form.bluetoothConnecting = null; - this.form.bluetoothConnectingTitle = null; - this.form.bluetoothConnectingContent = null; - this.form.bluetoothConnectFail = null; - this.form.bluetoothConnectFailTitle = null; - this.form.bluetoothConnectFailContent = null; - this.form.bluetoothClosed = null; - this.form.bluetoothClosedTitle = null; - this.form.bluetoothClosedContent = null; - this.form.iotVersion = null; - this.form.iotVersionName = null; - this.form.iotUpgradeData = null; - this.form.iotVersionUpgrade = null; + this.form.nursingTime = '00:00:00' + this.form.bluetoothConnecting = null + this.form.bluetoothConnectingTitle = null + this.form.bluetoothConnectingContent = null + this.form.bluetoothConnectFail = null + this.form.bluetoothConnectFailTitle = null + this.form.bluetoothConnectFailContent = null + this.form.bluetoothClosed = null + this.form.bluetoothClosedTitle = null + this.form.bluetoothClosedContent = null + this.form.iotVersion = null + this.form.iotVersionName = null + this.form.iotUpgradeData = null + this.form.iotVersionUpgrade = null /* we200数据清空 */ - this.form.we200IotVersion = null; - this.form.we200IotVersionName = null; - this.form.we200IotUpgradeData = null; + this.form.we200IotVersion = null + this.form.we200IotVersionName = null + this.form.we200IotUpgradeData = null this.form.we200IotVersionUpgrade = null; (this.we200BluetoothConnectFile = { uploadHide: false, - fileList: [], + fileList: [] }), - (this.form.we200BluetoothConnecting = null); - this.form.we200BluetoothConnectingTitle = null; - this.form.we200BluetoothConnectingContent = null; + (this.form.we200BluetoothConnecting = null) + this.form.we200BluetoothConnectingTitle = null + this.form.we200BluetoothConnectingContent = null // 仪器类型切换,关闭膜布选项 - this.WEClothShow = false; + this.WEClothShow = false // this.Modetions = []; // this.NewOptions = []; - this.wxLiningList = []; + this.wxLiningList = [] }, // 添加膜布 AddCloth() { this.wxLiningList.push({ - id: "", - modeList: "", - newModeIdList: "", - }); + id: '', + modeList: '', + newModeIdList: '' + }) }, // 删除膜布 delCloth(index) { - this.wxLiningList.splice(index, 1); + this.wxLiningList.splice(index, 1) }, modelChange() { - console.log(this.form, "查看列表"); - if (this.form.model === "WE200") { - this.WEClothShow = true; - this.wxLiningList = []; + console.log(this.form, '查看列表') + if (this.form.model === 'WE200') { + this.WEClothShow = true + this.wxLiningList = [] listAllMode({ instrumentType: this.form.type, - instrumentModel: this.form.model, + instrumentModel: this.form.model }).then((response) => { if (response.code != 200) { - this.$message.error("模式获取失败"); + this.$message.error('模式获取失败') } if (response.data.length > 0) { response.data.map((item) => { if (item.modeDesc != null) { - item.modeName = item.modeName + "(" + item.modeDesc + ")"; + item.modeName = item.modeName + '(' + item.modeDesc + ')' } - }); - this.Modetions = response.data; + }) + this.Modetions = response.data } - }); + }) } else { - this.WEClothShow = false; + this.WEClothShow = false // this.ClothOptions = [] // this.Modetions = [] // this.NewOptions = [] - this.wxLiningList = []; + this.wxLiningList = [] } /* 模式选项 */ - this.mode.modeIdsOptions = []; + this.mode.modeIdsOptions = [] // 清空模式和带new标识模式 // 模式清空 - this.form.modeIdsValue = []; - this.modeIdsOptions = []; + this.form.modeIdsValue = [] + this.modeIdsOptions = [] // 带 new 标识模式清空 - this.form.newModeIdList = []; - this.newModeOptionList = []; + this.form.newModeIdList = [] + this.newModeOptionList = [] // 获取对应模式 listAllMode({ instrumentType: this.form.type, - instrumentModel: this.form.model, + instrumentModel: this.form.model }).then((response) => { if (response.code != 200) { - this.$message.error("模式获取失败"); + this.$message.error('模式获取失败') } - this.mode.modeIdsOptions = response.data; - }); + this.mode.modeIdsOptions = response.data + }) /* 清空we200 对应的数据 */ - this.form.we200IotVersion = null; - this.form.we200IotUpgradeData = null; + this.form.we200IotVersion = null + this.form.we200IotUpgradeData = null this.form.we200IotVersionUpgrade = null; (this.we200BluetoothConnectFile = { uploadHide: false, - fileList: [], + fileList: [] }), - (this.form.we200BluetoothConnecting = null); - this.form.we200BluetoothConnectingTitle = null; - this.form.we200BluetoothConnectingContent = null; + (this.form.we200BluetoothConnecting = null) + this.form.we200BluetoothConnectingTitle = null + this.form.we200BluetoothConnectingContent = null }, /* 是否购买切换 */ isPurchaseChang() { if (this.form.isPurchase == 0) { - this.form.shoppingAppid = null; - this.form.shoppingPath = null; + this.form.shoppingAppid = null + this.form.shoppingPath = null } }, /* 设置小程序可见标签 */ editMiniProgramTags(row) { /* 小程序可见标签 */ - this.miniProgramTag.instrumentId = null; - this.miniProgramTag.selectTagList = null; + this.miniProgramTag.instrumentId = null + this.miniProgramTag.selectTagList = null // 小程序标签树 getMiniProgramTagTree().then((Response) => { - this.miniProgramTag.optionTree = Response.data; - this.miniProgramTag.visible = true; + this.miniProgramTag.optionTree = Response.data + this.miniProgramTag.visible = true if (row.miniTagIds != null && row.miniTagIds.length > 0) { this.miniProgramTag.selectTagList = row.miniTagIds - .split(",") - .map(Number); + .split(',') + .map(Number) } - this.miniProgramTag.instrumentId = row.id; + this.miniProgramTag.instrumentId = row.id listInstrumentTag({ instrumentId: row.id, - type: 1, + type: 1 }).then((res) => { if (res.code == 200 && res.data != null && res.data.length > 0) { this.miniProgramTag.selectTagList = res.data.map( (obj) => obj.tagId - ); + ) } - }); - }); + }) + }) }, /* 设置企微可见标签 */ editWecomTags(row) { - this.wecomTag.instrumentId = null; - this.wecomTag.selectTagList = null; + this.wecomTag.instrumentId = null + this.wecomTag.selectTagList = null // 外部标签树 getWecomTagTree().then((response) => { - this.wecomTag.optionTree = response.data; - this.wecomTag.visible = true; + this.wecomTag.optionTree = response.data + this.wecomTag.visible = true if (row.wecomTagIds != null && row.wecomTagIds.length > 0) { - this.wecomTag.selectTagList = row.wecomTagIds.split(",").map(Number); + this.wecomTag.selectTagList = row.wecomTagIds.split(',').map(Number) } - this.wecomTag.instrumentId = row.id; + this.wecomTag.instrumentId = row.id listInstrumentTag({ instrumentId: row.id, - type: 2, + type: 2 }).then((res) => { if (res.code == 200 && res.data != null && res.data.length > 0) { - this.wecomTag.selectTagList = res.data.map((obj) => obj.tagId); + this.wecomTag.selectTagList = res.data.map((obj) => obj.tagId) } - }); - }); + }) + }) }, /* 保存小程序标签 */ submitMiniProgramTagList() { addInstrumentTag({ instrumentId: this.miniProgramTag.instrumentId, tagIdList: this.miniProgramTag.selectTagList, - type: 1, + type: 1 }).then((response) => { - this.$modal.msgSuccess("操作成功"); - this.miniProgramTag.visible = false; - this.getList(); - }); + this.$modal.msgSuccess('操作成功') + this.miniProgramTag.visible = false + this.getList() + }) }, /* 保存外部标签 */ submitWecomTagList() { addInstrumentTag({ instrumentId: this.wecomTag.instrumentId, tagIdList: this.wecomTag.selectTagList, - type: 2, + type: 2 }).then((response) => { - this.$modal.msgSuccess("操作成功"); - this.wecomTag.visible = false; - this.getList(); - }); + this.$modal.msgSuccess('操作成功') + this.wecomTag.visible = false + this.getList() + }) }, /* 初次护理弹窗 */ addNurse() { this.nurseList.push({ - file: "", - fileType: "", - message: "", - }); + file: '', + fileType: '', + message: '' + }) }, handleNurseDelete(item) { - this.nurseList.splice(item.$index, 1); + this.nurseList.splice(item.$index, 1) }, addNurseFile(index) { - this.nurseIndex = index; - this.$refs.nurseFile.value = ""; - this.$refs.nurseFile.click(); + this.nurseIndex = index + this.$refs.nurseFile.value = '' + this.$refs.nurseFile.click() }, async nurseFileChange(e) { // 图片选中 - const files = e.target.files; + const files = e.target.files if (files.length) { - const data = await this.commonFileUpload(files[0]); - this.nurseList[this.nurseIndex].file = data.url; - const type = files[0].type; - const isImage = this.imageFileType.some((item) => type.includes(item)); + const data = await this.commonFileUpload(files[0]) + this.nurseList[this.nurseIndex].file = data.url + const type = files[0].type + const isImage = this.imageFileType.some((item) => type.includes(item)) if (isImage) { - this.nurseList[this.nurseIndex].fileType = "image"; + this.nurseList[this.nurseIndex].fileType = 'image' } else { - this.nurseList[this.nurseIndex].fileType = "video"; + this.nurseList[this.nurseIndex].fileType = 'video' } - this.nurseList = JSON.parse(JSON.stringify(this.nurseList)); + this.nurseList = JSON.parse(JSON.stringify(this.nurseList)) } }, /* 仪器介绍 */ addIntroduce() { this.introduceList.push({ - file: "", - fileType: "", - message: "", - }); + file: '', + fileType: '', + message: '' + }) }, handleIntroduceDelete(item) { - this.introduceList.splice(item.$index, 1); + this.introduceList.splice(item.$index, 1) }, addIntroduceFile(index) { - this.introduceIndex = index; - this.$refs.introduceFile.value = ""; - this.$refs.introduceFile.click(); + this.introduceIndex = index + this.$refs.introduceFile.value = '' + this.$refs.introduceFile.click() }, async introduceFileChange(e) { - const files = e.target.files; + const files = e.target.files // 图片选中 if (files.length) { - const data = await this.commonFileUpload(files[0]); - this.introduceList[this.introduceIndex].file = data.url; - const type = files[0].type; - const isImage = this.imageFileType.some((item) => type.includes(item)); + const data = await this.commonFileUpload(files[0]) + this.introduceList[this.introduceIndex].file = data.url + const type = files[0].type + const isImage = this.imageFileType.some((item) => type.includes(item)) if (isImage) { - this.introduceList[this.introduceIndex].fileType = "image"; + this.introduceList[this.introduceIndex].fileType = 'image' } else { - this.introduceList[this.introduceIndex].fileType = "video"; + this.introduceList[this.introduceIndex].fileType = 'video' } - this.introduceList = JSON.parse(JSON.stringify(this.introduceList)); + this.introduceList = JSON.parse(JSON.stringify(this.introduceList)) } }, /* 文件上传函数 */ async commonFileUpload(file) { - this.loading = true; - const formData = new FormData(); - formData.append("file", file); - const res = await upload(formData); + this.loading = true + const formData = new FormData() + formData.append('file', file) + const res = await upload(formData) - this.loading = false; + this.loading = false if (res.code === 200) { - return res.data; + return res.data } - return false; + return false }, getSplitList(data) { if (data) { - return data.split(","); + return data.split(',') } - return []; + return [] }, /* 正品控名称配置 */ @@ -2888,51 +2913,51 @@ export default { this.instrumentName.nameForm.push({ id: null, instrumentId: this.instrumentName.instrumentId, - productName: "", - }); + productName: '' + }) }, editInstrumentNameVisible(row) { - this.instrumentName.instrumentId = row.id; + this.instrumentName.instrumentId = row.id // 查询现有的正品控名称 listRelate({ - instrumentId: row.id, + instrumentId: row.id }).then((response) => { if (response.data != null && response.data.length > 0) { - this.instrumentName.nameForm = response.data; + this.instrumentName.nameForm = response.data } else { this.instrumentName.nameForm = [ { id: null, instrumentId: this.instrumentName.instrumentId, - productName: "", - }, - ]; + productName: '' + } + ] } - this.instrumentName.visible = true; - }); + this.instrumentName.visible = true + }) }, delInstrumentName(item) { // 获取 id,删除关联的正品控名称 if (item.row.id != null) { // 执行删除 delRelate(item.row.id).then((response) => { - this.$modal.msgSuccess("删除成功"); - }); + this.$modal.msgSuccess('删除成功') + }) } - this.instrumentName.nameForm.splice(item.$index, 1); + this.instrumentName.nameForm.splice(item.$index, 1) if (this.instrumentName.nameForm.length == 0) { - this.addInstrumentNameline(); + this.addInstrumentNameline() } }, saveInstrumentName(item) { if (item.id != null) { updateRelate(item).then((response) => { - this.$modal.msgSuccess("修改成功"); - }); + this.$modal.msgSuccess('修改成功') + }) } else { addRelate(item).then((response) => { - this.$modal.msgSuccess("新增成功"); - }); + this.$modal.msgSuccess('新增成功') + }) } }, @@ -2944,24 +2969,24 @@ export default { instrumentId: this.instrumentInstructions.instrumentId, name: null, link: null, - save: false, - }); + save: false + }) }, editInstrumentInstructionVisible(row) { - this.instrumentInstructions.instrumentId = row.id; + this.instrumentInstructions.instrumentId = row.id // 查询现有的仪器说明书 listInstructions({ - instrumentId: row.id, + instrumentId: row.id }).then((response) => { if (response.data != null && response.data.length > 0) { - this.instrumentInstructions.instructionList = response.data; + this.instrumentInstructions.instructionList = response.data for (let i = 0; i < response.data.length; i++) { this.instrumentInstructions.instructionList[i].fileList = [ { name: response.data[i].name, - url: response.data[i].url, - }, - ]; + url: response.data[i].url + } + ] } } else { this.instrumentInstructions.instructionList = [ @@ -2970,305 +2995,305 @@ export default { fileList: [], instrumentId: this.instrumentInstructions.instrumentId, name: null, - link: null, - }, - ]; + link: null + } + ] } - this.instrumentInstructions.visible = true; - }); + this.instrumentInstructions.visible = true + }) }, delInstrumentInstruction(item) { // 获取 id,删除关联的仪器说明书 if (item.row.id != null) { // 执行删除 delInstructions(item.row.id).then((response) => { - this.$modal.msgSuccess("删除成功"); - }); + this.$modal.msgSuccess('删除成功') + }) } - this.instrumentInstructions.instructionList.splice(item.$index, 1); + this.instrumentInstructions.instructionList.splice(item.$index, 1) if (this.instrumentInstructions.instructionList.length == 0) { - this.addInstrumentInstructionLine(); + this.addInstrumentInstructionLine() } }, saveInstrumentInstruction(item, index) { if (item.instrumentId == null) { - this.$modal.msgError("参数异常"); - return; + this.$modal.msgError('参数异常') + return } if (item.name == null || item.name.trim().length === 0) { - this.$modal.msgError("请输入说明书类型"); - return; + this.$modal.msgError('请输入说明书类型') + return } if (item.link == null) { - this.$modal.msgError("请上传说明书"); - return; + this.$modal.msgError('请上传说明书') + return } - const pattern = /^[a-zA-Z0-9]+$/; + const pattern = /^[a-zA-Z0-9]+$/ if (!pattern.test(item.name)) { - this.$modal.msgError("说明书类型只能为数字和英文的组合"); - return; + this.$modal.msgError('说明书类型只能为数字和英文的组合') + return } if (item.id != null) { updateInstructions(item).then((response) => { - this.$modal.msgSuccess("修改成功"); - }); + this.$modal.msgSuccess('修改成功') + }) } else { addInstructions(item).then((response) => { - this.$modal.msgSuccess("新增成功"); - item.save = true; - }); + this.$modal.msgSuccess('新增成功') + item.save = true + }) } }, confirmAddAll() { this.instrumentInstructions.instructionList.map((item) => { if (item.instrumentId == null) { - this.$modal.msgError("参数异常"); - return; + this.$modal.msgError('参数异常') + return } if (item.name == null || item.name.trim().length === 0) { - this.$modal.msgError("请输入说明书类型"); - return; + this.$modal.msgError('请输入说明书类型') + return } if (item.link == null) { - this.$modal.msgError("请上传说明书"); - return; + this.$modal.msgError('请上传说明书') + return } - const pattern = /^[a-zA-Z0-9]+$/; + const pattern = /^[a-zA-Z0-9]+$/ if (!pattern.test(item.name)) { - this.$modal.msgError("说明书类型只能为数字和英文的组合"); - return; + this.$modal.msgError('说明书类型只能为数字和英文的组合') + return } - }); + }) addAllInstructions(this.instrumentInstructions.instructionList).then( (response) => { - this.$modal.msgSuccess("新增成功"); + this.$modal.msgSuccess('新增成功') this.instrumentInstructions.instructionList.map((item) => { - item.save = true; - }); - this.instrumentInstructions.visible = false; + item.save = true + }) + this.instrumentInstructions.visible = false } - ); + ) }, instructionUploadExceed(files, fileList) { - this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`); + this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`) }, instructionUploadSuccess(response, file, fileList, index) { if (response.code == 200) { this.instrumentInstructions.instructionList[index].link = - response.data.url; + response.data.url } else { - this.$message.error("文件上传失败"); + this.$message.error('文件上传失败') } }, viewInstrumentInstruction(item) { - window.open(item.nameUrl, "_blank"); + window.open(item.nameUrl, '_blank') }, copyInstructionNameUrl(item) { navigator.clipboard.writeText(item.nameUrl).then(() => { - this.$message.success("已成功复制到剪贴板"); - }); + this.$message.success('已成功复制到剪贴板') + }) }, /* 模式 */ openModeIdDialog() { - this.mode.modeIdsValueTemp = []; - this.mode.sortMode = []; + this.mode.modeIdsValueTemp = [] + this.mode.sortMode = [] if (this.form.modeIdsValue.length > 1) { for (let i = 0; i < this.form.modeIdsValue.length; i++) { const filterModeArr = this.mode.modeIdsOptions.filter( (item) => item.id == this.form.modeIdsValue[i] - ); - console.log(filterModeArr); - this.mode.modeIdsValueTemp.push(filterModeArr[0]); + ) + console.log(filterModeArr) + this.mode.modeIdsValueTemp.push(filterModeArr[0]) } - this.mode.modeSortVisible = true; + this.mode.modeSortVisible = true } }, /* 模式名称排序 */ openModeIdDialog2(item, i) { - this.sortIndex = i; - this.mode.modeIdsValueTemp = []; - this.mode.sortMode = []; + this.sortIndex = i + this.mode.modeIdsValueTemp = [] + this.mode.sortMode = [] if (item.modeList.length > 1) { for (let i = 0; i < item.modeList.length; i++) { const filterModeArr = this.Modetions.filter( (obj) => obj.id == item.modeList[i] - ); - this.mode.modeIdsValueTemp.push(filterModeArr[0]); + ) + this.mode.modeIdsValueTemp.push(filterModeArr[0]) } - this.mode.modeSortVisible2 = true; + this.mode.modeSortVisible2 = true } }, handleCloseMode() { - this.mode.modeIdsValueTemp = []; - this.mode.sortMode = []; - this.mode.modeSortVisible = false; - this.mode.modeSortVisible2 = false; + this.mode.modeIdsValueTemp = [] + this.mode.sortMode = [] + this.mode.modeSortVisible = false + this.mode.modeSortVisible2 = false }, handleSaveMode() { - const newSort = []; + const newSort = [] for (let i = 0; i < this.mode.modeIdsValueTemp.length; i++) { - newSort.push(this.mode.modeIdsValueTemp[i].id); + newSort.push(this.mode.modeIdsValueTemp[i].id) } - this.form.modeIdsValue = newSort; - this.handleCloseMode(); + this.form.modeIdsValue = newSort + this.handleCloseMode() }, handleSaveMode2() { - const newSort = []; + const newSort = [] for (let i = 0; i < this.mode.modeIdsValueTemp.length; i++) { - newSort.push(this.mode.modeIdsValueTemp[i].id); + newSort.push(this.mode.modeIdsValueTemp[i].id) } - this.wxLiningList[this.sortIndex].modeList = newSort; - this.handleCloseMode(); + this.wxLiningList[this.sortIndex].modeList = newSort + this.handleCloseMode() }, modeIdsValueChang() { - const temp = []; + const temp = [] if (this.form.modeIdsValue.length > 0) { for (let i = 0; i < this.form.modeIdsValue.length; i++) { const filterModeArr = this.mode.modeIdsOptions.filter( (item) => item.id == this.form.modeIdsValue[i] - ); - temp.push(filterModeArr[0]); + ) + temp.push(filterModeArr[0]) } } - this.newModeOptionList = temp; + this.newModeOptionList = temp }, clothmodeIdsValueChang(e) { - const temp = []; + const temp = [] if (e.modeList.length > 0) { for (let i = 0; i < e.modeList.length; i++) { const filterModeArr = this.Modetions.filter( (item) => item.id == e.modeList[i] - ); - temp.push(filterModeArr[0]); + ) + temp.push(filterModeArr[0]) } } - this.NewOptions = temp; + this.NewOptions = temp }, // 上传前校检格式和大小 handleBeforeUpload(file) { - console.log("handleBeforeUpload"); + console.log('handleBeforeUpload') // 校检文件类型 - const fileName = file.name.split("."); - const fileExt = fileName[fileName.length - 1]; - const isImageTypeOk = this.imageFileType.indexOf(fileExt) >= 0; - const isVideoTypeOk = this.videoFileType.indexOf(fileExt) >= 0; + const fileName = file.name.split('.') + const fileExt = fileName[fileName.length - 1] + const isImageTypeOk = this.imageFileType.indexOf(fileExt) >= 0 + const isVideoTypeOk = this.videoFileType.indexOf(fileExt) >= 0 if (!(isImageTypeOk || isVideoTypeOk)) { - this.$modal.msgError(`文件格式不正确`); - return false; + this.$modal.msgError(`文件格式不正确`) + return false } - + // 校检文件大小 if (isImageTypeOk) { - const isLt = file.size / 1024 / 1024 < this.imageFileSize; + const isLt = file.size / 1024 / 1024 < this.imageFileSize if (!isLt) { this.$modal.msgError( `上传图片大小不能超过 ${this.imageFileSize} MB!` - ); - return false; + ) + return false } } if (isVideoTypeOk) { - const isLt = file.size / 1024 / 1024 < this.videoFileSize; + const isLt = file.size / 1024 / 1024 < this.videoFileSize if (!isLt) { this.$modal.msgError( `上传视频大小不能超过 ${this.videoFileSize} MB!` - ); - return false; + ) + return false } } - return true; + return true }, pdfHandleBeforeUpload(file) { // 校检文件类型 if (this.pdfFileType) { - const fileName = file.name.split("."); - const fileExt = fileName[fileName.length - 1]; - const isTypeOk = this.pdfFileType.indexOf(fileExt) >= 0; + const fileName = file.name.split('.') + const fileExt = fileName[fileName.length - 1] + const isTypeOk = this.pdfFileType.indexOf(fileExt) >= 0 if (!isTypeOk) { - this.$modal.msgError(`说明书文件类型只能为PDF格式`); - return false; + this.$modal.msgError(`说明书文件类型只能为PDF格式`) + return false } } // 校检文件大小 if (this.pdfFileSize) { - const isLt = file.size / 1024 / 1024 < this.pdfFileSize; + const isLt = file.size / 1024 / 1024 < this.pdfFileSize if (!isLt) { - this.$modal.msgError(`上传文件大小不能超过 ${this.pdfFileSize} MB!`); - return false; + this.$modal.msgError(`上传文件大小不能超过 ${this.pdfFileSize} MB!`) + return false } } // 校验文件名 - var regex = /^[a-zA-Z0-9\-_.]+$/; + var regex = /^[a-zA-Z0-9\-_.]+$/ if (!regex.test(file.name)) { this.$modal.msgError( `文件名只能由字母、数字、以及一些常用的特殊符号(比如连字符、下划线和点号等)组成` - ); - return false; + ) + return false } - return true; + return true }, handleBeforeUploadImage(file) { - const fileType = ["jpg", "png", "JPG", "PNG"]; - const fileName = file.name.split("."); - const fileExt = fileName[fileName.length - 1]; - const isTypeOk = fileType.indexOf(fileExt) >= 0; + const fileType = ['jpg', 'png', 'JPG', 'PNG'] + const fileName = file.name.split('.') + const fileExt = fileName[fileName.length - 1] + const isTypeOk = fileType.indexOf(fileExt) >= 0 if (!isTypeOk) { - this.$modal.msgError(`文件类型只能为jpg格式/png格式`); - return false; + this.$modal.msgError(`文件类型只能为jpg格式/png格式`) + return false } - return true; + return true }, // 处理时间组件 pickedTimeComponentChange() { if (this.form.nursingTime == null) { - this.form.nursingTime = "00:00:00"; + this.form.nursingTime = '00:00:00' } }, writePreviewFile(file, paramsType = null) { - this.innerVisible = true; + this.innerVisible = true if (!paramsType) { if (file.url) { - let type = file.url.split("."); - type = type[type.length - 1]; + let type = file.url.split('.') + type = type[type.length - 1] if ( - type == "bmp" || - type == "gif" || - type == "jpg" || - type == "jpeg" || - type == "png" + type == 'bmp' || + type == 'gif' || + type == 'jpg' || + type == 'jpeg' || + type == 'png' ) { - this.innerImg = file.url; + this.innerImg = file.url } else { - this.innerVideo = file.url; + this.innerVideo = file.url } } else { - let type = file.response.data.url.split("."); - type = type[type.length - 1]; + let type = file.response.data.url.split('.') + type = type[type.length - 1] if ( - type == "bmp" || - type == "gif" || - type == "jpg" || - type == "jpeg" || - type == "png" + type == 'bmp' || + type == 'gif' || + type == 'jpg' || + type == 'jpeg' || + type == 'png' ) { - this.innerImg = file.response.data.url; + this.innerImg = file.response.data.url } else { - this.innerVideo = file.response.data.url; + this.innerVideo = file.response.data.url } } } else { - this.innerVideo = file; + this.innerVideo = file } }, closePreview(e) { - this.innerImg = ""; - this.innerVideo = ""; - }, - }, -}; + this.innerImg = '' + this.innerVideo = '' + } + } +}