仪器管理-配置说明书

master
382696293@qq.com 2 years ago
parent 6d67364e79
commit 726f36945e

@ -0,0 +1,98 @@
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_instructions
*
* @author flossom
* @date 2024-01-16
*/
public class WxInstrumentInstructions extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* $column.columnComment
*/
private Long id;
/**
* id
*/
@Excel(name = "设备id")
private Long instrumentId;
/**
*
*/
@Excel(name = "说明书名称")
private String name;
/**
*
*/
@Excel(name = "说明书链接")
private String link;
/**
* 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 setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setLink(String link) {
this.link = link;
}
public String getLink() {
return link;
}
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("name", getName())
.append("link", getLink())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.toString();
}
}

@ -0,0 +1,62 @@
package com.flossom.common.core.mapper;
import com.flossom.common.core.domain.entity.WxInstrumentInstructions;
import java.util.List;
/**
* Mapper
*
* @author flossom
* @date 2024-01-16
*/
public interface WxInstrumentInstructionsMapper {
/**
*
*
* @param id
* @return
*/
public WxInstrumentInstructions selectWxInstrumentInstructionsById(Long id);
/**
*
*
* @param wxInstrumentInstructions
* @return
*/
public List<WxInstrumentInstructions> selectWxInstrumentInstructionsList(WxInstrumentInstructions wxInstrumentInstructions);
/**
*
*
* @param wxInstrumentInstructions
* @return
*/
public int insertWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions);
/**
*
*
* @param wxInstrumentInstructions
* @return
*/
public int updateWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions);
/**
*
*
* @param id
* @return
*/
public int deleteWxInstrumentInstructionsById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteWxInstrumentInstructionsByIds(Long[] ids);
}

@ -0,0 +1,79 @@
<?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.WxInstrumentInstructionsMapper">
<resultMap type="WxInstrumentInstructions" id="WxInstrumentInstructionsResult">
<result property="id" column="id" />
<result property="instrumentId" column="instrument_id" />
<result property="name" column="name" />
<result property="link" column="link" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectWxInstrumentInstructionsVo">
select id, instrument_id, name, link, status, create_by, create_time from wx_instrument_instructions
</sql>
<select id="selectWxInstrumentInstructionsList" parameterType="WxInstrumentInstructions" resultMap="WxInstrumentInstructionsResult">
<include refid="selectWxInstrumentInstructionsVo"/>
<where>
<if test="instrumentId != null "> and instrument_id = #{instrumentId}</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="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectWxInstrumentInstructionsById" parameterType="Long" resultMap="WxInstrumentInstructionsResult">
<include refid="selectWxInstrumentInstructionsVo"/>
where id = #{id}
</select>
<insert id="insertWxInstrumentInstructions" parameterType="WxInstrumentInstructions" useGeneratedKeys="true" keyProperty="id">
insert into wx_instrument_instructions
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="instrumentId != null">instrument_id,</if>
<if test="name != null and name != ''">name,</if>
<if test="link != null and link != ''">link,</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="name != null and name != ''">#{name},</if>
<if test="link != null and link != ''">#{link},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateWxInstrumentInstructions" parameterType="WxInstrumentInstructions">
update wx_instrument_instructions
<trim prefix="SET" suffixOverrides=",">
<if test="instrumentId != null">instrument_id = #{instrumentId},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="link != null and link != ''">link = #{link},</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="deleteWxInstrumentInstructionsById" parameterType="Long">
delete from wx_instrument_instructions where id = #{id}
</delete>
<delete id="deleteWxInstrumentInstructionsByIds" parameterType="String">
delete from wx_instrument_instructions where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,78 @@
package com.flossom.system.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.WxInstrumentInstructions;
import com.flossom.common.core.utils.poi.ExcelUtil;
import com.flossom.common.core.web.controller.BaseController;
import com.flossom.common.core.web.domain.AjaxResult;
import com.flossom.common.core.web.page.TableDataInfo;
import com.flossom.common.log.annotation.Log;
import com.flossom.common.log.enums.BusinessType;
import com.flossom.common.security.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.flossom.system.service.IWxInstrumentInstructionsService;
/**
* Controller
*
* @author flossom
* @date 2024-01-16
*/
@RestController
@RequestMapping("/instructions")
public class WxInstrumentInstructionsController extends BaseController {
@Autowired
private IWxInstrumentInstructionsService wxInstrumentInstructionsService;
/**
*
*/
@GetMapping("/list")
public R list(WxInstrumentInstructions wxInstrumentInstructions) {
return R.ok(wxInstrumentInstructionsService.selectWxInstrumentInstructionsList(wxInstrumentInstructions));
}
/**
*
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(wxInstrumentInstructionsService.selectWxInstrumentInstructionsById(id));
}
/**
*
*/
@PostMapping
public AjaxResult add(@RequestBody WxInstrumentInstructions wxInstrumentInstructions) {
return toAjax(wxInstrumentInstructionsService.insertWxInstrumentInstructions(wxInstrumentInstructions));
}
/**
*
*/
@PutMapping
public AjaxResult edit(@RequestBody WxInstrumentInstructions wxInstrumentInstructions) {
return toAjax(wxInstrumentInstructionsService.updateWxInstrumentInstructions(wxInstrumentInstructions));
}
/**
*
*/
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(wxInstrumentInstructionsService.deleteWxInstrumentInstructionsByIds(ids));
}
}

@ -0,0 +1,61 @@
package com.flossom.system.service;
import com.flossom.common.core.domain.entity.WxInstrumentInstructions;
import java.util.List;
/**
* Service
*
* @author flossom
* @date 2024-01-16
*/
public interface IWxInstrumentInstructionsService {
/**
*
*
* @param id
* @return
*/
public WxInstrumentInstructions selectWxInstrumentInstructionsById(Long id);
/**
*
*
* @param wxInstrumentInstructions
* @return
*/
public List<WxInstrumentInstructions> selectWxInstrumentInstructionsList(WxInstrumentInstructions wxInstrumentInstructions);
/**
*
*
* @param wxInstrumentInstructions
* @return
*/
public int insertWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions);
/**
*
*
* @param wxInstrumentInstructions
* @return
*/
public int updateWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions);
/**
*
*
* @param ids
* @return
*/
public int deleteWxInstrumentInstructionsByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteWxInstrumentInstructionsById(Long id);
}

@ -0,0 +1,90 @@
package com.flossom.system.service.impl;
import java.util.List;
import com.flossom.common.core.domain.entity.WxInstrumentInstructions;
import com.flossom.common.core.mapper.WxInstrumentInstructionsMapper;
import com.flossom.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.IWxInstrumentInstructionsService;
/**
* Service
*
* @author flossom
* @date 2024-01-16
*/
@Service
public class WxInstrumentInstructionsServiceImpl implements IWxInstrumentInstructionsService {
@Autowired
private WxInstrumentInstructionsMapper wxInstrumentInstructionsMapper;
/**
*
*
* @param id
* @return
*/
@Override
public WxInstrumentInstructions selectWxInstrumentInstructionsById(Long id) {
return wxInstrumentInstructionsMapper.selectWxInstrumentInstructionsById(id);
}
/**
*
*
* @param wxInstrumentInstructions
* @return
*/
@Override
public List<WxInstrumentInstructions> selectWxInstrumentInstructionsList(WxInstrumentInstructions wxInstrumentInstructions) {
return wxInstrumentInstructionsMapper.selectWxInstrumentInstructionsList(wxInstrumentInstructions);
}
/**
*
*
* @param wxInstrumentInstructions
* @return
*/
@Override
public int insertWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions) {
wxInstrumentInstructions.setCreateTime(DateUtils.getNowDate());
return wxInstrumentInstructionsMapper.insertWxInstrumentInstructions(wxInstrumentInstructions);
}
/**
*
*
* @param wxInstrumentInstructions
* @return
*/
@Override
public int updateWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions) {
return wxInstrumentInstructionsMapper.updateWxInstrumentInstructions(wxInstrumentInstructions);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteWxInstrumentInstructionsByIds(Long[] ids) {
return wxInstrumentInstructionsMapper.deleteWxInstrumentInstructionsByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteWxInstrumentInstructionsById(Long id) {
return wxInstrumentInstructionsMapper.deleteWxInstrumentInstructionsById(id);
}
}

@ -99,3 +99,42 @@ export function delRelate(id) {
method: 'delete'
})
}
// 查询仪器说明书列表
export function listInstructions(query) {
return request({
url: '/system/instructions/list',
method: 'get',
params: query
})
}
// 新增仪器说明书
export function addInstructions(data) {
return request({
url: '/system/instructions',
method: 'post',
data: data
})
}
// 修改仪器说明书
export function updateInstructions(data) {
return request({
url: '/system/instructions',
method: 'put',
data: data
})
}
// 删除仪器说明书
export function delInstructions(id) {
return request({
url: '/system/instructions/' + id,
method: 'delete'
})
}

@ -172,48 +172,25 @@
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:instrument:edit']"
>编辑
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['system:instrument:edit']">编辑
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="editMiniProgramTags(scope.row)"
>设置小程序可见标签
<el-button size="mini" type="text" icon="el-icon-edit" @click="editMiniProgramTags(scope.row)">
设置小程序可见标签
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="editWecomTags(scope.row)"
>设置企微可见标签
<el-button size="mini" type="text" icon="el-icon-edit" @click="editWecomTags(scope.row)">
</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="editInstrumentNameVisible(scope.row)">
<el-button size="mini" type="text" icon="el-icon-edit" @click="editInstrumentNameVisible(scope.row)">
正品控名称配置
</el-button>
<el-button size="mini" type="text" icon="el-icon-edit">配置说明书</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:instrument:remove']"
v-if="scope.row.status == 0"
>隐藏
<el-button size="mini" type="text" icon="el-icon-edit" @click="editInstrumentInstructionVisible(scope.row)">
配置说明书
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:instrument:remove']"
v-if="scope.row.status == 1"
>解除隐藏
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:instrument:remove']" v-if="scope.row.status == 0">隐藏
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:instrument:remove']" v-if="scope.row.status == 1">解除隐藏
</el-button>
</template>
</el-table-column>
@ -835,12 +812,38 @@
</el-table-column>
<el-table-column>
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-save" @click="saveInstrumentName(scope.row)"></el-button>
<el-button size="mini" type="text" icon="el-icon-save" @click="saveInstrumentName(scope.row)">
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="delInstrumentName(scope)"></el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog title="产品说明书配置" :visible.sync="instrumentInstructions.visible" width="50%">
<el-button size="mini" type="primary" icon="el-icon-add" @click="addInstrumentInstructionLine()">
</el-button>
<el-table :show-header="false" v-loading="loading" :data="instrumentInstructions.instructionList">
<el-table-column align="center" prop="name" width="200">
<template slot-scope="scope">
<el-input placeholder="请输入说明书名称" v-model="scope.row.name" clearable/>
</template>
</el-table-column>
<el-table-column align="center" prop="link" width="300">
<template slot-scope="scope">
<el-input v-model="scope.row.link" clearable/>
</template>
</el-table-column>
<el-table-column>
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-save" @click="saveInstrumentInstruction(scope.row)">
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="delInstrumentInstruction(scope)">
</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
@ -852,7 +855,15 @@ import {
addInstrument,
updateInstrument,
getMiniProgramTagTree,
getWecomTagTree, listRelate, delRelate, updateRelate, addRelate,
getWecomTagTree,
listRelate,
delRelate,
updateRelate,
addRelate,
listInstructions,
delInstructions,
addInstructions,
updateInstructions,
} from '@/api/system/instrument'
import {getToken} from '@/utils/auth'
import Treeselect from '@riophae/vue-treeselect'
@ -1046,6 +1057,12 @@ export default {
//
previewSrc: '', //
isPreviewVideo: true, //
/* 仪器说明书 */
instrumentInstructions: {
visible: false,
instrumentId: null,
instructionList: []
},
}
},
created() {
@ -1645,6 +1662,61 @@ export default {
})
}
},
/* 仪器说明书 */
addInstrumentInstructionLine() {
this.instrumentInstructions.instructionList.push({
id: null,
instrumentId: this.instrumentInstructions.instrumentId,
name: null,
link: null,
})
},
editInstrumentInstructionVisible(row) {
this.instrumentInstructions.instrumentId = row.id;
//
listInstructions({
instrumentId: row.id
}).then((response) => {
if (response.data != null && response.data.length > 0) {
this.instrumentInstructions.instructionList = response.data;
} else {
this.instrumentInstructions.instructionList = [{
id: null,
instrumentId: this.instrumentInstructions.instrumentId,
name: null,
link: null,
}];
}
this.instrumentInstructions.visible = true;
})
},
delInstrumentInstruction(item) {
// id
if (item.row.id != null) {
//
delInstructions(item.row.id).then((response) => {
this.$modal.msgSuccess('删除成功');
})
}
this.instrumentInstructions.instructionList.splice(item.$index, 1)
if (this.instrumentInstructions.instructionList.length == 0) {
this.addInstrumentInstructionLine();
}
},
saveInstrumentInstruction(item) {
console.log(item)
if (item.id != null) {
updateInstructions(item).then((response) => {
this.$modal.msgSuccess('修改成功');
})
} else {
addInstructions(item).then((response) => {
this.$modal.msgSuccess('新增成功');
})
}
},
},
}
</script>

Loading…
Cancel
Save