From 1ca6b87037fbf1327ad3f9174bfed6e17c0e6b17 Mon Sep 17 00:00:00 2001 From: sonjinyon <2476687577@qq.com> Date: Tue, 29 Oct 2024 10:59:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=9C=8D=E8=AF=9D=E6=9C=AF=E5=92=8C?= =?UTF-8?q?=E7=B4=A0=E6=9D=90=E5=9B=BE=E7=89=87=E6=B7=BB=E5=8A=A0=E5=88=86?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-admin-vue3/src/api/infra/file/index.ts | 4 + .../src/api/system/dict/dict.data.ts | 20 + yudao-admin-vue3/src/utils/dict.ts | 2 + .../src/views/infra/file/index.vue | 549 +++++++++++------- .../kefu/components/KeFuMessageList.vue | 2 - .../mall/promotion/verbaltrick/index.vue | 480 ++++++++------- .../controller/admin/file/FileController.java | 10 + .../admin/file/vo/file/FileCreateReqVO.java | 3 + .../admin/file/vo/file/FilePageReqVO.java | 5 + .../admin/file/vo/file/FileRespVO.java | 3 + .../infra/dal/dataobject/file/FileDO.java | 2 + .../infra/dal/mysql/file/FileMapper.java | 1 + .../infra/service/file/FileService.java | 4 + .../infra/service/file/FileServiceImpl.java | 25 + .../point/MemberPointRecordServiceImpl.java | 2 +- .../ConfigurationController.java | 35 +- .../ConfigurationServiceImpl.java | 2 +- .../module/system/api/dict/DictDataApi.java | 4 + .../system/api/dict/dto/DictDataRespDTO.java | 1 + .../system/api/dict/DictDataApiImpl.java | 12 + .../admin/dict/DictDataController.java | 35 ++ .../system/dal/mysql/dict/DictDataMapper.java | 7 + .../system/service/dict/DictDataService.java | 18 + .../service/dict/DictDataServiceImpl.java | 42 ++ 24 files changed, 856 insertions(+), 412 deletions(-) diff --git a/yudao-admin-vue3/src/api/infra/file/index.ts b/yudao-admin-vue3/src/api/infra/file/index.ts index fbad22e..fd67cd5 100644 --- a/yudao-admin-vue3/src/api/infra/file/index.ts +++ b/yudao-admin-vue3/src/api/infra/file/index.ts @@ -45,4 +45,8 @@ export const updateFile = (data: any) => { return request.upload({ url: '/infra/file/upload', data }) } +export const updatePicType = (id: number , picType: number) => { + return request.get({ url: '/infra/file/updatePicType?id=' + id + `&picType=` + picType }) +} + diff --git a/yudao-admin-vue3/src/api/system/dict/dict.data.ts b/yudao-admin-vue3/src/api/system/dict/dict.data.ts index 1c0c867..e11da9a 100644 --- a/yudao-admin-vue3/src/api/system/dict/dict.data.ts +++ b/yudao-admin-vue3/src/api/system/dict/dict.data.ts @@ -57,3 +57,23 @@ export const getTypeList = () => { export const getHuaShuTypeList = () => { return request.get({ url: '/system/dict-data/getHuaShuTypeList' }) } + +// 新增字典数据,客服话术分类 +export const createType = (data: DictDataVO) => { + return request.post({ url: '/system/dict-data/createType', data }) +} + +// 新增字典数据,素材管理图片分类 +export const createPicType = (data: DictDataVO) => { + return request.post({ url: '/system/dict-data/createPicType', data }) +} + +// 新增字典数据,素材管理图片分类 +export const updateMenu = (id : number, name : string) => { + return request.get({ url: '/system/dict-data/updateMenu?id='+ id + `&name=` + name }) +} + +// 删除字典数据 +export const deleteMenu = (id: number | undefined) => { + return request.delete({ url: '/system/dict-data/deleteMenu?id=' + id }) +} diff --git a/yudao-admin-vue3/src/utils/dict.ts b/yudao-admin-vue3/src/utils/dict.ts index b9a46ee..92871c3 100644 --- a/yudao-admin-vue3/src/utils/dict.ts +++ b/yudao-admin-vue3/src/utils/dict.ts @@ -124,6 +124,8 @@ export enum DICT_TYPE { TECHNICIAN_STATUS = 'technician_status', SEX = 'sex', + INFRA_FILE_TYPE = 'infra_file_type', + //预约:项目 SUBSCRIBE_PROJECT_STATUS = 'subscribe_project_status', diff --git a/yudao-admin-vue3/src/views/infra/file/index.vue b/yudao-admin-vue3/src/views/infra/file/index.vue index 07718e3..90d6a9e 100644 --- a/yudao-admin-vue3/src/views/infra/file/index.vue +++ b/yudao-admin-vue3/src/views/infra/file/index.vue @@ -1,26 +1,39 @@ + \ No newline at end of file diff --git a/yudao-admin-vue3/src/views/mall/promotion/kefu/components/KeFuMessageList.vue b/yudao-admin-vue3/src/views/mall/promotion/kefu/components/KeFuMessageList.vue index ef3cb53..0735fb3 100644 --- a/yudao-admin-vue3/src/views/mall/promotion/kefu/components/KeFuMessageList.vue +++ b/yudao-admin-vue3/src/views/mall/promotion/kefu/components/KeFuMessageList.vue @@ -121,7 +121,6 @@ v-show="showNewMessageTip" class="newMessageTip flex items-center cursor-pointer
{{item.label}} -
@@ -299,7 +298,6 @@ v-show="showNewMessageTip" class="newMessageTip flex items-center cursor-pointer const getHuaShuTypeList = async () => { const data = await DictDataApi.getHuaShuTypeList() huashuType.value = data - } //话术内容 const getVerbalTrickList = async (id: string) => { diff --git a/yudao-admin-vue3/src/views/mall/promotion/verbaltrick/index.vue b/yudao-admin-vue3/src/views/mall/promotion/verbaltrick/index.vue index 087d715..736ec3f 100644 --- a/yudao-admin-vue3/src/views/mall/promotion/verbaltrick/index.vue +++ b/yudao-admin-vue3/src/views/mall/promotion/verbaltrick/index.vue @@ -1,211 +1,303 @@ + + \ No newline at end of file diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java index 301ca7b..045181d 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java @@ -102,11 +102,21 @@ public class FileController { @Operation(summary = "获得文件分页") @PreAuthorize("@ss.hasPermission('infra:file:query')") public CommonResult> getFilePage(@Valid FilePageReqVO pageVO) { + if (pageVO.getPicType() == 0){ + pageVO.setPicType(null); + } PageResult pageResult = fileService.getFilePage(pageVO); return success(BeanUtils.toBean(pageResult, FileRespVO.class)); } + @GetMapping("/updatePicType") + public CommonResult updatePicType(Integer id,Integer picType){ + return success(fileService.updatePicType(id,picType)); + } + + + } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileCreateReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileCreateReqVO.java index 2497618..0f6a458 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileCreateReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileCreateReqVO.java @@ -28,6 +28,9 @@ public class FileCreateReqVO { @Schema(description = "文件 MIME 类型", example = "application/octet-stream") private String type; + @Schema(description = "图片类型") + private Integer picType; + @Schema(description = "文件大小", example = "2048", requiredMode = Schema.RequiredMode.REQUIRED) private Integer size; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePageReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePageReqVO.java index 21c1178..c6aa2df 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePageReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePageReqVO.java @@ -23,6 +23,11 @@ public class FilePageReqVO extends PageParam { @Schema(description = "文件类型,模糊匹配", example = "jpg") private String type; + @Schema(description = "图片类型", example = "jpg") + private Integer picType; + + + @Schema(description = "创建时间", example = "[2022-07-01 00:00:00, 2022-07-01 23:59:59]") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java index a0357da..fa2c7bd 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java @@ -27,6 +27,9 @@ public class FileRespVO { @Schema(description = "文件MIME类型", example = "application/octet-stream") private String type; + @Schema(description = "图片类型") + private Integer picType; + @Schema(description = "文件大小", example = "2048", requiredMode = Schema.RequiredMode.REQUIRED) private Integer size; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java index c0fb007..c1a3f0b 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java @@ -47,6 +47,8 @@ public class FileDO extends BaseDO { * 文件的 MIME 类型,例如 "application/octet-stream" */ private String type; + + private Integer picType; /** * 文件大小 */ diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileMapper.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileMapper.java index 11233a4..90f12cc 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileMapper.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileMapper.java @@ -18,6 +18,7 @@ public interface FileMapper extends BaseMapperX { default PageResult selectPage(FilePageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .likeIfPresent(FileDO::getPath, reqVO.getPath()) + .eqIfPresent(FileDO::getPicType, reqVO.getPicType()) .likeIfPresent(FileDO::getType, reqVO.getType()) .betweenIfPresent(FileDO::getCreateTime, reqVO.getCreateTime()) .orderByDesc(FileDO::getId)); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java index 3ca9a24..cd8a494 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java @@ -63,4 +63,8 @@ public interface FileService { */ FilePresignedUrlRespVO getFilePresignedUrl(String path) throws Exception; + Long updatePicType(Integer id,Integer picType); + + boolean deleteMenu(Long id); + } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java index 8efa5fe..cd910f8 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java @@ -13,11 +13,14 @@ import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FilePageReqVO import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FilePresignedUrlRespVO; import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO; import cn.iocoder.yudao.module.infra.dal.mysql.file.FileMapper; +import cn.iocoder.yudao.module.system.api.dict.DictDataApi; import lombok.SneakyThrows; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.List; + import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.FILE_NOT_EXISTS; @@ -35,6 +38,9 @@ public class FileServiceImpl implements FileService { @Resource private FileMapper fileMapper; + @Resource + private DictDataApi dictDataApi; + @Override public PageResult getFilePage(FilePageReqVO pageReqVO) { return fileMapper.selectPage(pageReqVO); @@ -114,4 +120,23 @@ public class FileServiceImpl implements FileService { object -> object.setConfigId(fileClient.getId())); } + @Override + public Long updatePicType(Integer id, Integer picType) { + FileDO fileDO = fileMapper.selectOne("id", id); + if (picType != null){ + fileDO.setPicType(picType); + } + return (long)fileMapper.updateById(fileDO); + } + + @Override + public boolean deleteMenu(Long id) { + List pic_type = fileMapper.selectList("pic_type", id); + if (pic_type.isEmpty()){ + dictDataApi.deleteMenu(id); + return true; + } + return false; + } + } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordServiceImpl.java index 91de488..a1adae8 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordServiceImpl.java @@ -108,7 +108,7 @@ public class MemberPointRecordServiceImpl implements MemberPointRecordService { } MemberPointRecordDO memberPointRecordDO = new MemberPointRecordDO(); memberPointRecordDO.setAddUp(addUp); - memberPointRecordDO.setReduce(reduce); + memberPointRecordDO.setReduce(Math.abs(reduce)); return memberPointRecordDO; } diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/configuration/ConfigurationController.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/configuration/ConfigurationController.java index 76545b6..5954908 100644 --- a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/configuration/ConfigurationController.java +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/configuration/ConfigurationController.java @@ -41,6 +41,29 @@ public class ConfigurationController { @Resource private ConfigurationService configurationService; + + + + //根据项目预约天id查找预约套餐时间段 + @GetMapping("/getConfiguration") + public CommonResult> getConfiguration(Integer id) { + List serviceTimeVOS = configurationService.getConfiguration(id); + return success(serviceTimeVOS); + } + + //添加预约套餐时间段配置 + @PostMapping("/addUpdConfiguration") + public CommonResult addConfiguration(@RequestBody ConfigurationDO pageReqVO) { + Integer aLong = configurationService.addUpdConfiguration(pageReqVO); + return success(aLong); + } + + + + + + + @PostMapping("/create") @Operation(summary = "创建预约配置") @PreAuthorize("@ss.hasPermission('subscribe:configuration:create')") @@ -96,18 +119,6 @@ public class ConfigurationController { } - //根据项目预约天id查找预约套餐时间段 - @GetMapping("/getConfiguration") - public CommonResult> getConfiguration(Integer id) { - List serviceTimeVOS = configurationService.getConfiguration(id); - return success(serviceTimeVOS); - } - //添加预约套餐时间段配置 - @PostMapping("/addUpdConfiguration") - public CommonResult addConfiguration(@RequestBody ConfigurationDO pageReqVO) { - Integer aLong = configurationService.addUpdConfiguration(pageReqVO); - return success(aLong); - } } \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/configuration/ConfigurationServiceImpl.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/configuration/ConfigurationServiceImpl.java index ea629c6..c5dd719 100644 --- a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/configuration/ConfigurationServiceImpl.java +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/configuration/ConfigurationServiceImpl.java @@ -149,7 +149,7 @@ public class ConfigurationServiceImpl implements ConfigurationService { for (int j = 0; j < serviceTimeVOS.size(); j++) { ServiceTimeVO serviceTimeVO = serviceTimeVOS.get(j); - String serviceTime = serviceTimeVO.getStart() + " - " + serviceTimeVO.getEnd(); + String serviceTime = serviceTimeVO.getStart() + " ~ " + serviceTimeVO.getEnd(); //判断时间段是否存在 /** diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java index 1fb923e..55deb1d 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java @@ -81,4 +81,8 @@ public interface DictDataApi { Long createDictDataApi(DictDataSaveReqApiVO createReqVO); + int updateMenu(Integer id,String name); + + void deleteMenu(Long id); + } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/dto/DictDataRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/dto/DictDataRespDTO.java index fe5ab6a..8b0223b 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/dto/DictDataRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/dto/DictDataRespDTO.java @@ -10,6 +10,7 @@ import lombok.Data; */ @Data public class DictDataRespDTO { + private Integer id; /** * 字典标签 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApiImpl.java index 460cbe6..af3089e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApiImpl.java @@ -50,4 +50,16 @@ public class DictDataApiImpl implements DictDataApi { return dictDataService.createDictDataApi(createReqVO); } + @Override + public int updateMenu(Integer id, String name) { + int i = dictDataService.updateMenu(id, name); + return i; + } + + @Override + public void deleteMenu(Long id) { + dictDataService.deleteDictData(id); + } + + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java index eea3e29..2f45624 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java @@ -126,4 +126,39 @@ public class DictDataController { return success(dictDataList); } + + //添加客服话术分类字典数据 + @PostMapping("/createType") + public CommonResult createType( @RequestBody DictDataDO createReqVO) { + Long dictDataId = dictDataService.createType(createReqVO); + return success(dictDataId); + } + + //添加客服话术分类字典数据 + @PostMapping("/createPicType") + public CommonResult createPicType( @RequestBody DictDataDO createReqVO) { + Long dictDataId = dictDataService.createPicType(createReqVO); + return success(dictDataId); + } + + + /** + * 素材管理菜单编辑 + */ + @GetMapping(value = "/updateMenu") + public CommonResult updateMenu(Integer id,String name) { + int i = dictDataApi.updateMenu(id, name); + return success(i); + } + + + @DeleteMapping("/deleteMenu") + public CommonResult deleteMenu(Long id) { + dictDataService.deleteDictData(id); + return success(true); + } + + + + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java index 87a05c6..b0c330e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java @@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPage import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Select; import java.util.Arrays; import java.util.Collection; @@ -46,4 +47,10 @@ public interface DictDataMapper extends BaseMapperX { .eqIfPresent(DictDataDO::getDictType, dictType)); } + @Select(" SELECT MAX(value) FROM system_dict_data where dict_type = 'kefu_verbal_trick_type' ") + int getMaxValue(); + + @Select(" SELECT MAX(value) FROM system_dict_data where dict_type = 'infra_file_type' ") + int getPicTypeMaxValue(); + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java index 9a046a7..3624daf 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java @@ -39,6 +39,8 @@ public interface DictDataService { */ void deleteDictData(Long id); + + /** * 获得字典数据列表 * @@ -109,4 +111,20 @@ public interface DictDataService { List getDictDataListByDictType(String dictType); Long createDictDataApi(DictDataSaveReqApiVO createReqVO); + + /** + * 添加客服话术分类 + * @param createReqVO + * @return + */ + Long createType(DictDataDO createReqVO); + + /** + * 添加图片类型字典数据 + * @param createReqVO + * @return + */ + Long createPicType(DictDataDO createReqVO); + + int updateMenu(Integer id, String name); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java index fba950f..b28c149 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java @@ -99,6 +99,8 @@ public class DictDataServiceImpl implements DictDataService { dictDataMapper.deleteById(id); } + + @Override public long getDictDataCountByDictType(String dictType) { return dictDataMapper.selectCountByDictType(dictType); @@ -190,4 +192,44 @@ public class DictDataServiceImpl implements DictDataService { return dictData.getId(); } + @Override + public Long createType(DictDataDO createReqVO) { + + List dictDataDOS = dictDataMapper.selectList("dict_type", "infra_file_type"); + int maxValue = 0; + if (!dictDataDOS.isEmpty()){ + maxValue = dictDataMapper.getMaxValue(); + } + createReqVO.setValue( String.valueOf( maxValue + 1 ) ); + createReqVO.setDictType("kefu_verbal_trick_type"); + createReqVO.setStatus(0); + // 插入字典类型 + dictDataMapper.insert(createReqVO); + return createReqVO.getId(); + } + + @Override + public Long createPicType(DictDataDO createReqVO) { + + List dictDataDOS = dictDataMapper.selectList("dict_type", "infra_file_type"); + int maxValue = 0; + if (!dictDataDOS.isEmpty()){ + maxValue = dictDataMapper.getPicTypeMaxValue(); + } + createReqVO.setValue( String.valueOf( maxValue + 1 ) ); + createReqVO.setDictType("infra_file_type"); + createReqVO.setStatus(0); + // 插入字典类型 + dictDataMapper.insert(createReqVO); + return createReqVO.getId(); + } + + @Override + public int updateMenu(Integer id, String name) { + DictDataDO id1 = dictDataMapper.selectOne("id", id); + id1.setLabel(name); + + return dictDataMapper.updateById(id1); + } + }