Compare commits

...

53 Commits

Author SHA1 Message Date
382696293@qq.com 48ddfebdf7 仪器新增 we200蓝牙连接 配置 2 years ago
382696293@qq.com fecf9628fb 【ID1000531】仪器绑定记录-操作时间时分秒,输入秒后,点击确定,会变为00 2 years ago
382696293@qq.com bb92e3d320 【ID1000531】仪器绑定记录-操作时间时分秒,输入秒后,点击确定,会变为00 2 years ago
elliott c6e9aca9e5 模式修改优化处理 2 years ago
elliott 2599790dd5 模式修改优化处理 2 years ago
382696293@qq.com 291d008313 【ID1000533】仪器绑定记录-换绑序列号输入1111,提示: 该序列号已经被绑定,提示有误,序列号列表都没有该序列号 2 years ago
382696293@qq.com ae9afa472f 护理记录:总护理次数,本年护理次数,本月护理次数,本周护理次数 2 years ago
382696293@qq.com 2306e15515 Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104 2 years ago
382696293@qq.com ecf404313a 序列号列表新增仪器数据获取 2 years ago
elliott ca24aa9835 模式修改优化处理 2 years ago
382696293@qq.com b4f33450f9 绑定仪器,需要换绑时返回仪器信息 2 years ago
blak-kong e270a5b9f5 富文本图片渲染失败的问题 2 years ago
382696293@qq.com 7a681d6412 仪器列表的仪器升级介绍 富文本框 图片没有回显 2 years ago
382696293@qq.com bfb4d31525 【ID1000462】仪器管理-用户仪器绑定绑定状态为:已解绑,操作项【解绑】按钮未置灰 2 years ago
382696293@qq.com 894dfa751e 【ID1000396】仪器管理-序列号列表导入,状态为空和异常输入,均导入成功,为空导入后状态为有效,异常输入导入后状态为无效 2 years ago
382696293@qq.com bfd4b1b855 多选下拉框组件偏移 2 years ago
382696293@qq.com d6ade55835 【ID1000459】仪器管理-用户仪器绑定-导出全量数据,详情数据范围:全部记录详情,导出文档数据为最新记录详情 2 years ago
382696293@qq.com ba3c96cbb8 【ID1000458】仪器管理-用户仪器绑定【仪器名称】和【绑定状态】搜索后,点击【重置】无反应 2 years ago
382696293@qq.com e570ff40ee Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104 2 years ago
382696293@qq.com 72a73de344 【ID1000452】仪器管理-仪器列表-配置说明书,说明书链接未上传正确链接,上传了图片,上传成功,点击【查看说明书】跳转异常 2 years ago
elliott 3250e6fdfe Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104 2 years ago
elliott 72cb41b7fd 模式修改优化处理 2 years ago
382696293@qq.com 40a63515fa 对 仪器 校验优化 2 years ago
382696293@qq.com 074fef8c3d 【ID1000399】仪器管理-用户仪器绑定-记录详情只显示最新记录详情,应该显示全部记录详情 2 years ago
382696293@qq.com 6bd169c750 Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104 2 years ago
382696293@qq.com b91b60258d 【ID1000399】仪器管理-用户仪器绑定-记录详情只显示最新记录详情,应该显示全部记录详情 2 years ago
elliott e2829a6426 Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104 2 years ago
elliott b35cc3b6de 模式修改优化处理 2 years ago
382696293@qq.com 5fbe8f88f7 【ID1000395】用户管理、序列号列表导入pdf文件,有两种错误提示,文件已上传,可复现 2 years ago
382696293@qq.com bb18fd6145 解绑仪器保存仪器名称 2 years ago
382696293@qq.com 937b269a94 【ID1000420】
仪器管理-仪器列表-仪器封面、仪器LOGO、仪器序列号图片未校验上传类型
2 years ago
382696293@qq.com 4b7193951b 【ID1000421】仪器管理-仪器列表,新增【扫码绑定介绍图片】改为【扫码绑定介绍视频/图片】 2 years ago
382696293@qq.com 59aca8971d 【ID1000422】仪器管理-仪器列表-新增手写绑定介绍视频/图片、扫码绑定介绍视频/图片上传大于10M,或小于10M的视频,大于1M,或小于1M的图片,均提示:上传文件大小不能超过 1 MB! 2 years ago
382696293@qq.com 88607c16b6 【ID1000425】仪器管理-仪器列表-新增仪器类型选择IOT仪器后,切换为非IOT仪器,模式显示的是IOT仪器型号,且下方提示仪器模式不能为空 2 years ago
382696293@qq.com c5b20fa501 仪器管理-仪器介绍和初次护理弹窗优化 2 years ago
382696293@qq.com 29d0593735 仪器管理-删除说明优化 2 years ago
382696293@qq.com c6475f2a11 仪器管理-说明书优化 2 years ago
382696293@qq.com 3ca80f079a 【ID1000454】仪器管理-用户仪器绑定【手机号码】搜索异常,无法输入搜索 2 years ago
382696293@qq.com 3936ab253d 【ID1000459】仪器管理-用户仪器绑定-导出全量数据,详情数据范围:全部记录详情,导出文档数据为最新记录详情 2 years ago
382696293@qq.com 363801934e Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104 2 years ago
382696293@qq.com 57191f2884 服务时间格式化 2 years ago
elliott 43ea1f0f8b Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104 2 years ago
382696293@qq.com 0b3012be74 Bug:【ID1000460】打卡管理-额外打卡时间段的结束时间是否可以设置23:59分 2 years ago
elliott b841f0c231 模式修改优化处理 2 years ago
382696293@qq.com 8c4d1e05ea Bug:【ID1000464】仪器管理-序列号列表【绑定状态】未默认全部 2 years ago
382696293@qq.com c60853f82e Bug:【ID1000467】仪器管理-序列号列表,【删除批量数据】/【删除全量数据】删除已绑定状态数据,删除成功 2 years ago
382696293@qq.com 6ae1176885 时间格式化 2 years ago
382696293@qq.com 71e02685eb 时间格式化 2 years ago
382696293@qq.com 0065d417bf 时间格式化 2 years ago
382696293@qq.com a5f34fda1f 时间格式化 2 years ago
382696293@qq.com 6063b4d5da Bug:模式的服务时间格式化 2 years ago
382696293@qq.com b00735b2aa Bug:【ID1000469】ID1000468】 2 years ago
382696293@qq.com 3191bdd3ec Bug:【ID1000469】仪器管理-序列号列表,新增序列号为中文,新增成功,超过三十个字符,提示:系统异常,请联系管理员 2 years ago

@ -49,6 +49,9 @@ 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;
} }
@ -97,6 +100,14 @@ 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,6 +232,21 @@ 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;
} }
@ -364,7 +379,7 @@ public class WxInstrument extends BaseEntity {
this.nursingTime = nursingTime; this.nursingTime = nursingTime;
// 将 localTime 转为 分秒 格式 // 将 localTime 转为 分秒 格式
if (nursingTime != null) { if (nursingTime != null) {
this.nursingTimeStr = String.format("%02d:%02d", nursingTime.getMinute(), nursingTime.getSecond()); this.nursingTimeStr = DateUtils.formatMS(nursingTime.getLong(ChronoField.SECOND_OF_DAY));
} }
} }
@ -575,4 +590,28 @@ 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,6 +42,8 @@ public class WxInstrumentInstructions extends BaseEntity {
*/ */
private String nameUrl; private String nameUrl;
private boolean isSave = true;
/** /**
* 0 1 * 0 1
*/ */
@ -96,6 +98,14 @@ 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,15 +26,25 @@ public class WxModeServiceInfo extends BaseEntity
private Long modeId; private Long modeId;
/** 服务开始时间 */ /** 服务开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "HH:mm:ss")
@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 = "yyyy-MM-dd") @JsonFormat(pattern = "HH:mm:ss")
@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;
@ -109,6 +119,22 @@ 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,6 +245,21 @@ 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;
} }
@ -580,4 +595,28 @@ 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,6 +2,7 @@ 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;
@ -20,11 +21,11 @@ public class WxInstrumentSerialImportVm {
private String source; private String source;
/** 序列号 */ /** 序列号 */
@Excel(name = "序列号",type = Type.IMPORT) @Excel(name = "序列号",type = Type.IMPORT, handler = InstrumentSerialAdapter.class)
private String serial; private String serial;
/** 序列号有效状态1有效0无效 */ /** 序列号有效状态1有效0无效 */
@Excel(name = "有效状态:1有效0无效",type = Type.IMPORT, combo = {"有效","无效"}, handler = InstrumentSerialValidStatusAdapter.class) @Excel(name = "有效状态(默认为有效)",type = Type.IMPORT,defaultValue = "1", combo = {"有效","无效"}, handler = InstrumentSerialValidStatusAdapter.class)
private String validStatus; private String validStatus;

@ -1,6 +1,7 @@
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;
@ -20,6 +21,8 @@ public interface WxInstrumentSerialMapper
*/ */
public WxInstrumentSerial selectWxInstrumentSerialById(Long id); public WxInstrumentSerial selectWxInstrumentSerialById(Long id);
public List<WxInstrumentSerial> selectWxInstrumentSerialByIdList(@Param("idList") List<Long> idList);
/** /**
* *
* *

@ -64,4 +64,6 @@ 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,4 +180,29 @@ 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);
}
} }

@ -0,0 +1,21 @@
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 null; return 1;
} }
} }

@ -25,6 +25,7 @@ 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,10 +52,13 @@ 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 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, we200_bluetooth_connecting_title, we200_bluetooth_connecting_content, we200_bluetooth_connecting from wx_instrument
</sql> </sql>
<select id="selectWxInstrumentList" parameterType="WxInstrument" resultMap="WxInstrumentResult"> <select id="selectWxInstrumentList" parameterType="WxInstrument" resultMap="WxInstrumentResult">
@ -102,6 +105,9 @@ 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>
@ -207,6 +213,9 @@ 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>
@ -255,6 +264,9 @@ 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>
@ -307,6 +319,9 @@ 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,6 +60,14 @@ 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,10 +19,14 @@ 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 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, nursing_days, nursing_days_week, nursing_days_month, nursing_days_year from wx_nursing_log
</sql> </sql>
<select id="selectWxNursingLogList" parameterType="WxNursingLog" resultMap="WxNursingLogResult"> <select id="selectWxNursingLogList" parameterType="WxNursingLog" resultMap="WxNursingLogResult">
@ -97,6 +101,16 @@ 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=",">
@ -113,6 +127,10 @@ 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>
@ -128,6 +146,10 @@ 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>
@ -147,6 +169,10 @@ 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,5 +1,6 @@
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;
@ -26,9 +27,8 @@ 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.util.ArrayList; import java.time.temporal.ChronoField;
import java.util.Date; import java.util.*;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -172,7 +172,10 @@ 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) {
@ -184,7 +187,10 @@ 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("绑定过该类型仪器,但当前扫码的序列号与以前绑定的仪器的序列号不一致,询问用户是否换绑仪器");
throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_TWO.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_TWO.getCode()); Map<String, Object> resultMap = new HashMap<>();
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("扫码序列号与当前用户绑定的序列号一致,无需绑定,返回响应");
} }
@ -193,7 +199,10 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
// 不立即绑定 // 不立即绑定
if (!isImmediatelyBinding) { if (!isImmediatelyBinding) {
logger.info("可以绑定,但是不立即绑定,页面需要询问用户是否绑定"); logger.info("可以绑定,但是不立即绑定,页面需要询问用户是否绑定");
throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_ONE.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_ONE.getCode()); Map<String, Object> resultMap = new HashMap<>();
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、判断序列号是否被别人绑定了 */
@ -209,7 +218,6 @@ 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());
@ -459,11 +467,37 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
// 查询 服务集合 // 查询 服务集合
WxModeServiceInfo wxModeServiceInfo = new WxModeServiceInfo(); WxModeServiceInfo wxModeServiceInfo = new WxModeServiceInfo();
wxModeServiceInfo.setModeId(wxMode.getId()); wxModeServiceInfo.setModeId(wxMode.getId());
wxModeRet.setServiceData(wxModeServiceInfoMapper.selectWxModeServiceInfoList(wxModeServiceInfo)); List<WxModeServiceInfo> wxModeServiceInfoList = 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(String.format("%02d:%02d", wxModeRet.getModeTime().getMinute(), wxModeRet.getModeTime().getSecond())); wxModeRet.setModeTimeStr(DateUtils.formatMS(wxModeRet.getModeTime().getLong(ChronoField.SECOND_OF_DAY)));
} }
wxModeRetList.add(wxModeRet); wxModeRetList.add(wxModeRet);
} }

@ -1,9 +1,6 @@
package com.flossom.miniProgram.service.impl; package com.flossom.miniProgram.service.impl;
import java.time.LocalDate; import java.time.*;
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;
@ -68,17 +65,10 @@ public class WxNursingLogServiceImpl implements IWxNursingLogService {
totalNursingSecond += wxNursingLog.getNursingTime().toSecondOfDay(); totalNursingSecond += wxNursingLog.getNursingTime().toSecondOfDay();
} }
} }
wxNursingStatisticsRet.setNursingTime(formatDuration(totalNursingSecond)); wxNursingStatisticsRet.setNursingTime(DateUtils.formatHMS(totalNursingSecond));
return wxNursingStatisticsRet; return wxNursingStatisticsRet;
} }
return new WxNursingStatisticsRet(0, formatDuration(0)); return new WxNursingStatisticsRet(0, DateUtils.formatHMS(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);
} }
/** /**
@ -198,6 +188,65 @@ 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,6 +50,11 @@ public class WxInstrumentController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/listAll")
public List<WxInstrument> listAll(WxInstrumentReq wxInstrumentReq) {
return wxInstrumentService.selectWxInstrumentPage(wxInstrumentReq);
}
/** /**
* *
*/ */

@ -6,10 +6,8 @@ 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.SysTag; import com.flossom.common.core.domain.entity.*;
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;
@ -18,8 +16,7 @@ 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.ISysTagService; import com.flossom.system.service.*;
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;
@ -30,7 +27,6 @@ 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
@ -48,7 +44,10 @@ 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;
/** /**
* *
*/ */
@ -155,6 +154,32 @@ 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,16 +56,21 @@ public class WxUserInstrumentController extends BaseController
public TableDataInfo list(WxUserInstrument wxUserInstrument) public TableDataInfo list(WxUserInstrument wxUserInstrument)
{ {
// 用户相关信息 // 用户相关信息
WxUserMemberVm wxUserMemberVm = new WxUserMemberVm(); if(!(wxUserInstrument.getNickName() == null && wxUserInstrument.getUserIdArray() == null
wxUserMemberVm.setNickname(wxUserInstrument.getNickName()); && wxUserInstrument.getUserPhone() == null)) {
if(wxUserInstrument.getUserIdArray() != null && wxUserInstrument.getUserIdArray().size() > 0) { WxUserMemberVm wxUserMemberVm = new WxUserMemberVm();
wxUserMemberVm.setId(wxUserInstrument.getUserIdArray().stream().map(String::valueOf).collect(Collectors.joining(","))); wxUserMemberVm.setNickname(wxUserInstrument.getNickName());
} if(wxUserInstrument.getUserIdArray() != null && wxUserInstrument.getUserIdArray().size() > 0) {
wxUserMemberVm.setMobile(wxUserInstrument.getUserPhone()); wxUserMemberVm.setId(wxUserInstrument.getUserIdArray().stream().map(String::valueOf).collect(Collectors.joining(",")));
List<WxUserMember> wxUserMemberList = wxUserMemberService.selectWxUserMemberList(wxUserMemberVm); }
if(wxUserMemberList != null && wxUserMemberList.size() > 0) { wxUserMemberVm.setMobile(wxUserInstrument.getUserPhone());
String collect = wxUserMemberList.stream().map(WxUserMember::getId).map(String::valueOf).collect(Collectors.joining(",")); List<WxUserMember> wxUserMemberList = wxUserMemberService.selectWxUserMemberList(wxUserMemberVm);
wxUserInstrument.setUserIds(collect); 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");
}
} }
startPage(); startPage();
@ -167,6 +172,23 @@ 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,6 +3,8 @@ 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;
@ -66,6 +68,13 @@ 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);
} }
@ -77,6 +86,14 @@ 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,5 +1,6 @@
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;
@ -9,6 +10,7 @@ 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;
@ -21,6 +23,7 @@ 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;
/** /**
@ -121,8 +124,17 @@ 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);
} }
@ -139,7 +151,16 @@ 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,7 +2,9 @@ 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;
@ -21,6 +23,9 @@ public class WxUserInstrumentLogServiceImpl implements IWxUserInstrumentLogServi
@Autowired @Autowired
private WxUserInstrumentLogMapper wxUserInstrumentLogMapper; private WxUserInstrumentLogMapper wxUserInstrumentLogMapper;
@Autowired
private WxInstrumentMapper wxInstrumentMapper;
/** /**
* *
* *
@ -55,6 +60,10 @@ 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,11 +9,13 @@ 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;
/** /**
@ -164,14 +166,15 @@ 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); // 有效
List<WxInstrumentSerial> serialList = instrumentSerialMapper.selectWxInstrumentSerialList(serial); WxInstrumentSerial wxInstrumentSerial = instrumentSerialMapper.selectEntityListBySerial(serial);
if (CollectionUtils.isEmpty(serialList)) { if (wxInstrumentSerial == null) {
resultMap.put("message","序列号无效,请确定后再绑定"); resultMap.put("message","序列号无效,请确定后再绑定");
resultMap.put("code", "500"); resultMap.put("code", "500");
return resultMap; return resultMap;
@ -179,15 +182,16 @@ public class WxUserInstrumentServiceImpl implements IWxUserInstrumentService
// 查看是否已经被绑定 // 查看是否已经被绑定
WxUserInstrument userInstrument = new WxUserInstrument(); WxUserInstrument userInstrument = new WxUserInstrument();
userInstrument.setSerial(wxUserInstrument.getSerial()); userInstrument.setSerial(wxUserInstrument.getSerial());
List<WxUserInstrument> wxUserInstrumentsList = wxUserInstrumentMapper.selectWxUserInstrumentList(userInstrument); userInstrument.setBindingStatus(BindingStatusEnums.BINDED.getCode());
if (!CollectionUtils.isEmpty(wxUserInstrumentsList)) { Integer count = wxUserInstrumentMapper.selectUiByInstrumentId(userInstrument);
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()) {
@ -208,7 +212,7 @@ public class WxUserInstrumentServiceImpl implements IWxUserInstrumentService
} }
} }
// 更新信息 // 更新信息
WxInstrumentSerial instrumentSerialVo = serialList.get(0); WxInstrumentSerial instrumentSerialVo = wxInstrumentSerial;
userInstrumentRecord.setInstrumentId(instrumentSerialVo.getInstrumentId()); userInstrumentRecord.setInstrumentId(instrumentSerialVo.getInstrumentId());
userInstrumentRecord.setSerial(instrumentSerialVo.getSerial()); userInstrumentRecord.setSerial(instrumentSerialVo.getSerial());
// userInstrumentRecord.setSerialImage(userInstrument.getSerialImage()); // userInstrumentRecord.setSerialImage(userInstrument.getSerialImage());
@ -216,6 +220,24 @@ 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,6 +9,14 @@ 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,10 +140,12 @@ export default {
handler(val) { handler(val) {
if (val !== this.currentValue) { if (val !== this.currentValue) {
this.currentValue = val === null ? '' : val this.currentValue = val === null ? '' : val
let ele = document.body.querySelector(`#${this.tableName} .editor`) setTimeout(() => {
if (ele) { let ele = document.body.querySelector(`#${this.tableName} .editor`)
ele.children[0].innerHTML = this.currentValue if (ele) {
} 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,6 +23,7 @@
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,108 +1,276 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-collapse accordion style="margin-bottom: 10px" v-model="activeNames">
<el-form-item label="微信用户" prop="userId"> <el-collapse-item name="search">
<el-input <template slot="title">
v-model="queryParams.userId" <div class="margin-top" style="border-left: solid 2px #419eff;padding-left: 10px;font-size: 18px !important;color: #000;">
placeholder="请输入微信用户" 搜索
clearable </div>
@keyup.enter.native="handleQuery" </template>
/> <div style="margin-top: 10px">
</el-form-item> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="当天使用过的仪器" prop="instrumentId"> <div style="display: flex">
<el-input <el-popover
v-model="queryParams.instrumentId" placement="top-start"
placeholder="请输入当天使用过的仪器" width="200"
clearable trigger="click"
@keyup.enter.native="handleQuery" content="手机号码和用户编号,满足其中之一内容即可"
/> >
</el-form-item> <el-form-item label="用户编号" prop="id" slot="reference">
<el-form-item label="当天使用过的仪器" prop="instrumentName"> <el-input
<el-input v-model="queryParams.id"
v-model="queryParams.instrumentName" placeholder="搜索多个请用英文逗号隔开"
placeholder="请输入当天使用过的仪器" clearable
clearable @keyup.enter.native="handleQuery"
@keyup.enter.native="handleQuery" />
/> </el-form-item>
</el-form-item> </el-popover>
<el-form-item> <el-form-item label="会员昵称" prop="userId">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-input
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> v-model="queryParams.userId"
</el-form-item> placeholder="请输入单个会员昵称搜索"
</el-form> clearable
@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-button <el-select
type="primary" v-model="batchOperateValue"
plain placeholder="批量操作"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:clockLog:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini" size="mini"
:disabled="single" clearable
@click="handleUpdate" >
v-hasPermi="['system:clockLog:edit']" <el-option label="批量添加小程序标签" :value="1"></el-option>
>修改</el-button> <el-option label="批量删除小程序标签" :value="2"></el-option>
</el-col> <el-option label="全量添加小程序标签" :value="3"></el-option>
<el-col :span="1.5"> <el-option label="全量删除小程序标签" :value="4"></el-option>
<el-button <el-option label="批量加减积分" :value="5"></el-option>
type="danger" <el-option label="全量加减积分" :value="6"></el-option>
plain <el-option label="批量发送话术" :value="7"></el-option>
icon="el-icon-delete" <el-option label="全量发送话术" :value="8"></el-option>
size="mini" <el-option label="批量备注" :value="9"></el-option>
:disabled="multiple" <el-option label="全量备注" :value="10"></el-option>
@click="handleDelete" <el-option label="注销账号" :value="11"></el-option>
v-hasPermi="['system:clockLog:remove']" <el-option label="导出数据" :value="12"></el-option>
>删除</el-button> <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="warning" type="primary"
plain plain
icon="el-icon-download" icon="el-icon-warning"
size="mini" size="mini"
@click="handleExport" >确认
v-hasPermi="['system:clockLog:export']" </el-button>
>导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <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="${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="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
@ -112,38 +280,23 @@
: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,
// //
@ -158,6 +311,12 @@ export default {
total: 0, total: 0,
// //
clockLogList: [], clockLogList: [],
//
instrumentList: [],
//
miniProgramTags: [],
//
wecomTags: [],
// //
title: "", title: "",
// //
@ -181,8 +340,25 @@ 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="" /> <el-option label="全部" :value="null" />
<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,7 +86,6 @@
>确认 >确认
</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"
@ -197,13 +196,12 @@
<!-- <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"
@ -213,7 +211,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)" /> <el-input v-model="form.serial" placeholder="请输入序列号" :disabled="isDisabled(form)" maxlength="30" minlength="1"/>
</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"/>
@ -247,6 +245,7 @@
: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>
@ -347,7 +346,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 {listInstrument} from "@/api/system/instrument"; import {listAllInstrument, 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"
@ -479,8 +478,8 @@ export default {
return false return false
}, },
queryInstrument(){ queryInstrument(){
listInstrument({}).then(response => { listAllInstrument({}).then(response => {
this.instrumentList = response.rows; this.instrumentList = response;
}); });
}, },
/** 查询仪器序列号关联列表 */ /** 查询仪器序列号关联列表 */
@ -549,6 +548,7 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加仪器序列号关联"; this.title = "添加仪器序列号关联";
this.form.instrumentId = '';
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -564,6 +564,12 @@ 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("修改成功");
@ -753,7 +759,18 @@ 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,8 +24,19 @@
</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" >
<el-table-column label="模式分类" align="center" prop="modeClass" /> <template slot-scope="scope">
<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" >
@ -104,15 +115,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"> <el-select v-model="form.instrumentType" @change="setModeTitle" :disabled="isDisabled(form)">
<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"> <el-select v-model="form.instrumentModel" @change="setModeType" :disabled="isDisabled(form)">
<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"
@ -125,7 +136,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.instrumentModel == 'FR200'"> <el-form-item label="模式类型" prop="modeType" v-if="form.instrumentType == 2&&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"
@ -135,7 +146,7 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="模式类型" prop="modeType" v-if="form.instrumentModel == 'WL200'"> <el-form-item label="模式类型" prop="modeType" v-if="form.instrumentType == 2&&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"
@ -145,7 +156,7 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="模式类型" prop="modeType" v-if="form.instrumentModel == 'M01'"> <el-form-item label="模式类型" prop="modeType" v-if="form.instrumentType == 2&&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"
@ -157,7 +168,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.instrumentModel == 'FR200'"> <el-form-item label="模式分类" prop="modeClass" v-if="form.instrumentType == 2&&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"
@ -167,7 +178,7 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="模式分类" prop="modeClass" v-if="form.instrumentModel == 'WL200'"> <el-form-item label="模式分类" prop="modeClass" v-if="form.instrumentType == 2&&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"
@ -181,7 +192,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.instrumentModel == 'WL200' & form.modeType != '10'"> <el-form-item label="舱体模式" prop="isCabinMode" v-if="form.instrumentType == 2&&form.instrumentModel == 'WL200' & form.modeType != 'MaskCustom'">
<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>
@ -189,7 +200,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 != '10'&&form.instrumentType==2)" label-width="100px"> <el-form-item label="自定义组合" prop="isCustomMode" v-if="(form.modeType != 'MaskCustom'&&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>
@ -204,7 +215,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="请输入模式时间"/> <el-input v-model="form.modeTime" placeholder="请输入模式时间" maxlength="5"/>
</el-form-item> </el-form-item>
<el-form-item label="模式封面" prop="modeBanner"> <el-form-item label="模式封面" prop="modeBanner">
<el-upload <el-upload
@ -226,6 +237,7 @@
</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"
@ -257,6 +269,7 @@
|| 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>
@ -278,12 +291,15 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-form-item> </el-form-item>
<el-form-item label="启动/暂停图片GIF" required label-width="130px" v-if="form.instrumentType == 2"> <el-form-item label="启动/暂停图片GIF" required label-width="135px" 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"
@ -300,9 +316,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row style="margin-top: 10px"> <el-row style="margin-top: 20px">
<el-col :span ="12"> <el-col :span ="12">
<el-form-item label="启动图片GIF" prop="modeBanner" label-width="110px"> <el-form-item label="启动图片GIF" prop="startSourceArray" 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"
@ -322,7 +341,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span ="12"> <el-col :span ="12">
<el-form-item label="暂停图片GIF" prop="modeBanner" label-width="110px"> <el-form-item label="暂停图片GIF" prop="stopSourceArray" 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"
@ -344,7 +366,7 @@
</el-row> </el-row>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item v-if="form.instrumentType == 2" label="模式组合" required label-width="120px"> <el-form-item v-if="form.instrumentType == 2 && form.isCustomMode == 1" 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>
@ -374,6 +396,9 @@
<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="请选择技术"
@ -390,6 +415,9 @@
</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>
@ -518,6 +546,9 @@ 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" }
], ],
@ -541,7 +572,7 @@ export default {
], ],
modeTime: [ modeTime: [
{ required: true, message: "模式时长不能为空", trigger: "blur" } { required: true, message: "模式时长不能为空", trigger: "blur" }
], ]
} }
}; };
}, },
@ -551,6 +582,12 @@ 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;
@ -695,39 +732,84 @@ 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) { if(data.startTimeArray == null || data.startTimeArray.length == 0) {
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 => {
if (!data.technologyArray) { console.log("----"+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;
}
} }
if (technologyFlag) { console.log(this.form.combineData)
if (technologyFlag && this.form.isCustomMode == 1) {
this.$message.error("使用技术不能为空"); this.$message.error("使用技术不能为空");
return; return;
} }
if (effectContent) { if (modeNameFlag && this.form.isCustomMode == 1) {
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) {
@ -772,8 +854,9 @@ export default {
}, `mode_${new Date().getTime()}.xlsx`) }, `mode_${new Date().getTime()}.xlsx`)
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
console.log('调用了') this.$refs.modeVideo.clearFiles();
this.fileList = []; this.fileList = [];
this.form.modeVideo = null;
}, },
handleRemoveBanner(file, fileList) { handleRemoveBanner(file, fileList) {
// console.log('') // console.log('')
@ -803,7 +886,7 @@ export default {
}, },
limitFileType(file) { limitFileType(file) {
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']] const imageType = ['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) {
@ -1010,3 +1093,21 @@ 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="source"> <el-form-item label="仪器名称" prop="instrumentIdArray">
<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="source"> <el-form-item label="绑定状态" prop="bindingStatus">
<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" value-format="yyyy-MM-dd HH:mm:ss"
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" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择操作结束时间"> placeholder="请选择操作结束时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -161,16 +161,7 @@
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="bingCancel(scope.row)" @click="bingCancel(scope.row)"
v-if="scope.row.bindingStatus == 0" :disabled="!(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
@ -367,7 +358,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 {listInstrument} from "@/api/system/instrument"; import {listAllInstrument, 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",
@ -500,8 +491,8 @@ export default {
this.guaranteeForm.guarantee = ""; this.guaranteeForm.guarantee = "";
}, },
queryInstrument(){ queryInstrument(){
listInstrument({}).then(response => { listAllInstrument({}).then(response => {
this.instrumentList = response.rows; this.instrumentList = response;
}); });
}, },
/** 查询用户仪器绑定列表 */ /** 查询用户仪器绑定列表 */
@ -753,6 +744,7 @@ 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("请选择导出字段");
@ -760,6 +752,7 @@ 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