+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 档案部门排序表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-07-30
+ */
+@Data
+public class ArchivesDeptDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * 归属部门
+ */
+ private String dept;
+
+ /**
+ * 排序
+ */
+ private Integer deptOrder;
+
+ /**
+ * 归属部门ID
+ */
+ private Long deptId;
+
+ /**
+ * 删除标识 0-否,1-是
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archives/service/impl/ArchivesServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archives/service/impl/ArchivesServiceImpl.java
index 5c17a5c5..d2cff7f2 100644
--- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archives/service/impl/ArchivesServiceImpl.java
+++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archives/service/impl/ArchivesServiceImpl.java
@@ -43,6 +43,7 @@ import com.elink.esua.epdc.modules.archives.entity.ArchivesEntity;
import com.elink.esua.epdc.modules.archives.excel.ArchivesExcel;
import com.elink.esua.epdc.modules.archives.redis.ArchivesRedis;
import com.elink.esua.epdc.modules.archives.service.ArchivesService;
+import com.elink.esua.epdc.modules.archivesdept.service.ArchivesDeptService;
import com.elink.esua.epdc.modules.feign.AdminFeignClient;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -71,6 +72,9 @@ public class ArchivesServiceImpl extends BaseServiceImpl page(Map params) {
IPage page = baseDao.selectPage(
@@ -87,8 +91,8 @@ public class ArchivesServiceImpl extends BaseServiceImpl getWrapper(Map params){
- String id = (String)params.get(FieldConstant.ID_HUMP);
+ private QueryWrapper getWrapper(Map params) {
+ String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@@ -99,8 +103,8 @@ public class ArchivesServiceImpl extends BaseServiceImpl parentAndAllDept = adminFeignClient.getParentAndAllDept(dto.getDeptId());
- if(!parentAndAllDept.success() || parentAndAllDept.getData() == null){
+ if (!parentAndAllDept.success() || parentAndAllDept.getData() == null) {
throw new RenException("获取归属部门信息失败");
}
//判断档号
- if(baseDao.getArchivesDTOByArchivesNum("",dto.getArchivesNum())){
+ if (baseDao.getArchivesDTOByArchivesNum("", dto.getArchivesNum())) {
throw new RenException("档号不能重复");
}
//判断日期
- if(dto.getArchiveTime().length()!=4 && dto.getArchiveTime().length()!=6 && dto.getArchiveTime().length()!=8) {
+ if (dto.getArchiveTime().length() != 4 && dto.getArchiveTime().length() != 6 && dto.getArchiveTime().length() != 8) {
throw new RenException("日期格式错误");
}
ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData();
@@ -133,25 +137,27 @@ public class ArchivesServiceImpl extends BaseServiceImpl parentAndAllDept = adminFeignClient.getParentAndAllDept(dto.getDeptId());
- if(!parentAndAllDept.success() || parentAndAllDept.getData() == null){
+ if (!parentAndAllDept.success() || parentAndAllDept.getData() == null) {
throw new RenException("获取归属部门信息失败");
}
//判断档号
- if(baseDao.getArchivesDTOByArchivesNum(dto.getId(),dto.getArchivesNum())){
+ if (baseDao.getArchivesDTOByArchivesNum(dto.getId(), dto.getArchivesNum())) {
throw new RenException("档号不能重复");
}
//判断日期
- if(dto.getArchiveTime().length()!=4 && dto.getArchiveTime().length()!=6 && dto.getArchiveTime().length()!=8) {
+ if (dto.getArchiveTime().length() != 4 && dto.getArchiveTime().length() != 6 && dto.getArchiveTime().length() != 8) {
throw new RenException("日期格式错误");
}
ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData();
@@ -162,6 +168,8 @@ public class ArchivesServiceImpl extends BaseServiceImpl parentAndAllDept = adminFeignClient.getParentAndAllDept(Long.parseLong(deptId));
- if(!parentAndAllDept.success() || parentAndAllDept.getData() == null){
+ if (!parentAndAllDept.success() || parentAndAllDept.getData() == null) {
throw new RenException("获取归属部门信息失败");
}
ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData();
@@ -212,10 +220,10 @@ public class ArchivesServiceImpl extends BaseServiceImpl archivesExcelList = ExcelImportUtil.importExcel(f, ArchivesExcel.class, importParams);
// 校验数据
List epdcArchivesErroyResultDTOS = this.checkExcel(archivesExcelList);
- if(epdcArchivesErroyResultDTOS.size()>0){
+ if (epdcArchivesErroyResultDTOS.size() > 0) {
return new Result().ok(epdcArchivesErroyResultDTOS);
}
- saveList(archivesExcelList,parentAndAllDeptDTO);
+ saveList(archivesExcelList, parentAndAllDeptDTO);
for (ArchivesExcel archivesExcel : archivesExcelList) {
System.out.println("从Excel导入数据到数据库的详细为 :{}" + JSON.toJSONString(archivesExcel));
}
@@ -231,7 +239,7 @@ public class ArchivesServiceImpl extends BaseServiceImpl listArchiveDeptInfo = this.baseDao.selectListArchiveDeptInfo(formDTO);
+ List listArchiveDeptInfo = this.baseDao.selectListArchiveDeptInfo(formDTO);
return new Result().ok(listArchiveDeptInfo);
}
@@ -240,7 +248,7 @@ public class ArchivesServiceImpl extends BaseServiceImpl listArchiveInfo = this.baseDao.selectListArchiveInfo(formDTO);
+ List listArchiveInfo = this.baseDao.selectListArchiveInfo(formDTO);
return new Result().ok(listArchiveInfo);
}
@@ -258,10 +266,10 @@ public class ArchivesServiceImpl extends BaseServiceImpl partyList, ParentAndAllDeptDTO parentAndAllDeptDTO) {
List archivesEntityList = new ArrayList<>();
- for(ArchivesExcel archivesExcel : partyList){
+ for (ArchivesExcel archivesExcel : partyList) {
ArchivesEntity archivesEntity = ConvertUtils.sourceToTarget(archivesExcel, ArchivesEntity.class);
- if(archivesExcel.getArchiveTime().length()!=4 && archivesExcel.getArchiveTime().length()!=6 && archivesExcel.getArchiveTime().length()!=8) {
+ if (archivesExcel.getArchiveTime().length() != 4 && archivesExcel.getArchiveTime().length() != 6 && archivesExcel.getArchiveTime().length() != 8) {
throw new RenException("日期格式错误");
}
archivesEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds());
@@ -273,6 +281,10 @@ public class ArchivesServiceImpl extends BaseServiceImpl checkExcel(List archivesList) {
List archivesEntityList = baseDao.selectList(new QueryWrapper());
- List errorLineinfoList=new ArrayList<>();
+ List errorLineinfoList = new ArrayList<>();
EpdcArchivesErroyResultDTO errorLineinfoDto;
for (int i = 0; i < archivesList.size(); i++) {
ArchivesExcel archivesExcel = archivesList.get(i);
@@ -296,47 +308,47 @@ public class ArchivesServiceImpl extends BaseServiceImpl
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.archivesdept.controller;
+
+import com.elink.esua.epdc.commons.tools.page.PageData;
+import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
+import com.elink.esua.epdc.commons.tools.utils.Result;
+import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
+import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
+import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
+import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
+import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
+import com.elink.esua.epdc.dto.ArchivesDeptDTO;
+import com.elink.esua.epdc.modules.archivesdept.excel.ArchivesDeptExcel;
+import com.elink.esua.epdc.modules.archivesdept.service.ArchivesDeptService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 档案部门排序表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-07-30
+ */
+@RestController
+@RequestMapping("archivesdept")
+public class ArchivesDeptController {
+
+ @Autowired
+ private ArchivesDeptService archivesDeptService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = archivesDeptService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ ArchivesDeptDTO data = archivesDeptService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody ArchivesDeptDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ archivesDeptService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody ArchivesDeptDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ archivesDeptService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ archivesDeptService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = archivesDeptService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, ArchivesDeptExcel.class);
+ }
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/dao/ArchivesDeptDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/dao/ArchivesDeptDao.java
new file mode 100644
index 00000000..a7b9e15d
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/dao/ArchivesDeptDao.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.archivesdept.dao;
+
+import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
+import com.elink.esua.epdc.modules.archivesdept.entity.ArchivesDeptEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 档案部门排序表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-07-30
+ */
+@Mapper
+public interface ArchivesDeptDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/entity/ArchivesDeptEntity.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/entity/ArchivesDeptEntity.java
new file mode 100644
index 00000000..7398406e
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/entity/ArchivesDeptEntity.java
@@ -0,0 +1,56 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.archivesdept.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 档案部门排序表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-07-30
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("epdc_archives_dept")
+public class ArchivesDeptEntity extends BaseEpdcEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 归属部门
+ */
+ private String dept;
+
+ /**
+ * 归属部门ID
+ */
+ private Long deptId;
+
+ /**
+ * 排序
+ */
+ private Integer deptOrder;
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/excel/ArchivesDeptExcel.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/excel/ArchivesDeptExcel.java
new file mode 100644
index 00000000..f12a39de
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/excel/ArchivesDeptExcel.java
@@ -0,0 +1,62 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.archivesdept.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 档案部门排序表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-07-30
+ */
+@Data
+public class ArchivesDeptExcel {
+
+ @Excel(name = "主键")
+ private String id;
+
+ @Excel(name = "归属部门")
+ private String dept;
+
+ @Excel(name = "归属部门ID")
+ private Long deptId;
+
+ @Excel(name = "删除标识 0-否,1-是")
+ private String delFlag;
+
+ @Excel(name = "乐观锁")
+ private Integer revision;
+
+ @Excel(name = "创建人")
+ private String createdBy;
+
+ @Excel(name = "创建时间")
+ private Date createdTime;
+
+ @Excel(name = "更新人")
+ private String updatedBy;
+
+ @Excel(name = "更新时间")
+ private Date updatedTime;
+
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/redis/ArchivesDeptRedis.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/redis/ArchivesDeptRedis.java
new file mode 100644
index 00000000..c438827f
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/redis/ArchivesDeptRedis.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.archivesdept.redis;
+
+import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 档案部门排序表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-07-30
+ */
+@Component
+public class ArchivesDeptRedis {
+ @Autowired
+ private RedisUtils redisUtils;
+
+ public void delete(Object[] ids) {
+
+ }
+
+ public void set(){
+
+ }
+
+ public String get(String id){
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/service/ArchivesDeptService.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/service/ArchivesDeptService.java
new file mode 100644
index 00000000..812b9093
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/service/ArchivesDeptService.java
@@ -0,0 +1,105 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *