parent
b4ad8bb3a7
commit
e2d4aa2d61
|
|
@ -1,4 +0,0 @@
|
|||
NODE_ENV = 'development'
|
||||
|
||||
# Base API
|
||||
VITE_APP_BASE_URL=''
|
||||
|
|
@ -15,7 +15,7 @@ import javax.annotation.Resource;
|
|||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("api/decorate/data")
|
||||
@RequestMapping("/adminapi/decorate/data")
|
||||
@Api(tags = "装修数据管理")
|
||||
public class DecorateDataController {
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("api/decorate/pages")
|
||||
@RequestMapping("/adminapi/decorate/page")
|
||||
@Api(tags = "装修页面管理")
|
||||
public class DecoratePagesController {
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("api/decorate/tabbar")
|
||||
@RequestMapping("/adminapi/decorate/tabbar")
|
||||
@Api(tags = "装修导航管理")
|
||||
public class DecorateTabbarController {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.mdd.admin.controller.setting;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.mdd.admin.aop.Log;
|
||||
import com.mdd.admin.service.ISettingNoticeService;
|
||||
import com.mdd.admin.vo.setting.SettingNoticeDetailVo;
|
||||
|
|
@ -16,18 +17,20 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("api/setting/notice")
|
||||
@RequestMapping("/adminapi/notice/notice")
|
||||
@Api(tags = "配置消息通知")
|
||||
public class SettingNoticeController {
|
||||
|
||||
@Resource
|
||||
ISettingNoticeService iSettingNoticeService;
|
||||
|
||||
@GetMapping("/list")
|
||||
@GetMapping("/settingLists")
|
||||
@ApiOperation(value="通知设置列表")
|
||||
public AjaxResult<List<SettingNoticeListedVo>> list(@RequestParam Integer recipient) {
|
||||
public AjaxResult<JSONObject> list(@RequestParam Integer recipient) {
|
||||
List<SettingNoticeListedVo> list = iSettingNoticeService.list(recipient);
|
||||
return AjaxResult.success(list);
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("lists", list);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
@GetMapping("/detail")
|
||||
|
|
@ -38,9 +41,9 @@ public class SettingNoticeController {
|
|||
}
|
||||
|
||||
@Log(title = "通知设置编辑")
|
||||
@PostMapping("/save")
|
||||
@PostMapping("/set")
|
||||
@ApiOperation(value="通知设置编辑")
|
||||
public AjaxResult<Object> save(@RequestBody Map<String, Object> params) {
|
||||
public AjaxResult<Object> save(@RequestBody JSONObject params) {
|
||||
iSettingNoticeService.save(params);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.mdd.admin.controller.setting;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.mdd.admin.aop.Log;
|
||||
import com.mdd.admin.service.ISettingSmsService;
|
||||
import com.mdd.common.core.AjaxResult;
|
||||
|
|
@ -15,32 +16,32 @@ import java.util.Map;
|
|||
* 短信设置管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("api/setting/sms")
|
||||
@RequestMapping("/adminapi/notice/sms_config")
|
||||
@Api(tags = "配置短信引擎")
|
||||
public class SettingSmsController {
|
||||
|
||||
@Resource
|
||||
ISettingSmsService iSettingSmsService;
|
||||
|
||||
@GetMapping("/list")
|
||||
@GetMapping("/getConfig")
|
||||
@ApiOperation(value="短信引擎列表")
|
||||
public AjaxResult<List<Map<String, Object>>> list() {
|
||||
List<Map<String, Object>> list = iSettingSmsService.list();
|
||||
public AjaxResult<List<Map<String, Object>>> getConfig() {
|
||||
List<Map<String, Object>> list = iSettingSmsService.getConfig();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/detail")
|
||||
@ApiOperation(value="短信引擎详情")
|
||||
public AjaxResult<Map<String, Object>> detail(String alias) {
|
||||
Map<String, Object> map = iSettingSmsService.detail(alias);
|
||||
public AjaxResult<Map<String, Object>> detail(String type) {
|
||||
Map<String, Object> map = iSettingSmsService.detail(type);
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
@Log(title = "短信引擎编辑")
|
||||
@PostMapping("/save")
|
||||
@PostMapping("/setConfig")
|
||||
@ApiOperation(value="短信引擎编辑")
|
||||
public AjaxResult<Object> save(@RequestBody Map<String, String> params) {
|
||||
iSettingSmsService.save(params);
|
||||
public AjaxResult<Object> setConfig(@RequestBody JSONObject params) {
|
||||
iSettingSmsService.setConfig(params);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
package com.mdd.admin.controller.system;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.mdd.admin.service.system.IDeptService;
|
||||
import com.mdd.common.aop.NotPower;
|
||||
import com.mdd.admin.validate.commons.IdValidate;
|
||||
import com.mdd.admin.validate.system.DeptCreateValidate;
|
||||
import com.mdd.admin.validate.system.DeptSearchValidate;
|
||||
import com.mdd.admin.validate.system.DeptUpdateValidate;
|
||||
import com.mdd.admin.vo.system.DeptVo;
|
||||
import com.mdd.common.core.AjaxResult;
|
||||
import com.mdd.common.validator.annotation.IDMust;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/adminapi/dept/dept")
|
||||
@Api(tags = "系统部门管理")
|
||||
public class DeptController {
|
||||
|
||||
@Resource
|
||||
IDeptService deptService;
|
||||
|
||||
@NotPower
|
||||
@GetMapping("/all")
|
||||
@ApiOperation(value="部门所有")
|
||||
public AjaxResult<JSONArray> all() {
|
||||
JSONArray list = deptService.all();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/lists")
|
||||
@ApiOperation(value="部门列表")
|
||||
public AjaxResult<JSONArray> list(@Validated DeptSearchValidate searchValidate) {
|
||||
JSONArray list = deptService.list(searchValidate);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/detail")
|
||||
@ApiOperation(value="部门详情")
|
||||
public AjaxResult<DeptVo> detail(@Validated @IDMust() @RequestParam("id") Integer id) {
|
||||
DeptVo vo = deptService.detail(id);
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation(value="部门新增")
|
||||
public AjaxResult<Object> add(@Validated @RequestBody DeptCreateValidate createValidate) {
|
||||
deptService.add(createValidate);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/edit")
|
||||
@ApiOperation(value="部门编辑")
|
||||
public AjaxResult<Object> edit(@Validated @RequestBody DeptUpdateValidate updateValidate) {
|
||||
deptService.edit(updateValidate);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation(value="部门删除")
|
||||
public AjaxResult<Object> del(@Validated @RequestBody IdValidate idValidate) {
|
||||
deptService.del(idValidate.getId());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.mdd.admin.service;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.mdd.admin.vo.setting.SettingNoticeDetailVo;
|
||||
import com.mdd.admin.vo.setting.SettingNoticeListedVo;
|
||||
|
||||
|
|
@ -35,6 +36,6 @@ public interface ISettingNoticeService {
|
|||
* @author fzr
|
||||
* @param params 参数
|
||||
*/
|
||||
void save(Map<String, Object> params);
|
||||
void save(JSONObject params);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.mdd.admin.service;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -14,7 +16,7 @@ public interface ISettingSmsService {
|
|||
* @author fzr
|
||||
* @return List<Map<String, Object>>
|
||||
*/
|
||||
List<Map<String, Object>> list();
|
||||
List<Map<String, Object>> getConfig();
|
||||
|
||||
/**
|
||||
* 短信引擎详情
|
||||
|
|
@ -23,7 +25,7 @@ public interface ISettingSmsService {
|
|||
* @param alias 别名
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> detail(String alias);
|
||||
Map<String, Object> detail(String type);
|
||||
|
||||
/**
|
||||
* 短信引擎保存
|
||||
|
|
@ -31,6 +33,6 @@ public interface ISettingSmsService {
|
|||
* @author fzr
|
||||
* @param params 参数
|
||||
*/
|
||||
void save(Map<String, String> params);
|
||||
void setConfig(JSONObject params);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ public class DecorateDataServiceImpl implements IDecorateDataService {
|
|||
|
||||
List<Article> articles = articleMapper.selectList(new QueryWrapper<Article>()
|
||||
.eq("is_show", 1)
|
||||
.eq("is_delete", 0)
|
||||
.orderByDesc("id")
|
||||
.last("limit " + limit));
|
||||
|
||||
|
|
@ -43,8 +42,17 @@ public class DecorateDataServiceImpl implements IDecorateDataService {
|
|||
for (Article article : articles) {
|
||||
DecorateDataArticleVo vo = new DecorateDataArticleVo();
|
||||
BeanUtils.copyProperties(article, vo);
|
||||
vo.setImage(UrlUtils.toAbsoluteUrl(article.getImage()));
|
||||
vo.setCreateTime(TimeUtils.timestampToDate(article.getCreateTime()));
|
||||
vo.setImage(UrlUtils.toAbsoluteUrl(vo.getImage()));
|
||||
|
||||
Integer clickActual = vo.getClickActual() != null ? vo.getClickActual() : 0;
|
||||
|
||||
Integer clickVirtual = vo.getClickVirtual() != null ? vo.getClickVirtual() : 0;
|
||||
|
||||
Integer click = clickActual + clickVirtual;
|
||||
|
||||
vo.setClick(click);
|
||||
|
||||
vo.setCreateTime(TimeUtils.timestampToDate(vo.getCreateTime()));
|
||||
list.add(vo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.mdd.admin.validate.decorate.DecoratePageValidate;
|
|||
import com.mdd.admin.vo.decorate.DecoratePageVo;
|
||||
import com.mdd.common.entity.decorate.DecoratePage;
|
||||
import com.mdd.common.mapper.decorate.DecoratePageMapper;
|
||||
import com.mdd.common.util.TimeUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
@ -27,11 +28,15 @@ public class DecoratePageServiceImpl implements IDecoratePageService {
|
|||
public DecoratePageVo detail(Integer id) {
|
||||
DecoratePage decoratePage = decoratePageMapper.selectById(id);
|
||||
Assert.notNull(decoratePage, "数据不存在!");
|
||||
|
||||
DecoratePageVo vo = new DecoratePageVo();
|
||||
vo.setId(decoratePage.getId());
|
||||
vo.setPageType(decoratePage.getType());
|
||||
vo.setPageData(decoratePage.getData());
|
||||
vo.setName(decoratePage.getName());
|
||||
vo.setType(decoratePage.getType());
|
||||
vo.setData(decoratePage.getData());
|
||||
vo.setMeta(decoratePage.getMeta());
|
||||
|
||||
vo.setCreateTime(TimeUtils.timestampToDate(decoratePage.getCreateTime()));
|
||||
vo.setUpdateTime(TimeUtils.timestampToDate(decoratePage.getUpdateTime()));
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +51,10 @@ public class DecoratePageServiceImpl implements IDecoratePageService {
|
|||
DecoratePage decoratePage = decoratePageMapper.selectById(decoratePageValidate.getId());
|
||||
Assert.notNull(decoratePage, "数据不存在!");
|
||||
|
||||
decoratePage.setData(decoratePageValidate.getPageData());
|
||||
decoratePage.setName(decoratePageValidate.getName());
|
||||
decoratePage.setType(decoratePageValidate.getType());
|
||||
decoratePage.setMeta(decoratePageValidate.getMeta());
|
||||
decoratePage.setData(decoratePageValidate.getData());
|
||||
decoratePage.setUpdateTime(System.currentTimeMillis() / 1000);
|
||||
decoratePageMapper.updateById(decoratePage);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.mdd.admin.service.IDecorateTabbarService;
|
|||
import com.mdd.admin.validate.decorate.DecorateTabsValidate;
|
||||
import com.mdd.admin.vo.decorate.DecorateTabsListsVo;
|
||||
import com.mdd.admin.vo.decorate.DecorateTabbarVo;
|
||||
import com.mdd.admin.vo.decorate.DecorateTabsStyleVo;
|
||||
import com.mdd.common.entity.decorate.DecorateTabbar;
|
||||
import com.mdd.common.mapper.decorate.DecorateTabbarMapper;
|
||||
import com.mdd.common.util.*;
|
||||
|
|
@ -15,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import javax.annotation.Resource;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 底部导航服务实现类
|
||||
|
|
@ -43,9 +45,10 @@ public class DecorateTabbarServiceImpl implements IDecorateTabbarService {
|
|||
DecorateTabsListsVo vo = new DecorateTabsListsVo();
|
||||
vo.setId(tab.getId());
|
||||
vo.setName(tab.getName());
|
||||
vo.setSelected(UrlUtils.toAbsoluteUrl(tab.getSelected()));
|
||||
vo.setUnselected(UrlUtils.toAbsoluteUrl(tab.getUnselected()));
|
||||
vo.setSelected(tab.getSelected());
|
||||
vo.setUnselected(tab.getUnselected());
|
||||
vo.setLink(JSON.parse(tab.getLink()));
|
||||
vo.setIsShow(tab.getIsShow());
|
||||
vo.setCreateTime(TimeUtils.timestampToDate(tab.getCreateTime()));
|
||||
vo.setUpdateTime(TimeUtils.timestampToDate(tab.getUpdateTime()));
|
||||
tabList.add(vo);
|
||||
|
|
@ -54,7 +57,11 @@ public class DecorateTabbarServiceImpl implements IDecorateTabbarService {
|
|||
String tabbar = ConfigUtils.get("tabbar", "style", "{}");
|
||||
|
||||
DecorateTabbarVo response = new DecorateTabbarVo();
|
||||
response.setStyle(MapUtils.jsonToMap(tabbar));
|
||||
DecorateTabsStyleVo styleVo = new DecorateTabsStyleVo();
|
||||
Map<String,String> styleMap = MapUtils.jsonToMap(tabbar);
|
||||
styleVo.setDefaultColor(styleMap.get("defaultColor"));
|
||||
styleVo.setSelectedColor(styleMap.get("selectedColor"));
|
||||
response.setStyle(styleVo);
|
||||
response.setList(tabList);
|
||||
return response;
|
||||
}
|
||||
|
|
@ -74,8 +81,8 @@ public class DecorateTabbarServiceImpl implements IDecorateTabbarService {
|
|||
DecorateTabbar model = new DecorateTabbar();
|
||||
model.setName(obj.getName());
|
||||
model.setLink(JSON.toJSONString(obj.getLink()));
|
||||
model.setSelected(UrlUtils.toRelativeUrl(obj.getSelected()));
|
||||
model.setUnselected(UrlUtils.toRelativeUrl(obj.getUnselected()));
|
||||
model.setSelected(obj.getSelected());
|
||||
model.setUnselected(obj.getUnselected());
|
||||
model.setCreateTime(System.currentTimeMillis() / 1000);
|
||||
model.setUpdateTime(System.currentTimeMillis() / 1000);
|
||||
decorateTabbarMapper.insert(model);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.mdd.admin.validate.file.FileSearchValidate;
|
|||
import com.mdd.admin.validate.commons.PageValidate;
|
||||
import com.mdd.admin.vo.album.FileCateVo;
|
||||
import com.mdd.admin.vo.album.FileVo;
|
||||
import com.mdd.common.config.GlobalConfig;
|
||||
import com.mdd.common.core.PageResult;
|
||||
import com.mdd.common.entity.file.File;
|
||||
import com.mdd.common.entity.file.FileCate;
|
||||
|
|
@ -73,15 +74,21 @@ public class FileServiceImpl implements IFileService {
|
|||
|
||||
IPage<File> iPage = fileMapper.selectPage(new Page<>(page, limit), queryWrapper);
|
||||
|
||||
// String engine = ConfigUtils.get("storage", "default", "local");
|
||||
// engine = engine.equals("") ? "local" : engine;
|
||||
String engine = ConfigUtils.get("storage", "default", "local");
|
||||
engine = engine.equals("") ? "local" : engine;
|
||||
|
||||
List<FileVo> list = new ArrayList<>();
|
||||
for (File file : iPage.getRecords()) {
|
||||
FileVo vo = new FileVo();
|
||||
BeanUtils.copyProperties(file, vo);
|
||||
vo.setUrl(UrlUtils.toAbsoluteUrl(file.getUri()));
|
||||
vo.setUri(file.getUri());
|
||||
|
||||
if (engine.equals("local")) {
|
||||
vo.setUri(GlobalConfig.publicPrefix + "/" + file.getUri());
|
||||
} else {
|
||||
vo.setUri(file.getUri());
|
||||
}
|
||||
|
||||
vo.setCreateTime(TimeUtils.timestampToDate(file.getCreateTime()));
|
||||
vo.setUpdateTime(TimeUtils.timestampToDate(file.getUpdateTime()));
|
||||
list.add(vo);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.mdd.admin.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mdd.admin.service.ISettingNoticeService;
|
||||
import com.mdd.admin.vo.setting.SettingNoticeDetailVo;
|
||||
|
|
@ -38,7 +39,6 @@ public class SettingNoticeServiceImpl implements ISettingNoticeService {
|
|||
public List<SettingNoticeListedVo> list(Integer recipient) {
|
||||
QueryWrapper<NoticeSetting> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("recipient", recipient);
|
||||
queryWrapper.eq("is_delete", 0);
|
||||
queryWrapper.orderByAsc("id");
|
||||
|
||||
List<NoticeSetting> noticeSettings = noticeSettingMapper.selectList(queryWrapper);
|
||||
|
|
@ -47,18 +47,28 @@ public class SettingNoticeServiceImpl implements ISettingNoticeService {
|
|||
SettingNoticeListedVo vo = new SettingNoticeListedVo();
|
||||
BeanUtils.copyProperties(n, vo);
|
||||
|
||||
Map<String, String> systemMap = MapUtils.jsonToMap(n.getSystemNotice());
|
||||
Map<String, String> smsMap = MapUtils.jsonToMap(n.getSmsNotice());
|
||||
Map<String, String> oaMap = MapUtils.jsonToMap(n.getOaNotice());
|
||||
Map<String, String> mnpMap = MapUtils.jsonToMap(n.getMnpNotice());
|
||||
|
||||
JSONObject systemNotice = JSONObject.parse(n.getSystemNotice());
|
||||
JSONObject smsNotice = JSONObject.parse(n.getSmsNotice());
|
||||
JSONObject oaNotice = JSONObject.parse(n.getOaNotice());
|
||||
JSONObject mnpNotice = JSONObject.parse(n.getMnpNotice());
|
||||
|
||||
if (systemNotice != null && "1".equals(systemNotice.getString("status"))) {
|
||||
vo.setSmsNotice(systemNotice);
|
||||
}
|
||||
|
||||
if (smsNotice != null && "1".equals(smsNotice.getString("status"))) {
|
||||
vo.setSmsNotice(smsNotice);
|
||||
}
|
||||
|
||||
if (oaNotice != null && "1".equals(oaNotice.getString("status"))) {
|
||||
vo.setSmsNotice(oaNotice);
|
||||
}
|
||||
|
||||
if (mnpNotice != null && "1".equals(mnpNotice.getString("status"))) {
|
||||
vo.setSmsNotice(mnpNotice);
|
||||
}
|
||||
vo.setType(n.getType()==1?"业务通知":"验证码");
|
||||
vo.setSystemStatus(Integer.parseInt(systemMap.getOrDefault("status", "0")));
|
||||
vo.setSmsStatus(Integer.parseInt(smsMap.getOrDefault("status", "0")));
|
||||
vo.setOaStatus(Integer.parseInt(oaMap.getOrDefault("status", "0")));
|
||||
vo.setMnpStatus(Integer.parseInt(mnpMap.getOrDefault("status", "0")));
|
||||
vo.setCreateTime(TimeUtils.timestampToDate(n.getCreateTime()));
|
||||
vo.setUpdateTime(TimeUtils.timestampToDate(n.getUpdateTime()));
|
||||
list.add(vo);
|
||||
}
|
||||
|
||||
|
|
@ -77,29 +87,19 @@ public class SettingNoticeServiceImpl implements ISettingNoticeService {
|
|||
public SettingNoticeDetailVo detail(Integer id) {
|
||||
NoticeSetting noticeSetting = noticeSettingMapper.selectOne(new QueryWrapper<NoticeSetting>()
|
||||
.select(NoticeSetting.class, info ->
|
||||
!info.getColumn().equals("is_delete") &&
|
||||
!info.getColumn().equals("delete_time") &&
|
||||
!info.getColumn().equals("create_time") &&
|
||||
!info.getColumn().equals("update_time")
|
||||
)
|
||||
.eq("id", id)
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
|
||||
Map<String, Object> systemMap = MapUtils.jsonToMapAsObj(noticeSetting.getSystemNotice());
|
||||
Map<String, Object> oaMap = MapUtils.jsonToMapAsObj(noticeSetting.getOaNotice());
|
||||
Map<String, Object> mnpMap = MapUtils.jsonToMapAsObj(noticeSetting.getMnpNotice());
|
||||
Map<String, Object> smsMap = MapUtils.jsonToMapAsObj(noticeSetting.getSmsNotice());
|
||||
|
||||
smsMap.put("tips", JSON.parseArray(smsMap.get("tips").toString()));
|
||||
|
||||
SettingNoticeDetailVo vo = new SettingNoticeDetailVo();
|
||||
BeanUtils.copyProperties(noticeSetting, vo);
|
||||
vo.setType(noticeSetting.getType().equals(1)?"业务通知":"验证码");
|
||||
vo.setSystemNotice(systemMap);
|
||||
vo.setOaNotice(oaMap);
|
||||
vo.setMnpNotice(mnpMap);
|
||||
vo.setSmsNotice(smsMap);
|
||||
vo.setSystemNotice(JSONObject.parse(noticeSetting.getSystemNotice()));
|
||||
vo.setOaNotice(JSONObject.parse(noticeSetting.getOaNotice()));
|
||||
vo.setMnpNotice(JSONObject.parse(noticeSetting.getMnpNotice()));
|
||||
vo.setSmsNotice(JSONObject.parse(noticeSetting.getSmsNotice()));
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
|
@ -110,58 +110,22 @@ public class SettingNoticeServiceImpl implements ISettingNoticeService {
|
|||
* @param params 参数
|
||||
*/
|
||||
@Override
|
||||
public void save(Map<String, Object> params) {
|
||||
public void save(JSONObject params) {
|
||||
Integer id = Integer.parseInt(params.get("id").toString());
|
||||
NoticeSetting noticeSetting = noticeSettingMapper.selectOne(new QueryWrapper<NoticeSetting>()
|
||||
.eq("id", id)
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
|
||||
Map<String, String> systemParam = MapUtils.objectToMap(params.get("systemNotice"));
|
||||
Map<String, String> systemMap = MapUtils.jsonToMap(noticeSetting.getSystemNotice());
|
||||
if (StringUtils.isNotEmpty(systemMap)) {
|
||||
systemMap.put("title", systemParam.getOrDefault("title", ""));
|
||||
systemMap.put("content", systemParam.getOrDefault("content", ""));
|
||||
systemMap.put("tips", systemParam.getOrDefault("tips", ""));
|
||||
systemMap.put("status", systemParam.getOrDefault("status", "0"));
|
||||
}
|
||||
JSONObject template = params.getJSONObject("template");
|
||||
JSONObject mnp_notice = template.getJSONObject("mnp_notice");
|
||||
JSONObject oa_notice = template.getJSONObject("oa_notice");
|
||||
JSONObject sms_notice = template.getJSONObject("sms_notice");
|
||||
JSONObject system_notice = template.getJSONObject("system_notice");
|
||||
|
||||
Map<String, String> smsParam = MapUtils.objectToMap(params.get("smsNotice"));
|
||||
Map<String, String> smsMap = MapUtils.jsonToMap(noticeSetting.getSmsNotice());
|
||||
if (StringUtils.isNotEmpty(smsMap)) {
|
||||
smsMap.put("templateId", smsParam.getOrDefault("templateId", ""));
|
||||
smsMap.put("content", smsParam.getOrDefault("content", ""));
|
||||
smsMap.put("tips", smsParam.getOrDefault("tips", ""));
|
||||
smsMap.put("status", smsParam.getOrDefault("status", "0"));
|
||||
}
|
||||
|
||||
Map<String, String> oaParam = MapUtils.objectToMap(params.get("oaNotice"));
|
||||
Map<String, String> oaMap = MapUtils.jsonToMap(noticeSetting.getOaNotice());
|
||||
if (StringUtils.isNotEmpty(oaMap)) {
|
||||
oaMap.put("name", oaParam.getOrDefault("name", ""));
|
||||
oaMap.put("first", oaParam.getOrDefault("first", ""));
|
||||
oaMap.put("remark", oaParam.getOrDefault("remark", ""));
|
||||
oaMap.put("templateId", oaParam.getOrDefault("templateId", ""));
|
||||
oaMap.put("templateSn", oaParam.getOrDefault("templateSn", ""));
|
||||
oaMap.put("tpl", oaParam.getOrDefault("tpl", ""));
|
||||
oaMap.put("tips", oaParam.getOrDefault("tips", ""));
|
||||
oaMap.put("status", oaParam.getOrDefault("status", "0"));
|
||||
}
|
||||
|
||||
Map<String, String> mnpParam = MapUtils.objectToMap(params.get("mnpNotice"));
|
||||
Map<String, String> mnpMap = MapUtils.jsonToMap(noticeSetting.getMnpNotice());
|
||||
if (StringUtils.isNotEmpty(mnpParam)) {
|
||||
mnpMap.put("templateId", mnpParam.get("templateId"));
|
||||
mnpMap.put("templateSn", mnpParam.get("templateSn"));
|
||||
mnpMap.put("tpl", mnpParam.get("tpl"));
|
||||
mnpMap.put("tips", mnpParam.get("tips"));
|
||||
mnpMap.put("status", mnpParam.getOrDefault("status", "0"));
|
||||
}
|
||||
|
||||
noticeSetting.setSystemNotice(JSON.toJSONString(systemMap));
|
||||
noticeSetting.setSmsNotice(JSON.toJSONString(smsMap));
|
||||
noticeSetting.setOaNotice(JSON.toJSONString(oaMap));
|
||||
noticeSetting.setMnpNotice(JSON.toJSONString(mnpMap));
|
||||
noticeSetting.setSystemNotice(system_notice.toJSONString());
|
||||
noticeSetting.setSmsNotice(sms_notice.toJSONString());
|
||||
noticeSetting.setOaNotice(oa_notice.toJSONString());
|
||||
noticeSetting.setMnpNotice(mnp_notice.toJSONString());
|
||||
noticeSetting.setUpdateTime(System.currentTimeMillis() / 1000);
|
||||
noticeSettingMapper.updateById(noticeSetting);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.mdd.admin.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.mdd.admin.service.ISettingSmsService;
|
||||
import com.mdd.common.util.ConfigUtils;
|
||||
import com.mdd.common.util.StringUtils;
|
||||
|
|
@ -22,20 +23,20 @@ public class SettingSmsServiceImpl implements ISettingSmsService {
|
|||
* @return List<Map<String, Object>>
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> list() {
|
||||
String engine = ConfigUtils.get("sms", "default", "aliyun");
|
||||
public List<Map<String, Object>> getConfig() {
|
||||
String engine = ConfigUtils.get("sms", "engine", "ali");
|
||||
List<Map<String, Object>> list = new LinkedList<>();
|
||||
|
||||
Map<String, Object> aliyun = new LinkedHashMap<>();
|
||||
aliyun.put("name", "阿里云短信");
|
||||
aliyun.put("alias", "aliyun");
|
||||
aliyun.put("status", engine.equals("aliyun") ? 1 : 0);
|
||||
aliyun.put("type", "ali");
|
||||
aliyun.put("status", engine.equalsIgnoreCase("ali") ? 1 : 0);
|
||||
list.add(aliyun);
|
||||
|
||||
Map<String, Object> tencent = new LinkedHashMap<>();
|
||||
tencent.put("name", "腾讯云短信");
|
||||
tencent.put("alias", "tencent");
|
||||
tencent.put("status", engine.equals("tencent") ? 1 : 0);
|
||||
tencent.put("type", "tencent");
|
||||
tencent.put("status", engine.equalsIgnoreCase("tencent") ? 1 : 0);
|
||||
list.add(tencent);
|
||||
return list;
|
||||
}
|
||||
|
|
@ -48,29 +49,29 @@ public class SettingSmsServiceImpl implements ISettingSmsService {
|
|||
* @return Map<String, Object>
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> detail(String alias) {
|
||||
public Map<String, Object> detail(String type) {
|
||||
String env = YmlUtils.get("like.production");
|
||||
boolean envStatus = StringUtils.isNotNull(env) && env.equals("true");
|
||||
|
||||
String engine = ConfigUtils.get("sms", "default", "local");
|
||||
Map<String, String> config = ConfigUtils.getMap("sms", alias);
|
||||
String engine = ConfigUtils.get("sms", "engine", "ali");
|
||||
Map<String, String> config = ConfigUtils.getMap("sms", type);
|
||||
config = StringUtils.isNotNull(config) ? config : Collections.emptyMap();
|
||||
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("name", config.getOrDefault("name", ""));
|
||||
map.put("status", engine.equals(alias) ? 1 : 0);
|
||||
map.put("alias", alias);
|
||||
map.put("status", engine.equalsIgnoreCase(type) ? 1 : 0);
|
||||
map.put("type", type);
|
||||
map.put("sign", config.getOrDefault("sign", ""));
|
||||
|
||||
switch (alias) {
|
||||
case "aliyun":
|
||||
map.put("appKey", envStatus ? "******" : config.getOrDefault("appKey", ""));
|
||||
map.put("secretKey", envStatus ? "******" : config.getOrDefault("secretKey", ""));
|
||||
switch (type) {
|
||||
case "ali":
|
||||
map.put("app_key", envStatus ? "******" : config.getOrDefault("app_key", ""));
|
||||
map.put("secret_key", envStatus ? "******" : config.getOrDefault("secret_key", ""));
|
||||
break;
|
||||
case "tencent":
|
||||
map.put("appId", envStatus ? "******" : config.getOrDefault("appId", ""));
|
||||
map.put("secretId", envStatus ? "******" : config.getOrDefault("secretId", ""));
|
||||
map.put("secretKey", envStatus ? "******" : config.getOrDefault("secretKey", ""));
|
||||
map.put("app_id", envStatus ? "******" : config.getOrDefault("app_id", ""));
|
||||
map.put("secret_id", envStatus ? "******" : config.getOrDefault("secret_id", ""));
|
||||
map.put("secret_key", envStatus ? "******" : config.getOrDefault("secret_key", ""));
|
||||
break;
|
||||
case "huawei":
|
||||
break;
|
||||
|
|
@ -86,36 +87,16 @@ public class SettingSmsServiceImpl implements ISettingSmsService {
|
|||
* @param params 参数
|
||||
*/
|
||||
@Override
|
||||
public void save(Map<String, String> params) {
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
public void setConfig(JSONObject params) {
|
||||
String type = params.getString("type");
|
||||
|
||||
switch (params.get("alias")) {
|
||||
case "aliyun":
|
||||
map.put("name", "阿里云短信");
|
||||
map.put("alias", "aliyun");
|
||||
map.put("sign", params.getOrDefault("sign", ""));
|
||||
map.put("appKey", params.getOrDefault("appKey", ""));
|
||||
map.put("secretKey", params.getOrDefault("secretKey", ""));
|
||||
break;
|
||||
case "tencent":
|
||||
map.put("name", "腾讯云短信");
|
||||
map.put("alias", "aliyun");
|
||||
map.put("sign", params.getOrDefault("sign", ""));
|
||||
map.put("appId", params.getOrDefault("appId", ""));
|
||||
map.put("secretId", params.getOrDefault("secretId", ""));
|
||||
map.put("secretKey", params.getOrDefault("secretKey", ""));
|
||||
break;
|
||||
case "huawei":
|
||||
break;
|
||||
}
|
||||
ConfigUtils.set("sms", type, params.toJSONString());
|
||||
|
||||
ConfigUtils.set("sms", params.get("alias"), JSON.toJSONString(map));
|
||||
|
||||
String engine = ConfigUtils.get("sms", "default", "");
|
||||
if (Integer.parseInt(params.get("status")) == 1) {
|
||||
ConfigUtils.set("sms", "default", params.get("alias"));
|
||||
} else if (engine.equals(params.get("alias")) && Integer.parseInt(params.get("status")) == 0) {
|
||||
ConfigUtils.set("sms", "default", "");
|
||||
String engine = ConfigUtils.get("sms", "engine", "");
|
||||
if (Integer.parseInt(params.getString("status")) == 1) {
|
||||
ConfigUtils.set("sms", "engine", type);
|
||||
} else if (engine.equals(type) && Integer.parseInt(params.getString("status")) == 0) {
|
||||
ConfigUtils.set("sms", "engine", "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,225 @@
|
|||
package com.mdd.admin.service.impl.system;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Assert;
|
||||
import com.mdd.admin.service.system.IDeptService;
|
||||
import com.mdd.admin.validate.system.DeptCreateValidate;
|
||||
import com.mdd.admin.validate.system.DeptSearchValidate;
|
||||
import com.mdd.admin.validate.system.DeptUpdateValidate;
|
||||
import com.mdd.admin.vo.system.DeptVo;
|
||||
import com.mdd.common.entity.admin.Admin;
|
||||
import com.mdd.common.entity.admin.Dept;
|
||||
import com.mdd.common.mapper.admin.AdminMapper;
|
||||
import com.mdd.common.mapper.admin.DeptMapper;
|
||||
import com.mdd.common.util.ListUtils;
|
||||
import com.mdd.common.util.TimeUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 系统部门服务实现类
|
||||
*/
|
||||
@Service
|
||||
public class DeptServiceImpl implements IDeptService {
|
||||
|
||||
@Resource
|
||||
DeptMapper deptMapper;
|
||||
|
||||
@Resource
|
||||
AdminMapper adminMapper;
|
||||
|
||||
/**
|
||||
* 岗位所有
|
||||
*
|
||||
* @author fzr
|
||||
* @return List<SystemAuthDeptVo>
|
||||
*/
|
||||
@Override
|
||||
public JSONArray all() {
|
||||
QueryWrapper<Dept> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.isNull("delete_time");
|
||||
queryWrapper.orderByDesc(Arrays.asList("sort", "id"));
|
||||
queryWrapper.select(Dept.class, info ->
|
||||
!info.getColumn().equals("delete_time"));
|
||||
|
||||
|
||||
List<Dept> systemAuthDeptList = deptMapper.selectList(queryWrapper);
|
||||
|
||||
List<DeptVo> list = new LinkedList<>();
|
||||
for (Dept systemAuthDept : systemAuthDeptList) {
|
||||
DeptVo vo = new DeptVo();
|
||||
BeanUtils.copyProperties(systemAuthDept, vo);
|
||||
vo.setStatusDesc(systemAuthDept.getStatus() != null && systemAuthDept.getStatus().intValue() == 1 ? "正常" : "禁用");
|
||||
vo.setCreateTime(TimeUtils.timestampToDate(systemAuthDept.getCreateTime()));
|
||||
vo.setUpdateTime(TimeUtils.timestampToDate(systemAuthDept.getUpdateTime()));
|
||||
list.add(vo);
|
||||
}
|
||||
|
||||
JSONArray jsonArray = JSONArray.parseArray(JSONArray.toJSONString(list));
|
||||
return ListUtils.listToTree(jsonArray, "id", "pid", "children");
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门列表
|
||||
*
|
||||
* @author fzr
|
||||
* @param searchValidate 搜索参数
|
||||
* @return JSONArray
|
||||
*/
|
||||
@Override
|
||||
public JSONArray list(DeptSearchValidate searchValidate) {
|
||||
QueryWrapper<Dept> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.isNull("delete_time");
|
||||
queryWrapper.orderByDesc(Arrays.asList("sort", "id"));
|
||||
queryWrapper.select(Dept.class, info ->
|
||||
!info.getColumn().equals("delete_time"));
|
||||
|
||||
deptMapper.setSearch(queryWrapper, searchValidate, new String[]{
|
||||
"like:name:str",
|
||||
"=:status@status:int"
|
||||
});
|
||||
|
||||
List<Dept> systemAuthDeptList = deptMapper.selectList(queryWrapper);
|
||||
|
||||
List<DeptVo> list = new LinkedList<>();
|
||||
for (Dept systemAuthDept : systemAuthDeptList) {
|
||||
DeptVo vo = new DeptVo();
|
||||
BeanUtils.copyProperties(systemAuthDept, vo);
|
||||
vo.setStatusDesc(systemAuthDept.getStatus() != null && systemAuthDept.getStatus().intValue() == 1 ? "正常" : "禁用");
|
||||
vo.setCreateTime(TimeUtils.timestampToDate(systemAuthDept.getCreateTime()));
|
||||
vo.setUpdateTime(TimeUtils.timestampToDate(systemAuthDept.getUpdateTime()));
|
||||
list.add(vo);
|
||||
}
|
||||
|
||||
JSONArray jsonArray = JSONArray.parseArray(JSONArray.toJSONString(list));
|
||||
return ListUtils.listToTree(jsonArray, "id", "pid", "children");
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门详情
|
||||
*
|
||||
* @author fzr
|
||||
* @param id 主键
|
||||
* @return SystemDeptVo
|
||||
*/
|
||||
@Override
|
||||
public DeptVo detail(Integer id) {
|
||||
Dept systemAuthDept = deptMapper.selectOne(
|
||||
new QueryWrapper<Dept>()
|
||||
.select(Dept.class, info ->
|
||||
!info.getColumn().equals("delete_time"))
|
||||
.eq("id", id)
|
||||
.isNull("delete_time")
|
||||
.last("limit 1"));
|
||||
|
||||
Assert.notNull(systemAuthDept, "部门已不存在!");
|
||||
|
||||
DeptVo vo = new DeptVo();
|
||||
BeanUtils.copyProperties(systemAuthDept, vo);
|
||||
vo.setCreateTime(TimeUtils.timestampToDate(systemAuthDept.getCreateTime()));
|
||||
vo.setUpdateTime(TimeUtils.timestampToDate(systemAuthDept.getUpdateTime()));
|
||||
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门新增
|
||||
*
|
||||
* @author fzr
|
||||
* @param createValidate 参数
|
||||
*/
|
||||
@Override
|
||||
public void add(DeptCreateValidate createValidate) {
|
||||
if (createValidate.getPid().equals(0)) {
|
||||
Dept systemAuthDept = deptMapper.selectOne(
|
||||
new QueryWrapper<Dept>()
|
||||
.select("id,pid,name")
|
||||
.eq("pid", 0)
|
||||
.isNull("delete_time")
|
||||
.last("limit 1"));
|
||||
|
||||
Assert.isNull(systemAuthDept, "顶级部门只允许有一个");
|
||||
}
|
||||
|
||||
Dept model = new Dept();
|
||||
model.setPid(createValidate.getPid());
|
||||
model.setName(createValidate.getName());
|
||||
model.setLeader(createValidate.getLeader());
|
||||
model.setMobile(createValidate.getMobile());
|
||||
model.setSort(createValidate.getSort());
|
||||
model.setStatus(createValidate.getStatus());
|
||||
model.setCreateTime(System.currentTimeMillis() / 1000);
|
||||
model.setUpdateTime(System.currentTimeMillis() / 1000);
|
||||
deptMapper.insert(model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门编辑
|
||||
*
|
||||
* @author fzr
|
||||
* @param updateValidate 参数
|
||||
*/
|
||||
@Override
|
||||
public void edit(DeptUpdateValidate updateValidate) {
|
||||
Dept model = deptMapper.selectOne(
|
||||
new QueryWrapper<Dept>()
|
||||
.select(Dept.class, info ->
|
||||
!info.getColumn().equals("delete_time"))
|
||||
.eq("id", updateValidate.getId())
|
||||
.isNull("delete_time")
|
||||
.last("limit 1"));
|
||||
|
||||
Assert.notNull(model, "部门不存在");
|
||||
Assert.isFalse((model.getPid().equals(0) && updateValidate.getPid()>0), "顶级部门不能修改上级");
|
||||
Assert.isFalse(updateValidate.getId().equals(updateValidate.getPid()), "上级部门不能是自己");
|
||||
|
||||
model.setPid(updateValidate.getPid());
|
||||
model.setName(updateValidate.getName());
|
||||
model.setLeader(updateValidate.getLeader());
|
||||
model.setMobile(updateValidate.getMobile());
|
||||
model.setSort(updateValidate.getSort());
|
||||
model.setStatus(updateValidate.getStatus());
|
||||
model.setUpdateTime(System.currentTimeMillis() / 1000);
|
||||
deptMapper.updateById(model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门删除
|
||||
*
|
||||
* @author fzr
|
||||
* @param id 主键
|
||||
*/
|
||||
@Override
|
||||
public void del(Integer id) {
|
||||
Dept model = deptMapper.selectOne(
|
||||
new QueryWrapper<Dept>()
|
||||
.select("id,pid,name")
|
||||
.eq("id", id)
|
||||
.isNull("delete_time")
|
||||
.last("limit 1"));
|
||||
|
||||
Assert.notNull(model, "部门不存在");
|
||||
Assert.isFalse((model.getPid() == 0), "顶级部门不能删除");
|
||||
|
||||
Dept pModel = deptMapper.selectOne(
|
||||
new QueryWrapper<Dept>()
|
||||
.select("id,pid,name")
|
||||
.eq("pid", id)
|
||||
.isNull("delete_time")
|
||||
.last("limit 1"));
|
||||
|
||||
Assert.isNull(pModel, "请先删除子级部门");
|
||||
|
||||
List<Admin> admins = adminMapper.getByDept(id);
|
||||
|
||||
Assert.isTrue(admins.isEmpty(), "该部门已被管理员使用,请先移除");
|
||||
|
||||
model.setDeleteTime(System.currentTimeMillis() / 1000);
|
||||
deptMapper.updateById(model);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.mdd.admin.service.system;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.mdd.admin.validate.system.DeptCreateValidate;
|
||||
import com.mdd.admin.validate.system.DeptSearchValidate;
|
||||
import com.mdd.admin.validate.system.DeptUpdateValidate;
|
||||
import com.mdd.admin.vo.system.DeptVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统部门服务接口类
|
||||
*/
|
||||
public interface IDeptService {
|
||||
|
||||
/**
|
||||
* 部门列表
|
||||
*
|
||||
* @author fzr
|
||||
* @param searchValidate 搜索参数
|
||||
* @return JSONArray
|
||||
*/
|
||||
JSONArray list(DeptSearchValidate searchValidate);
|
||||
|
||||
/**
|
||||
* 部门所有
|
||||
*
|
||||
* @author fzr
|
||||
* @return JSONArray
|
||||
*/
|
||||
JSONArray all();
|
||||
|
||||
/**
|
||||
* 部门详情
|
||||
*
|
||||
* @author fzr
|
||||
* @param id 主键
|
||||
* @return SysMenu
|
||||
*/
|
||||
DeptVo detail(Integer id);
|
||||
|
||||
/**
|
||||
* 部门新增
|
||||
*
|
||||
* @author fzr
|
||||
* @param createValidate 参数
|
||||
*/
|
||||
void add(DeptCreateValidate createValidate);
|
||||
|
||||
/**
|
||||
* 部门编辑
|
||||
*
|
||||
* @author fzr
|
||||
* @param updateValidate 参数
|
||||
*/
|
||||
void edit(DeptUpdateValidate updateValidate);
|
||||
|
||||
/**
|
||||
* 部门删除
|
||||
*
|
||||
* @author fzr
|
||||
* @param id 主键
|
||||
*/
|
||||
void del(Integer id);
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package com.mdd.admin.validate.decorate;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.mdd.common.validator.annotation.IDMust;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -18,8 +20,16 @@ public class DecoratePageValidate implements Serializable {
|
|||
@ApiModelProperty(value = "id", required = true)
|
||||
private Integer id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Integer type;
|
||||
|
||||
@NotNull(message = "pageData参数缺失")
|
||||
@ApiModelProperty(value = "装修数据", required = true)
|
||||
private String pageData;
|
||||
private String data;
|
||||
|
||||
@NotNull(message = "pageMeta")
|
||||
@ApiModelProperty(value = "装修数据", required = true)
|
||||
private String meta;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import java.io.Serializable;
|
|||
|
||||
@Data
|
||||
@ApiModel("系统部门创建参数")
|
||||
public class SystemDeptCreateValidate implements Serializable {
|
||||
public class DeptCreateValidate implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ public class SystemDeptCreateValidate implements Serializable {
|
|||
private String name;
|
||||
|
||||
@Length(min = 1, max = 30, message = "负责人名称必须在1~30个字符内")
|
||||
private String duty = "";
|
||||
private String leader = "";
|
||||
|
||||
@Length(min = 11, max = 11, message = "手机号只能为11位")
|
||||
@Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
|
||||
|
|
@ -39,7 +39,7 @@ public class SystemDeptCreateValidate implements Serializable {
|
|||
@NotNull(message = "请选择状态")
|
||||
@IntegerContains(values = {0, 1})
|
||||
@ApiModelProperty(value = "状态", required = true)
|
||||
private Integer isStop;
|
||||
private Integer status;
|
||||
|
||||
@NotNull(message = "排序号不能为空")
|
||||
@DecimalMin(value = "0", message = "排序号值不能少于0")
|
||||
|
|
@ -8,7 +8,7 @@ import java.io.Serializable;
|
|||
|
||||
@Data
|
||||
@ApiModel("系统部门搜索参数")
|
||||
public class SystemDeptSearchValidate implements Serializable {
|
||||
public class DeptSearchValidate implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
@ -16,6 +16,6 @@ public class SystemDeptSearchValidate implements Serializable {
|
|||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "是否停用")
|
||||
private Integer isStop;
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ import java.io.Serializable;
|
|||
|
||||
@Data
|
||||
@ApiModel("系统部门更新参数")
|
||||
public class SystemDeptUpdateValidate implements Serializable {
|
||||
public class DeptUpdateValidate implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ public class SystemDeptUpdateValidate implements Serializable {
|
|||
private String name;
|
||||
|
||||
@Length(min = 1, max = 30, message = "负责人名称必须在1~30个字符内")
|
||||
private String duty = "";
|
||||
private String leader = "";
|
||||
|
||||
@Length(min = 11, max = 11, message = "手机号只能为11位")
|
||||
@Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
|
||||
|
|
@ -44,7 +44,7 @@ public class SystemDeptUpdateValidate implements Serializable {
|
|||
@NotNull(message = "请选择状态")
|
||||
@IntegerContains(values = {0, 1})
|
||||
@ApiModelProperty(value = "状态")
|
||||
private Integer isStop;
|
||||
private Integer status;
|
||||
|
||||
@DecimalMin(value = "0", message = "排序号值不能少于0")
|
||||
@DecimalMax(value = "9999", message = "排序号值不能大于9999")
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package com.mdd.admin.vo.decorate;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -12,26 +14,46 @@ public class DecorateDataArticleVo implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
@ApiModelProperty(value = "主键")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "文章标题")
|
||||
@ApiModelProperty(value = "分类")
|
||||
private String cateName;
|
||||
|
||||
@ApiModelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "文章简介")
|
||||
private String intro;
|
||||
|
||||
@ApiModelProperty(value = "文章描述")
|
||||
private String summary;
|
||||
|
||||
@ApiModelProperty(value = "文章图片")
|
||||
@ApiModelProperty(value = "图片")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "文章作者")
|
||||
@ApiModelProperty(value = "作者")
|
||||
private String author;
|
||||
|
||||
@ApiModelProperty(value = "浏览数量")
|
||||
private Integer visit;
|
||||
@ApiModelProperty("简介")
|
||||
@TableField(value = "`desc`")
|
||||
private String desc;
|
||||
|
||||
@ApiModelProperty("摘要")
|
||||
@JsonProperty("abstract")
|
||||
private String abstractField;
|
||||
|
||||
@ApiModelProperty(value = "访问")
|
||||
private Integer click;
|
||||
|
||||
@ApiModelProperty("内容")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("虚拟浏览量")
|
||||
private Integer clickVirtual;
|
||||
|
||||
@ApiModelProperty("实际浏览量")
|
||||
private Integer clickActual;
|
||||
|
||||
@ApiModelProperty(value = "是否显示")
|
||||
private Integer isShow;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private String createTime;
|
||||
|
|
|
|||
|
|
@ -16,9 +16,19 @@ public class DecoratePageVo implements Serializable {
|
|||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "页面类型")
|
||||
private Integer pageType;
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "页面数据")
|
||||
private String pageData;
|
||||
private String data;
|
||||
|
||||
@ApiModelProperty(value = "页面数据")
|
||||
private String meta;
|
||||
|
||||
private String createTime;
|
||||
|
||||
private String updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class DecorateTabbarVo implements Serializable {
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "样式")
|
||||
private Map<String, String> style;
|
||||
private DecorateTabsStyleVo style;
|
||||
|
||||
@ApiModelProperty(value = "列表")
|
||||
private List<DecorateTabsListsVo> list;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ public class DecorateTabsListsVo implements Serializable {
|
|||
@ApiModelProperty(value = "id")
|
||||
private Object link;
|
||||
|
||||
@ApiModelProperty(value = "是否显示")
|
||||
private Integer isShow;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private String createTime;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.mdd.admin.vo.setting;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -15,25 +16,28 @@ public class SettingNoticeDetailVo implements Serializable {
|
|||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "senceId")
|
||||
private Integer senceId;
|
||||
|
||||
@ApiModelProperty(value = "场景名称")
|
||||
private String name;
|
||||
private String sceneName;
|
||||
|
||||
@ApiModelProperty(value = "通知类型: [1=业务, 2=验证]")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "场景描述")
|
||||
private String remarks;
|
||||
private String sceneDesc;
|
||||
|
||||
@ApiModelProperty(value = "系统的通知设置")
|
||||
private Object systemNotice;
|
||||
private JSONObject systemNotice;
|
||||
|
||||
@ApiModelProperty(value = "公众号通知设置")
|
||||
private Object oaNotice;
|
||||
private JSONObject oaNotice;
|
||||
|
||||
@ApiModelProperty(value = "小程序通知设置")
|
||||
private Object mnpNotice;
|
||||
private JSONObject mnpNotice;
|
||||
|
||||
@ApiModelProperty(value = "短信的通知设置")
|
||||
private Object smsNotice;
|
||||
private JSONObject smsNotice;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.mdd.admin.vo.setting;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -16,27 +17,18 @@ public class SettingNoticeListedVo implements Serializable {
|
|||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "通知名称")
|
||||
private String name;
|
||||
private String sceneName;
|
||||
|
||||
@ApiModelProperty(value = "通知类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "通知状态")
|
||||
private Integer systemStatus;
|
||||
@ApiModelProperty(value = "通知类型")
|
||||
private String typeDesc;
|
||||
|
||||
@ApiModelProperty(value = "通知状态")
|
||||
private Integer smsStatus;
|
||||
private String smsStatusDesc;
|
||||
|
||||
@ApiModelProperty(value = "公众号状态")
|
||||
private Integer oaStatus;
|
||||
|
||||
@ApiModelProperty(value = "小程序状态")
|
||||
private Integer mnpStatus;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private String createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private String updateTime;
|
||||
@ApiModelProperty(value = "通知对象")
|
||||
private JSONObject smsNotice;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.mdd.admin.vo.system;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -8,7 +9,7 @@ import java.io.Serializable;
|
|||
|
||||
@Data
|
||||
@ApiModel("部门Vo")
|
||||
public class SystemAuthDeptVo implements Serializable {
|
||||
public class DeptVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
@ -22,7 +23,7 @@ public class SystemAuthDeptVo implements Serializable {
|
|||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "负责人")
|
||||
private String duty;
|
||||
private String leader;
|
||||
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private String mobile;
|
||||
|
|
@ -31,12 +32,17 @@ public class SystemAuthDeptVo implements Serializable {
|
|||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "是否停用: [0=否, 1=是]")
|
||||
private Integer isStop;
|
||||
private Integer status;
|
||||
|
||||
@JsonProperty("status_desc")
|
||||
private String statusDesc;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonProperty("create_time")
|
||||
private String createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@JsonProperty("update_time")
|
||||
private String updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.mdd.common.entity.admin;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@ApiModel("系统岗位实体")
|
||||
public class Dept implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@ApiModelProperty("ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("上级部门")
|
||||
private Integer pid;
|
||||
|
||||
@ApiModelProperty("部门名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("负责人名")
|
||||
private String leader;
|
||||
|
||||
@ApiModelProperty("联系电话")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("排序编号")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("是否禁用: [0=否, 1=是]")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Long createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Long updateTime;
|
||||
|
||||
@ApiModelProperty("删除时间")
|
||||
private Long deleteTime;
|
||||
|
||||
}
|
||||
|
|
@ -30,6 +30,9 @@ public class DecorateTabbar implements Serializable {
|
|||
@ApiModelProperty("链接地址")
|
||||
private String link;
|
||||
|
||||
@ApiModelProperty("是否显示")
|
||||
private Integer isShow;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Long createTime;
|
||||
|
||||
|
|
|
|||
|
|
@ -19,13 +19,13 @@ public class NoticeSetting implements Serializable {
|
|||
private Integer id;
|
||||
|
||||
@ApiModelProperty("场景编号")
|
||||
private Integer scene;
|
||||
private Integer sceneId;
|
||||
|
||||
@ApiModelProperty("场景名称")
|
||||
private String name;
|
||||
private String sceneName;
|
||||
|
||||
@ApiModelProperty("场景描述")
|
||||
private String remarks;
|
||||
private String sceneDesc;
|
||||
|
||||
@ApiModelProperty("接收人员: [1=用户, 2=平台]")
|
||||
private Integer recipient;
|
||||
|
|
@ -45,16 +45,7 @@ public class NoticeSetting implements Serializable {
|
|||
@ApiModelProperty("小程序通知设置")
|
||||
private String mnpNotice;
|
||||
|
||||
@ApiModelProperty("是否删除: [0=否, 1=是]")
|
||||
private Integer isDelete;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Long createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Long updateTime;
|
||||
|
||||
@ApiModelProperty("删除时间")
|
||||
private Long deleteTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.mdd.common.mapper.admin;
|
|||
import com.mdd.common.core.basics.IBaseMapper;
|
||||
import com.mdd.common.entity.admin.Admin;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -13,4 +14,9 @@ import java.util.List;
|
|||
@Mapper
|
||||
public interface AdminMapper extends IBaseMapper<Admin> {
|
||||
|
||||
|
||||
@Select("SELECT * FROM la_admin admin INNER JOIN la_admin_dept lad ON admin.id = lad.admin_id WHERE lad.dept_id = #{deptId} AND admin.delete_time IS NULL")
|
||||
List<Admin> getByDept(@Param("deptId") Integer deptId);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
package com.mdd.common.mapper.admin;
|
||||
|
||||
import com.mdd.common.core.basics.IBaseMapper;
|
||||
import com.mdd.common.entity.admin.Dept;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 部门表Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeptMapper extends IBaseMapper<Dept> {
|
||||
|
||||
}
|
||||
|
|
@ -20,8 +20,7 @@ public class NoticeDriver {
|
|||
NoticeSettingMapper noticeSettingMapper = SpringUtils.getBean(NoticeSettingMapper.class);
|
||||
NoticeSetting noticeSetting = noticeSettingMapper.selectOne(
|
||||
new QueryWrapper<NoticeSetting>()
|
||||
.eq("scene", noticeSmsVo.getScene())
|
||||
.eq("is_delete", 0)
|
||||
.eq("scene_id", noticeSmsVo.getScene())
|
||||
.last("limit 1"));
|
||||
|
||||
if (StringUtils.isNull(noticeSetting)) {
|
||||
|
|
@ -30,7 +29,7 @@ public class NoticeDriver {
|
|||
|
||||
// 短信通知
|
||||
SmsTemplate smsTemplate = new SmsTemplate();
|
||||
smsTemplate.setName(noticeSetting.getName());
|
||||
smsTemplate.setName(noticeSetting.getSceneName());
|
||||
smsTemplate.setType(noticeSetting.getType());
|
||||
smsTemplate.setParams(noticeSetting.getSmsNotice());
|
||||
if (StringUtils.isNotNull(smsTemplate.getStatus()) && smsTemplate.getStatus().equals(1)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue