|
|
@@ -3,16 +3,22 @@ package com.usoftchina.smartschool.school.business.service.impl;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.usoftchina.smartschool.context.BaseContextHolder;
|
|
|
+import com.usoftchina.smartschool.exception.BizException;
|
|
|
import com.usoftchina.smartschool.page.PageRequest;
|
|
|
import com.usoftchina.smartschool.school.business.service.PrincipalMailService;
|
|
|
import com.usoftchina.smartschool.school.dto.BatchDealBaseDTO;
|
|
|
import com.usoftchina.smartschool.school.dto.DocBaseDTO;
|
|
|
import com.usoftchina.smartschool.school.dto.ListReqDTO;
|
|
|
+import com.usoftchina.smartschool.school.exception.BizExceptionCode;
|
|
|
import com.usoftchina.smartschool.school.mapper.PrincipalMailboxMapper;
|
|
|
+import com.usoftchina.smartschool.school.po.PrincipalMail;
|
|
|
import com.usoftchina.smartschool.school.po.PrincipalMailboxDO;
|
|
|
+import com.usoftchina.smartschool.school.po.PrincipalReplyDO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -26,7 +32,7 @@ public class PrincipalMailServiceImpl implements PrincipalMailService {
|
|
|
private PrincipalMailboxMapper principalMailboxMapper;
|
|
|
|
|
|
@Override
|
|
|
- public PageInfo<PrincipalMailboxDO> getListData(PageRequest page, ListReqDTO listReqDTO) {
|
|
|
+ public PageInfo<PrincipalMail> getListData(PageRequest page, ListReqDTO listReqDTO) {
|
|
|
PageHelper.startPage(page.getNumber(), page.getSize());
|
|
|
Long schoolId = BaseContextHolder.getSchoolId();
|
|
|
schoolId = 1l;
|
|
|
@@ -35,8 +41,8 @@ public class PrincipalMailServiceImpl implements PrincipalMailService {
|
|
|
if(condition == null){
|
|
|
condition = "1=1";
|
|
|
}
|
|
|
- List<PrincipalMailboxDO> data = principalMailboxMapper.selectByConditon(condition, schoolId);
|
|
|
- PageInfo<PrincipalMailboxDO> list = new PageInfo<>(data);
|
|
|
+ List<PrincipalMail> data = principalMailboxMapper.selectByConditon(condition, schoolId);
|
|
|
+ PageInfo<PrincipalMail> list = new PageInfo<>(data);
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
@@ -52,7 +58,44 @@ public class PrincipalMailServiceImpl implements PrincipalMailService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void batchIgnore(BatchDealBaseDTO baseDTOs) {
|
|
|
+ if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
|
|
|
+ baseDTOs.getBaseDTOs().size() == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<DocBaseDTO> base = baseDTOs.getBaseDTOs();
|
|
|
+ principalMailboxMapper.batchIgnore(base);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void batchUnIgnore(BatchDealBaseDTO baseDTOs) {
|
|
|
+ if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
|
|
|
+ baseDTOs.getBaseDTOs().size() == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<DocBaseDTO> base = baseDTOs.getBaseDTOs();
|
|
|
+ principalMailboxMapper.batchUnIgnore(base);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void reply(String msg, Long id) {
|
|
|
+ if (StringUtils.isEmpty(msg) || StringUtils.isEmpty(id)) {
|
|
|
+ throw new BizException(BizExceptionCode.USELESS_DATA);
|
|
|
+ }
|
|
|
+ //更新主表
|
|
|
+ principalMailboxMapper.updateReply(msg, id);
|
|
|
+
|
|
|
+ PrincipalReplyDO replyDO = new PrincipalReplyDO();
|
|
|
+ replyDO.setMailboxId(id);
|
|
|
+ replyDO.setReplyContent(msg);
|
|
|
+ replyDO.setReplyDate(new Date());
|
|
|
+ //插入从表
|
|
|
+ principalMailboxMapper.insertDetail(replyDO);
|
|
|
+ }
|
|
|
+
|
|
|
private void singleDelete(Long id) {
|
|
|
principalMailboxMapper.deleteByPrimaryKey(id);
|
|
|
}
|
|
|
+
|
|
|
}
|