Merge branch 'feature/develop2.1.1'

This commit is contained in:
8fire 2022-07-26 10:19:47 +08:00
commit 8c5b8b08f0
105 changed files with 4732 additions and 1802 deletions

View File

@ -39,7 +39,11 @@
29. **账务管理:简易版账户和账户流水,支付申请单管理**
## 在线体验
暂未开放数据库,有需要的可以加群,项目可用于搭建流程平台商业化
**地址http://dingflow.xyz:9527/login**
**后台管理系统地址https://www.dingflow.yifaoa.top/login**
**DingFlow前台官网地址https://www.dingflow.yifaoa.top/front/index**
- QQ群:
- **技术交流群:
QQ一群 577813338(已满)**<a target="_blank" href="https://jq.qq.com/?_wv=1027&k=HBdPBdyf"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="Flop Mine" title="DingFlow"></a>
@ -216,6 +220,14 @@ V2.1.0 2022-03-14
- 3.0 优化采购管理,现在采购单,支付申请单,虚拟账户实现打通
- 4.0 修复Excel导出异常功能
- 5.0 优化部分菜单栏目
V2.1.1 2022-08-01
- 项目断更好久了最近一段时间阿吉比较忙碌大环境让阿吉创业胎死腹中入职了新公司。从0到1开发了一款奢侈品电商APP需要买名牌包的联系阿吉这期先做个小更新近期都会以优化代码为主
- 1.0 重构邮件模块
- 2.0 重构消息中心
- 3.0 钉钉模块部分代码调整
## 未来规划
- 1.0 接入企业微信
@ -233,9 +245,9 @@ V2.1.0 2022-03-14
开源离不开您的参与、支持与鼓励。开源不易如果您觉得项目对您有帮助请您动动小手star一下也是对作者的莫大帮助与支持。
## 友情链接
- 博客http://47.114.7.28:8082
- 博客http://47.114.7.28:8082(暂时不能访问)
- 若依http://ruoyi.vip
- 在线文档http://dingflow.xyz:3000
- 在线文档http://dingflow.xyz:3000(暂时不能访问)
## 最后,特别感谢若依系统提供框架

15
pom.xml
View File

@ -8,8 +8,10 @@
<version>2.0.0</version>
<name>snow</name>
<url>http://dingflow.xyz:9527</url>
<description>snow管理系统</description>
<url>https://www.dingflow.yifaoa.top/front/index</url>
<description>
DingFlow 系统致力于打造一款开源的面向中小型企业管理系统
</description>
<properties>
<snow.version>2.0.0</snow.version>
@ -125,6 +127,8 @@
</exclusion>
</exclusions>
</dependency>
<!--解析sql工具类-->
<dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
@ -264,6 +268,8 @@
<artifactId>alipay-sdk-java</artifactId>
<version>${com.alipay.sdk.version}</version>
</dependency>
<!--钉钉-->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>dingtalk</artifactId>
@ -338,11 +344,6 @@
<version>${flowable.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.stdlib.verson}</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>

View File

@ -82,7 +82,7 @@ public class SnowGlobalExceptionHandler {
@ExceptionHandler(FlowableException.class)
public AjaxResult flowableException(Exception e)
{
log.error(e.getMessage(), e);
String errMessage=Optional.ofNullable(e.getMessage()).orElse("");
log.error("流程服务异常:"+e.getMessage(), e);
if(e.getMessage().contains("")){

View File

@ -18,7 +18,7 @@ import com.snow.common.core.page.TableDataInfo;
import com.snow.common.enums.BusinessType;
import com.snow.common.utils.poi.ExcelUtil;
import com.snow.framework.util.ShiroUtils;
import com.snow.system.domain.SysDictData;
import com.snow.common.core.domain.SysDictData;
import com.snow.system.service.ISysDictDataService;
/**

View File

@ -20,7 +20,7 @@ import com.snow.common.core.page.TableDataInfo;
import com.snow.common.enums.BusinessType;
import com.snow.common.utils.poi.ExcelUtil;
import com.snow.framework.util.ShiroUtils;
import com.snow.system.domain.SysDictType;
import com.snow.common.core.domain.SysDictType;
import com.snow.system.service.ISysDictTypeService;
/**

View File

@ -109,7 +109,7 @@ public class SysIndexController extends BaseController
mmap.put("isPasswordExpired", passwordIsExpiration(user.getPwdUpdateDate()));
mmap.put("isNewNotice",isNotice);
List<SysOaEmail> myNoReadOaEmailList = sysOaEmailService.getMyNoReadOaEmailList(String.valueOf(user.getUserId()));
List<SysOaEmailDTO> myNoReadOaEmailList = sysOaEmailService.getMyNoReadOaEmailList(String.valueOf(user.getUserId()));
mmap.put("emailListSize",myNoReadOaEmailList.size());
//如果大于三条只取前三条记录
if(CollectionUtils.isNotEmpty(myNoReadOaEmailList)&&myNoReadOaEmailList.size()>3){

View File

@ -1,9 +1,12 @@
package com.snow.web.controller.system;
import cn.hutool.core.collection.CollUtil;
import com.snow.common.annotation.Log;
import com.snow.common.core.controller.BaseController;
import com.snow.common.core.domain.AjaxResult;
import com.snow.common.core.page.TableDataInfo;
import com.snow.common.core.text.Convert;
import com.snow.common.enums.BusinessType;
import com.snow.common.enums.MessageEventType;
import com.snow.framework.util.ShiroUtils;
import com.snow.system.domain.SysMessageTransition;
@ -13,9 +16,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.stream.Collectors;
@ -42,6 +43,7 @@ public class SysMessageCenterController extends BaseController
*/
@RequiresPermissions("system:messageCenter:view")
@GetMapping()
@Deprecated
public String messageCenter(ModelMap mmap)
{
SysUser sysUser = ShiroUtils.getSysUser();
@ -91,18 +93,47 @@ public class SysMessageCenterController extends BaseController
mmap.put("sysTaskList",sysTaskList);
}
return prefix + "/messageCenter";
return prefix + "/message_center";
}
/**
* 前端消息中心
* 消息列表
* @param sysMessageTransition
* @return
*/
@RequiresPermissions("system:messageCenter:view")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(SysMessageTransition sysMessageTransition) {
startPage();
sysMessageTransition.setConsumerId(String.valueOf(ShiroUtils.getUserId()));
sysMessageTransition.setOrderBy("create_time desc");
List<SysMessageTransition> sysMessageTransitions = sysMessageTransitionService.selectSysMessageTransitionList(sysMessageTransition);
return getDataTable(sysMessageTransitions);
}
/**
* 详情
* @param id
* @param mmap
* @return
*/
@GetMapping("/detail/{id}")
@RequiresPermissions("system:messageCenter:detail")
public String detail(@PathVariable("id") Long id, ModelMap mmap) {
SysMessageTransition sysMessageTransition = sysMessageTransitionService.selectSysMessageTransitionById(id);
mmap.put("sysMessageTransition", sysMessageTransition);
return prefix + "/detail";
}
/**
* 官网消息中心
* @param sysMessageTransition
* @param mmap
* @return
*/
@GetMapping("/website")
public String websiteMessageCenter(SysMessageTransition sysMessageTransition,ModelMap mmap)
{
public String websiteMessageCenter(SysMessageTransition sysMessageTransition,ModelMap mmap) {
startPage();
SysUser sysUser = ShiroUtils.getSysUser();
sysMessageTransition.setConsumerId(String.valueOf(sysUser.getUserId()));
@ -139,4 +170,41 @@ public class SysMessageCenterController extends BaseController
int i = sysMessageTransitionService.updateSysMessageTransition(sysMessageTransition);
return AjaxResult.success(i);
}
/**
* 标记已读
* @param ids
* @return
*/
@RequiresPermissions("system:messageCenter:mark")
@PostMapping( "/mark")
@ResponseBody
public AjaxResult mark(String ids)
{
List<String> idList = Convert.toStrList(ids);
idList.forEach(t->{
SysUser sysUser = ShiroUtils.getSysUser();
SysMessageTransition sysMessageTransition=new SysMessageTransition();
sysMessageTransition.setId(Long.parseLong(t));
sysMessageTransition.setMessageReadStatus(1L);
sysMessageTransition.setUpdateBy(String.valueOf(sysUser.getUserId()));
sysMessageTransitionService.updateSysMessageTransition(sysMessageTransition);
});
return AjaxResult.success();
}
/**
* 删除消息
*
* @param ids
* @return
*/
@RequiresPermissions("system:messageCenter:remove")
@Log(title = "消息中心", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(sysMessageTransitionService.deleteSysMessageTransitionByIds(ids));
}
}

View File

@ -1,5 +1,6 @@
package com.snow.web.controller.system;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.NumberUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@ -12,7 +13,7 @@ import com.snow.common.core.page.TableDataInfo;
import com.snow.common.core.text.Convert;
import com.snow.common.enums.BusinessType;
import com.snow.common.enums.MessageEventType;
import com.snow.common.enums.SysEmailSearchType;
import com.snow.common.enums.SysEmailType;
import com.snow.common.utils.StringUtils;
import com.snow.framework.util.ShiroUtils;
import com.snow.common.core.domain.MessageEventRequest;
@ -24,7 +25,6 @@ import com.snow.system.service.impl.SysUserServiceImpl;
import org.apache.commons.collections.CollectionUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
@ -44,8 +44,7 @@ import java.util.stream.Collectors;
*/
@Controller
@RequestMapping("/system/email")
public class SysOaEmailController extends BaseController
{
public class SysOaEmailController extends BaseController {
private String prefix = "system/email";
@Autowired
@ -57,8 +56,6 @@ public class SysOaEmailController extends BaseController
@Autowired
private ISysSequenceService sequenceService;
@Value("${spring.mail.username}")
private String from;
@Autowired
private SysMessageTransitionServiceImpl sysMessageTransitionService;
@ -66,63 +63,124 @@ public class SysOaEmailController extends BaseController
@Autowired
private ApplicationContext applicationContext;
@RequiresPermissions("system:email:view")
@RequiresPermissions("system:email:writeMail")
@GetMapping()
public String email()
{
return prefix + "/mailCompose";
public String writeMail() {
return prefix + "/write-email";
}
/**
* 查询邮件列表
* 收件箱
* @return 跳转收件箱
*/
@RequiresPermissions("system:email:getMyList")
@PostMapping("/getMyList")
@RequiresPermissions("system:email:receivedMail")
@GetMapping("/receivedMail")
public String receivedMail() {
return prefix + "/received-email";
}
@RequiresPermissions("system:email:receivedMail")
@PostMapping("/getReceivedMail")
@ResponseBody
public TableDataInfo getMyList(SysOaEmailDO sysOaEmail)
{
public TableDataInfo getReceivedMail(SysOaEmailDO sysOaEmail) {
startPage();
SysUser sysUser = ShiroUtils.getSysUser();
Integer mailSearchType = sysOaEmail.getMailSearchType();
List<SysOaEmailVO> list =Lists.newArrayList();
switch (mailSearchType){
//收件
case 6:
sysOaEmail.setConsumerId(String.valueOf(sysUser.getUserId()));
break;
//发件
case 7:
sysOaEmail.setProducerId(String.valueOf(sysUser.getUserId()));
break;
//重要(我发件的或者收件的可标记为重要)
case 3:
sysOaEmail.setProducerOrConsumerId(String.valueOf(sysUser.getUserId()));
sysOaEmail.setEmailStatus(3L);
break;
//发消息:草稿状态
case 1:
sysOaEmail.setProducerId(String.valueOf(sysUser.getUserId()));
sysOaEmail.setEmailStatus(1L);
list = sysOaEmailService.selectEmailList(sysOaEmail);
return getDataTable(list);
//收件存在垃圾
case 4:
sysOaEmail.setConsumerId(String.valueOf(sysUser.getUserId()));
sysOaEmail.setEmailStatus(4L);
break;
default:
}
sysOaEmail.setMessageType(MessageEventType.SEND_EMAIL.getCode());
sysOaEmail.setConsumerId(String.valueOf(sysUser.getUserId()));
sysOaEmail.setSortField("m.message_read_status asc,o.update_time desc");
list=sysOaEmailService.selectEmailList(sysOaEmail);
return getDataTable(list);
return getDataTable(sysOaEmailService.selectEmailList(sysOaEmail));
}
/**
* 获取是否已读 true 已读false 未读
* 发件箱
* @return 跳转发件箱
*/
@RequiresPermissions("system:email:sendMail")
@GetMapping("/sendMail")
public String sendMail() {
return prefix + "/send-email";
}
@RequiresPermissions("system:email:sendMail")
@PostMapping("/getSendMail")
@ResponseBody
public TableDataInfo getSendMail(SysOaEmailDO sysOaEmail) {
startPage();
SysUser sysUser = ShiroUtils.getSysUser();
sysOaEmail.setMessageType(MessageEventType.SEND_EMAIL.getCode());
sysOaEmail.setProducerId(String.valueOf(sysUser.getUserId()));
sysOaEmail.setSortField("m.message_read_status asc,o.update_time desc");
return getDataTable(sysOaEmailService.selectEmailList(sysOaEmail));
}
/**
* 草稿箱
* @return 跳转草稿箱
*/
@RequiresPermissions("system:email:draftsMail")
@GetMapping("/drafts")
public String drafts() {
return prefix + "/drafts-email";
}
@RequiresPermissions("system:email:draftsMail")
@PostMapping("/getDraftsMail")
@ResponseBody
public TableDataInfo getDraftsMail(SysOaEmailDTO sysOaEmail) {
startPage();
SysUser sysUser = ShiroUtils.getSysUser();
sysOaEmail.setBelongUserId(String.valueOf(sysUser.getUserId()));
sysOaEmail.setEmailStatus(1L);
return getDataTable(sysOaEmailService.selectSysOaEmailList(sysOaEmail));
}
/**
* 标星邮件
* @return 跳转标星邮件
*/
@RequiresPermissions("system:email:importantMail")
@GetMapping("/importantMail")
public String importantMail() {
return prefix + "/important-email";
}
@RequiresPermissions("system:email:importantMail")
@PostMapping("/getImportantMail")
@ResponseBody
public TableDataInfo getImportantMail(SysOaEmailDO sysOaEmail) {
startPage();
SysUser sysUser = ShiroUtils.getSysUser();
sysOaEmail.setProducerOrConsumerId(String.valueOf(sysUser.getUserId()));
sysOaEmail.setEmailStatus(3);
sysOaEmail.setSortField("m.message_read_status asc,o.update_time desc");
return getDataTable(sysOaEmailService.selectEmailList(sysOaEmail));
}
/**
* 垃圾箱
* @return 跳转垃圾箱
*/
@RequiresPermissions("system:email:trashMail")
@GetMapping("/trashMail")
public String trash() {
return prefix + "/trash-email";
}
@RequiresPermissions("system:email:trashMail")
@PostMapping("/getTrashMail")
@ResponseBody
public TableDataInfo getTrashMail(SysOaEmailDO sysOaEmail) {
startPage();
SysUser sysUser = ShiroUtils.getSysUser();
sysOaEmail.setConsumerId(String.valueOf(sysUser.getUserId()));
sysOaEmail.setEmailStatus(4);
sysOaEmail.setSortField("m.message_read_status asc,o.update_time desc");
return getDataTable(sysOaEmailService.selectEmailList(sysOaEmail));
}
/**
* 获取是否已读 true 已读false 未读received-mail
* @param outsideId
* @return
*/
@ -140,11 +198,10 @@ public class SysOaEmailController extends BaseController
* 修改邮件
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
SysOaEmail sysOaEmail = sysOaEmailService.selectSysOaEmailById(id);
public String edit(@PathVariable("id") Long id, ModelMap mmap) {
SysOaEmailDTO sysOaEmail = sysOaEmailService.selectSysOaEmailById(id);
mmap.put("sysOaEmail", sysOaEmail);
return prefix + "/mailComposeEdit";
return prefix + "/edit-email";
}
/**
@ -154,7 +211,7 @@ public class SysOaEmailController extends BaseController
@Log(title = "邮件", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(SysOaEmail sysOaEmail)
public AjaxResult editSave(SysOaEmailDTO sysOaEmail)
{
return toAjax(sysOaEmailService.updateSysOaEmail(sysOaEmail));
}
@ -171,9 +228,9 @@ public class SysOaEmailController extends BaseController
SysUser sysUser = ShiroUtils.getSysUser();
ArrayList<String> idList = Lists.newArrayList(Convert.toStrArray(ids));
idList.forEach(t->{
SysOaEmail sysOaEmail=new SysOaEmail();
SysOaEmailDTO sysOaEmail=new SysOaEmailDTO();
sysOaEmail.setId(Long.parseLong(t));
sysOaEmail.setEmailStatus(SysEmailSearchType.TRASH.getCode().longValue());
sysOaEmail.setEmailStatus(SysEmailType.TRASH.getCode().longValue());
sysOaEmail.setUpdateBy(String.valueOf(sysUser.getUserId()));
sysOaEmailService.updateSysOaEmail(sysOaEmail);
});
@ -192,9 +249,9 @@ public class SysOaEmailController extends BaseController
public AjaxResult remarkRead(String ids)
{
SysUser sysUser = ShiroUtils.getSysUser();
SysOaEmail sysOaEmail=new SysOaEmail();
SysOaEmailDTO sysOaEmail=new SysOaEmailDTO();
sysOaEmail.setIdList(Lists.newArrayList(Convert.toStrArray(ids)));
List<SysOaEmail> sysOaEmailList = sysOaEmailService.selectSysOaEmailList(sysOaEmail);
List<SysOaEmailDTO> sysOaEmailList = sysOaEmailService.selectSysOaEmailList(sysOaEmail);
sysOaEmailList.forEach(t->{
SysMessageTransition sysMessageTransition=new SysMessageTransition();
sysMessageTransition.setConsumerId(String.valueOf(sysUser.getUserId()));
@ -221,9 +278,9 @@ public class SysOaEmailController extends BaseController
SysUser sysUser = ShiroUtils.getSysUser();
ArrayList<String> idList = Lists.newArrayList(Convert.toStrArray(ids));
idList.forEach(t->{
SysOaEmail sysOaEmail=new SysOaEmail();
SysOaEmailDTO sysOaEmail=new SysOaEmailDTO();
sysOaEmail.setId(Long.parseLong(t));
sysOaEmail.setEmailStatus(SysEmailSearchType.IMPORTANT.getCode().longValue());
sysOaEmail.setEmailStatus(SysEmailType.IMPORTANT.getCode().longValue());
sysOaEmail.setUpdateBy(String.valueOf(sysUser.getUserId()));
sysOaEmailService.updateSysOaEmail(sysOaEmail);
});
@ -243,10 +300,10 @@ public class SysOaEmailController extends BaseController
public AjaxResult markDelete(String ids)
{
SysOaEmail sysOaEmail=new SysOaEmail();
SysOaEmailDTO sysOaEmail=new SysOaEmailDTO();
sysOaEmail.setIdList(Lists.newArrayList(Convert.toStrArray(ids)));
List<SysOaEmail> sysOaEmailList = sysOaEmailService.selectSysOaEmailList(sysOaEmail);
int j = sysMessageTransitionService.deleteSysMessageTransitionByOutsideId(sysOaEmailList.stream().map(SysOaEmail::getEmailNo).collect(Collectors.toList()));
List<SysOaEmailDTO> sysOaEmailList = sysOaEmailService.selectSysOaEmailList(sysOaEmail);
int j = sysMessageTransitionService.deleteSysMessageTransitionByOutsideId(sysOaEmailList.stream().map(SysOaEmailDTO::getEmailNo).collect(Collectors.toList()));
int i = sysOaEmailService.deleteSysOaEmailByIds(ids);
return AjaxResult.success(j);
}
@ -263,11 +320,12 @@ public class SysOaEmailController extends BaseController
@ResponseBody
@RepeatSubmit
@Transactional(rollbackFor = Exception.class)
public AjaxResult sendSysEmail(SysOaEmail sysOaEmail){
public AjaxResult sendSysEmail(SysOaEmailDTO sysOaEmail){
SysUser sysUser = ShiroUtils.getSysUser();
if(StringUtils.isNotNull(sysOaEmail.getId())){
sysOaEmail.setUpdateBy(String.valueOf(sysUser.getUserId()));
sysOaEmailService.updateSysOaEmail(sysOaEmail);
SysOaEmail oaEmail = BeanUtil.copyProperties(sysOaEmail, SysOaEmail.class);
oaEmail.setEmailToUser(Lists.newArrayList(sysOaEmail.getEmailTo()));
sysOaEmailService.updateById(oaEmail);
}else {
String newSequenceNo = sequenceService.getNewSequenceNo(SequenceConstants.OA_EMAIL_SEQUENCE);
sysOaEmail.setBelongUserId(String.valueOf(sysUser.getUserId()));
@ -275,12 +333,14 @@ public class SysOaEmailController extends BaseController
sysOaEmail.setUpdateBy(String.valueOf(sysUser.getUserId()));
sysOaEmail.setEmailNo(newSequenceNo);
sysOaEmail.setSendTime(new Date());
sysOaEmailService.insertSysOaEmail(sysOaEmail);
SysOaEmail oaEmail = BeanUtil.copyProperties(sysOaEmail, SysOaEmail.class);
oaEmail.setEmailToUser(Lists.newArrayList(sysOaEmail.getEmailTo()));
sysOaEmailService.save(oaEmail);
}
String newSequenceNo=sysOaEmail.getEmailNo();
//只有发送状态下才能发送
if(sysOaEmail.getEmailStatus().intValue()==SysEmailSearchType.COMMON.getCode()){
if(sysOaEmail.getEmailStatus().intValue()== SysEmailType.COMMON.getCode()){
MessageEventRequest messageEventDTO=new MessageEventRequest(MessageEventType.SEND_EMAIL.getCode());
messageEventDTO.setProducerId(String.valueOf(sysUser.getUserId()));
messageEventDTO.setConsumerIds(Sets.newHashSet(sysOaEmail.getEmailTo()));
@ -309,7 +369,7 @@ public class SysOaEmailController extends BaseController
public String mailDetail(@PathVariable("id") String id,ModelMap mmap)
{
SysUser sysUser = ShiroUtils.getSysUser();
SysOaEmail sysOaEmail;
SysOaEmailDTO sysOaEmail;
if(NumberUtil.isLong(id)){
sysOaEmail = sysOaEmailService.selectSysOaEmailById(Long.parseLong(id));
}else {
@ -331,7 +391,7 @@ public class SysOaEmailController extends BaseController
messageEventDTO.setMessageEventType(MessageEventType.SEND_EMAIL);
applicationContext.publishEvent(messageEventDTO);
mmap.put("sysOaEmail", sysOaEmail);
return prefix + "/mailDetail";
return prefix + "/mail-detail";
}
@ -366,13 +426,13 @@ public class SysOaEmailController extends BaseController
//垃圾标记针对收件messageStatus = null
long trashTotal = list.stream().filter(t -> (
t.getConsumerId().equals(String.valueOf(sysUser.getUserId())))&&t.getEmailStatus().intValue()==SysEmailSearchType.TRASH.getCode()).
t.getConsumerId().equals(String.valueOf(sysUser.getUserId())))&&t.getEmailStatus().intValue()== SysEmailType.TRASH.getCode()).
count();
builder.trashTotal(trashTotal);
//草稿标记针对我发件
long draftsTotal= list.stream().filter(t -> (
t.getProducerId().equals(String.valueOf(sysUser.getUserId())))&&t.getEmailStatus().intValue()==SysEmailSearchType.DRAFTS.getCode()).
t.getProducerId().equals(String.valueOf(sysUser.getUserId())))&&t.getEmailStatus().intValue()== SysEmailType.DRAFTS.getCode()).
count();
builder.draftsTotal(draftsTotal);
}
@ -381,10 +441,57 @@ public class SysOaEmailController extends BaseController
importantSysOaEmail.setProducerOrConsumerId(String.valueOf(sysUser.getUserId()));
List<SysOaEmailVO> importantSysOaEmailList = sysOaEmailService.selectEmailList(importantSysOaEmail);
//重要标记收件或者发件
long importantTotal = importantSysOaEmailList.stream().filter(t -> t.getEmailStatus().intValue()==SysEmailSearchType.IMPORTANT.getCode()).
long importantTotal = importantSysOaEmailList.stream().filter(t -> t.getEmailStatus().intValue()== SysEmailType.IMPORTANT.getCode()).
count();
builder.importantTotal(importantTotal);
return AjaxResult.success(builder.build());
}
/**
* 查询邮件列表
*/
@RequiresPermissions("system:email:getMyList")
@PostMapping("/getMyList")
@ResponseBody
@Deprecated
public TableDataInfo getMyList(SysOaEmailDO sysOaEmail)
{
startPage();
SysUser sysUser = ShiroUtils.getSysUser();
Integer mailSearchType = sysOaEmail.getMailSearchType();
List<SysOaEmailVO> list =Lists.newArrayList();
switch (mailSearchType){
//收件
case 6:
sysOaEmail.setConsumerId(String.valueOf(sysUser.getUserId()));
break;
//发件
case 7:
sysOaEmail.setProducerId(String.valueOf(sysUser.getUserId()));
break;
//重要(我发件的或者收件的可标记为重要)
case 3:
sysOaEmail.setProducerOrConsumerId(String.valueOf(sysUser.getUserId()));
sysOaEmail.setEmailStatus(3);
break;
//发消息:草稿状态
case 1:
sysOaEmail.setProducerId(String.valueOf(sysUser.getUserId()));
sysOaEmail.setEmailStatus(1);
list = sysOaEmailService.selectEmailList(sysOaEmail);
return getDataTable(list);
//收件存在垃圾
case 4:
sysOaEmail.setConsumerId(String.valueOf(sysUser.getUserId()));
sysOaEmail.setEmailStatus(4);
break;
default:
}
sysOaEmail.setMessageType(MessageEventType.SEND_EMAIL.getCode());
sysOaEmail.setSortField("m.message_read_status asc,o.update_time desc");
list=sysOaEmailService.selectEmailList(sysOaEmail);
return getDataTable(list);
}
}

View File

@ -1,45 +1,42 @@
package com.snow.web.controller.system;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists;
import com.snow.common.annotation.Log;
import com.snow.common.annotation.RepeatSubmit;
import com.snow.common.constant.MessageConstants;
import com.snow.common.core.controller.BaseController;
import com.snow.common.core.domain.AjaxResult;
import com.snow.common.core.domain.MessageEventRequest;
import com.snow.common.core.page.TableDataInfo;
import com.snow.common.enums.BusinessType;
import com.snow.common.enums.DingFlowTaskType;
import com.snow.common.enums.MessageEventType;
import com.snow.common.utils.poi.ExcelUtil;
import com.snow.dingtalk.service.WorkRecodeService;
import com.snow.framework.util.ShiroUtils;
import com.snow.system.domain.SysOaTask;
import com.snow.system.domain.SysOaTaskDistribute;
import com.snow.system.domain.SysUser;
import com.snow.system.service.ISysOaTaskDistributeService;
import com.snow.system.service.ISysOaTaskService;
import org.apache.commons.compress.utils.Sets;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.BetweenFormater;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.collect.Lists;
import com.snow.common.constant.MessageConstants;
import com.snow.common.core.domain.MessageEventRequest;
import com.snow.common.enums.DingFlowTaskType;
import com.snow.common.enums.DingTalkListenerType;
import com.snow.common.enums.MessageEventType;
import com.snow.framework.util.ShiroUtils;
import com.snow.system.domain.*;
import com.snow.system.domain.SysOaTaskDistribute;
import com.snow.system.event.SyncEvent;
import com.snow.system.service.ISysOaTaskDistributeService;
import com.snow.system.service.ISysUserService;
import org.apache.commons.compress.utils.Sets;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.snow.common.annotation.Log;
import com.snow.common.enums.BusinessType;
import org.springframework.stereotype.Controller;
import com.snow.system.service.ISysOaTaskService;
import com.snow.common.core.controller.BaseController;
import com.snow.common.core.domain.AjaxResult;
import com.snow.common.utils.poi.ExcelUtil;
import com.snow.common.core.page.TableDataInfo;
/**
* 系统任务Controller
* 当任务被分配后判断是否同步到钉钉系统
@ -48,8 +45,7 @@ import com.snow.common.core.page.TableDataInfo;
*/
@Controller
@RequestMapping("/system/task")
public class SysOaTaskController extends BaseController
{
public class SysOaTaskController extends BaseController {
private String prefix = "system/task";
@Autowired
@ -59,10 +55,10 @@ public class SysOaTaskController extends BaseController
private ISysOaTaskDistributeService sysOaTaskDistributeService;
@Autowired
private ISysUserService sysUserService;
private ApplicationContext applicationContext;
@Autowired
private ApplicationContext applicationContext;
private WorkRecodeService workRecodeService;
@RequiresPermissions("system:task:view")
@GetMapping()
@ -71,18 +67,6 @@ public class SysOaTaskController extends BaseController
return prefix + "/task";
}
/**
* 查询系统任务列表
*/
@RequiresPermissions("system:task:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(SysOaTask sysOaTask)
{
startPage();
List<SysOaTask> list = sysOaTaskService.selectSysOaTaskList(sysOaTask);
return getDataTable(list);
}
/**
* 任务分配列表
@ -90,13 +74,13 @@ public class SysOaTaskController extends BaseController
@RequiresPermissions("system:task:taskDistributeList")
@PostMapping("/taskDistributeList")
@ResponseBody
public TableDataInfo taskDistributeList(SysOaTaskDistribute sysOaTaskDistribute)
{
public TableDataInfo taskDistributeList(SysOaTaskDistribute sysOaTaskDistribute) {
startPage();
List<SysOaTaskDistribute> list = sysOaTaskDistributeService.selectSysOaTaskDistributeList(sysOaTaskDistribute);
if(CollUtil.isNotEmpty(list)){
warpSysOaTask(list);
if(CollUtil.isEmpty(list)){
return getDataTable(list);
}
sysOaTaskDistributeService.warpSysOaTask(list);
return getDataTable(list);
}
/**
@ -105,54 +89,38 @@ public class SysOaTaskController extends BaseController
@RequiresPermissions("system:task:myList")
@PostMapping("/myList")
@ResponseBody
public TableDataInfo myList(SysOaTask sysOaTask)
{
public TableDataInfo myList(SysOaTask sysOaTask) {
startPage();
SysUser sysUser = ShiroUtils.getSysUser();
sysOaTask.setCreateBy(String.valueOf(sysUser.getUserId()));
sysOaTask.setCreateBy(String.valueOf(ShiroUtils.getUserId()));
List<SysOaTask> list = sysOaTaskService.selectSysOaTaskList(sysOaTask);
return getDataTable(list);
}
/**
* 我的待处理任务
* @param sysOaTaskDistribute
* @return
*/
@RequiresPermissions("system:task:waitList")
@PostMapping("/waitList")
@ResponseBody
public TableDataInfo waitList(SysOaTaskDistribute sysOaTaskDistribute)
{
public TableDataInfo waitList(SysOaTaskDistribute sysOaTaskDistribute) {
startPage();
SysUser sysUser = ShiroUtils.getSysUser();
sysOaTaskDistribute.setTaskExecuteStatusList(Lists.newArrayList(DingFlowTaskType.RUNNING.getCode(),DingFlowTaskType.PROCESSING.getCode()));
sysOaTaskDistribute.setTaskDistributeId(String.valueOf(sysUser.getUserId()));
List<SysOaTaskDistribute> sysOaTaskDistributes = sysOaTaskDistributeService.selectSysOaTaskDistributeList(sysOaTaskDistribute);
if(CollUtil.isNotEmpty(sysOaTaskDistributes)){
warpSysOaTask(sysOaTaskDistributes);
}
return getDataTable(sysOaTaskDistributes);
sysOaTaskDistribute.setTaskDistributeId(String.valueOf(ShiroUtils.getUserId()));
sysOaTaskDistribute.setTaskExecuteStatusList(Lists.newArrayList(DingFlowTaskType.NEW.getCode(),DingFlowTaskType.RUNNING.getCode()));
return getDataTable(sysOaTaskDistributeService.getSysOaTaskDistribute(sysOaTaskDistribute));
}
/**
* 我处理的任务
* @param sysOaTaskDistribute
* @return
*/
@RequiresPermissions("system:task:handleList")
@PostMapping("/handleList")
@ResponseBody
public TableDataInfo handleList(SysOaTaskDistribute sysOaTaskDistribute)
{
public TableDataInfo handleList(SysOaTaskDistribute sysOaTaskDistribute) {
startPage();
SysUser sysUser = ShiroUtils.getSysUser();
sysOaTaskDistribute.setTaskExecuteId(String.valueOf(sysUser.getUserId()));
sysOaTaskDistribute.setTaskExecuteStatus(DingFlowTaskType.COMPLETED.getCode());
List<SysOaTaskDistribute> sysOaTaskDistributes = sysOaTaskDistributeService.selectSysOaTaskDistributeList(sysOaTaskDistribute);
if(CollUtil.isNotEmpty(sysOaTaskDistributes)){
warpSysOaTask(sysOaTaskDistributes);
}
List<SysOaTaskDistribute> sysOaTaskDistributes = sysOaTaskDistributeService.getSysOaTaskDistribute(sysOaTaskDistribute);
return getDataTable(sysOaTaskDistributes);
}
@ -163,19 +131,18 @@ public class SysOaTaskController extends BaseController
@Log(title = "系统任务", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysOaTask sysOaTask)
{
public AjaxResult export(SysOaTask sysOaTask) {
List<SysOaTask> list = sysOaTaskService.selectSysOaTaskList(sysOaTask);
ExcelUtil<SysOaTask> util = new ExcelUtil<SysOaTask>(SysOaTask.class);
return util.exportExcel(list, "task");
return util.exportExcel(list, "task","系统任务");
}
/**
* 新增系统任务
*/
@GetMapping("/add")
public String add()
{
public String add() {
return prefix + "/add";
}
@ -186,32 +153,45 @@ public class SysOaTaskController extends BaseController
@Log(title = "系统任务", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(SysOaTask sysOaTask)
{
@RepeatSubmit
@Transactional(rollbackFor = Exception.class)
public AjaxResult addSave(SysOaTask sysOaTask) {
SysUser sysUser = ShiroUtils.getSysUser();
sysOaTask.setCreateBy(String.valueOf(sysUser.getUserId()));
return toAjax(sysOaTaskService.insertSysOaTask(sysOaTask));
SysOaTask task= sysOaTaskService.insertSysOaTask(sysOaTask);
//是否同步到钉钉待办,然后把钉钉taskId反写表中
if(sysOaTask.getSyncDingtalk()==1){
String taskId = workRecodeService.createTodoTask(task);
SysOaTask updateTask=new SysOaTask();
updateTask.setTaskNo(task.getTaskNo());
updateTask.setTaskOutsideId(taskId);
sysOaTaskService.updateById(updateTask);
}
return AjaxResult.success();
}
@RequiresPermissions("system:task:start")
@PostMapping("/start")
@ResponseBody
public AjaxResult start(Long id)
{
public AjaxResult start(Long id) {
SysOaTaskDistribute taskDistribute = sysOaTaskDistributeService.getById(id);
SysOaTask task = sysOaTaskService.getById(taskDistribute.getTaskNo());
SysOaTaskDistribute sysOaTaskDistribute =new SysOaTaskDistribute();
sysOaTaskDistribute.setId(id);
sysOaTaskDistribute.setTaskStartTime(new Date());
sysOaTaskDistribute.setTaskExecuteStatus(DingFlowTaskType.PROCESSING.getCode());
return toAjax(sysOaTaskDistributeService.updateSysOaTaskDistribute(sysOaTaskDistribute));
sysOaTaskDistribute.setTaskExecuteStatus(DingFlowTaskType.RUNNING.getCode());
if(task.getSyncDingtalk()==1){
workRecodeService.updateTodoTaskExecutorStatus(ShiroUtils.getUserId(),sysOaTaskService.getOutTaskOutsideId(task.getTaskNo()),false);
}
return toAjax(sysOaTaskDistributeService.updateById(sysOaTaskDistribute));
}
/**
* 处理系统任务
*/
@GetMapping("/handle/{id}")
public String handle(@PathVariable("id") Long id, ModelMap mmap)
{
public String handle(@PathVariable("id") Long id, ModelMap mmap) {
SysOaTaskDistribute sysOaTaskDistribute = sysOaTaskDistributeService.selectSysOaTaskDistributeById(id);
warpSysOaTask(Lists.newArrayList(sysOaTaskDistribute));
sysOaTaskDistributeService.warpSysOaTask(Lists.newArrayList(sysOaTaskDistribute));
mmap.put("sysOaTaskDistribute", sysOaTaskDistribute);
return prefix + "/handle";
}
@ -224,19 +204,103 @@ public class SysOaTaskController extends BaseController
@Log(title = "系统任务", businessType = BusinessType.UPDATE)
@PostMapping("/handle")
@ResponseBody
public AjaxResult handleSave(SysOaTaskDistribute sysOaTaskDistribute)
{
public AjaxResult handleSave(SysOaTaskDistribute sysOaTaskDistribute) {
SysOaTaskDistribute taskDistribute = sysOaTaskDistributeService.getById(sysOaTaskDistribute.getId());
SysOaTask task = sysOaTaskService.getById(taskDistribute.getTaskNo());
sysOaTaskDistribute.setTaskCompleteTime(new Date());
sysOaTaskDistribute.setTaskExecuteId(String.valueOf(ShiroUtils.getUserId()));
sysOaTaskDistribute.setUpdateBy(String.valueOf(ShiroUtils.getUserId()));
sysOaTaskDistribute.setTaskExecuteStatus(DingFlowTaskType.COMPLETED.getCode());
//发送站内信
sendInnerMessage(sysOaTaskDistribute);
//事件发送
SyncEvent<SysOaTaskDistribute> syncEvent = new SyncEvent(sysOaTaskDistribute, DingTalkListenerType.UPDATE_TODO_TASK_EXECUTOR_STATUS);
applicationContext.publishEvent(syncEvent);
return toAjax(sysOaTaskDistributeService.updateSysOaTaskDistribute(sysOaTaskDistribute));
//更新钉钉任务状态
if(task.getSyncDingtalk()==1){
workRecodeService.updateTodoTaskExecutorStatus(ShiroUtils.getUserId(),task.getTaskOutsideId(),true);
}
return toAjax(sysOaTaskDistributeService.updateById(sysOaTaskDistribute));
}
/**
* 修改系统任务
*/
@GetMapping("/edit/{taskNo}")
public String edit(@PathVariable("taskNo") String taskNo, ModelMap mmap) {
SysOaTask sysOaTask = sysOaTaskService.selectSysOaTaskById(taskNo);
mmap.put("sysOaTask", sysOaTask);
return prefix + "/edit";
}
/**
* 修改保存系统任务
*/
@RequiresPermissions("system:task:edit")
@Log(title = "系统任务", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(SysOaTask sysOaTask) {
LambdaQueryWrapper<SysOaTaskDistribute> eq = new QueryWrapper<SysOaTaskDistribute>().lambda().ne(SysOaTaskDistribute::getTaskExecuteStatus, DingFlowTaskType.NEW.getCode())
.eq(SysOaTaskDistribute::getTaskNo, sysOaTask.getTaskNo());
if(CollUtil.isNotEmpty(sysOaTaskDistributeService.list(eq))){
return AjaxResult.error("只有待执行任务,才能编辑任务");
}
sysOaTask.setUpdateBy(ShiroUtils.getUserId().toString());
if(sysOaTask.getSyncDingtalk()==1){
workRecodeService.updateTodoTask(sysOaTask);
}
return toAjax(sysOaTaskService.updateById(sysOaTask));
}
/**
* 任务详情
* @param taskNo 任务编码
* @param mmap
* @return
*/
@GetMapping("/detail/{id}")
@RequiresPermissions("system:task:detail")
public String detail(@PathVariable("id") String taskNo, ModelMap mmap) {
SysOaTask sysOaTask = sysOaTaskService.selectSysOaTaskById(taskNo);
SysOaTaskDistribute sysOaTaskDistribute=new SysOaTaskDistribute();
sysOaTaskDistribute.setTaskNo(taskNo);
List<SysOaTaskDistribute> sysOaTaskDistributes = sysOaTaskDistributeService.selectSysOaTaskDistributeList(sysOaTaskDistribute);
mmap.put("sysOaTask", sysOaTask);
mmap.put("sysOaTaskDistributes", sysOaTaskDistributes);
return prefix + "/detail";
}
/**
* 我处理的详情
* @param id
* @param mmap
* @return
*/
@GetMapping("/taskDistributedDetail/{id}")
@RequiresPermissions("system:task:taskDistributedDetail")
public String taskDistributedDetail(@PathVariable("id") Long id, ModelMap mmap) {
SysOaTaskDistribute sysOaTaskDistribute = sysOaTaskDistributeService.selectSysOaTaskDistributeById(id);
sysOaTaskDistributeService.warpSysOaTask(Lists.newArrayList(sysOaTaskDistribute));
mmap.put("sysOaTask", sysOaTaskDistribute);
return prefix + "/taskDistributedDetail";
}
/**
* 任务分配详情
* @param id
* @param mmap
* @return
*/
@GetMapping("/taskDistribute/detail/{id}")
@RequiresPermissions("system:taskDistribute:detail")
public String taskDistributeDetail(@PathVariable("id") Long id, ModelMap mmap) {
SysOaTaskDistribute sysOaTaskDistribute = sysOaTaskDistributeService.selectSysOaTaskDistributeById(id);
sysOaTaskDistributeService.warpSysOaTask(Lists.newArrayList(sysOaTaskDistribute));
mmap.put("sysOaTask", sysOaTaskDistribute);
return prefix + "/taskDistributeDetail";
}
/**
* 发送站内信
* @param sysOaTaskDistribute 参数
@ -256,112 +320,5 @@ public class SysOaTaskController extends BaseController
messageEventDTO.setTemplateCode(MessageConstants.INNER_SYS_TASK_COMPLETE);
applicationContext.publishEvent(messageEventDTO);
}
/**
* 修改系统任务
*/
@GetMapping("/edit/{taskNo}")
public String edit(@PathVariable("taskNo") String taskNo, ModelMap mmap)
{
SysOaTask sysOaTask = sysOaTaskService.selectSysOaTaskById(taskNo);
mmap.put("sysOaTask", sysOaTask);
return prefix + "/edit";
}
/**
* 修改保存系统任务
*/
@RequiresPermissions("system:task:edit")
@Log(title = "系统任务", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(SysOaTask sysOaTask)
{
SysOaTaskDistribute sysOaTaskDistribute=new SysOaTaskDistribute();
sysOaTaskDistribute.setSysOaTask(sysOaTask);
SyncEvent<SysOaTaskDistribute> syncEvent = new SyncEvent(sysOaTaskDistribute, DingTalkListenerType.WORK_RECORD_UPDATE);
applicationContext.publishEvent(syncEvent);
return toAjax(sysOaTaskService.updateSysOaTask(sysOaTask));
}
/**
* 删除系统任务
*/
@RequiresPermissions("system:task:remove")
@Log(title = "系统任务", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(sysOaTaskService.deleteSysOaTaskByIds(ids));
}
/**
* 任务详情
* @param taskNo 任务编码
* @param mmap
* @return
*/
@GetMapping("/detail/{id}")
@RequiresPermissions("system:task:detail")
public String detail(@PathVariable("id") String taskNo, ModelMap mmap)
{
SysOaTask sysOaTask = sysOaTaskService.selectSysOaTaskById(taskNo);
SysOaTaskDistribute sysOaTaskDistribute=new SysOaTaskDistribute();
sysOaTaskDistribute.setTaskNo(taskNo);
List<SysOaTaskDistribute> sysOaTaskDistributes = sysOaTaskDistributeService.selectSysOaTaskDistributeList(sysOaTaskDistribute);
mmap.put("sysOaTask", sysOaTask);
mmap.put("sysOaTaskDistributes", sysOaTaskDistributes);
return prefix + "/detail";
}
/**
* 我处理的详情
* @param taskNo
* @param mmap
* @return
*/
@GetMapping("/taskDistributedDetail/{id}")
@RequiresPermissions("system:task:taskDistributedDetail")
public String taskDistributedDetail(@PathVariable("id") Long id, ModelMap mmap)
{
SysOaTaskDistribute sysOaTaskDistribute = sysOaTaskDistributeService.selectSysOaTaskDistributeById(id);
warpSysOaTask(Lists.newArrayList(sysOaTaskDistribute));
mmap.put("sysOaTask", sysOaTaskDistribute);
return prefix + "/taskDistributedDetail";
}
/**
* 任务分配详情
* @param id
* @param mmap
* @return
*/
@GetMapping("/taskDistribute/detail/{id}")
@RequiresPermissions("system:taskDistribute:detail")
public String taskDistributeDetail(@PathVariable("id") Long id, ModelMap mmap)
{
SysOaTaskDistribute sysOaTaskDistribute = sysOaTaskDistributeService.selectSysOaTaskDistributeById(id);
warpSysOaTask(Lists.newArrayList(sysOaTaskDistribute));
mmap.put("sysOaTask", sysOaTaskDistribute);
return prefix + "/taskDistributeDetail";
}
private void warpSysOaTask(List<SysOaTaskDistribute> sysOaTaskDistributes){
sysOaTaskDistributes.forEach(t->{
SysOaTask sysOaTask = sysOaTaskService.selectSysOaTaskById(t.getTaskNo());
sysOaTask.setCreateBy(sysUserService.selectUserById(Long.parseLong(sysOaTask.getCreateBy())).getUserName());
if(ObjectUtil.isNotNull(t.getTaskDistributeId())){
t.setTaskDistributeId(sysUserService.selectUserById(Long.parseLong(t.getTaskDistributeId())).getUserName());
}
if(ObjectUtil.isNotNull(t.getTaskExecuteId())){
t.setTaskExecuteId(sysUserService.selectUserById(Long.parseLong(t.getTaskExecuteId())).getUserName());
}
if(ObjectUtil.isNotNull(t.getTaskStartTime())&&ObjectUtil.isNotNull(t.getTaskCompleteTime())){
t.setSpendTime(DateUtil.formatBetween(t.getTaskStartTime(),t.getTaskCompleteTime(), BetweenFormater.Level.SECOND));
}
t.setSysOaTask(sysOaTask);
t.setCreateBy(sysUserService.selectUserById(Long.parseLong(t.getCreateBy())).getUserName());
});
}
}

View File

@ -1,5 +1,6 @@
package com.snow.web.controller.system;
import cn.hutool.core.codec.Base64;
import com.snow.common.core.page.TableDataInfo;
import com.snow.framework.storage.StorageService;
import com.snow.system.domain.SysAuthUser;
@ -134,6 +135,7 @@ public class SysProfileController extends BaseController
public String avatar(ModelMap mmap)
{
SysUser user = ShiroUtils.getSysUser();
user.setAvatar(Base64.encode(user.getAvatar()));
mmap.put("user", userService.selectUserById(user.getUserId()));
return prefix + "/avatar";
}
@ -165,26 +167,20 @@ public class SysProfileController extends BaseController
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
@PostMapping("/updateAvatar")
@ResponseBody
public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file)
{
public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file) {
SysUser currentUser = ShiroUtils.getSysUser();
try
{
if (!file.isEmpty())
{
try {
if (!file.isEmpty()) {
SysFile store = storageService.store(file);
currentUser.setAvatar(store.getUrl());
if (userService.updateUserInfo(currentUser) > 0)
{
if (userService.updateUserInfo(currentUser) > 0) {
ShiroUtils.setSysUser(userService.selectUserById(currentUser.getUserId()));
return success();
}
}
return error();
}
catch (Exception e)
{
log.error("修改头像失败!", e);
} catch (Exception e) {
log.error("@@修改头像失败!", e);
return error(e.getMessage());
}
}

View File

@ -5,7 +5,7 @@ snow:
# 版本
version: 2.0.0
# 版权年份
copyrightYear: 2021
copyrightYear: 2022
# 实例演示开关
demoEnabled: true
# 获取ip地址开关
@ -14,7 +14,7 @@ snow:
# 开发环境配置
server:
# 服务器的HTTP端口默认为80
port: 9527
port: 80
servlet:
# 应用的访问路径
context-path: /
@ -83,10 +83,17 @@ spring:
mybatis-plus:
# 搜索指定包别名
typeAliasesPackage: com.snow.**.domain
typeHandlersPackage: com.snow.system.handler
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:META-INF/modeler-mybatis-mappings/*.xml,classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
#全局配置
global-config:
db-config:
#逻辑删除
logic-delete-value: 1
logic-not-delete-value: 0
# PageHelper分页插件
@ -143,10 +150,10 @@ xss:
#登录后是否显示最新的公告
is:
notice: true
notice: false
#是否开启同步钉钉
sync:
dingtalk: false
dingtalk: true
flowable:
#关闭定时任务JOB

View File

@ -0,0 +1,144 @@
@charset "utf-8";
.container {
margin: 10px auto 0 auto;
position: relative;
font-family: 微软雅黑;
font-size: 12px;
}
.container p {
line-height: 12px;
line-height: 0px;
height: 0px;
margin: 10px;
color: #bbb
}
.action {
width: 400px;
height: 30px;
margin: 10px 0;
}
.cropped {
position: absolute;
left: 500px;
top: 0;
width: 200px;
border: 1px #ddd solid;
height: 450px;
padding: 4px;
box-shadow: 0px 0px 12px #ddd;
text-align: center;
}
.imageBox {
position: relative;
height: 400px;
width: 400px;
border: 1px solid #aaa;
background: #fff;
overflow: hidden;
background-repeat: no-repeat;
cursor: move;
box-shadow: 4px 4px 12px #B0B0B0;
}
.imageBox .thumbBox {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
height: 200px;
margin-top: -100px;
margin-left: -100px;
box-sizing: border-box;
border: 1px solid rgb(102, 102, 102);
box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
background: none repeat scroll 0% 0% transparent;
}
.imageBox .spinner {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
text-align: center;
line-height: 400px;
background: rgba(0, 0, 0, 0.7);
}
.Btnsty_peyton {
float: right;
width: 46px;
display: inline-block;
margin-bottom: 10px;
height: 37px;
line-height: 37px;
font-size: 14px;
color: #FFFFFF;
margin: 0px 2px;
background-color: #f38e81;
border-radius: 3px;
text-decoration: none;
cursor: pointer;
box-shadow: 0px 0px 5px #B0B0B0;
border: 0px #fff solid;
}
/*选择文件上传*/
.new-contentarea {
width: 165px;
overflow: hidden;
margin: 0 auto;
position: relative;
float: left;
}
.new-contentarea label {
width: 100%;
height: 100%;
display: block;
}
.new-contentarea input[type=file] {
width: 188px;
height: 60px;
background: #333;
margin: 0 auto;
position: absolute;
right: 50%;
margin-right: -94px;
top: 0;
right /*\**/: 0px \9;
margin-right /*\**/: 0px \9;
width /*\**/: 10px \9;
opacity: 0;
filter: alpha(opacity=0);
z-index: 2;
}
a.upload-img {
width: 165px;
display: inline-block;
margin-bottom: 10px;
height: 37px;
line-height: 37px;
font-size: 14px;
color: #FFFFFF;
background-color: #f38e81;
border-radius: 3px;
text-decoration: none;
cursor: pointer;
border: 0px #fff solid;
box-shadow: 0px 0px 5px #B0B0B0;
}
a.upload-img:hover {
background-color: #ec7e70;
}
.tc {
text-align: center;
}

View File

@ -0,0 +1,128 @@
"use strict";
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else {
factory(jQuery);
}
}(function ($) {
var cropbox = function (options, el) {
var el = el || $(options.imageBox),
obj =
{
state: {},
ratio: 1,
options: options,
imageBox: el,
thumbBox: el.find(options.thumbBox),
spinner: el.find(options.spinner),
image: new Image(),
getDataURL: function () {
var width = this.thumbBox.width(),
height = this.thumbBox.height(),
canvas = document.createElement("canvas"),
dim = el.css('background-position').split(' '),
size = el.css('background-size').split(' '),
dx = parseInt(dim[0]) - el.width() / 2 + width / 2,
dy = parseInt(dim[1]) - el.height() / 2 + height / 2,
dw = parseInt(size[0]),
dh = parseInt(size[1]),
sh = parseInt(this.image.height),
sw = parseInt(this.image.width);
canvas.width = width;
canvas.height = height;
var context = canvas.getContext("2d");
context.drawImage(this.image, 0, 0, sw, sh, dx, dy, dw, dh);
var imageData = canvas.toDataURL('image/png');
return imageData;
},
getBlob: function () {
var imageData = this.getDataURL();
var b64 = imageData.replace('data:image/png;base64,', '');
var binary = atob(b64);
var array = [];
for (var i = 0; i < binary.length; i++) {
array.push(binary.charCodeAt(i));
}
return new Blob([new Uint8Array(array)], {type: 'image/png'});
},
zoomIn: function () {
this.ratio *= 1.1;
setBackground();
},
zoomOut: function () {
this.ratio *= 0.9;
setBackground();
}
},
setBackground = function () {
var w = parseInt(obj.image.width) * obj.ratio;
var h = parseInt(obj.image.height) * obj.ratio;
var pw = (el.width() - w) / 2;
var ph = (el.height() - h) / 2;
el.css({
'background-image': 'url(' + obj.image.src + ')',
'background-size': w + 'px ' + h + 'px',
'background-position': pw + 'px ' + ph + 'px',
'background-repeat': 'no-repeat'
});
},
imgMouseDown = function (e) {
e.stopImmediatePropagation();
obj.state.dragable = true;
obj.state.mouseX = e.clientX;
obj.state.mouseY = e.clientY;
},
imgMouseMove = function (e) {
e.stopImmediatePropagation();
if (obj.state.dragable) {
var x = e.clientX - obj.state.mouseX;
var y = e.clientY - obj.state.mouseY;
var bg = el.css('background-position').split(' ');
var bgX = x + parseInt(bg[0]);
var bgY = y + parseInt(bg[1]);
el.css('background-position', bgX + 'px ' + bgY + 'px');
obj.state.mouseX = e.clientX;
obj.state.mouseY = e.clientY;
}
},
imgMouseUp = function (e) {
e.stopImmediatePropagation();
obj.state.dragable = false;
},
zoomImage = function (e) {
e.originalEvent.wheelDelta > 0 || e.originalEvent.detail < 0 ? obj.ratio *= 1.1 : obj.ratio *= 0.9;
setBackground();
}
obj.spinner.show();
obj.image.onload = function () {
obj.spinner.hide();
setBackground();
el.bind('mousedown', imgMouseDown);
el.bind('mousemove', imgMouseMove);
$(window).bind('mouseup', imgMouseUp);
el.bind('mousewheel DOMMouseScroll', zoomImage);
};
obj.image.crossOrigin = 'Anonymous';
obj.image.src = options.imgSrc;
el.on('remove', function () {
$(window).unbind('mouseup', imgMouseUp)
});
return obj;
};
jQuery.fn.cropbox = function (options) {
return new cropbox(options, this);
};
}));

View File

@ -1,11 +1,11 @@
/*!
* Cropper.js v1.5.7
* Cropper.js v1.5.12
* https://fengyuanchen.github.io/cropperjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2020-05-23T05:22:57.283Z
* Date: 2021-06-12T08:00:11.623Z
*/
.cropper-container {
@ -301,4 +301,4 @@
.cropper-disabled .cropper-line,
.cropper-disabled .cropper-point {
cursor: not-allowed;
}
}

View File

@ -1,19 +1,57 @@
/*!
* Cropper.js v1.5.7
* Cropper.js v1.5.12
* https://fengyuanchen.github.io/cropperjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2020-05-23T05:23:00.081Z
* Date: 2021-06-12T08:00:17.411Z
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.Cropper = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Cropper = factory());
}(this, (function () { 'use strict';
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) {
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
}
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _typeof(obj) {
"@babel/helpers - typeof";
@ -67,40 +105,6 @@
return obj;
}
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
@ -110,7 +114,7 @@
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _unsupportedIterableToArray(o, minLen) {
@ -190,6 +194,10 @@
var REGEXP_DATA_URL = /^data:/;
var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/;
var REGEXP_TAG_NAME = /^img|canvas$/i; // Misc
// Inspired by the default width and height of a canvas element.
var MIN_CONTAINER_WIDTH = 200;
var MIN_CONTAINER_HEIGHT = 100;
var DEFAULTS = {
// Define the view mode of the cropper
@ -253,8 +261,8 @@
minCanvasHeight: 0,
minCropBoxWidth: 0,
minCropBoxHeight: 0,
minContainerWidth: 200,
minContainerHeight: 100,
minContainerWidth: MIN_CONTAINER_WIDTH,
minContainerHeight: MIN_CONTAINER_HEIGHT,
// Shortcuts of events
ready: null,
cropstart: null,
@ -802,7 +810,7 @@
function getMaxZoomRatio(pointers) {
var pointers2 = _objectSpread2({}, pointers);
var ratios = [];
var maxRatio = 0;
forEach(pointers, function (pointer, pointerId) {
delete pointers2[pointerId];
forEach(pointers2, function (pointer2) {
@ -813,13 +821,13 @@
var z1 = Math.sqrt(x1 * x1 + y1 * y1);
var z2 = Math.sqrt(x2 * x2 + y2 * y2);
var ratio = (z2 - z1) / z1;
ratios.push(ratio);
if (Math.abs(ratio) > Math.abs(maxRatio)) {
maxRatio = ratio;
}
});
});
ratios.sort(function (a, b) {
return Math.abs(a) < Math.abs(b);
});
return ratios[0];
return maxRatio;
}
/**
* Get a pointer from an event object.
@ -1223,11 +1231,13 @@
options = this.options,
container = this.container,
cropper = this.cropper;
var minWidth = Number(options.minContainerWidth);
var minHeight = Number(options.minContainerHeight);
addClass(cropper, CLASS_HIDDEN);
removeClass(element, CLASS_HIDDEN);
var containerData = {
width: Math.max(container.offsetWidth, Number(options.minContainerWidth) || 200),
height: Math.max(container.offsetHeight, Number(options.minContainerHeight) || 100)
width: Math.max(container.offsetWidth, minWidth >= 0 ? minWidth : MIN_CONTAINER_WIDTH),
height: Math.max(container.offsetHeight, minHeight >= 0 ? minHeight : MIN_CONTAINER_HEIGHT)
};
this.containerData = containerData;
setStyle(cropper, {
@ -1268,14 +1278,15 @@
width: canvasWidth,
height: canvasHeight
};
canvasData.left = (containerData.width - canvasWidth) / 2;
canvasData.top = (containerData.height - canvasHeight) / 2;
canvasData.oldLeft = canvasData.left;
canvasData.oldTop = canvasData.top;
this.canvasData = canvasData;
this.limited = viewMode === 1 || viewMode === 2;
this.limitCanvas(true, true);
this.initialImageData = assign({}, imageData);
canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);
canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);
canvasData.left = (containerData.width - canvasData.width) / 2;
canvasData.top = (containerData.height - canvasData.height) / 2;
canvasData.oldLeft = canvasData.left;
canvasData.oldTop = canvasData.top;
this.initialCanvasData = assign({}, canvasData);
},
limitCanvas: function limitCanvas(sizeLimited, positionLimited) {
@ -1809,9 +1820,11 @@
var options = this.options,
container = this.container,
containerData = this.containerData;
var ratio = container.offsetWidth / containerData.width; // Resize when width changed or height changed
var ratioX = container.offsetWidth / containerData.width;
var ratioY = container.offsetHeight / containerData.height;
var ratio = Math.abs(ratioX - 1) > Math.abs(ratioY - 1) ? ratioX : ratioY; // Resize when width changed or height changed
if (ratio !== 1 || container.offsetHeight !== containerData.height) {
if (ratio !== 1) {
var canvasData;
var cropBoxData;
@ -3331,9 +3344,10 @@
if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) {
url = addTimestamp(url);
}
} // The third parameter is required for avoiding side-effect (#682)
xhr.open('GET', url);
xhr.open('GET', url, true);
xhr.responseType = 'arraybuffer';
xhr.withCredentials = element.crossOrigin === 'use-credentials';
xhr.send();
@ -3424,6 +3438,7 @@
naturalHeight: naturalHeight,
aspectRatio: naturalWidth / naturalHeight
});
_this2.initialImageData = assign({}, _this2.imageData);
_this2.sizing = false;
_this2.sized = true;

View File

@ -1,9 +1,9 @@
/*!
* Cropper.js v1.5.7
* Cropper.js v1.5.12
* https://fengyuanchen.github.io/cropperjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2020-05-23T05:22:57.283Z
*/.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}
* Date: 2021-06-12T08:00:11.623Z
*/.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{image-orientation:0deg;display:block;height:100%;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 223 KiB

View File

@ -1202,6 +1202,34 @@ var table = {
$.operate.submit(url, "post", "json", data);
});
},
mark: function(id) {
table.set();
$.modal.confirm("确定标记该条" + table.options.modalName + "信息吗?", function() {
var url = $.common.isEmpty(id) ? table.options.markUrl : table.options.markUrl.replace("{id}", id);
if(table.options.type == table_type.bootstrapTreeTable) {
$.operate.get(url);
} else {
var data = { "ids": id };
$.operate.submit(url, "post", "json", data);
}
});
},
// 批量标记信息
markAll: function() {
table.set();
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
if (rows.length == 0) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
$.modal.confirm("确认要标记选中的" + rows.length + "条数据吗?", function() {
var url = table.options.markUrl;
var data = { "ids": rows.join() };
$.operate.submit(url, "post", "json", data);
});
},
// 发布信息
deployment: function(id,type) {
table.set();

View File

@ -100,10 +100,10 @@
<!-- cropper图像裁剪插件 -->
<div th:fragment="cropper-css">
<link th:href="@{/ajax/libs/cropper/cropper.min.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/cropper/cropper.min.css?v=1.5.12}" rel="stylesheet"/>
</div>
<div th:fragment="cropper-js">
<script th:src="@{/ajax/libs/cropper/cropper.min.js}"></script>
<script th:src="@{/ajax/libs/cropper/cropper.min.js?v=1.5.12}"></script>
</div>
<!-- jasny功能扩展插件 -->

View File

@ -0,0 +1,204 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('邮件列表')" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>邮件列表</title>
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<link th:href="@{/css/iCheck/custom.css}" rel="stylesheet">
<link th:href="@{/css/animate.css}" rel="stylesheet">
<link th:href="@{/css/style.css}" rel="stylesheet">
<link th:href="#{/css/iCheck/custom.css}" rel="stylesheet">
<style type="text/css">
#bootstrap-table {border-left: 0px; border-right:0px}
#bootstrap-table th{border-left: 0px; border-right: 0px}
#bootstrap-table td{border-left: 0px; border-right: 0px}
</style>
</head>
<body>
<div id="wrapper">
<div class="wrapper wrapper-content gray-bg">
<div class="row">
<div class="col-lg-3">
<div class="ibox float-e-margins">
<div class="ibox-content mailbox-content">
<div class="file-manager">
<a class="btn btn-block btn-primary compose-mail"href="javascript:void(0)" onclick="toSendEmail()">写邮件</a>
<div class="space-25"></div>
<h3>邮件标签</h3>
<ul class="category-list" style="padding: 0">
<li><a href="#"> <i class="fa fa-circle text-navy"></i> 工作 </a></li>
<li><a href="#"> <i class="fa fa-circle text-danger"></i> 文档</a></li>
<li><a href="#"> <i class="fa fa-circle text-primary"></i> 社交</a></li>
<li><a href="#"> <i class="fa fa-circle text-info"></i> 活动</a></li>
</ul>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
<div class="col-lg-9 animated fadeInRight">
<div class="mail-box-header">
<form class="pull-right mail-search select-list" id="formId">
<div class="input-group">
<input type="text" class="form-control input-sm" name="emailSubject" placeholder="Search email">
<div class="input-group-btn">
<a onclick="$.table.search()" class="btn btn-sm btn-primary">
请输入邮件主题
</a>
</div>
</div>
</form>
<h2>
DingFlow草稿箱
</h2>
<div class="mail-box">
<table id="bootstrap-table" class="table table-hover table-mail table-no-borde">
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Mainly scripts -->
<script th:src="@{/js/jquery.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
<script th:src="@{/ruoyi/js/common.js}"></script>
<script th:src="@{/ruoyi/js/ry-ui.js}"></script>
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/bootstrap-table.min.js?v=20200727}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js?v=20200727}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js?v=20200727}"></script>
<script th:inline="javascript">
var prefix = "/system/email";
var emailLabelDatas = [[${@dict.getType('sys_email_lable')}]];
$(document).ready(function(){
$('.i-checks').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green'
});
});
var options = {
url: prefix + "/getDraftsMail",
rememberSelected: true,
modalName: "邮件",
showToggle:false,
showHeader:true,
showSearch:false,
showRefresh:false,
showColumns:false,
queryParams: queryParams,
striped:true,
height:'30px',
columns: [
{
field: 'id',
title: 'id',
visible: false
},
{
field: 'emailSubject',
title: '邮件主题',
align:'left',
formatter: function(value, row, index) {
var emailStatus= row.emailStatus;
if(emailStatus==3){
return '<i class="fa fa-flag danger" style="color: red"></i> '+'<a href="javascript:void(0)" onclick="mailDetail(\''+row.id+'\')">'+value+'</a> ';
}else {
return '<a href="javascript:void(0)" onclick="mailDetail(\''+row.id+'\')">'+value+'</a> ';
}
}
},
{
field: 'emailTo',
title: '发件邮箱',
align:'left'
},
{
field: 'emailLabel',
title: '邮件标签',
formatter: function(value, row, index) {
return $.table.selectDictLabel(emailLabelDatas, value);
}
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<button class="btn btn-info btn-sm" data-toggle="tooltip" data-placement="top" title="编辑" onclick="emailEdit(\''+row.id+'\')"><i class="fa fa-edit"></i> </button> ');
actions.push('<button class="btn btn-danger btn-sm" data-toggle="tooltip" data-placement="top" title="删除" onclick="markDelete(\''+row.id+'\')"><i class="fa fa-remove"></i> </button> ');
return actions.join('');
}
}
]
};
$.table.init(options);
function queryParams(params) {
var search = $.table.queryParams(params);
return search;
}
function markDelete(id){
var config = {
url: prefix + "/markDelete",
type: "post",
dataType: "json",
data: {
"ids":id
},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$.modal.msg("删除成功,即将跳转到收件箱", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="/system/email/trashMail";
},2000);
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$.modal.enable();
}
};
$.ajax(config)
}
function mailDetail(id) {
var detailUrl="/system/email/mailDetail/"+id;
$.modal.openTab("查阅邮件", detailUrl);
}
function emailEdit(id) {
$.modal.openTab('邮件管理', "/system/email/edit/"+id);
}
function toSendEmail() {
$.modal.openTab('邮件管理', prefix);
}
</script>
</body>
</html>

View File

@ -24,31 +24,14 @@
<div class="ibox float-e-margins">
<div class="ibox-content mailbox-content">
<div class="file-manager">
<a class="btn btn-block btn-primary compose-mail" href="/system/email">写邮件</a>
<a class="btn btn-block btn-primary compose-mail"href="javascript:void(0)" onclick="toSendEmail()">写邮件</a>
<div class="space-25"></div>
<h3>文件夹</h3>
<ul class="folder-list m-b-md" style="padding: 0">
<li><a th:href="@{/system/email/mailbox/6}"> <i class="fa fa-inbox "></i>收件箱<span class="label label-warning pull-right" id="readTotal"></span> </a></li>
<li><a th:href="@{/system/email/mailbox/7}"> <i class="fa fa-inbox "></i>发件箱</a></li>
<li><a th:href="@{/system/email/mailbox/3}"> <i class="fa fa-certificate"></i> 重要邮件</a></li>
<li><a th:href="@{/system/email/mailbox/1}"> <i class="fa fa-file-text-o"></i> 草稿箱 <span class="label label-info pull-right" id="draftsTotal">2</span></a></li>
<li><a th:href="@{/system/email/mailbox/4}"> <i class="fa fa-trash-o"></i> 垃圾箱</a></li>
</ul>
<h3>分类</h3>
<ul class="category-list" style="padding: 0">
<li><a href="#"> <i class="fa fa-circle text-navy"></i> 工作 </a></li>
<li><a href="#"> <i class="fa fa-circle text-danger"></i> 文档</a></li>
<li><a href="#"> <i class="fa fa-circle text-primary"></i> 社交</a></li>
<li><a href="#"> <i class="fa fa-circle text-info"></i> 活动</a></li>
<li><a href="#"> <i class="fa fa-circle text-warning"></i> 抄送</a></li>
</ul>
<h3>邮件标签</h3>
<ul class="category-list" style="padding: 0">
<li><label> <input type="radio" name="emailLabel" value="1" > <i></i> Work </label></li>
<li> <label> <input type="radio" name="emailLabel" value="2" > <i></i> Documents </label></li>
<li><label> <input type="radio" name="emailLabel" value="3" > <i></i>Social </label></li>
<li><label> <input type="radio" name="emailLabel" value="4" > <i></i> Advertising </label></li>
<div class="i-checks"><label> <input type="radio" value="1" checked="" name="emailLabel"> <i></i> 工作 </label></div>
<div class="i-checks"><label> <input type="radio" value="2" name="emailLabel"> <i></i> 文档 </label></div>
<div class="i-checks"><label> <input type="radio" value="3" name="emailLabel"> <i></i>社交 </label></div>
<div class="i-checks"><label> <input type="radio" value="4" name="emailLabel"> <i></i> 活动 </label></div>
</ul>
<div class="clearfix"></div>
</div>
@ -57,12 +40,8 @@
</div>
<div class="col-lg-9 animated fadeInRight">
<div class="mail-box-header">
<!--<div class="pull-right tooltip-demo">
<a href="mailbox.html" class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="top" title="Move to draft folder"><i class="fa fa-pencil"></i> 草稿</a>
<a href="mailbox.html" class="btn btn-danger btn-sm" data-toggle="tooltip" data-placement="top" title="Discard email"><i class="fa fa-times"></i> 删除</a>
</div>-->
<h2>
Ding-Flow在线邮件
DingFlow在线邮件
</h2>
</div>
<div class="mail-box">
@ -129,17 +108,6 @@
radioClass: 'iradio_square-green',
});
$.get("/system/email/getSysOaEmailData", function(data) {
if (data.code == web_status.SUCCESS ) {
var sysOaEmailData=data.data;
$("#readTotal").text(sysOaEmailData.readTotal);
$("#draftsTotal").text(sysOaEmailData.draftsTotal);
} else if (data.code == web_status.WARNING) {
$.modal.alertWarning(data.msg)
} else {
$.modal.alertError(data.msg);
}
});
$('.summernote').summernote({
placeholder: '请输入邮件内容',
@ -248,13 +216,13 @@
if(emailStatus==1){
$.modal.msg("草稿保存成功,即将跳转到草稿箱", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="/system/email/mailbox/1";
window.location.href="/system/email/drafts";
},3000);
}
else if(emailStatus==0){
$.modal.msg("邮件发送成功,即将跳转到发件箱", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="/system/email/mailbox/7";
window.location.href="/system/email/sendMail";
},3000);
}
@ -269,6 +237,9 @@
};
$.ajax(config)
}
function toSendEmail() {
$.modal.openTab('邮件管理', prefix);
}
</script>
</body>

View File

@ -0,0 +1,341 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('邮件列表')" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>邮件列表</title>
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<link th:href="@{/css/iCheck/custom.css}" rel="stylesheet">
<link th:href="@{/css/animate.css}" rel="stylesheet">
<link th:href="@{/css/style.css}" rel="stylesheet">
<link th:href="#{/css/iCheck/custom.css}" rel="stylesheet">
<style type="text/css">
#bootstrap-table {border-left: 0px; border-right:0px}
#bootstrap-table th{border-left: 0px; border-right: 0px}
#bootstrap-table td{border-left: 0px; border-right: 0px}
</style>
</head>
<body>
<div id="wrapper">
<div class="wrapper wrapper-content gray-bg">
<div class="row">
<div class="col-lg-3">
<div class="ibox float-e-margins">
<div class="ibox-content mailbox-content">
<div class="file-manager">
<a class="btn btn-block btn-primary compose-mail"href="javascript:void(0)" onclick="toSendEmail()">写邮件</a>
<div class="space-25"></div>
<h3>邮件标签</h3>
<ul class="category-list" style="padding: 0">
<li><a href="#"> <i class="fa fa-circle text-navy"></i> 工作 </a></li>
<li><a href="#"> <i class="fa fa-circle text-danger"></i> 文档</a></li>
<li><a href="#"> <i class="fa fa-circle text-primary"></i> 社交</a></li>
<li><a href="#"> <i class="fa fa-circle text-info"></i> 活动</a></li>
</ul>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
<div class="col-lg-9 animated fadeInRight">
<div class="mail-box-header">
<form class="pull-right mail-search select-list" id="formId">
<div class="input-group">
<input type="text" class="form-control input-sm" name="emailSubject" placeholder="Search email">
<div class="input-group-btn">
<a onclick="$.table.search()" class="btn btn-sm btn-primary">
请输入邮件主题
</a>
</div>
</div>
</form>
<h2>
<i class="fa fa-flag danger" style="color: red"></i> 标星邮件
</h2>
<div class="mail-tools tooltip-demo m-t-md">
<button class="btn btn-success btn-sm" data-toggle="tooltip" data-placement="top" title="标记为已读" onclick="markRead()"><i class="fa fa-eye"></i>标记已读 </button>
</div>
<div class="mail-box">
<table id="bootstrap-table" class="table table-hover table-mail table-no-borde">
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Mainly scripts -->
<script th:src="@{/js/jquery.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
<script th:src="@{/ruoyi/js/common.js}"></script>
<script th:src="@{/ruoyi/js/ry-ui.js}"></script>
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/bootstrap-table.min.js?v=20200727}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js?v=20200727}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js?v=20200727}"></script>
<script th:inline="javascript">
var prefix = "/system/email";
var emailLabelDatas = [[${@dict.getType('sys_email_lable')}]];
$(document).ready(function(){
$('.i-checks').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green'
});
$.get(prefix+"/getSysOaEmailData", function(data) {
if (data.code == web_status.SUCCESS ) {
var sysOaEmailData=data.data;
$("#readTotal").text(sysOaEmailData.readTotal);
$("#draftsTotal").text(sysOaEmailData.draftsTotal);
} else if (data.code == web_status.WARNING) {
$.modal.alertWarning(data.msg)
} else {
$.modal.alertError(data.msg);
}
});
});
var options = {
url: prefix + "/getImportantMail",
rememberSelected: true,
modalName: "邮件",
showToggle:false,
showHeader:true,
showSearch:false,
showRefresh:false,
showColumns:false,
queryParams: queryParams,
striped:true,
height:'30px',
columns: [{
field: 'state',
checkbox: true,
visible :true,
formatter: function(value, row, index) {
if(row.messageReadStatus==0){
return { disabled : false}
}else {
return { disabled : true}
}
}},
{
field: 'id',
title: 'id',
visible: false
},
{
field: 'emailSubject',
title: '邮件主题',
align:'left',
formatter: function(value, row, index) {
return '<i class="fa fa-flag danger" style="color: red"></i> '+'<a href="javascript:void(0)" onclick="mailDetail(\''+row.id+'\')">'+value+'</a> ';
}
},
{
field: 'producerUser.email',
title: '发件邮箱',
align:'left'
},
{
field: 'emailLabel',
title: '邮件标签',
align:'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(emailLabelDatas, value);
}
},
{
field: 'messageReadStatus',
title: '是否已读',
width: 30,
align:'center',
formatter: function(value, row, index) {
if(value==0){
return '<span class="label label-warning pull-right">未读</span>';
}else {
return '<span class="label label-success pull-right">已读</span>';
}
}
},
{
field: 'sendTime',
title: '发送时间',
width: 220,
align:'center',
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<button class="btn btn-warning btn-sm" data-toggle="tooltip" data-placement="top" title="移到垃圾箱" onclick="remarkTrash(\''+row.id+'\')"><i class="fa fa-trash"></i> </button> ');
actions.push('<button class="btn btn-danger btn-sm" data-toggle="tooltip" data-placement="top" title="删除" onclick="markDelete(\''+row.id+'\')"><i class="fa fa-remove"></i> </button> ');
return actions.join('');
}
}
]
};
$.table.init(options);
function queryParams(params) {
var search = $.table.queryParams(params);
return search;
}
// 选中数据
function markRead(){
var arrays = $.table.selectColumns("id");
if($.common.isEmpty(arrays)){
$.modal.msgWarning("请至少选择一条记录");
return false;
}
var config = {
url: prefix + "/remarkRead",
type: "post",
dataType: "json",
data: {
"ids":arrays.join()
},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$.modal.msg("标记已读成功", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="#";
},3000);
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$.modal.enable();
}
};
$.ajax(config);
}
function remarkImportant(id){
var config = {
url: prefix + "/remarkImportant",
type: "post",
dataType: "json",
data: {
"ids":id
},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$.modal.msg("标记成功,即将跳转到重要邮件箱", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="/system/email/mailbox/3";
},3000);
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$.modal.enable();
}
};
$.ajax(config)
}
function remarkTrash(id){
var config = {
url: prefix + "/remarkTrash",
type: "post",
dataType: "json",
data: {
"ids":id
},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$.modal.msg("标记成功,即将跳转到垃圾箱", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="/system/email/trashMail";
},3000);
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$.modal.enable();
}
};
$.ajax(config);
}
function markDelete(id){
var config = {
url: prefix + "/markDelete",
type: "post",
dataType: "json",
data: {
"ids":id
},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$.modal.msg("删除成功,即将跳转到收件箱", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="/system/email/receivedMail";
},3000);
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$.modal.enable();
}
};
$.ajax(config)
}
function mailDetail(id) {
var detailUrl="/system/email/mailDetail/"+id;
$.modal.openTab("查阅邮件", detailUrl);
}
function toSendEmail() {
$.modal.openTab('邮件管理', prefix);
}
</script>
</body>
</html>

View File

@ -0,0 +1,350 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('邮件列表')" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>邮件列表</title>
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<link th:href="@{/css/iCheck/custom.css}" rel="stylesheet">
<link th:href="@{/css/animate.css}" rel="stylesheet">
<link th:href="@{/css/style.css}" rel="stylesheet">
<link th:href="#{/css/iCheck/custom.css}" rel="stylesheet">
<style type="text/css">
#bootstrap-table {border-left: 0px; border-right:0px}
#bootstrap-table th{border-left: 0px; border-right: 0px}
#bootstrap-table td{border-left: 0px; border-right: 0px}
</style>
</head>
<body>
<div id="wrapper">
<div class="wrapper wrapper-content gray-bg">
<div class="row">
<div class="col-lg-3">
<div class="ibox float-e-margins">
<div class="ibox-content mailbox-content">
<div class="file-manager">
<a class="btn btn-block btn-primary compose-mail"href="javascript:void(0)" onclick="toSendEmail()">写邮件</a>
<div class="space-25"></div>
<h3>邮件标签</h3>
<ul class="category-list" style="padding: 0">
<li><a href="#"> <i class="fa fa-circle text-navy"></i> 工作 </a></li>
<li><a href="#"> <i class="fa fa-circle text-danger"></i> 文档</a></li>
<li><a href="#"> <i class="fa fa-circle text-primary"></i> 社交</a></li>
<li><a href="#"> <i class="fa fa-circle text-info"></i> 活动</a></li>
</ul>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
<div class="col-lg-9 animated fadeInRight">
<div class="mail-box-header">
<form class="pull-right mail-search select-list" id="formId">
<div class="input-group">
<input type="text" class="form-control input-sm" name="emailSubject" placeholder="Search email">
<div class="input-group-btn">
<a onclick="$.table.search()" class="btn btn-sm btn-primary">
请输入邮件主题
</a>
</div>
</div>
</form>
<h2>
DingFlow收件箱<span class="label label-warning pull-right" id="readTotal"></span>
</h2>
<span id="systemUserId" hidden>
<shiro:principal property='userId'/>
</span>
<div class="mail-tools tooltip-demo m-t-md">
<button class="btn btn-success btn-sm" data-toggle="tooltip" data-placement="top" title="标记为已读" onclick="markRead()"><i class="fa fa-eye"></i>标记已读 </button>
</div>
<div class="mail-box">
<table id="bootstrap-table" class="table table-hover table-mail table-no-borde">
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Mainly scripts -->
<script th:src="@{/js/jquery.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
<script th:src="@{/ruoyi/js/common.js}"></script>
<script th:src="@{/ruoyi/js/ry-ui.js}"></script>
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/bootstrap-table.min.js?v=20200727}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js?v=20200727}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js?v=20200727}"></script>
<script th:inline="javascript">
var prefix = "/system/email";
var emailLabelDatas = [[${@dict.getType('sys_email_lable')}]];
$(document).ready(function(){
$('.i-checks').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green'
});
$.get(prefix+"/getSysOaEmailData", function(data) {
if (data.code == web_status.SUCCESS ) {
var sysOaEmailData=data.data;
$("#readTotal").text(sysOaEmailData.readTotal);
$("#draftsTotal").text(sysOaEmailData.draftsTotal);
} else if (data.code == web_status.WARNING) {
$.modal.alertWarning(data.msg)
} else {
$.modal.alertError(data.msg);
}
});
});
var options = {
url: prefix + "/getReceivedMail",
rememberSelected: true,
modalName: "邮件",
showToggle:false,
showHeader:true,
showSearch:false,
showRefresh:false,
showColumns:false,
queryParams: queryParams,
height:'30px',
columns: [{
field: 'state',
checkbox: true,
visible : true,
formatter: function(value, row, index) {
if(row.messageReadStatus==0){
return { disabled : false}
}else {
return { disabled : true}
}
}
},
{
field: 'id',
title: 'id',
visible: false
},
{
field: 'emailSubject',
title: '邮件主题',
align:'left',
formatter: function(value, row, index) {
var emailStatus= row.emailStatus;
if(emailStatus==3){
return '<i class="fa fa-flag danger" style="color: red"></i> '+'<a href="javascript:void(0)" onclick="mailDetail(\''+row.id+'\')">'+value+'</a> ';
}else {
return '<a href="javascript:void(0)" onclick="mailDetail(\''+row.id+'\')">'+value+'</a> ';
}
}
},
{
field: 'producerUser.email',
title: '发件邮箱',
align:'left'
},
{
field: 'emailLabel',
title: '邮件标签',
formatter: function(value, row, index) {
return $.table.selectDictLabel(emailLabelDatas, value);
}
},
{
field: 'messageReadStatus',
title: '是否已读',
width: 30,
align:'left',
formatter: function(value, row, index) {
//from 等于当前用户并且状态为0代表是发件箱
if(value==0){
return '<span class="label label-warning pull-right">未读</span>';
}else {
return '<span class="label label-success pull-right">已读</span>';
}
}
},
{
field: 'sendTime',
title: '发送时间',
width: 220,
align: 'right'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<button class="btn btn-primary btn-sm" data-toggle="tooltip" data-placement="top" title="标记为重要邮件" onclick="remarkImportant(\''+row.id+'\')"><i class="fa fa-flag"></i> </button> ');
actions.push('<button class="btn btn-warning btn-sm" data-toggle="tooltip" data-placement="top" title="移到垃圾箱" onclick="remarkTrash(\''+row.id+'\')"><i class="fa fa-trash"></i> </button> ');
actions.push('<button class="btn btn-danger btn-sm" data-toggle="tooltip" data-placement="top" title="删除" onclick="markDelete(\''+row.id+'\')"><i class="fa fa-remove"></i> </button> ');
return actions.join('');
}
}
]
};
$.table.init(options);
function queryParams(params) {
var search = $.table.queryParams(params);
return search;
}
// 选中数据
function markRead(){
var arrays = $.table.selectColumns("id");
if($.common.isEmpty(arrays)){
$.modal.msgWarning("请至少选择一条记录");
return false;
}
var config = {
url: prefix + "/remarkRead",
type: "post",
dataType: "json",
data: {
"ids":arrays.join()
},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$.modal.msg("标记已读成功", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="#";
},3000);
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$.modal.enable();
}
};
$.ajax(config);
}
function remarkImportant(id){
var config = {
url: prefix + "/remarkImportant",
type: "post",
dataType: "json",
data: {
"ids":id
},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$.modal.msg("标记成功,即将跳转到重要邮件箱", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="/system/email/importantMail";
},2000);
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$.modal.enable();
}
};
$.ajax(config)
}
function remarkTrash(id){
var config = {
url: prefix + "/remarkTrash",
type: "post",
dataType: "json",
data: {
"ids":id
},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$.modal.msg("标记成功,即将跳转到垃圾箱", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="/system/email/trashMail";
},3000);
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$.modal.enable();
}
};
$.ajax(config);
}
function markDelete(id){
var config = {
url: prefix + "/markDelete",
type: "post",
dataType: "json",
data: {
"ids":id
},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$.modal.msg("删除成功,即将跳转到收件箱", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="/system/email/receivedMail";
},3000);
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$.modal.enable();
}
};
$.ajax(config)
}
function mailDetail(id) {
var detailUrl="/system/email/mailDetail/"+id;
$.modal.openTab("查阅邮件", detailUrl);
}
function toSendEmail() {
$.modal.openTab('邮件管理', prefix);
}
</script>
</div>
</body>
</html>

View File

@ -0,0 +1,333 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('邮件列表')" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>邮件列表</title>
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<link th:href="@{/css/iCheck/custom.css}" rel="stylesheet">
<link th:href="@{/css/animate.css}" rel="stylesheet">
<link th:href="@{/css/style.css}" rel="stylesheet">
<link th:href="#{/css/iCheck/custom.css}" rel="stylesheet">
<style type="text/css">
#bootstrap-table {border-left: 0px; border-right:0px}
#bootstrap-table th{border-left: 0px; border-right: 0px}
#bootstrap-table td{border-left: 0px; border-right: 0px}
</style>
</head>
<body>
<div id="wrapper">
<div class="wrapper wrapper-content gray-bg">
<div class="row">
<div class="col-lg-3">
<div class="ibox float-e-margins">
<div class="ibox-content mailbox-content">
<div class="file-manager">
<a class="btn btn-block btn-primary compose-mail"href="javascript:void(0)" onclick="toSendEmail()">写邮件</a>
<div class="space-25"></div>
<h3>邮件标签</h3>
<ul class="category-list" style="padding: 0">
<li><a href="#"> <i class="fa fa-circle text-navy"></i> 工作 </a></li>
<li><a href="#"> <i class="fa fa-circle text-danger"></i> 文档</a></li>
<li><a href="#"> <i class="fa fa-circle text-primary"></i> 社交</a></li>
<li><a href="#"> <i class="fa fa-circle text-info"></i> 活动</a></li>
</ul>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
<div class="col-lg-9 animated fadeInRight">
<div class="mail-box-header">
<form class="pull-right mail-search select-list" id="formId">
<div class="input-group">
<input type="hidden" name="mailSearchType" th:value="${mailType}" id="mailType" >
<input type="text" class="form-control input-sm" name="emailSubject" placeholder="Search email">
<div class="input-group-btn">
<a onclick="$.table.search()" class="btn btn-sm btn-primary">
请输入邮件主题
</a>
</div>
</div>
</form>
<h2>
DingFlow发件箱
</h2>
</div>
<div class="mail-box">
<table id="bootstrap-table" class="table table-hover table-mail table-no-borde">
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Mainly scripts -->
<script th:src="@{/js/jquery.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
<script th:src="@{/ruoyi/js/common.js}"></script>
<script th:src="@{/ruoyi/js/ry-ui.js}"></script>
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/bootstrap-table.min.js?v=20200727}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js?v=20200727}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js?v=20200727}"></script>
<script th:inline="javascript">
var prefix = "/system/email";
var emailLabelDatas = [[${@dict.getType('sys_email_lable')}]];
$(document).ready(function(){
$('.i-checks').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green'
});
$.get(prefix+"/getSysOaEmailData", function(data) {
if (data.code == web_status.SUCCESS ) {
var sysOaEmailData=data.data;
$("#readTotal").text(sysOaEmailData.readTotal);
$("#draftsTotal").text(sysOaEmailData.draftsTotal);
} else if (data.code == web_status.WARNING) {
$.modal.alertWarning(data.msg)
} else {
$.modal.alertError(data.msg);
}
});
});
var options = {
url: prefix + "/getSendMail",
rememberSelected: true,
modalName: "邮件",
showToggle:false,
showHeader:true,
showSearch:false,
showRefresh:false,
showColumns:false,
queryParams: queryParams,
striped:true,
height:'30px',
columns: [
{
field: 'id',
title: 'id',
visible: false
},
{
field: 'emailSubject',
title: '邮件主题',
align:'left',
formatter: function(value, row, index) {
var emailStatus= row.emailStatus;
if(emailStatus==3){
return '<i class="fa fa-flag danger" style="color: red"></i> '+'<a href="javascript:void(0)" onclick="mailDetail(\''+row.id+'\')">'+value+'</a> ';
}else {
return '<a href="javascript:void(0)" onclick="mailDetail(\''+row.id+'\')">'+value+'</a> ';
}
}
},
{
field: 'producerUser.email',
title: '收件邮箱',
align:'left'
},
{
field: 'emailLabel',
title: '邮件标签',
formatter: function(value, row, index) {
return $.table.selectDictLabel(emailLabelDatas, value);
}
},
{
field: 'sendTime',
title: '发送时间',
width: 220,
align: 'right'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<button class="btn btn-primary btn-sm" data-toggle="tooltip" data-placement="top" title="标记为重要邮件" onclick="remarkImportant(\''+row.id+'\')"><i class="fa fa-flag"></i> </button> ');
actions.push('<button class="btn btn-warning btn-sm" data-toggle="tooltip" data-placement="top" title="移到垃圾箱" onclick="remarkTrash(\''+row.id+'\')"><i class="fa fa-trash"></i> </button> ');
actions.push('<button class="btn btn-danger btn-sm" data-toggle="tooltip" data-placement="top" title="删除" onclick="markDelete(\''+row.id+'\')"><i class="fa fa-remove"></i> </button> ');
return actions.join('');
}
}
]
};
$.table.init(options);
function queryParams(params) {
var search = $.table.queryParams(params);
return search;
}
// 选中数据
function markRead(){
var arrays = $.table.selectColumns("id");
if($.common.isEmpty(arrays)){
$.modal.msgWarning("请至少选择一条记录");
return false;
}
var config = {
url: prefix + "/remarkRead",
type: "post",
dataType: "json",
data: {
"ids":arrays.join()
},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$.modal.msg("标记已读成功", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="#";
},3000);
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$.modal.enable();
}
};
$.ajax(config);
}
function remarkImportant(id){
/* var arrays = $.table.selectColumns("id");
if($.common.isEmpty(arrays)){
$.modal.msgWarning("请至少选择一条记录");
return false;
}*/
var config = {
url: prefix + "/remarkImportant",
type: "post",
dataType: "json",
data: {
"ids":id
},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$.modal.msg("标记成功,即将跳转到重要邮件箱", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="/system/email/mailbox/3";
},3000);
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$.modal.enable();
}
};
$.ajax(config)
}
function remarkTrash(id){
var config = {
url: prefix + "/remarkTrash",
type: "post",
dataType: "json",
data: {
"ids":id
},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$.modal.msg("标记成功,即将跳转到垃圾箱", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="/system/email/mailbox/4";
},3000);
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$.modal.enable();
}
};
$.ajax(config);
}
function markDelete(id){
var config = {
url: prefix + "/markDelete",
type: "post",
dataType: "json",
data: {
"ids":id
},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$.modal.msg("删除成功,即将跳转到收件箱", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="/system/email/sendMail";
},3000);
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$.modal.enable();
}
};
$.ajax(config)
}
function mailDetail(id) {
var detailUrl="/system/email/mailDetail/"+id;
$.modal.openTab("查阅邮件", detailUrl);
}
function emailEdit(id) {
window.location.href="/system/email/edit/"+id;
}
function toSendEmail() {
$.modal.openTab('邮件管理', prefix);
}
</script>
</body>
</html>

View File

@ -0,0 +1,230 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('邮件列表')" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>邮件列表</title>
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<link th:href="@{/css/iCheck/custom.css}" rel="stylesheet">
<link th:href="@{/css/animate.css}" rel="stylesheet">
<link th:href="@{/css/style.css}" rel="stylesheet">
<link th:href="#{/css/iCheck/custom.css}" rel="stylesheet">
<style type="text/css">
#bootstrap-table {border-left: 0px; border-right:0px}
#bootstrap-table th{border-left: 0px; border-right: 0px}
#bootstrap-table td{border-left: 0px; border-right: 0px}
</style>
</head>
<body>
<div id="wrapper">
<div class="wrapper wrapper-content gray-bg">
<div class="row">
<div class="col-lg-3">
<div class="ibox float-e-margins">
<div class="ibox-content mailbox-content">
<div class="file-manager">
<a class="btn btn-block btn-primary compose-mail"href="javascript:void(0)" onclick="toSendEmail()">写邮件</a>
<div class="space-25"></div>
<h3>邮件标签</h3>
<ul class="category-list" style="padding: 0">
<li><a href="#"> <i class="fa fa-circle text-navy"></i> 工作 </a></li>
<li><a href="#"> <i class="fa fa-circle text-danger"></i> 文档</a></li>
<li><a href="#"> <i class="fa fa-circle text-primary"></i> 社交</a></li>
<li><a href="#"> <i class="fa fa-circle text-info"></i> 活动</a></li>
</ul>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
<div class="col-lg-9 animated fadeInRight">
<div class="mail-box-header">
<form class="pull-right mail-search select-list" id="formId">
<div class="input-group">
<input type="hidden" name="mailSearchType" th:value="${mailType}" id="mailType" >
<input type="text" class="form-control input-sm" name="emailSubject" placeholder="Search email">
<div class="input-group-btn">
<a onclick="$.table.search()" class="btn btn-sm btn-primary">
请输入邮件主题
</a>
</div>
</div>
</form>
<h2>
DingFlow垃圾箱
</h2>
<div class="mail-box">
<table id="bootstrap-table" class="table table-hover table-mail table-no-borde">
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Mainly scripts -->
<script th:src="@{/js/jquery.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
<script th:src="@{/ruoyi/js/common.js}"></script>
<script th:src="@{/ruoyi/js/ry-ui.js}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/bootstrap-table.min.js?v=20200727}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js?v=20200727}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js?v=20200727}"></script>
<script th:inline="javascript">
var prefix = "/system/email";
var emailLabelDatas = [[${@dict.getType('sys_email_lable')}]];
$(document).ready(function(){
$('.i-checks').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green'
});
$.get(prefix+"/getSysOaEmailData", function(data) {
if (data.code == web_status.SUCCESS ) {
var sysOaEmailData=data.data;
$("#readTotal").text(sysOaEmailData.readTotal);
$("#draftsTotal").text(sysOaEmailData.draftsTotal);
} else if (data.code == web_status.WARNING) {
$.modal.alertWarning(data.msg)
} else {
$.modal.alertError(data.msg);
}
});
});
var options = {
url: prefix + "/getTrashMail",
rememberSelected: true,
modalName: "邮件",
showToggle:false,
showHeader:true,
showSearch:false,
showRefresh:false,
showColumns:false,
queryParams: queryParams,
striped:true,
height:'30px',
columns: [
{
field: 'id',
title: 'id',
visible: false
},
{
field: 'emailSubject',
title: '邮件主题',
align:'left',
formatter: function(value, row, index) {
var emailStatus= row.emailStatus;
if(emailStatus==3){
return '<i class="fa fa-flag danger" style="color: red"></i> '+'<a href="javascript:void(0)" onclick="mailDetail(\''+row.id+'\')">'+value+'</a> ';
}else {
return '<a href="javascript:void(0)" onclick="mailDetail(\''+row.id+'\')">'+value+'</a> ';
}
}
},
{
field: 'producerUser.email',
title: '发件邮箱',
align:'left'
},
{
field: 'emailLabel',
title: '邮件标签',
formatter: function(value, row, index) {
return $.table.selectDictLabel(emailLabelDatas, value);
}
},
{
field: 'messageReadStatus',
title: '是否已读',
width: 30,
align:'left',
formatter: function(value, row, index) {
//from 等于当前用户并且状态为0代表是发件箱
if(value==0){
return '<span class="label label-warning pull-right">未读</span>';
}else {
return '<span class="label label-success pull-right">已读</span>';
}
}
},
{
field: 'sendTime',
title: '发送时间',
width: 220,
align: 'right'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<button class="btn btn-danger btn-sm" data-toggle="tooltip" data-placement="top" title="删除" onclick="markDelete(\''+row.id+'\')"><i class="fa fa-remove"></i> </button> ');
return actions.join('');
}
}
]
};
$.table.init(options);
function queryParams(params) {
var search = $.table.queryParams(params);
return search;
}
function markDelete(id){
var config = {
url: prefix + "/markDelete",
type: "post",
dataType: "json",
data: {
"ids":id
},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$.modal.msg("删除成功,即将跳转到收件箱", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="/system/email/mailbox/6";
},3000);
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$.modal.enable();
}
};
$.ajax(config)
}
function mailDetail(id) {
var detailUrl="/system/email/mailDetail/"+id;
$.modal.openTab("查阅邮件", detailUrl);
}
function toSendEmail() {
$.modal.openTab('邮件管理', prefix);
}
</script>
</div>
</body>
</html>

View File

@ -0,0 +1,241 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mailbox</title>
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<link th:href="@{/css/iCheck/custom.css}" rel="stylesheet">
<link th:href="@{/css/animate.css}" rel="stylesheet">
<link th:href="@{/css/style.css}" rel="stylesheet">
<th:block th:include="include :: summernote-css" />
</head>
<body>
<div id="wrapper">
<div class="wrapper wrapper-content gray-bg">
<div class="row">
<div class="col-lg-3">
<div class="ibox float-e-margins">
<div class="ibox-content mailbox-content">
<div class="file-manager">
<span class="compose-mail" >DingFlow邮件管理系统</span>
<div class="space-25"></div>
<h3>邮件标签</h3>
<ul class="category-list" style="padding: 0">
<div class="i-checks"><label> <input type="radio" value="1" checked="" name="emailLabel"> <i></i> 工作 </label></div>
<div class="i-checks"><label> <input type="radio" value="2" name="emailLabel"> <i></i> 文档 </label></div>
<div class="i-checks"><label> <input type="radio" value="3" name="emailLabel"> <i></i>社交 </label></div>
<div class="i-checks"><label> <input type="radio" value="4" name="emailLabel"> <i></i> 活动 </label></div>
</ul>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
<div class="col-lg-9 animated fadeInRight">
<div class="mail-box-header">
<h2>
DingFlow在线邮件
</h2>
</div>
<div class="mail-box">
<div class="mail-body">
<form class="form-horizontal" method="get">
<div class="form-group"><label class="col-sm-2 control-label">收件人:</label>
<div class="col-sm-10">
<input class="form-control" type="hidden" name="emailTo" id="emailTo" required>
<input type="text" class="form-control" onclick="selectUserInfo()" id="emailToName" name="emailToName" readonly="true">
</div>
</div>
<div class="form-group"><label class="col-sm-2 control-label">主题:</label>
<div class="col-sm-10"><input type="text" class="form-control" id="subject" name="subject"></div>
</div>
</form>
</div>
<div class="mail-text h-200">
<input id="emailContent" name="emailContent" type="hidden">
<div class="summernote">
</div>
<div class="clearfix"></div>
</div>
<div class="mail-body text-right tooltip-demo">
<a href="javascript:void(0)" class="btn btn-sm btn-primary" data-toggle="tooltip" onclick="sendEmail(0)" data-placement="top" title="发送"><i class="fa fa-reply"></i> 发送</a>
<a href="javascript:void(0)" class="btn btn-warning btn-sm" data-toggle="tooltip" onclick="sendEmail(1)" data-placement="top" title="存为草稿"><i class="fa fa-file-text-o"></i> 草稿</a>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
</div>
<!-- Mainly scripts -->
<script th:src="@{/js/jquery.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/js/plugins/metisMenu/jquery.metisMenu.js}"></script>
<script th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script>
<!-- Custom and plugin javascript -->
<script th:src="@{/js/inspinia.js}"></script>
<script th:src="@{/js/plugins/pace/pace.min.js}"></script>
<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
<script th:src="@{/ruoyi/js/common.js}"></script>
<script th:src="@{/ruoyi/js/ry-ui.js}"></script>
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<th:block th:include="include :: summernote-js" />
<script type="text/javascript">
var prefix ="../system/email";
$(document).ready(function () {
$('.i-checks').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green',
});
$.get(prefix+"/getSysOaEmailData", function(data) {
if (data.code == web_status.SUCCESS ) {
var sysOaEmailData=data.data;
$("#readTotal").text(sysOaEmailData.readTotal);
$("#draftsTotal").text(sysOaEmailData.draftsTotal);
} else if (data.code == web_status.WARNING) {
$.modal.alertWarning(data.msg)
} else {
$.modal.alertError(data.msg);
}
});
});
$('.summernote').summernote({
placeholder: '请输入邮件内容',
height : 300,
lang : 'zh-CN',
followingToolbar: false,
callbacks: {
onImageUpload: function (files) {
sendFile(files[0], this);
}
}
});
/*选择用户*/
function selectUserInfo() {
var url = "/system/resign/selectUser";
$.modal.open("选择用户",url,"","",doSubmit);
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
var iframeWin = layero.find('iframe')[0];
iframeWin.contentWindow.submitHandler(index, layero);
$("#emailTo").val(body.find('#id').val());
var userName=body.find('#userName').val();
$("#emailToName").val(userName+"("+body.find('#email').val()+")");
layer.close(index);
}
// 上传文件
function sendFile(file, obj) {
var data = new FormData();
data.append("file", file);
$.ajax({
type: "POST",
url: "../common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$(obj).summernote('editor.insertImage', result.url, result.fileName);
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertWarning("图片上传失败。");
}
});
}
function sendEmail(emailStatus) {
var emailLabel= $("input[name='emailLabel']:checked").val();
if($.common.isEmpty(emailLabel)){
$.modal.msgWarning("请选择邮件标签");
return false;
}
var emailTo=$("#emailTo").val();
if($.common.isEmpty(emailTo)){
$.modal.msgWarning("请输入收件人");
return false;
}
var subject=$("#subject").val();
if($.common.isEmpty(subject)){
$.modal.msgWarning("请输入邮件主题");
return false;
}
var sHTML = $('.summernote').summernote('code');
$("#emailContent").val(sHTML);
if($.common.isEmpty(sHTML)){
$.modal.msgWarning("请输入邮件内容");
return false;
}
var config = {
url: prefix + "/sendSysEmail",
type: "post",
dataType: "json",
data: {
"emailLabel":emailLabel,
"emailTo": emailTo,
"emailSubject":subject,
"emailStatus":emailStatus,
"emailContent":$("#emailContent").val()
},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
if(emailStatus==1){
$.modal.msg("草稿保存成功,即将跳转到草稿箱", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="/system/email/drafts";
},2000);
}
else if(emailStatus==0){
$.modal.msg("邮件发送成功,即将跳转到发件箱", modal_status.SUCCESS);
setTimeout(function(){
window.location.href="/system/email/sendMail";
},2000);
}
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$.modal.enable();
}
};
$.ajax(config)
}
</script>
</body>
</html>

View File

@ -0,0 +1,80 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" />
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet" />
<!-- bootstrap-table 表格插件样式 -->
<link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
<link th:href="@{/css/animate.css}" rel="stylesheet" />
<link th:href="@{/css/style.css}" rel="stylesheet" />
<link th:href="@{/ruoyi/css/ry-ui.css}" rel="stylesheet" />
</head>
<body class="white-bg" >
<form class="form-horizontal m-t" id="signupForm">
<div id="vertical-timeline5" class="vertical-container light-timeline">
<div class="pull-left">
<label th:switch="${sysMessageTransition.messageReadStatus}">
<span class="label label-danger" th:case="'0'">未读</span>
<span class="label label-success" th:case="'1'">已读</span>
</label>
</div>
<div class="text-center article-title">
<h1>
[[${sysMessageTransition.sysMessageTemplate.templateName}]]
</h1>
</div>
<div class="vertical-timeline-block">
<hr>
<div class="vertical-timeline-content">
<p >&nbsp;&nbsp; <span class="text-danger"><i th:class="${sysMessageTransition.iconClass}"></i> </span> &nbsp;&nbsp; [[${sysMessageTransition.messageContent}]]</p>
<a href="javascript:void(0)" class="btn btn-sm btn-success" th:onclick="messageDetail([[${sysMessageTransition.id}]],[[${sysMessageTransition.pcUrl}]]);"> 查看详情 </a>
</div>
<div class="pull-right">
<span class="text-muted"><i class="fa fa-clock-o"></i> [[${#dates.format(sysMessageTransition.createTime, 'yyyy-MM-dd hh:mm:ss')}]]</span>
</div>
<br/>
<hr>
</div>
</div>
</form>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
function messageDetail(id,url){
//先标记为已读
markRead(id);
//在跳转到页面
createNoPanelMenuItem(url,"详情")
}
function markRead(id){
var config = {
url: "/system/messageCenter/remarkRead",
type: "post",
dataType: "json",
data: {
"id":id
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$(".messageReadStatus badge badge-primary").show();
$(".messageReadStatus badge badge-danger").hide();
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
}
};
$.ajax(config)
}
</script>
</body>
</html>

View File

@ -2,6 +2,11 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('消息中心')" />
<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<link href="../static/css/main/animate.min.css" th:href="@{/css/main/animate.min.css}" rel="stylesheet"/>
<link href="../static/css/main/style.min862f.css" th:href="@{/css/main/style.min862f.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/layui/layui.css}" rel="stylesheet"/>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeIn">
@ -98,6 +103,7 @@
<div id="tab-3" class="tab-pane">
<div class="panel-body">
<h3>流程待办</h3>
<div id="vertical-timeline2" class="vertical-container light-timeline" th:each="todoTask,iterStat : ${todoTaskList}">
<div class="vertical-timeline-block">
@ -115,9 +121,7 @@
</p>
<p >[[${todoTask.messageContent}]]</p>
<a href="javascript:void(0)" class="btn btn-sm btn-success" th:onclick="messageDetail([[${todoTask.id}]],[[${todoTask.pcUrl}]]);"> 查看详情 </a>
<p>
<!--<small class="badge badge-warning"> <i class="fa fa-clock-o"></i>[[${todoTask.spendTime}]]</small>-->
</p>
<div id="footPage" style="text-align: center;"></div>
</div>
<hr>
</div>
@ -186,8 +190,30 @@
</div>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
<script th:src="@{/ruoyi/js/ry-ui.js}"></script>
<script th:inline="javascript">
layui.use('laypage', function(){
var laypage = layui.laypage;
laypage.render({
elem: 'footPage'
,count: [[${dataTable.total}]]
,curr: function(){ //通过url获取当前页也可以同上pages方式获取
var page = location.search.match(/pageNum=(\d+)/);
return page ? page[1] : 1;
}()
,jump: function(obj, first){
//首次不执行
if(!first){
window.location.href="?pageNum="+obj.curr+"&pageSize=10"
}
}
});
});
function messageDetail(id,url){
//先标记为已读
@ -200,7 +226,6 @@
area : ["70%", "80%"],
content : [url, 'yes']
})
}
function markRead(id){

View File

@ -0,0 +1,142 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('消息中心')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li class="select-time">
<label>消息时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
</li>
<li>
<label>消息状态:</label>
<select name="messageReadStatus" >
<option value="">请选择</option>
<option value="0">未读</option>
<option value="1">已读</option>
</select>
</li>
<li>
<label>消息类型:</label>
<select name="messageType" th:with="type=${@dict.getType('sys_oa_message_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success multiple disabled" onclick="$.operate.markAll()" shiro:hasPermission="system:messageCenter:mark">
<i class="fa fa-mars-stroke"></i> 标记已读
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:messageCenter:remove">
<i class="fa fa-remove"></i> 删除
</a>
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:payment:export">
<i class="fa fa-download"></i> 导出
</a>-->
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var removeFlag = [[${@permission.hasPermi('system:messageCenter:remove')}]];
var markFlag = [[${@permission.hasPermi('system:messageCenter:mark')}]];
var detailFlag = [[${@permission.hasPermi('system:messageCenter:detail')}]];
var messageType = [[${@dict.getType('sys_oa_message_type')}]];
var messageReadType = [[${@dict.getType('sys_message_read_flag')}]];
var prefix = ctx + "system/messageCenter";
$(function() {
var options = {
url: prefix + "/list",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
markUrl:prefix+"/mark",
modalName: "消息中心",
columns: [{
checkbox: true
},
{
field: 'id',
title: 'id',
visible: false
},
{
field: 'messageType',
title: '消息类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(messageType, value);
}
},
{
field: 'consumerUser.userName',
title: '发送者'
},
{
field: 'messageContent',
title: '消息内容',
formatter: function(value, row, index) {
return $.table.tooltip(value);
}
},
{
field: 'messageReadStatus',
title: '消息状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(messageReadType, value);
}
},
{
field: 'createTime',
title: '发送时间'
},
{
field: 'spendTime',
title: '距今时间'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
if(row.messageReadStatus==0){
actions.push('<a class="btn btn-success btn-xs ' + markFlag + '" href="javascript:void(0)" onclick="$.operate.mark(\'' + row.id + '\')"><i class="fa fa-mars-stroke"></i>标记已读</a> ');
}
actions.push('<a class="btn btn-info btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="messageDetail(\'' + row.id + '\')"><i class="fa fa-eye"></i>详情</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
});
function messageDetail(id) {
$.modal.openTab('消息详情', "/system/messageCenter/detail/"+id);
}
</script>
</body>
</html>

View File

@ -50,7 +50,7 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">期望完成时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<div class="input-group datetime">
<input name="expectedTime" class="datetime-input form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text" required>
</div>
</div>
@ -61,12 +61,13 @@
<input name="taskSource" class="form-control" type="text">
</div>
</div>
<!-- <div class="form-group">
<label class="col-sm-3 control-label">任务跳转URL</label>
<div class="form-group">
<label class="col-sm-3 control-label is-required">是否创建钉钉待办</label>
<div class="col-sm-8">
<input name="taskUrl" class="form-control" type="text">
<label class="radio-box"> <input type="radio" name="syncDingtalk" value="0" checked/></label>
<label class="radio-box"> <input type="radio" name="syncDingtalk" value="1" /></label>
</div>
</div>-->
</div>
</form>
</div>
<div class="row">

View File

@ -6,6 +6,7 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-task-edit" th:object="${sysOaTask}">
<input name="taskOutsideId" th:field="*{taskOutsideId}" type="hidden" >
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务编号:</label>
<div class="col-sm-8">
@ -42,30 +43,19 @@
<textarea name="taskContent" class="form-control" rows="7" th:field="*{taskContent}"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">执行人:</label>
<div class="col-sm-8">
<div class="input-group">
<input class="form-control" type="hidden" name="taskDistributeId" id="taskDistributeId" th:field="*{taskDistributeId}">
<input class="form-control" type="text" name="transitionPersonName" onclick="selectUserInfo()" id="transitionPersonName" readonly="true">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">任务状态:</label>
<div class="col-sm-8">
<select name="taskStatus" class="form-control m-b" th:with="type=${@dict.getType('ding_task_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{taskStatus}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">任务来源:</label>
<div class="col-sm-8">
<input name="taskSource" th:field="*{taskSource}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">是否创建钉钉待办:</label>
<div class="col-sm-8">
<label class="radio-box"> <input type="radio" name="syncDingtalk" value="0" checked/></label>
<label class="radio-box"> <input type="radio" name="syncDingtalk" value="1" /></label>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
@ -74,24 +64,12 @@
$("#form-task-edit").validate({
focusCleanup: true
});
function selectUserInfo() {
var url = "/system/user/selectMultiUser";
$.modal.open("选择用户",url,"","",doSubmit);
}
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-task-edit').serialize());
}
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
var iframeWin = layero.find('iframe')[0];
iframeWin.contentWindow.submitHandler(index, layero);
$("#taskDistributeId").val(body.find('#id').val());
$("#transitionPersonName").val(body.find('#userName').val());
layer.close(index);
}
</script>
</body>
</html>

View File

@ -10,17 +10,19 @@
<div class="tabs-container">
<div class="tabs-left">
<ul class="nav nav-tabs">
<li class="active">
<a data-toggle="tab" href="#tab-1"> 待处理 <span class="label label-info pull-right"></span></a>
<a data-toggle="tab" href="#tab-1"> <span class="font-bold text-info"><i class="fa fa-tasks"></i> 待处理 </span> <span class="label label-info pull-right"></span></a>
</li>
<li class="">
<a data-toggle="tab" href="#tab-2"> 我创建 <span class="label label-info pull-right" ></span></a>
<a data-toggle="tab" href="#tab-2"> <span class="font-bold text-info"><i class="fa fa-paint-brush"></i> 我创建 </span> <span class="label label-info pull-right" ></span></a>
</li>
<li class="">
<a data-toggle="tab" href="#tab-3"> 已处理 <span class="label label-info pull-right" ></span></a>
<a data-toggle="tab" href="#tab-3"><span class="font-bold text-info"><i class="fa fa-map"></i> 已处理 </span> <span class="label label-info pull-right" ></span></a>
</li>
</ul>
@ -92,7 +94,7 @@
</form>
</div>
<div class="btn-group-sm" id="toolbar2" role="group">
<a class="btn btn-success" onclick="$.operate.addTab()" shiro:hasPermission="system:task:add">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:task:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:task:export">
@ -188,6 +190,7 @@
return row.sysOaTask.taskName;
}
},
{
field: 'taskType',
title: '任务类型',
@ -195,6 +198,13 @@
return $.table.selectDictLabel(taskTypeDatas, row.sysOaTask.taskType);
}
},
{
field: 'taskExecuteStatus',
title: '执行状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(taskStatusDatas, row.sysOaTask.taskType);
}
},
{
field: 'createBy',
title: '指派人',
@ -218,10 +228,10 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
if(row.taskExecuteStatus=='RUNNING') {
if(row.taskExecuteStatus=='NEW') {
actions.push('<a class="btn btn-info btn-xs ' + startFlag + '" href="javascript:void(0)" onclick="startTask(\''+row.id+'\')"><i class="fa fa-hourglass-start"></i>开始</a> ');
}
if(row.taskExecuteStatus=='PROCESSING') {
if(row.taskExecuteStatus=='RUNNING') {
actions.push('<a class="btn btn-success btn-xs ' + handleFlag + '" href="javascript:void(0)" onclick="$.operate.handle(\'' + row.id + '\')"><i class="fa fa-edit"></i>处理</a>');
}
return actions.join('');
@ -234,7 +244,6 @@
search.taskNo = $("#myTaskNo").val();
search.taskStatus = $("#myTaskStatus").val();
return search;
}
@ -251,7 +260,6 @@
onExpandRow : function(index, row, $detail) {
initChildTable(index, row, $detail);
},
modalName: "我创建",
columns: [{
checkbox: true
@ -263,22 +271,25 @@
},
{
field: 'taskName',
title: '任务名称'
title: '任务名称',
formatter: function(value, row, index) {
return $.table.tooltip(value);
}
},
{
field: 'taskContent',
title: '任务内容',
formatter: function(value, row, index) {
return row.taskContent.substring(0,20)+"...";
return $.table.tooltip(value);
}
},
/* {
{
field: 'taskStatus',
title: '任务状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(taskStatusDatas, value);
}
},*/
},
{
field: 'taskType',
title: '任务类型',
@ -286,10 +297,6 @@
return $.table.selectDictLabel(taskTypeDatas, value);
}
},
{
field: 'taskSource',
title: '任务来源'
},
{
title: '操作',
align: 'center',
@ -297,7 +304,7 @@
var actions = [];
actions.push('<a class="btn btn-info btn-xs " href="javascript:void(0)" onclick="$.operate.detail(\'' + row.taskNo + '\')"><i class="fa fa-eye"></i>详情</a> ');
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.taskNo + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.taskNo + '\')"><i class="fa fa-remove"></i>删除</a>');
/* actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.taskNo + '\')"><i class="fa fa-remove"></i>删除</a>');*/
return actions.join('');
}
}]

View File

@ -4,258 +4,258 @@
<th:block th:include="include :: header('修改用户头像')" />
<th:block th:include="include :: cropper-css" />
<style type='text/css'>
/* avator css start */
.container {
margin: 10px 5px 5px 5px;
}
.action {
padding: 5px 0px;
}
.cropped {
width: 200px;
border: 1px #ddd solid;
box-shadow: 0px 0px 12px #ddd;
}
.img-preview {
border-radius: 50%;
box-shadow: 0px 0px 12px #7e7e7e;
display: inline-block;
}
.preview-box {
text-align: center;
margin: 0px auto;
margin-top: 10px;
color: #bbb;
}
.preview-md {
width: 128px;
height: 128px;
}
.preview-sm {
width: 96px;
height: 96px;
}
.preview-xs {
width: 64px;
height: 64px;
}
.imageBox {
border: 1px solid #aaa;
overflow: hidden;
cursor: move;
box-shadow: 4px 4px 12px #B0B0B0;
margin: 0px auto;
}
.btn-custom {
float: right;
width: 46px;
display: inline-block;
margin-bottom: 10px;
height: 37px;
line-height: 37px;
font-size: 14px;
color: #FFFFFF;
margin: 0px 2px;
background-color: #f38e81;
border-radius: 3px;
text-decoration: none;
cursor: pointer;
box-shadow: 0px 0px 5px #B0B0B0;
border: 0px #fff solid;
}
/*选择文件上传*/
.new-contentarea {
width: 165px;
overflow: hidden;
margin: 0 auto;
position: relative;
float: left;
}
.new-contentarea label {
width: 100%;
height: 100%;
display: block;
}
.new-contentarea input[type=file] {
width: 188px;
height: 60px;
background: #333;
margin: 0 auto;
position: absolute;
right: 50%;
margin-right: -94px;
top: 0;
right/*\**/: 0px\9;
margin-right/*\**/: 0px\9;
width/*\**/: 10px\9;
opacity: 0;
filter: alpha(opacity=0);
z-index: 2;
}
a.upload-img {
width: 165px;
display: inline-block;
margin-bottom: 10px;
height: 37px;
line-height: 37px;
font-size: 14px;
color: #FFFFFF;
background-color: #f38e81;
border-radius: 3px;
text-decoration: none;
cursor: pointer;
border: 0px #fff solid;
box-shadow: 0px 0px 5px #B0B0B0;
}
a.upload-img:hover {
background-color: #ec7e70;
}
.tc {
text-align: center;
}
/* avator css end */
/* avator css start */
.container {
margin: 10px 5px 5px 5px;
}
.action {
padding: 5px 0px;
}
.cropped {
width: 200px;
border: 1px #ddd solid;
box-shadow: 0px 0px 12px #ddd;
}
.img-preview {
border-radius: 50%;
box-shadow: 0px 0px 12px #7e7e7e;
display: inline-block;
}
.preview-box {
text-align: center;
margin: 0px auto;
margin-top: 10px;
color: #bbb;
}
.preview-md {
width: 128px;
height: 128px;
}
.preview-sm {
width: 96px;
height: 96px;
}
.preview-xs {
width: 64px;
height: 64px;
}
.imageBox {
border: 1px solid #aaa;
overflow: hidden;
cursor: move;
box-shadow: 4px 4px 12px #B0B0B0;
margin: 0px auto;
}
.btn-custom {
float: right;
width: 46px;
display: inline-block;
margin-bottom: 10px;
height: 37px;
line-height: 37px;
font-size: 14px;
color: #FFFFFF;
margin: 0px 2px;
background-color: #f38e81;
border-radius: 3px;
text-decoration: none;
cursor: pointer;
box-shadow: 0px 0px 5px #B0B0B0;
border: 0px #fff solid;
}
/*选择文件上传*/
.new-contentarea {
width: 165px;
overflow: hidden;
margin: 0 auto;
position: relative;
float: left;
}
.new-contentarea label {
width: 100%;
height: 100%;
display: block;
}
.new-contentarea input[type=file] {
width: 188px;
height: 60px;
background: #333;
margin: 0 auto;
position: absolute;
right: 50%;
margin-right: -94px;
top: 0;
right/*\**/: 0px\9;
margin-right/*\**/: 0px\9;
width/*\**/: 10px\9;
opacity: 0;
filter: alpha(opacity=0);
z-index: 2;
}
a.upload-img {
width: 165px;
display: inline-block;
margin-bottom: 10px;
height: 37px;
line-height: 37px;
font-size: 14px;
color: #FFFFFF;
background-color: #f38e81;
border-radius: 3px;
text-decoration: none;
cursor: pointer;
border: 0px #fff solid;
box-shadow: 0px 0px 5px #B0B0B0;
}
a.upload-img:hover {
background-color: #ec7e70;
}
.tc {
text-align: center;
}
/* avator css end */
</style>
</head>
<body class="white-bg">
<div class="row container">
<div class="col-md-10">
<div class="imageBox">
<img id="avatar" th:src="(${#strings.isEmpty(user.avatar)}) ? @{/img/profile.jpg} : @{${user.avatar}}" th:onerror="'this.src=\'' + @{'/img/profile.jpg'} + '\''">
<div class="row container">
<div class="col-md-10">
<div class="imageBox">
<img id="avatar" th:src="(${#strings.isEmpty(user.avatar)}) ? @{/img/profile.jpg} : @{${user.avatar}}" th:onerror="'this.src=\'' + @{'/img/profile.jpg'} + '\''">
</div>
<div class="action">
<div class="new-contentarea tc">
<a href="javascript:void(0)" class="upload-img"><label for="inputImage">上传图像</label> </a>
<input type="file" name="avatar" id="inputImage" accept="image/*"/>
</div>
<button type="button" class="btn-custom" data-method="zoom" data-option="0.1"><i class="fa fa-search-plus"></i></button>
<button type="button" class="btn-custom" data-method="zoom" data-option="-0.1"><i class="fa fa-search-minus"></i></button>
<button type="button" class="btn-custom" data-method="rotate" data-option="-45"><i class="fa fa-rotate-left"></i></button>
<button type="button" class="btn-custom" data-method="rotate" data-option="45"><i class="fa fa-rotate-right"></i></button>
<button type="button" class="btn-custom" data-method="scaleX" data-option="-1"><i class="fa fa-arrows-h"></i></button>
<button type="button" class="btn-custom" data-method="scaleY" data-option="-1"><i class="fa fa-arrows-v"></i></button>
<button type="button" class="btn-custom" data-method="reset"><i class="fa fa-refresh"></i></button>
</div>
</div>
<div class="action">
<div class="new-contentarea tc">
<a href="javascript:void(0)" class="upload-img"><label for="inputImage">上传图像</label> </a>
<input type="file" name="avatar" id="inputImage" accept="image/*"/>
</div>
<button type="button" class="btn-custom" data-method="zoom" data-option="0.1"><i class="fa fa-search-plus"></i></button>
<button type="button" class="btn-custom" data-method="zoom" data-option="-0.1"><i class="fa fa-search-minus"></i></button>
<button type="button" class="btn-custom" data-method="rotate" data-option="-45"><i class="fa fa-rotate-left"></i></button>
<button type="button" class="btn-custom" data-method="rotate" data-option="45"><i class="fa fa-rotate-right"></i></button>
<button type="button" class="btn-custom" data-method="scaleX" data-option="-1"><i class="fa fa-arrows-h"></i></button>
<button type="button" class="btn-custom" data-method="scaleY" data-option="-1"><i class="fa fa-arrows-v"></i></button>
<button type="button" class="btn-custom" data-method="reset"><i class="fa fa-refresh"></i></button>
</div>
</div>
<div class="col-md-2">
<div class="cropped">
<div class="preview-box">
<div class="img-preview preview-xs"></div>
</div>
<div class="preview-box">
<div class="img-preview preview-sm"></div>
</div>
<div class="preview-box">
<div class="img-preview preview-md"></div>
<div class="col-md-2">
<div class="cropped">
<div class="preview-box">
<div class="img-preview preview-xs"></div>
</div>
<div class="preview-box">
<div class="img-preview preview-sm"></div>
</div>
<div class="preview-box">
<div class="img-preview preview-md"></div>
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: cropper-js" />
<script type="text/javascript">
var cropper;
var croppable = false;
$(window).load(function() {
var image = document.getElementById('avatar');
cropper = new Cropper(image, {
aspectRatio: 1,
viewMode: 1,
autoCropArea: 0.9,
preview: '.img-preview',
ready: function () {
croppable = true;
}
})
var cropper;
var croppable = false;
$(window).on('load', function() {
var image = document.getElementById('avatar');
cropper = new Cropper(image, {
aspectRatio: 1,
viewMode: 1,
autoCropArea: 0.9,
preview: '.img-preview',
ready: function () {
croppable = true;
}
})
$('#inputImage').on('change', function() {
var reader = new FileReader();
var file = $('#inputImage')[0].files[0];
if (/^image\/\w+$/.test(file.type)) {
reader.onload = function(e) {
if(croppable){
cropper.replace(e.target.result)
}
}
reader.readAsDataURL(this.files[0]);
} else {
$.modal.alertWarning('请选择一个图片文件。');
}
});
$('#inputImage').on('change', function() {
var reader = new FileReader();
var file = $('#inputImage')[0].files[0];
if (/^image\/\w+$/.test(file.type)) {
reader.onload = function(e) {
if(croppable){
cropper.replace(e.target.result)
}
}
reader.readAsDataURL(this.files[0]);
} else {
$.modal.alertWarning('请选择一个图片文件。');
}
});
$('.btn-custom').on('click',function (e) {
if (!croppable) {
$.modal.alertWarning("裁剪框加载中,请稍后...");
return;
}
var data = {
method: $(this).data('method'),
option: $(this).data('option') || undefined,
};
var result = cropper[data.method](data.option, data.secondOption);
if(['scaleX','scaleY'].indexOf(data.method) !== -1){
$(this).data('option', -data.option)
$('.btn-custom').on('click',function (e) {
if (!croppable) {
$.modal.alertWarning("裁剪框加载中,请稍候...");
return;
}
var data = {
method: $(this).data('method'),
option: $(this).data('option') || undefined,
};
var result = cropper[data.method](data.option, data.secondOption);
if(['scaleX','scaleY'].indexOf(data.method) !== -1){
$(this).data('option', -data.option)
}
})
});
function submitHandler() {
if (!croppable) {
$.modal.alertWarning("裁剪框加载中,请稍候...");
return
}
cropper.getCroppedCanvas().toBlob(function(img) {
var formdata = new FormData();
formdata.append("avatarfile", img);
$.ajax({
url: ctx + "system/user/profile/updateAvatar",
data: formdata,
type: "post",
processData: false,
contentType: false,
success: function(result) {
$.operate.saveReload(result);
}
})
});
}
function submitHandler() {
if (!croppable) {
$.modal.alertWarning("裁剪框加载中,请稍后...");
return
}
cropper.getCroppedCanvas().toBlob(function(img) {
var formdata = new FormData();
formdata.append("avatarfile", img);
$.ajax({
url: ctx + "system/user/profile/updateAvatar",
data: formdata,
type: "post",
processData: false,
contentType: false,
success: function(result) {
$.operate.saveSuccess(result);
$(window).resize(function() {
$('.imageBox').height($(window).height() - 80);
$('.cropped').height($(window).height() - 40);
}).resize();
if (!HTMLCanvasElement.prototype.toBlob) {
Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {
value: function(callback, type, quality) {
var canvas = this;
setTimeout(function() {
var binStr = atob(canvas.toDataURL(type, quality).split(',')[1]);
var len = binStr.length;
var arr = new Uint8Array(len);
for (var i = 0; i < len; i++) {
arr[i] = binStr.charCodeAt(i);
}
})
});
}
$(window).resize(function() {
$('.imageBox').height($(window).height() - 80);
$('.cropped').height($(window).height() - 40);
}).resize();
if (!HTMLCanvasElement.prototype.toBlob) {
Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {
value: function(callback, type, quality) {
var canvas = this;
setTimeout(function() {
var binStr = atob(canvas.toDataURL(type, quality).split(',')[1]);
var len = binStr.length;
var arr = new Uint8Array(len);
for (var i = 0; i < len; i++) {
arr[i] = binStr.charCodeAt(i);
}
callback(new Blob([arr], {
type: type || 'image/png'
}));
});
}
});
}
callback(new Blob([arr], {
type: type || 'image/png'
}));
});
}
});
}
</script>
</body>
</html>

View File

@ -1,9 +1,14 @@
package com.snow.common.annotation;
import com.snow.common.utils.poi.ExcelHandlerAdapter;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.IndexedColors;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.math.BigDecimal;
/**
* 自定义导出Excel数据注解
@ -45,9 +50,14 @@ public @interface Excel
public String separator() default ",";
/**
* 导出类型0数字 1字符串
* BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
*/
public ColumnType cellType() default ColumnType.STRING;
public int scale() default -1;
/**
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
*/
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
/**
* 导出时在excel中每个列的高度 单位为字符
@ -89,6 +99,36 @@ public @interface Excel
*/
public String targetAttr() default "";
/**
* 是否自动统计数据,在最后追加一行统计数据总和
*/
public boolean isStatistics() default false;
/**
* 导出类型0数字 1字符串
*/
public ColumnType cellType() default ColumnType.STRING;
/**
* 导出字体颜色
*/
public IndexedColors color() default IndexedColors.BLACK;
/**
* 导出字段对齐方式
*/
public HorizontalAlignment align() default HorizontalAlignment.CENTER;
/**
* 自定义数据处理器
*/
public Class<?> handler() default ExcelHandlerAdapter.class;
/**
* 自定义数据处理器参数
*/
public String[] args() default {};
/**
* 字段类型0导出导入1仅导出2仅导入
*/
@ -112,7 +152,7 @@ public @interface Excel
public enum ColumnType
{
NUMERIC(0), STRING(1);
NUMERIC(0), STRING(1), IMAGE(2);
private final int value;
ColumnType(int value)

View File

@ -1,4 +1,4 @@
package com.snow.system.domain;
package com.snow.common.core.domain;
import javax.validation.constraints.*;
import org.apache.commons.lang3.builder.ToStringBuilder;

View File

@ -1,4 +1,4 @@
package com.snow.system.domain;
package com.snow.common.core.domain;
import javax.validation.constraints.*;
import org.apache.commons.lang3.builder.ToStringBuilder;

View File

@ -9,15 +9,11 @@ package com.snow.common.enums;
public enum DingFlowTaskType {
NEW("NEW", "未启动"),
RUNNING("RUNNING", "处理"),
RUNNING("RUNNING", "处理"),
PAUSED("PAUSED", "暂停"),
CANCELED("CANCELED", "取消"),
COMPLETED("COMPLETED", "完成"),
TERMINATED("TERMINATED", "终止"),
//20211015
PROCESSING("PROCESSING","处理中")
;
private final String code;

View File

@ -25,7 +25,7 @@ public enum MessageEventType {
INNER_SYS_TODO_TASK("INNER_SYS_TODO_TASK", "站内信系统任务待办"),
INNER_SYS_TASK_COMPLETE("INNER_SYS_TASK_COMPLETE", "站内信系统任务待办"),
INNER_SYS_TASK_COMPLETE("INNER_SYS_TASK_COMPLETE", "站内信系统任务完成"),
;

View File

@ -3,7 +3,7 @@ package com.snow.common.enums;
/**
* email搜索类型
*/
public enum SysEmailSearchType {
public enum SysEmailType {
COMMON(0, "common"),
INBOX(6, "inbox"),
@ -15,7 +15,7 @@ public enum SysEmailSearchType {
private final Integer code;
private final String info;
SysEmailSearchType(Integer code, String info)
SysEmailType(Integer code, String info)
{
this.code = code;
this.info = info;

View File

@ -3,6 +3,7 @@ package com.snow.common.utils;
import java.lang.management.ManagementFactory;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.*;
import java.util.Date;
import org.apache.commons.lang3.time.DateFormatUtils;
@ -159,5 +160,22 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
return day + "" + hour + "小时" + min + "分钟";
}
/**
* 增加 LocalDateTime ==> Date
*/
public static Date toDate(LocalDateTime temporalAccessor)
{
ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault());
return Date.from(zdt.toInstant());
}
/**
* 增加 LocalDate ==> Date
*/
public static Date toDate(LocalDate temporalAccessor)
{
LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0));
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
return Date.from(zdt.toInstant());
}
}

View File

@ -1,11 +1,11 @@
package com.snow.system.utils;
package com.snow.common.utils;
import java.util.List;
import org.springframework.stereotype.Component;
import com.snow.common.constant.Constants;
import com.snow.common.utils.CacheUtils;
import com.snow.common.utils.StringUtils;
import com.snow.system.domain.SysDictData;
import com.snow.common.core.domain.SysDictData;
/**
* 字典工具类
@ -22,7 +22,7 @@ public class DictUtils
/**
* 设置字典缓存
*
*
* @param key 参数键
* @param dictDatas 字典数据列表
*/
@ -33,7 +33,7 @@ public class DictUtils
/**
* 获取字典缓存
*
*
* @param key 参数键
* @return dictDatas 字典数据列表
*/
@ -42,15 +42,14 @@ public class DictUtils
Object cacheObj = CacheUtils.get(getCacheName(), getCacheKey(key));
if (StringUtils.isNotNull(cacheObj))
{
List<SysDictData> DictDatas = StringUtils.cast(cacheObj);
return DictDatas;
return StringUtils.cast(cacheObj);
}
return null;
}
/**
* 根据字典类型和字典值获取字典标签
*
*
* @param dictType 字典类型
* @param dictValue 字典值
* @return 字典标签
@ -62,7 +61,7 @@ public class DictUtils
/**
* 根据字典类型和字典标签获取字典值
*
*
* @param dictType 字典类型
* @param dictLabel 字典标签
* @return 字典值
@ -74,7 +73,7 @@ public class DictUtils
/**
* 根据字典类型和字典值获取字典标签
*
*
* @param dictType 字典类型
* @param dictValue 字典值
* @param separator 分隔符
@ -93,7 +92,7 @@ public class DictUtils
{
if (value.equals(dict.getDictValue()))
{
propertyString.append(dict.getDictLabel() + separator);
propertyString.append(dict.getDictLabel()).append(separator);
break;
}
}
@ -114,7 +113,7 @@ public class DictUtils
/**
* 根据字典类型和字典标签获取字典值
*
*
* @param dictType 字典类型
* @param dictLabel 字典标签
* @param separator 分隔符
@ -133,7 +132,7 @@ public class DictUtils
{
if (label.equals(dict.getDictLabel()))
{
propertyString.append(dict.getDictValue() + separator);
propertyString.append(dict.getDictValue()).append(separator);
break;
}
}
@ -152,6 +151,16 @@ public class DictUtils
return StringUtils.stripEnd(propertyString.toString(), separator);
}
/**
* 删除指定字典缓存
*
* @param key 字典键
*/
public static void removeDictCache(String key)
{
CacheUtils.remove(getCacheName(), getCacheKey(key));
}
/**
* 清空字典缓存
*/
@ -162,7 +171,7 @@ public class DictUtils
/**
* 获取cache name
*
*
* @return 缓存名
*/
public static String getCacheName()
@ -172,7 +181,7 @@ public class DictUtils
/**
* 设置cache key
*
*
* @param configKey 参数键
* @return 缓存键key
*/

View File

@ -132,7 +132,7 @@ public class FileUploadUtils
* @return
* @throws IOException
*/
private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
public static File getAbsoluteFile(String uploadDir, String fileName) throws IOException
{
File desc = new File(uploadDir + File.separator + fileName);
@ -146,7 +146,7 @@ public class FileUploadUtils
return desc;
}
private static final String getPathFileName(String uploadDir, String fileName) throws IOException
public static final String getPathFileName(String uploadDir, String fileName) throws IOException
{
int dirLastIndex = defaultBaseDir.length() + 1;
String currentDir = StringUtils.substring(uploadDir, dirLastIndex);

View File

@ -1,14 +1,14 @@
package com.snow.common.utils.file;
import com.snow.common.config.Global;
import com.snow.common.utils.DateUtils;
import com.snow.common.utils.uuid.IdUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.io.*;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import javax.servlet.http.HttpServletRequest;
@ -19,66 +19,46 @@ import javax.servlet.http.HttpServletResponse;
*
* @author snow
*/
public class FileUtils extends org.apache.commons.io.FileUtils
{
public class FileUtils extends org.apache.commons.io.FileUtils {
public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
/**
* 输出指定文件的byte数组
*
* @param filePath 文件路径
* @param os 输出流
* @return
* 写数据到文件中
*
* @param data 数据
* @return 目标文件
* @throws IOException IO异常
*/
public static void writeBytes(String filePath, OutputStream os) throws IOException
public static String writeImportBytes(byte[] data) throws IOException
{
FileInputStream fis = null;
try
{
File file = new File(filePath);
if (!file.exists())
{
throw new FileNotFoundException(filePath);
}
fis = new FileInputStream(file);
byte[] b = new byte[1024];
int length;
while ((length = fis.read(b)) > 0)
{
os.write(b, 0, length);
}
}
catch (IOException e)
{
throw e;
}
finally
{
if (os != null)
{
try
{
os.close();
}
catch (IOException e1)
{
e1.printStackTrace();
}
}
if (fis != null)
{
try
{
fis.close();
}
catch (IOException e1)
{
e1.printStackTrace();
}
}
}
return writeBytes(data, Global.getDownloadPath());
}
/**
* 写数据到文件中
*
* @param data 数据
* @param uploadDir 目标文件
* @return 目标文件
* @throws IOException IO异常
*/
public static String writeBytes(byte[] data, String uploadDir) throws IOException
{
FileOutputStream fos = null;
String pathName = "";
try {
String extension = getFileExtendName(data);
pathName = DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + extension;
File file = FileUploadUtils.getAbsoluteFile(uploadDir, pathName);
fos = new FileOutputStream(file);
fos.write(data);
} finally {
IOUtils.closeQuietly(fos);
}
return FileUploadUtils.getPathFileName(uploadDir, pathName);
}
/**
* 删除文件
*
@ -205,4 +185,105 @@ public class FileUtils extends org.apache.commons.io.FileUtils
String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString());
return encode.replaceAll("\\+", "%20");
}
/**
* 输出指定文件的byte数组
*
* @param filePath 文件路径
* @param os 输出流
* @return
*/
public static void writeBytes(String filePath, OutputStream os) throws IOException
{
FileInputStream fis = null;
try
{
File file = new File(filePath);
if (!file.exists())
{
throw new FileNotFoundException(filePath);
}
fis = new FileInputStream(file);
byte[] b = new byte[1024];
int length;
while ((length = fis.read(b)) > 0)
{
os.write(b, 0, length);
}
}
catch (IOException e)
{
throw e;
}
finally
{
IOUtils.closeQuietly(os);
IOUtils.closeQuietly(fis);
}
}
/**
* 获取图像后缀
*
* @param photoByte 图像数据
* @return 后缀名
*/
public static String getFileExtendName(byte[] photoByte)
{
String strFileExtendName = "jpg";
if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56)
&& ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97))
{
strFileExtendName = "gif";
}
else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70))
{
strFileExtendName = "jpg";
}
else if ((photoByte[0] == 66) && (photoByte[1] == 77))
{
strFileExtendName = "bmp";
}
else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71))
{
strFileExtendName = "png";
}
return strFileExtendName;
}
/**
* 获取文件名称 /profile/upload/2022/04/16/ruoyi.png -- ruoyi.png
*
* @param fileName 路径名称
* @return 没有文件路径的名称
*/
public static String getName(String fileName)
{
if (fileName == null)
{
return null;
}
int lastUnixPos = fileName.lastIndexOf('/');
int lastWindowsPos = fileName.lastIndexOf('\\');
int index = Math.max(lastUnixPos, lastWindowsPos);
return fileName.substring(index + 1);
}
/**
* 获取不带后缀文件名称 /profile/upload/2022/04/16/ruoyi.png -- ruoyi
*
* @param fileName 路径名称
* @return 没有文件路径和后缀的名称
*/
public static String getNameNotSuffix(String fileName)
{
if (fileName == null)
{
return null;
}
String baseName = FilenameUtils.getBaseName(fileName);
return baseName;
}
}

View File

@ -0,0 +1,86 @@
package com.snow.common.utils.file;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.util.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.Arrays;
/**
* 图片处理工具类
*
* @author ruoyi
*/
@Slf4j
public class ImageUtils
{
public static byte[] getImage(String imagePath)
{
InputStream is = getFile(imagePath);
try
{
return IOUtils.toByteArray(is);
}
catch (Exception e)
{
log.error("图片加载异常 {}", e);
return null;
}
finally
{
IOUtils.closeQuietly(is);
}
}
public static InputStream getFile(String imagePath)
{
try
{
byte[] result = readFile(imagePath);
result = Arrays.copyOf(result, result.length);
return new ByteArrayInputStream(result);
}
catch (Exception e)
{
log.error("获取图片异常 {}", e);
}
return null;
}
/**
* 读取文件为字节数据
*
* @param url 地址
* @return 字节数据
*/
public static byte[] readFile(String url)
{
InputStream in = null;
try
{
// 网络地址
URL urlObj = new URL(url);
URLConnection urlConnection = urlObj.openConnection();
urlConnection.setConnectTimeout(30 * 1000);
urlConnection.setReadTimeout(60 * 1000);
urlConnection.setDoInput(true);
in = urlConnection.getInputStream();
return IOUtils.toByteArray(in);
}
catch (Exception e)
{
log.error("访问文件异常 {}", e);
return null;
}
finally
{
IOUtils.closeQuietly(in);
}
}
}

View File

@ -0,0 +1,19 @@
package com.snow.common.utils.poi;
/**
* Excel数据格式处理适配器
*
* @author ruoyi
*/
public interface ExcelHandlerAdapter
{
/**
* 格式化
*
* @param value 单元格数据值
* @param args excel注解args参数组
*
* @return 处理后的值
*/
Object format(Object value, String[] args);
}

View File

@ -42,9 +42,5 @@
<artifactId>dingtalk</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,6 +1,7 @@
package com.snow.dingtalk.listener;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.aliyun.dingtalktodo_1_0.models.GetTodoTaskBySourceIdResponseBody;
import com.snow.common.enums.DingTalkListenerType;
@ -36,9 +37,9 @@ public class WorkRecodeEventService implements ISyncDingTalkInfo {
Integer code = eventType.getCode();
//钉钉创建待办
if(code.equals(DingTalkListenerType.WORK_RECODE_CREATE.getCode())){
SysOaTask sysOaTask=(SysOaTask)syncEvent.getSource();
String sysOaTask=(String)syncEvent.getSource();
log.info("@@创建钉钉待办系统传入的参数:{}",JSON.toJSONString(sysOaTask));
workRecodeService.createTodoTask(sysOaTask);
workRecodeService.createTodoTask(JSONUtil.toBean(sysOaTask,SysOaTask.class));
}
//更新钉钉待办
if(code.equals(DingTalkListenerType.WORK_RECORD_UPDATE.getCode())){
@ -55,12 +56,12 @@ public class WorkRecodeEventService implements ISyncDingTalkInfo {
//更新任务状态
if(code.equals(DingTalkListenerType.UPDATE_TODO_TASK_EXECUTOR_STATUS.getCode())){
SysOaTaskDistribute sysOaTaskDistribute=(SysOaTaskDistribute)syncEvent.getSource();
GetTodoTaskBySourceIdResponseBody body = workRecodeService.getTodoTaskByBusinessId(String.valueOf(sysOaTaskDistribute.getId()));
GetTodoTaskBySourceIdResponseBody body = workRecodeService.getTodoTaskByBusinessId(String.valueOf(sysOaTaskDistribute.getTaskNo()));
boolean isComplete=false;
if(ObjectUtil.isNotNull(sysOaTaskDistribute.getTaskCompleteTime())){
isComplete=true;
}
workRecodeService.updateTodoTaskExecutorStatus(body.getId(),isComplete);
workRecodeService.updateTodoTaskExecutorStatus(Long.parseLong(sysOaTaskDistribute.getTaskExecuteId()),body.getId(),isComplete);
}
//钉钉发送普通消息
if(code.equals(DingTalkListenerType.ASYNCSEND_V2.getCode())){

View File

@ -4,6 +4,8 @@ import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.model.AuthToken;
import java.io.Serializable;
import java.util.List;
@ -18,7 +20,7 @@ import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class AttendanceListRecordRequest implements Serializable {
public class AttendanceListRecordRequest extends SnowDingTalkDefaultRequest implements Serializable {
private static final long serialVersionUID = -6492475769072358528L;
/**

View File

@ -18,7 +18,7 @@ import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class AttendanceListRequest implements Serializable {
public class AttendanceListRequest extends SnowDingTalkDefaultRequest implements Serializable {
private static final long serialVersionUID = 1746815839189321601L;
/**
* 员工在企业内的userid列表最多不能超过50个

View File

@ -17,7 +17,7 @@ import java.io.Serializable;
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class AttendanceRecordUploadRequest implements Serializable {
public class AttendanceRecordUploadRequest extends SnowDingTalkDefaultRequest implements Serializable {
private static final long serialVersionUID = -583239968246465341L;

View File

@ -0,0 +1,61 @@
package com.snow.dingtalk.model.request;
import com.alibaba.fastjson.JSON;
import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.request.OapiGettokenRequest;
import com.dingtalk.api.response.OapiGettokenResponse;
import com.snow.common.constant.CacheConstants;
import com.snow.common.constant.Constants;
import com.snow.common.exception.SyncDataException;
import com.snow.common.utils.CacheUtils;
import com.snow.dingtalk.common.BaseConstantUrl;
import com.taobao.api.ApiException;
import com.taobao.api.TaobaoRequest;
import com.taobao.api.TaobaoResponse;
/**
* @author qimingjin
* @Title:
* @Description:
* @date 2022/3/15 13:25
*/
public abstract class SnowDingTalkDefaultRequest implements SnowDingTalkRequest{
/**
* 请求钉钉接口
* @param request 请求对象
* @param url 请求钉钉接口url路径
* @param <T> 具体请求参数泛型
* @return 请求返回的参数对象
* @throws ApiException
*/
@Override
public <T extends TaobaoResponse> T execute(TaobaoRequest<T> request,String url) throws ApiException{
DefaultDingTalkClient client = new DefaultDingTalkClient(url);
return client.execute(request,this.getAccessToken());
}
/**
* 获取token
* @return 返回token
*/
@Override
public String getAccessToken() {
DefaultDingTalkClient client = new DefaultDingTalkClient(BaseConstantUrl.GET_TOKEN_URL);
OapiGettokenRequest request = new OapiGettokenRequest();
request.setAppkey(CacheUtils.getSysConfig(CacheConstants.ENTERPRICE_APP_KEY).toString());
request.setAppsecret(CacheUtils.getSysConfig(CacheConstants.ENTERPRICE_APP_SECRET).toString());
request.setHttpMethod(Constants.GET);
try {
OapiGettokenResponse response = client.execute(request);
if(response.getErrcode()==0){
return response.getAccessToken();
}else {
throw new SyncDataException(JSON.toJSONString(request),response.getErrmsg());
}
} catch (ApiException e) {
throw new SyncDataException(JSON.toJSONString(request),e.getMessage());
}
}
}

View File

@ -0,0 +1,24 @@
package com.snow.dingtalk.model.request;
import com.snow.common.exception.DingTalkApiException;
import com.taobao.api.ApiException;
import com.taobao.api.TaobaoRequest;
import com.taobao.api.TaobaoResponse;
/**
* @author qimingjin
* @Title: 系统钉钉请求对象接口
* @Description:
* @date 2022/3/15 13:21
*/
public interface SnowDingTalkRequest {
default String getAccessToken() {
throw new DingTalkApiException("调用钉钉接口获取token异常");
}
default <T extends TaobaoResponse> T execute(TaobaoRequest<T> request,String url) throws ApiException {
throw new DingTalkApiException("调用钉钉接口异常");
}
}

View File

@ -52,7 +52,7 @@ public interface WorkRecodeService {
* @param status 是否
* @return
*/
Boolean updateTodoTaskExecutorStatus(String taskId,Boolean status);
Boolean updateTodoTaskExecutorStatus(Long userId,String taskId,Boolean status);
/**
* 根据业务id获取待办详情()

View File

@ -3,8 +3,6 @@ package com.snow.dingtalk.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSON;
import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiAttendanceListRecordRequest;
import com.dingtalk.api.request.OapiAttendanceListRequest;
import com.dingtalk.api.request.OapiAttendanceRecordUploadRequest;
@ -15,7 +13,6 @@ import com.snow.common.annotation.DingTalkLog;
import com.snow.common.enums.DingTalkLogType;
import com.snow.common.exception.SyncDataException;
import com.snow.dingtalk.common.BaseConstantUrl;
import com.snow.dingtalk.common.BaseService;
import com.snow.dingtalk.model.request.AttendanceListRecordRequest;
import com.snow.dingtalk.model.request.AttendanceListRequest;
import com.snow.dingtalk.model.request.AttendanceRecordUploadRequest;
@ -36,7 +33,7 @@ import java.util.List;
*/
@Slf4j
@Service
public class AttendanceServiceImpl extends BaseService implements AttendanceService {
public class AttendanceServiceImpl implements AttendanceService {
/**
* 获取考勤记录
@ -46,12 +43,11 @@ public class AttendanceServiceImpl extends BaseService implements AttendanceServ
@Override
@DingTalkLog(dingTalkLogType=DingTalkLogType.ATTENDANCE_RECORD_LIST,dingTalkUrl =BaseConstantUrl.ATTENDANCE_RECORD_LIST)
public AttendanceListResponse getAttendanceList(AttendanceListRequest attendanceListRequest) {
DingTalkClient client = new DefaultDingTalkClient(BaseConstantUrl.ATTENDANCE_RECORD_LIST);
OapiAttendanceListRequest req = BeanUtil.copyProperties(attendanceListRequest, OapiAttendanceListRequest.class);
req.setIsI18n(false);
OapiAttendanceListResponse rsp = null;
try {
rsp = client.execute(req, getDingTalkToken());
rsp = attendanceListRequest.execute(req, BaseConstantUrl.ATTENDANCE_RECORD_LIST);
if(rsp.getErrcode()!=0){
log.error("@@获取考勤记录信息返回异常:{}",rsp.getErrmsg());
throw new SyncDataException(JSON.toJSONString(req),rsp.getErrmsg());
@ -69,12 +65,11 @@ public class AttendanceServiceImpl extends BaseService implements AttendanceServ
@Override
@DingTalkLog(dingTalkLogType=DingTalkLogType.ATTENDANCE_RECORD_RECORD,dingTalkUrl =BaseConstantUrl.ATTENDANCE_RECORD_RECORD)
public List<AttendanceListRecordResponse> getAttendanceRecord(AttendanceListRecordRequest attendanceListRecordRequest) {
DingTalkClient client = new DefaultDingTalkClient(BaseConstantUrl.ATTENDANCE_RECORD_RECORD);
OapiAttendanceListRecordRequest req = BeanUtil.copyProperties(attendanceListRecordRequest, OapiAttendanceListRecordRequest.class);
req.setIsI18n(false);
OapiAttendanceListRecordResponse rsp =null;
try {
rsp = client.execute(req, getDingTalkToken());
rsp = attendanceListRecordRequest.execute(req,BaseConstantUrl.ATTENDANCE_RECORD_RECORD);
if(rsp.getErrcode()!=0){
log.error("@@获取考勤记录信息详情返回异常:{}",rsp.getErrmsg());
throw new SyncDataException(JSON.toJSONString(req),rsp.getErrmsg());
@ -89,12 +84,12 @@ public class AttendanceServiceImpl extends BaseService implements AttendanceServ
@Override
@DingTalkLog(dingTalkLogType=DingTalkLogType.UPLOAD_ATTENDANCE_RECORD,dingTalkUrl =BaseConstantUrl.ATTENDANCE_RECORD_UPLOAD)
public String uploadAttendanceRecord(AttendanceRecordUploadRequest attendanceRecordUploadRequest) {
DingTalkClient client = new DefaultDingTalkClient(BaseConstantUrl.ATTENDANCE_RECORD_UPLOAD);
OapiAttendanceRecordUploadRequest req = BeanUtil.copyProperties(attendanceRecordUploadRequest, OapiAttendanceRecordUploadRequest.class);
req.setUserid(attendanceRecordUploadRequest.getDingUserId());
OapiAttendanceRecordUploadResponse rsp = null;
try {
rsp = client.execute(req, getDingTalkToken());
rsp = attendanceRecordUploadRequest.execute(req, BaseConstantUrl.ATTENDANCE_RECORD_UPLOAD);
if(rsp.getErrcode()!=0){
log.error("@@上传考勤记录信息返回异常:{}",rsp.getErrmsg());
throw new SyncDataException(JSON.toJSONString(req),rsp.getErrmsg());

View File

@ -1,7 +1,9 @@
package com.snow.dingtalk.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.aliyun.dingtalktodo_1_0.Client;
import com.aliyun.dingtalktodo_1_0.models.*;
@ -28,9 +30,7 @@ import com.snow.dingtalk.service.UserService;
import com.snow.dingtalk.service.WorkRecodeService;
import com.snow.framework.util.ShiroUtils;
import com.snow.system.domain.SysOaTask;
import com.snow.system.service.ISysMessageTemplateService;
import com.snow.system.service.ISysUserService;
import com.snow.system.service.impl.SysConfigServiceImpl;
import com.snow.system.domain.SysOaTaskDistribute;
import com.taobao.api.ApiException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
@ -51,14 +51,9 @@ import java.util.stream.Collectors;
@Service
public class WorkRecodeServiceImpl extends BaseService implements WorkRecodeService {
private SysConfigServiceImpl isysConfigService=SpringUtils.getBean(SysConfigServiceImpl.class);
private ISysMessageTemplateService sysMessageTemplateService=SpringUtils.getBean(ISysMessageTemplateService.class);
private UserService userService=SpringUtils.getBean(UserService.class);
private ISysUserService sysUserService=SpringUtils.getBean(ISysUserService.class);
/**
* 创建工作待办
@ -120,6 +115,7 @@ public class WorkRecodeServiceImpl extends BaseService implements WorkRecodeServ
}
try {
CreateTodoTaskResponse response = createTodoClient().createTodoTaskWithOptions(userService.getUnionIdBySysUserId(Long.parseLong(sysOaTask.getCreateBy())), createTodoTaskRequest, createTodoTaskHeaders, new RuntimeOptions());
log.info("@@创建钉钉待办返回参数:{}", JSONUtil.toJsonStr(response));
return response.getBody().id;
} catch (Exception err) {
log.error("@@调用钉钉创建待办的时候出现异常,异常信息为:{}",err.getMessage());
@ -150,21 +146,23 @@ public class WorkRecodeServiceImpl extends BaseService implements WorkRecodeServ
updateTodoTaskHeaders.xAcsDingtalkAccessToken = getDingTalkTokenV2();
UpdateTodoTaskRequest updateTodoTaskRequest = new UpdateTodoTaskRequest()
.setSubject(sysOaTask.getTaskName())
.setDescription(sysOaTask.getTaskContent())
.setExecutorIds(Arrays.asList(
""
));
//设置是否完成
if(ObjectUtil.isNotNull(sysOaTask.getTaskCompleteTime())){
updateTodoTaskRequest.setDone(true);
}else {
updateTodoTaskRequest.setDone(false);
.setDescription(sysOaTask.getTaskContent());
List<String> taskDistributeId = sysOaTask.getTaskDistributeId();
//执行者id
if(CollUtil.isNotEmpty(taskDistributeId)){
List<String> executorIds = taskDistributeId.stream().map(t -> {
return userService.getUnionIdBySysUserId(Long.parseLong(t));
}).collect(Collectors.toList());
updateTodoTaskRequest.setExecutorIds(executorIds);
}
//设置是否完成
updateTodoTaskRequest.setDone(ObjectUtil.isNotNull(sysOaTask.getTaskCompleteTime()));
if(ObjectUtil.isNotNull(sysOaTask.getExpectedTime())){
updateTodoTaskRequest.setDueTime(sysOaTask.getExpectedTime().getTime());
}
try {
UpdateTodoTaskResponse updateTodoTaskResponse = createTodoClient().updateTodoTaskWithOptions(userService.getUnionIdBySysUserId(Long.parseLong(sysOaTask.getUpdateBy())), sysOaTask.getDingTaskId(), updateTodoTaskRequest, updateTodoTaskHeaders, new RuntimeOptions());
String unionId=userService.getUnionIdBySysUserId(Long.parseLong(sysOaTask.getUpdateBy()));
UpdateTodoTaskResponse updateTodoTaskResponse = createTodoClient().updateTodoTaskWithOptions(unionId, sysOaTask.getTaskOutsideId(), updateTodoTaskRequest, updateTodoTaskHeaders, new RuntimeOptions());
return updateTodoTaskResponse.getBody().result;
}catch (Exception err) {
log.error("@@调用钉钉更新待办的时候出现异常,异常信息为:{}",err.getMessage());
@ -173,18 +171,17 @@ public class WorkRecodeServiceImpl extends BaseService implements WorkRecodeServ
}
@Override
public Boolean updateTodoTaskExecutorStatus(String taskId,Boolean status) {
public Boolean updateTodoTaskExecutorStatus(Long userId,String taskId,Boolean status) {
String unionId= userService.getUnionIdBySysUserId(userId);
UpdateTodoTaskExecutorStatusHeaders updateTodoTaskExecutorStatusHeaders = new UpdateTodoTaskExecutorStatusHeaders();
updateTodoTaskExecutorStatusHeaders.xAcsDingtalkAccessToken = getDingTalkTokenV2();
UpdateTodoTaskExecutorStatusRequest.UpdateTodoTaskExecutorStatusRequestExecutorStatusList executorStatusList0 = new UpdateTodoTaskExecutorStatusRequest.UpdateTodoTaskExecutorStatusRequestExecutorStatusList()
.setId(taskId)
.setId(unionId)
.setIsDone(status);
UpdateTodoTaskExecutorStatusRequest updateTodoTaskExecutorStatusRequest = new UpdateTodoTaskExecutorStatusRequest()
.setExecutorStatusList(Arrays.asList(
executorStatusList0
));
.setExecutorStatusList(CollUtil.newArrayList(executorStatusList0));
try {
UpdateTodoTaskExecutorStatusResponse response = createTodoClient().updateTodoTaskExecutorStatusWithOptions("PUoiinWIpa2yH2ymhiiGiP6g", taskId, updateTodoTaskExecutorStatusRequest, updateTodoTaskExecutorStatusHeaders, new RuntimeOptions());
UpdateTodoTaskExecutorStatusResponse response = createTodoClient().updateTodoTaskExecutorStatusWithOptions(unionId, taskId, updateTodoTaskExecutorStatusRequest, updateTodoTaskExecutorStatusHeaders, new RuntimeOptions());
return response.getBody().result;
} catch (Exception err) {
log.error("@@调用钉钉更新办状态的时候出现异常,异常信息为:{}",err.getMessage());

View File

@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.snow.common.constant.MessageConstants;
import com.snow.common.core.domain.MessageEventRequest;
import com.snow.common.core.domain.ProcessEventRequest;
import com.snow.common.enums.MessageEventType;
import com.snow.common.enums.ProcessStatus;
@ -13,7 +14,6 @@ import com.snow.flowable.common.constants.FlowConstants;
import com.snow.flowable.common.enums.FlowDefEnum;
import com.snow.flowable.common.enums.FlowTypeEnum;
import com.snow.flowable.service.FlowableService;
import com.snow.common.core.domain.MessageEventRequest;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;

View File

@ -13,7 +13,9 @@ import org.springframework.stereotype.Service;
* @author: 没用的阿吉
* @create: 2021-01-10 20:05
**/
@Service("purManagerFlowListener")
//@Service("purManagerFlowListener")
@Service("saleManagerFlowListener")
@Slf4j
public class PurchaseManagerFlowListener extends AbstractExecutionListener<PurchaseOrderForm> {
@ -24,6 +26,7 @@ public class PurchaseManagerFlowListener extends AbstractExecutionListener<Purch
//设置参数(应该在任务节点设置参数)
setVariable("totalPrice",appForms.getTotalPrice());
setVariable("price",1000);
setVariable("tRate",1000);
}
}

View File

@ -3,7 +3,6 @@ package com.snow.flowable.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.BetweenFormater;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;

View File

@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.snow.common.constant.UserConstants;
import com.snow.common.core.text.Convert;
import com.snow.common.utils.StringUtils;
import com.snow.flowable.service.FlowableUserService;
import com.snow.system.domain.FlowGroupDO;

View File

@ -53,14 +53,14 @@ public class StorageService {
String fileName = file.getOriginalFilename();
String contentType = file.getContentType();
long size = file.getSize();
String key = generateKey(fileName);
String key = IdUtil.fastSimpleUUID();
storage.store(key,file);
String url = generateUrl(key);
SysFile storageInfo = new SysFile();
storageInfo.setName(fileName);
storageInfo.setSize(size);
storageInfo.setType(contentType);
storageInfo.setKey(key.substring(0,key.indexOf(",")));
storageInfo.setKey(key);
storageInfo.setUrl(url);
storageInfo.setCreateBy(ShiroUtils.getLoginName());
sysFileService.insertSysFile(storageInfo);
@ -68,17 +68,6 @@ public class StorageService {
return storageInfo;
}
private String generateKey(String originalFilename) {
int index = originalFilename.lastIndexOf('.');
String suffix;
if(index==-1){
suffix="profile";
}else {
suffix = originalFilename.substring(index);
}
return IdUtil.fastSimpleUUID() + suffix;
}
public Stream<Path> loadAll() {
return storage.loadAll();
}

View File

@ -3,7 +3,7 @@ package com.snow.framework.web.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.snow.system.domain.SysDictData;
import com.snow.common.core.domain.SysDictData;
import com.snow.system.service.ISysDictDataService;
import com.snow.system.service.ISysDictTypeService;

View File

@ -1,5 +1,6 @@
package com.snow.framework.web.service;
import cn.hutool.core.collection.CollUtil;
import com.snow.common.constant.Constants;
import com.snow.framework.util.ShiroUtils;
import com.snow.system.domain.SysNewsNode;
@ -55,7 +56,9 @@ public class NewsTriggerService {
SysNewsNode sysNewsNodes=new SysNewsNode();
sysNewsNodes.setNewsNodeKey(parentNodeKey);
List<SysNewsNode> sysNewsNodeList = sysNewsNodeService.selectSysNewsNodeList(sysNewsNodes);
if(CollUtil.isEmpty(sysNewsNodeList)){
return false;
}
SysNewsNode sysNewsNode = sysNewsNodeService.selectSysNewsNodeByKey(nodeKey,sysNewsNodeList.get(0).getId().longValue());
if(null == sysNewsNode){
return false;

View File

@ -1,17 +1,5 @@
package com.snow.quartz.controller;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.snow.common.annotation.Log;
import com.snow.common.core.controller.BaseController;
import com.snow.common.core.domain.AjaxResult;
@ -22,6 +10,15 @@ import com.snow.common.utils.poi.ExcelUtil;
import com.snow.quartz.domain.SysJob;
import com.snow.quartz.service.ISysJobService;
import com.snow.quartz.util.CronUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 调度任务信息操作处理

View File

@ -49,7 +49,7 @@ public class SyncSysDingTask {
SysOaTask upSysOaTask=new SysOaTask();
upSysOaTask.setTaskNo(t.getTaskNo());
upSysOaTask.setTaskStatus(TaskStatus.FINISH.getCode());
sysOaTaskService.updateSysOaTask(upSysOaTask);
sysOaTaskService.updateById(upSysOaTask);
}
});
}

View File

@ -1,30 +1,26 @@
package com.snow.system.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.snow.common.annotation.Excel;
import com.snow.common.core.domain.BaseEntity;
import com.snow.system.handler.JsonStringListTypeHandler;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.snow.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.snow.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 邮件对象 sys_oa_email
*
* @author 没用的阿吉
* @date 2021-03-12
*/
@Data
public class SysOaEmail extends BaseEntity
{
private static final long serialVersionUID = 1L;
public class SysOaEmail extends BaseEntity implements Serializable {
/** id */
private Long id;
private static final long serialVersionUID = 8790267868126534635L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private List idList;
/** 邮件编号 */
@Excel(name = "邮件编号")
private String emailNo;
@ -37,57 +33,38 @@ public class SysOaEmail extends BaseEntity
@Excel(name = "邮件内容")
private String emailContent;
private String emailTo;
/**
* 收件人
*/
private List<SysUser> emailToUser;
/**
* 发件人邮件
*/
private SysUser emailFromUser;
/** 发送时间 */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "发送时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date sendTime;
/** 邮件类型0--发1-收) */
@Excel(name = "邮件类型", readConverterExp = "0=--发1-收")
private Long emailType;
/** 邮件状态0--普通邮件1-草稿2--已发送3--重要邮件4--已删除 */
@Excel(name = "邮件状态", readConverterExp = "0=--普通邮件1-草稿2--已发送3--重要邮件4--已删除")
private Long emailStatus;
/** 邮件状态0--普通邮件1-草稿2--已发送3--重要邮件4--垃圾箱) */
@Excel(name = "邮件状态", readConverterExp = "0=--普通邮件1-草稿2--已发送3--重要邮件4--垃圾箱")
private Integer emailStatus;
/** 邮件标签 */
@Excel(name = "邮件标签")
private Long emailLabel;
private Integer emailLabel;
@Excel(name = "邮件接收人")
@TableField(typeHandler= JsonStringListTypeHandler.class)
private List<String> emailToUser;
/** 所属人id */
@Excel(name = "所属人id")
private String belongUserId;
private SysUser belongUser;
/** 删除标识0--正常1--删除) */
@Excel(name = "删除标识", readConverterExp = "0=--正常1--删除")
@TableLogic
private Long isDelete;
/** 附件 */
@Excel(name = "附件")
private String fileUrl;
/**
* 查询类型
*/
private Integer mailSearchType;
private List emailNoList;
/**
*花费时间
*/
private String spendTime;
private SysMessageTransition sysMessageTransition;
}

View File

@ -53,7 +53,7 @@ public class SysOaEmailDO extends BaseEntity
private Long emailType;
/** 邮件状态0--普通邮件1-草稿2--已发送3--重要邮件4--已删除) */
private Long emailStatus;
private Integer emailStatus;
/** 邮件标签 */
private Long emailLabel;

View File

@ -0,0 +1,92 @@
package com.snow.system.domain;
import java.util.Date;
import java.util.List;
import com.snow.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.snow.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 邮件对象 sys_oa_email
*
* @author 没用的阿吉
* @date 2021-03-12
*/
@Data
public class SysOaEmailDTO extends BaseEntity {
private static final long serialVersionUID = 1L;
/** id */
private Long id;
private List idList;
/** 邮件编号 */
@Excel(name = "邮件编号")
private String emailNo;
/** 邮件主题 */
@Excel(name = "邮件主题")
private String emailSubject;
/** 邮件内容 */
@Excel(name = "邮件内容")
private String emailContent;
private String emailTo;
/**
* 收件人
*/
private List<SysUser> emailToUser;
/**
* 发件人邮件
*/
private SysUser emailFromUser;
/** 发送时间 */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "发送时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date sendTime;
/** 邮件类型0--发1-收) */
private Long emailType;
/** 邮件状态0--普通邮件1-草稿2--已发送3--重要邮件4--已删除) */
@Excel(name = "邮件状态", readConverterExp = "0=--普通邮件1-草稿2--已发送3--重要邮件4--已删除")
private Long emailStatus;
/** 邮件标签 */
@Excel(name = "邮件标签")
private Long emailLabel;
/** 所属人id */
private String belongUserId;
private SysUser belongUser;
/** 删除标识0--正常1--删除) */
private Long isDelete;
/** 附件 */
private String fileUrl;
/**
* 查询类型
*/
private Integer mailSearchType;
private List emailNoList;
/**
*花费时间
*/
private String spendTime;
private SysMessageTransition sysMessageTransition;
}

View File

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.snow.common.core.domain.BaseEntity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@ -14,24 +15,37 @@ import java.util.List;
* @date 2021-03-12
*/
@Data
public class SysOaEmailVO
{
public class SysOaEmailVO implements Serializable {
private static final long serialVersionUID = 1L;
/** id */
/**
* id
*
*/
private Long id;
private List idList;
/** 邮件编号 */
/**
* id集合
*/
private List<Integer> idList;
/**
* 邮件编号
*/
private String emailNo;
/** 邮件主题 */
/**
* 邮件主题
*
*/
private String emailSubject;
/** 邮件内容 */
/**
* 邮件内容
*/
private String emailContent;
private String emailTo;
/**
* 收件人
@ -68,7 +82,6 @@ public class SysOaEmailVO
/** 附件 */
private String fileUrl;
/**
* 查询类型
*/

View File

@ -1,5 +1,9 @@
package com.snow.system.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.snow.common.annotation.Excel;
import com.snow.common.core.domain.BaseEntity;
@ -20,12 +24,10 @@ public class SysOaTask extends BaseEntity
private static final long serialVersionUID = 1L;
/** 任务编号 */
@TableId(type = IdType.NONE)
@Excel(name = "任务编号")
private String taskNo;
/**
* 钉钉待办taskId
*/
private String dingTaskId;
/** 任务名称 */
@Excel(name = "任务名称")
@ -35,26 +37,29 @@ public class SysOaTask extends BaseEntity
@Excel(name = "任务内容")
private String taskContent;
@Excel(name = "紧急程度")
@Excel(name = "紧急程度",dictType = "sys_oa_task_priority")
private Integer priority;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "任务期望完成时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expectedTime;
/** 任务状态(详见数据字典) */
@Excel(name = "任务状态", readConverterExp = "详=见数据字典")
@Excel(name = "任务状态", readConverterExp = "un_finish=执行中,finish=结束")
private String taskStatus;
/** 任务类型(详见数据字典) */
@Excel(name = "任务类型", readConverterExp = "详=见数据字典")
@Excel(name = "任务类型", dictType = "sys_task_type")
private String taskType;
/** 任务来源 */
@Excel(name = "任务来源")
private String taskSource;
/** 任务外部id */
@Excel(name = "任务外部id")
@Excel(name = "任务状态", readConverterExp = "0=不同步,1=同步")
private Integer syncDingtalk;
/** 任务外部id即钉钉id*/
private String taskOutsideId;
/** 任务跳转URL */
@ -62,21 +67,23 @@ public class SysOaTask extends BaseEntity
private String taskUrl;
/** 任务分配人 */
@Excel(name = "任务分配人")
@Excel(name = "任务执行人")
@TableField(exist = false)
private List<String> taskDistributeId;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(exist = false)
private Date taskCompleteTime;
/** 乐观锁 */
@Excel(name = "乐观锁")
private Long revision;
/** 删除标识 */
@Excel(name = "删除标识")
@TableLogic
private Long isDelete;
@TableField(exist = false)
private List<SysOaTaskDistribute> sysOaTaskDistributeList;
}

View File

@ -1,5 +1,9 @@
package com.snow.system.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.snow.common.annotation.Excel;
import com.snow.common.core.domain.BaseEntity;
@ -20,6 +24,7 @@ public class SysOaTaskDistribute extends BaseEntity
private static final long serialVersionUID = 1L;
/** 主键ID */
@TableId(type = IdType.AUTO)
private Long id;
/** 任务编号 */
@ -38,6 +43,7 @@ public class SysOaTaskDistribute extends BaseEntity
@Excel(name = "任务执行状态")
private String taskExecuteStatus;
@TableField(exist = false)
private List<String> taskExecuteStatusList;
/** 任务完成时间 */
@ -65,16 +71,19 @@ public class SysOaTaskDistribute extends BaseEntity
/** 删除标识 */
@Excel(name = "删除标识")
@TableLogic
private Long isDelete;
/**
* 任务花费时间
*/
@TableField(exist = false)
private String spendTime;
/**
* 任务主表
*/
@TableField(exist = false)
private SysOaTask sysOaTask;
}

View File

@ -44,7 +44,6 @@ public class SysUser extends BaseEntity
/** 用户名称 */
@Excel(name = "用户名称")
@Sensitive(type = SensitiveTypeEnum.CHINESE_NAME)
private String userName;
/** 用户类型 */
@ -52,7 +51,6 @@ public class SysUser extends BaseEntity
/** 用户邮箱 */
@Excel(name = "用户邮箱")
@Sensitive(type=SensitiveTypeEnum.EMAIL)
private String email;
/** 手机号码 */

View File

@ -10,6 +10,8 @@ import org.springframework.context.ApplicationEvent;
*/
public class SyncEvent<T> extends ApplicationEvent {
private static final long serialVersionUID = 2315510470385496950L;
private Integer eventType;
private T t;

View File

@ -1,4 +1,4 @@
package com.snow.framework.config;
package com.snow.system.handler;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;

View File

@ -1,4 +1,4 @@
package com.snow.framework.config;
package com.snow.system.handler;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;

View File

@ -2,7 +2,7 @@ package com.snow.system.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.snow.system.domain.SysDictData;
import com.snow.common.core.domain.SysDictData;
/**
* 字典表 数据层

View File

@ -1,7 +1,7 @@
package com.snow.system.mapper;
import java.util.List;
import com.snow.system.domain.SysDictType;
import com.snow.common.core.domain.SysDictType;
/**
* 字典表 数据层

View File

@ -1,7 +1,10 @@
package com.snow.system.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.snow.system.domain.SysOaEmail;
import com.snow.system.domain.SysOaEmailDTO;
import com.snow.system.domain.SysOaEmailDO;
import com.snow.system.domain.SysOaEmailVO;
@ -11,18 +14,17 @@ import com.snow.system.domain.SysOaEmailVO;
* @author 没用的阿吉
* @date 2021-03-12
*/
public interface SysOaEmailMapper
{
public interface SysOaEmailMapper extends BaseMapper<SysOaEmail> {
/**
* 查询邮件
*
* @param id 邮件ID
* @return 邮件
*/
public SysOaEmail selectSysOaEmailById(Long id);
public SysOaEmailDTO selectSysOaEmailById(Long id);
public SysOaEmail selectSysOaEmailByEmailNo(String emailNo);
public SysOaEmailDTO selectSysOaEmailByEmailNo(String emailNo);
/**
* 查询邮件列表
@ -30,7 +32,7 @@ public interface SysOaEmailMapper
* @param sysOaEmail 邮件
* @return 邮件集合
*/
public List<SysOaEmail> selectSysOaEmailList(SysOaEmail sysOaEmail);
public List<SysOaEmailDTO> selectSysOaEmailList(SysOaEmailDTO sysOaEmail);
/**
@ -47,7 +49,7 @@ public interface SysOaEmailMapper
* @param sysOaEmail 邮件
* @return 结果
*/
public int insertSysOaEmail(SysOaEmail sysOaEmail);
public int insertSysOaEmail(SysOaEmailDTO sysOaEmail);
/**
* 修改邮件
@ -55,14 +57,14 @@ public interface SysOaEmailMapper
* @param sysOaEmail 邮件
* @return 结果
*/
public int updateSysOaEmail(SysOaEmail sysOaEmail);
public int updateSysOaEmail(SysOaEmailDTO sysOaEmail);
/**
*
* @param sysOaEmail
* @return
*/
public int updateSysOaEmailByEmailNo(SysOaEmail sysOaEmail);
public int updateSysOaEmailByEmailNo(SysOaEmailDTO sysOaEmail);
/**
* 删除邮件

View File

@ -1,6 +1,6 @@
package com.snow.system.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.snow.system.domain.SysOaTaskDistribute;
/**
@ -9,61 +9,5 @@ import com.snow.system.domain.SysOaTaskDistribute;
* @author 没用的阿吉
* @date 2021-08-15
*/
public interface SysOaTaskDistributeMapper
{
/**
* 查询任务分配
*
* @param id 任务分配ID
* @return 任务分配
*/
public SysOaTaskDistribute selectSysOaTaskDistributeById(Long id);
/**
* 根据任务编号查询
* @param taskNo 任务编号
* @return 任务分配
*/
List<SysOaTaskDistribute> selectSysOaTaskDistributeByTaskNo(String taskNo);
/**
* 查询任务分配列表
*
* @param sysOaTaskDistribute 任务分配
* @return 任务分配集合
*/
public List<SysOaTaskDistribute> selectSysOaTaskDistributeList(SysOaTaskDistribute sysOaTaskDistribute);
/**
* 新增任务分配
*
* @param sysOaTaskDistribute 任务分配
* @return 结果
*/
public int insertSysOaTaskDistribute(SysOaTaskDistribute sysOaTaskDistribute);
/**
* 修改任务分配
*
* @param sysOaTaskDistribute 任务分配
* @return 结果
*/
public int updateSysOaTaskDistribute(SysOaTaskDistribute sysOaTaskDistribute);
/**
* 删除任务分配
*
* @param id 任务分配ID
* @return 结果
*/
public int deleteSysOaTaskDistributeById(Long id);
/**
* 批量删除任务分配
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSysOaTaskDistributeByIds(String[] ids);
public interface SysOaTaskDistributeMapper extends BaseMapper<SysOaTaskDistribute> {
}

View File

@ -1,6 +1,8 @@
package com.snow.system.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.snow.system.domain.SysOaTask;
/**
@ -9,8 +11,7 @@ import com.snow.system.domain.SysOaTask;
* @author 没用的阿吉
* @date 2021-07-29
*/
public interface SysOaTaskMapper
{
public interface SysOaTaskMapper extends BaseMapper<SysOaTask> {
/**
* 查询系统任务
*

View File

@ -43,6 +43,14 @@ public interface SysUserMapper
*/
public List<SysUser> selectUserListByRoleIds(@Param("roleIds") List<Long> roleIds);
/**
*
* @param ids
* @return
*/
List<SysUser> selectUserByIds(Long[] ids);
/**
* 根据条件分页查询未分配用户角色列表
*

View File

@ -1,7 +1,7 @@
package com.snow.system.service;
import java.util.List;
import com.snow.system.domain.SysDictData;
import com.snow.common.core.domain.SysDictData;
/**
* 字典 业务层

View File

@ -2,8 +2,8 @@ package com.snow.system.service;
import java.util.List;
import com.snow.common.core.domain.Ztree;
import com.snow.system.domain.SysDictData;
import com.snow.system.domain.SysDictType;
import com.snow.common.core.domain.SysDictData;
import com.snow.common.core.domain.SysDictType;
/**
* 字典 业务层

View File

@ -20,6 +20,11 @@ public interface ISysMessageTransitionService
public SysMessageTransition selectSysMessageTransitionById(Long id);
/**
* 获取消息是否已读
* @param sysMessageTransition
* @return
*/
public Boolean getIsRead(SysMessageTransition sysMessageTransition);
/**
@ -72,6 +77,11 @@ public interface ISysMessageTransitionService
public int deleteSysMessageTransitionById(Long id);
/**
* 删除消息
* @param outsideIdList
* @return
*/
public int deleteSysMessageTransitionByOutsideId(List outsideIdList);

View File

@ -1,7 +1,10 @@
package com.snow.system.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.snow.system.domain.SysOaEmail;
import com.snow.system.domain.SysOaEmailDTO;
import com.snow.system.domain.SysOaEmailDO;
import com.snow.system.domain.SysOaEmailVO;
@ -11,17 +14,16 @@ import com.snow.system.domain.SysOaEmailVO;
* @author 没用的阿吉
* @date 2021-03-12
*/
public interface ISysOaEmailService
{
public interface ISysOaEmailService extends IService<SysOaEmail> {
/**
* 查询邮件
*
* @param id 邮件ID
* @return 邮件
*/
public SysOaEmail selectSysOaEmailById(Long id);
public SysOaEmailDTO selectSysOaEmailById(Long id);
public SysOaEmail selectSysOaEmailByEmailNo(String emailNo);
public SysOaEmailDTO selectSysOaEmailByEmailNo(String emailNo);
/**
@ -29,7 +31,7 @@ public interface ISysOaEmailService
* @param userId
* @return
*/
public List<SysOaEmail> getMyNoReadOaEmailList(String userId);
public List<SysOaEmailDTO> getMyNoReadOaEmailList(String userId);
/**
* 查询邮件列表
@ -37,8 +39,7 @@ public interface ISysOaEmailService
* @param sysOaEmail 邮件
* @return 邮件集合
*/
@Deprecated
public List<SysOaEmail> selectSysOaEmailList(SysOaEmail sysOaEmail);
public List<SysOaEmailDTO> selectSysOaEmailList(SysOaEmailDTO sysOaEmail);
/**
@ -48,13 +49,7 @@ public interface ISysOaEmailService
*/
public List<SysOaEmailVO> selectEmailList(SysOaEmailDO sysOaEmailDO);
/**
* 新增邮件
*
* @param sysOaEmail 邮件
* @return 结果
*/
public int insertSysOaEmail(SysOaEmail sysOaEmail);
/**
* 修改邮件
@ -62,7 +57,7 @@ public interface ISysOaEmailService
* @param sysOaEmail 邮件
* @return 结果
*/
public int updateSysOaEmail(SysOaEmail sysOaEmail);
public int updateSysOaEmail(SysOaEmailDTO sysOaEmail);
/**
* 批量删除邮件
@ -87,5 +82,5 @@ public interface ISysOaEmailService
* @param sysOaEmail
* @return
*/
public int updateSysOaEmailByEmailNo(SysOaEmail sysOaEmail);
public int updateSysOaEmailByEmailNo(SysOaEmailDTO sysOaEmail);
}

View File

@ -1,6 +1,9 @@
package com.snow.system.service;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.snow.system.domain.SysOaTaskDistribute;
/**
@ -9,7 +12,7 @@ import com.snow.system.domain.SysOaTaskDistribute;
* @author 没用的阿吉
* @date 2021-08-15
*/
public interface ISysOaTaskDistributeService
public interface ISysOaTaskDistributeService extends IService<SysOaTaskDistribute>
{
/**
* 查询任务分配
@ -17,7 +20,7 @@ public interface ISysOaTaskDistributeService
* @param id 任务分配ID
* @return 任务分配
*/
public SysOaTaskDistribute selectSysOaTaskDistributeById(Long id);
SysOaTaskDistribute selectSysOaTaskDistributeById(Long id);
/**
* 查询任务分配列表
@ -25,37 +28,16 @@ public interface ISysOaTaskDistributeService
* @param sysOaTaskDistribute 任务分配
* @return 任务分配集合
*/
public List<SysOaTaskDistribute> selectSysOaTaskDistributeList(SysOaTaskDistribute sysOaTaskDistribute);
List<SysOaTaskDistribute> selectSysOaTaskDistributeList(SysOaTaskDistribute sysOaTaskDistribute);
/**
* 新增任务分配
*
* 获取我处理的和我待处理任务
* @param sysOaTaskDistribute 任务分配
* @return 结果
*/
public int insertSysOaTaskDistribute(SysOaTaskDistribute sysOaTaskDistribute);
List<SysOaTaskDistribute> getSysOaTaskDistribute(SysOaTaskDistribute sysOaTaskDistribute);
/**
* 修改任务分配
*
* @param sysOaTaskDistribute 任务分配
* @return 结果
*/
public int updateSysOaTaskDistribute(SysOaTaskDistribute sysOaTaskDistribute);
void warpSysOaTask(List<SysOaTaskDistribute> sysOaTaskDistributes);
/**
* 批量删除任务分配
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSysOaTaskDistributeByIds(String ids);
/**
* 删除任务分配信息
*
* @param id 任务分配ID
* @return 结果
*/
public int deleteSysOaTaskDistributeById(Long id);
}

View File

@ -1,6 +1,8 @@
package com.snow.system.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.snow.system.domain.SysOaTask;
/**
@ -9,15 +11,14 @@ import com.snow.system.domain.SysOaTask;
* @author 没用的阿吉
* @date 2021-07-29
*/
public interface ISysOaTaskService
{
public interface ISysOaTaskService extends IService<SysOaTask> {
/**
* 查询系统任务
*
* @param taskNo 系统任务ID
* @return 系统任务
*/
public SysOaTask selectSysOaTaskById(String taskNo);
SysOaTask selectSysOaTaskById(String taskNo);
/**
* 查询系统任务列表
@ -25,7 +26,7 @@ public interface ISysOaTaskService
* @param sysOaTask 系统任务
* @return 系统任务集合
*/
public List<SysOaTask> selectSysOaTaskList(SysOaTask sysOaTask);
List<SysOaTask> selectSysOaTaskList(SysOaTask sysOaTask);
/**
* 新增系统任务
@ -33,29 +34,13 @@ public interface ISysOaTaskService
* @param sysOaTask 系统任务
* @return 结果
*/
public int insertSysOaTask(SysOaTask sysOaTask);
SysOaTask insertSysOaTask(SysOaTask sysOaTask);
/**
* 修改系统任务
*
* @param sysOaTask 系统任务
* @return 结果
* 根据任务编号获取三方id
* @param taskNo 任务id
* @return
*/
public int updateSysOaTask(SysOaTask sysOaTask);
/**
* 批量删除系统任务
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSysOaTaskByIds(String ids);
/**
* 删除系统任务信息
*
* @param taskNo 系统任务ID
* @return 结果
*/
public int deleteSysOaTaskById(String taskNo);
String getOutTaskOutsideId(String taskNo);
}

View File

@ -76,6 +76,14 @@ public interface ISysUserService
*/
public SysUser selectUserById(Long userId);
/**
* 通过用户ID查询用户
*
* @param userIds 用户ID
* @return 用户对象信息
*/
public List<SysUser> selectUserByIds(Long[] userIds);
/**
* 通过用户dingUserId查询用户
* @param dingUserId

View File

@ -9,7 +9,6 @@ import com.snow.common.enums.DingTalkListenerType;
import com.snow.common.utils.DateUtils;
import com.snow.common.utils.StringUtils;
import com.snow.system.domain.DingtalkCallBackEvent;
import com.snow.system.domain.SysDictData;
import com.snow.system.event.SyncEvent;
import com.snow.system.mapper.DingtalkCallBackEventMapper;
import org.springframework.beans.BeanUtils;

View File

@ -2,11 +2,11 @@ package com.snow.system.service.impl;
import java.util.List;
import com.snow.system.utils.DictUtils;
import com.snow.common.utils.DictUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.snow.common.core.text.Convert;
import com.snow.system.domain.SysDictData;
import com.snow.common.core.domain.SysDictData;
import com.snow.system.mapper.SysDictDataMapper;
import com.snow.system.service.ISysDictDataService;

View File

@ -4,8 +4,8 @@ import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import com.snow.system.domain.SysDictType;
import com.snow.system.utils.DictUtils;
import com.snow.common.core.domain.SysDictType;
import com.snow.common.utils.DictUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -14,7 +14,7 @@ import com.snow.common.core.domain.Ztree;
import com.snow.common.core.text.Convert;
import com.snow.common.exception.BusinessException;
import com.snow.common.utils.StringUtils;
import com.snow.system.domain.SysDictData;
import com.snow.common.core.domain.SysDictData;
import com.snow.system.mapper.SysDictDataMapper;
import com.snow.system.mapper.SysDictTypeMapper;
import com.snow.system.service.ISysDictTypeService;

View File

@ -1,17 +1,17 @@
package com.snow.system.service.impl;
import java.util.List;
import java.util.Optional;
import cn.hutool.core.date.BetweenFormater;
import cn.hutool.core.date.DateUtil;
import com.snow.common.core.text.Convert;
import com.snow.common.utils.StringUtils;
import com.snow.system.domain.SysDingProcinst;
import com.snow.system.mapper.SysDingProcinstMapper;
import com.snow.system.service.ISysDingProcinstService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.snow.system.mapper.SysDingProcinstMapper;
import com.snow.system.domain.SysDingProcinst;
import com.snow.system.service.ISysDingProcinstService;
import com.snow.common.core.text.Convert;
import java.util.List;
import java.util.Optional;
/**
* 钉钉流程实例Service业务层处理

View File

@ -42,7 +42,12 @@ public class SysMessageTransitionServiceImpl implements ISysMessageTransitionSer
@Override
public SysMessageTransition selectSysMessageTransitionById(Long id)
{
return sysMessageTransitionMapper.selectSysMessageTransitionById(id);
SysMessageTransition sysMessageTransition = sysMessageTransitionMapper.selectSysMessageTransitionById(id);
sysMessageTransition.setProducerUser(sysUserService.selectUserById(Long.parseLong(sysMessageTransition.getProducerId())));
sysMessageTransition.setConsumerUser(sysUserService.selectUserById(Long.parseLong(sysMessageTransition.getConsumerId())));
sysMessageTransition.setSpendTime(DateUtil.formatBetween(sysMessageTransition.getCreateTime(), new Date(), BetweenFormater.Level.SECOND)+"");
Optional.ofNullable(sysMessageTransition.getTemplateCode()).ifPresent( m-> sysMessageTransition.setSysMessageTemplate(sysMessageTemplateService.getSysMessageTemplateByCode(sysMessageTransition.getTemplateCode())));
return sysMessageTransition;
}

View File

@ -1,22 +1,24 @@
package com.snow.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.BetweenFormater;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.snow.common.core.text.Convert;
import com.snow.common.enums.MessageEventType;
import com.snow.common.utils.DateUtils;
import com.snow.system.domain.SysMessageTransition;
import com.snow.system.domain.SysOaEmail;
import com.snow.system.domain.SysOaEmailDO;
import com.snow.system.domain.SysOaEmailVO;
import com.snow.common.utils.bean.BeanUtils;
import com.snow.system.domain.*;
import com.snow.system.mapper.SysOaEmailMapper;
import com.snow.system.service.ISysOaEmailService;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@ -27,8 +29,7 @@ import java.util.stream.Collectors;
* @date 2021-03-12
*/
@Service
public class SysOaEmailServiceImpl implements ISysOaEmailService
{
public class SysOaEmailServiceImpl extends ServiceImpl<SysOaEmailMapper, SysOaEmail> implements ISysOaEmailService {
@Autowired
private SysOaEmailMapper sysOaEmailMapper;
@ -47,24 +48,27 @@ public class SysOaEmailServiceImpl implements ISysOaEmailService
* @return 邮件
*/
@Override
public SysOaEmail selectSysOaEmailById(Long id)
{
SysOaEmail sysOaEmail=sysOaEmailMapper.selectSysOaEmailById(id);
sysOaEmail.setBelongUser(sysUserService.selectUserById(Long.parseLong(sysOaEmail.getBelongUserId())));
return sysOaEmail;
public SysOaEmailDTO selectSysOaEmailById(Long id) {
SysOaEmail sysOaEmail=this.getById(id);
SysOaEmailDTO sysOaEmailDTO= BeanUtil.copyProperties(sysOaEmail,SysOaEmailDTO.class);
sysOaEmailDTO.setBelongUser(sysUserService.selectUserById(Long.parseLong(sysOaEmail.getBelongUserId())));
return sysOaEmailDTO;
}
@Override
public SysOaEmail selectSysOaEmailByEmailNo(String emailNo) {
SysOaEmail sysOaEmail=sysOaEmailMapper.selectSysOaEmailByEmailNo(emailNo);
sysOaEmail.setBelongUser(sysUserService.selectUserById(Long.parseLong(sysOaEmail.getBelongUserId())));
return sysOaEmail;
public SysOaEmailDTO selectSysOaEmailByEmailNo(String emailNo) {
LambdaQueryWrapper<SysOaEmail> eq = new LambdaQueryWrapper<SysOaEmail>()
.eq(SysOaEmail::getEmailSubject, emailNo);
SysOaEmail sysOaEmail = this.getOne(eq);
SysOaEmailDTO sysOaEmailDTO= BeanUtil.copyProperties(sysOaEmail,SysOaEmailDTO.class);
sysOaEmailDTO.setBelongUser(sysUserService.selectUserById(Long.parseLong(sysOaEmail.getBelongUserId())));
return sysOaEmailDTO;
}
@Override
public List<SysOaEmail> getMyNoReadOaEmailList(String userId){
List<SysOaEmail> sysOaEmailList=new ArrayList<>();
public List<SysOaEmailDTO> getMyNoReadOaEmailList(String userId){
List<SysOaEmailDTO> sysOaEmailList=new ArrayList<>();
SysMessageTransition sysMessageTransition=new SysMessageTransition();
sysMessageTransition.setConsumerId(userId);
sysMessageTransition.setMessageType(MessageEventType.SEND_EMAIL.getCode());
@ -73,7 +77,7 @@ public class SysOaEmailServiceImpl implements ISysOaEmailService
List<SysMessageTransition> sysMessageTransitions = sysMessageTransitionService.selectSysMessageTransitionList(sysMessageTransition);
if(CollUtil.isNotEmpty(sysMessageTransitions)){
List<String> emailNoList = sysMessageTransitions.stream().map(SysMessageTransition::getMessageOutsideId).collect(Collectors.toList());
SysOaEmail sysOaEmail=new SysOaEmail();
SysOaEmailDTO sysOaEmail=new SysOaEmailDTO();
sysOaEmail.setEmailNoList(emailNoList);
sysOaEmailList = selectSysOaEmailList(sysOaEmail);
}
@ -86,54 +90,47 @@ public class SysOaEmailServiceImpl implements ISysOaEmailService
* @return 邮件
*/
@Override
public List<SysOaEmail> selectSysOaEmailList(SysOaEmail sysOaEmail)
{
public List<SysOaEmailDTO> selectSysOaEmailList(SysOaEmailDTO sysOaEmail) {
List<SysOaEmail> sysOaEmailList = sysOaEmailMapper.selectSysOaEmailList(sysOaEmail);
if(CollUtil.isNotEmpty(sysOaEmailList)){
sysOaEmailList.forEach(t->{
t.setSpendTime(DateUtil.formatBetween(t.getSendTime(), new Date(), BetweenFormater.Level.SECOND)+"");
SysMessageTransition sysMessageTransition=new SysMessageTransition();
sysMessageTransition.setMessageType(MessageEventType.SEND_EMAIL.getCode());
sysMessageTransition.setMessageStatus(0L);
sysMessageTransition.setMessageOutsideId(t.getEmailNo());
List<SysMessageTransition> sysMessageTransitions = sysMessageTransitionService.selectSysMessageTransitionList(sysMessageTransition);
if(CollUtil.isNotEmpty(sysMessageTransitions)){
//生产者只有一个直接get(0)就行了
t.setEmailFromUser(sysMessageTransitions.get(0).getProducerUser());
//消费者存在多个
t.setEmailToUser(sysMessageTransitions.stream().map(SysMessageTransition::getConsumerUser).collect(Collectors.toList()));
}
});
LambdaQueryWrapper<SysOaEmail> eq = new LambdaQueryWrapper<SysOaEmail>()
.like(StrUtil.isNotBlank(sysOaEmail.getEmailSubject()), SysOaEmail::getEmailSubject, sysOaEmail.getEmailSubject())
.eq(ObjectUtil.isNotEmpty(sysOaEmail.getEmailStatus()),SysOaEmail::getEmailStatus,sysOaEmail.getEmailStatus());
List<SysOaEmail> list = this.list(eq);
if(CollUtil.isEmpty(list)){
return BeanUtils.transformList(list,SysOaEmailDTO.class);
}
return sysOaEmailList;
List<SysOaEmailDTO> sysOaEmailDTOList= Lists.newArrayList();
list.forEach(t->{
List<String> emailToUser = t.getEmailToUser();
if(CollUtil.isEmpty(emailToUser)){
return;
}
List<SysUser> sysUserList = sysUserService.selectUserByIds(cn.hutool.core.convert.Convert.toLongArray(emailToUser));
List<String> emailList = sysUserList.stream().map(SysUser::getEmail).collect(Collectors.toList());
t.setEmailToUser(emailList);
SysOaEmailDTO sysOaEmailDTO = BeanUtil.copyProperties(t, SysOaEmailDTO.class);
sysOaEmailDTO.setEmailToUser(sysUserList);
sysOaEmailDTO.setEmailTo(CollUtil.join(emailList,","));
sysOaEmailDTOList.add(sysOaEmailDTO);
});
return sysOaEmailDTOList;
}
@Override
public List<SysOaEmailVO> selectEmailList(SysOaEmailDO sysOaEmailDO) {
List<SysOaEmailVO> sysOaEmailVOS = sysOaEmailMapper.selectEmailList(sysOaEmailDO);
if(CollUtil.isNotEmpty(sysOaEmailVOS)){
sysOaEmailVOS.forEach(t->{
t.setProducerUser(sysUserService.selectUserById(Long.parseLong(t.getProducerId())));
t.setConsumerUser(sysUserService.selectUserById(Long.parseLong(t.getConsumerId())));
});
if(CollUtil.isEmpty(sysOaEmailVOS)){
return sysOaEmailVOS;
}
sysOaEmailVOS.forEach(t->{
t.setProducerUser(sysUserService.selectUserById(Long.parseLong(t.getProducerId())));
t.setConsumerUser(sysUserService.selectUserById(Long.parseLong(t.getConsumerId())));
});
return sysOaEmailVOS;
}
/**
* 新增邮件
*
* @param sysOaEmail 邮件
* @return 结果
*/
@Override
public int insertSysOaEmail(SysOaEmail sysOaEmail)
{
sysOaEmail.setCreateTime(DateUtils.getNowDate());
return sysOaEmailMapper.insertSysOaEmail(sysOaEmail);
}
/**
* 修改邮件
@ -142,7 +139,7 @@ public class SysOaEmailServiceImpl implements ISysOaEmailService
* @return 结果
*/
@Override
public int updateSysOaEmail(SysOaEmail sysOaEmail)
public int updateSysOaEmail(SysOaEmailDTO sysOaEmail)
{
sysOaEmail.setUpdateTime(DateUtils.getNowDate());
return sysOaEmailMapper.updateSysOaEmail(sysOaEmail);
@ -174,7 +171,7 @@ public class SysOaEmailServiceImpl implements ISysOaEmailService
@Override
public int updateSysOaEmailByEmailNo(SysOaEmail sysOaEmail) {
public int updateSysOaEmailByEmailNo(SysOaEmailDTO sysOaEmail) {
sysOaEmail.setUpdateTime(DateUtils.getNowDate());
return sysOaEmailMapper.updateSysOaEmailByEmailNo(sysOaEmail);
}

View File

@ -1,13 +1,24 @@
package com.snow.system.service.impl;
import java.util.List;
import com.snow.common.utils.DateUtils;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.BetweenFormater;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.snow.common.enums.DingFlowTaskType;
import com.snow.system.domain.SysOaTask;
import com.snow.system.domain.SysOaTaskDistribute;
import com.snow.system.domain.SysUser;
import com.snow.system.mapper.SysOaTaskDistributeMapper;
import com.snow.system.service.ISysOaTaskDistributeService;
import com.snow.system.service.ISysOaTaskService;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.snow.system.mapper.SysOaTaskDistributeMapper;
import com.snow.system.domain.SysOaTaskDistribute;
import com.snow.system.service.ISysOaTaskDistributeService;
import com.snow.common.core.text.Convert;
import java.util.List;
/**
* 任务分配Service业务层处理
@ -16,11 +27,14 @@ import com.snow.common.core.text.Convert;
* @date 2021-08-15
*/
@Service
public class SysOaTaskDistributeServiceImpl implements ISysOaTaskDistributeService
{
@Autowired
private SysOaTaskDistributeMapper sysOaTaskDistributeMapper;
public class SysOaTaskDistributeServiceImpl extends ServiceImpl<SysOaTaskDistributeMapper,SysOaTaskDistribute> implements ISysOaTaskDistributeService {
@Autowired
private ISysOaTaskService sysOaTaskService;
@Autowired
private SysUserServiceImpl sysUserService;
/**
* 查询任务分配
*
@ -30,7 +44,7 @@ public class SysOaTaskDistributeServiceImpl implements ISysOaTaskDistributeServi
@Override
public SysOaTaskDistribute selectSysOaTaskDistributeById(Long id)
{
return sysOaTaskDistributeMapper.selectSysOaTaskDistributeById(id);
return this.getById(id);
}
/**
@ -40,58 +54,45 @@ public class SysOaTaskDistributeServiceImpl implements ISysOaTaskDistributeServi
* @return 任务分配
*/
@Override
public List<SysOaTaskDistribute> selectSysOaTaskDistributeList(SysOaTaskDistribute sysOaTaskDistribute)
{
return sysOaTaskDistributeMapper.selectSysOaTaskDistributeList(sysOaTaskDistribute);
public List<SysOaTaskDistribute> selectSysOaTaskDistributeList(SysOaTaskDistribute sysOaTaskDistribute) {
LambdaQueryWrapper<SysOaTaskDistribute> lambda = new QueryWrapper<SysOaTaskDistribute>().lambda();
lambda.eq(ObjectUtil.isNotEmpty(sysOaTaskDistribute.getTaskNo()),SysOaTaskDistribute::getTaskNo,sysOaTaskDistribute.getTaskNo());
lambda.in(CollUtil.isNotEmpty(sysOaTaskDistribute.getTaskExecuteStatusList()),SysOaTaskDistribute::getTaskExecuteStatus,sysOaTaskDistribute.getTaskExecuteStatusList());
lambda.eq(ObjectUtil.isNotEmpty(sysOaTaskDistribute.getTaskDistributeId()),SysOaTaskDistribute::getTaskDistributeId,sysOaTaskDistribute.getTaskDistributeId());
lambda.eq(ObjectUtil.isNotEmpty(sysOaTaskDistribute.getTaskExecuteId()),SysOaTaskDistribute::getTaskExecuteId,sysOaTaskDistribute.getTaskExecuteId());
lambda.eq(ObjectUtil.isNotEmpty(sysOaTaskDistribute.getTaskExecuteStatus()),SysOaTaskDistribute::getTaskExecuteStatus,sysOaTaskDistribute.getTaskExecuteStatus());
lambda.eq(ObjectUtil.isNotEmpty(sysOaTaskDistribute.getTaskCompleteTime()),SysOaTaskDistribute::getTaskCompleteTime,sysOaTaskDistribute.getTaskCompleteTime());
lambda.eq(ObjectUtil.isNotEmpty(sysOaTaskDistribute.getTaskStartTime()),SysOaTaskDistribute::getTaskStartTime,sysOaTaskDistribute.getTaskStartTime());
lambda.eq(ObjectUtil.isNotEmpty(sysOaTaskDistribute.getTaskSuspendTime()),SysOaTaskDistribute::getTaskSuspendTime,sysOaTaskDistribute.getTaskSuspendTime());
return this.list(lambda);
}
/**
* 新增任务分配
*
* @param sysOaTaskDistribute 任务分配
* @return 结果
*/
@Override
public int insertSysOaTaskDistribute(SysOaTaskDistribute sysOaTaskDistribute)
{
sysOaTaskDistribute.setCreateTime(DateUtils.getNowDate());
return sysOaTaskDistributeMapper.insertSysOaTaskDistribute(sysOaTaskDistribute);
public List<SysOaTaskDistribute> getSysOaTaskDistribute(SysOaTaskDistribute sysOaTaskDistribute) {
List<SysOaTaskDistribute> sysOaTaskDistributes = this.selectSysOaTaskDistributeList(sysOaTaskDistribute);
if(CollUtil.isEmpty(sysOaTaskDistributes)){
return sysOaTaskDistributes;
}
warpSysOaTask(sysOaTaskDistributes);
return sysOaTaskDistributes;
}
/**
* 修改任务分配
*
* @param sysOaTaskDistribute 任务分配
* @return 结果
*/
@Override
public int updateSysOaTaskDistribute(SysOaTaskDistribute sysOaTaskDistribute)
{
sysOaTaskDistribute.setUpdateTime(DateUtils.getNowDate());
return sysOaTaskDistributeMapper.updateSysOaTaskDistribute(sysOaTaskDistribute);
public void warpSysOaTask(List<SysOaTaskDistribute> sysOaTaskDistributes){
sysOaTaskDistributes.forEach(t->{
SysOaTask sysOaTask = sysOaTaskService.selectSysOaTaskById(t.getTaskNo());
sysOaTask.setCreateBy(sysUserService.selectUserById(Long.parseLong(sysOaTask.getCreateBy())).getUserName());
if(ObjectUtil.isNotNull(t.getTaskDistributeId())){
t.setTaskDistributeId(sysUserService.selectUserById(Long.parseLong(t.getTaskDistributeId())).getUserName());
}
if(ObjectUtil.isNotNull(t.getTaskExecuteId())){
t.setTaskExecuteId(sysUserService.selectUserById(Long.parseLong(t.getTaskExecuteId())).getUserName());
}
if(ObjectUtil.isNotNull(t.getTaskStartTime())&&ObjectUtil.isNotNull(t.getTaskCompleteTime())){
t.setSpendTime(DateUtil.formatBetween(t.getTaskStartTime(),t.getTaskCompleteTime(), BetweenFormater.Level.SECOND));
}
t.setSysOaTask(sysOaTask);
t.setCreateBy(sysUserService.selectUserById(Long.parseLong(t.getCreateBy())).getUserName());
});
}
/**
* 删除任务分配对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteSysOaTaskDistributeByIds(String ids)
{
return sysOaTaskDistributeMapper.deleteSysOaTaskDistributeByIds(Convert.toStrArray(ids));
}
/**
* 删除任务分配信息
*
* @param id 任务分配ID
* @return 结果
*/
@Override
public int deleteSysOaTaskDistributeById(Long id)
{
return sysOaTaskDistributeMapper.deleteSysOaTaskDistributeById(id);
}
}

View File

@ -2,20 +2,17 @@ package com.snow.system.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.snow.common.constant.MessageConstants;
import com.snow.common.constant.SequenceConstants;
import com.snow.common.core.domain.MessageEventRequest;
import com.snow.common.core.text.Convert;
import com.snow.common.enums.DingFlowTaskType;
import com.snow.common.enums.DingTalkListenerType;
import com.snow.common.enums.MessageEventType;
import com.snow.common.enums.TaskStatus;
import com.snow.common.exception.BusinessException;
import com.snow.common.utils.DateUtils;
import com.snow.system.domain.SysOaTask;
import com.snow.system.domain.SysOaTaskDistribute;
import com.snow.system.event.SyncEvent;
import com.snow.system.mapper.SysOaTaskDistributeMapper;
import com.snow.system.mapper.SysOaTaskMapper;
import com.snow.system.service.ISysOaTaskDistributeService;
import com.snow.system.service.ISysOaTaskService;
@ -25,10 +22,10 @@ import org.apache.commons.compress.utils.Sets;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 系统任务Service业务层处理
@ -37,17 +34,11 @@ import java.util.*;
* @date 2021-07-29
*/
@Service
public class SysOaTaskServiceImpl implements ISysOaTaskService
{
@Autowired
private SysOaTaskMapper sysOaTaskMapper;
public class SysOaTaskServiceImpl extends ServiceImpl<SysOaTaskMapper,SysOaTask> implements ISysOaTaskService {
@Autowired
private ISysOaTaskDistributeService sysOaTaskDistributeService;
@Resource
private SysOaTaskDistributeMapper sysOaTaskDistributeMapper;
@Autowired
private ISysUserService sysUserService;
@ -57,6 +48,7 @@ public class SysOaTaskServiceImpl implements ISysOaTaskService
@Autowired
private ApplicationContext applicationContext;
/**
* 查询系统任务
*
@ -64,9 +56,8 @@ public class SysOaTaskServiceImpl implements ISysOaTaskService
* @return 系统任务
*/
@Override
public SysOaTask selectSysOaTaskById(String taskNo)
{
return sysOaTaskMapper.selectSysOaTaskById(taskNo);
public SysOaTask selectSysOaTaskById(String taskNo) {
return this.getById(taskNo);
}
/**
@ -76,9 +67,13 @@ public class SysOaTaskServiceImpl implements ISysOaTaskService
* @return 系统任务
*/
@Override
public List<SysOaTask> selectSysOaTaskList(SysOaTask sysOaTask)
{
return sysOaTaskMapper.selectSysOaTaskList(sysOaTask);
public List<SysOaTask> selectSysOaTaskList(SysOaTask sysOaTask) {
LambdaQueryWrapper<SysOaTask> lambda = new QueryWrapper<SysOaTask>().lambda();
lambda.like(ObjectUtil.isNotEmpty(sysOaTask.getTaskNo()),SysOaTask::getTaskNo,sysOaTask.getTaskNo());
lambda.eq(ObjectUtil.isNotEmpty(sysOaTask.getTaskStatus()),SysOaTask::getTaskStatus,sysOaTask.getTaskStatus());
lambda.eq(ObjectUtil.isNotEmpty(sysOaTask.getPriority()),SysOaTask::getPriority,sysOaTask.getPriority());
lambda.like(ObjectUtil.isNotEmpty(sysOaTask.getTaskName()),SysOaTask::getTaskName,sysOaTask.getTaskName());
return this.list(lambda);
}
/**
@ -88,86 +83,38 @@ public class SysOaTaskServiceImpl implements ISysOaTaskService
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertSysOaTask(SysOaTask sysOaTask)
{
sysOaTask.setCreateTime(DateUtils.getNowDate());
public SysOaTask insertSysOaTask(SysOaTask sysOaTask) {
String newSequenceNo = sequenceService.getNewSequenceNo(SequenceConstants.OA_TASK_SEQUENCE);
sysOaTask.setTaskNo(newSequenceNo);
sysOaTask.setTaskStatus(TaskStatus.UN_FINISH.getCode());
sysOaTask.setTaskStatus(DingFlowTaskType.NEW.getCode());
//任务执行人
List<String> taskDistributeIdList= sysOaTask.getTaskDistributeId();
this.save(sysOaTask);
if(CollUtil.isEmpty(taskDistributeIdList)){
return sysOaTask;
}
List<SysOaTaskDistribute> sysOaTaskDistributeList= Lists.newArrayList();
if(CollUtil.isNotEmpty(taskDistributeIdList)){
taskDistributeIdList.forEach(t->{
SysOaTaskDistribute sysOaTaskDistribute=new SysOaTaskDistribute();
sysOaTaskDistribute.setTaskDistributeId(t);
sysOaTaskDistribute.setTaskNo(newSequenceNo);
sysOaTaskDistribute.setTaskExecuteStatus(DingFlowTaskType.RUNNING.getCode());
sysOaTaskDistribute.setCreateBy(sysOaTask.getCreateBy());
sysOaTaskDistributeService.insertSysOaTaskDistribute(sysOaTaskDistribute);
sysOaTaskDistribute.setSysOaTask(sysOaTask);
//发送消息
sendInnerMessage(sysOaTaskDistribute);
sysOaTaskDistributeList.add(sysOaTaskDistribute);
});
}
sysOaTask.setSysOaTaskDistributeList(sysOaTaskDistributeList);
//事件发送
SyncEvent<SysOaTask> syncEvent = new SyncEvent(sysOaTask, DingTalkListenerType.WORK_RECODE_CREATE);
applicationContext.publishEvent(syncEvent);
return sysOaTaskMapper.insertSysOaTask(sysOaTask);
}
/**
* 修改系统任务
*
* @param sysOaTask 系统任务
* @return 结果
*/
@Override
public int updateSysOaTask(SysOaTask sysOaTask)
{
sysOaTask.setUpdateTime(DateUtils.getNowDate());
return sysOaTaskMapper.updateSysOaTask(sysOaTask);
}
/**
* 删除系统任务对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteSysOaTaskByIds(String ids)
{
List<String> list = Arrays.asList(Convert.toStrArray(ids));
list.forEach(t->{
List<SysOaTaskDistribute> sysOaTaskDistributes = sysOaTaskDistributeMapper.selectSysOaTaskDistributeByTaskNo(t);
if(CollUtil.isNotEmpty(sysOaTaskDistributes)){
throw new BusinessException("任务编号:"+t+"已分配,不允许删除操作");
}
taskDistributeIdList.forEach(t->{
SysOaTaskDistribute sysOaTaskDistribute=new SysOaTaskDistribute();
sysOaTaskDistribute.setTaskDistributeId(t);
sysOaTaskDistribute.setTaskNo(newSequenceNo);
sysOaTaskDistribute.setTaskExecuteStatus(DingFlowTaskType.NEW.getCode());
sysOaTaskDistribute.setCreateBy(sysOaTask.getCreateBy());
sysOaTaskDistributeService.save(sysOaTaskDistribute);
//发送站内信
sendInnerMessage(sysOaTaskDistribute);
sysOaTaskDistributeList.add(sysOaTaskDistribute);
});
return sysOaTaskMapper.deleteSysOaTaskByIds(Convert.toStrArray(ids));
sysOaTask.setSysOaTaskDistributeList(sysOaTaskDistributeList);
return sysOaTask;
}
/**
* 删除系统任务信息
*
* @param taskNo 系统任务ID
* @return 结果
*/
@Override
public int deleteSysOaTaskById(String taskNo)
{
List<SysOaTaskDistribute> sysOaTaskDistributes = sysOaTaskDistributeMapper.selectSysOaTaskDistributeByTaskNo(taskNo);
if(CollUtil.isNotEmpty(sysOaTaskDistributes)){
throw new BusinessException("任务编号:"+taskNo+"已分配,不允许删除操作");
}
//发送事件
SyncEvent<String> syncEvent = new SyncEvent(taskNo, DingTalkListenerType.WORK_RECODE_CREATE);
applicationContext.publishEvent(syncEvent);
return sysOaTaskMapper.deleteSysOaTaskById(taskNo);
public String getOutTaskOutsideId(String taskNo) {
return this.getOne(new QueryWrapper<SysOaTask>().lambda().eq(SysOaTask::getTaskNo,taskNo)).getTaskOutsideId();
}
/**

View File

@ -146,6 +146,11 @@ public class SysUserServiceImpl implements ISysUserService
return userMapper.selectUserById(userId);
}
public List<SysUser> selectUserByIds(Long[] userIds)
{
return userMapper.selectUserByIds(userIds);
}
@Override
public SysUser selectUserByDingUserId(String dingUserId) {
return userMapper.selectUserByDingUserId(dingUserId);

View File

@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="ancestors" column="ancestors" />
<result property="deptName" column="dept_name" />
<result property="orderNum" column="order_num" />
<result property="leader" column="leader" typeHandler="com.snow.framework.config.JsonStringListTypeHandler" />
<result property="leader" column="leader" typeHandler="com.snow.system.handler.JsonStringListTypeHandler" />
<result property="phone" column="phone" />
<result property="email" column="email" />
<result property="status" column="status" />
@ -106,7 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptName != null and deptName != ''">#{deptName},</if>
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
<if test="leader != null and leader != ''">#{leader,typeHandler=com.snow.framework.config.JsonStringListTypeHandler},</if>
<if test="leader != null and leader != ''">#{leader,typeHandler=com.snow.system.handler.JsonStringListTypeHandler},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="status != null">#{status},</if>
@ -123,7 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
<if test="leader != null">leader = #{leader,typeHandler=com.snow.framework.config.JsonStringListTypeHandler},</if>
<if test="leader != null">leader = #{leader,typeHandler=com.snow.system.handler.JsonStringListTypeHandler},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="email != null">email = #{email},</if>
<if test="status != null and status != ''">status = #{status},</if>

Some files were not shown because too many files have changed in this diff Show More