From 03bc97a428005adb43040fdb1850ad71226377e4 Mon Sep 17 00:00:00 2001 From: "382696293@qq.com" <382696293@qq.com> Date: Mon, 18 Mar 2024 11:04:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E6=8D=A2=E6=A1=A3=E6=97=B6=E9=97=B4=E3=80=81=E8=9C=82=E9=B8=A3?= =?UTF-8?q?=E6=8F=90=E9=86=92=E6=97=B6=E9=97=B4=E3=80=81=E9=9C=87=E5=8A=A8?= =?UTF-8?q?=E6=8F=90=E9=86=92=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/domain/entity/WxMode.java | 31 +++- .../common/core/domain/entity/WxModeGear.java | 87 +++++++++++ .../core/domain/entity/WxNursingLog.java | 26 ++++ .../common/core/mapper/WxModeGearMapper.java | 65 +++++++++ .../flossom/common/core/utils/DateUtils.java | 12 ++ .../resources/mapper/WxModeGearMapper.xml | 79 ++++++++++ .../service/impl/WxModeServiceImpl.java | 88 ++++++++++++ flossom-ui/src/views/system/mode/index.vue | 136 +++++++++++++++--- 8 files changed, 504 insertions(+), 20 deletions(-) create mode 100644 flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxModeGear.java create mode 100644 flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxModeGearMapper.java create mode 100644 flossom-common/flossom-common-core/src/main/resources/mapper/WxModeGearMapper.xml diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxMode.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxMode.java index 0b3e4c7..11bf3eb 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxMode.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxMode.java @@ -1,7 +1,6 @@ package com.flossom.common.core.domain.entity; import java.util.ArrayList; -import java.util.Date; import java.util.List; import com.fasterxml.jackson.annotation.JsonFormat; @@ -117,6 +116,12 @@ public class WxMode extends BaseEntity private String stepThreeVideo; + private List modeGear = new ArrayList<>(); + + private List modeBuzzing = new ArrayList<>(); + + private List modeVibrate = new ArrayList<>(); + public void setId(Long id) { @@ -366,6 +371,30 @@ public class WxMode extends BaseEntity this.stepThreeVideo = stepThreeVideo; } + public List getModeGear() { + return modeGear; + } + + public void setModeGear(List modeGear) { + this.modeGear = modeGear; + } + + public List getModeBuzzing() { + return modeBuzzing; + } + + public void setModeBuzzing(List modeBuzzing) { + this.modeBuzzing = modeBuzzing; + } + + public List getModeVibrate() { + return modeVibrate; + } + + public void setModeVibrate(List modeVibrate) { + this.modeVibrate = modeVibrate; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxModeGear.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxModeGear.java new file mode 100644 index 0000000..c30251f --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxModeGear.java @@ -0,0 +1,87 @@ +package com.flossom.common.core.domain.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.flossom.common.core.utils.DateUtils; +import com.flossom.common.core.web.domain.BaseEntity; + +import java.time.LocalTime; + +/** + * 模式关联 换挡时间、蜂鸣提醒时间、震动提醒时间 + */ +public class WxModeGear extends BaseEntity { + + private Long id; + /** + * 关联的模式 + */ + private Long modeId; + /** + * 触发时间 + */ + private String time; + /** + * 类型:1、换挡时间,2、蜂鸣提醒时间,3、震动提醒时间 + */ + private Integer type; + + @JsonInclude(value = JsonInclude.Include.NON_DEFAULT) + @JsonIgnore + private Integer second; + + public WxModeGear() { + } + + public WxModeGear(Long id, Long modeId, String time, Integer type, Integer second) { + this.id = id; + this.modeId = modeId; + this.time = time; + this.type = type; + this.second = second; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getModeId() { + return modeId; + } + + public void setModeId(Long modeId) { + this.modeId = modeId; + } + + public String getTime() { + return time; + } + + public void setTime(String time) { + this.time = time; + this.second = DateUtils.convertTimeToSeconds(time); + } + + public Integer getSecond() { + return second; + } + + public void setSecond(Integer second) { + this.second = second; + this.time = DateUtils.formatMS(second); + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxNursingLog.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxNursingLog.java index aa11f4e..3d421bb 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxNursingLog.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxNursingLog.java @@ -41,6 +41,16 @@ public class WxNursingLog extends BaseEntity { */ private Integer instrumentType; + /** + * 仪器型号 + */ + private String instrumentModel; + + /** + * 模式类型 + */ + private String instrumentModeName; + /** * 是否在线,1在线,2离线 */ @@ -391,4 +401,20 @@ public class WxNursingLog extends BaseEntity { public void setNursingDaysYear(Integer nursingDaysYear) { this.nursingDaysYear = nursingDaysYear; } + + public String getInstrumentModel() { + return instrumentModel; + } + + public void setInstrumentModel(String instrumentModel) { + this.instrumentModel = instrumentModel; + } + + public String getInstrumentModeName() { + return instrumentModeName; + } + + public void setInstrumentModeName(String instrumentModeName) { + this.instrumentModeName = instrumentModeName; + } } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxModeGearMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxModeGearMapper.java new file mode 100644 index 0000000..3eff6c9 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxModeGearMapper.java @@ -0,0 +1,65 @@ +package com.flossom.common.core.mapper; + +import com.flossom.common.core.domain.entity.WxModeGear; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * FR200 模式挡位切换配置Mapper接口 + * + * @author flossom + * @date 2024-03-15 + */ +public interface WxModeGearMapper { + /** + * 查询FR200 模式挡位切换配置 + * + * @param id FR200 模式挡位切换配置主键 + * @return FR200 模式挡位切换配置 + */ + public WxModeGear selectWxModeGearById(Long id); + + /** + * 查询FR200 模式挡位切换配置列表 + * + * @param wxModeGear FR200 模式挡位切换配置 + * @return FR200 模式挡位切换配置集合 + */ + public List selectWxModeGearList(WxModeGear wxModeGear); + + /** + * 新增FR200 模式挡位切换配置 + * + * @param wxModeGear FR200 模式挡位切换配置 + * @return 结果 + */ + public int insertWxModeGear(WxModeGear wxModeGear); + + /** + * 修改FR200 模式挡位切换配置 + * + * @param wxModeGear FR200 模式挡位切换配置 + * @return 结果 + */ + public int updateWxModeGear(WxModeGear wxModeGear); + + /** + * 删除FR200 模式挡位切换配置 + * + * @param id FR200 模式挡位切换配置主键 + * @return 结果 + */ + public int deleteWxModeGearById(Long id); + + /** + * 批量删除FR200 模式挡位切换配置 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWxModeGearByIds(Long[] ids); + + void deleteWxModeGearByModeId(@Param("modeId") Long modeId); + +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/utils/DateUtils.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/utils/DateUtils.java index fd02e41..f0c8ed3 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/utils/DateUtils.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/utils/DateUtils.java @@ -204,5 +204,17 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils return String.format("%02d:%02d", minutes, remainingSeconds); } + /** + * 将字符串分秒转为秒数返回 + * + * @param minuteAndSecond 分秒:05:30 + * @return 秒数 + */ + public static int convertTimeToSeconds(String minuteAndSecond) { + String[] parts = minuteAndSecond.split(":"); + int minutes = Integer.parseInt(parts[0]); + int second = Integer.parseInt(parts[1]); + return minutes * 60 + second; + } } diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxModeGearMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxModeGearMapper.xml new file mode 100644 index 0000000..3ac6976 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxModeGearMapper.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + select id, mode_id, second, type, create_time, create_by from wx_mode_gear + + + + + + + + insert into wx_mode_gear + + mode_id, + second, + type, + create_time, + create_by, + + + #{modeId}, + #{second}, + #{type}, + #{createTime}, + #{createBy}, + + + + + update wx_mode_gear + + mode_id = #{modeId}, + second = #{second}, + type = #{type}, + create_time = #{createTime}, + create_by = #{createBy}, + + where id = #{id} + + + + delete from wx_mode_gear where id = #{id} + + + + delete from wx_mode_gear where id in + + #{id} + + + + + delete from wx_mode_gear where mode_id = #{modeId} + + + \ No newline at end of file diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxModeServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxModeServiceImpl.java index fdb7c38..6e7a225 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxModeServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxModeServiceImpl.java @@ -1,5 +1,6 @@ package com.flossom.system.service.impl; +import java.time.LocalDateTime; import java.util.Arrays; import java.util.Date; import java.util.List; @@ -11,6 +12,7 @@ import com.flossom.common.core.enums.TagTypeStatusEnum; import com.flossom.common.core.mapper.*; import com.flossom.common.core.utils.DateUtils; import com.flossom.common.core.utils.StringUtils; +import com.flossom.common.security.utils.SecurityUtils; import org.apache.commons.compress.utils.Lists; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -35,6 +37,9 @@ public class WxModeServiceImpl implements IWxModeService private WxModeServiceInfoMapper wxModeServiceInfoMapper; @Autowired private WxModeCombineInfoMapper wxModeCombineInfoMapper; + @Autowired + private WxModeGearMapper wxModeGearMapper; + /** * 查询模式列 * @@ -90,6 +95,15 @@ public class WxModeServiceImpl implements IWxModeService } } wxMode.setCombineData(wxModeCombineInfos); + // 获取换挡配置 + WxModeGear query = new WxModeGear(); + query.setModeId(wxMode.getId()); + List wxModeGearList = wxModeGearMapper.selectWxModeGearList(query); + if(wxModeGearList != null && wxModeGearList.size() > 0) { + wxMode.setModeGear(wxModeGearList.stream().filter(wxModeGear -> wxModeGear.getType() == 1).collect(Collectors.toList())); + wxMode.setModeBuzzing(wxModeGearList.stream().filter(wxModeGear -> wxModeGear.getType() == 2).collect(Collectors.toList())); + wxMode.setModeVibrate(wxModeGearList.stream().filter(wxModeGear -> wxModeGear.getType() == 3).collect(Collectors.toList())); + } return wxMode; } @@ -174,6 +188,37 @@ public class WxModeServiceImpl implements IWxModeService wxModeCombineInfoMapper.insertWxModeCombineInfo(wxModeCombineInfo); } } + // 保存换挡时间设置 + if(CollectionUtils.isNotEmpty(wxMode.getModeGear())) { + List modeGearList = wxMode.getModeGear(); + for (WxModeGear wxModeGear: modeGearList) { + wxModeGear.setModeId(wxMode.getId()); + wxModeGear.setType(1); + wxModeGear.setCreateBy(SecurityUtils.getLoginUser().getUsername()); + wxModeGear.setCreateTime(DateUtils.getNowDate()); + wxModeGearMapper.insertWxModeGear(wxModeGear); + } + } + if(CollectionUtils.isNotEmpty(wxMode.getModeBuzzing())) { + List modeGearList = wxMode.getModeGear(); + for (WxModeGear wxModeGear: modeGearList) { + wxModeGear.setModeId(wxMode.getId()); + wxModeGear.setType(2); + wxModeGear.setCreateBy(SecurityUtils.getLoginUser().getUsername()); + wxModeGear.setCreateTime(DateUtils.getNowDate()); + wxModeGearMapper.insertWxModeGear(wxModeGear); + } + } + if(CollectionUtils.isNotEmpty(wxMode.getModeVibrate())) { + List modeGearList = wxMode.getModeGear(); + for (WxModeGear wxModeGear: modeGearList) { + wxModeGear.setModeId(wxMode.getId()); + wxModeGear.setType(3); + wxModeGear.setCreateBy(SecurityUtils.getLoginUser().getUsername()); + wxModeGear.setCreateTime(DateUtils.getNowDate()); + wxModeGearMapper.insertWxModeGear(wxModeGear); + } + } return i; } @@ -253,6 +298,49 @@ public class WxModeServiceImpl implements IWxModeService wxModeCombineInfoMapper.insertWxModeCombineInfo(wxModeCombineInfo); } } + // 保存换挡时间设置 + if(CollectionUtils.isNotEmpty(wxMode.getModeGear())) { + List modeGearList = wxMode.getModeGear(); + for (WxModeGear wxModeGear: modeGearList) { + if(wxModeGear.getId() == null) { + wxModeGear.setModeId(wxMode.getId()); + wxModeGear.setType(1); + wxModeGear.setCreateBy(SecurityUtils.getLoginUser().getUsername()); + wxModeGear.setCreateTime(DateUtils.getNowDate()); + wxModeGearMapper.insertWxModeGear(wxModeGear); + } else { + wxModeGearMapper.updateWxModeGear(wxModeGear); + } + } + } + if(CollectionUtils.isNotEmpty(wxMode.getModeBuzzing())) { + List modeGearList = wxMode.getModeBuzzing(); + for (WxModeGear wxModeGear: modeGearList) { + if(wxModeGear.getId() == null) { + wxModeGear.setModeId(wxMode.getId()); + wxModeGear.setType(2); + wxModeGear.setCreateBy(SecurityUtils.getLoginUser().getUsername()); + wxModeGear.setCreateTime(DateUtils.getNowDate()); + wxModeGearMapper.insertWxModeGear(wxModeGear); + } else { + wxModeGearMapper.updateWxModeGear(wxModeGear); + } + } + } + if(CollectionUtils.isNotEmpty(wxMode.getModeVibrate())) { + List modeGearList = wxMode.getModeVibrate(); + for (WxModeGear wxModeGear: modeGearList) { + if(wxModeGear.getId() == null) { + wxModeGear.setModeId(wxMode.getId()); + wxModeGear.setType(3); + wxModeGear.setCreateBy(SecurityUtils.getLoginUser().getUsername()); + wxModeGear.setCreateTime(DateUtils.getNowDate()); + wxModeGearMapper.insertWxModeGear(wxModeGear); + } else { + wxModeGearMapper.updateWxModeGear(wxModeGear); + } + } + } return wxModeMapper.updateWxMode(wxMode); } diff --git a/flossom-ui/src/views/system/mode/index.vue b/flossom-ui/src/views/system/mode/index.vue index d1aa276..5454252 100644 --- a/flossom-ui/src/views/system/mode/index.vue +++ b/flossom-ui/src/views/system/mode/index.vue @@ -215,7 +215,7 @@ - +
- + *
- + *
- + *
- + *
- + *
@@ -478,7 +478,7 @@
- + *
- + *
@@ -504,6 +504,90 @@ + + + +
+ * +
+ 添加 +
+ + + + + + + + + 删除 + + + + +
+
+ + + 添加 +
+ + + + + + + + + 删除 + + + + +
+
+ + + 添加 +
+ + + + + + + + + 删除 + + + + +
+