5.31推送

master
L14\huangyilong 2 years ago
parent 7d4aff4c60
commit 5f4c1cdda1

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

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

@ -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<Long> ids;
private List<Long> planIds;
public String getPlanId() {
return planId;
@ -146,4 +148,20 @@ public class WxNursingPlanJoinUserReq {
public void setIds(List<Long> ids) {
this.ids = ids;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public List<Long> getPlanIds() {
return planIds;
}
public void setPlanIds(List<Long> planIds) {
this.planIds = planIds;
}
}

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

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

@ -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<WxUserTag> miniProgramTags;
@Excel(name = "小程序标签")
private String miniProgramTagName;
/**
*
*/
private List<WxUserTag> 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;
}
}

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

@ -139,4 +139,8 @@ public interface SysTagMapper {
List<SysTag> selectByIdList(@Param("tagIdList") List<Long> 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);
}

@ -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<InstrumentModeVo> getInstrumentModeList(Integer type);
List<InstrumentModeVo> getInstrumentModeList(@Param("ids") List<Long> ids);
}

@ -72,4 +72,6 @@ public interface WxNursingPlanCycleMapper
int findCycleMarkerCount(@Param("planId")Long planId,
@Param("cycleMarker")Long cycleMarker,
@Param("notId")Long notId);
List<Integer> findDayNumList(@Param("planId")Long planId);
}

@ -69,4 +69,6 @@ public interface WxNursingPlanInstrumentMapper {
List<Long> getWxNursingPlanIdsByInstrumentName(String instrumentName);
int findCountByInstrumentId(@Param("planId") Long planId,@Param("instrumentId") Long instrumentId);
List<Long> findPlanIdsByInstrumentIds(@Param("instrumentIds")List<Long> instrumentIds);
}

@ -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<WxNursingPlanUserProgressVo> getWxNursingPlanUserProgressVo(@Param("statusArr")Integer[] statusArr,@Param("userId")Long userId);
List<WxNursingPlanJoin> findJoinStatusByCond(@Param("userId")Long userId,@Param("statusArr")Integer[] statusArr);
List<WxNursingPlanUserJoinRet> findWxNursingPlanUserJoinRet(@Param("userId")Long userId,
@Param("startTime")LocalDateTime startTime,
@Param("endTime")LocalDateTime endTime);
}

@ -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<Long> progressIds);
List<LocalTime> getNursingTimeList(@Param("progressIds") List<Long> progressIds);
List<WxNursingPlanJoinProgressDetail> listWxNursingPlanJoinProgressDetailCond(WxNursingPlanJoinProgressDetail detail);
List<WxNursingPlanUserJoinDayRet> findJoinProgressDetailList(@Param("planId")Long planId,
@Param("userId")Long userId,
@Param("startTime")LocalDateTime startTime,
@Param("endTime")LocalDateTime endTime);
}

@ -61,9 +61,9 @@ public interface WxNursingPlanJoinProgressMapper {
*/
public int deleteWxNursingPlanJoinProgressByIds(Long[] ids);
List<Long> findProgressIdsByJoinIds(List<Long> joinIds);
List<Long> findProgressIdsByJoinIds(@Param("joinIds") List<Long> joinIds);
int deleteWxNursingPlanJoinProgressByJoinIds(List<Long> joinIds);
int deleteWxNursingPlanJoinProgressByJoinIds(@Param("joinIds") List<Long> 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<WxNursingPlanJoinProgress> selectNowProgressList(@Param("planJoinId")Long planJoinId,
@Param("nowStartTime")LocalDateTime nowStartTime,

@ -75,4 +75,6 @@ public interface WxUserInstrumentMapper
* @return id
*/
List<Long> selectInstrumentIdListByUserId(@Param("userId") Long userId);
List<WxUserInstrument> findInstrumentList(WxUserInstrument wxUserInstrument);
}

@ -220,4 +220,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update sys_tag set del_flag = '2' where id = #{id}
</delete>
<select id="selectCount" resultType="java.lang.Integer">
select count(*) from sys_tag
<where>
and del_flag = '0'
<if test="parentId != null">and parent_id = #{parentId}</if>
<if test="type != null">and `type` =#{type}</if>
</where>
</select>
<select id="findTagCount" resultType="java.lang.Integer">
select count(*) from sys_tag
<where>
and del_flag = '0'
<if test="type != null">and `type` =#{type}</if>
<if test="tagName != null">and tag_name = #{tagName}</if>
<if test="notId != null">and id != #{notId}</if>
</where>
</select>
</mapper>

@ -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
<where>
<if test="type != null">and wi.type = #{type}</if>
<if test="ids != null and ids.size()>0">
and wi.id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</select>
</mapper>

@ -147,4 +147,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="notId != null">and id != #{notId}</if>
</where>
</select>
<select id="findDayNumList" parameterType="java.lang.Long" resultType="java.lang.Integer">
select COUNT(d.`day`) from wx_nursing_plan_cycle c
LEFT JOIN wx_nursing_plan_cycle_detail d on d.cycle_id = c.id
where c.plan_id = #{planId} GROUP BY c.id
</select>
</mapper>

@ -89,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getWxNursingPlanInstrumentIdsByPlanId" parameterType="java.lang.Long" resultType="java.lang.Long">
select id from wx_nursing_plan_instrument where plan_id = #{planId}
select instrument_id from wx_nursing_plan_instrument where plan_id = #{planId}
</select>
<select id="getWxNursingPlanIdsByInstrumentName" parameterType="java.lang.String" resultType="java.lang.Long">
@ -100,4 +100,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="findCountByInstrumentId" parameterType="java.lang.Long" resultType="java.lang.Integer">
select count(*) from wx_nursing_plan_instrument where plan_id = #{planId} and instrument_id = #{instrumentId}
</select>
<select id="findPlanIdsByInstrumentIds" resultType="java.lang.Long">
select plan_id from wx_nursing_plan_instrument
<where>
<if test="instrumentIds != null and instrumentIds.size()>0">
and instrument_id in
<foreach collection="instrumentIds" item="instrumentId" open="(" separator="," close=")">
#{instrumentId}
</foreach>
</if>
</where>
</select>
</mapper>

@ -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
<where>
<if test="nickName != null">and m.nickname like concat('%', #{nickName}, '%')</if>
<if test="planTitle != null and planTitle != ''">
and p.title like concat('%', #{planTitle}, '%')
</if>
@ -203,10 +204,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</if>
<if test="joinStartTime != null">
and pj.create_time &lt; = #{joinStartTime}
and pj.create_time &lt;= #{joinStartTime}
</if>
<if test="joinEndTime != null">
and pj.create_time &gt; = #{joinStartTime}
and pj.create_time &gt;= #{joinEndTime}
</if>
<if test="status != null">and pj.status = #{status}</if>
<if test="ids != null and ids.size()>0">
@ -215,6 +216,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{pjId}
</foreach>
</if>
<if test="planIds != null and planIds.size()>0">
and p.id in
<foreach collection="planIds" item="planId" open="(" separator="," close=")">
#{planId}
</foreach>
</if>
</where>
order by pj.create_time desc
</select>
@ -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"
</where>
ORDER BY pj.create_time DESC
</select>
<select id="findJoinStatusByCond" resultMap="WxNursingPlanJoinResult">
<include refid="selectWxNursingPlanJoinVo"/>
<where>
<if test="statusArr!=null and statusArr.length>0">
and `status` in
<foreach collection="statusArr" item="status" open="(" separator="," close=")">#{status}</foreach>
</if>
<if test="userId != null">and user_id = #{userId}</if>
</where>
ORDER BY create_time DESC
</select>
<select id="findWxNursingPlanUserJoinRet" resultType="com.flossom.common.core.domain.ret.WxNursingPlanUserJoinRet">
select j.id as 'joinId',j.plan_id as 'planId',j.create_time as 'joinTime',
p.active_start_time as 'activeStartTime',p.active_end_time as 'activeEndTime',j.`status`
from wx_nursing_plan p
INNER JOIN wx_nursing_plan_join j on p.id=j.plan_id
<where>
<if test="userId != null">
and j.user_id = #{userId}
</if>
<if test="startTime != null and endTime != null">
and p.active_end_time &lt; #{endTime}
and j.create_time &lt;= #{endTime} and p.active_end_time &gt; #{startTime}
</if>
</where>
</select>
</mapper>

@ -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}
</foreach>
</select>
<select id="listWxNursingPlanJoinProgressDetailCond" parameterType="WxNursingPlanJoinProgressDetail" resultMap="WxNursingPlanJoinProgressDetailResult">
<include refid="selectWxNursingPlanJoinProgressDetailVo"/>
<where>
<if test="progressId != null "> and progress_id = #{progressId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="stepType != null "> and step_type = #{stepType}</if>
<if test="index != null "> and `index` = #{index}</if>
<if test="productId != null "> and product_id = #{productId}</if>
<if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
<if test="modeId != null "> and mode_id = #{modeId}</if>
<if test="logId != null">and log_id = #{logId}</if>
<if test="status != null">and status = #{status}</if>
</where>
order by create_time desc
</select>
<select id="findJoinProgressDetailList" resultType="com.flossom.common.core.domain.ret.WxNursingPlanUserJoinDayRet">
select p.id as 'progressId',p.plan_id as 'planId',p.start_time as 'startTime',d.`status`,
d.instrument_id as 'instrumentId',d.mode_id as 'modeId',
i.model,i.`name` as 'instrumentName',m.mode_name as 'modeName',i.color_code as 'colorCode',
p.cycle_id as 'cycleId',p.is_day_off as 'isDayOff'
from wx_nursing_plan_join_progress p
left join wx_nursing_plan_join_progress_detail d on p.id=d.progress_id and d.step_type=2
LEFT JOIN wx_instrument i on i.id=d.instrument_id
LEFT JOIN wx_mode m on m.id = d.mode_id
<where>
<if test="planId != null">and p.plan_id = #{planId}</if>
<if test="userId != null">and p.user_id = #{userId}</if>
<if test="startTime != null">and p.start_time &gt;= #{startTime}</if>
<if test="endTime != null">and p.start_time &lt;= #{endTime}</if>
</where>
</select>
</mapper>

@ -130,14 +130,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="findProgressIdsByJoinIds" parameterType="java.lang.Long" resultType="java.lang.Long">
delete id from wx_nursing_plan_join_progress where id in
select id from wx_nursing_plan_join_progress where id in
<foreach item="id" collection="joinIds" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<delete id="deleteWxNursingPlanJoinProgressByJoinIds" parameterType="java.lang.Long">
select id from wx_nursing_plan_join_progress where id in
delete from wx_nursing_plan_join_progress where id in
<foreach item="id" collection="joinIds" open="(" separator="," close=")">
#{id}
</foreach>
@ -158,6 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null "> and p.status = #{status}</if>
<if test="isWarn != null"> and j.is_warn = #{isWarn}</if>
<if test="nextTime != null"> and p.next_time =#{nextTime}</if>
<if test="joinStatus != null">and j.status = #{joinStatus}</if>
</where>
</select>
@ -165,8 +166,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectWxNursingPlanJoinProgressVo"/>
<where>
<if test="planJoinId != null "> and plan_join_id = #{planJoinId}</if>
<if test="nowStartTime != null "> and start_time &gt; = #{nowStartTime}</if>
<if test="nowEndTime != null "> and start_time &lt; = #{nowEndTime}</if>
<if test="nowStartTime != null "> and start_time &gt;= #{nowStartTime}</if>
<if test="nowEndTime != null "> and start_time &lt;= #{nowEndTime}</if>
</where>
</select>
</mapper>

@ -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 test="userId != null">if(isnull(pj.`status`),0,pj.`status`) as 'joinStatus',</if>
(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
<if test="userId != null">left join wx_nursing_plan_join pj on pj.plan_id = p.id</if>
<where>
<if test="userId != null">and pj.user_id = #{userId}</if>
<if test="planId != null">and p.id = #{planId}</if>
<if test="status != null "> and p.status = #{status}</if>
<if test="activeTime != null ">and p.active_start_time &lt;= #{activeTime} and p.active_end_time &gt; #{activeTime}</if>
<if test="userRegistrationTime != null ">and p.user_registration_start_time &lt;= #{userRegistrationTime} and p.user_registration_end_time &gt; #{userRegistrationTime}</if>
<if test="userId != null and joinStatusList!=null and joinStatusList.size()>0">
and pj.`status` in
<foreach collection="joinStatusList" item="statusItem" open="(" separator="," close=")">#{statusItem}</foreach>
</if>
</where>
order by p.order_num desc
</select>

@ -200,4 +200,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectInstrumentIdListByUserId" resultType="long">
select instrument_id from wx_user_instrument where user_id = #{userId}
</select>
<select id="findInstrumentList" parameterType="com.flossom.common.core.domain.entity.WxUserInstrument" resultMap="WxUserInstrumentResult">
select ui.id, ui.user_id, ui.serial, ui.instrument_id, ui.serial_image, ui.guarantee, ui.guarantee_endtime, ui.binding_status,
ui.status, ui.create_by, ui.create_time, ui.update_by, ui.update_time, ui.remark,i.`name` as 'instrumentName'
from wx_user_instrument ui
left join wx_instrument i on ui.instrument_id = i.id
<where>
<if test="userId != null "> and ui.user_id = #{userId}</if>
<if test="serial != null and serial != ''"> and ui.serial = #{serial}</if>
<if test="instrumentId != null "> and ui.instrument_id = #{instrumentId}</if>
<if test="bindingStatus != null "> and ui.binding_status = #{bindingStatus}</if>
<if test="status != null "> and ui.status = #{status}</if>
</where>
</select>
</mapper>

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

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

@ -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<userInfoList> user_info_list;
private Integer errcode;
private String errmsg;
public OfficialAccountUserDetailRet() {
}
public OfficialAccountUserDetailRet(List<userInfoList> user_info_list, Integer errcode, String errmsg) {
this.user_info_list = user_info_list;
this.errcode = errcode;
this.errmsg = errmsg;
}
public List<userInfoList> getUser_info_list() {
return user_info_list;
}
public void setUser_info_list(List<userInfoList> 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<Integer> 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<Integer> 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<Integer> getTagid_list() {
return tagid_list;
}
public void setTagid_list(List<Integer> 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;
}
}
}

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

@ -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<String> getOpenidList() {
return getData().getOpenid();
}
class data {
private List<String> openid;
public data() {
}
public data(List<String> openid) {
this.openid = openid;
}
public List<String> getOpenid() {
return openid;
}
public void setOpenid(List<String> openid) {
this.openid = openid;
}
}
}

@ -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<String,String> 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<WxNursingPlanJoinProgress> 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<WxNursingPlanJoinProgress> 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("---------定时发送今日未完成任务消息任务结束-------------");
}
/**

@ -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<String> 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<OfficialAccountUserDetailRet.userInfoList> userInfoList = new ArrayList<>();
int pageSize = 100;
int page = total % pageSize == 0 ? total / pageSize : total / pageSize + 1;
for (int pageNo = 1; pageNo <= page; pageNo++) {
List<String> pageList = openidList.stream().skip((long) (pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
if(pageList.isEmpty()){
break;
}
// 获取 unionid 集合
List<OfficialAccountUserReq> 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<String, String> 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("--------定时轮询小程序关注公众号的任务结束-----------");
}
}

@ -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<OfficialAccountUserReq> 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<String, Object> 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: 10000OpenID
*
* @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<String, String> 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<String,String> 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<String, JSONObject> 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;
}
}

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

@ -91,6 +91,16 @@ public class LoginUserVo {
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
private Date birthday;
/**
* 12
*/
private Integer clock;
/**
* 12
*/
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;
}
}

@ -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<WxNursingPlanCycleDetailStep> 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<WxNursingPlanUserJoinDayRet> listCalendar(LocalDate date);
}

@ -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<SysDictData> 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<Integer> newGearDataList = JSON.parseArray(newJsonObject.getString("groupedAa"),Integer.class);
List<Integer> newJoulePerSecondList = JSON.parseArray(newJsonObject.getString("joulePerSecond"),Integer.class);
List<Integer> 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<Integer> oldGearDataList = JSON.parseArray(oldNursingDataJsonObject.getString("groupedAa"),Integer.class);
List<Integer> oldJoulePerSecondList = new ArrayList<>();
if(oldNursingDataJsonObject.containsKey("joulePerSecond")){
oldJoulePerSecondList = JSON.parseArray(oldNursingDataJsonObject.getString("joulePerSecond"),Integer.class);
}
List<Integer> 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 {
// 其他模式取最新的

@ -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<WxNursingPlan> listPlan() {
@ -100,30 +106,30 @@ public class WxNursingPlanService implements IWxNursingPlanService {
Iterator<WxNursingPlan> 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<Integer> 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<WxNursingPlan> joinPlanList = this.getPlanListByCond(queryWxNursingPlan);
if (!joinPlanList.isEmpty()) {
WxNursingPlan plan = joinPlanList.get(0);//用户每次只能参与一个护理计划
List<WxNursingPlan> 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<WxNursingPlan> planList = wxNursingPlanMapper.findWxNursingPlanList(queryWxNursingPlan);
planList.forEach(item -> {
//计算周期时长,计算公式:活动的总天数*日程循环次数
item.setCycleTime(DateUtils.timeDistanceDay(item.getActiveEndTime(), item.getActiveStartTime()) * item.getCycleNumber());
List<Integer> 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<Long> 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<WxNursingPlanCycle> 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<WxNursingPlanTag> planTagList = wxNursingPlanTagMapper.listTagByPlanId(plan.getId());
if(!planTagList.isEmpty()){
//护理计划有标签限制
WxUserTag queryTag = new WxUserTag();
queryTag.setUserId(userId);
List<WxUserTag> tags = wxUserTagMapper.selectWxUserTagList(queryTag);
List<Long> userWxTags = tags.stream().filter(item -> item.getType() == 1).map(WxUserTag::getTagId).collect(Collectors.toList());
List<Long> userCompanyTags = tags.stream().filter(item -> item.getType() == 2).map(WxUserTag::getTagId).collect(Collectors.toList());
// 判断是否存在 可参加人群(小程序标签)
List<Long> 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<Long> 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<Long> 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<Long> 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<Long> planInstrumentIds = wxNursingPlanInstrumentMapper.getWxNursingPlanInstrumentIdsByPlanId(plan.getId());
if(!planInstrumentIds.isEmpty()){
//护理计划有仪器限制
List<Long> 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<WxNursingPlanJoin> joinList = wxNursingPlanJoinMapper.selectWxNursingPlanJoinList(queryJoin);
if (joinList.isEmpty()) {
@ -337,8 +452,10 @@ public class WxNursingPlanService implements IWxNursingPlanService {
List<WxNursingPlanJoin> 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<Long> 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<Long> wxTagIds = wxNursingPlanTagMapper.listTagIdsByPlanId(planId, 6);
List<Long> 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<WxNursingPlanJoinProgress> nowProgressList = wxNursingPlanJoinProgressMapper.selectNowProgressList(planJoinId,nowStartTime,nowEndTime);
LocalDateTime nowStartTime = LocalDateTime.of(LocalDate.now(), LocalTime.MIN);
LocalDateTime nowEndTime = LocalDateTime.of(LocalDate.now(), LocalTime.MAX);
List<WxNursingPlanJoinProgress> 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<WxNursingPlanUserProgressVo> progressVoList = wxNursingPlanJoinMapper.getWxNursingPlanUserProgressVo(new Integer[]{1, 2, 3}, userId);
List<WxNursingPlanUserProgressVo> progressVoList = wxNursingPlanJoinMapper.getWxNursingPlanUserProgressVo(null, userId);
if (progressVoList.isEmpty()) {
return null;
}
List<Integer> 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<WxNursingPlanJoinProgressDetail> detailList = wxNursingPlanJoinProgressDetailMapper.selectWxNursingPlanJoinProgressDetailList(queryDetail);
List<WxNursingPlanJoinProgressDetail> 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<WxNursingPlanJoinProgress> 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<WxNursingPlanUserJoinDayRet> 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<WxNursingPlanUserJoinRet> userJoinRetList = wxNursingPlanJoinMapper.findWxNursingPlanUserJoinRet(userId, monthStartDayTime, monthEndDayTime);
if (userJoinRetList.isEmpty()) {
return null;//没有符合条件的参与记录
}
//查询出指定范围内的进度记录
List<WxNursingPlanUserJoinDayRet> dayRetList = wxNursingPlanJoinProgressDetailMapper.findJoinProgressDetailList(null, userId, monthStartDayTime, monthEndDayTime);
List<Long> joinDayPlanIds = dayRetList.stream().map(WxNursingPlanUserJoinDayRet::getPlanId).collect(Collectors.toList());
//取差集,判断是哪个护理计划尚未开始
List<WxNursingPlanUserJoinRet> unStartPlanList = userJoinRetList.stream().filter(item -> !joinDayPlanIds.contains(item.getPlanId())).collect(Collectors.toList());
for (WxNursingPlanUserJoinRet item : unStartPlanList) {
List<WxNursingPlanUserJoinDayRet> _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<WxNursingPlanCycleDetailRet> 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());
}
}

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

@ -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() + "'失败,上级标签不能是自己");

@ -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<InstrumentModeVo> voList = wxInstrumentModeService.getInstrumentModeList(type);
//转换成为map
Map<String,List<InstrumentModeVo>> map = new HashMap<>();
voList.forEach(item->{
if(map.containsKey(item.getInstrumentId().toString())){
List<InstrumentModeVo> list= map.get(item.getInstrumentId().toString());
list.add(item);
}else {
List<InstrumentModeVo> 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);
}
}

@ -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<InstrumentModeVo> voList = wxNursingPlanService.getInstrumentModeList(planId);
//转换成为map
Map<String,List<InstrumentModeVo>> map = new HashMap<>();
voList.forEach(item->{
if(map.containsKey(item.getInstrumentId().toString())){
List<InstrumentModeVo> list= map.get(item.getInstrumentId().toString());
list.add(item);
}else {
List<InstrumentModeVo> 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);
}
}

@ -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<WxNursingPlanJoinUserVo> 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<WxNursingPlanJoinUserVo> util = new ExcelUtil(WxNursingPlanJoinUserVo.class);
util.exportExcel(response, list, "用户参加护理计划", req.getExportFields());
util.exportExcel(response, list, "护理计划记录", req.getExportFields());
}
/**

@ -138,4 +138,6 @@ public interface ISysTagService
List<Map<String, Object>> getWecomTags();
int findTagCount(String type,String tagName,Long notId);
}

@ -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<InstrumentModeVo> getInstrumentModeList(Integer type);
}

@ -61,4 +61,6 @@ public interface IWxNursingPlanCycleService
public int deleteWxNursingPlanCycleById(Long id);
int deleteWxNursingPlanCycleByPlanId(Long planId);
List<Integer> findDayList(Long planId);
}

@ -67,4 +67,6 @@ public interface IWxNursingPlanInstrumentService
List<Long> getWxNursingPlanIdsByInstrumentName(String instrumentName);
void batchInsertWxNursingPlanInstrument(Long planId,List<Long> instrumentIds);
List<Long> getWxNursingPlanInstrumentIdsByPlanId(Long planId);
}

@ -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<InstrumentModeVo> getInstrumentModeList(Long planId);
}

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

@ -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<InstrumentModeVo> getInstrumentModeList(Integer type){
return wxInstrumentModeMapper.getInstrumentModeList(type);
}
}

@ -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<Integer> findDayList(Long planId){
return wxNursingPlanCycleMapper.findDayNumList(planId);
}
}

@ -116,4 +116,8 @@ public class WxNursingPlanInstrumentServiceImpl implements IWxNursingPlanInstrum
wxNursingPlanInstrumentMapper.insertWxNursingPlanInstrument(instrument);
});
}
public List<Long> getWxNursingPlanInstrumentIdsByPlanId(Long planId){
return wxNursingPlanInstrumentMapper.getWxNursingPlanInstrumentIdsByPlanId(planId);
}
}

@ -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<WxNursingPlanJoin> 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<Long> userIds = wxNursingPlanJoinProgressDetailMapper.getUserIdsByInstrumentIds(req.getInstrumentIds(), 1);
userIds.add(0L);
req.setUserIds(userIds);
if (req.getInstrumentIds() != null && !req.getInstrumentIds().isEmpty()) {
List<Long> planIds = wxNursingPlanInstrumentMapper.findPlanIdsByInstrumentIds(req.getInstrumentIds());
planIds.add(0L);
req.setPlanIds(planIds);
}
List<WxNursingPlanJoinUserVo> 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<String> instrumentNameList = wxNursingPlanInstrumentMapper.getWxNursingPlanInstrumentNameByPlanId(item.getPlanId());
//绑定使用过的仪器
List<WxNursingPlanJoinProgressDetail> 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<Long> ids) {
List<Long> 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<Long> 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);

@ -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<WxNursingPlan> wxNursingPlanList = wxNursingPlanMapper.selectWxNursingPlanReqList(wxNursingPlanReq);
wxNursingPlanList.forEach(item -> {
//计算周期时长,计算公式:活动的总天数*日程循环次数
item.setCycleTime(DateUtils.timeDistanceDay(item.getActiveEndTime(), item.getActiveStartTime()) * item.getCycleNumber());
List<Integer> 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<WxNursingPlanJoin> 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<WxNursingPlanJoin> joinList = wxNursingPlanJoinService.selectWxNursingPlanJoinList(queryJoin);
joinList = wxNursingPlanJoinService.selectWxNursingPlanJoinList(queryJoin);
if(!joinList.isEmpty()){
List<Long> 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<InstrumentModeVo> getInstrumentModeList(Long planId){
List<Long> instrumentIds = wxNursingPlanInstrumentService.getWxNursingPlanInstrumentIdsByPlanId(planId);
if(instrumentIds.isEmpty()){
return new ArrayList<>();
}
return wxInstrumentModeMapper.getInstrumentModeList(instrumentIds);
}
}

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

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

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

@ -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-<version>,maven-mvnd-<version>-<platform>}/<hash>
[ -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 "$@"

@ -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-<version>,maven-mvnd-<version>-<platform>}/<hash>
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"

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>flossom-transfer</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>flossom-transfer</name>
<description>flossom-transfer</description>
<properties>
<java.version>1.8</java.version>
<spring-boot.version>3.3.0</spring-boot.version>
</properties>
<dependencies>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
<version>3.5.6</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.23</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<repositories>
<repository>
<id>public</id>
<name>aliyun nexus</name>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>aliyun nexus</name>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

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

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

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

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

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

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

@ -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;
/**
* 1234
*/
private Integer status;
/**
* id
*/
private Long instrumentId;
}

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

@ -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<HzActivityAddCondition> {
}

@ -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<HzActivityCarePlan> {
}

@ -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<HzActivityClock> {
}

@ -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<HzActivityClockTimes> {
}

@ -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<HzActivity> {
}

@ -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<HzActivityUser> {
}

@ -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<HzUserPermissionLog> {
}

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

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

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

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

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

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

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

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

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

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

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

@ -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<WxDailyCareProducts> {
}

@ -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<WxNursingPlanCycleDetail> {
}

@ -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<WxNursingPlanCycleDetailStep> {
}

@ -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<WxNursingPlanCycle> {
}

@ -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<WxNursingPlanInstrument> {
}

@ -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<WxNursingPlanJoin> {
}

@ -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<WxNursingPlanJoinProgressDetail> {
}

@ -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<WxNursingPlanJoinProgress> {
}

@ -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<WxNursingPlan> {
}

@ -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<WxNursingPlanTag> {
}

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

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

Binary file not shown.

@ -54,10 +54,4 @@ export function delMode(id) {
}
//获取仪器与模式的标签树
export function instrumentModeTree(query){
return request({
url: '/system/mode/instrumentModeTree',
method: 'get',
params: query
})
}

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

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save