package com.ruoyi.system.controller.conslole;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.system.api.constant.ConfigEnum;
|
import com.ruoyi.system.api.domain.dto.MgtBaseBathDto;
|
import com.ruoyi.system.api.domain.dto.MgtClassNumDto;
|
import com.ruoyi.system.api.domain.dto.MgtUserIdByDept;
|
import com.ruoyi.system.api.domain.poji.config.*;
|
import com.ruoyi.system.api.domain.poji.sys.SysStaff;
|
import com.ruoyi.system.api.domain.vo.AppOtherConfigGetVo;
|
import com.ruoyi.system.api.domain.vo.MgtSysSimpleUserVo;
|
import com.ruoyi.system.domain.dto.MgtCustomConfigDto;
|
import com.ruoyi.system.domain.pojo.config.CustomConfig;
|
import com.ruoyi.system.service.config.*;
|
import com.ruoyi.system.service.staff.SysStaffService;
|
import com.ruoyi.system.service.sys.ISysUserService;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* @author jqs34
|
* @version 1.0
|
* @classname ConfigController
|
* @description: TODO
|
* @date 2023 2023/4/30 15:53
|
*/
|
@RestController
|
@RequestMapping("/config")
|
public class ConfigController {
|
|
@Resource
|
private SysTagService sysTagService;
|
|
@Resource
|
private ActivenessService activenessService;
|
|
@Resource
|
private SysClassificationService sysClassificationService;
|
|
@Resource
|
private ISysUserService sysUserService;
|
|
@Resource
|
private DelayTaskService delayTaskService;
|
|
@Resource
|
private CustomConfigService customConfigService;
|
|
@Resource
|
private SysStaffService sysStaffService;
|
|
@Resource
|
private FileRecordService fileRecordService;
|
|
|
/**
|
* 获取系统标签
|
* @param sysTagId
|
* @return
|
*/
|
@PostMapping("/getSysTag")
|
public R<SysTag> getSysTag(@RequestBody Long sysTagId)
|
{
|
SysTag sysTag = sysTagService.getByTagId(sysTagId);
|
return R.ok(sysTag);
|
}
|
|
/**
|
* 获取系统标签列表
|
* @param tagType
|
* @return
|
*/
|
@PostMapping("/listSysTag")
|
public R<List<SysTag>> listSysTag(@RequestBody Integer tagType)
|
{
|
List<SysTag> sysTagList = sysTagService.listByType(tagType);
|
return R.ok(sysTagList);
|
}
|
|
/**
|
* 获取活跃度配置
|
* @return
|
*/
|
@PostMapping("/listActiveness")
|
public R<List<Activeness>> listActiveness()
|
{
|
List<Activeness> activenessList = activenessService.listActiveness();
|
return R.ok(activenessList);
|
}
|
|
/**
|
* 通过id获取分类
|
* @return
|
*/
|
@PostMapping("/getSysClassification")
|
public R<SysClassification> getSysClassification(@RequestBody Long classId)
|
{
|
SysClassification sysClassification = sysClassificationService.getById(classId);
|
return R.ok(sysClassification);
|
}
|
|
/**
|
* 通过ids获取分类
|
* @return
|
*/
|
@PostMapping("/getSysClassificationList")
|
public R<Map<Long,SysClassification>> getSysClassificationList(@RequestBody List<Long> classIds)
|
{
|
Map<Long,SysClassification> sysClassificationMap = sysClassificationService.getSysClassificationList(classIds);
|
return R.ok(sysClassificationMap);
|
}
|
|
/**
|
* @description 获取部门用户
|
* @author jqs
|
* @date 2023/6/21 16:00
|
* @param userIdByDept
|
* @return R<MgtShopIdByCodeDto>
|
*/
|
@PostMapping("/getUserIdByDept")
|
public R<MgtUserIdByDept> getUserIdByDept(@RequestBody MgtUserIdByDept userIdByDept)
|
{
|
userIdByDept = sysUserService.getUserIdByDept(userIdByDept);
|
return R.ok(userIdByDept);
|
}
|
|
/**
|
* @description 通过id获取用户简易信息
|
* @author jqs
|
* @date 2023/6/25 14:41
|
* @param mgtBaseBathDto
|
* @return R<List<MgtSysSimpleUserVo>>
|
*/
|
@PostMapping("/listSimpleUserVo")
|
public R<List<MgtSysSimpleUserVo>> listSimpleUserVo(@RequestBody MgtBaseBathDto mgtBaseBathDto)
|
{
|
List<MgtSysSimpleUserVo> sysSimpleUserVoList = sysUserService.listSimpleUserVo(mgtBaseBathDto);
|
return R.ok(sysSimpleUserVoList);
|
}
|
|
/**
|
* @description 通过名称获取活跃度
|
* @author jqs
|
* @date 2023/6/29 17:20
|
* @param name
|
* @return R<Activeness>
|
*/
|
@PostMapping("/getActivenessByName")
|
public R<Activeness> getActivenessByName(@RequestBody String name)
|
{
|
Activeness activeness = activenessService.getActivenessByName(name);
|
return R.ok(activeness);
|
}
|
|
@PostMapping("/getDelayTask")
|
public R<DelayTask> getDelayTask(@RequestBody String key)
|
{
|
DelayTask delayTask = delayTaskService.getDelayTask(key);
|
return R.ok(delayTask);
|
}
|
|
@PostMapping("/addDelayTask")
|
public R addDelayTask(@RequestBody DelayTask delayTask)
|
{
|
delayTaskService.addDelayTask(delayTask);
|
return R.ok();
|
}
|
|
@PostMapping("/deleteDelayTask")
|
public R deleteDelayTask(@RequestBody String key)
|
{
|
delayTaskService.deleteDelayTask(key);
|
return R.ok();
|
}
|
|
/**
|
* @description 获取其他设置
|
* @author jqs
|
* @date 2023/7/12 15:27
|
* @param
|
* @return R<AppOtherConfigGetVo>
|
*/
|
@PostMapping("/getAppOtherConfigGetVo")
|
public R<AppOtherConfigGetVo> getAppOtherConfigGetVo()
|
{
|
AppOtherConfigGetVo appOtherConfigGetVo = customConfigService.getAppOtherConfigGetVo();
|
return R.ok(appOtherConfigGetVo);
|
}
|
|
/**
|
* @description 改变分类数量
|
* @author jqs
|
* @date 2023/7/20 20:06
|
* @param mgtClassNumDto
|
* @return R
|
*/
|
@PostMapping("/changeClassNum")
|
public R changeClassNum(@RequestBody MgtClassNumDto mgtClassNumDto)
|
{
|
sysClassificationService.changeClassNum(mgtClassNumDto);
|
return R.ok();
|
}
|
|
/**
|
* @description 获取客户电话
|
* @author jqs
|
* @date 2023/7/29 15:26
|
* @return R<String>
|
*/
|
@PostMapping("/getServicePhone")
|
public R<String> getServicePhone()
|
{
|
MgtCustomConfigDto mgtCustomConfigDto = new MgtCustomConfigDto();
|
mgtCustomConfigDto.setConfigType("PLATFORM_SERVICE_PHONE");
|
List<String> mgtCustomConfigVo = customConfigService.getCustomConfig(mgtCustomConfigDto);
|
String servicePhone = "暂无客服电话";
|
if(mgtCustomConfigVo!=null&&mgtCustomConfigVo.size()>0){
|
servicePhone = mgtCustomConfigVo.get(0);
|
}
|
return R.ok(servicePhone);
|
}
|
|
/**
|
* @description 通过id获取员工列表
|
* @author jqs
|
* @date 2023/9/5 10:01
|
* @param userIdList
|
* @return R<List<SysStaff>>
|
*/
|
@PostMapping("/listSysStaffByIds")
|
public R<List<SysStaff>> listSysStaffByIds(@RequestBody List<Long> userIdList)
|
{
|
List<SysStaff> sysStaffList = sysStaffService.listSysStaffByIds(userIdList);
|
return R.ok(sysStaffList);
|
}
|
|
/**
|
* @description 创建文件上传记录
|
* @author jqs
|
* @date 2023/9/11 11:56
|
* @param fileRecord
|
* @return R
|
*/
|
@PostMapping("/createFileRecord")
|
public R createFileRecord(@RequestBody FileRecord fileRecord)
|
{
|
fileRecordService.createFileRecord(fileRecord);
|
return R.ok();
|
}
|
|
|
/**
|
* 获取门店课程验证密码
|
* @return
|
*/
|
@PostMapping("/getStoreCurriculumPassword")
|
public R<String> getStoreCurriculumPassword(){
|
CustomConfig one = customConfigService.getOne(new QueryWrapper<CustomConfig>().eq("config_type", ConfigEnum.STORE_COURSE_DISPLAY_PASSWORD.getKeyType())
|
.eq("config_key", ConfigEnum.STORE_COURSE_DISPLAY_PASSWORD.getKey()));
|
return R.ok(one.getConfigValue());
|
}
|
|
|
/**
|
* 获取门店课程展示名称
|
* @return
|
*/
|
@PostMapping("/getStoreCurriculumName")
|
public R<String> getStoreCurriculumName(){
|
CustomConfig one = customConfigService.getOne(new QueryWrapper<CustomConfig>().eq("config_type", ConfigEnum.STORE_COURSE_DISPLAY_NAME.getKeyType())
|
.eq("config_key", ConfigEnum.STORE_COURSE_DISPLAY_NAME.getKey()));
|
return R.ok(one.getConfigValue());
|
}
|
}
|