仪器管理-关联正品控名称

master
382696293@qq.com 2 years ago
parent 9c9aaf4c81
commit 22cc022b63

@ -0,0 +1,84 @@
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_name_relate
*
* @author flossom
* @date 2024-01-15
*/
public class WxInstrumentNameRelate extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* $column.columnComment
*/
private Long id;
/**
* id
*/
@Excel(name = "仪器id")
private Long instrumentId;
/**
*
*/
@Excel(name = "产品名称")
private String productName;
/**
* 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 setProductName(String productName) {
this.productName = productName;
}
public String getProductName() {
return productName;
}
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("productName", getProductName())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.toString();
}
}

@ -0,0 +1,61 @@
package com.flossom.common.core.mapper;
import com.flossom.common.core.domain.entity.WxInstrumentNameRelate;
import java.util.List;
/**
* Mapper
*
* @author flossom
* @date 2024-01-15
*/
public interface WxInstrumentNameRelateMapper {
/**
*
*
* @param id
* @return
*/
public WxInstrumentNameRelate selectWxInstrumentNameRelateById(Long id);
/**
*
*
* @param wxInstrumentNameRelate
* @return
*/
public List<WxInstrumentNameRelate> selectWxInstrumentNameRelateList(WxInstrumentNameRelate wxInstrumentNameRelate);
/**
*
*
* @param wxInstrumentNameRelate
* @return
*/
public int insertWxInstrumentNameRelate(WxInstrumentNameRelate wxInstrumentNameRelate);
/**
*
*
* @param wxInstrumentNameRelate
* @return
*/
public int updateWxInstrumentNameRelate(WxInstrumentNameRelate wxInstrumentNameRelate);
/**
*
*
* @param id
* @return
*/
public int deleteWxInstrumentNameRelateById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteWxInstrumentNameRelateByIds(Long[] ids);
}

@ -0,0 +1,74 @@
<?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.WxInstrumentNameRelateMapper">
<resultMap type="WxInstrumentNameRelate" id="WxInstrumentNameRelateResult">
<result property="id" column="id" />
<result property="instrumentId" column="instrument_id" />
<result property="productName" column="product_name" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectWxInstrumentNameRelateVo">
select id, instrument_id, product_name, status, create_by, create_time from wx_instrument_name_relate
</sql>
<select id="selectWxInstrumentNameRelateList" parameterType="WxInstrumentNameRelate" resultMap="WxInstrumentNameRelateResult">
<include refid="selectWxInstrumentNameRelateVo"/>
<where>
<if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectWxInstrumentNameRelateById" parameterType="Long" resultMap="WxInstrumentNameRelateResult">
<include refid="selectWxInstrumentNameRelateVo"/>
where id = #{id}
</select>
<insert id="insertWxInstrumentNameRelate" parameterType="WxInstrumentNameRelate" useGeneratedKeys="true" keyProperty="id">
insert into wx_instrument_name_relate
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="instrumentId != null">instrument_id,</if>
<if test="productName != null and productName != ''">product_name,</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="productName != null and productName != ''">#{productName},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateWxInstrumentNameRelate" parameterType="WxInstrumentNameRelate">
update wx_instrument_name_relate
<trim prefix="SET" suffixOverrides=",">
<if test="instrumentId != null">instrument_id = #{instrumentId},</if>
<if test="productName != null and productName != ''">product_name = #{productName},</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="deleteWxInstrumentNameRelateById" parameterType="Long">
delete from wx_instrument_name_relate where id = #{id}
</delete>
<delete id="deleteWxInstrumentNameRelateByIds" parameterType="String">
delete from wx_instrument_name_relate where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,18 @@
package com.flossom.miniProgram.controller;
import com.flossom.common.core.web.controller.BaseController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Controller
*
* @author flossom
* @date 2024-01-15
*/
@RestController
@RequestMapping("/instrument")
public class WxInstrumenController extends BaseController {
}

@ -0,0 +1,46 @@
package com.flossom.system.controller;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.WxInstrumentNameRelate;
import com.flossom.common.core.web.controller.BaseController;
import com.flossom.common.core.web.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.flossom.system.service.IWxInstrumentNameRelateService;
/**
* Controller
*
* @author flossom
* @date 2024-01-15
*/
@RestController
@RequestMapping("/instrumentRelateName")
public class WxInstrumentNameRelateController extends BaseController {
@Autowired
private IWxInstrumentNameRelateService wxInstrumentNameRelateService;
@GetMapping("/list")
public R list(WxInstrumentNameRelate wxInstrumentNameRelate) {
return R.ok(wxInstrumentNameRelateService.selectWxInstrumentNameRelateList(wxInstrumentNameRelate));
}
@PostMapping
public AjaxResult add(@RequestBody WxInstrumentNameRelate wxInstrumentNameRelate) {
return toAjax(wxInstrumentNameRelateService.insertWxInstrumentNameRelate(wxInstrumentNameRelate));
}
@PutMapping
public AjaxResult edit(@RequestBody WxInstrumentNameRelate wxInstrumentNameRelate) {
return toAjax(wxInstrumentNameRelateService.updateWxInstrumentNameRelate(wxInstrumentNameRelate));
}
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(wxInstrumentNameRelateService.deleteWxInstrumentNameRelateByIds(ids));
}
}

@ -0,0 +1,61 @@
package com.flossom.system.service;
import com.flossom.common.core.domain.entity.WxInstrumentNameRelate;
import java.util.List;
/**
* Service
*
* @author flossom
* @date 2024-01-15
*/
public interface IWxInstrumentNameRelateService {
/**
*
*
* @param id
* @return
*/
public WxInstrumentNameRelate selectWxInstrumentNameRelateById(Long id);
/**
*
*
* @param wxInstrumentNameRelate
* @return
*/
public List<WxInstrumentNameRelate> selectWxInstrumentNameRelateList(WxInstrumentNameRelate wxInstrumentNameRelate);
/**
*
*
* @param wxInstrumentNameRelate
* @return
*/
public int insertWxInstrumentNameRelate(WxInstrumentNameRelate wxInstrumentNameRelate);
/**
*
*
* @param wxInstrumentNameRelate
* @return
*/
public int updateWxInstrumentNameRelate(WxInstrumentNameRelate wxInstrumentNameRelate);
/**
*
*
* @param ids
* @return
*/
public int deleteWxInstrumentNameRelateByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteWxInstrumentNameRelateById(Long id);
}

@ -0,0 +1,90 @@
package com.flossom.system.service.impl;
import com.flossom.common.core.domain.entity.WxInstrumentNameRelate;
import com.flossom.common.core.mapper.WxInstrumentNameRelateMapper;
import com.flossom.common.core.utils.DateUtils;
import com.flossom.system.service.IWxInstrumentNameRelateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author flossom
* @date 2024-01-15
*/
@Service
public class WxInstrumentNameRelateServiceImpl implements IWxInstrumentNameRelateService {
@Autowired
private WxInstrumentNameRelateMapper wxInstrumentNameRelateMapper;
/**
*
*
* @param id
* @return
*/
@Override
public WxInstrumentNameRelate selectWxInstrumentNameRelateById(Long id) {
return wxInstrumentNameRelateMapper.selectWxInstrumentNameRelateById(id);
}
/**
*
*
* @param wxInstrumentNameRelate
* @return
*/
@Override
public List<WxInstrumentNameRelate> selectWxInstrumentNameRelateList(WxInstrumentNameRelate wxInstrumentNameRelate) {
return wxInstrumentNameRelateMapper.selectWxInstrumentNameRelateList(wxInstrumentNameRelate);
}
/**
*
*
* @param wxInstrumentNameRelate
* @return
*/
@Override
public int insertWxInstrumentNameRelate(WxInstrumentNameRelate wxInstrumentNameRelate) {
wxInstrumentNameRelate.setCreateTime(DateUtils.getNowDate());
return wxInstrumentNameRelateMapper.insertWxInstrumentNameRelate(wxInstrumentNameRelate);
}
/**
*
*
* @param wxInstrumentNameRelate
* @return
*/
@Override
public int updateWxInstrumentNameRelate(WxInstrumentNameRelate wxInstrumentNameRelate) {
return wxInstrumentNameRelateMapper.updateWxInstrumentNameRelate(wxInstrumentNameRelate);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteWxInstrumentNameRelateByIds(Long[] ids) {
return wxInstrumentNameRelateMapper.deleteWxInstrumentNameRelateByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteWxInstrumentNameRelateById(Long id) {
return wxInstrumentNameRelateMapper.deleteWxInstrumentNameRelateById(id);
}
}

@ -64,3 +64,38 @@ export function getWecomTagTree() {
}
})
}
// 查询仪器关联正品控产品名列表
export function listRelate(query) {
return request({
url: '/system/instrumentRelateName/list',
method: 'get',
params: query
})
}
// 新增仪器关联正品控产品名
export function addRelate(data) {
return request({
url: '/system/instrumentRelateName',
method: 'post',
data: data
})
}
// 修改仪器关联正品控产品名
export function updateRelate(data) {
return request({
url: '/system/instrumentRelateName',
method: 'put',
data: data
})
}
// 删除仪器关联正品控产品名
export function delRelate(id) {
return request({
url: '/system/instrumentRelateName/' + id,
method: 'delete'
})
}

@ -194,8 +194,7 @@
@click="editWecomTags(scope.row)"
>设置企微可见标签
</el-button>
<el-button size="mini" type="text" icon="el-icon-edit"
>正品控名称配置
<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"
>配置说明书
@ -826,6 +825,30 @@
<el-button type="primary" @click="submitWecomTagList"> </el-button>
</div>
</el-dialog>
<el-dialog title="正品控商品名配置" :visible.sync="instrumentName.visible" width="50%">
<el-table v-loading="loading" :data="instrumentName.nameForm">
<el-table-column type="index" width="55" align="center"/>
<el-table-column align="center" prop="productName" width="400">
<template slot-scope="scope">
<el-input placeholder="请输入正品控名称" v-model="scope.row.productName" clearable/>
</template>
</el-table-column>
<el-table-column>
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-add"
@click="addInstrumentNameline()">新增
</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>
</div>
</template>
@ -837,7 +860,7 @@ import {
addInstrument,
updateInstrument,
getMiniProgramTagTree,
getWecomTagTree,
getWecomTagTree, listRelate, delRelate, updateRelate, addRelate,
} from '@/api/system/instrument'
import {getToken} from '@/utils/auth'
import Treeselect from '@riophae/vue-treeselect'
@ -1022,7 +1045,12 @@ export default {
message: '',
},
],
/* 正品控商品名 */
instrumentName: {
visible: false,
instrumentId: null,
nameForm: []
},
//
previewSrc: '', //
isPreviewVideo: true, //
@ -1248,10 +1276,10 @@ export default {
this.title = '修改仪器列'
/* 首次护理管理视频 */
if (response.data.nurseList != null) {
this.nurseIndex = response.data.nurseList.length;
this.nurseList = response.data.nurseList;
}
if (response.data.nurseList != null) {
this.nurseIndex = response.data.nurseList.length;
this.nurseList = response.data.nurseList;
}
/* 仪器介绍视频 */
if (response.data.introduceList != null) {
@ -1573,6 +1601,58 @@ export default {
}
return []
},
/* 正品控名称配置 */
addInstrumentNameline() {
this.instrumentName.nameForm.push({
id: null,
instrumentId: this.instrumentName.instrumentId,
productName: ''
})
},
editInstrumentNameVisible(row) {
this.instrumentName.instrumentId = row.id;
//
listRelate({
instrumentId: row.id
}).then((response) => {
if (response.data != null && response.data.length > 0) {
this.instrumentName.nameForm = response.data;
} else {
this.instrumentName.nameForm = [{
id: null,
instrumentId: this.instrumentName.instrumentId,
productName: ''
}];
}
this.instrumentName.visible = true;
})
},
delInstrumentName(item) {
// id
if (item.row.id != null) {
//
delRelate(item.row.id).then((response) => {
this.$modal.msgSuccess('删除成功');
})
}
this.instrumentName.nameForm.splice(item.$index, 1)
if (this.instrumentName.nameForm.length == 0) {
this.addInstrumentNameline()
}
},
saveInstrumentName(item) {
console.log(item)
if (item.id != null) {
updateRelate(item).then((response) => {
this.$modal.msgSuccess('修改成功');
})
} else {
addRelate(item).then((response) => {
this.$modal.msgSuccess('新增成功');
})
}
},
},
}
</script>

Loading…
Cancel
Save