8 changed files with 691 additions and 613 deletions
@ -1,263 +1,272 @@ |
|||
package com.zdxt.auth.project.system.notice.domain; |
|||
|
|||
import javax.tools.FileObject; |
|||
import javax.validation.constraints.*; |
|||
import javax.validation.constraints.Size; |
|||
import com.zdxt.common.BaseDomain; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 通知公告表 sys_notice |
|||
* |
|||
* @author ruoyi |
|||
*/ |
|||
public class Notice extends BaseDomain |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 通知ID */ |
|||
private String noticeId; |
|||
|
|||
/** 通知标题 */ |
|||
private String noticeTitle; |
|||
|
|||
/** 发布对象(0全部 1监督端 2执法端 3 企业端) */ |
|||
private String objectType; |
|||
|
|||
/** 通知内容 */ |
|||
private String noticeContent; |
|||
|
|||
/** 公告状态(0正常 1关闭) */ |
|||
private String status; |
|||
/** 创建者id */ |
|||
private String createBy; |
|||
/** 创建时间 */ |
|||
private Date createTime; |
|||
/** 更新时间 */ |
|||
private Date updateTime; |
|||
/** 更新者 */ |
|||
private String updateBy; |
|||
/** 发布部门多个 */ |
|||
private String bureauDeptIds; |
|||
/** 发布部门名称多个 */ |
|||
private String bureauDeptNames; |
|||
/** 备注 */ |
|||
private String remark; |
|||
/** 发布部门名称列表 */ |
|||
private List<String> bureauDeptNameList; |
|||
private String beginTime; |
|||
private String endTime; |
|||
private String createTimeStr; |
|||
|
|||
private FileObject fileObject; |
|||
|
|||
|
|||
/** |
|||
* 文件对象 |
|||
*/ |
|||
public static class FileObject{ |
|||
private String fileName; |
|||
private String fileUrl; |
|||
|
|||
public String getFileName() { |
|||
return fileName; |
|||
} |
|||
|
|||
public void setFileName(String fileName) { |
|||
this.fileName = fileName; |
|||
} |
|||
|
|||
public String getFileUrl() { |
|||
return fileUrl; |
|||
} |
|||
|
|||
public void setFileUrl(String fileUrl) { |
|||
this.fileUrl = fileUrl; |
|||
} |
|||
} |
|||
|
|||
public FileObject getFileObject() { |
|||
return fileObject; |
|||
} |
|||
|
|||
public void setFileObject(FileObject fileObject) { |
|||
this.fileObject = fileObject; |
|||
} |
|||
|
|||
|
|||
|
|||
public String getNoticeId() |
|||
{ |
|||
return noticeId; |
|||
} |
|||
|
|||
public void setNoticeId(String noticeId) |
|||
{ |
|||
this.noticeId = noticeId; |
|||
} |
|||
|
|||
public void setNoticeTitle(String noticeTitle) |
|||
{ |
|||
this.noticeTitle = noticeTitle; |
|||
} |
|||
|
|||
@NotBlank(message = "公告标题不能为空") |
|||
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符") |
|||
public String getNoticeTitle() |
|||
{ |
|||
return noticeTitle; |
|||
} |
|||
|
|||
public String getObjectType() { |
|||
return objectType; |
|||
} |
|||
|
|||
public void setObjectType(String objectType) { |
|||
this.objectType = objectType; |
|||
} |
|||
|
|||
public void setNoticeContent(String noticeContent) |
|||
{ |
|||
this.noticeContent = noticeContent; |
|||
} |
|||
|
|||
public String getNoticeContent() |
|||
{ |
|||
return noticeContent; |
|||
} |
|||
|
|||
public void setStatus(String status) |
|||
{ |
|||
this.status = status; |
|||
} |
|||
|
|||
public String getStatus() |
|||
{ |
|||
return status; |
|||
} |
|||
|
|||
@Override |
|||
public String getCreateBy() { |
|||
return createBy; |
|||
} |
|||
|
|||
@Override |
|||
public void setCreateBy(String createBy) { |
|||
this.createBy = createBy; |
|||
} |
|||
|
|||
@Override |
|||
public Date getCreateTime() { |
|||
return createTime; |
|||
} |
|||
|
|||
@Override |
|||
public void setCreateTime(Date createTime) { |
|||
this.createTime = createTime; |
|||
} |
|||
|
|||
@Override |
|||
public Date getUpdateTime() { |
|||
return updateTime; |
|||
} |
|||
|
|||
@Override |
|||
public void setUpdateTime(Date updateTime) { |
|||
this.updateTime = updateTime; |
|||
} |
|||
|
|||
@Override |
|||
public String getUpdateBy() { |
|||
return updateBy; |
|||
} |
|||
|
|||
@Override |
|||
public void setUpdateBy(String updateBy) { |
|||
this.updateBy = updateBy; |
|||
} |
|||
|
|||
public String getBureauDeptIds() { |
|||
return bureauDeptIds; |
|||
} |
|||
|
|||
public void setBureauDeptIds(String bureauDeptIds) { |
|||
this.bureauDeptIds = bureauDeptIds; |
|||
} |
|||
|
|||
public String getBureauDeptNames() { |
|||
return bureauDeptNames; |
|||
} |
|||
|
|||
public void setBureauDeptNames(String bureauDeptNames) { |
|||
this.bureauDeptNames = bureauDeptNames; |
|||
} |
|||
|
|||
@Override |
|||
public String getRemark() { |
|||
return remark; |
|||
} |
|||
|
|||
@Override |
|||
public void setRemark(String remark) { |
|||
this.remark = remark; |
|||
} |
|||
|
|||
public List<String> getBureauDeptNameList() { |
|||
return bureauDeptNameList; |
|||
} |
|||
|
|||
public void setBureauDeptNameList(List<String> bureauDeptNameList) { |
|||
this.bureauDeptNameList = bureauDeptNameList; |
|||
} |
|||
|
|||
public String getBeginTime() { |
|||
return beginTime; |
|||
} |
|||
|
|||
public void setBeginTime(String beginTime) { |
|||
this.beginTime = beginTime; |
|||
} |
|||
|
|||
public String getEndTime() { |
|||
return endTime; |
|||
} |
|||
|
|||
public void setEndTime(String endTime) { |
|||
this.endTime = endTime; |
|||
} |
|||
|
|||
public String getCreateTimeStr() { |
|||
return createTimeStr; |
|||
} |
|||
|
|||
public void setCreateTimeStr(String createTimeStr) { |
|||
this.createTimeStr = createTimeStr; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("noticeId", getNoticeId()) |
|||
.append("noticeTitle", getNoticeTitle()) |
|||
.append("objectType", getObjectType()) |
|||
.append("noticeContent", getNoticeContent()) |
|||
.append("status", getStatus()) |
|||
.append("createBy", getCreateBy()) |
|||
.append("createTime", getCreateTime()) |
|||
.append("updateBy", getUpdateBy()) |
|||
.append("updateTime", getUpdateTime()) |
|||
.append("bureauDeptIds",getBureauDeptIds()) |
|||
.append("bureauDeptNames",getBureauDeptNames()) |
|||
.append("remark", getRemark()) |
|||
.append("bureauDeptNameList",getBureauDeptNameList()) |
|||
.append("beginTime",getBeginTime()) |
|||
.append("endTime",getEndTime()) |
|||
.append("createTimeStr",getCreateTimeStr()) |
|||
.toString(); |
|||
} |
|||
|
|||
} |
|||
package com.zdxt.auth.project.system.notice.domain; |
|||
|
|||
import javax.tools.FileObject; |
|||
import javax.validation.constraints.*; |
|||
import javax.validation.constraints.Size; |
|||
import com.zdxt.common.BaseDomain; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 通知公告表 sys_notice |
|||
* |
|||
* @author ruoyi |
|||
*/ |
|||
public class Notice extends BaseDomain |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 通知ID */ |
|||
private String noticeId; |
|||
|
|||
/** 通知标题 */ |
|||
private String noticeTitle; |
|||
|
|||
/** 发布对象(0全部 1监督端 2执法端 3 企业端) */ |
|||
private String objectType; |
|||
|
|||
/** 通知内容 */ |
|||
private String noticeContent; |
|||
|
|||
/** 公告状态(0正常 1关闭) */ |
|||
private String status; |
|||
/** 创建者id */ |
|||
private String createBy; |
|||
/** 创建时间 */ |
|||
private Date createTime; |
|||
/** 更新时间 */ |
|||
private Date updateTime; |
|||
/** 更新者 */ |
|||
private String updateBy; |
|||
/** 发布部门多个 */ |
|||
private String bureauDeptIds; |
|||
/** 发布部门名称多个 */ |
|||
private String bureauDeptNames; |
|||
/** 备注 */ |
|||
private String remark; |
|||
/** 发布部门名称列表 */ |
|||
private List<String> bureauDeptNameList; |
|||
private String beginTime; |
|||
private String endTime; |
|||
private String createTimeStr; |
|||
|
|||
private FileObject fileObject; |
|||
|
|||
private List<FileObject> fileObjects; |
|||
|
|||
/** |
|||
* 文件对象 |
|||
*/ |
|||
public static class FileObject{ |
|||
private String fileName; |
|||
private String fileUrl; |
|||
|
|||
public String getFileName() { |
|||
return fileName; |
|||
} |
|||
|
|||
public void setFileName(String fileName) { |
|||
this.fileName = fileName; |
|||
} |
|||
|
|||
public String getFileUrl() { |
|||
return fileUrl; |
|||
} |
|||
|
|||
public void setFileUrl(String fileUrl) { |
|||
this.fileUrl = fileUrl; |
|||
} |
|||
} |
|||
|
|||
public FileObject getFileObject() { |
|||
return fileObject; |
|||
} |
|||
|
|||
public void setFileObject(FileObject fileObject) { |
|||
this.fileObject = fileObject; |
|||
} |
|||
|
|||
public List<FileObject> getFileObjects() { |
|||
return fileObjects; |
|||
} |
|||
|
|||
public void setFileObjects(List<FileObject> fileObjects) { |
|||
this.fileObjects = fileObjects; |
|||
} |
|||
|
|||
|
|||
|
|||
public String getNoticeId() |
|||
{ |
|||
return noticeId; |
|||
} |
|||
|
|||
public void setNoticeId(String noticeId) |
|||
{ |
|||
this.noticeId = noticeId; |
|||
} |
|||
|
|||
public void setNoticeTitle(String noticeTitle) |
|||
{ |
|||
this.noticeTitle = noticeTitle; |
|||
} |
|||
|
|||
@NotBlank(message = "公告标题不能为空") |
|||
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符") |
|||
public String getNoticeTitle() |
|||
{ |
|||
return noticeTitle; |
|||
} |
|||
|
|||
public String getObjectType() { |
|||
return objectType; |
|||
} |
|||
|
|||
public void setObjectType(String objectType) { |
|||
this.objectType = objectType; |
|||
} |
|||
|
|||
public void setNoticeContent(String noticeContent) |
|||
{ |
|||
this.noticeContent = noticeContent; |
|||
} |
|||
|
|||
public String getNoticeContent() |
|||
{ |
|||
return noticeContent; |
|||
} |
|||
|
|||
public void setStatus(String status) |
|||
{ |
|||
this.status = status; |
|||
} |
|||
|
|||
public String getStatus() |
|||
{ |
|||
return status; |
|||
} |
|||
|
|||
@Override |
|||
public String getCreateBy() { |
|||
return createBy; |
|||
} |
|||
|
|||
@Override |
|||
public void setCreateBy(String createBy) { |
|||
this.createBy = createBy; |
|||
} |
|||
|
|||
@Override |
|||
public Date getCreateTime() { |
|||
return createTime; |
|||
} |
|||
|
|||
@Override |
|||
public void setCreateTime(Date createTime) { |
|||
this.createTime = createTime; |
|||
} |
|||
|
|||
@Override |
|||
public Date getUpdateTime() { |
|||
return updateTime; |
|||
} |
|||
|
|||
@Override |
|||
public void setUpdateTime(Date updateTime) { |
|||
this.updateTime = updateTime; |
|||
} |
|||
|
|||
@Override |
|||
public String getUpdateBy() { |
|||
return updateBy; |
|||
} |
|||
|
|||
@Override |
|||
public void setUpdateBy(String updateBy) { |
|||
this.updateBy = updateBy; |
|||
} |
|||
|
|||
public String getBureauDeptIds() { |
|||
return bureauDeptIds; |
|||
} |
|||
|
|||
public void setBureauDeptIds(String bureauDeptIds) { |
|||
this.bureauDeptIds = bureauDeptIds; |
|||
} |
|||
|
|||
public String getBureauDeptNames() { |
|||
return bureauDeptNames; |
|||
} |
|||
|
|||
public void setBureauDeptNames(String bureauDeptNames) { |
|||
this.bureauDeptNames = bureauDeptNames; |
|||
} |
|||
|
|||
@Override |
|||
public String getRemark() { |
|||
return remark; |
|||
} |
|||
|
|||
@Override |
|||
public void setRemark(String remark) { |
|||
this.remark = remark; |
|||
} |
|||
|
|||
public List<String> getBureauDeptNameList() { |
|||
return bureauDeptNameList; |
|||
} |
|||
|
|||
public void setBureauDeptNameList(List<String> bureauDeptNameList) { |
|||
this.bureauDeptNameList = bureauDeptNameList; |
|||
} |
|||
|
|||
public String getBeginTime() { |
|||
return beginTime; |
|||
} |
|||
|
|||
public void setBeginTime(String beginTime) { |
|||
this.beginTime = beginTime; |
|||
} |
|||
|
|||
public String getEndTime() { |
|||
return endTime; |
|||
} |
|||
|
|||
public void setEndTime(String endTime) { |
|||
this.endTime = endTime; |
|||
} |
|||
|
|||
public String getCreateTimeStr() { |
|||
return createTimeStr; |
|||
} |
|||
|
|||
public void setCreateTimeStr(String createTimeStr) { |
|||
this.createTimeStr = createTimeStr; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("noticeId", getNoticeId()) |
|||
.append("noticeTitle", getNoticeTitle()) |
|||
.append("objectType", getObjectType()) |
|||
.append("noticeContent", getNoticeContent()) |
|||
.append("status", getStatus()) |
|||
.append("createBy", getCreateBy()) |
|||
.append("createTime", getCreateTime()) |
|||
.append("updateBy", getUpdateBy()) |
|||
.append("updateTime", getUpdateTime()) |
|||
.append("bureauDeptIds",getBureauDeptIds()) |
|||
.append("bureauDeptNames",getBureauDeptNames()) |
|||
.append("remark", getRemark()) |
|||
.append("bureauDeptNameList",getBureauDeptNameList()) |
|||
.append("beginTime",getBeginTime()) |
|||
.append("endTime",getEndTime()) |
|||
.append("createTimeStr",getCreateTimeStr()) |
|||
.toString(); |
|||
} |
|||
|
|||
} |
|||
|
|||
@ -1,173 +1,185 @@ |
|||
package com.zdxt.auth.project.system.notice.service; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import cn.hutool.core.util.IdUtil; |
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.zdxt.auth.dto.ZdxtFileBean; |
|||
import com.zdxt.auth.feign.FileUploadApi; |
|||
import com.zdxt.auth.feign.ZdxtFileCommonApi; |
|||
import com.zdxt.common.zdxtFile.AttFileRespDTO; |
|||
import com.zdxt.common.zdxtFile.FilePreviewUtilBean; |
|||
import com.zdxt.common.zdxtFile.ZdxtFileCommon; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.zdxt.auth.common.utils.security.ShiroUtils; |
|||
import com.zdxt.auth.common.utils.text.Convert; |
|||
import com.zdxt.auth.project.system.notice.mapper.NoticeMapper; |
|||
import com.zdxt.auth.project.system.notice.domain.Notice; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
/** |
|||
* 公告 服务层实现 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2018-06-25 |
|||
*/ |
|||
@Service |
|||
public class NoticeServiceImpl implements INoticeService |
|||
{ |
|||
@Autowired |
|||
private NoticeMapper noticeMapper; |
|||
|
|||
@Autowired |
|||
private ZdxtFileCommonApi zdxtFileCommonApi; |
|||
|
|||
@Autowired |
|||
private FileUploadApi fileUploadApi; |
|||
|
|||
/** |
|||
* 查询公告信息 |
|||
* |
|||
* @param noticeId 公告ID |
|||
* @return 公告信息 |
|||
*/ |
|||
@Override |
|||
public Notice selectNoticeById(String noticeId) |
|||
{ |
|||
return noticeMapper.selectNoticeById(noticeId); |
|||
} |
|||
|
|||
/** |
|||
* 查询公告列表 |
|||
* |
|||
* @param notice 公告信息 |
|||
* @return 公告集合 |
|||
*/ |
|||
@Override |
|||
public List<Notice> selectNoticeList(Notice notice) |
|||
{ |
|||
return noticeMapper.selectNoticeList(notice); |
|||
} |
|||
|
|||
@Override |
|||
public List<Notice> selectNoticeListNoPermission(Notice notice) { |
|||
List<Notice> list = |
|||
noticeMapper.selectNoticeList(notice); |
|||
list.forEach(res ->{ |
|||
List<ZdxtFileCommon> zdxtFileCommons = zdxtFileCommonApi.selectZdxtFileById(res.getNoticeId()); |
|||
if(zdxtFileCommons != null && zdxtFileCommons.size() > 0){ |
|||
Notice.FileObject fileObject = new Notice.FileObject(); |
|||
fileObject.setFileName(zdxtFileCommons.get(0).getFileName()); |
|||
fileObject.setFileUrl(zdxtFileCommons.get(0).getUploadPath()); |
|||
res.setFileObject(fileObject); |
|||
} |
|||
}); |
|||
return list; |
|||
} |
|||
|
|||
/** |
|||
* 新增公告 |
|||
* |
|||
* @param notice 公告信息 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertNotice(Notice notice) |
|||
{ |
|||
notice.setNoticeId(IdUtil.fastSimpleUUID()); |
|||
notice.setCreateBy(ShiroUtils.getLoginName()); |
|||
return noticeMapper.insertNotice(notice); |
|||
} |
|||
|
|||
@Override |
|||
public int addNotice(MultipartFile[] files, Notice notice) { |
|||
String busId = IdUtil.fastSimpleUUID(); |
|||
notice.setNoticeId(busId); |
|||
notice.setCreateBy(ShiroUtils.getLoginName()); |
|||
// 上传文件,并在附件表中添加记录
|
|||
if (ObjectUtil.isNotEmpty(files)) { |
|||
for (MultipartFile file : files) { |
|||
if(file.getOriginalFilename() != null && !"".equals(file.getOriginalFilename())){ |
|||
zdxtFileCommonApi.insertZdxtFile(file, busId, fileUploadApi.upload(file)); |
|||
} |
|||
} |
|||
} |
|||
return noticeMapper.insertNotice(notice); |
|||
} |
|||
|
|||
/** |
|||
* 修改公告 |
|||
* |
|||
* @param notice 公告信息 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateNotice(Notice notice) |
|||
{ |
|||
notice.setUpdateBy(ShiroUtils.getLoginName()); |
|||
return noticeMapper.updateNotice(notice); |
|||
} |
|||
|
|||
@Override |
|||
public int editNoticeFile(MultipartFile[] files, Notice notice) { |
|||
// 上传文件,并在附件表中添加记录
|
|||
if (ObjectUtil.isNotEmpty(files)) { |
|||
for (MultipartFile file : files) { |
|||
if(file.getOriginalFilename() != null && !"".equals(file.getOriginalFilename())){ |
|||
zdxtFileCommonApi.insertZdxtFile(file, notice.getNoticeId(), fileUploadApi.upload(file)); |
|||
} |
|||
} |
|||
} |
|||
notice.setUpdateBy(ShiroUtils.getLoginName()); |
|||
return noticeMapper.updateNotice(notice); |
|||
} |
|||
|
|||
/** |
|||
* 删除公告对象 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteNoticeByIds(String ids) |
|||
{ |
|||
return noticeMapper.deleteNoticeByIds(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
@Override |
|||
public AttFileRespDTO queryFiles(String noticeId) { |
|||
ArrayList<ZdxtFileCommon> fileList = new ArrayList<>(); |
|||
FilePreviewUtilBean filePreviewUtilBean = new FilePreviewUtilBean(); |
|||
if(noticeId ==null || "".equals(noticeId)){ |
|||
return filePreviewUtilBean.attachementToAttFileRespDTO(fileList); |
|||
} |
|||
ZdxtFileBean zdxtFileBeanCondition = new ZdxtFileBean(); |
|||
zdxtFileBeanCondition.setBusinessId(noticeId); |
|||
List<ZdxtFileBean> fileBeanList = zdxtFileCommonApi.selectZdxtFileList(zdxtFileBeanCondition); |
|||
|
|||
for (ZdxtFileBean fileBean : fileBeanList) { |
|||
ZdxtFileCommon zdxtFileCommon = new ZdxtFileCommon(); |
|||
BeanUtil.copyProperties(fileBean, zdxtFileCommon); |
|||
fileList.add(zdxtFileCommon); |
|||
} |
|||
return filePreviewUtilBean.attachementToAttFileRespDTO(fileList); |
|||
} |
|||
|
|||
@Override |
|||
public int removeFile(String key) { |
|||
return zdxtFileCommonApi.deleteZdxtFileById(key); |
|||
} |
|||
} |
|||
package com.zdxt.auth.project.system.notice.service; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import cn.hutool.core.util.IdUtil; |
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.zdxt.auth.dto.ZdxtFileBean; |
|||
import com.zdxt.auth.feign.FileUploadApi; |
|||
import com.zdxt.auth.feign.ZdxtFileCommonApi; |
|||
import com.zdxt.common.zdxtFile.AttFileRespDTO; |
|||
import com.zdxt.common.zdxtFile.FilePreviewUtilBean; |
|||
import com.zdxt.common.zdxtFile.ZdxtFileCommon; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.zdxt.auth.common.utils.security.ShiroUtils; |
|||
import com.zdxt.auth.common.utils.text.Convert; |
|||
import com.zdxt.auth.project.system.notice.mapper.NoticeMapper; |
|||
import com.zdxt.auth.project.system.notice.domain.Notice; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
/** |
|||
* 公告 服务层实现 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2018-06-25 |
|||
*/ |
|||
@Service |
|||
public class NoticeServiceImpl implements INoticeService |
|||
{ |
|||
@Autowired |
|||
private NoticeMapper noticeMapper; |
|||
|
|||
@Autowired |
|||
private ZdxtFileCommonApi zdxtFileCommonApi; |
|||
|
|||
@Autowired |
|||
private FileUploadApi fileUploadApi; |
|||
|
|||
/** |
|||
* 查询公告信息 |
|||
* |
|||
* @param noticeId 公告ID |
|||
* @return 公告信息 |
|||
*/ |
|||
@Override |
|||
public Notice selectNoticeById(String noticeId) |
|||
{ |
|||
Notice notice = noticeMapper.selectNoticeById(noticeId); |
|||
List<ZdxtFileCommon> zdxtFileCommons = zdxtFileCommonApi.selectZdxtFileById(notice.getNoticeId()); |
|||
List<Notice.FileObject> fs = new ArrayList<>(); |
|||
for (ZdxtFileCommon f : zdxtFileCommons) { |
|||
if(zdxtFileCommons != null && zdxtFileCommons.size() > 0){ |
|||
Notice.FileObject fileObject = new Notice.FileObject(); |
|||
fileObject.setFileName(zdxtFileCommons.get(0).getFileName()); |
|||
fileObject.setFileUrl(zdxtFileCommons.get(0).getUploadPath()); |
|||
fs.add(fileObject); |
|||
} |
|||
} |
|||
notice.setFileObjects(fs); |
|||
return notice; |
|||
} |
|||
|
|||
/** |
|||
* 查询公告列表 |
|||
* |
|||
* @param notice 公告信息 |
|||
* @return 公告集合 |
|||
*/ |
|||
@Override |
|||
public List<Notice> selectNoticeList(Notice notice) |
|||
{ |
|||
return noticeMapper.selectNoticeList(notice); |
|||
} |
|||
|
|||
@Override |
|||
public List<Notice> selectNoticeListNoPermission(Notice notice) { |
|||
List<Notice> list = |
|||
noticeMapper.selectNoticeList(notice); |
|||
list.forEach(res ->{ |
|||
List<ZdxtFileCommon> zdxtFileCommons = zdxtFileCommonApi.selectZdxtFileById(res.getNoticeId()); |
|||
if(zdxtFileCommons != null && zdxtFileCommons.size() > 0){ |
|||
Notice.FileObject fileObject = new Notice.FileObject(); |
|||
fileObject.setFileName(zdxtFileCommons.get(0).getFileName()); |
|||
fileObject.setFileUrl(zdxtFileCommons.get(0).getUploadPath()); |
|||
res.setFileObject(fileObject); |
|||
} |
|||
}); |
|||
return list; |
|||
} |
|||
|
|||
/** |
|||
* 新增公告 |
|||
* |
|||
* @param notice 公告信息 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertNotice(Notice notice) |
|||
{ |
|||
notice.setNoticeId(IdUtil.fastSimpleUUID()); |
|||
notice.setCreateBy(ShiroUtils.getLoginName()); |
|||
return noticeMapper.insertNotice(notice); |
|||
} |
|||
|
|||
@Override |
|||
public int addNotice(MultipartFile[] files, Notice notice) { |
|||
String busId = IdUtil.fastSimpleUUID(); |
|||
notice.setNoticeId(busId); |
|||
notice.setCreateBy(ShiroUtils.getLoginName()); |
|||
// 上传文件,并在附件表中添加记录
|
|||
if (ObjectUtil.isNotEmpty(files)) { |
|||
for (MultipartFile file : files) { |
|||
if(file.getOriginalFilename() != null && !"".equals(file.getOriginalFilename())){ |
|||
zdxtFileCommonApi.insertZdxtFile(file, busId, fileUploadApi.upload(file)); |
|||
} |
|||
} |
|||
} |
|||
return noticeMapper.insertNotice(notice); |
|||
} |
|||
|
|||
/** |
|||
* 修改公告 |
|||
* |
|||
* @param notice 公告信息 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateNotice(Notice notice) |
|||
{ |
|||
notice.setUpdateBy(ShiroUtils.getLoginName()); |
|||
return noticeMapper.updateNotice(notice); |
|||
} |
|||
|
|||
@Override |
|||
public int editNoticeFile(MultipartFile[] files, Notice notice) { |
|||
// 上传文件,并在附件表中添加记录
|
|||
if (ObjectUtil.isNotEmpty(files)) { |
|||
for (MultipartFile file : files) { |
|||
if(file.getOriginalFilename() != null && !"".equals(file.getOriginalFilename())){ |
|||
zdxtFileCommonApi.insertZdxtFile(file, notice.getNoticeId(), fileUploadApi.upload(file)); |
|||
} |
|||
} |
|||
} |
|||
notice.setUpdateBy(ShiroUtils.getLoginName()); |
|||
return noticeMapper.updateNotice(notice); |
|||
} |
|||
|
|||
/** |
|||
* 删除公告对象 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteNoticeByIds(String ids) |
|||
{ |
|||
return noticeMapper.deleteNoticeByIds(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
@Override |
|||
public AttFileRespDTO queryFiles(String noticeId) { |
|||
ArrayList<ZdxtFileCommon> fileList = new ArrayList<>(); |
|||
FilePreviewUtilBean filePreviewUtilBean = new FilePreviewUtilBean(); |
|||
if(noticeId ==null || "".equals(noticeId)){ |
|||
return filePreviewUtilBean.attachementToAttFileRespDTO(fileList); |
|||
} |
|||
ZdxtFileBean zdxtFileBeanCondition = new ZdxtFileBean(); |
|||
zdxtFileBeanCondition.setBusinessId(noticeId); |
|||
List<ZdxtFileBean> fileBeanList = zdxtFileCommonApi.selectZdxtFileList(zdxtFileBeanCondition); |
|||
|
|||
for (ZdxtFileBean fileBean : fileBeanList) { |
|||
ZdxtFileCommon zdxtFileCommon = new ZdxtFileCommon(); |
|||
BeanUtil.copyProperties(fileBean, zdxtFileCommon); |
|||
fileList.add(zdxtFileCommon); |
|||
} |
|||
return filePreviewUtilBean.attachementToAttFileRespDTO(fileList); |
|||
} |
|||
|
|||
@Override |
|||
public int removeFile(String key) { |
|||
return zdxtFileCommonApi.deleteZdxtFileById(key); |
|||
} |
|||
} |
|||
|
|||
@ -1,160 +1,161 @@ |
|||
package com.zdxt.code.mapper; |
|||
|
|||
import com.zdxt.code.domain.EnforceRegCount; |
|||
import com.zdxt.code.domain.EnforcementRegistration; |
|||
import com.zdxt.code.domain.SearchType; |
|||
import com.zdxt.code.domain.dto.EnforcementRegistrationDto; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 执法端-执法登记Mapper接口 |
|||
* |
|||
* @author chenrui |
|||
* @date 2024-02-23 |
|||
*/ |
|||
public interface EnforcementRegistrationMapper |
|||
{ |
|||
/** |
|||
* 查询执法端-执法登记 |
|||
* |
|||
* @param id 执法端-执法登记ID |
|||
* @return 执法端-执法登记 |
|||
*/ |
|||
EnforcementRegistration selectEnforcementRegistrationById(String id); |
|||
EnforcementRegistration selectEnforcementRegistrationByLawId(String id); |
|||
|
|||
/** |
|||
* 查询执法端-执法登记列表 |
|||
* |
|||
* @param enforcementRegistration 执法端-执法登记 |
|||
* @return 执法端-执法登记集合 |
|||
*/ |
|||
List<EnforcementRegistration> selectEnforcementRegistrationList(EnforcementRegistration enforcementRegistration); |
|||
|
|||
List<EnforcementRegistration> selectEnforcementRegistrationListNew(EnforcementRegistration enforcementRegistration); |
|||
|
|||
List<EnforcementRegistration> selectEnforcementRegistrationByEpId(EnforcementRegistration enforcementRegistration); |
|||
List<EnforcementRegistration> selectEnforcementRegistrationList1(EnforcementRegistration enforcementRegistration); |
|||
List<EnforcementRegistration> selectEnforcementRegistrationAndAddressList(EnforcementRegistration enforcementRegistration); |
|||
/*substring(i.enterprise_address,INSTR(i.enterprise_address, '深圳市')+3,INSTR(i.enterprise_address, '区')-3)as qy,substring(i.enterprise_address,INSTR(i.enterprise_address, '区')+1,INSTR(i.enterprise_address, '街道')-INSTR(i.enterprise_address, '区')+1)as jd*/ |
|||
List<EnforcementRegistration> selectUnite(EnforcementRegistration enforcementRegistration); |
|||
/** |
|||
* 查询企业端-执法登记列表 |
|||
* |
|||
* @param enforcementRegistration 企业端-执法登记 |
|||
* @return 企业端-执法登记集合 |
|||
*/ |
|||
List<EnforcementRegistration> selectEnterpriseRegistrationList(EnforcementRegistration enforcementRegistration); |
|||
|
|||
/** |
|||
* 新增执法端-执法登记 |
|||
* |
|||
* @param enforcementRegistration 执法端-执法登记 |
|||
* @return 结果 |
|||
*/ |
|||
int insertEnforcementRegistration(EnforcementRegistration enforcementRegistration); |
|||
|
|||
/** |
|||
* 修改执法端-执法登记 |
|||
* |
|||
* @param enforcementRegistration 执法端-执法登记 |
|||
* @return 结果 |
|||
*/ |
|||
int updateEnforcementRegistration(EnforcementRegistration enforcementRegistration); |
|||
|
|||
/** |
|||
* 删除执法端-执法登记 |
|||
* |
|||
* @param id 执法端-执法登记ID |
|||
* @return 结果 |
|||
*/ |
|||
int deleteEnforcementRegistrationById(String id); |
|||
|
|||
/** |
|||
* 批量删除执法端-执法登记 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
int deleteEnforcementRegistrationByIds(String[] ids); |
|||
|
|||
/** |
|||
* 查询企业端-执法部门预约记录列表 |
|||
*/ |
|||
List<EnforceRegCount> countMentByTime(@Param("timeMonth") Long timeMonth, @Param("searchValue") String searchValue); |
|||
List<EnforceRegCount> countMentByTime2(@Param("timeMonth") Long timeMonth, @Param("searchValue") String searchValue); |
|||
|
|||
/** |
|||
* 执法预警-统计执法部门执法数量 |
|||
* @param beginTime |
|||
* @return |
|||
*/ |
|||
List<EnforceRegCount> countMentByTimeLawNew(@Param("beginTime") String beginTime, @Param("endTime") String endTime); |
|||
/** |
|||
* 执法预警-统计企业执法数量 |
|||
* @param beginTime |
|||
* @return |
|||
*/ |
|||
List<EnforceRegCount> countMentByTimeQyNew(@Param("beginTime") String beginTime, @Param("endTime") String endTime); |
|||
|
|||
List<EnforcementRegistration> selectAllList(EnforcementRegistration enforcementRegistration); |
|||
|
|||
/** |
|||
* 统计分析,统计分类列表 |
|||
* @param enforcementRegistrationDto |
|||
* @return |
|||
*/ |
|||
List<EnforcementRegistrationDto> staticEnforcementRegistration(EnforcementRegistrationDto enforcementRegistrationDto); |
|||
List<EnforcementRegistrationDto> staticEnforcementRegistrationLI(EnforcementRegistrationDto enforcementRegistrationDto); |
|||
|
|||
/** |
|||
* 统计分析,统计分类列表 |
|||
* @param enforcementRegistrationDto |
|||
* @return |
|||
*/ |
|||
List<EnforcementRegistrationDto> staticEnforcementRegistrationDetail(EnforcementRegistrationDto enforcementRegistrationDto); |
|||
|
|||
/** |
|||
* 用于移动端统计第一部分 |
|||
* @param searchType |
|||
* @return |
|||
*/ |
|||
List<EnforcementRegistration> selectAppStatisticsPart1(SearchType searchType); |
|||
|
|||
/** |
|||
* 传入userId或bureauDeptId得符合记录的部门 |
|||
* @param searchType |
|||
* @return |
|||
*/ |
|||
List<EnforcementRegistration>selectGroupByDeptList(SearchType searchType); |
|||
/** |
|||
* 传入联合执法批次id和本次执法id--得此次联合执法除本身外的部门 |
|||
* @param enforcementRegistration |
|||
* @return |
|||
*/ |
|||
List<EnforcementRegistration>selectUniteGroupByDeptList(EnforcementRegistration enforcementRegistration); |
|||
/** |
|||
* 传入联合执法批次id和本次执法id--得此次联合执法除本身外的记录 |
|||
* @param enforcementRegistration |
|||
* @return |
|||
*/ |
|||
List<EnforcementRegistration>selectUniteNotItself(EnforcementRegistration enforcementRegistration); |
|||
|
|||
/** |
|||
* 用来 |
|||
* @param enforcementRegistration |
|||
* @return |
|||
*/ |
|||
List<EnforcementRegistration> selectEnforcementRegistrationByUnion(EnforcementRegistration enforcementRegistration); |
|||
|
|||
/** |
|||
* 根据联合检查 |
|||
* |
|||
* @param enforcementRegistration 执法端-执法登记 |
|||
* @return 结果 |
|||
*/ |
|||
int updateRegToUnionFlag(EnforcementRegistration enforcementRegistration); |
|||
} |
|||
package com.zdxt.code.mapper; |
|||
|
|||
import com.zdxt.code.domain.EnforceRegCount; |
|||
import com.zdxt.code.domain.EnforcementRegistration; |
|||
import com.zdxt.code.domain.SearchType; |
|||
import com.zdxt.code.domain.dto.EnforcementRegistrationDto; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 执法端-执法登记Mapper接口 |
|||
* |
|||
* @author chenrui |
|||
* @date 2024-02-23 |
|||
*/ |
|||
public interface EnforcementRegistrationMapper |
|||
{ |
|||
/** |
|||
* 查询执法端-执法登记 |
|||
* |
|||
* @param id 执法端-执法登记ID |
|||
* @return 执法端-执法登记 |
|||
*/ |
|||
EnforcementRegistration selectEnforcementRegistrationById(String id); |
|||
EnforcementRegistration selectEnforcementRegistrationByLawId(String id); |
|||
|
|||
/** |
|||
* 查询执法端-执法登记列表 |
|||
* |
|||
* @param enforcementRegistration 执法端-执法登记 |
|||
* @return 执法端-执法登记集合 |
|||
*/ |
|||
List<EnforcementRegistration> selectEnforcementRegistrationList(EnforcementRegistration enforcementRegistration); |
|||
|
|||
List<EnforcementRegistration> selectEnforcementRegistrationListNew(EnforcementRegistration enforcementRegistration); |
|||
|
|||
List<EnforcementRegistration> selectEnforcementRegistrationByEpId(EnforcementRegistration enforcementRegistration); |
|||
List<EnforcementRegistration> selectEnforcementRegistrationList1(EnforcementRegistration enforcementRegistration); |
|||
List<EnforcementRegistration> selectEnforcementRegistrationAndAddressList(EnforcementRegistration enforcementRegistration); |
|||
/*substring(i.enterprise_address,INSTR(i.enterprise_address, '深圳市')+3,INSTR(i.enterprise_address, '区')-3)as qy,substring(i.enterprise_address,INSTR(i.enterprise_address, '区')+1,INSTR(i.enterprise_address, '街道')-INSTR(i.enterprise_address, '区')+1)as jd*/ |
|||
List<EnforcementRegistration> selectUnite(EnforcementRegistration enforcementRegistration); |
|||
/** |
|||
* 查询企业端-执法登记列表 |
|||
* |
|||
* @param enforcementRegistration 企业端-执法登记 |
|||
* @return 企业端-执法登记集合 |
|||
*/ |
|||
List<EnforcementRegistration> selectEnterpriseRegistrationList(EnforcementRegistration enforcementRegistration); |
|||
|
|||
/** |
|||
* 新增执法端-执法登记 |
|||
* |
|||
* @param enforcementRegistration 执法端-执法登记 |
|||
* @return 结果 |
|||
*/ |
|||
int insertEnforcementRegistration(EnforcementRegistration enforcementRegistration); |
|||
|
|||
/** |
|||
* 修改执法端-执法登记 |
|||
* |
|||
* @param enforcementRegistration 执法端-执法登记 |
|||
* @return 结果 |
|||
*/ |
|||
int updateEnforcementRegistration(EnforcementRegistration enforcementRegistration); |
|||
|
|||
/** |
|||
* 删除执法端-执法登记 |
|||
* |
|||
* @param id 执法端-执法登记ID |
|||
* @return 结果 |
|||
*/ |
|||
int deleteEnforcementRegistrationById(String id); |
|||
|
|||
/** |
|||
* 批量删除执法端-执法登记 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
int deleteEnforcementRegistrationByIds(String[] ids); |
|||
|
|||
/** |
|||
* 查询企业端-执法部门预约记录列表 |
|||
*/ |
|||
List<EnforceRegCount> countMentByTime(@Param("timeMonth") Long timeMonth, @Param("searchValue") String searchValue); |
|||
List<EnforceRegCount> countMentByTime2(@Param("timeMonth") Long timeMonth, @Param("searchValue") String searchValue); |
|||
|
|||
/** |
|||
* 执法预警-统计执法部门执法数量 |
|||
* @param beginTime |
|||
* @return |
|||
*/ |
|||
List<EnforceRegCount> countMentByTimeLawNew(@Param("beginTime") String beginTime, @Param("endTime") String endTime); |
|||
/** |
|||
* 执法预警-统计企业执法数量 |
|||
* @param beginTime |
|||
* @return |
|||
*/ |
|||
List<EnforceRegCount> countMentByTimeQyNew(@Param("beginTime") String beginTime, @Param("endTime") String endTime); |
|||
|
|||
List<EnforcementRegistration> selectAllList(EnforcementRegistration enforcementRegistration); |
|||
|
|||
/** |
|||
* 统计分析,统计分类列表 |
|||
* @param enforcementRegistrationDto |
|||
* @return |
|||
*/ |
|||
List<EnforcementRegistrationDto> staticEnforcementRegistration(EnforcementRegistrationDto enforcementRegistrationDto); |
|||
List<EnforcementRegistrationDto> staticEnforcementRegistrationLI(EnforcementRegistrationDto enforcementRegistrationDto); |
|||
|
|||
/** |
|||
* 统计分析,统计分类列表 |
|||
* @param enforcementRegistrationDto |
|||
* @return |
|||
*/ |
|||
List<EnforcementRegistrationDto> staticEnforcementRegistrationDetail(EnforcementRegistrationDto enforcementRegistrationDto); |
|||
|
|||
/** |
|||
* 用于移动端统计第一部分 |
|||
* @param searchType |
|||
* @return |
|||
*/ |
|||
List<EnforcementRegistration> selectAppStatisticsPart1(SearchType searchType); |
|||
|
|||
/** |
|||
* 传入userId或bureauDeptId得符合记录的部门 |
|||
* @param searchType |
|||
* @return |
|||
*/ |
|||
List<EnforcementRegistration>selectGroupByDeptList(SearchType searchType); |
|||
/** |
|||
* 传入联合执法批次id和本次执法id--得此次联合执法除本身外的部门 |
|||
* @param enforcementRegistration |
|||
* @return |
|||
*/ |
|||
List<EnforcementRegistration>selectUniteGroupByDeptList(EnforcementRegistration enforcementRegistration); |
|||
/** |
|||
* 传入联合执法批次id和本次执法id--得此次联合执法除本身外的记录 |
|||
* @param enforcementRegistration |
|||
* @return |
|||
*/ |
|||
List<EnforcementRegistration>selectUniteNotItself(EnforcementRegistration enforcementRegistration); |
|||
|
|||
/** |
|||
* 用来 |
|||
* @param enforcementRegistration |
|||
* @return |
|||
*/ |
|||
List<EnforcementRegistration> selectEnforcementRegistrationByUnion(EnforcementRegistration enforcementRegistration); |
|||
int outTimeByUnion(EnforcementRegistration enforcementRegistration); |
|||
|
|||
/** |
|||
* 根据联合检查 |
|||
* |
|||
* @param enforcementRegistration 执法端-执法登记 |
|||
* @return 结果 |
|||
*/ |
|||
int updateRegToUnionFlag(EnforcementRegistration enforcementRegistration); |
|||
} |
|||
|
|||
Loading…
Reference in new issue