Merge branch 'feature-20240104' of https://gitee.com/yunqiang_technology/floatomcloud into feature-20240104

master
qsj 2 years ago
commit d41b7aaf59

@ -0,0 +1,83 @@
package com.flossom.common.core.domain.entity;
import com.flossom.common.core.annotation.Excel;
import com.flossom.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* wx_instrument_lining
*
* @author flossom
* @date 2024-03-27
*/
public class WxInstrumentLining extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* $column.columnComment
*/
private Long id;
/**
* id
*/
@Excel(name = "仪器id")
private Long instrumentId;
/**
* id
*/
@Excel(name = "膜布id")
private Long liningId;
/**
* 0 1
*/
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private Long status;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setInstrumentId(Long instrumentId) {
this.instrumentId = instrumentId;
}
public Long getInstrumentId() {
return instrumentId;
}
public void setLiningId(Long liningId) {
this.liningId = liningId;
}
public Long getLiningId() {
return liningId;
}
public void setStatus(Long status) {
this.status = status;
}
public Long getStatus() {
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("instrumentId", getInstrumentId())
.append("liningId", getLiningId())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.toString();
}
}

@ -48,6 +48,8 @@ public class WxInstrumentMode extends BaseEntity {
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private Integer status;
private Long liningId;
public void setId(Long id) {
this.id = id;
}
@ -96,6 +98,14 @@ public class WxInstrumentMode extends BaseEntity {
this.isNew = isNew;
}
public Long getLiningId() {
return liningId;
}
public void setLiningId(Long liningId) {
this.liningId = liningId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -5,6 +5,8 @@ import com.flossom.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.List;
/**
* wx_lining
*
@ -64,6 +66,16 @@ public class WxLining extends BaseEntity {
@Excel(name = "状态", readConverterExp = "0=正常,1=禁用")
private Long status;
/**
*
*/
private List<Integer> modeList;
/**
* new
*/
private List<Integer> newModeIdList;
public void setId(Long id) {
this.id = id;
}
@ -136,6 +148,23 @@ public class WxLining extends BaseEntity {
return status;
}
public List<Integer> getModeList() {
return modeList;
}
public void setModeList(List<Integer> modeList) {
this.modeList = modeList;
}
public List<Integer> getNewModeIdList() {
return newModeIdList;
}
public void setNewModeIdList(List<Integer> newModeIdList) {
this.newModeIdList = newModeIdList;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -2,6 +2,7 @@ package com.flossom.common.core.domain.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.flossom.common.core.domain.entity.WxInstrumentFileRelate;
import com.flossom.common.core.domain.entity.WxLining;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
@ -260,6 +261,11 @@ public class WxInstrumentSaveReq {
*/
private String we200BluetoothConnectingContent;
/**
*
*/
private List<WxLining> wxLiningList;
public Long getId() {
return id;
}
@ -619,4 +625,12 @@ public class WxInstrumentSaveReq {
public void setWe200BluetoothConnectingContent(String we200BluetoothConnectingContent) {
this.we200BluetoothConnectingContent = we200BluetoothConnectingContent;
}
public List<WxLining> getWxLiningList() {
return wxLiningList;
}
public void setWxLiningList(List<WxLining> wxLiningList) {
this.wxLiningList = wxLiningList;
}
}

@ -0,0 +1,63 @@
package com.flossom.common.core.mapper;
import com.flossom.common.core.domain.entity.WxInstrumentLining;
import java.util.List;
/**
* Mapper
*
* @author flossom
* @date 2024-03-27
*/
public interface WxInstrumentLiningMapper {
/**
*
*
* @param id
* @return
*/
public WxInstrumentLining selectWxInstrumentLiningById(Long id);
/**
*
*
* @param wxInstrumentLining
* @return
*/
public List<WxInstrumentLining> selectWxInstrumentLiningList(WxInstrumentLining wxInstrumentLining);
/**
*
*
* @param wxInstrumentLining
* @return
*/
public int insertWxInstrumentLining(WxInstrumentLining wxInstrumentLining);
/**
*
*
* @param wxInstrumentLining
* @return
*/
public int updateWxInstrumentLining(WxInstrumentLining wxInstrumentLining);
/**
*
*
* @param id
* @return
*/
public int deleteWxInstrumentLiningById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteWxInstrumentLiningByIds(Long[] ids);
public int deleteByInstrumentId(Long instrumentId);
}

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.flossom.common.core.mapper.WxInstrumentLiningMapper">
<resultMap type="WxInstrumentLining" id="WxInstrumentLiningResult">
<result property="id" column="id" />
<result property="instrumentId" column="instrument_id" />
<result property="liningId" column="lining_id" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectWxInstrumentLiningVo">
select id, instrument_id, lining_id, status, create_by, create_time from wx_instrument_lining
</sql>
<select id="selectWxInstrumentLiningList" parameterType="WxInstrumentLining" resultMap="WxInstrumentLiningResult">
<include refid="selectWxInstrumentLiningVo"/>
<where>
<if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
<if test="liningId != null "> and lining_id = #{liningId}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectWxInstrumentLiningById" parameterType="Long" resultMap="WxInstrumentLiningResult">
<include refid="selectWxInstrumentLiningVo"/>
where id = #{id}
</select>
<insert id="insertWxInstrumentLining" parameterType="WxInstrumentLining" useGeneratedKeys="true" keyProperty="id">
insert into wx_instrument_lining
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="instrumentId != null">instrument_id,</if>
<if test="liningId != null">lining_id,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="instrumentId != null">#{instrumentId},</if>
<if test="liningId != null">#{liningId},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateWxInstrumentLining" parameterType="WxInstrumentLining">
update wx_instrument_lining
<trim prefix="SET" suffixOverrides=",">
<if test="instrumentId != null">instrument_id = #{instrumentId},</if>
<if test="liningId != null">lining_id = #{liningId},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWxInstrumentLiningById" parameterType="Long">
delete from wx_instrument_lining where id = #{id}
</delete>
<delete id="deleteWxInstrumentLiningByIds" parameterType="String">
delete from wx_instrument_lining where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteByInstrumentId" parameterType="Long">
delete from wx_instrument_lining where instrument_id = #{instrumentId}
</delete>
</mapper>

@ -13,10 +13,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="liningId" column="lining_id" />
</resultMap>
<sql id="selectWxInstrumentModeVo">
select id, instrument_id, mode_id, mode_sort, is_new, status, create_by, create_time from wx_instrument_mode
select id, instrument_id, mode_id, mode_sort, is_new, status, create_by, create_time, lining_id from wx_instrument_mode
</sql>
<select id="selectWxInstrumentModeList" parameterType="WxInstrumentMode" resultMap="WxInstrumentModeResult">
@ -26,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="modeId != null "> and mode_id = #{modeId}</if>
<if test="isNew != null "> and is_new = #{isNew}</if>
<if test="status != null "> and status = #{status}</if>
<if test="liningId != null "> and lining_id = #{liningId}</if>
</where>
order by mode_sort asc
</select>
@ -45,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="liningId != null">lining_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="instrumentId != null">#{instrumentId},</if>
@ -54,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="liningId != null">#{liningId},</if>
</trim>
</insert>
@ -67,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="liningId != null">lining_id = #{liningId},</if>
</trim>
where id = #{id}
</update>

@ -45,6 +45,12 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
@Autowired
private WxInstrumentTagMapper wxInstrumentTagMapper;
@Autowired
private WxInstrumentLiningMapper wxInstrumentLiningMapper;
@Autowired
private WxLiningMapper wxLiningMapper;
/**
*
*
@ -80,21 +86,50 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
selectByInstrumentIdAndClassify(wxInstrument.getId(), InstrumentFileClassifyEnum.INSTRUMENT_INSTRUCTION.getCode());
wxInstrumentSaveReq.setIntroduceList(instructionRelate);
// 获取模式关联
WxInstrumentMode wxInstrumentMode = new WxInstrumentMode();
wxInstrumentMode.setInstrumentId(id);
List<WxInstrumentMode> wxInstrumentModes = wxInstrumentModeMapper.selectWxInstrumentModeList(wxInstrumentMode);
if (wxInstrumentModes != null && wxInstrumentModes.size() > 0) {
wxInstrumentSaveReq.setModeIdsValue(wxInstrumentModes.stream()
.map(WxInstrumentMode::getModeId)
.map(Long::intValue)
.collect(Collectors.toList()));
wxInstrumentSaveReq.setNewModeIdList(wxInstrumentModes.stream()
.filter(im -> im.getIsNew() == 1)
.map(WxInstrumentMode::getModeId)
.map(Long::intValue)
.collect(Collectors.toList())
);
if (!StringUtils.equals(wxInstrument.getModel(), "WE200")) {
// 其他仪器直接获取关联的模式
WxInstrumentMode wxInstrumentMode = new WxInstrumentMode();
wxInstrumentMode.setInstrumentId(id);
List<WxInstrumentMode> wxInstrumentModes = wxInstrumentModeMapper.selectWxInstrumentModeList(wxInstrumentMode);
if (wxInstrumentModes != null && wxInstrumentModes.size() > 0) {
wxInstrumentSaveReq.setModeIdsValue(wxInstrumentModes.stream()
.map(WxInstrumentMode::getModeId)
.map(Long::intValue)
.collect(Collectors.toList()));
wxInstrumentSaveReq.setNewModeIdList(wxInstrumentModes.stream()
.filter(im -> im.getIsNew() == 1)
.map(WxInstrumentMode::getModeId)
.map(Long::intValue)
.collect(Collectors.toList())
);
}
} else {
// we200 获取膜布关联的模式
WxInstrumentLining instrumentLiningQuery = new WxInstrumentLining();
instrumentLiningQuery.setInstrumentId(id);
List<WxInstrumentLining> instrumentLiningList = wxInstrumentLiningMapper.selectWxInstrumentLiningList(instrumentLiningQuery);
if (instrumentLiningList != null) {
for (WxInstrumentLining wxInstrumentLining : instrumentLiningList) {
Long liningId = wxInstrumentLining.getLiningId();
WxLining wxLining = wxLiningMapper.selectWxLiningById(liningId);
WxInstrumentMode instrumentModeQuery = new WxInstrumentMode();
instrumentModeQuery.setInstrumentId(id);
instrumentModeQuery.setLiningId(liningId);
List<WxInstrumentMode> wxInstrumentModeList = wxInstrumentModeMapper.selectWxInstrumentModeList(instrumentModeQuery);
if (wxInstrumentModeList != null && wxInstrumentModeList.size() > 0) {
wxLining.setModeList(wxInstrumentModeList.stream()
.map(WxInstrumentMode::getModeId)
.map(Long::intValue)
.collect(Collectors.toList()));
wxLining.setNewModeIdList(wxInstrumentModeList.stream()
.filter(im -> im.getIsNew() == 1)
.map(WxInstrumentMode::getModeId)
.map(Long::intValue)
.collect(Collectors.toList())
);
}
}
}
}
return wxInstrumentSaveReq;
}
@ -222,6 +257,55 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
wxInstrumentModeMapper.insertWxInstrumentMode(wxInstrumentMode);
}
}
// 膜布关联的模式
List<WxLining> wxLiningList = wxInstrumentSaveReq.getWxLiningList();
if (wxLiningList != null && wxLiningList.size() > 0) {
wxInstrumentModeMapper.deleteByInstrumentId(wxInstrument.getId());
wxInstrumentLiningMapper.deleteByInstrumentId(wxInstrument.getId());
for (WxLining wxLining : wxLiningList) {
Long liningId = wxLining.getId();
WxInstrumentLining wxInstrumentLining = new WxInstrumentLining();
wxInstrumentLining.setLiningId(liningId);
wxInstrumentLining.setInstrumentId(wxInstrument.getId());
wxInstrumentLining.setStatus(Status.OK.getCode().longValue());
wxInstrumentLining.setCreateBy(SecurityUtils.getUsername());
wxInstrumentLining.setCreateTime(DateUtils.getNowDate());
wxInstrumentLiningMapper.insertWxInstrumentLining(wxInstrumentLining);
List<Integer> modeList = wxLining.getModeList();
if (modeList != null && modeList.size() > 0) {
for (int i = 0; i < modeList.size(); i++) {
WxInstrumentMode wxInstrumentMode = new WxInstrumentMode();
wxInstrumentMode.setInstrumentId(wxInstrument.getId());
wxInstrumentMode.setModeId(modeList.get(i).longValue());
wxInstrumentMode.setModeSort(i);
wxInstrumentMode.setIsNew(0);
wxInstrumentMode.setLiningId(liningId);
wxInstrumentMode.setStatus(Status.OK.getCode());
wxInstrumentMode.setCreateBy(SecurityUtils.getUsername());
wxInstrumentMode.setCreateTime(DateUtils.getNowDate());
wxInstrumentModeMapper.insertWxInstrumentMode(wxInstrumentMode);
}
}
List<Integer> newModeIdList = wxLining.getNewModeIdList();
if (newModeIdList != null && newModeIdList.size() > 0) {
for (int i = 0; i < newModeIdList.size(); i++) {
WxInstrumentMode wxInstrumentMode = new WxInstrumentMode();
wxInstrumentMode.setInstrumentId(wxInstrument.getId());
wxInstrumentMode.setModeId(modeIdList.get(i).longValue());
wxInstrumentMode.setModeSort(i);
wxInstrumentMode.setIsNew(1);
wxInstrumentMode.setLiningId(liningId);
wxInstrumentMode.setStatus(Status.OK.getCode());
wxInstrumentMode.setCreateBy(SecurityUtils.getUsername());
wxInstrumentMode.setCreateTime(DateUtils.getNowDate());
wxInstrumentModeMapper.insertWxInstrumentMode(wxInstrumentMode);
}
}
}
}
return insertNum;
}
@ -268,7 +352,6 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
}
wxInstrument.setUpdateTime(DateUtils.getNowDate());
// 打卡时间处理
// 打卡时间处理
if (wxInstrumentSaveReq.getIsExtraClock() != null && wxInstrumentSaveReq.getIsExtraClock() == 1) {
wxInstrument.setStartTime(wxInstrumentSaveReq.getExtraClockTimeRange().get(0));
@ -329,6 +412,55 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
wxInstrumentModeMapper.insertWxInstrumentMode(wxInstrumentMode);
}
}
// 膜布关联的模式
List<WxLining> wxLiningList = wxInstrumentSaveReq.getWxLiningList();
if (wxLiningList != null && wxLiningList.size() > 0) {
wxInstrumentModeMapper.deleteByInstrumentId(wxInstrument.getId());
wxInstrumentLiningMapper.deleteByInstrumentId(wxInstrument.getId());
for (WxLining wxLining : wxLiningList) {
Long liningId = wxLining.getId();
WxInstrumentLining wxInstrumentLining = new WxInstrumentLining();
wxInstrumentLining.setLiningId(liningId);
wxInstrumentLining.setInstrumentId(wxInstrument.getId());
wxInstrumentLining.setStatus(Status.OK.getCode().longValue());
wxInstrumentLining.setCreateBy(SecurityUtils.getUsername());
wxInstrumentLining.setCreateTime(DateUtils.getNowDate());
wxInstrumentLiningMapper.insertWxInstrumentLining(wxInstrumentLining);
List<Integer> modeList = wxLining.getModeList();
if (modeList != null && modeList.size() > 0) {
for (int i = 0; i < modeList.size(); i++) {
WxInstrumentMode wxInstrumentMode = new WxInstrumentMode();
wxInstrumentMode.setInstrumentId(wxInstrument.getId());
wxInstrumentMode.setModeId(modeList.get(i).longValue());
wxInstrumentMode.setModeSort(i);
wxInstrumentMode.setIsNew(0);
wxInstrumentMode.setLiningId(liningId);
wxInstrumentMode.setStatus(Status.OK.getCode());
wxInstrumentMode.setCreateBy(SecurityUtils.getUsername());
wxInstrumentMode.setCreateTime(DateUtils.getNowDate());
wxInstrumentModeMapper.insertWxInstrumentMode(wxInstrumentMode);
}
}
List<Integer> newModeIdList = wxLining.getNewModeIdList();
if (newModeIdList != null && newModeIdList.size() > 0) {
for (int i = 0; i < newModeIdList.size(); i++) {
WxInstrumentMode wxInstrumentMode = new WxInstrumentMode();
wxInstrumentMode.setInstrumentId(wxInstrument.getId());
wxInstrumentMode.setModeId(modeIdList.get(i).longValue());
wxInstrumentMode.setModeSort(i);
wxInstrumentMode.setIsNew(1);
wxInstrumentMode.setLiningId(liningId);
wxInstrumentMode.setStatus(Status.OK.getCode());
wxInstrumentMode.setCreateBy(SecurityUtils.getUsername());
wxInstrumentMode.setCreateTime(DateUtils.getNowDate());
wxInstrumentModeMapper.insertWxInstrumentMode(wxInstrumentMode);
}
}
}
}
return wxInstrumentMapper.updateWxInstrument(wxInstrument);
}

@ -1424,7 +1424,7 @@ export default {
this.form.iotVersionUpgrade
)
// WE200IOT
this.form.iotVersionUpgrade = decodeURIComponent(
this.form.we200IotVersionUpgrade = decodeURIComponent(
this.form.we200IotVersionUpgrade
)
})

Loading…
Cancel
Save