Compare commits

..

No commits in common. '48ddfebdf714efc12f7158630517212ad64ccd16' and 'e0af7e8fad8a71d02ba5d6c08b2e383e0e213431' have entirely different histories.

@ -49,9 +49,6 @@ public class WxClockLog extends BaseEntity {
@Excel(name = "状态", readConverterExp = "0=正常,1=停用") @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private Long status; private Long status;
// 微信用户实体
private WxUserMember wxUserMember;
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
@ -100,14 +97,6 @@ public class WxClockLog extends BaseEntity {
return status; return status;
} }
public WxUserMember getWxUserMember() {
return wxUserMember;
}
public void setWxUserMember(WxUserMember wxUserMember) {
this.wxUserMember = wxUserMember;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -2,11 +2,11 @@ package com.flossom.common.core.domain.entity;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalTime; import java.time.LocalTime;
import java.time.temporal.ChronoField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.flossom.common.core.utils.DateUtils;
import com.flossom.common.core.web.domain.BaseEntity; import com.flossom.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/** /**
* wx_instrument * wx_instrument
@ -232,21 +232,6 @@ public class WxInstrument extends BaseEntity {
*/ */
private String we200IotVersionUpgrade; private String we200IotVersionUpgrade;
/**
*
*/
private String we200BluetoothConnectingTitle;
/**
*
*/
private String we200BluetoothConnecting;
/**
*
*/
private String we200BluetoothConnectingContent;
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
@ -379,7 +364,7 @@ public class WxInstrument extends BaseEntity {
this.nursingTime = nursingTime; this.nursingTime = nursingTime;
// 将 localTime 转为 分秒 格式 // 将 localTime 转为 分秒 格式
if (nursingTime != null) { if (nursingTime != null) {
this.nursingTimeStr = DateUtils.formatMS(nursingTime.getLong(ChronoField.SECOND_OF_DAY)); this.nursingTimeStr = String.format("%02d:%02d", nursingTime.getMinute(), nursingTime.getSecond());
} }
} }
@ -590,28 +575,4 @@ public class WxInstrument extends BaseEntity {
public String getNursingTimeStr() { public String getNursingTimeStr() {
return nursingTimeStr; return nursingTimeStr;
} }
public String getWe200BluetoothConnectingTitle() {
return we200BluetoothConnectingTitle;
}
public void setWe200BluetoothConnectingTitle(String we200BluetoothConnectingTitle) {
this.we200BluetoothConnectingTitle = we200BluetoothConnectingTitle;
}
public String getWe200BluetoothConnecting() {
return we200BluetoothConnecting;
}
public void setWe200BluetoothConnecting(String we200BluetoothConnecting) {
this.we200BluetoothConnecting = we200BluetoothConnecting;
}
public String getWe200BluetoothConnectingContent() {
return we200BluetoothConnectingContent;
}
public void setWe200BluetoothConnectingContent(String we200BluetoothConnectingContent) {
this.we200BluetoothConnectingContent = we200BluetoothConnectingContent;
}
} }

@ -42,8 +42,6 @@ public class WxInstrumentInstructions extends BaseEntity {
*/ */
private String nameUrl; private String nameUrl;
private boolean isSave = true;
/** /**
* 0 1 * 0 1
*/ */
@ -98,14 +96,6 @@ public class WxInstrumentInstructions extends BaseEntity {
this.nameUrl = nameUrl; this.nameUrl = nameUrl;
} }
public boolean isSave() {
return isSave;
}
public void setSave(boolean save) {
isSave = save;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -26,25 +26,15 @@ public class WxModeServiceInfo extends BaseEntity
private Long modeId; private Long modeId;
/** 服务开始时间 */ /** 服务开始时间 */
@JsonFormat(pattern = "HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "服务开始时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "服务开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date serviceStartTime; private Date serviceStartTime;
/**
*
*/
private String serviceStartTimeStr;
/** 服务结束时间 */ /** 服务结束时间 */
@JsonFormat(pattern = "HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "服务结束时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "服务结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date serviceEndTime; private Date serviceEndTime;
/**
*
*/
private String serviceEndTimeStr;
/** 启动图片资源 */ /** 启动图片资源 */
@Excel(name = "启动图片资源") @Excel(name = "启动图片资源")
private String startSource; private String startSource;
@ -119,22 +109,6 @@ public class WxModeServiceInfo extends BaseEntity
this.modeId = modeId; this.modeId = modeId;
} }
public String getServiceStartTimeStr() {
return serviceStartTimeStr;
}
public void setServiceStartTimeStr(String serviceStartTimeStr) {
this.serviceStartTimeStr = serviceStartTimeStr;
}
public String getServiceEndTimeStr() {
return serviceEndTimeStr;
}
public void setServiceEndTimeStr(String serviceEndTimeStr) {
this.serviceEndTimeStr = serviceEndTimeStr;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -245,21 +245,6 @@ public class WxInstrumentSaveReq {
*/ */
private List<Integer> newModeIdList; private List<Integer> newModeIdList;
/**
*
*/
private String we200BluetoothConnectingTitle;
/**
*
*/
private String we200BluetoothConnecting;
/**
*
*/
private String we200BluetoothConnectingContent;
public Long getId() { public Long getId() {
return id; return id;
} }
@ -595,28 +580,4 @@ public class WxInstrumentSaveReq {
public void setWe200IotVersionUpgrade(String we200IotVersionUpgrade) { public void setWe200IotVersionUpgrade(String we200IotVersionUpgrade) {
this.we200IotVersionUpgrade = we200IotVersionUpgrade; this.we200IotVersionUpgrade = we200IotVersionUpgrade;
} }
public String getWe200BluetoothConnectingTitle() {
return we200BluetoothConnectingTitle;
}
public void setWe200BluetoothConnectingTitle(String we200BluetoothConnectingTitle) {
this.we200BluetoothConnectingTitle = we200BluetoothConnectingTitle;
}
public String getWe200BluetoothConnecting() {
return we200BluetoothConnecting;
}
public void setWe200BluetoothConnecting(String we200BluetoothConnecting) {
this.we200BluetoothConnecting = we200BluetoothConnecting;
}
public String getWe200BluetoothConnectingContent() {
return we200BluetoothConnectingContent;
}
public void setWe200BluetoothConnectingContent(String we200BluetoothConnectingContent) {
this.we200BluetoothConnectingContent = we200BluetoothConnectingContent;
}
} }

@ -2,7 +2,6 @@ package com.flossom.common.core.domain.req;
import com.flossom.common.core.annotation.Excel; import com.flossom.common.core.annotation.Excel;
import com.flossom.common.core.annotation.Excel.Type; import com.flossom.common.core.annotation.Excel.Type;
import com.flossom.common.core.utils.poi.InstrumentSerialAdapter;
import com.flossom.common.core.utils.poi.InstrumentSerialValidStatusAdapter; import com.flossom.common.core.utils.poi.InstrumentSerialValidStatusAdapter;
@ -21,11 +20,11 @@ public class WxInstrumentSerialImportVm {
private String source; private String source;
/** 序列号 */ /** 序列号 */
@Excel(name = "序列号",type = Type.IMPORT, handler = InstrumentSerialAdapter.class) @Excel(name = "序列号",type = Type.IMPORT)
private String serial; private String serial;
/** 序列号有效状态1有效0无效 */ /** 序列号有效状态1有效0无效 */
@Excel(name = "有效状态(默认为有效)",type = Type.IMPORT,defaultValue = "1", combo = {"有效","无效"}, handler = InstrumentSerialValidStatusAdapter.class) @Excel(name = "有效状态:1有效0无效",type = Type.IMPORT, combo = {"有效","无效"}, handler = InstrumentSerialValidStatusAdapter.class)
private String validStatus; private String validStatus;

@ -1,7 +1,6 @@
package com.flossom.common.core.mapper; package com.flossom.common.core.mapper;
import com.flossom.common.core.domain.entity.WxInstrumentSerial; import com.flossom.common.core.domain.entity.WxInstrumentSerial;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -21,8 +20,6 @@ public interface WxInstrumentSerialMapper
*/ */
public WxInstrumentSerial selectWxInstrumentSerialById(Long id); public WxInstrumentSerial selectWxInstrumentSerialById(Long id);
public List<WxInstrumentSerial> selectWxInstrumentSerialByIdList(@Param("idList") List<Long> idList);
/** /**
* *
* *

@ -64,6 +64,4 @@ public interface WxNursingLogMapper {
public int deleteWxNursingLogByIds(Long[] ids); public int deleteWxNursingLogByIds(Long[] ids);
List<WxNursingLog> selectWxNursingLogByIdList(@Param("idList") List<Integer> idList); List<WxNursingLog> selectWxNursingLogByIdList(@Param("idList") List<Integer> idList);
WxNursingLog selectLastNursingLogByUserId(@Param("userId") Long userId, @Param("instrumentId") Long instrumentId);
} }

@ -180,29 +180,4 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault()); ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
return Date.from(zdt.toInstant()); return Date.from(zdt.toInstant());
} }
/**
* 50:40:30504030
* @param seconds
* @return
*/
public static String formatHMS(long seconds) {
long hours = seconds / 3600;
long minutes = (seconds % 3600) / 60;
long remainingSeconds = seconds % 60;
return String.format("%02d:%02d:%02d", hours, minutes, remainingSeconds);
}
/**
* 140:3014030
* @param seconds
* @return
*/
public static String formatMS(long seconds) {
long minutes = seconds / 60;
long remainingSeconds = seconds % 60;
return String.format("%02d:%02d", minutes, remainingSeconds);
}
} }

@ -1,21 +0,0 @@
package com.flossom.common.core.utils.poi;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Workbook;
/**
* {@link com.flossom.common.core.domain.req.WxInstrumentSerialImportVm#validStatus}
*/
public class InstrumentSerialAdapter implements ExcelHandlerAdapter {
@Override
public Object format(Object value, String[] args, Cell cell, Workbook wb) {
if(StringUtils.isBlank(((String) value).trim())) {
return null;
}
return ((String) value).trim();
}
}

@ -19,7 +19,7 @@ public class InstrumentSerialValidStatusAdapter implements ExcelHandlerAdapter {
if (StringUtils.equals(v, "无效")) { if (StringUtils.equals(v, "无效")) {
return 0; return 0;
} }
return 1; return null;
} }
} }

@ -25,7 +25,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="link != null and link != ''"> and link = #{link}</if> <if test="link != null and link != ''"> and link = #{link}</if>
<if test="status != null "> and status = #{status}</if> <if test="status != null "> and status = #{status}</if>
<if test="id != null "> and id != #{id}</if>
</where> </where>
</select> </select>

@ -52,13 +52,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="we200IotVersion" column="we200_iot_version" /> <result property="we200IotVersion" column="we200_iot_version" />
<result property="we200IotUpgradeData" column="we200_iot_upgrade_data" /> <result property="we200IotUpgradeData" column="we200_iot_upgrade_data" />
<result property="we200IotVersionUpgrade" column="we200_iot_version_upgrade" /> <result property="we200IotVersionUpgrade" column="we200_iot_version_upgrade" />
<result property="we200BluetoothConnectingTitle" column="we200_bluetooth_connecting_title" />
<result property="we200BluetoothConnectingContent" column="we200_bluetooth_connecting_content" />
<result property="we200BluetoothConnecting" column="we200_bluetooth_connecting" />
</resultMap> </resultMap>
<sql id="selectWxInstrumentVo"> <sql id="selectWxInstrumentVo">
select id, name, type, model, banner, logo, serial, guarantee, daily_clock_credit, is_extra_clock, binding_credit, extra_clock_credit, start_time, end_time, mini_tag_ids, mini_tag_names, wecom_tag_ids, wecom_tag_names, nursing_time, iot_version, iot_upgrade_data, is_scan_code, is_purchase, shopping_appid, shopping_path, bluetooth_connecting_title, bluetooth_connecting_content,bluetooth_connecting, bluetooth_closed_title, bluetooth_closed_content, bluetooth_closed, bluetooth_connect_fail_title, bluetooth_connect_fail_content, bluetooth_connect_fail, iot_version_upgrade, sort_no, status, manual_code_binding, scan_code_binding, create_by, create_time, update_by, update_time, remark, we200_iot_version, we200_iot_upgrade_data, we200_iot_version_upgrade, we200_bluetooth_connecting_title, we200_bluetooth_connecting_content, we200_bluetooth_connecting from wx_instrument select id, name, type, model, banner, logo, serial, guarantee, daily_clock_credit, is_extra_clock, binding_credit, extra_clock_credit, start_time, end_time, mini_tag_ids, mini_tag_names, wecom_tag_ids, wecom_tag_names, nursing_time, iot_version, iot_upgrade_data, is_scan_code, is_purchase, shopping_appid, shopping_path, bluetooth_connecting_title, bluetooth_connecting_content,bluetooth_connecting, bluetooth_closed_title, bluetooth_closed_content, bluetooth_closed, bluetooth_connect_fail_title, bluetooth_connect_fail_content, bluetooth_connect_fail, iot_version_upgrade, sort_no, status, manual_code_binding, scan_code_binding, create_by, create_time, update_by, update_time, remark, we200_iot_version, we200_iot_upgrade_data, we200_iot_version_upgrade from wx_instrument
</sql> </sql>
<select id="selectWxInstrumentList" parameterType="WxInstrument" resultMap="WxInstrumentResult"> <select id="selectWxInstrumentList" parameterType="WxInstrument" resultMap="WxInstrumentResult">
@ -105,9 +102,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="we200IotVersion != null and we200IotVersion != ''"> and we200_iot_version = #{we200IotVersion}</if> <if test="we200IotVersion != null and we200IotVersion != ''"> and we200_iot_version = #{we200IotVersion}</if>
<if test="we200IotUpgradeData != null and we200IotUpgradeData != ''"> and we200_iot_upgrade_data = #{we200IotUpgradeData}</if> <if test="we200IotUpgradeData != null and we200IotUpgradeData != ''"> and we200_iot_upgrade_data = #{we200IotUpgradeData}</if>
<if test="we200IotVersionUpgrade != null and we200IotVersionUpgrade != ''"> and we200_iot_version_upgrade = #{we200IotVersionUpgrade}</if> <if test="we200IotVersionUpgrade != null and we200IotVersionUpgrade != ''"> and we200_iot_version_upgrade = #{we200IotVersionUpgrade}</if>
<if test="we200BluetoothConnectingTitle != null and we200BluetoothConnectingTitle != ''"> and we200_bluetooth_connecting_title = #{we200BluetoothConnectingTitle}</if>
<if test="we200BluetoothConnectingContent != null and we200BluetoothConnectingContent != ''"> and we200_bluetooth_connecting_content = #{we200BluetoothConnectingContent}</if>
<if test="we200BluetoothConnecting != null and we200BluetoothConnecting != ''"> and we200_bluetooth_connecting = #{we200BluetoothConnecting}</if>
</where> </where>
order by create_time desc order by create_time desc
</select> </select>
@ -213,9 +207,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="we200IotVersion != null">we200_iot_version,</if> <if test="we200IotVersion != null">we200_iot_version,</if>
<if test="we200IotUpgradeData != null">we200_iot_upgrade_data,</if> <if test="we200IotUpgradeData != null">we200_iot_upgrade_data,</if>
<if test="we200IotVersionUpgrade != null">we200_iot_version_upgrade,</if> <if test="we200IotVersionUpgrade != null">we200_iot_version_upgrade,</if>
<if test="we200BluetoothConnectingTitle != null">we200_bluetooth_connecting_title,</if>
<if test="we200BluetoothConnectingContent != null">we200_bluetooth_connecting_Content,</if>
<if test="we200BluetoothConnecting != null">we200_bluetooth_connecting,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if> <if test="name != null and name != ''">#{name},</if>
@ -264,9 +255,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="we200IotVersion != null">#{we200IotVersion},</if> <if test="we200IotVersion != null">#{we200IotVersion},</if>
<if test="we200IotUpgradeData != null">#{we200IotUpgradeData},</if> <if test="we200IotUpgradeData != null">#{we200IotUpgradeData},</if>
<if test="we200IotVersionUpgrade != null">#{we200IotVersionUpgrade},</if> <if test="we200IotVersionUpgrade != null">#{we200IotVersionUpgrade},</if>
<if test="we200BluetoothConnectingTitle != null">#{we200BluetoothConnectingTitle},</if>
<if test="we200BluetoothConnectingContent != null">#{we200BluetoothConnectingContent},</if>
<if test="we200BluetoothConnecting != null">#{we200BluetoothConnecting},</if>
</trim> </trim>
</insert> </insert>
@ -319,9 +307,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="we200IotVersion != null">we200_iot_version = #{we200IotVersion},</if> <if test="we200IotVersion != null">we200_iot_version = #{we200IotVersion},</if>
<if test="we200IotUpgradeData != null">we200_iot_upgrade_data = #{we200IotUpgradeData},</if> <if test="we200IotUpgradeData != null">we200_iot_upgrade_data = #{we200IotUpgradeData},</if>
<if test="we200IotVersionUpgrade != null">we200_iot_version_upgrade = #{we200IotVersionUpgrade},</if> <if test="we200IotVersionUpgrade != null">we200_iot_version_upgrade = #{we200IotVersionUpgrade},</if>
<if test="we200BluetoothConnectingTitle != null">we200_bluetooth_connecting_title = #{we200BluetoothConnectingTitle},</if>
<if test="we200BluetoothConnectingContent != null">we200_bluetooth_connecting_content = #{we200BluetoothConnectingContent},</if>
<if test="we200BluetoothConnecting != null">we200_bluetooth_connecting = #{we200BluetoothConnecting},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

@ -60,14 +60,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id} where id = #{id}
</select> </select>
<select id="selectWxInstrumentSerialByIdList" parameterType="Long" resultMap="WxInstrumentSerialResult">
<include refid="selectWxInstrumentSerialVo"/>
where id in
<foreach item="id" collection="idList" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<insert id="insertWxInstrumentSerial" parameterType="WxInstrumentSerial" useGeneratedKeys="true" keyProperty="id"> <insert id="insertWxInstrumentSerial" parameterType="WxInstrumentSerial" useGeneratedKeys="true" keyProperty="id">
insert into wx_instrument_serial insert into wx_instrument_serial
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

@ -19,14 +19,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="nursingDays" column="nursing_days" />
<result property="nursingDaysWeek" column="nursing_days_week" />
<result property="nursingDaysMonth" column="nursing_days_month" />
<result property="nursingDaysYear" column="nursing_days_year" />
</resultMap> </resultMap>
<sql id="selectWxNursingLogVo"> <sql id="selectWxNursingLogVo">
select id, user_id, instrument_id, instrument_name, online, mode_id, mode_name, nursing_time, completion_percentage, status, create_by, create_time, update_by, update_time, nursing_days, nursing_days_week, nursing_days_month, nursing_days_year from wx_nursing_log select id, user_id, instrument_id, instrument_name, online, mode_id, mode_name, nursing_time, completion_percentage, status, create_by, create_time, update_by, update_time from wx_nursing_log
</sql> </sql>
<select id="selectWxNursingLogList" parameterType="WxNursingLog" resultMap="WxNursingLogResult"> <select id="selectWxNursingLogList" parameterType="WxNursingLog" resultMap="WxNursingLogResult">
@ -101,16 +97,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</select> </select>
<select id="selectLastNursingLogByUserId" resultMap="WxNursingLogResult">
<include refid="selectWxNursingLogVo"/>
WHERE
user_id = #{userId}
AND instrument_id = #{instrumentId}
ORDER BY
update_time DESC
LIMIT 1
</select>
<insert id="insertWxNursingLog" parameterType="WxNursingLog" useGeneratedKeys="true" keyProperty="id"> <insert id="insertWxNursingLog" parameterType="WxNursingLog" useGeneratedKeys="true" keyProperty="id">
insert into wx_nursing_log insert into wx_nursing_log
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -127,10 +113,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="nursingDays != null">nursing_days,</if>
<if test="nursingDaysWeek != null">nursing_days_week,</if>
<if test="nursingDaysMonth != null">nursing_days_month,</if>
<if test="nursingDaysYear != null">nursing_days_year,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if> <if test="userId != null">#{userId},</if>
@ -146,10 +128,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="nursingDays != null">#{nursingDays},</if>
<if test="nursingDaysWeek != null">#{nursingDaysWeek},</if>
<if test="nursingDaysMonth != null">#{nursingDaysMonth},</if>
<if test="nursingDaysYear != null">#{nursingDaysYear},</if>
</trim> </trim>
</insert> </insert>
@ -169,10 +147,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="nursingDays != null">nursing_days = #{nursingDays},</if>
<if test="nursingDaysWeek != null">nursing_days_week = #{nursingDaysWeek},</if>
<if test="nursingDaysMonth != null">nursing_days_month = #{nursingDaysMonth},</if>
<if test="nursingDaysYear != null">nursing_days_year = #{nursingDaysYear},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

@ -1,6 +1,5 @@
package com.flossom.miniProgram.service.impl; package com.flossom.miniProgram.service.impl;
import com.alibaba.fastjson.JSON;
import com.flossom.common.core.domain.entity.*; import com.flossom.common.core.domain.entity.*;
import com.flossom.common.core.domain.ret.WxBindingInstrumentInfo; import com.flossom.common.core.domain.ret.WxBindingInstrumentInfo;
import com.flossom.common.core.domain.ret.WxModeRet; import com.flossom.common.core.domain.ret.WxModeRet;
@ -27,8 +26,9 @@ import java.time.Instant;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalTime; import java.time.LocalTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.time.temporal.ChronoField; import java.util.ArrayList;
import java.util.*; import java.util.Date;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -172,10 +172,7 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
userBindInstrumentQuery.setInstrumentId(wxInstrumentSerial.getInstrumentId()); userBindInstrumentQuery.setInstrumentId(wxInstrumentSerial.getInstrumentId());
userBindInstrumentQuery.setBindingStatus(BindingStatusEnums.BINDED.getCode()); userBindInstrumentQuery.setBindingStatus(BindingStatusEnums.BINDED.getCode());
userBindInstrumentQuery.setStatus(Status.OK.getCode().longValue()); userBindInstrumentQuery.setStatus(Status.OK.getCode().longValue());
// 用户仪器绑定记录
List<WxUserInstrument> wxUserInstrumentList = wxUserInstrumentMapper.selectListByUserIdAndInstrumentId(userBindInstrumentQuery); List<WxUserInstrument> wxUserInstrumentList = wxUserInstrumentMapper.selectListByUserIdAndInstrumentId(userBindInstrumentQuery);
// 仪器信息
WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(wxInstrumentSerial.getInstrumentId());
// 2.1、当前用户绑定过序列号对应的仪器ID // 2.1、当前用户绑定过序列号对应的仪器ID
if (wxUserInstrumentList != null && wxUserInstrumentList.size() > 0) { if (wxUserInstrumentList != null && wxUserInstrumentList.size() > 0) {
if (wxUserInstrumentList.size() != 1) { if (wxUserInstrumentList.size() != 1) {
@ -187,10 +184,7 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
if (!StringUtils.equals(wxUserInstrument.getSerial(), serial)) { if (!StringUtils.equals(wxUserInstrument.getSerial(), serial)) {
/* 2.1.2、绑定过仪器,但不是同一个序列号,询问是否需要换绑 */ /* 2.1.2、绑定过仪器,但不是同一个序列号,询问是否需要换绑 */
logger.info("绑定过该类型仪器,但当前扫码的序列号与以前绑定的仪器的序列号不一致,询问用户是否换绑仪器"); logger.info("绑定过该类型仪器,但当前扫码的序列号与以前绑定的仪器的序列号不一致,询问用户是否换绑仪器");
Map<String, Object> resultMap = new HashMap<>(); throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_TWO.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_TWO.getCode());
resultMap.put("result", InstrumentHttpCodeEnum.TWO_HUNDRED_AND_TWO.getInfo());
resultMap.put("instrument", wxInstrument);
throw new ServiceReturnCodeException(JSON.toJSONString(resultMap), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_TWO.getCode());
} }
logger.info("扫码序列号与当前用户绑定的序列号一致,无需绑定,返回响应"); logger.info("扫码序列号与当前用户绑定的序列号一致,无需绑定,返回响应");
} }
@ -199,10 +193,7 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
// 不立即绑定 // 不立即绑定
if (!isImmediatelyBinding) { if (!isImmediatelyBinding) {
logger.info("可以绑定,但是不立即绑定,页面需要询问用户是否绑定"); logger.info("可以绑定,但是不立即绑定,页面需要询问用户是否绑定");
Map<String, Object> resultMap = new HashMap<>(); throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_ONE.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_ONE.getCode());
resultMap.put("result", InstrumentHttpCodeEnum.TWO_HUNDRED_AND_ONE.getInfo());
resultMap.put("instrument", wxInstrument);
throw new ServiceReturnCodeException(JSON.toJSONString(resultMap), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_ONE.getCode());
} }
/* 2.2.1、判断序列号是否被别人绑定了 */ /* 2.2.1、判断序列号是否被别人绑定了 */
@ -218,6 +209,7 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
} }
/* 2.2.2、绑定仪器 */ /* 2.2.2、绑定仪器 */
else { else {
WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(wxInstrumentSerial.getInstrumentId());
if (wxInstrument != null && wxInstrument.getStatus().intValue() == Status.DISABLE.getCode()) { if (wxInstrument != null && wxInstrument.getStatus().intValue() == Status.DISABLE.getCode()) {
logger.info("仪器({})被隐藏了,无法绑定", wxInstrumentSerial.getInstrumentId()); logger.info("仪器({})被隐藏了,无法绑定", wxInstrumentSerial.getInstrumentId());
throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_SIX.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_SIX.getCode()); throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_SIX.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_SIX.getCode());
@ -467,37 +459,11 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
// 查询 服务集合 // 查询 服务集合
WxModeServiceInfo wxModeServiceInfo = new WxModeServiceInfo(); WxModeServiceInfo wxModeServiceInfo = new WxModeServiceInfo();
wxModeServiceInfo.setModeId(wxMode.getId()); wxModeServiceInfo.setModeId(wxMode.getId());
List<WxModeServiceInfo> wxModeServiceInfoList = wxModeServiceInfoMapper.selectWxModeServiceInfoList(wxModeServiceInfo); wxModeRet.setServiceData(wxModeServiceInfoMapper.selectWxModeServiceInfoList(wxModeServiceInfo));
if (wxModeServiceInfoList != null && wxModeServiceInfoList.size() > 0) {
Calendar calendar = Calendar.getInstance();
for (WxModeServiceInfo modeServiceInfo : wxModeServiceInfoList) {
if (modeServiceInfo.getServiceStartTime() != null) {
Date date = modeServiceInfo.getServiceStartTime();
calendar.setTime(date);
modeServiceInfo.setServiceStartTimeStr(
DateUtils.formatMS(calendar.get(Calendar.HOUR_OF_DAY) * 60 * 60
+ calendar.get(Calendar.MINUTE) * 60
+ calendar.get(Calendar.SECOND)
)
);
}
if (modeServiceInfo.getServiceEndTime() != null) {
Date date = modeServiceInfo.getServiceEndTime();
calendar.setTime(date);
modeServiceInfo.setServiceEndTimeStr(
DateUtils.formatMS(calendar.get(Calendar.HOUR_OF_DAY) * 60 * 60
+ calendar.get(Calendar.MINUTE) * 60
+ calendar.get(Calendar.SECOND)
)
);
}
}
}
wxModeRet.setServiceData(wxModeServiceInfoList);
// 将 localTime 转为 分秒 格式 // 将 localTime 转为 分秒 格式
if (wxModeRet.getModeTime() != null) { if (wxModeRet.getModeTime() != null) {
wxModeRet.setModeTimeStr(DateUtils.formatMS(wxModeRet.getModeTime().getLong(ChronoField.SECOND_OF_DAY))); wxModeRet.setModeTimeStr(String.format("%02d:%02d", wxModeRet.getModeTime().getMinute(), wxModeRet.getModeTime().getSecond()));
} }
wxModeRetList.add(wxModeRet); wxModeRetList.add(wxModeRet);
} }

@ -1,6 +1,9 @@
package com.flossom.miniProgram.service.impl; package com.flossom.miniProgram.service.impl;
import java.time.*; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.temporal.TemporalAdjusters; import java.time.temporal.TemporalAdjusters;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -65,10 +68,17 @@ public class WxNursingLogServiceImpl implements IWxNursingLogService {
totalNursingSecond += wxNursingLog.getNursingTime().toSecondOfDay(); totalNursingSecond += wxNursingLog.getNursingTime().toSecondOfDay();
} }
} }
wxNursingStatisticsRet.setNursingTime(DateUtils.formatHMS(totalNursingSecond)); wxNursingStatisticsRet.setNursingTime(formatDuration(totalNursingSecond));
return wxNursingStatisticsRet; return wxNursingStatisticsRet;
} }
return new WxNursingStatisticsRet(0, DateUtils.formatHMS(0)); return new WxNursingStatisticsRet(0, formatDuration(0));
}
private String formatDuration(int seconds) {
int hours = seconds / 3600;
int minutes = (seconds % 3600) / 60;
int remainingSeconds = seconds % 60;
return String.format("%02d:%02d:%02d", hours, minutes, remainingSeconds);
} }
/** /**
@ -188,65 +198,6 @@ public class WxNursingLogServiceImpl implements IWxNursingLogService {
wxNursingLog.setUpdateBy(SecurityUtils.getLoginUser().getWxUserMember().getNickname()); wxNursingLog.setUpdateBy(SecurityUtils.getLoginUser().getWxUserMember().getNickname());
wxNursingLog.setUpdateTime(DateUtils.getNowDate()); wxNursingLog.setUpdateTime(DateUtils.getNowDate());
wxNursingLog.setStatus(Status.OK.getCode().longValue()); wxNursingLog.setStatus(Status.OK.getCode().longValue());
/* 护理天数计算 */
// 1、获取最近一条护理记录
WxNursingLog lastNursingLog = wxNursingLogMapper.selectLastNursingLogByUserId(SecurityUtils.getLoginUser().getWxUserMember().getId(), wxNursingLog.getInstrumentId());
if (lastNursingLog != null) {
// 2、有最近的一条护理记录
// 获取护理时间和当前时间,转为 localDateTime
LocalDateTime nursingDateTime = LocalDateTime.ofInstant(lastNursingLog.getCreateTime().toInstant(), ZoneId.systemDefault());
LocalDateTime nowDateTime = LocalDateTime.now();
// 2.1、总护理天数:直接 +1
if (lastNursingLog.getNursingDays() != null) {
wxNursingLog.setNursingDays(lastNursingLog.getNursingDays() + 1);
} else {
// 总护理天数为null说明之前没有计算总数目前是直接重新开始
wxNursingLog.setNursingDays(1);
}
// 2.2、本年护理天数:判断是否是本年的记录,是 +1不是则为1
LocalDateTime firstDateOfYear = nowDateTime.with(TemporalAdjusters.firstDayOfYear()).with(LocalTime.MIN);
LocalDateTime lastDateOfYear = nowDateTime.with(TemporalAdjusters.lastDayOfYear()).with(LocalTime.MAX);
if (lastNursingLog.getNursingDaysYear() != null && (
nursingDateTime.isEqual(firstDateOfYear) || nursingDateTime.isEqual(lastDateOfYear)
|| (nursingDateTime.isAfter(firstDateOfYear) && nursingDateTime.isBefore(lastDateOfYear))
)) {
wxNursingLog.setNursingDaysYear(lastNursingLog.getNursingDaysYear() + 1);
} else {
// 本年护理天数为null有两种情况要么之前没有计算要么是新的一年的第一条护理记录目前是直接重新开始
wxNursingLog.setNursingDaysYear(1);
}
// 2.3、本月护理天数:判断是否是本月的记录,是 +1不是则为1
LocalDateTime firstDateOfMonth = nowDateTime.with(TemporalAdjusters.firstDayOfMonth()).with(LocalTime.MIN);
LocalDateTime lastDateOfMonth = nowDateTime.with(TemporalAdjusters.lastDayOfMonth()).with(LocalTime.MAX);
if (lastNursingLog.getNursingDaysMonth() != null && (
nursingDateTime.isEqual(firstDateOfMonth) || nursingDateTime.isEqual(lastDateOfMonth)
|| (nursingDateTime.isAfter(firstDateOfMonth) && nursingDateTime.isBefore(lastDateOfMonth))
)) {
wxNursingLog.setNursingDaysMonth(lastNursingLog.getNursingDaysMonth() + 1);
} else {
// 本月护理天数为null有两种情况要么之前没有计算要么是新的一月的第一条护理记录目前是直接重新开始
wxNursingLog.setNursingDaysMonth(1);
}
// 2.4、本周护理天数:判断是否是本周的记录,是 +1不是则为1
LocalDateTime firstDateOfWeek = nowDateTime.toLocalDate().with(DayOfWeek.MONDAY).atStartOfDay();
LocalDateTime lastDateOfWeek = nowDateTime.toLocalDate().with(DayOfWeek.SUNDAY).atTime(LocalTime.MAX);
if (lastNursingLog.getNursingDaysWeek() != null && (
nursingDateTime.isEqual(firstDateOfWeek) || nursingDateTime.isEqual(lastDateOfWeek)
|| (nursingDateTime.isAfter(firstDateOfWeek) && nursingDateTime.isBefore(lastDateOfWeek))
)) {
wxNursingLog.setNursingDaysWeek(lastNursingLog.getNursingDaysWeek() + 1);
} else {
// 本周护理天数为null有两种情况要么之前没有计算要么是新的一周的第一条护理记录目前是直接重新开始
wxNursingLog.setNursingDaysWeek(1);
}
} else {
// 3、没有最近的一条护理记录
wxNursingLog.setNursingDays(1);
wxNursingLog.setNursingDaysYear(1);
wxNursingLog.setNursingDaysMonth(1);
wxNursingLog.setNursingDaysWeek(1);
}
wxNursingLogMapper.insertWxNursingLog(wxNursingLog); wxNursingLogMapper.insertWxNursingLog(wxNursingLog);
} }
} }

@ -50,11 +50,6 @@ public class WxInstrumentController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/listAll")
public List<WxInstrument> listAll(WxInstrumentReq wxInstrumentReq) {
return wxInstrumentService.selectWxInstrumentPage(wxInstrumentReq);
}
/** /**
* *
*/ */

@ -6,8 +6,10 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.common.utils.CollectionUtils;
import com.flossom.common.core.domain.entity.*; import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.domain.R; import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.WxMode;
import com.flossom.common.core.domain.entity.WxModeTag;
import com.flossom.common.core.enums.TagTypeStatusEnum; import com.flossom.common.core.enums.TagTypeStatusEnum;
import com.flossom.common.core.utils.poi.ExcelUtil; import com.flossom.common.core.utils.poi.ExcelUtil;
import com.flossom.common.core.web.controller.BaseController; import com.flossom.common.core.web.controller.BaseController;
@ -16,7 +18,8 @@ import com.flossom.common.core.web.page.TableDataInfo;
import com.flossom.common.log.annotation.Log; import com.flossom.common.log.annotation.Log;
import com.flossom.common.log.enums.BusinessType; import com.flossom.common.log.enums.BusinessType;
import com.flossom.common.security.annotation.RequiresPermissions; import com.flossom.common.security.annotation.RequiresPermissions;
import com.flossom.system.service.*; import com.flossom.system.service.ISysTagService;
import com.flossom.system.service.IWxModeTagService;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -27,6 +30,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.flossom.system.service.IWxModeService;
/** /**
* Controller * Controller
@ -44,10 +48,7 @@ public class WxModeController extends BaseController
private IWxModeTagService wxModeTagService; private IWxModeTagService wxModeTagService;
@Autowired @Autowired
private ISysTagService sysTagService; private ISysTagService sysTagService;
@Autowired
private IWxModeCombineInfoService wxModeCombineInfoService;
@Autowired
private IWxInstrumentModeService wxInstrumentModeService;
/** /**
* *
*/ */
@ -154,32 +155,6 @@ public class WxModeController extends BaseController
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
{ {
Boolean delFlag = false;
// 先查询是否被占用
for (long id : ids) {
WxModeCombineInfo combineInfo = new WxModeCombineInfo();
combineInfo.setCombineModeId(id);
List<WxModeCombineInfo> wxModeCombineInfos = wxModeCombineInfoService.selectWxModeCombineInfoList(combineInfo);
if (CollectionUtils.isNotEmpty(wxModeCombineInfos)) {
delFlag = true;
}
}
if (delFlag) {
return error("删除的模式已经被组合占用,不支持删除");
}
// 查看仪器是否被占用
Boolean delInstrumentFlag = false;
for (long id : ids) {
WxInstrumentMode wxInstrumentMode = new WxInstrumentMode();
wxInstrumentMode.setModeId(id);
List<WxInstrumentMode> wxInstrumentModes = wxInstrumentModeService.selectWxInstrumentModeList(wxInstrumentMode);
if (CollectionUtils.isNotEmpty(wxInstrumentModes)) {
delInstrumentFlag = true;
}
}
if (delInstrumentFlag) {
return error("删除的模式已经被仪器占用,不支持删除");
}
return toAjax(wxModeService.deleteWxModeByIds(ids)); return toAjax(wxModeService.deleteWxModeByIds(ids));
} }
} }

@ -56,21 +56,16 @@ public class WxUserInstrumentController extends BaseController
public TableDataInfo list(WxUserInstrument wxUserInstrument) public TableDataInfo list(WxUserInstrument wxUserInstrument)
{ {
// 用户相关信息 // 用户相关信息
if(!(wxUserInstrument.getNickName() == null && wxUserInstrument.getUserIdArray() == null WxUserMemberVm wxUserMemberVm = new WxUserMemberVm();
&& wxUserInstrument.getUserPhone() == null)) { wxUserMemberVm.setNickname(wxUserInstrument.getNickName());
WxUserMemberVm wxUserMemberVm = new WxUserMemberVm(); if(wxUserInstrument.getUserIdArray() != null && wxUserInstrument.getUserIdArray().size() > 0) {
wxUserMemberVm.setNickname(wxUserInstrument.getNickName()); wxUserMemberVm.setId(wxUserInstrument.getUserIdArray().stream().map(String::valueOf).collect(Collectors.joining(",")));
if(wxUserInstrument.getUserIdArray() != null && wxUserInstrument.getUserIdArray().size() > 0) { }
wxUserMemberVm.setId(wxUserInstrument.getUserIdArray().stream().map(String::valueOf).collect(Collectors.joining(","))); wxUserMemberVm.setMobile(wxUserInstrument.getUserPhone());
} List<WxUserMember> wxUserMemberList = wxUserMemberService.selectWxUserMemberList(wxUserMemberVm);
wxUserMemberVm.setMobile(wxUserInstrument.getUserPhone()); if(wxUserMemberList != null && wxUserMemberList.size() > 0) {
List<WxUserMember> wxUserMemberList = wxUserMemberService.selectWxUserMemberList(wxUserMemberVm); String collect = wxUserMemberList.stream().map(WxUserMember::getId).map(String::valueOf).collect(Collectors.joining(","));
if(wxUserMemberList != null && wxUserMemberList.size() > 0) { wxUserInstrument.setUserIds(collect);
String collect = wxUserMemberList.stream().map(WxUserMember::getId).map(String::valueOf).collect(Collectors.joining(","));
wxUserInstrument.setUserIds(collect);
} else {
wxUserInstrument.setUserIds("0L");
}
} }
startPage(); startPage();
@ -172,23 +167,6 @@ public class WxUserInstrumentController extends BaseController
@Log(title = "批量导出", businessType = BusinessType.EXPORT) @Log(title = "批量导出", businessType = BusinessType.EXPORT)
@PostMapping("/batchExport") @PostMapping("/batchExport")
public void batchExport(HttpServletResponse response, WxUserInstrument wxUserInstrument) { public void batchExport(HttpServletResponse response, WxUserInstrument wxUserInstrument) {
if(!(wxUserInstrument.getNickName() == null && wxUserInstrument.getUserIdArray() == null
&& wxUserInstrument.getUserPhone() == null)) {
WxUserMemberVm wxUserMemberVm = new WxUserMemberVm();
wxUserMemberVm.setNickname(wxUserInstrument.getNickName());
if(wxUserInstrument.getUserIdArray() != null && wxUserInstrument.getUserIdArray().size() > 0) {
wxUserMemberVm.setId(wxUserInstrument.getUserIdArray().stream().map(String::valueOf).collect(Collectors.joining(",")));
}
wxUserMemberVm.setMobile(wxUserInstrument.getUserPhone());
List<WxUserMember> wxUserMemberList = wxUserMemberService.selectWxUserMemberList(wxUserMemberVm);
if(wxUserMemberList != null && wxUserMemberList.size() > 0) {
String collect = wxUserMemberList.stream().map(WxUserMember::getId).map(String::valueOf).collect(Collectors.joining(","));
wxUserInstrument.setUserIds(collect);
} else {
wxUserInstrument.setUserIds("0L");
}
}
List<WxUserInstrumentExportVm> userInstrumentExportData = wxUserInstrumentService.findUserInstrumentExportData(wxUserInstrument); List<WxUserInstrumentExportVm> userInstrumentExportData = wxUserInstrumentService.findUserInstrumentExportData(wxUserInstrument);
ExcelUtil<WxUserInstrumentExportVm> util = new ExcelUtil<WxUserInstrumentExportVm>(WxUserInstrumentExportVm.class); ExcelUtil<WxUserInstrumentExportVm> util = new ExcelUtil<WxUserInstrumentExportVm>(WxUserInstrumentExportVm.class);
util.exportExcel(response, userInstrumentExportData, "用户仪器绑定数据", wxUserInstrument.getExportFields()); util.exportExcel(response, userInstrumentExportData, "用户仪器绑定数据", wxUserInstrument.getExportFields());

@ -3,8 +3,6 @@ package com.flossom.system.service.impl;
import java.util.List; import java.util.List;
import com.flossom.common.core.domain.entity.WxInstrumentInstructions; import com.flossom.common.core.domain.entity.WxInstrumentInstructions;
import com.flossom.common.core.enums.Status;
import com.flossom.common.core.exception.ServiceException;
import com.flossom.common.core.mapper.WxInstrumentInstructionsMapper; import com.flossom.common.core.mapper.WxInstrumentInstructionsMapper;
import com.flossom.common.core.utils.DateUtils; import com.flossom.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -68,13 +66,6 @@ public class WxInstrumentInstructionsServiceImpl implements IWxInstrumentInstruc
@Override @Override
public int insertWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions) { public int insertWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions) {
wxInstrumentInstructions.setCreateTime(DateUtils.getNowDate()); wxInstrumentInstructions.setCreateTime(DateUtils.getNowDate());
WxInstrumentInstructions query = new WxInstrumentInstructions();
query.setName(wxInstrumentInstructions.getName());
query.setStatus(Status.OK.getCode().longValue());
List<WxInstrumentInstructions> instructions = wxInstrumentInstructionsMapper.selectWxInstrumentInstructionsList(query);
if(instructions != null && instructions.size() > 0) {
throw new ServiceException("不允许填写相同的说明书类型");
}
return wxInstrumentInstructionsMapper.insertWxInstrumentInstructions(wxInstrumentInstructions); return wxInstrumentInstructionsMapper.insertWxInstrumentInstructions(wxInstrumentInstructions);
} }
@ -86,14 +77,6 @@ public class WxInstrumentInstructionsServiceImpl implements IWxInstrumentInstruc
*/ */
@Override @Override
public int updateWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions) { public int updateWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions) {
WxInstrumentInstructions query = new WxInstrumentInstructions();
query.setId(wxInstrumentInstructions.getId());
query.setName(wxInstrumentInstructions.getName());
query.setStatus(Status.OK.getCode().longValue());
List<WxInstrumentInstructions> instructions = wxInstrumentInstructionsMapper.selectWxInstrumentInstructionsList(query);
if(instructions != null && instructions.size() > 0) {
throw new ServiceException("不允许填写相同的说明书类型");
}
return wxInstrumentInstructionsMapper.updateWxInstrumentInstructions(wxInstrumentInstructions); return wxInstrumentInstructionsMapper.updateWxInstrumentInstructions(wxInstrumentInstructions);
} }

@ -1,6 +1,5 @@
package com.flossom.system.service.impl; package com.flossom.system.service.impl;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -10,7 +9,6 @@ import com.flossom.common.core.domain.entity.WxInstrument;
import com.flossom.common.core.domain.entity.WxInstrumentSerial; import com.flossom.common.core.domain.entity.WxInstrumentSerial;
import com.flossom.common.core.domain.req.WxInstrumentSerialExportVm; import com.flossom.common.core.domain.req.WxInstrumentSerialExportVm;
import com.flossom.common.core.domain.req.WxInstrumentSerialImportVm; import com.flossom.common.core.domain.req.WxInstrumentSerialImportVm;
import com.flossom.common.core.enums.BindingStatusEnums;
import com.flossom.common.core.exception.ServiceException; import com.flossom.common.core.exception.ServiceException;
import com.flossom.common.core.mapper.WxInstrumentMapper; import com.flossom.common.core.mapper.WxInstrumentMapper;
import com.flossom.common.core.mapper.WxInstrumentSerialMapper; import com.flossom.common.core.mapper.WxInstrumentSerialMapper;
@ -23,7 +21,6 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.flossom.system.service.IWxInstrumentSerialService; import com.flossom.system.service.IWxInstrumentSerialService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
/** /**
@ -124,17 +121,8 @@ public class WxInstrumentSerialServiceImpl implements IWxInstrumentSerialService
* @return * @return
*/ */
@Override @Override
@Transactional
public int deleteWxInstrumentSerialByIds(Long[] ids) public int deleteWxInstrumentSerialByIds(Long[] ids)
{ {
List<WxInstrumentSerial> wxInstrumentSerialList = wxInstrumentSerialMapper.selectWxInstrumentSerialByIdList(Arrays.asList(ids));
if (wxInstrumentSerialList != null && wxInstrumentSerialList.size() > 0) {
for (WxInstrumentSerial wxInstrumentSerial : wxInstrumentSerialList) {
if (wxInstrumentSerial.getBindingStatus() == BindingStatusEnums.BINDED.getCode()) {
throw new ServiceException("删除失败,只能删除已解绑状态和未绑定状态的数据,您选中的内容存在【已绑定状态】请重试");
}
}
}
return wxInstrumentSerialMapper.deleteWxInstrumentSerialByIds(ids); return wxInstrumentSerialMapper.deleteWxInstrumentSerialByIds(ids);
} }
@ -151,16 +139,7 @@ public class WxInstrumentSerialServiceImpl implements IWxInstrumentSerialService
} }
@Override @Override
@Transactional
public int deleteAll() { public int deleteAll() {
List<WxInstrumentSerial> wxInstrumentSerialList = wxInstrumentSerialMapper.selectWxInstrumentSerialList(new WxInstrumentSerial());
if (wxInstrumentSerialList != null && wxInstrumentSerialList.size() > 0) {
for (WxInstrumentSerial wxInstrumentSerial : wxInstrumentSerialList) {
if (wxInstrumentSerial.getBindingStatus() == BindingStatusEnums.BINDED.getCode()) {
throw new ServiceException("删除失败,只能删除已解绑状态和未绑定状态的数据,您选中的内容存在【已绑定状态】请重试");
}
}
}
return wxInstrumentSerialMapper.deleteAll(); return wxInstrumentSerialMapper.deleteAll();
} }

@ -2,9 +2,7 @@ package com.flossom.system.service.impl;
import java.util.List; import java.util.List;
import com.flossom.common.core.domain.entity.WxInstrument;
import com.flossom.common.core.domain.entity.WxUserInstrumentLog; import com.flossom.common.core.domain.entity.WxUserInstrumentLog;
import com.flossom.common.core.mapper.WxInstrumentMapper;
import com.flossom.common.core.mapper.WxUserInstrumentLogMapper; import com.flossom.common.core.mapper.WxUserInstrumentLogMapper;
import com.flossom.common.core.utils.DateUtils; import com.flossom.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -23,9 +21,6 @@ public class WxUserInstrumentLogServiceImpl implements IWxUserInstrumentLogServi
@Autowired @Autowired
private WxUserInstrumentLogMapper wxUserInstrumentLogMapper; private WxUserInstrumentLogMapper wxUserInstrumentLogMapper;
@Autowired
private WxInstrumentMapper wxInstrumentMapper;
/** /**
* *
* *
@ -60,10 +55,6 @@ public class WxUserInstrumentLogServiceImpl implements IWxUserInstrumentLogServi
public int insertWxUserInstrumentLog(WxUserInstrumentLog wxUserInstrumentLog) public int insertWxUserInstrumentLog(WxUserInstrumentLog wxUserInstrumentLog)
{ {
wxUserInstrumentLog.setCreateTime(DateUtils.getNowDate()); wxUserInstrumentLog.setCreateTime(DateUtils.getNowDate());
WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(wxUserInstrumentLog.getInstrumentId());
if(wxInstrument != null) {
wxUserInstrumentLog.setInstrumentName(wxInstrument.getName());
}
// 设置系列号图片 // 设置系列号图片
return wxUserInstrumentLogMapper.insertWxUserInstrumentLog(wxUserInstrumentLog); return wxUserInstrumentLogMapper.insertWxUserInstrumentLog(wxUserInstrumentLog);
} }

@ -9,13 +9,11 @@ import com.flossom.common.core.domain.req.WxUserInstrumentExportVm;
import com.flossom.common.core.enums.BindingStatusEnums; import com.flossom.common.core.enums.BindingStatusEnums;
import com.flossom.common.core.mapper.*; import com.flossom.common.core.mapper.*;
import com.flossom.common.core.utils.DateUtils; import com.flossom.common.core.utils.DateUtils;
import com.flossom.common.security.utils.SecurityUtils;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.flossom.system.service.IWxUserInstrumentService; import com.flossom.system.service.IWxUserInstrumentService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
/** /**
@ -166,15 +164,14 @@ public class WxUserInstrumentServiceImpl implements IWxUserInstrumentService
} }
@Override @Override
@Transactional
public Map<String,String> changeSerial(WxUserInstrument wxUserInstrument) { public Map<String,String> changeSerial(WxUserInstrument wxUserInstrument) {
Map<String,String> resultMap = Maps.newHashMap(); Map<String,String> resultMap = Maps.newHashMap();
// 查询序列号是否有效存在 // 查询序列号是否有效存在
WxInstrumentSerial serial = new WxInstrumentSerial(); WxInstrumentSerial serial = new WxInstrumentSerial();
serial.setSerial(wxUserInstrument.getSerial()); serial.setSerial(wxUserInstrument.getSerial());
serial.setValidStatus(1); // 有效 serial.setValidStatus(1); // 有效
WxInstrumentSerial wxInstrumentSerial = instrumentSerialMapper.selectEntityListBySerial(serial); List<WxInstrumentSerial> serialList = instrumentSerialMapper.selectWxInstrumentSerialList(serial);
if (wxInstrumentSerial == null) { if (CollectionUtils.isEmpty(serialList)) {
resultMap.put("message","序列号无效,请确定后再绑定"); resultMap.put("message","序列号无效,请确定后再绑定");
resultMap.put("code", "500"); resultMap.put("code", "500");
return resultMap; return resultMap;
@ -182,16 +179,15 @@ public class WxUserInstrumentServiceImpl implements IWxUserInstrumentService
// 查看是否已经被绑定 // 查看是否已经被绑定
WxUserInstrument userInstrument = new WxUserInstrument(); WxUserInstrument userInstrument = new WxUserInstrument();
userInstrument.setSerial(wxUserInstrument.getSerial()); userInstrument.setSerial(wxUserInstrument.getSerial());
userInstrument.setBindingStatus(BindingStatusEnums.BINDED.getCode()); List<WxUserInstrument> wxUserInstrumentsList = wxUserInstrumentMapper.selectWxUserInstrumentList(userInstrument);
Integer count = wxUserInstrumentMapper.selectUiByInstrumentId(userInstrument); if (!CollectionUtils.isEmpty(wxUserInstrumentsList)) {
if (count != null && count > 0) {
resultMap.put("message","该序列号已经被绑定"); resultMap.put("message","该序列号已经被绑定");
resultMap.put("code", "500"); resultMap.put("code", "500");
return resultMap; return resultMap;
} }
// 开始绑定 // 开始绑定
WxUserInstrument userInstrumentRecord = wxUserInstrumentMapper.selectWxUserInstrumentById(wxUserInstrument.getId()); WxUserInstrument userInstrumentRecord = wxUserInstrumentMapper.selectWxUserInstrumentById(wxUserInstrument.getId());
String oldSerial = userInstrumentRecord.getSerial();
// 操作变更日记 // 操作变更日记
// 是否已经绑定 // 是否已经绑定
if (0 == userInstrumentRecord.getBindingStatus()) { if (0 == userInstrumentRecord.getBindingStatus()) {
@ -212,7 +208,7 @@ public class WxUserInstrumentServiceImpl implements IWxUserInstrumentService
} }
} }
// 更新信息 // 更新信息
WxInstrumentSerial instrumentSerialVo = wxInstrumentSerial; WxInstrumentSerial instrumentSerialVo = serialList.get(0);
userInstrumentRecord.setInstrumentId(instrumentSerialVo.getInstrumentId()); userInstrumentRecord.setInstrumentId(instrumentSerialVo.getInstrumentId());
userInstrumentRecord.setSerial(instrumentSerialVo.getSerial()); userInstrumentRecord.setSerial(instrumentSerialVo.getSerial());
// userInstrumentRecord.setSerialImage(userInstrument.getSerialImage()); // userInstrumentRecord.setSerialImage(userInstrument.getSerialImage());
@ -220,24 +216,6 @@ public class WxUserInstrumentServiceImpl implements IWxUserInstrumentService
this.saveLog(userInstrumentRecord,0); this.saveLog(userInstrumentRecord,0);
// 更新绑定数据 // 更新绑定数据
WxInstrumentSerial oldUpdate = new WxInstrumentSerial();
oldUpdate.setBindingStatus(BindingStatusEnums.UN_BOUND.getCode());
oldUpdate.setUpdateBy(SecurityUtils.getUsername());
oldUpdate.setUpdateTime(DateUtils.getNowDate());
oldUpdate.setSerial(oldSerial);
instrumentSerialMapper.updateBySerial(oldUpdate);
WxInstrumentSerial newUpdate = new WxInstrumentSerial();
newUpdate.setBindingStatus(BindingStatusEnums.BINDED.getCode());
newUpdate.setUpdateBy(SecurityUtils.getUsername());
newUpdate.setUpdateTime(DateUtils.getNowDate());
newUpdate.setSerial(wxUserInstrument.getSerial());
instrumentSerialMapper.updateBySerial(newUpdate);
userInstrumentRecord.setUserId(null);
userInstrumentRecord.setInstrumentId(null);
userInstrumentRecord.setBindingStatus(BindingStatusEnums.BINDED.getCode());
wxUserInstrumentMapper.updateWxUserInstrument(userInstrumentRecord); wxUserInstrumentMapper.updateWxUserInstrument(userInstrumentRecord);
resultMap.put("message","换绑序列号成功"); resultMap.put("message","换绑序列号成功");
resultMap.put("code", "200"); resultMap.put("code", "200");

@ -9,14 +9,6 @@ export function listInstrument(query) {
}) })
} }
export function listAllInstrument(query) {
return request({
url: '/system/instrument/listAll',
method: 'get',
params: query
})
}
// 查询仪器列详细 // 查询仪器列详细
export function getInstrument(id) { export function getInstrument(id) {
return request({ return request({

@ -140,12 +140,10 @@ export default {
handler(val) { handler(val) {
if (val !== this.currentValue) { if (val !== this.currentValue) {
this.currentValue = val === null ? '' : val this.currentValue = val === null ? '' : val
setTimeout(() => { let ele = document.body.querySelector(`#${this.tableName} .editor`)
let ele = document.body.querySelector(`#${this.tableName} .editor`) if (ele) {
if (ele) { ele.children[0].innerHTML = this.currentValue
ele.children[0].innerHTML = this.currentValue }
}
}, 100)
} }
}, },
immediate: true, immediate: true,

@ -1,7 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form ref="form" :model="form" :rules="rules" label-width="150px"> <el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-form-item label="日常打卡奖励" prop="dailyClockCredit"> <el-form-item label="日常打卡奖励" prop="dailyClockCredit">
<el-input v-model="form.dailyClockCredit" placeholder="请输入日常打卡奖励" style="width: 25%;"/> <el-input v-model="form.dailyClockCredit" placeholder="请输入日常打卡奖励" style="width: 25%;"/>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
@ -11,10 +11,10 @@
> >
<el-switch v-model="form.isExtraClock"> </el-switch> <el-switch v-model="form.isExtraClock"> </el-switch>
</el-form-item> </el-form-item>
<el-form-item label="额外打卡奖励积分" prop="extraClockCredit" v-if="form.isExtraClock"> <el-form-item label="额外打卡奖励积分" prop="extraClockCredit" v-if="form.isExtraClock">
<el-input v-model="form.extraClockCredit" placeholder="请输入额外打卡奖励积分" style="width: 25%;"/> <el-input v-model="form.extraClockCredit" placeholder="请输入额外打卡奖励积分" style="width: 25%;"/>
</el-form-item> </el-form-item>
<el-form-item label="额外打卡时间段" prop="timeRange" label-width="150px" v-if="form.isExtraClock"> <el-form-item label="额外打卡时间段" prop="timeRange" label-width="150px" v-if="form.isExtraClock">
<el-date-picker <el-date-picker
v-model="form.timeRange" v-model="form.timeRange"
type="datetimerange" type="datetimerange"
@ -23,7 +23,6 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']">
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>

@ -1,276 +1,108 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-collapse accordion style="margin-bottom: 10px" v-model="activeNames"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-collapse-item name="search"> <el-form-item label="微信用户" prop="userId">
<template slot="title"> <el-input
<div class="margin-top" style="border-left: solid 2px #419eff;padding-left: 10px;font-size: 18px !important;color: #000;"> v-model="queryParams.userId"
搜索 placeholder="请输入微信用户"
</div> clearable
</template> @keyup.enter.native="handleQuery"
<div style="margin-top: 10px"> />
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> </el-form-item>
<div style="display: flex"> <el-form-item label="当天使用过的仪器" prop="instrumentId">
<el-popover <el-input
placement="top-start" v-model="queryParams.instrumentId"
width="200" placeholder="请输入当天使用过的仪器"
trigger="click" clearable
content="手机号码和用户编号,满足其中之一内容即可" @keyup.enter.native="handleQuery"
> />
<el-form-item label="用户编号" prop="id" slot="reference"> </el-form-item>
<el-input <el-form-item label="当天使用过的仪器" prop="instrumentName">
v-model="queryParams.id" <el-input
placeholder="搜索多个请用英文逗号隔开" v-model="queryParams.instrumentName"
clearable placeholder="请输入当天使用过的仪器"
@keyup.enter.native="handleQuery" clearable
/> @keyup.enter.native="handleQuery"
</el-form-item> />
</el-popover> </el-form-item>
<el-form-item label="会员昵称" prop="userId"> <el-form-item>
<el-input <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
v-model="queryParams.userId" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
placeholder="请输入单个会员昵称搜索" </el-form-item>
clearable </el-form>
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-popover
placement="top-start"
trigger="click"
content="手机号码和用户编号,满足其中之一内容即可"
>
<el-form-item label="手机号码" prop="mobile" slot="reference">
<el-input
v-model="queryParams.mobile"
placeholder="搜索多个请用英文逗号隔开"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-popover>
<el-form-item label="仪器名称" prop="source">
<el-select
v-model="queryParams.instrumentIdArray"
placeholder="请选择类型"
multiple
:style="{ width: '100%' }"
clearable
>
<el-option
v-for="item in instrumentList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</div>
<div style="display: flex">
<el-form-item label="打卡时间" prop="startTime">
<el-date-picker clearable
v-model="queryParams.startTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm"
placeholder="请选择操作开始时间">
</el-date-picker>
</el-form-item>
<el-form-item prop="endTime">
<el-date-picker clearable
v-model="queryParams.endTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm"
placeholder="请选择操作结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="用户注册时间" prop="startTime">
<el-date-picker clearable
v-model="queryParams.startTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm"
placeholder="请选择操作开始时间">
</el-date-picker>
</el-form-item>
<el-form-item prop="endTime">
<el-date-picker clearable
v-model="queryParams.endTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm"
placeholder="请选择操作结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="最新打卡时间" prop="startTime">
<el-date-picker clearable
v-model="queryParams.startTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm"
placeholder="请选择操作开始时间">
</el-date-picker>
</el-form-item>
<el-form-item prop="endTime">
<el-date-picker clearable
v-model="queryParams.endTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm"
placeholder="请选择操作结束时间">
</el-date-picker>
</el-form-item>
</div>
<div style="display: flex">
<el-popover
placement="top-start"
width="200"
trigger="click"
content="外部标签和小程序标签,同时满足所选内容"
>
<el-form-item
label="外部标签"
prop="wecomTags"
slot="reference"
>
<el-select
v-model="queryParams.wecomTags"
multiple
placeholder="请选择"
>
<el-option
v-for="item in wecomTags"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-popover>
<el-popover
placement="top-start"
width="200"
trigger="click"
content="外部标签和小程序标签,同时满足所选内容"
>
<el-form-item
label="小程序标签"
prop="miniProgramTags"
slot="reference"
>
<el-select
v-model="queryParams.miniProgramTags"
multiple
placeholder="请选择"
>
<el-option
v-for="item in miniProgramTags"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-popover>
<el-form-item label="打卡范围" prop="credit">
<el-input-number
:min="0"
:precision="0"
v-model="queryParams.creditStart"
@keyup.enter.native="handleQuery"
></el-input-number>
<el-input-number
:min="0"
:precision="0"
v-model="queryParams.creditEnd"
@keyup.enter.native="handleQuery"
></el-input-number>
<el-button icon="el-icon-close" circle ></el-button>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索
</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置
</el-button
>
</el-form-item>
</div>
</el-form>
</div>
</el-collapse-item>
</el-collapse>
<!-- 批量操作下拉选项 -->
<div
class="margin-top"
style="
border-left: solid 2px #419eff;
padding-left: 10px;
font-size: 18px;
color: #000;
margin-bottom: 10px;
"
>
批量操作
</div>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-select <el-button
v-model="batchOperateValue" type="primary"
placeholder="批量操作" plain
icon="el-icon-plus"
size="mini" size="mini"
clearable @click="handleAdd"
> v-hasPermi="['system:clockLog:add']"
<el-option label="批量添加小程序标签" :value="1"></el-option> >新增</el-button>
<el-option label="批量删除小程序标签" :value="2"></el-option>
<el-option label="全量添加小程序标签" :value="3"></el-option>
<el-option label="全量删除小程序标签" :value="4"></el-option>
<el-option label="批量加减积分" :value="5"></el-option>
<el-option label="全量加减积分" :value="6"></el-option>
<el-option label="批量发送话术" :value="7"></el-option>
<el-option label="全量发送话术" :value="8"></el-option>
<el-option label="批量备注" :value="9"></el-option>
<el-option label="全量备注" :value="10"></el-option>
<el-option label="注销账号" :value="11"></el-option>
<el-option label="导出数据" :value="12"></el-option>
<el-option label="导出全量数据" :value="13"></el-option>
</el-select>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="success"
plain plain
icon="el-icon-warning" icon="el-icon-edit"
size="mini" size="mini"
>确认 :disabled="single"
</el-button> @click="handleUpdate"
v-hasPermi="['system:clockLog:edit']"
>修改</el-button>
</el-col> </el-col>
<right-toolbar <el-col :span="1.5">
:showSearch.sync="showSearch" <el-button
@queryTable="getList" type="danger"
></right-toolbar> plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:clockLog:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:clockLog:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="clockLogList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="clockLogList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="头像" align="center" prop="userId" /> <el-table-column label="${comment}" align="center" prop="id" />
<el-table-column label="会员昵称" align="center" prop="userId" /> <el-table-column label="微信用户" align="center" prop="userId" />
<el-table-column label="用户编号" align="center" prop="userId" /> <el-table-column label="当天使用过的仪器" align="center" prop="instrumentId" />
<el-table-column label="手机号码" align="center" prop="userId" /> <el-table-column label="当天使用过的仪器" align="center" prop="instrumentName" />
<el-table-column label="仪器名称" align="center" prop="userId" /> <el-table-column label="打卡心得" align="center" prop="clockContent" />
<el-table-column label="打卡记录" align="center" prop="userId" />
<el-table-column label="打卡天数" align="center" prop="instrumentId" />
<el-table-column label="最新打卡时间" align="center" prop="instrumentName" />
<el-table-column label="小程序标签" align="center" prop="clockContent" />
<el-table-column label="外部标签" align="center" prop="clockContent" />
<el-table-column label="用户注册时间" align="center" prop="clockContent" />
<el-table-column label="状态" align="center" prop="status" /> <el-table-column label="状态" align="center" prop="status" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:clockLog:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:clockLog:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<pagination <pagination
@ -280,23 +112,38 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改用户打卡对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="微信用户" prop="userId">
<el-input v-model="form.userId" placeholder="请输入微信用户" />
</el-form-item>
<el-form-item label="当天使用过的仪器" prop="instrumentId">
<el-input v-model="form.instrumentId" placeholder="请输入当天使用过的仪器" />
</el-form-item>
<el-form-item label="当天使用过的仪器" prop="instrumentName">
<el-input v-model="form.instrumentName" placeholder="请输入当天使用过的仪器" />
</el-form-item>
<el-form-item label="打卡心得">
<editor v-model="form.clockContent" :min-height="192"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listClockLog, getClockLog, delClockLog, addClockLog, updateClockLog } from "@/api/system/clockLog"; import { listClockLog, getClockLog, delClockLog, addClockLog, updateClockLog } from "@/api/system/clockLog";
import {listInstrument} from "@/api/system/instrument";
import {
getMiniProgramTags,
getWecomTags,
} from '@/api/system/member'
export default { export default {
name: "ClockLog", name: "ClockLog",
data() { data() {
return { return {
batchOperateValue: '',
//
activeNames: ['search'],
// //
loading: true, loading: true,
// //
@ -311,12 +158,6 @@ export default {
total: 0, total: 0,
// //
clockLogList: [], clockLogList: [],
//
instrumentList: [],
//
miniProgramTags: [],
//
wecomTags: [],
// //
title: "", title: "",
// //
@ -340,25 +181,8 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.queryInstrument();
this.getTag();
}, },
methods: { methods: {
getTag(){
//
getMiniProgramTags().then((Response) => {
this.miniProgramTags = Response.data
})
//
getWecomTags().then((Response) => {
this.wecomTags = Response.data
})
},
queryInstrument(){
listInstrument({}).then(response => {
this.instrumentList = response.rows;
});
},
/** 查询用户打卡列表 */ /** 查询用户打卡列表 */
getList() { getList() {
this.loading = true; this.loading = true;

File diff suppressed because it is too large Load Diff

@ -32,7 +32,7 @@
:style="{ width: '100%' }" :style="{ width: '100%' }"
clearable clearable
> >
<el-option label="全部" :value="null" /> <el-option label="全部" value="" />
<el-option label="已绑定" value="0" /> <el-option label="已绑定" value="0" />
<el-option label="未绑定" value="1" /> <el-option label="未绑定" value="1" />
<el-option label="已解绑" value="2" /> <el-option label="已解绑" value="2" />
@ -86,6 +86,7 @@
>确认 >确认
</el-button> </el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
@ -196,12 +197,13 @@
<!-- <el-form-item label="仪器id" prop="instrumentId">--> <!-- <el-form-item label="仪器id" prop="instrumentId">-->
<!-- <el-input v-model="form.instrumentId" placeholder="请输入仪器id" />--> <!-- <el-input v-model="form.instrumentId" placeholder="请输入仪器id" />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="仪器" prop="instrumentId"> <el-form-item label="仪器型号" prop="instrumentId">
<el-select :disabled="isDisabled(form)" <el-select :disabled="isDisabled(form)"
v-model="form.instrumentId" v-model="form.instrumentId"
placeholder="请选择仪器" placeholder="请选择型号"
:style="{ width: '100%' }" :style="{ width: '100%' }"
clearable> clearable
>
<el-option <el-option
v-for="item in instrumentList" v-for="item in instrumentList"
:key="item.id" :key="item.id"
@ -211,7 +213,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="序列号" prop="serial" > <el-form-item label="序列号" prop="serial" >
<el-input v-model="form.serial" placeholder="请输入序列号" :disabled="isDisabled(form)" maxlength="30" minlength="1"/> <el-input v-model="form.serial" placeholder="请输入序列号" :disabled="isDisabled(form)" />
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" maxlength="50"/> <el-input v-model="form.remark" placeholder="请输入备注" maxlength="50"/>
@ -245,7 +247,6 @@
:on-success="handleFileSuccess" :on-success="handleFileSuccess"
:auto-upload="false" :auto-upload="false"
drag drag
:before-upload="handleBeforeUpload"
> >
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
@ -346,7 +347,7 @@
<script> <script>
import { listSerial, getSerial, delSerial, addSerial, updateSerial,delSerialAll,updateStatus } from "@/api/system/instrumentSerial"; import { listSerial, getSerial, delSerial, addSerial, updateSerial,delSerialAll,updateStatus } from "@/api/system/instrumentSerial";
import {listAllInstrument, listInstrument} from "@/api/system/instrument"; import {listInstrument} from "@/api/system/instrument";
import {getToken} from "@/utils/auth"; import {getToken} from "@/utils/auth";
import {listLog} from "@/api/system/userInstrumentLog" import {listLog} from "@/api/system/userInstrumentLog"
@ -478,8 +479,8 @@ export default {
return false return false
}, },
queryInstrument(){ queryInstrument(){
listAllInstrument({}).then(response => { listInstrument({}).then(response => {
this.instrumentList = response; this.instrumentList = response.rows;
}); });
}, },
/** 查询仪器序列号关联列表 */ /** 查询仪器序列号关联列表 */
@ -548,7 +549,6 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加仪器序列号关联"; this.title = "添加仪器序列号关联";
this.form.instrumentId = '';
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -564,12 +564,6 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
var pattern = /^[a-zA-Z0-9\s]+$/;
if (!pattern.test(this.form.serial) || this.form.serial.trim().length === 0
|| this.form.serial.trim().length > 30) {
this.$modal.msgError("请输入正确的序列号");
return;
}
if (this.form.id != null) { if (this.form.id != null) {
updateSerial(this.form).then(response => { updateSerial(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
@ -759,18 +753,7 @@ export default {
// //
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit();
}, }
handleBeforeUpload(file) {
let fileType = ["xls", "xlsx"]
const fileName = file.name.split('.');
const fileExt = fileName[fileName.length - 1];
const isTypeOk = fileType.indexOf(fileExt) >= 0;
if (!isTypeOk) {
this.$modal.msgError(`文件类型只能为xls格式/.xlsx格式`);
return false;
}
return true;
},
} }
}; };
</script> </script>

@ -24,19 +24,8 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="仪器型号" align="center" prop="instrumentModel" /> <el-table-column label="仪器型号" align="center" prop="instrumentModel" />
<el-table-column label="模式类型" align="center" prop="modeType" > <el-table-column label="模式类型" align="center" prop="modeType" />
<template slot-scope="scope"> <el-table-column label="模式分类" align="center" prop="modeClass" />
<dict-tag :options="dict.type.instrument_model_type_fr200" :value="scope.row.modeType" v-if="scope.row.instrumentModel == 'FR200'"/>
<dict-tag :options="dict.type.instrument_model_type_wl200" :value="scope.row.modeType" v-if="scope.row.instrumentModel == 'WL200'"/>
<dict-tag :options="dict.type.instrument_model_type_m01" :value="scope.row.modeType" v-if="scope.row.instrumentModel == 'M01'"/>
</template>
</el-table-column>
<el-table-column label="模式分类" align="center" prop="modeClass" >
<template slot-scope="scope">
<dict-tag :options="dict.type.instrument_model_class_fr200" :value="scope.row.modeClass" v-if="scope.row.instrumentModel == 'FR200'"/>
<dict-tag :options="dict.type.instrument_model_class_wl200" :value="scope.row.modeClass" v-if="scope.row.instrumentModel == 'WL200'"/>
</template>
</el-table-column>
<el-table-column label="模式名称" align="center" prop="modeName" /> <el-table-column label="模式名称" align="center" prop="modeName" />
<el-table-column label="模式时长(分钟)" align="center" prop="modeTime" width="180" /> <el-table-column label="模式时长(分钟)" align="center" prop="modeTime" width="180" />
<el-table-column label="模式封面图片" align="center" prop="modeBanner" > <el-table-column label="模式封面图片" align="center" prop="modeBanner" >
@ -115,15 +104,15 @@
<el-row> <el-row>
<el-col :span ="12"> <el-col :span ="12">
<el-form-item label="仪器类型" prop="instrumentType"> <el-form-item label="仪器类型" prop="instrumentType">
<el-select v-model="form.instrumentType" @change="setModeTitle" :disabled="isDisabled(form)"> <el-select v-model="form.instrumentType" @change="setModeTitle">
<el-option label="非iot仪器" :value="1" :key="1"></el-option> <el-option label="非iot仪器" :value="1" :key="1"></el-option>
<el-option label="iot仪器" :value="2" :key="2"></el-option> <el-option label="iot仪器" :value="2" :key="2"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span ="12"> <el-col :span ="12">
<el-form-item label="仪器型号" prop="instrumentModel" v-if="form.instrumentType == 2" > <el-form-item label="仪器型号" prop="instrumentModel" v-if="form.instrumentType == 2">
<el-select v-model="form.instrumentModel" @change="setModeType" :disabled="isDisabled(form)"> <el-select v-model="form.instrumentModel" @change="setModeType">
<el-option <el-option
v-for="dict in dict.type.instrument_model" v-for="dict in dict.type.instrument_model"
:key="dict.value" :key="dict.value"
@ -136,7 +125,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span ="12"> <el-col :span ="12">
<el-form-item label="模式类型" prop="modeType" v-if="form.instrumentType == 2&&form.instrumentModel == 'FR200'"> <el-form-item label="模式类型" prop="modeType" v-if="form.instrumentModel == 'FR200'">
<el-select v-model="form.modeType"> <el-select v-model="form.modeType">
<el-option <el-option
v-for="dict in dict.type.instrument_model_type_fr200" v-for="dict in dict.type.instrument_model_type_fr200"
@ -146,7 +135,7 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="模式类型" prop="modeType" v-if="form.instrumentType == 2&&form.instrumentModel == 'WL200'"> <el-form-item label="模式类型" prop="modeType" v-if="form.instrumentModel == 'WL200'">
<el-select v-model="form.modeType"> <el-select v-model="form.modeType">
<el-option <el-option
v-for="dict in dict.type.instrument_model_type_wl200" v-for="dict in dict.type.instrument_model_type_wl200"
@ -156,7 +145,7 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="模式类型" prop="modeType" v-if="form.instrumentType == 2&&form.instrumentModel == 'M01'"> <el-form-item label="模式类型" prop="modeType" v-if="form.instrumentModel == 'M01'">
<el-select v-model="form.modeType"> <el-select v-model="form.modeType">
<el-option <el-option
v-for="dict in dict.type.instrument_model_type_m01" v-for="dict in dict.type.instrument_model_type_m01"
@ -168,7 +157,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span ="12"> <el-col :span ="12">
<el-form-item label="模式分类" prop="modeClass" v-if="form.instrumentType == 2&&form.instrumentModel == 'FR200'"> <el-form-item label="模式分类" prop="modeClass" v-if="form.instrumentModel == 'FR200'">
<el-select v-model="form.modeClass"> <el-select v-model="form.modeClass">
<el-option <el-option
v-for="dict in dict.type.instrument_model_class_fr200" v-for="dict in dict.type.instrument_model_class_fr200"
@ -178,7 +167,7 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="模式分类" prop="modeClass" v-if="form.instrumentType == 2&&form.instrumentModel == 'WL200'"> <el-form-item label="模式分类" prop="modeClass" v-if="form.instrumentModel == 'WL200'">
<el-select v-model="form.modeClass"> <el-select v-model="form.modeClass">
<el-option <el-option
v-for="dict in dict.type.instrument_model_class_wl200" v-for="dict in dict.type.instrument_model_class_wl200"
@ -192,7 +181,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span ="12"> <el-col :span ="12">
<el-form-item label="舱体模式" prop="isCabinMode" v-if="form.instrumentType == 2&&form.instrumentModel == 'WL200' & form.modeType != 'MaskCustom'"> <el-form-item label="舱体模式" prop="isCabinMode" v-if="form.instrumentModel == 'WL200' & form.modeType != '10'">
<el-select v-model="form.isCabinMode"> <el-select v-model="form.isCabinMode">
<el-option label="是" :value="1"></el-option> <el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option> <el-option label="否" :value="0"></el-option>
@ -200,7 +189,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span ="12"> <el-col :span ="12">
<el-form-item label="自定义组合" prop="isCustomMode" v-if="(form.modeType != 'MaskCustom'&&form.instrumentType==2)" label-width="100px"> <el-form-item label="自定义组合" prop="isCustomMode" v-if="(form.modeType != '10'&&form.instrumentType==2)" label-width="100px">
<el-select v-model="form.isCustomMode"> <el-select v-model="form.isCustomMode">
<el-option label="是" :value="1"></el-option> <el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option> <el-option label="否" :value="0"></el-option>
@ -215,7 +204,7 @@
<el-input v-model="form.modeDesc" placeholder="请输入模式描述" maxlength="10"/> <el-input v-model="form.modeDesc" placeholder="请输入模式描述" maxlength="10"/>
</el-form-item> </el-form-item>
<el-form-item label="模式时长" prop="modeTime" v-if="form.instrumentType == 2"> <el-form-item label="模式时长" prop="modeTime" v-if="form.instrumentType == 2">
<el-input v-model="form.modeTime" placeholder="请输入模式时间" maxlength="5"/> <el-input v-model="form.modeTime" placeholder="请输入模式时间"/>
</el-form-item> </el-form-item>
<el-form-item label="模式封面" prop="modeBanner"> <el-form-item label="模式封面" prop="modeBanner">
<el-upload <el-upload
@ -237,7 +226,6 @@
</el-form-item> </el-form-item>
<el-form-item :label="modeVideoTitle" prop="modeVideo" label-width="100px"> <el-form-item :label="modeVideoTitle" prop="modeVideo" label-width="100px">
<el-upload <el-upload
ref = "modeVideo"
class="upload-demo" class="upload-demo"
:action="upload.url" :action="upload.url"
:before-upload="limitVideFileType" :before-upload="limitVideFileType"
@ -269,7 +257,6 @@
|| scope.row.openSourceSuffix === 'JPG' || scope.row.openSourceSuffix === 'JPG'
|| scope.row.openSourceSuffix === 'svg' || scope.row.openSourceSuffix === 'svg'
|| scope.row.openSourceSuffix === 'SVG' || scope.row.openSourceSuffix === 'SVG'
|| scope.row.openSourceSuffix === 'mp4'
"> ">
<ImagePreview :src="scope.row.openSourceUrl" /> <ImagePreview :src="scope.row.openSourceUrl" />
</template> </template>
@ -291,15 +278,12 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-form-item> </el-form-item>
<el-form-item label="启动/暂停图片GIF" required label-width="135px" v-if="form.instrumentType == 2"> <el-form-item label="启动/暂停图片GIF" required label-width="130px" v-if="form.instrumentType == 2">
<el-button type="primary" @click="addService"></el-button> <el-button type="primary" @click="addService"></el-button>
<div v-for="(item,index) of serviceData"> <div v-for="(item,index) of serviceData">
<el-row style="margin-top: 10px"> <el-row style="margin-top: 10px">
<el-col :span ="12"> <el-col :span ="12">
<el-form-item label="护理时间范围" prop="startTimeArray" label-width="110px"> <el-form-item label="护理时间范围" prop="startTimeArray" label-width="110px">
<div style="position: relative">
<i class="little-red-heart el-icon-star-on"></i>
</div>
<el-time-picker <el-time-picker
is-range is-range
v-model="item.startTimeArray" v-model="item.startTimeArray"
@ -316,12 +300,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row style="margin-top: 20px"> <el-row style="margin-top: 10px">
<el-col :span ="12"> <el-col :span ="12">
<el-form-item label="启动图片GIF" prop="startSourceArray" label-width="110px"> <el-form-item label="启动图片GIF" prop="modeBanner" label-width="110px">
<div style="position: relative">
<i class="little-red-heart el-icon-star-on"></i>
</div>
<el-upload <el-upload
:action="upload.url+'/else'" :action="upload.url+'/else'"
:headers="upload.headers" :headers="upload.headers"
@ -341,10 +322,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span ="12"> <el-col :span ="12">
<el-form-item label="暂停图片GIF" prop="stopSourceArray" label-width="110px"> <el-form-item label="暂停图片GIF" prop="modeBanner" label-width="110px">
<div style="position: relative">
<i class="little-red-heart el-icon-star-on"></i>
</div>
<el-upload <el-upload
:action="upload.url+'/else'" :action="upload.url+'/else'"
:headers="upload.headers" :headers="upload.headers"
@ -366,7 +344,7 @@
</el-row> </el-row>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item v-if="form.instrumentType == 2 && form.isCustomMode == 1" label="模式组合" required label-width="120px"> <el-form-item v-if="form.instrumentType == 2" label="模式组合" required label-width="120px">
<el-button type="primary" @click="addCombine"></el-button> <el-button type="primary" @click="addCombine"></el-button>
<div v-for="(item,index) of combineData"> <div v-for="(item,index) of combineData">
<el-divider content-position="left">组合{{index+1}}</el-divider> <el-divider content-position="left">组合{{index+1}}</el-divider>
@ -396,9 +374,6 @@
<el-form-item label="使用技术" prop="technologyInfo" label-width="110px" style="margin-top: 10px"> <el-form-item label="使用技术" prop="technologyInfo" label-width="110px" style="margin-top: 10px">
<div style="position: relative; left: 30px">
<i class="little-red-heart2 el-icon-star-on"></i>
</div>
<el-select <el-select
v-model="item.technologyArray" v-model="item.technologyArray"
placeholder="请选择技术" placeholder="请选择技术"
@ -415,9 +390,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="模式功效" prop="effectContent" label-width="110px" style="margin-top: 10px"> <el-form-item label="模式功效" prop="effectContent" label-width="110px" style="margin-top: 10px">
<div style="position: relative; left: 30px">
<i class="little-red-heart2 el-icon-star-on"></i>
</div>
<el-input v-model="item.effectContent" placeholder="请输入模式功效" maxlength="50"/> <el-input v-model="item.effectContent" placeholder="请输入模式功效" maxlength="50"/>
</el-form-item> </el-form-item>
</div> </div>
@ -546,9 +518,6 @@ export default {
instrumentType: [ instrumentType: [
{ required: true, message: "仪器类型不能为空", trigger: "blur" } { required: true, message: "仪器类型不能为空", trigger: "blur" }
], ],
modeBanner: [
{ required: true, message: "模式封面图片不能为空", trigger: "blur" }
],
instrumentModel: [ instrumentModel: [
{ required: true, message: "仪器型号不能为空", trigger: "blur" } { required: true, message: "仪器型号不能为空", trigger: "blur" }
], ],
@ -572,7 +541,7 @@ export default {
], ],
modeTime: [ modeTime: [
{ required: true, message: "模式时长不能为空", trigger: "blur" } { required: true, message: "模式时长不能为空", trigger: "blur" }
] ],
} }
}; };
}, },
@ -582,12 +551,6 @@ export default {
}, },
methods: { methods: {
isDisabled(row){
if (row.id) {
return true;
}
return false
},
getCombineList(){ getCombineList(){
listModeAll(this.combineModeQueryParams).then(response => { listModeAll(this.combineModeQueryParams).then(response => {
this.combineModeList = response.data; this.combineModeList = response.data;
@ -732,84 +695,39 @@ export default {
// //
this.form.serviceData = this.serviceData; this.form.serviceData = this.serviceData;
let flag = false; let flag = false;
let serverImageFlag = false;
if (this.form.serviceData.length > 0) { if (this.form.serviceData.length > 0) {
this.form.serviceData.forEach(data => { this.form.serviceData.forEach(data => {
if(data.startTimeArray == null || data.startTimeArray.length == 0) { if(!data.startTimeArray) {
flag = true; flag = true;
} }
if (data.startSourceArray.length == 0 ) {
serverImageFlag = true;
} else {
if(!data.startSourceArray[0].url) {
serverImageFlag = true;
}
}
if (data.stopSourceArray.length == 0) {
serverImageFlag = true;
} else {
if(!data.stopSourceArray[0].url) {
serverImageFlag = true;
}
}
}) })
} else {
this.$message.error("启动/暂停图片不能为空");
return;
} }
if (flag) { if (flag) {
this.$message.error("护理时间范围不能为空"); this.$message.error("服务时间不能为空");
return;
}
if (serverImageFlag) {
this.$message.error("启动/暂停图片不能为空");
return; return;
} }
// //
this.form.combineData = this.combineData; this.form.combineData = this.combineData;
let technologyFlag = false; let technologyFlag = false;
let effectContent = false; let effectContent = false;
let modeNameFlag = false;
if (this.form.combineData.length>0){ if (this.form.combineData.length>0){
this.form.combineData.forEach(data => { this.form.combineData.forEach(data => {
console.log("----"+data.technologyArray) if (!data.technologyArray) {
if (data.technologyArray.length == 0) {
technologyFlag = true; technologyFlag = true;
} }
if (!data.effectContent) { if (!data.effectContent) {
effectContent = true; effectContent = true;
} }
if (!data.combineModeId) {
modeNameFlag = true;
}
}) })
} else {
if (this.form.instrumentType == 2 && this.form.isCustomMode == 1) {
this.$message.error("模式组合不能为空");
return;
}
} }
console.log(this.form.combineData) if (technologyFlag) {
if (technologyFlag && this.form.isCustomMode == 1) {
this.$message.error("使用技术不能为空"); this.$message.error("使用技术不能为空");
return; return;
} }
if (modeNameFlag && this.form.isCustomMode == 1) { if (effectContent) {
this.$message.error("模式组合中的模式名称不能为空");
return;
}
if (effectContent && this.form.isCustomMode == 1) {
this.$message.error("模式功效不能为空"); this.$message.error("模式功效不能为空");
return; return;
} }
if (this.form.modeTime) {
const regex = /[^0-9]/g;
if (regex.test(this.form.modeTime)) {
this.$modal.msgError("时长仅支持输入正整数");
return;
}
}
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
@ -854,9 +772,8 @@ export default {
}, `mode_${new Date().getTime()}.xlsx`) }, `mode_${new Date().getTime()}.xlsx`)
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
this.$refs.modeVideo.clearFiles(); console.log('调用了')
this.fileList = []; this.fileList = [];
this.form.modeVideo = null;
}, },
handleRemoveBanner(file, fileList) { handleRemoveBanner(file, fileList) {
// console.log('') // console.log('')
@ -886,7 +803,7 @@ export default {
}, },
limitFileType(file) { limitFileType(file) {
const imageType = ['image/jpeg', 'image/jpg', 'image/png', 'image/svg', 'video/mp4','video/avi','video/mov','video/rmvb','video/rm','video/flv','video/3gp'] const imageType = ['image/jpeg', 'image/jpg', 'image/png', 'image/svg', ['image/jpeg', 'image/jpg', 'image/png', 'image/svg', 'video/mp4','video/avi','video/mov','video/rmvb','video/rm','video/flv','video/3gp']]
let isVideo = imageType.includes(file.type) let isVideo = imageType.includes(file.type)
// //
if (!isVideo) { if (!isVideo) {
@ -1093,21 +1010,3 @@ export default {
} }
}; };
</script> </script>
<style lang="scss" scoped>
.little-red-heart {
position: absolute;
top: 12px;
left: -108px;
color: #ff4949;
font-size: 7px;
}
.little-red-heart2 {
position: absolute;
top: 12px;
left: -108px;
color: #ff4949;
font-size: 7px;
}
</style>

@ -32,7 +32,7 @@
</el-form-item> </el-form-item>
</el-popover> </el-popover>
<el-form-item label="仪器名称" prop="instrumentIdArray"> <el-form-item label="仪器名称" prop="source">
<el-select <el-select
v-model="queryParams.instrumentIdArray" v-model="queryParams.instrumentIdArray"
placeholder="请选择类型" placeholder="请选择类型"
@ -48,7 +48,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="绑定状态" prop="bindingStatus"> <el-form-item label="绑定状态" prop="source">
<el-select <el-select
v-model="queryParams.bindingStatus" v-model="queryParams.bindingStatus"
placeholder="请选择类型" placeholder="请选择类型"
@ -76,11 +76,11 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="操作时间" prop="startTime"> <el-form-item label="操作开始" prop="startTime">
<el-date-picker clearable <el-date-picker clearable
v-model="queryParams.startTime" v-model="queryParams.startTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm"
placeholder="请选择操作开始时间"> placeholder="请选择操作开始时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -88,7 +88,7 @@
<el-date-picker clearable <el-date-picker clearable
v-model="queryParams.endTime" v-model="queryParams.endTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm"
placeholder="请选择操作结束时间"> placeholder="请选择操作结束时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -161,7 +161,16 @@
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="bingCancel(scope.row)" @click="bingCancel(scope.row)"
:disabled="!(scope.row.bindingStatus == 0)" v-if="scope.row.bindingStatus == 0"
v-hasPermi="['system:instrument:edit']"
>解绑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="bingCancel(scope.row)"
v-if="scope.row.bindingStatus != 0"
disabled
v-hasPermi="['system:instrument:edit']" v-hasPermi="['system:instrument:edit']"
>解绑</el-button> >解绑</el-button>
<el-button <el-button
@ -358,7 +367,7 @@
<script> <script>
import { listUserInstrument, getInstrument, delInstrument, addInstrument, updateInstrument,changeSerial,changeGuarantee } from "@/api/system/userInstrument"; import { listUserInstrument, getInstrument, delInstrument, addInstrument, updateInstrument,changeSerial,changeGuarantee } from "@/api/system/userInstrument";
import {listAllInstrument, listInstrument} from "@/api/system/instrument"; import {listInstrument} from "@/api/system/instrument";
import {listLog,addLog} from "@/api/system/userInstrumentLog" import {listLog,addLog} from "@/api/system/userInstrumentLog"
export default { export default {
name: "Instrument", name: "Instrument",
@ -491,8 +500,8 @@ export default {
this.guaranteeForm.guarantee = ""; this.guaranteeForm.guarantee = "";
}, },
queryInstrument(){ queryInstrument(){
listAllInstrument({}).then(response => { listInstrument({}).then(response => {
this.instrumentList = response; this.instrumentList = response.rows;
}); });
}, },
/** 查询用户仪器绑定列表 */ /** 查询用户仪器绑定列表 */
@ -744,7 +753,6 @@ export default {
this.cancelExportFieldsDialog(); this.cancelExportFieldsDialog();
} }
if (this.batchOperateValue == 2) { if (this.batchOperateValue == 2) {
console.log(this.exportFieldList)
let exportFields = Object.values(this.exportFieldList).filter(val => val != null); let exportFields = Object.values(this.exportFieldList).filter(val => val != null);
if (exportFields.length == 0) { if (exportFields.length == 0) {
this.$modal.msgError("请选择导出字段"); this.$modal.msgError("请选择导出字段");
@ -752,7 +760,6 @@ export default {
} }
this.queryParams.userInstrumentIdList = null; this.queryParams.userInstrumentIdList = null;
this.queryParams.exportFields = exportFields; this.queryParams.exportFields = exportFields;
this.queryParams.queryString = this.exportFieldsForm.queryString;
this.download('/system/userInstrument/batchExport', { this.download('/system/userInstrument/batchExport', {
...Object.assign({}, this.queryParams, {exportFields: exportFields}) ...Object.assign({}, this.queryParams, {exportFields: exportFields})
}, `仪器绑定_${new Date().getTime()}.xlsx`) }, `仪器绑定_${new Date().getTime()}.xlsx`)

Loading…
Cancel
Save