From 22cc022b63ba045d7079c1a1adbf2ddc4737a83a Mon Sep 17 00:00:00 2001 From: "382696293@qq.com" <382696293@qq.com> Date: Tue, 16 Jan 2024 09:21:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=AA=E5=99=A8=E7=AE=A1=E7=90=86-=E5=85=B3?= =?UTF-8?q?=E8=81=94=E6=AD=A3=E5=93=81=E6=8E=A7=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/entity/WxInstrumentNameRelate.java | 84 ++++++++++++++++ .../mapper/WxInstrumentNameRelateMapper.java | 61 ++++++++++++ .../mapper/WxInstrumentNameRelateMapper.xml | 74 ++++++++++++++ .../controller/WxInstrumenController.java | 18 ++++ .../WxInstrumentNameRelateController.java | 46 +++++++++ .../IWxInstrumentNameRelateService.java | 61 ++++++++++++ .../WxInstrumentNameRelateServiceImpl.java | 90 +++++++++++++++++ flossom-ui/src/api/system/instrument.js | 35 +++++++ .../src/views/system/instrument/index.vue | 96 +++++++++++++++++-- 9 files changed, 557 insertions(+), 8 deletions(-) create mode 100644 flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentNameRelate.java create mode 100644 flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentNameRelateMapper.java create mode 100644 flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentNameRelateMapper.xml create mode 100644 flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxInstrumenController.java create mode 100644 flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentNameRelateController.java create mode 100644 flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentNameRelateService.java create mode 100644 flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentNameRelateServiceImpl.java diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentNameRelate.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentNameRelate.java new file mode 100644 index 0000000..2413cb4 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentNameRelate.java @@ -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(); + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentNameRelateMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentNameRelateMapper.java new file mode 100644 index 0000000..5654b28 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentNameRelateMapper.java @@ -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 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); +} diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentNameRelateMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentNameRelateMapper.xml new file mode 100644 index 0000000..31341e9 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentNameRelateMapper.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + select id, instrument_id, product_name, status, create_by, create_time from wx_instrument_name_relate + + + + + + + + insert into wx_instrument_name_relate + + instrument_id, + product_name, + status, + create_by, + create_time, + + + #{instrumentId}, + #{productName}, + #{status}, + #{createBy}, + #{createTime}, + + + + + update wx_instrument_name_relate + + instrument_id = #{instrumentId}, + product_name = #{productName}, + status = #{status}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from wx_instrument_name_relate where id = #{id} + + + + delete from wx_instrument_name_relate where id in + + #{id} + + + \ No newline at end of file diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxInstrumenController.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxInstrumenController.java new file mode 100644 index 0000000..67a46fd --- /dev/null +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxInstrumenController.java @@ -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 { + + +} diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentNameRelateController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentNameRelateController.java new file mode 100644 index 0000000..5b4360c --- /dev/null +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentNameRelateController.java @@ -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)); + } + +} diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentNameRelateService.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentNameRelateService.java new file mode 100644 index 0000000..ae78fa0 --- /dev/null +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentNameRelateService.java @@ -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 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); +} diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentNameRelateServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentNameRelateServiceImpl.java new file mode 100644 index 0000000..39fc610 --- /dev/null +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentNameRelateServiceImpl.java @@ -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 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); + } +} diff --git a/flossom-ui/src/api/system/instrument.js b/flossom-ui/src/api/system/instrument.js index 7cda1b4..09388e5 100644 --- a/flossom-ui/src/api/system/instrument.js +++ b/flossom-ui/src/api/system/instrument.js @@ -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' + }) +} diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index 6c970b8..74a4c1d 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -194,8 +194,7 @@ @click="editWecomTags(scope.row)" >设置企微可见标签 - 正品控名称配置 + 正品控名称配置 配置说明书 @@ -826,6 +825,30 @@ 确 定 + + + + + + + + + + + + @@ -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('新增成功'); + }) + } + }, }, }