|
@@ -9,7 +9,10 @@ import com.qmth.paper.library.business.entity.PaperScanTask;
|
|
|
import com.qmth.paper.library.business.mapper.PaperArchivesMapper;
|
|
|
import com.qmth.paper.library.business.service.PaperArchivesService;
|
|
|
import com.qmth.paper.library.business.service.PaperScanTaskService;
|
|
|
+import com.qmth.paper.library.common.contant.SystemConstant;
|
|
|
+import com.qmth.paper.library.common.entity.SysUser;
|
|
|
import com.qmth.paper.library.common.enums.ExceptionResultEnum;
|
|
|
+import com.qmth.paper.library.common.util.ServletUtil;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -31,6 +34,23 @@ public class PaperArchivesServiceImpl extends ServiceImpl<PaperArchivesMapper, P
|
|
|
return this.baseMapper.pageData(new Page<>(pageNumber, pageSize), semesterId, managerOrgId, archivesTypeId, archivesName);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean saveData(PaperArchives paperArchives) {
|
|
|
+ SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
+ Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
+ // todo 生成档案编号
|
|
|
+
|
|
|
+ PaperArchives archives = this.baseMapper.selectByArchivesName(schoolId, paperArchives.getArchivesName());
|
|
|
+ if (archives != null) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("档案名称已存在");
|
|
|
+ }
|
|
|
+ paperArchives.setId(SystemConstant.getDbUuid());
|
|
|
+ paperArchives.setSchoolId(schoolId);
|
|
|
+ paperArchives.setCreateId(sysUser.getId());
|
|
|
+ paperArchives.setCreateTime(System.currentTimeMillis());
|
|
|
+ return this.save(paperArchives);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public boolean delete(Long id) {
|
|
|
PaperArchives paperArchives = this.getById(id);
|
|
@@ -45,11 +65,4 @@ public class PaperArchivesServiceImpl extends ServiceImpl<PaperArchivesMapper, P
|
|
|
return this.removeById(id);
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public boolean saveData(PaperArchives paperArchives) {
|
|
|
- // todo 生成档案编号
|
|
|
-
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
}
|