处理提交
This commit is contained in:
51
JeeThink-archives/pom.xml
Normal file
51
JeeThink-archives/pom.xml
Normal file
@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>jeethink</artifactId>
|
||||
<groupId>com.jeethink</groupId>
|
||||
<version>3.1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<description>
|
||||
archives
|
||||
</description>
|
||||
<artifactId>jeethink-archives</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
</dependency>
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.jeethink</groupId>
|
||||
<artifactId>jeethink-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>1.5.21</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jeethink</groupId>
|
||||
<artifactId>jeethink-system</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jeethink</groupId>
|
||||
<artifactId>jeethink-framework</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -0,0 +1,355 @@
|
||||
package com.jeethink.bean.domain;
|
||||
|
||||
import com.jeethink.common.annotation.Excel;
|
||||
import com.jeethink.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 人事档案接收对象 archives_master
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-08
|
||||
*/
|
||||
public class ArchivesMaster extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private String archivesId;
|
||||
|
||||
/** 档案标题(职工编码+姓名,如10000001张三) */
|
||||
@Excel(name = "档案标题")
|
||||
private String name;
|
||||
|
||||
/** 档案编号(类型缩写+职工编码+人事档案类别码+四位文件序号,如RS1000000011000) */
|
||||
@Excel(name = "档案编号")
|
||||
private String archiveNo;
|
||||
|
||||
/** 档案类型(0人事档案,1健康档案,2培训档案) */
|
||||
@Excel(name = "档案类别", readConverterExp = "0=人事档案,1=健康档案,2=培训档案")
|
||||
private String type;
|
||||
|
||||
/** 档案人员类别 */
|
||||
@Excel(name = "档案人员类别", readConverterExp = "0=管理人员,1=专业技术人员,2=员工")
|
||||
private String peopleType;
|
||||
|
||||
/** 层级 */
|
||||
@Excel(name = "层级", readConverterExp = "0=案卷级")
|
||||
private String tier;
|
||||
|
||||
/** 密级 */
|
||||
@Excel(name = "密级", readConverterExp = "0=绝密,1=机密,2=秘密")
|
||||
private String classified;
|
||||
|
||||
/** 保管期限 */
|
||||
@Excel(name = "保管期限", readConverterExp = "0=永久,1=30年,2=20年,3=10年")
|
||||
private String duration;
|
||||
|
||||
/** 是否为纸质档案(0是,1否) */
|
||||
private String ifPaper;
|
||||
|
||||
/** 归档人ID */
|
||||
private Long gdPeopleId;
|
||||
|
||||
/** 对应用户的id */
|
||||
private Long userId;
|
||||
|
||||
/** 创建用户 */
|
||||
private Long createUser;
|
||||
|
||||
/** 更新用户 */
|
||||
private Long updateUser;
|
||||
|
||||
private String nowStatus;
|
||||
/** 逻辑删除字段,是否删除 ,0为是,1为否 */
|
||||
private String deleted;
|
||||
|
||||
@Excel(name = "员工姓名")
|
||||
private String nickName;
|
||||
@Excel(name = "员工编号")
|
||||
private String userNumber;
|
||||
|
||||
private Long deptId;
|
||||
private String deptName;
|
||||
|
||||
private String updaterName;
|
||||
|
||||
private Integer expire; //剩余过期天数
|
||||
private String stage; //所处阶段:recevie接收,destroy销毁
|
||||
private Boolean isBorrowed;
|
||||
|
||||
private String warehouseType;//所在仓库
|
||||
|
||||
@Excel(name = "检查医院")
|
||||
private String checkHospital;
|
||||
@Excel(name = "检查结论")
|
||||
private String checkConclusion;
|
||||
@Excel(name = "检查日期")
|
||||
private Date checkDate;
|
||||
@Excel(name = "检查年份")
|
||||
private String jkFileDate;
|
||||
|
||||
public String getJkFileDate() {
|
||||
return jkFileDate;
|
||||
}
|
||||
|
||||
public void setJkFileDate(String jkFileDate) {
|
||||
this.jkFileDate = jkFileDate;
|
||||
}
|
||||
|
||||
public String getCheckHospital() {
|
||||
return checkHospital;
|
||||
}
|
||||
|
||||
public void setCheckHospital(String checkHospital) {
|
||||
this.checkHospital = checkHospital;
|
||||
}
|
||||
|
||||
public String getCheckConclusion() {
|
||||
return checkConclusion;
|
||||
}
|
||||
|
||||
public void setCheckConclusion(String checkConclusion) {
|
||||
this.checkConclusion = checkConclusion;
|
||||
}
|
||||
|
||||
public Date getCheckDate() {
|
||||
return checkDate;
|
||||
}
|
||||
|
||||
public void setCheckDate(Date checkDate) {
|
||||
this.checkDate = checkDate;
|
||||
}
|
||||
|
||||
public String getUserNumber() {
|
||||
return userNumber;
|
||||
}
|
||||
|
||||
public void setUserNumber(String userNumber) {
|
||||
this.userNumber = userNumber;
|
||||
}
|
||||
|
||||
public void setArchivesId(String archivesId)
|
||||
{
|
||||
this.archivesId = archivesId;
|
||||
}
|
||||
|
||||
public String getArchivesId()
|
||||
{
|
||||
return archivesId;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setArchiveNo(String archiveNo)
|
||||
{
|
||||
this.archiveNo = archiveNo;
|
||||
}
|
||||
|
||||
public String getArchiveNo()
|
||||
{
|
||||
return archiveNo;
|
||||
}
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setPeopleType(String peopleType)
|
||||
{
|
||||
this.peopleType = peopleType;
|
||||
}
|
||||
|
||||
public String getPeopleType()
|
||||
{
|
||||
return peopleType;
|
||||
}
|
||||
public void setTier(String tier)
|
||||
{
|
||||
this.tier = tier;
|
||||
}
|
||||
|
||||
public String getTier()
|
||||
{
|
||||
return tier;
|
||||
}
|
||||
public void setClassified(String classified)
|
||||
{
|
||||
this.classified = classified;
|
||||
}
|
||||
|
||||
public String getClassified()
|
||||
{
|
||||
return classified;
|
||||
}
|
||||
public void setDuration(String duration)
|
||||
{
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public String getDuration()
|
||||
{
|
||||
return duration;
|
||||
}
|
||||
public void setIfPaper(String ifPaper)
|
||||
{
|
||||
this.ifPaper = ifPaper;
|
||||
}
|
||||
|
||||
public String getIfPaper()
|
||||
{
|
||||
return ifPaper;
|
||||
}
|
||||
public void setGdPeopleId(Long gdPeopleId)
|
||||
{
|
||||
this.gdPeopleId = gdPeopleId;
|
||||
}
|
||||
|
||||
public Long getGdPeopleId()
|
||||
{
|
||||
return gdPeopleId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setCreateUser(Long createUser)
|
||||
{
|
||||
this.createUser = createUser;
|
||||
}
|
||||
|
||||
public Long getCreateUser()
|
||||
{
|
||||
return createUser;
|
||||
}
|
||||
public void setUpdateUser(Long updateUser)
|
||||
{
|
||||
this.updateUser = updateUser;
|
||||
}
|
||||
|
||||
public Long getUpdateUser()
|
||||
{
|
||||
return updateUser;
|
||||
}
|
||||
public void setDeleted(String deleted)
|
||||
{
|
||||
this.deleted = deleted;
|
||||
}
|
||||
|
||||
public String getDeleted()
|
||||
{
|
||||
return deleted;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getNickName() {
|
||||
return nickName;
|
||||
}
|
||||
|
||||
public void setNickName(String nickName) {
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getNowStatus() {
|
||||
return nowStatus;
|
||||
}
|
||||
|
||||
public void setNowStatus(String nowStatus) {
|
||||
this.nowStatus = nowStatus;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUpdaterName() {
|
||||
return updaterName;
|
||||
}
|
||||
|
||||
public void setUpdaterName(String updaterName) {
|
||||
this.updaterName = updaterName;
|
||||
}
|
||||
|
||||
public Integer getExpire() {
|
||||
return expire;
|
||||
}
|
||||
|
||||
public void setExpire(Integer expire) {
|
||||
this.expire = expire;
|
||||
}
|
||||
|
||||
public String getStage() {
|
||||
return stage;
|
||||
}
|
||||
|
||||
public void setStage(String stage) {
|
||||
this.stage = stage;
|
||||
}
|
||||
|
||||
public Boolean getIsBorrowed() {
|
||||
return isBorrowed;
|
||||
}
|
||||
|
||||
public void setIsBorrowed(Boolean isBorrowed) {
|
||||
this.isBorrowed = isBorrowed;
|
||||
}
|
||||
|
||||
public String getWarehouseType() {
|
||||
return warehouseType;
|
||||
}
|
||||
|
||||
public void setWarehouseType(String warehouseType) {
|
||||
this.warehouseType = warehouseType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("archivesId", getArchivesId())
|
||||
.append("name", getName())
|
||||
.append("archiveNo", getArchiveNo())
|
||||
.append("type", getType())
|
||||
.append("peopleType", getPeopleType())
|
||||
.append("tier", getTier())
|
||||
.append("classified", getClassified())
|
||||
.append("duration", getDuration())
|
||||
.append("ifPaper", getIfPaper())
|
||||
.append("gdPeopleId", getGdPeopleId())
|
||||
.append("userId", getUserId())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("createUser", getCreateUser())
|
||||
.append("updateUser", getUpdateUser())
|
||||
.append("deleted", getDeleted())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.jeethink.bean.vo;
|
||||
|
||||
public class Approval {
|
||||
|
||||
//档案ID
|
||||
private String objectId;
|
||||
//状态:pass:通过,reject:不通过
|
||||
private String status;
|
||||
//备注,不通过的理由
|
||||
private String remark;
|
||||
|
||||
public String getObjectId() {
|
||||
return objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(String objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
}
|
@ -0,0 +1,207 @@
|
||||
package com.jeethink.dataCenter.controller;
|
||||
|
||||
import com.jeethink.common.constant.Constants;
|
||||
import com.jeethink.common.constant.UserConstants;
|
||||
import com.jeethink.common.core.controller.BaseController;
|
||||
import com.jeethink.common.core.domain.AjaxResult;
|
||||
import com.jeethink.common.utils.SecurityUtils;
|
||||
import com.jeethink.common.utils.StringUtils;
|
||||
import com.jeethink.dataCenter.domain.Warehouse;
|
||||
import com.jeethink.dataCenter.service.IWarehouseService;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库房信息
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/datacenter/warehouse")
|
||||
public class WarehouseController extends BaseController
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private IWarehouseService warehouseService;
|
||||
|
||||
/**
|
||||
* 获取库房列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('datacenter:warehouse:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(Warehouse warehouse)
|
||||
{
|
||||
|
||||
List<Warehouse> warehouseList = warehouseService.selectWarehouseList(warehouse);
|
||||
return AjaxResult.success(warehouseList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询库房树数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('datacenter:warehouse:list')")
|
||||
@GetMapping("/tree")
|
||||
public AjaxResult tree()
|
||||
{
|
||||
List<Warehouse> list = warehouseService.selectWarehouseList(new Warehouse());
|
||||
Iterator<Warehouse> it = list.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
Warehouse wh = it.next();
|
||||
if (wh.getLevel() >= Constants.WAREHOUSE_LEVEL_MAX) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询库房树数据(排除节点)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('datacenter:warehouse:list')")
|
||||
@GetMapping("/tree/exclude/{id}")
|
||||
public AjaxResult excludeChild(@PathVariable(value = "id", required = false) Long id)
|
||||
{
|
||||
Warehouse warehouse = warehouseService.selectWarehouseById(id);
|
||||
List<Warehouse> warehouseList = warehouseService.selectWarehouseList(new Warehouse());
|
||||
Iterator<Warehouse> it = warehouseList.listIterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
Warehouse wh = it.next();
|
||||
if (wh.getId().intValue() == id
|
||||
|| ArrayUtils.contains(StringUtils.split(wh.getAncestors(), ","), id + "")
|
||||
|| wh.getLevel() >= Constants.WAREHOUSE_LEVEL_MAX)
|
||||
{
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(warehouseList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键获取详情
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('datacenter:warehouse:query')")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id)
|
||||
{
|
||||
return AjaxResult.success(warehouseService.selectWarehouseById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库房
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('datacenter:warehouse:add')")
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody Warehouse warehouse)
|
||||
{
|
||||
if (StringUtils.isNotNull(warehouse.getRelaUser()))
|
||||
{
|
||||
if (warehouse.getLevel() < Constants.WAREHOUSE_LEVEL_MAX)//层级为4(档案卷)才能关联人
|
||||
{
|
||||
return AjaxResult.error("新增库房“" + warehouse.getName() + "”失败,该等级不能关联人员");
|
||||
}
|
||||
else
|
||||
{
|
||||
List<Warehouse> list = warehouseService.selectWarehouseByRelaUser(warehouse.getRelaUser());
|
||||
if (list.size() > 0) {
|
||||
return AjaxResult.error("新增库房“" + warehouse.getName() + "”失败,关联人员已与“"+list.get(0).getName()+"”关联");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
warehouse.setCreateBy(SecurityUtils.getUsername());
|
||||
warehouse.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(warehouseService.insertWarehouse(warehouse));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库房
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('datacenter:warehouse:edit')")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody Warehouse warehouse)
|
||||
{
|
||||
if (StringUtils.isNotNull(warehouse.getRelaUser()))
|
||||
{
|
||||
if (warehouse.getLevel() < Constants.WAREHOUSE_LEVEL_MAX)//层级为4(档案卷)才能关联人
|
||||
{
|
||||
return AjaxResult.error("修改库房“" + warehouse.getName() + "”失败,该等级不能关联人员");
|
||||
}
|
||||
else
|
||||
{
|
||||
List<Warehouse> list = warehouseService.selectWarehouseByRelaUser(warehouse.getRelaUser());
|
||||
if (list.size() > 1) {
|
||||
return AjaxResult.error("修改库房“" + warehouse.getName() + "”失败,关联人员已与其他库房关联");
|
||||
}
|
||||
if (list.size() > 0 && !list.get(0).getId().equals(warehouse.getId())) {
|
||||
return AjaxResult.error("修改库房“" + warehouse.getName() + "”失败,关联人员已与“"+list.get(0).getName()+"”关联");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (warehouse.getParentId().equals(warehouse.getId()))
|
||||
{
|
||||
return AjaxResult.error("修改库房'" + warehouse.getName() + "'失败,上级库房不能是自己");
|
||||
}
|
||||
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, warehouse.getStatus())
|
||||
&& warehouseService.selectNormalChildrenById(warehouse.getId()) > 0)
|
||||
{
|
||||
return AjaxResult.error("该库房包含未停用的子库房!");
|
||||
}
|
||||
warehouse.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(warehouseService.updateWarehouse(warehouse));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库房
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('datacenter:warehouse:remove')")
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable Long id)
|
||||
{
|
||||
if (warehouseService.hasChildById(id))
|
||||
{
|
||||
return AjaxResult.error("存在下级库房,不允许删除");
|
||||
}
|
||||
return toAjax(warehouseService.deleteWarehouseById(id));
|
||||
}
|
||||
|
||||
@PostMapping("/realArchives")
|
||||
public AjaxResult realArchives(@Validated @RequestBody HashMap hashMap){
|
||||
List<String> list = (List<String>) hashMap.get("list");
|
||||
Long id = Long.valueOf((Integer) hashMap.get("id"));
|
||||
String ancestorsId = (String) hashMap.get("ancestorsId");
|
||||
int i = 0;
|
||||
warehouseService.deleteArchives(id);
|
||||
if(list.size()>0){
|
||||
for(String archivesId : list){
|
||||
String name=warehouseService.selectArchivesById(archivesId);
|
||||
Warehouse warehouse = new Warehouse();
|
||||
warehouse.setParentId(id);
|
||||
warehouse.setArchivesId(archivesId);
|
||||
warehouse.setAncestors(ancestorsId);
|
||||
warehouse.setCreateBy(SecurityUtils.getUsername());
|
||||
warehouse.setUpdateBy(SecurityUtils.getUsername());
|
||||
warehouse.setLevel(5);
|
||||
warehouse.setStatus("0");
|
||||
warehouse.setOrderNum(i);
|
||||
warehouse.setName(name);
|
||||
warehouseService.insertWarehouse(warehouse);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
@GetMapping("/selectArchives/{parentId}")
|
||||
public AjaxResult selectArchives(@PathVariable Long parentId)
|
||||
{
|
||||
return AjaxResult.success(warehouseService.selectArchivesByParentId(parentId));
|
||||
}
|
||||
}
|
@ -0,0 +1,171 @@
|
||||
package com.jeethink.dataCenter.domain;
|
||||
|
||||
import com.jeethink.common.core.domain.BaseEntity;
|
||||
|
||||
public class Warehouse extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 库房ID */
|
||||
private Long id;
|
||||
|
||||
/** 库房名 */
|
||||
private String name;
|
||||
|
||||
/** 祖籍列表 */
|
||||
private String ancestors;
|
||||
|
||||
/** 层级:0:库,1:室,2:架,3:层,4:卷;最高4级 */
|
||||
private Integer level;
|
||||
/** 父库房 */
|
||||
private Long parentId;
|
||||
/** 描述 */
|
||||
private String description;
|
||||
/** 状态:0正常,1停用 */
|
||||
private String status;
|
||||
/** 关联人员:只有层级为4时,才可有值 */
|
||||
private Long relaUser;
|
||||
/** 排序 */
|
||||
private Integer orderNum;
|
||||
|
||||
/** 关联人员名 */
|
||||
private String relaUserName;
|
||||
|
||||
//所有父级名称
|
||||
private String parentsName;
|
||||
|
||||
private String wlh;
|
||||
private String lwz;
|
||||
private String ch;
|
||||
private String jh;
|
||||
|
||||
private String archivesId;
|
||||
|
||||
public String getArchivesId() {
|
||||
return archivesId;
|
||||
}
|
||||
|
||||
public void setArchivesId(String archivesId) {
|
||||
this.archivesId = archivesId;
|
||||
}
|
||||
|
||||
public String getWlh() {
|
||||
return wlh;
|
||||
}
|
||||
|
||||
public void setWlh(String wlh) {
|
||||
this.wlh = wlh;
|
||||
}
|
||||
|
||||
public String getLwz() {
|
||||
return lwz;
|
||||
}
|
||||
|
||||
public void setLwz(String lwz) {
|
||||
this.lwz = lwz;
|
||||
}
|
||||
|
||||
public String getCh() {
|
||||
return ch;
|
||||
}
|
||||
|
||||
public void setCh(String ch) {
|
||||
this.ch = ch;
|
||||
}
|
||||
|
||||
public String getJh() {
|
||||
return jh;
|
||||
}
|
||||
|
||||
public void setJh(String jh) {
|
||||
this.jh = jh;
|
||||
}
|
||||
|
||||
public String getParentsName() {
|
||||
return parentsName;
|
||||
}
|
||||
|
||||
public void setParentsName(String parentsName) {
|
||||
this.parentsName = parentsName;
|
||||
}
|
||||
|
||||
public Long getRelaUser() {
|
||||
return relaUser;
|
||||
}
|
||||
|
||||
public void setRelaUser(Long relaUser) {
|
||||
this.relaUser = relaUser;
|
||||
}
|
||||
|
||||
public String getRelaUserName() {
|
||||
return relaUserName;
|
||||
}
|
||||
|
||||
public void setRelaUserName(String relaUserName) {
|
||||
this.relaUserName = relaUserName;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(Integer level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public Long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getOrderNum() {
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(Integer orderNum) {
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
public String getAncestors() {
|
||||
return ancestors;
|
||||
}
|
||||
|
||||
public void setAncestors(String ancestors) {
|
||||
this.ancestors = ancestors;
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.jeethink.dataCenter.mapper;
|
||||
|
||||
import com.jeethink.dataCenter.domain.Warehouse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库房Mapper接口
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
public interface WarehouseMapper {
|
||||
|
||||
/**
|
||||
* 查询库房数据
|
||||
*
|
||||
* @param warehouse 库房信息
|
||||
* @return 库房信息集合
|
||||
*/
|
||||
List<Warehouse> selectWarehouseList(Warehouse warehouse);
|
||||
|
||||
/**
|
||||
* 根据库房ID查询信息
|
||||
*
|
||||
* @param id 库房ID
|
||||
* @return 库房信息
|
||||
*/
|
||||
Warehouse selectWarehouseById(Long id);
|
||||
|
||||
/**
|
||||
* 校验库房名称是否唯一
|
||||
*
|
||||
* @param name 库房名称
|
||||
* @param parentId 父库房ID
|
||||
* @return 信息
|
||||
*/
|
||||
Warehouse checkNameUnique(@Param("name") String name, @Param("parentId") Long parentId);
|
||||
|
||||
/**
|
||||
* 新增库房信息
|
||||
*
|
||||
* @param warehouse 库房信息
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWarehouse(Warehouse warehouse);
|
||||
|
||||
/**
|
||||
* 根据ID查询所有正常状态的所有子库房
|
||||
*
|
||||
* @param id 库房ID
|
||||
* @return 子库房数
|
||||
*/
|
||||
int selectNormalChildrenById(Long id);
|
||||
|
||||
/**
|
||||
* 修改库房信息
|
||||
*
|
||||
* @param warehouse 库房信息
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWarehouse(Warehouse warehouse);
|
||||
|
||||
/**
|
||||
* 获取ID子库房集合
|
||||
*
|
||||
* @param id 库房ID
|
||||
* @return 子库房合集
|
||||
*/
|
||||
List<Warehouse> getChildList(Long id);
|
||||
|
||||
/**
|
||||
* 删除库房信息
|
||||
*
|
||||
* @param id 库房ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWarehouseById(Long id);
|
||||
|
||||
/**
|
||||
* 根据关联人员查找库房
|
||||
*
|
||||
* @param relaUser 关联人员
|
||||
* @return 库房合集 (原则上只有1个)
|
||||
*/
|
||||
List<Warehouse> selectWarehouseByRelaUser(Long relaUser);
|
||||
|
||||
void deleteArchives(Long id);
|
||||
|
||||
String selectArchivesById(String archivesId);
|
||||
|
||||
List<String> selectArchivesByParentId(Long parentId);
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package com.jeethink.dataCenter.service;
|
||||
|
||||
import com.jeethink.dataCenter.domain.Warehouse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库房管理 服务层
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
public interface IWarehouseService
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询库房管理数据
|
||||
*
|
||||
* @param warehouse 库房信息
|
||||
* @return 库房信息合集
|
||||
*/
|
||||
public List<Warehouse> selectWarehouseList(Warehouse warehouse);
|
||||
|
||||
/**
|
||||
* 根据ID查询信息
|
||||
*
|
||||
* @param id 库房ID
|
||||
* @return 库房信息
|
||||
*/
|
||||
public Warehouse selectWarehouseById(Long id);
|
||||
|
||||
/**
|
||||
* 校验库房名称是否唯一
|
||||
*
|
||||
* @param warehouse 库房信息
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkNameUnique(Warehouse warehouse);
|
||||
|
||||
/**
|
||||
* 新增库房信息
|
||||
*
|
||||
* @param warehouse 库房信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWarehouse(Warehouse warehouse);
|
||||
|
||||
/**
|
||||
* 根据ID查询所有正常状态的子库房数
|
||||
*
|
||||
* @param id 库房ID
|
||||
* @return 子库房数
|
||||
*/
|
||||
public int selectNormalChildrenById(Long id);
|
||||
|
||||
/**
|
||||
* 修改库房信息
|
||||
*
|
||||
* @param warehouse 库房信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWarehouse(Warehouse warehouse);
|
||||
|
||||
/**
|
||||
* 是否存在子库房
|
||||
*
|
||||
* @param id 库房ID
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean hasChildById(Long id);
|
||||
|
||||
/**
|
||||
* 删除库房信息
|
||||
*
|
||||
* @param id 库房ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWarehouseById(Long id);
|
||||
|
||||
/**
|
||||
* 根据关联人员查找库房
|
||||
*
|
||||
* @param relaUser 关联人员
|
||||
* @return 库房合集 (原则上只有1个)
|
||||
*/
|
||||
List<Warehouse> selectWarehouseByRelaUser(Long relaUser);
|
||||
|
||||
void deleteArchives(Long id);
|
||||
|
||||
String selectArchivesById(String archivesId);
|
||||
|
||||
List<String> selectArchivesByParentId(Long parentId);
|
||||
}
|
@ -0,0 +1,176 @@
|
||||
package com.jeethink.dataCenter.service.impl;
|
||||
|
||||
import com.jeethink.common.constant.UserConstants;
|
||||
import com.jeethink.common.exception.CustomException;
|
||||
import com.jeethink.common.utils.DateUtils;
|
||||
import com.jeethink.common.utils.StringUtils;
|
||||
import com.jeethink.dataCenter.domain.Warehouse;
|
||||
import com.jeethink.dataCenter.mapper.WarehouseMapper;
|
||||
import com.jeethink.dataCenter.service.IWarehouseService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库房管理 服务层
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@Service
|
||||
public class WarehouseServiceImpl implements IWarehouseService
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private WarehouseMapper warehouseMapper;
|
||||
|
||||
/**
|
||||
* 查询库房管理数据
|
||||
*
|
||||
* @param warehouse 库房信息
|
||||
* @return 库房信息合集
|
||||
*/
|
||||
@Override
|
||||
public List<Warehouse> selectWarehouseList(Warehouse warehouse)
|
||||
{
|
||||
List<Warehouse> warehouseList=warehouseMapper.selectWarehouseList(warehouse);
|
||||
for (int i=0;i<warehouseList.size();i++){
|
||||
String [] ids=warehouseList.get(i).getAncestors().split(",");
|
||||
String parentsName="";
|
||||
for (int j=0;j<ids.length;j++){
|
||||
Warehouse warehouse1=warehouseMapper.selectWarehouseById(Long.valueOf(ids[j]));
|
||||
if(warehouse1!=null){
|
||||
parentsName+=warehouse1.getName()+",";
|
||||
}
|
||||
}
|
||||
if (parentsName.length()>0){
|
||||
warehouseList.get(i).setParentsName(parentsName.substring(0,parentsName.length()-1));
|
||||
}else {
|
||||
warehouseList.get(i).setParentsName(parentsName);
|
||||
}
|
||||
}
|
||||
return warehouseList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询信息
|
||||
*
|
||||
* @param id 库房ID
|
||||
* @return 库房信息
|
||||
*/
|
||||
@Override
|
||||
public Warehouse selectWarehouseById(Long id)
|
||||
{
|
||||
return warehouseMapper.selectWarehouseById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验库房名称是否唯一
|
||||
*
|
||||
* @param warehouse 库房信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String checkNameUnique(Warehouse warehouse)
|
||||
{
|
||||
Long id = StringUtils.isNull(warehouse.getId()) ? -1L : warehouse.getId();
|
||||
Warehouse info = warehouseMapper.checkNameUnique(warehouse.getName(), warehouse.getParentId());
|
||||
if (StringUtils.isNotNull(info) && info.getId().longValue() != id.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库房信息
|
||||
*
|
||||
* @param warehouse 库房信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWarehouse(Warehouse warehouse)
|
||||
{
|
||||
Warehouse info = warehouseMapper.selectWarehouseById(warehouse.getParentId());
|
||||
if (!UserConstants.DEPT_NORMAL.equals(warehouse.getStatus()))
|
||||
{
|
||||
throw new CustomException("库房停用, 不允许新增");
|
||||
}
|
||||
return warehouseMapper.insertWarehouse(warehouse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询所有正常状态的子库房数
|
||||
*
|
||||
* @param id 库房ID
|
||||
* @return 子库房数
|
||||
*/
|
||||
@Override
|
||||
public int selectNormalChildrenById(Long id)
|
||||
{
|
||||
|
||||
return warehouseMapper.selectNormalChildrenById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库房信息
|
||||
*
|
||||
* @param warehouse 库房信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWarehouse(Warehouse warehouse)
|
||||
{
|
||||
return warehouseMapper.updateWarehouse(warehouse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否存在子库房
|
||||
*
|
||||
* @param id 库房ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean hasChildById(Long id)
|
||||
{
|
||||
return warehouseMapper.getChildList(id).size() > 0 ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库房信息
|
||||
*
|
||||
* @param id 库房ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWarehouseById(Long id) {
|
||||
return warehouseMapper.deleteWarehouseById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据关联人员查找库房
|
||||
*
|
||||
* @param relaUser 关联人员
|
||||
* @return 库房合集 (原则上只有1个)
|
||||
*/
|
||||
@Override
|
||||
public List<Warehouse> selectWarehouseByRelaUser(Long relaUser) {
|
||||
|
||||
return warehouseMapper.selectWarehouseByRelaUser(relaUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteArchives(Long id) {
|
||||
warehouseMapper.deleteArchives(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String selectArchivesById(String archivesId) {
|
||||
return warehouseMapper.selectArchivesById(archivesId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> selectArchivesByParentId(Long parentId) {
|
||||
return warehouseMapper.selectArchivesByParentId(parentId);
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.jeethink.flow.controller;
|
||||
|
||||
import com.jeethink.common.core.domain.AjaxResult;
|
||||
import com.jeethink.flow.service.IFlowService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/flow")
|
||||
public class FlowController {
|
||||
|
||||
@Autowired
|
||||
private IFlowService flowService;
|
||||
|
||||
@RequestMapping("/step/{flowType}")
|
||||
public AjaxResult getFlowStep(@PathVariable("flowType") String flowType) {
|
||||
|
||||
return AjaxResult.success(flowService.selectStepsByFlowType(flowType));
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.jeethink.flow.domain;
|
||||
|
||||
|
||||
import com.jeethink.common.core.domain.BaseEntity;
|
||||
|
||||
public class Flow extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String flowId;
|
||||
private String objectId;
|
||||
private String flowType;
|
||||
private Integer stepNum;
|
||||
private String flowStatus;
|
||||
|
||||
private String createByName;
|
||||
private String updateByName;
|
||||
|
||||
|
||||
public String getFlowId() {
|
||||
return flowId;
|
||||
}
|
||||
|
||||
public void setFlowId(String flowId) {
|
||||
this.flowId = flowId;
|
||||
}
|
||||
|
||||
|
||||
public String getObjectId() {
|
||||
return objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(String objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public String getFlowType() {
|
||||
return flowType;
|
||||
}
|
||||
|
||||
public void setFlowType(String flowType) {
|
||||
this.flowType = flowType;
|
||||
}
|
||||
|
||||
public Integer getStepNum() {
|
||||
return stepNum;
|
||||
}
|
||||
|
||||
public void setStepNum(Integer stepNum) {
|
||||
this.stepNum = stepNum;
|
||||
}
|
||||
|
||||
public String getFlowStatus() {
|
||||
return flowStatus;
|
||||
}
|
||||
|
||||
public void setFlowStatus(String flowStatus) {
|
||||
this.flowStatus = flowStatus;
|
||||
}
|
||||
|
||||
public String getCreateByName() {
|
||||
return createByName;
|
||||
}
|
||||
|
||||
public void setCreateByName(String createByName) {
|
||||
this.createByName = createByName;
|
||||
}
|
||||
|
||||
public String getUpdateByName() {
|
||||
return updateByName;
|
||||
}
|
||||
|
||||
public void setUpdateByName(String updateByName) {
|
||||
this.updateByName = updateByName;
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package com.jeethink.flow.domain;
|
||||
|
||||
|
||||
import com.jeethink.common.core.domain.BaseEntity;
|
||||
|
||||
public class FlowRecord extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String recordId;
|
||||
private String flowId;
|
||||
private Integer stepNum;
|
||||
private String status;
|
||||
|
||||
private String createByName;
|
||||
|
||||
public String getRecordId() {
|
||||
return recordId;
|
||||
}
|
||||
|
||||
public void setRecordId(String recordId) {
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public String getFlowId() {
|
||||
return flowId;
|
||||
}
|
||||
|
||||
public void setFlowId(String flowId) {
|
||||
this.flowId = flowId;
|
||||
}
|
||||
|
||||
public Integer getStepNum() {
|
||||
return stepNum;
|
||||
}
|
||||
|
||||
public void setStepNum(Integer stepNum) {
|
||||
this.stepNum = stepNum;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getCreateByName() {
|
||||
return createByName;
|
||||
}
|
||||
|
||||
public void setCreateByName(String createByName) {
|
||||
this.createByName = createByName;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.jeethink.flow.domain;
|
||||
|
||||
import com.jeethink.common.core.domain.BaseEntity;
|
||||
|
||||
public class FlowStep extends BaseEntity {
|
||||
|
||||
private Long stepId;
|
||||
private String flowType;
|
||||
private String stepName;
|
||||
private Integer stepNum;
|
||||
|
||||
public Long getStepId() {
|
||||
return stepId;
|
||||
}
|
||||
|
||||
public void setStepId(Long stepId) {
|
||||
this.stepId = stepId;
|
||||
}
|
||||
|
||||
public String getFlowType() {
|
||||
return flowType;
|
||||
}
|
||||
|
||||
public void setFlowType(String flowType) {
|
||||
this.flowType = flowType;
|
||||
}
|
||||
|
||||
public String getStepName() {
|
||||
return stepName;
|
||||
}
|
||||
|
||||
public void setStepName(String stepName) {
|
||||
this.stepName = stepName;
|
||||
}
|
||||
|
||||
public Integer getStepNum() {
|
||||
return stepNum;
|
||||
}
|
||||
|
||||
public void setStepNum(Integer stepNum) {
|
||||
this.stepNum = stepNum;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.jeethink.flow.mapper;
|
||||
|
||||
import com.jeethink.flow.domain.Flow;
|
||||
import com.jeethink.flow.domain.FlowRecord;
|
||||
import com.jeethink.flow.domain.FlowStep;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FlowMapper {
|
||||
|
||||
void insertFlow(Flow flow);
|
||||
|
||||
Flow selectFlowByObjectIdAndFlowType(@Param("objectId") String objectId, @Param("flowType") String flowType);
|
||||
|
||||
void updateFlow(Flow flow);
|
||||
|
||||
void changeStatusByObjectIdAndFlowType(Flow flow);
|
||||
|
||||
List<FlowRecord> selectRecordByObjectIdAndFlowType(@Param("objectId") String objectId, @Param("flowType") String flowType);
|
||||
|
||||
void insertRecord(FlowRecord record);
|
||||
|
||||
List<FlowStep> selectStepsByFlowType(String flowType);
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.jeethink.flow.service;
|
||||
|
||||
import com.jeethink.flow.domain.FlowRecord;
|
||||
import com.jeethink.flow.domain.FlowStep;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IFlowService {
|
||||
|
||||
void insertFlow(String objectId, String flowType);
|
||||
|
||||
void updateFlow(String objectId, String flowType, String status, String remark);
|
||||
|
||||
void finishFlow(String objectId, String flowType);
|
||||
|
||||
void destroyFlow(String objectId, String flowType);
|
||||
|
||||
List<FlowRecord> selectRecord(String objectId, String flowType);
|
||||
|
||||
List<FlowStep> selectStepsByFlowType(String flowType);
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
package com.jeethink.flow.service.impl;
|
||||
|
||||
import com.jeethink.common.constant.Constants;
|
||||
import com.jeethink.common.utils.SecurityUtils;
|
||||
import com.jeethink.common.utils.uuid.IdUtils;
|
||||
import com.jeethink.flow.domain.Flow;
|
||||
import com.jeethink.flow.domain.FlowRecord;
|
||||
import com.jeethink.flow.domain.FlowStep;
|
||||
import com.jeethink.flow.mapper.FlowMapper;
|
||||
import com.jeethink.flow.service.IFlowService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class FlowServiceImpl implements IFlowService {
|
||||
|
||||
@Autowired
|
||||
private FlowMapper flowMapper;
|
||||
|
||||
/**
|
||||
* 插入新流程
|
||||
* @param objectId
|
||||
* @param flowType
|
||||
*/
|
||||
@Override
|
||||
public void insertFlow(String objectId, String flowType) {
|
||||
|
||||
Flow flow = new Flow();
|
||||
String flowId = IdUtils.simpleUUID();
|
||||
flow.setFlowId(flowId);
|
||||
flow.setObjectId(objectId);
|
||||
flow.setFlowType(flowType);
|
||||
flow.setFlowStatus(Constants.FLOW_STATUS_UNDERWAY);
|
||||
flow.setStepNum(1);
|
||||
flow.setCreateBy(SecurityUtils.getUsername());
|
||||
flowMapper.insertFlow(flow);
|
||||
|
||||
insertRecord(flowId, 1, Constants.APPROVE_PASS, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新流程进度
|
||||
* @param objectId
|
||||
* @param flowType
|
||||
* @param status
|
||||
* @param remark
|
||||
*/
|
||||
@Override
|
||||
public void updateFlow(String objectId, String flowType, String status, String remark) {
|
||||
|
||||
Flow flow = flowMapper.selectFlowByObjectIdAndFlowType(objectId, flowType);
|
||||
if (flow != null) {
|
||||
Integer stepNum = flow.getStepNum() + 1;
|
||||
flow.setStepNum(stepNum);
|
||||
flow.setUpdateBy(SecurityUtils.getUsername());
|
||||
flowMapper.updateFlow(flow);
|
||||
|
||||
insertRecord(flow.getFlowId(), stepNum, status, remark);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成流程
|
||||
* @param objectId
|
||||
* @param flowType
|
||||
*/
|
||||
@Override
|
||||
public void finishFlow(String objectId, String flowType) {
|
||||
|
||||
Flow flow = new Flow();
|
||||
flow.setObjectId(objectId);
|
||||
flow.setFlowType(flowType);
|
||||
flow.setFlowStatus(Constants.FLOW_STATUS_FINISH);
|
||||
flow.setUpdateBy(SecurityUtils.getUsername());
|
||||
flowMapper.changeStatusByObjectIdAndFlowType(flow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 废弃流程
|
||||
* @param objectId
|
||||
* @param flowType
|
||||
*/
|
||||
@Override
|
||||
public void destroyFlow(String objectId, String flowType) {
|
||||
|
||||
|
||||
|
||||
Flow flow = new Flow();
|
||||
flow.setObjectId(objectId);
|
||||
flow.setFlowType(flowType);
|
||||
flow.setFlowStatus(Constants.FLOW_STATUS_DESTROY);
|
||||
flow.setUpdateBy(SecurityUtils.getUsername());
|
||||
flowMapper.changeStatusByObjectIdAndFlowType(flow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程详情
|
||||
* @param objectId
|
||||
* @param flowType
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<FlowRecord> selectRecord(String objectId, String flowType) {
|
||||
|
||||
return flowMapper.selectRecordByObjectIdAndFlowType(objectId, flowType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过流程流程获取流程步骤
|
||||
* @param flowType
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<FlowStep> selectStepsByFlowType(String flowType) {
|
||||
|
||||
return flowMapper.selectStepsByFlowType(flowType);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 插入流程详情
|
||||
* @param flowId
|
||||
* @param stepNum
|
||||
* @param status
|
||||
* @param remark
|
||||
*/
|
||||
private void insertRecord(String flowId, Integer stepNum, String status, String remark) {
|
||||
|
||||
FlowRecord record = new FlowRecord();
|
||||
record.setRecordId(IdUtils.simpleUUID());
|
||||
record.setFlowId(flowId);
|
||||
record.setStepNum(stepNum);
|
||||
record.setStatus(status);
|
||||
record.setRemark(remark);
|
||||
record.setCreateBy(SecurityUtils.getUsername());
|
||||
flowMapper.insertRecord(record);
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.jeethink.manage.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.jeethink.common.annotation.Log;
|
||||
import com.jeethink.common.core.controller.BaseController;
|
||||
import com.jeethink.common.core.domain.AjaxResult;
|
||||
import com.jeethink.common.enums.BusinessType;
|
||||
import com.jeethink.manage.service.IAuthenticateService;
|
||||
import com.jeethink.common.utils.poi.ExcelUtil;
|
||||
import com.jeethink.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 价值鉴定Controller
|
||||
*
|
||||
* @author zjt
|
||||
* @date 2022-11-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/manage/authenticate")
|
||||
public class AuthenticateController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAuthenticateService service;
|
||||
/**
|
||||
* 查询价值鉴定列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('manage:authenticate:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ArchivesMaster archives)
|
||||
{
|
||||
startPage();
|
||||
List<ArchivesMaster> list = service.selectAuthenticateList(archives);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出价值鉴定列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('manage:authenticate:export')")
|
||||
@Log(title = "价值鉴定", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(ArchivesMaster archives)
|
||||
{
|
||||
List<ArchivesMaster> list = service.selectAuthenticateList(archives);
|
||||
ExcelUtil<ArchivesMaster> util = new ExcelUtil<ArchivesMaster>(ArchivesMaster.class);
|
||||
return util.exportExcel(list, "authenticate");
|
||||
}
|
||||
|
||||
@PreAuthorize(("@ss.hasPermi('manage:authenticate:postpone')"))
|
||||
@Log(title = "档案延期", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/postpone")
|
||||
public AjaxResult postpone(@RequestBody ArchivesMaster archives) {
|
||||
|
||||
service.postponeArchives(archives);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package com.jeethink.manage.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.bean.vo.Approval;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.jeethink.common.annotation.Log;
|
||||
import com.jeethink.common.core.controller.BaseController;
|
||||
import com.jeethink.common.core.domain.AjaxResult;
|
||||
import com.jeethink.common.enums.BusinessType;
|
||||
import com.jeethink.manage.service.IDestroyService;
|
||||
import com.jeethink.common.utils.poi.ExcelUtil;
|
||||
import com.jeethink.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 销毁清册Controller
|
||||
*
|
||||
* @author zjt
|
||||
* @date 2022-11-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/manage/destroy")
|
||||
public class DestroyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDestroyService service;
|
||||
|
||||
/**
|
||||
* 申请销毁
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('manage:destroy:add')")
|
||||
@GetMapping
|
||||
public AjaxResult apply(@RequestParam String archivesId)
|
||||
{
|
||||
service.applyDestroy(archivesId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('manage:destroy:revocation')")
|
||||
@GetMapping("/revocation")
|
||||
public AjaxResult revocation(@RequestParam String archivesId) {
|
||||
|
||||
service.revocationDestroy(archivesId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
/**
|
||||
* 查询待销毁列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('manage:destroy:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ArchivesMaster archiveDestroy)
|
||||
{
|
||||
startPage();
|
||||
List<ArchivesMaster> list = service.selectDestroyList(archiveDestroy);
|
||||
return getDataTable(list);
|
||||
};
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('manage:destroy:query')")
|
||||
@GetMapping("/archives")
|
||||
public AjaxResult getArchives(@RequestParam String archivesId) {
|
||||
|
||||
return AjaxResult.success(service.seelectArchivesById(archivesId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出销毁清册列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('manage:destroy:export')")
|
||||
@Log(title = "销毁清册", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(ArchivesMaster archiveDestroy)
|
||||
{
|
||||
List<ArchivesMaster> list = service.selectDestroyList(archiveDestroy);
|
||||
ExcelUtil<ArchivesMaster> util = new ExcelUtil<ArchivesMaster>(ArchivesMaster.class);
|
||||
return util.exportExcel(list, "destroy");
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核销毁清册
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('manage:destroy:approval')")
|
||||
@PutMapping("/approval")
|
||||
public AjaxResult check(@RequestBody Approval approval)
|
||||
{
|
||||
service.approvalDestroy(approval);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package com.jeethink.manage.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.jeethink.common.annotation.Log;
|
||||
import com.jeethink.common.core.controller.BaseController;
|
||||
import com.jeethink.common.core.domain.AjaxResult;
|
||||
import com.jeethink.common.enums.BusinessType;
|
||||
import com.jeethink.manage.service.ISearchService;
|
||||
import com.jeethink.common.utils.poi.ExcelUtil;
|
||||
import com.jeethink.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 档案检索Controller
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/manage/search")
|
||||
public class SearchController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISearchService service;
|
||||
|
||||
/**
|
||||
* 查询档案检索列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('manage:search:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ArchivesMaster archives)
|
||||
{
|
||||
startPage();
|
||||
List<ArchivesMaster> list = service.selectSearchList(archives);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('manage:search:query')")
|
||||
@GetMapping("/{archivesId}")
|
||||
public AjaxResult getInfo(@PathVariable("archivesId") String archivesId) {
|
||||
|
||||
return AjaxResult.success(service.selectArchivesById(archivesId));
|
||||
}
|
||||
|
||||
//查询附件
|
||||
@GetMapping("/exportFile/{archivesId}")
|
||||
public AjaxResult getFileInfo(@PathVariable("archivesId") String archivesId) {
|
||||
|
||||
return AjaxResult.success(service.selectArchivesFileById(archivesId));
|
||||
}
|
||||
/**
|
||||
* 导出档案检索列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('manage:search:export')")
|
||||
@Log(title = "档案检索", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(ArchivesMaster archives)
|
||||
{
|
||||
List<ArchivesMaster> list = service.selectSearchList(archives);
|
||||
ExcelUtil<ArchivesMaster> util = new ExcelUtil<ArchivesMaster>(ArchivesMaster.class);
|
||||
return util.exportExcel(list, "search");
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.jeethink.manage.controller;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.common.constant.Constants;
|
||||
import com.jeethink.common.core.domain.AjaxResult;
|
||||
import com.jeethink.common.core.page.TableDataInfo;
|
||||
import com.jeethink.receive.service.IArchivesService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.jeethink.common.core.controller.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 档案整理Controller
|
||||
*
|
||||
* @author zjt
|
||||
* @date 2022-11-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/manage/tidy")
|
||||
public class TidyController extends BaseController
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private IArchivesService service;
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ArchivesMaster archives) {
|
||||
|
||||
startPage();
|
||||
archives.setNowStatus(Constants.ARCHIVES_STATUS_RK);
|
||||
List<ArchivesMaster> list = service.selectArchivesList(archives);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.jeethink.manage.service;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 价值鉴定Service接口
|
||||
*
|
||||
* @author zjt
|
||||
* @date 2022-11-10
|
||||
*/
|
||||
public interface IAuthenticateService
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询价值鉴定列表
|
||||
*
|
||||
* @param archiveAuthenticate 价值鉴定
|
||||
* @return 价值鉴定集合
|
||||
*/
|
||||
public List<ArchivesMaster> selectAuthenticateList(ArchivesMaster archiveAuthenticate);
|
||||
|
||||
/**
|
||||
* 档案延期
|
||||
* @param archives
|
||||
*/
|
||||
void postponeArchives(ArchivesMaster archives);
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.jeethink.manage.service;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.bean.vo.Approval;
|
||||
import com.jeethink.receive.vo.ArchivesVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 销毁清册Service接口
|
||||
*
|
||||
* @author zjt
|
||||
* @date 2022-11-10
|
||||
*/
|
||||
public interface IDestroyService
|
||||
{
|
||||
/**
|
||||
* 查询销毁清册列表
|
||||
*
|
||||
* @param archives 销毁清册
|
||||
* @return 销毁清册集合
|
||||
*/
|
||||
List<ArchivesMaster> selectDestroyList(ArchivesMaster archives);
|
||||
|
||||
void applyDestroy(String archivesId);
|
||||
|
||||
void approvalDestroy(Approval approval);
|
||||
|
||||
ArchivesVO seelectArchivesById(String archivesId);
|
||||
|
||||
void revocationDestroy(String archivesId);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.jeethink.manage.service;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.receive.vo.ArchivesVO;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 档案检索Service接口
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-10
|
||||
*/
|
||||
public interface ISearchService
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询档案检索列表
|
||||
*
|
||||
* @param archives 档案检索
|
||||
* @return 档案检索集合
|
||||
*/
|
||||
List<ArchivesMaster> selectSearchList(ArchivesMaster archives);
|
||||
|
||||
ArchivesVO selectArchivesById(String archivesId);
|
||||
|
||||
List<HashMap> selectArchivesFileById(String archivesId);
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.jeethink.manage.service;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 档案整理Service接口
|
||||
*
|
||||
* @author zjt
|
||||
* @date 2022-11-10
|
||||
*/
|
||||
public interface ITidyService
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.jeethink.manage.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.common.utils.SecurityUtils;
|
||||
import com.jeethink.receive.mapper.ArchivesMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jeethink.manage.service.IAuthenticateService;
|
||||
|
||||
/**
|
||||
* 价值鉴定Service业务层处理
|
||||
*
|
||||
* @author zjt
|
||||
* @date 2022-11-10
|
||||
*/
|
||||
@Service
|
||||
public class AuthenticateServiceImpl implements IAuthenticateService
|
||||
{
|
||||
@Autowired
|
||||
private ArchivesMapper archivesMapper;
|
||||
|
||||
/**
|
||||
* 查询价值鉴定列表
|
||||
*
|
||||
* @param archives 价值鉴定
|
||||
* @return 价值鉴定
|
||||
*/
|
||||
@Override
|
||||
public List<ArchivesMaster> selectAuthenticateList(ArchivesMaster archives)
|
||||
{
|
||||
return archivesMapper.selectExpireArchivesList(archives);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postponeArchives(ArchivesMaster archives) {
|
||||
|
||||
archives.setUpdateUser(SecurityUtils.getUserId());
|
||||
archivesMapper.postponeArchives(archives);
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package com.jeethink.manage.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.bean.vo.Approval;
|
||||
import com.jeethink.receive.mapper.ArchivesMapper;
|
||||
import com.jeethink.common.constant.Constants;
|
||||
import com.jeethink.common.exception.CustomException;
|
||||
import com.jeethink.common.utils.SecurityUtils;
|
||||
import com.jeethink.flow.service.IFlowService;
|
||||
import com.jeethink.receive.service.IArchivesService;
|
||||
import com.jeethink.receive.vo.ArchivesVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jeethink.manage.service.IDestroyService;
|
||||
|
||||
/**
|
||||
* 销毁清册Service业务层处理
|
||||
*
|
||||
* @author zjt
|
||||
* @date 2022-11-10
|
||||
*/
|
||||
@Service
|
||||
public class DestroyServiceImpl implements IDestroyService
|
||||
{
|
||||
@Autowired
|
||||
private IArchivesService archivesService;
|
||||
|
||||
@Autowired
|
||||
private IFlowService flowService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询销毁清册列表
|
||||
*
|
||||
* @param archive 销毁清册
|
||||
* @return 销毁清册
|
||||
*/
|
||||
@Override
|
||||
public List<ArchivesMaster> selectDestroyList(ArchivesMaster archive)
|
||||
{
|
||||
String userType = SecurityUtils.getLoginUser().getUser().getUserType();
|
||||
List<ArchivesMaster> list = new ArrayList<>();
|
||||
if (Constants.USER_TYPE_ZG.equals(userType)) {
|
||||
archive.setNowStatus(Constants.ARCHIVES_STATUS_DESTROY_APPLY);
|
||||
list = archivesService.selectArchivesList(archive);
|
||||
} else if (Constants.USER_TYPE_BZ.equals(userType)) {
|
||||
archive.setNowStatus(Constants.ARCHIVES_STATUS_DESTROY_APPROVE);
|
||||
list = archivesService.selectArchivesList(archive);
|
||||
} else {
|
||||
archive.setStage(Constants.ARCHIVES_STAGE_DESTROY);
|
||||
list = archivesService.selectArchivesList(archive);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyDestroy(String archivesId) {
|
||||
|
||||
ArchivesMaster archives = archivesService.selectById(archivesId);
|
||||
if (!Constants.ARCHIVES_STATUS_RK.equals(archives.getNowStatus())
|
||||
&& !Constants.ARCHIVES_STATUS_DESTROY_REJECT.equals(archives.getNowStatus())) {
|
||||
throw new CustomException("该档案当前不能申请销毁");
|
||||
}
|
||||
if (Constants.ARCHIVES_STATUS_DESTROY_REJECT.equals(archives.getNowStatus())) {
|
||||
//审批未通过,再次提交申请时,需要将上次的审批详情废弃
|
||||
flowService.destroyFlow(archivesId, Constants.FLOW_TYPE_DESTROY);
|
||||
}
|
||||
archivesService.changeNowStatus(archivesId, Constants.ARCHIVES_STATUS_DESTROY_APPLY);
|
||||
flowService.insertFlow(archivesId, Constants.FLOW_TYPE_DESTROY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void approvalDestroy(Approval approval) {
|
||||
String userType = SecurityUtils.getLoginUser().getUser().getUserType();
|
||||
if (!Constants.USER_TYPE_ZG.equals(userType) && !Constants.USER_TYPE_BZ.equals(userType)) {
|
||||
throw new CustomException("您没有审核权限");
|
||||
}
|
||||
String archivesId = approval.getObjectId();
|
||||
if (Constants.APPROVE_PASS.equals(approval.getStatus())) {
|
||||
String nowStatus = Constants.USER_TYPE_BZ.equals(userType)? Constants.ARCHIVES_STATUS_DESTROY_WAIT: Constants.ARCHIVES_STATUS_DESTROY_APPROVE;
|
||||
archivesService.changeNowStatus(archivesId, nowStatus);
|
||||
} else {
|
||||
archivesService.changeNowStatus(archivesId, Constants.ARCHIVES_STATUS_DESTROY_REJECT);
|
||||
}
|
||||
flowService.updateFlow(archivesId, Constants.FLOW_TYPE_DESTROY, approval.getStatus(), approval.getRemark());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArchivesVO seelectArchivesById(String archivesId) {
|
||||
|
||||
return archivesService.selectArchivesById(archivesId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void revocationDestroy(String archivesId) {
|
||||
|
||||
ArchivesMaster master = archivesService.selectById(archivesId);
|
||||
if (!Constants.ARCHIVES_STATUS_DESTROY_APPLY.equals(master.getNowStatus())
|
||||
&& !Constants.ARCHIVES_STATUS_DESTROY_REJECT.equals(master.getNowStatus())) {
|
||||
throw new CustomException("该档案当前不能撤销注销申请");
|
||||
}
|
||||
archivesService.changeNowStatus(archivesId, Constants.ARCHIVES_STATUS_RK);
|
||||
flowService.destroyFlow(archivesId, Constants.FLOW_TYPE_DESTROY);
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.jeethink.manage.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.common.constant.Constants;
|
||||
import com.jeethink.receive.service.IArchivesService;
|
||||
import com.jeethink.receive.vo.ArchivesVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jeethink.manage.service.ISearchService;
|
||||
|
||||
/**
|
||||
* 档案检索Service业务层处理
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-10
|
||||
*/
|
||||
@Service
|
||||
public class SearchServiceImpl implements ISearchService
|
||||
{
|
||||
@Autowired
|
||||
private IArchivesService archivesService;
|
||||
|
||||
/**
|
||||
* 查询档案检索列表
|
||||
*
|
||||
* @param archives 档案检索
|
||||
* @return 档案检索
|
||||
*/
|
||||
@Override
|
||||
public List<ArchivesMaster> selectSearchList(ArchivesMaster archives)
|
||||
{
|
||||
archives.setNowStatus(Constants.ARCHIVES_STATUS_RK);
|
||||
return archivesService.selectArchivesList(archives);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArchivesVO selectArchivesById(String archivesId) {
|
||||
|
||||
return archivesService.selectArchivesById(archivesId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> selectArchivesFileById(String archivesId) {
|
||||
return archivesService.selectArchivesFileById(archivesId);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.jeethink.manage.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jeethink.manage.service.ITidyService;
|
||||
|
||||
/**
|
||||
* 档案整理Service业务层处理
|
||||
*
|
||||
* @author zjt
|
||||
* @date 2022-11-10
|
||||
*/
|
||||
@Service
|
||||
public class TidyServiceImpl implements ITidyService
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package com.jeethink.receive.controller;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.common.annotation.Log;
|
||||
import com.jeethink.common.core.controller.BaseController;
|
||||
import com.jeethink.common.core.domain.AjaxResult;
|
||||
import com.jeethink.common.core.page.TableDataInfo;
|
||||
import com.jeethink.common.enums.BusinessType;
|
||||
import com.jeethink.common.utils.poi.ExcelUtil;
|
||||
import com.jeethink.receive.service.IArchivesApprovalService;
|
||||
import com.jeethink.bean.vo.Approval;
|
||||
import com.jeethink.receive.vo.ArchivesVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 档案接收Controller
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-08
|
||||
*/
|
||||
@Api("档案审批")
|
||||
@RestController
|
||||
@RequestMapping("/receive/approval")
|
||||
public class ArchivesApprovalController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IArchivesApprovalService approvalService;
|
||||
|
||||
/**
|
||||
* 查询档案接收列表
|
||||
*/
|
||||
@ApiOperation("档案审批页面list列表")
|
||||
@PreAuthorize("@ss.hasPermi('receive:approval:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ArchivesMaster archive)
|
||||
{
|
||||
startPage();
|
||||
List<ArchivesMaster> list = approvalService.selectApprovalList(archive);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('receive:approval:query')")
|
||||
@GetMapping
|
||||
public AjaxResult getInfo(@RequestParam String archivesId) {
|
||||
|
||||
ArchivesVO archivesVO = approvalService.getArchives(archivesId);
|
||||
return AjaxResult.success(archivesVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:approval:check')")
|
||||
@Log(title = "档案接收", businessType = BusinessType.UPDATE)
|
||||
@PostMapping
|
||||
public AjaxResult edit(@RequestBody Approval approval)
|
||||
{
|
||||
approvalService.approvalArchive(approval);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出档案接收列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:approval:export')")
|
||||
@Log(title = "档案接收", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public AjaxResult export(ArchivesMaster rsArchive)
|
||||
{
|
||||
List<ArchivesMaster> list = approvalService.selectApprovalList(rsArchive);
|
||||
ExcelUtil<ArchivesMaster> util = new ExcelUtil<ArchivesMaster>(ArchivesMaster.class);
|
||||
return util.exportExcel(list, "rsReceive");
|
||||
}
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
package com.jeethink.receive.controller;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.common.annotation.Log;
|
||||
import com.jeethink.common.constant.Constants;
|
||||
import com.jeethink.common.core.controller.BaseController;
|
||||
import com.jeethink.common.core.domain.AjaxResult;
|
||||
import com.jeethink.common.core.domain.model.LoginUser;
|
||||
import com.jeethink.common.core.page.TableDataInfo;
|
||||
import com.jeethink.common.enums.BusinessType;
|
||||
import com.jeethink.common.utils.ServletUtils;
|
||||
import com.jeethink.common.utils.poi.ExcelUtil;
|
||||
import com.jeethink.receive.service.IArchivesService;
|
||||
import com.jeethink.receive.vo.ArchivesVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 健康档案接收Controller
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-08
|
||||
*/
|
||||
@Api("健康档案接收")
|
||||
@RestController
|
||||
@RequestMapping("/receive/jkReceive")
|
||||
public class JkArchivesController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IArchivesService service;
|
||||
|
||||
/**
|
||||
* 查询健康档案接收列表
|
||||
*/
|
||||
@ApiOperation("健康档案接收页面list列表")
|
||||
@PreAuthorize("@ss.hasPermi('receive:jkReceive:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ArchivesMaster archives) {
|
||||
|
||||
startPage();
|
||||
archives.setType(Constants.ARCHIVES_TYPE_JK);
|
||||
archives.setStage(Constants.ARCHIVES_STAGE_RECEIVE);
|
||||
List<ArchivesMaster> list = service.selectArchivesList(archives);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取健康档案接收详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:jkReceive:query')")
|
||||
@GetMapping
|
||||
public AjaxResult getInfo(@RequestParam String archivesId) {
|
||||
|
||||
return AjaxResult.success(service.selectArchivesById(archivesId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('receive:jkReceive:add')")
|
||||
@Log(title = "健康档案接收", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ArchivesVO archives) {
|
||||
|
||||
archives.setType(Constants.ARCHIVES_TYPE_JK);
|
||||
service.insertArchives(archives);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('receive:jkReceive:edit')")
|
||||
@Log(title = "健康档案接收", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult update(@RequestBody ArchivesVO archives) {
|
||||
|
||||
service.updateArchives(archives);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('receive:jkReceive:submit')")
|
||||
@Log(title = "健康档案接收", businessType = BusinessType.OTHER)
|
||||
@PostMapping("/submit")
|
||||
public AjaxResult submit(@RequestBody ArchivesVO archives) {
|
||||
|
||||
service.submitArchives(archives);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('receive:jkReceive:remove')")
|
||||
@Log(title = "健康档案接收", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{archivesId}")
|
||||
public AjaxResult remove(@PathVariable("archivesId") String archivesId) {
|
||||
|
||||
return toAjax(service.removeArchives(archivesId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出健康档案接收列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:jkReceive:export')")
|
||||
@Log(title = "健康档案接收", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(ArchivesMaster archives) {
|
||||
archives.setType(Constants.ARCHIVES_TYPE_JK);
|
||||
archives.setStage(Constants.ARCHIVES_STAGE_RECEIVE);
|
||||
List<ArchivesMaster> list = service.selectArchivesList(archives);
|
||||
ExcelUtil<ArchivesMaster> util = new ExcelUtil<ArchivesMaster>(ArchivesMaster.class);
|
||||
return util.exportExcel(list, "rsReceive");
|
||||
}
|
||||
|
||||
@Log(title = "档案导入", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('receive:jkReceive:import')")
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||
{
|
||||
ExcelUtil<ArchivesMaster> util = new ExcelUtil<ArchivesMaster>(ArchivesMaster.class);
|
||||
List<ArchivesMaster> archivesMasterList = util.importExcel(file.getInputStream());
|
||||
String message = service.importArchives2(archivesMasterList, updateSupport);
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
/**
|
||||
* 批量导入附件并与主表关联
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/uploadArchiveList")
|
||||
public AjaxResult uploadArchiveList(){
|
||||
service.uploadArchiveFileList();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,196 @@
|
||||
package com.jeethink.receive.controller;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.common.annotation.Log;
|
||||
import com.jeethink.common.constant.Constants;
|
||||
import com.jeethink.common.core.controller.BaseController;
|
||||
import com.jeethink.common.core.domain.AjaxResult;
|
||||
import com.jeethink.common.core.domain.entity.SysUser;
|
||||
import com.jeethink.common.core.domain.model.LoginUser;
|
||||
import com.jeethink.common.core.page.TableDataInfo;
|
||||
import com.jeethink.common.enums.BusinessType;
|
||||
import com.jeethink.common.utils.DateUtils;
|
||||
import com.jeethink.common.utils.SecurityUtils;
|
||||
import com.jeethink.common.utils.ServletUtils;
|
||||
import com.jeethink.common.utils.StringUtils;
|
||||
import com.jeethink.common.utils.file.FileDownLoad;
|
||||
import com.jeethink.common.utils.poi.ExcelUtil;
|
||||
import com.jeethink.common.utils.uuid.IdUtils;
|
||||
import com.jeethink.receive.service.IArchivesService;
|
||||
import com.jeethink.receive.vo.ArchivesVO;
|
||||
import com.jeethink.system.domain.SystemFile;
|
||||
import com.jeethink.system.service.ISystemFileService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.tomcat.util.bcel.Const;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 人事档案接收Controller
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-08
|
||||
*/
|
||||
@Api("人事档案接收")
|
||||
@RestController
|
||||
@RequestMapping("/receive/rsReceive")
|
||||
public class RsArchivesController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IArchivesService service;
|
||||
@Autowired
|
||||
private ISystemFileService systemFileService;
|
||||
|
||||
/**
|
||||
* 查询人事档案接收列表
|
||||
*/
|
||||
@ApiOperation("人事档案接收页面list列表")
|
||||
@PreAuthorize("@ss.hasPermi('receive:rsReceive:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ArchivesMaster archives) {
|
||||
|
||||
startPage();
|
||||
archives.setType(Constants.ARCHIVES_TYPE_RS);
|
||||
archives.setStage(Constants.ARCHIVES_STAGE_RECEIVE);
|
||||
List<ArchivesMaster> list = service.selectArchivesList(archives);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取人事档案接收详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:rsReceive:query')")
|
||||
@GetMapping
|
||||
public AjaxResult getInfo(@RequestParam String archivesId) {
|
||||
|
||||
return AjaxResult.success(service.selectArchivesById(archivesId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('receive:rsReceive:add')")
|
||||
@Log(title = "人事档案接收", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ArchivesVO archives) {
|
||||
|
||||
archives.setType(Constants.ARCHIVES_TYPE_RS);
|
||||
service.insertArchives(archives);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('receive:rsReceive:edit')")
|
||||
@Log(title = "人事档案接收", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult update(@RequestBody ArchivesVO archives) {
|
||||
|
||||
service.updateArchives(archives);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('receive:rsReceive:submit')")
|
||||
@Log(title = "人事档案接收", businessType = BusinessType.OTHER)
|
||||
@PostMapping("/submit")
|
||||
public AjaxResult submit(@RequestBody ArchivesVO archives) {
|
||||
|
||||
service.submitArchives(archives);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('receive:rsReceive:revocation')")
|
||||
@Log(title = "人事档案接收", businessType = BusinessType.OTHER)
|
||||
@GetMapping("/revocation")
|
||||
public AjaxResult revocation(@RequestParam String archivesId) {
|
||||
|
||||
service.revocationArchives(archivesId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('receive:rsReceive:remove')")
|
||||
@Log(title = "人事档案接收", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{archivesId}")
|
||||
public AjaxResult remove(@PathVariable("archivesId") String archivesId) {
|
||||
|
||||
return toAjax(service.removeArchives(archivesId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出人事档案接收列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:rsReceive:export')")
|
||||
@Log(title = "人事档案接收", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public AjaxResult export(@RequestBody ArchivesMaster archives) {
|
||||
archives.setType(Constants.ARCHIVES_TYPE_RS);
|
||||
archives.setStage(Constants.ARCHIVES_STAGE_RECEIVE);
|
||||
List<ArchivesMaster> list = service.selectArchivesList(archives);
|
||||
ExcelUtil<ArchivesMaster> util = new ExcelUtil<ArchivesMaster>(ArchivesMaster.class);
|
||||
return util.exportExcel(list, "rsReceive");
|
||||
}
|
||||
|
||||
@Log(title = "档案导入", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('receive:rsReceive:import')")
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||
{
|
||||
ExcelUtil<ArchivesMaster> util = new ExcelUtil<ArchivesMaster>(ArchivesMaster.class);
|
||||
List<ArchivesMaster> archivesMasterList = util.importExcel(file.getInputStream());
|
||||
String message = service.importArchives(archivesMasterList, updateSupport);
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
/**
|
||||
* 批量导入附件并与主表关联
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/uploadArchiveList")
|
||||
public AjaxResult uploadArchiveList(){
|
||||
service.uploadArchiveFileList();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
@GetMapping("/importTemplate")
|
||||
public AjaxResult importTemplate()
|
||||
{
|
||||
ExcelUtil<ArchivesMaster> util = new ExcelUtil<ArchivesMaster>(ArchivesMaster.class);
|
||||
return util.importTemplateExcel("档案模板");
|
||||
}
|
||||
|
||||
/**
|
||||
* 与朗新接口对接获取年度工资表数据(URL、人员编号、文件类型、文件大小)
|
||||
* @param salaryList
|
||||
*/
|
||||
@ApiOperation("年度工资单")
|
||||
@PostMapping("/salary")
|
||||
@CrossOrigin(origins = "*")
|
||||
public AjaxResult rsSalary(@RequestBody List<HashMap> salaryList){
|
||||
for(int i=0;i<salaryList.size();i++){
|
||||
String fileUrl= (String) salaryList.get(i).get("fileUrl");
|
||||
String userNumber= (String) salaryList.get(i).get("userNumber");
|
||||
String type= (String) salaryList.get(i).get("type");
|
||||
int fileSize= (int) salaryList.get(i).get("fileSize");
|
||||
String fileName = fileUrl.substring(fileUrl.lastIndexOf("/")+1);
|
||||
String filePath = "E:\\jeethink\\uploadPath\\uploadFiles\\archives\\person\\"+userNumber+"\\"+type;
|
||||
File file = FileDownLoad.saveUrlAs(fileUrl, filePath,fileName ,"GET");
|
||||
String fileObjectId = service.selectArchiveFileId(userNumber,type);
|
||||
if(StringUtils.isNotNull(fileObjectId)){
|
||||
SystemFile systemFile = new SystemFile();
|
||||
systemFile.setFileId(IdUtils.simpleUUID());
|
||||
systemFile.setFileObjectId(fileObjectId);
|
||||
systemFile.setFileSize((long) fileSize);
|
||||
systemFile.setFileName(fileName.split("\\.")[0]);
|
||||
systemFile.setFileSuffix(fileName.split("\\.")[1]);
|
||||
systemFile.setFilePath(filePath);
|
||||
String fileUrl2 = "http://10.10.10.141:9001/profile/uploadFiles/archives/person/"+userNumber+"/"+type+"/"+fileName;
|
||||
systemFile.setFileUrl(fileUrl2);
|
||||
systemFile.setFileDeleteType(Constants.DELETED_NO);
|
||||
systemFile.setFileCreateTime(DateUtils.getNowDate());
|
||||
systemFileService.insertSystemFile(systemFile);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
package com.jeethink.receive.domain;
|
||||
|
||||
|
||||
import com.jeethink.common.core.domain.BaseEntity;
|
||||
import com.jeethink.system.domain.SystemFile;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class ArchivesFile extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String archivesFileId;
|
||||
private String rsFileType;
|
||||
private String jkFileDate;
|
||||
private String checkHospital;
|
||||
private String checkConclusion;
|
||||
private Date checkDate;
|
||||
private String archivesId;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
private long createUser;
|
||||
private long updateUser;
|
||||
private String deleted;
|
||||
|
||||
private List<SystemFile> fileList;
|
||||
|
||||
public String getArchivesFileId() {
|
||||
return archivesFileId;
|
||||
}
|
||||
|
||||
public void setArchivesFileId(String archivesFileId) {
|
||||
this.archivesFileId = archivesFileId;
|
||||
}
|
||||
|
||||
public String getRsFileType() {
|
||||
return rsFileType;
|
||||
}
|
||||
|
||||
public void setRsFileType(String rsFileType) {
|
||||
this.rsFileType = rsFileType;
|
||||
}
|
||||
|
||||
public String getJkFileDate() {
|
||||
return jkFileDate;
|
||||
}
|
||||
|
||||
public void setJkFileDate(String jkFileDate) {
|
||||
this.jkFileDate = jkFileDate;
|
||||
}
|
||||
|
||||
public String getCheckHospital() {
|
||||
return checkHospital;
|
||||
}
|
||||
|
||||
public void setCheckHospital(String checkHospital) {
|
||||
this.checkHospital = checkHospital;
|
||||
}
|
||||
|
||||
public String getCheckConclusion() {
|
||||
return checkConclusion;
|
||||
}
|
||||
|
||||
public void setCheckConclusion(String checkConclusion) {
|
||||
this.checkConclusion = checkConclusion;
|
||||
}
|
||||
|
||||
public Date getCheckDate() {
|
||||
return checkDate;
|
||||
}
|
||||
|
||||
public void setCheckDate(Date checkDate) {
|
||||
this.checkDate = checkDate;
|
||||
}
|
||||
|
||||
public String getArchivesId() {
|
||||
return archivesId;
|
||||
}
|
||||
|
||||
public void setArchivesId(String archivesId) {
|
||||
this.archivesId = archivesId;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
public long getCreateUser() {
|
||||
return createUser;
|
||||
}
|
||||
|
||||
public void setCreateUser(long createUser) {
|
||||
this.createUser = createUser;
|
||||
}
|
||||
|
||||
public long getUpdateUser() {
|
||||
return updateUser;
|
||||
}
|
||||
|
||||
public void setUpdateUser(long updateUser) {
|
||||
this.updateUser = updateUser;
|
||||
}
|
||||
|
||||
public String getDeleted() {
|
||||
return deleted;
|
||||
}
|
||||
|
||||
public void setDeleted(String deleted) {
|
||||
this.deleted = deleted;
|
||||
}
|
||||
|
||||
public List<SystemFile> getFileList() {
|
||||
return fileList;
|
||||
}
|
||||
|
||||
public void setFileList(List<SystemFile> fileList) {
|
||||
this.fileList = fileList;
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.jeethink.receive.mapper;
|
||||
|
||||
import com.jeethink.receive.domain.ArchivesFile;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public interface ArchivesFileMapper {
|
||||
|
||||
|
||||
List<ArchivesFile> selectArchivesFileList(String archivesId);
|
||||
|
||||
void removeByArchivesId(String archivesId);
|
||||
|
||||
void insertArchivesFile(ArchivesFile archivesFile);
|
||||
|
||||
String selectArchiveFileId(@Param("userNumber") String userNumber, @Param("type") String type);
|
||||
|
||||
List<HashMap> selectArchivesFileById(String archivesId);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.jeethink.receive.mapper;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ArchivesMapper {
|
||||
|
||||
List<ArchivesMaster> selectArchivesList(ArchivesMaster archives);
|
||||
|
||||
ArchivesMaster selectById(String archivesId);
|
||||
|
||||
void insertArchives(ArchivesMaster master);
|
||||
|
||||
void updateArchive(ArchivesMaster archivesMaster);
|
||||
|
||||
void changeNowStatus(@Param("archivesId") String archivesId, @Param("nowStatus") String nowStatus);
|
||||
|
||||
int romoveById(String archivesId);
|
||||
|
||||
List<ArchivesMaster> selectExpireArchivesList(ArchivesMaster archives);
|
||||
|
||||
void postponeArchives(ArchivesMaster archives);
|
||||
|
||||
List<ArchivesMaster> selectArchivesByUser(ArchivesMaster archives);
|
||||
|
||||
ArchivesMaster selectJk(String userNumber);
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.jeethink.receive.service;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.bean.vo.Approval;
|
||||
import com.jeethink.receive.vo.ArchivesVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 人事档案接收Service接口
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-08
|
||||
*/
|
||||
public interface IArchivesApprovalService
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询人事档案接收列表
|
||||
*
|
||||
* @param rsArchive 人事档案接收
|
||||
* @return 人事档案接收集合
|
||||
*/
|
||||
public List<ArchivesMaster> selectApprovalList(ArchivesMaster rsArchive);
|
||||
|
||||
/**
|
||||
* 档案审核
|
||||
* @param approval
|
||||
* @return
|
||||
*/
|
||||
void approvalArchive(Approval approval);
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
* @param archivesId
|
||||
* @return
|
||||
*/
|
||||
ArchivesVO getArchives(String archivesId);
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.jeethink.receive.service;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.receive.vo.ArchivesVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public interface IArchivesService {
|
||||
/**
|
||||
* 获取档案列表
|
||||
* @param archives
|
||||
* @return
|
||||
*/
|
||||
List<ArchivesMaster> selectArchivesList(ArchivesMaster archives);
|
||||
|
||||
/**
|
||||
* 获取档案详情
|
||||
* @param archivesId
|
||||
* @return
|
||||
*/
|
||||
ArchivesVO selectArchivesById(String archivesId);
|
||||
|
||||
/**
|
||||
* 新增档案
|
||||
* @param archives
|
||||
*/
|
||||
void insertArchives(ArchivesVO archives);
|
||||
|
||||
/**
|
||||
* 修改档案
|
||||
* @param archives
|
||||
*/
|
||||
void updateArchives(ArchivesVO archives);
|
||||
|
||||
/**
|
||||
* 提交档案
|
||||
* @param archives
|
||||
*/
|
||||
void submitArchives(ArchivesVO archives);
|
||||
|
||||
/**
|
||||
* 撤销提交
|
||||
* @param archivesId
|
||||
*/
|
||||
void revocationArchives(String archivesId);
|
||||
|
||||
/**
|
||||
* 删除档案
|
||||
* @param archivesId
|
||||
* @return
|
||||
*/
|
||||
int removeArchives(String archivesId);
|
||||
|
||||
/**
|
||||
* 修改档案状态
|
||||
* @param archivesId
|
||||
* @param nowStatus
|
||||
*/
|
||||
void changeNowStatus(String archivesId, String nowStatus);
|
||||
|
||||
void uploadArchiveFileList();
|
||||
|
||||
String importArchives(List<ArchivesMaster> archivesMasterList, boolean updateSupport);
|
||||
String importArchives2(List<ArchivesMaster> archivesMasterList, boolean updateSupport);
|
||||
|
||||
ArchivesMaster selectById(String archivesId);
|
||||
|
||||
String selectArchiveFileId(@Param("userNumber") String userNumber, @Param("type") String type);
|
||||
|
||||
List<HashMap> selectArchivesFileById(String archivesId);
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.jeethink.receive.service.impl;
|
||||
|
||||
import com.jeethink.common.constant.Constants;
|
||||
import com.jeethink.common.exception.CustomException;
|
||||
import com.jeethink.common.utils.SecurityUtils;
|
||||
import com.jeethink.flow.service.IFlowService;
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.receive.service.IArchivesApprovalService;
|
||||
import com.jeethink.bean.vo.Approval;
|
||||
import com.jeethink.receive.service.IArchivesService;
|
||||
import com.jeethink.receive.vo.ArchivesVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.beans.Transient;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 人事档案接收Service业务层处理
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-08
|
||||
*/
|
||||
@Service
|
||||
public class ArchivesApprovalServiceImpl implements IArchivesApprovalService
|
||||
{
|
||||
@Autowired
|
||||
private IArchivesService archivesService;
|
||||
@Autowired
|
||||
private IFlowService flowService;
|
||||
|
||||
/**
|
||||
* 查询人事档案接收列表
|
||||
*
|
||||
* @param archives 人事档案接收
|
||||
* @return 人事档案接收
|
||||
*/
|
||||
@Override
|
||||
public List<ArchivesMaster> selectApprovalList(ArchivesMaster archives)
|
||||
{
|
||||
String userType = SecurityUtils.getLoginUser().getUser().getUserType();
|
||||
List<ArchivesMaster> list = new ArrayList<>();
|
||||
if (Constants.USER_TYPE_ZG.equals(userType)) {
|
||||
archives.setNowStatus(Constants.ARCHIVES_STATUS_RECEIVE_SUBMITED);
|
||||
list = archivesService.selectArchivesList(archives);
|
||||
} else if (Constants.USER_TYPE_BZ.equals(userType)) {
|
||||
archives.setNowStatus(Constants.ARCHIVES_STATUS_RECEIVE_APPROVE);
|
||||
list = archivesService.selectArchivesList(archives);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Transient
|
||||
@Override
|
||||
public void approvalArchive(Approval approval) {
|
||||
String userType = SecurityUtils.getLoginUser().getUser().getUserType();
|
||||
if (!Constants.USER_TYPE_ZG.equals(userType) && !Constants.USER_TYPE_BZ.equals(userType)) {
|
||||
throw new CustomException("您没有审核权限");
|
||||
}
|
||||
flowService.updateFlow(approval.getObjectId(), Constants.FLOW_TYPE_RECEIVE, approval.getStatus(), approval.getRemark());
|
||||
if (Constants.APPROVE_PASS.equals(approval.getStatus())) {
|
||||
if (Constants.USER_TYPE_BZ.equals(userType)) {
|
||||
archivesService.changeNowStatus(approval.getObjectId(), Constants.ARCHIVES_STATUS_RECEIVE_WAIT);
|
||||
}else if (Constants.USER_TYPE_ZG.equals(userType)) {
|
||||
archivesService.changeNowStatus(approval.getObjectId(), Constants.ARCHIVES_STATUS_RECEIVE_APPROVE);
|
||||
}
|
||||
} else {
|
||||
archivesService.changeNowStatus(approval.getObjectId(), Constants.ARCHIVES_STATUS_RECEIVE_REJECT);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArchivesVO getArchives(String archivesId) {
|
||||
|
||||
return archivesService.selectArchivesById(archivesId);
|
||||
}
|
||||
}
|
@ -0,0 +1,569 @@
|
||||
package com.jeethink.receive.service.impl;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.common.core.domain.entity.SysUser;
|
||||
import com.jeethink.common.utils.DateUtils;
|
||||
import com.jeethink.common.utils.StringUtils;
|
||||
import com.jeethink.common.utils.file.FileUtils;
|
||||
import com.jeethink.framework.config.ServerConfig;
|
||||
import com.jeethink.receive.domain.ArchivesFile;
|
||||
import com.jeethink.receive.mapper.ArchivesFileMapper;
|
||||
import com.jeethink.receive.vo.ArchivesVO;
|
||||
import com.jeethink.common.constant.Constants;
|
||||
import com.jeethink.common.exception.CustomException;
|
||||
import com.jeethink.common.utils.SecurityUtils;
|
||||
import com.jeethink.common.utils.uuid.IdUtils;
|
||||
import com.jeethink.flow.domain.FlowRecord;
|
||||
import com.jeethink.flow.service.IFlowService;
|
||||
import com.jeethink.receive.mapper.ArchivesMapper;
|
||||
import com.jeethink.receive.service.IArchivesService;
|
||||
import com.jeethink.system.domain.SystemFile;
|
||||
import com.jeethink.system.mapper.SysDictDataMapper;
|
||||
import com.jeethink.system.mapper.SysUserMapper;
|
||||
import com.jeethink.system.mapper.SystemFileMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.beans.Transient;
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class ArchivesServiceImpl implements IArchivesService {
|
||||
private static final Logger log = LoggerFactory.getLogger(ArchivesServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private ArchivesMapper mapper;
|
||||
@Autowired
|
||||
private ArchivesFileMapper archivesFileMapper;
|
||||
@Autowired
|
||||
private IFlowService flowService;
|
||||
@Autowired
|
||||
private SystemFileMapper fileMapper;
|
||||
@Autowired
|
||||
private SysUserMapper userMapper;
|
||||
@Autowired
|
||||
private ServerConfig serverConfig;
|
||||
/**
|
||||
* 获取档案列表
|
||||
*
|
||||
* @param archives
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ArchivesMaster> selectArchivesList(ArchivesMaster archives) {
|
||||
|
||||
return mapper.selectArchivesList(archives);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取档案详情
|
||||
*
|
||||
* @param archivesId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ArchivesVO selectArchivesById(String archivesId) {
|
||||
|
||||
ArchivesMaster archives = mapper.selectById(archivesId);
|
||||
ArchivesVO vo = new ArchivesVO();
|
||||
BeanUtils.copyProperties(archives, vo);
|
||||
|
||||
Map<String, ArchivesFile> fileInfo = selectFileInfo(archives);
|
||||
vo.setFileInfo(fileInfo);
|
||||
|
||||
|
||||
List<FlowRecord> records = new ArrayList<>();
|
||||
if (Constants.ARCHIVES_STATUS_RECEIVE_SUBMITED.equals(archives.getNowStatus())
|
||||
|| Constants.ARCHIVES_STATUS_RECEIVE_APPROVE.equals(archives.getNowStatus())
|
||||
|| Constants.ARCHIVES_STATUS_RECEIVE_WAIT.equals(archives.getNowStatus())
|
||||
|| Constants.ARCHIVES_STATUS_RECEIVE_REJECT.equals(archives.getNowStatus())
|
||||
) {
|
||||
records = flowService.selectRecord(archivesId, Constants.FLOW_TYPE_RECEIVE);
|
||||
}
|
||||
if (Constants.ARCHIVES_STATUS_DESTROY_APPLY.equals(archives.getNowStatus())
|
||||
|| Constants.ARCHIVES_STATUS_DESTROY_APPROVE.equals(archives.getNowStatus())
|
||||
|| Constants.ARCHIVES_STATUS_DESTROY_WAIT.equals(archives.getNowStatus())
|
||||
|| Constants.ARCHIVES_STATUS_DESTROY_REJECT.equals(archives.getNowStatus())
|
||||
) {
|
||||
records = flowService.selectRecord(archivesId, Constants.FLOW_TYPE_DESTROY);
|
||||
}
|
||||
vo.setFlowRecords(records);
|
||||
|
||||
return vo;
|
||||
}
|
||||
|
||||
private Map<String, ArchivesFile> selectFileInfo(ArchivesMaster archives) {
|
||||
|
||||
String archivesId = archives.getArchivesId();
|
||||
String archivesType = archives.getType();
|
||||
Map<String, ArchivesFile> fileInfo = new HashMap<>();
|
||||
List<ArchivesFile> archivesFileList = archivesFileMapper.selectArchivesFileList(archivesId);
|
||||
if(Constants.ARCHIVES_TYPE_JK.equals(archivesType)){
|
||||
Date dt=new Date();
|
||||
int year = Integer.parseInt(DateUtils.parseDateToStr("yyyy",dt));
|
||||
ArchivesFile archivesFileNew = new ArchivesFile();
|
||||
/*for(int i=0;i<5;i++){
|
||||
fileInfo.put(String.valueOf(year-i),archivesFileNew);
|
||||
}*/
|
||||
for(int i=2019;i<=year;i++){
|
||||
fileInfo.put(String.valueOf(i),archivesFileNew);
|
||||
}
|
||||
}
|
||||
for (ArchivesFile archivesFile : archivesFileList){
|
||||
SystemFile systemFile = new SystemFile();
|
||||
systemFile.setFileObjectId(archivesFile.getArchivesFileId());
|
||||
List<SystemFile> fileList = fileMapper.selectSystemFileList(systemFile);
|
||||
archivesFile.setFileList(fileList);
|
||||
if (Constants.ARCHIVES_TYPE_RS.equals(archivesType)) {
|
||||
fileInfo.put(archivesFile.getRsFileType(), archivesFile);
|
||||
}else if (Constants.ARCHIVES_TYPE_JK.equals(archivesType)) {
|
||||
fileInfo.put(archivesFile.getJkFileDate(), archivesFile);
|
||||
}
|
||||
}
|
||||
return fileInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增档案
|
||||
*
|
||||
* @param archives
|
||||
*/
|
||||
@Transient
|
||||
@Override
|
||||
public void insertArchives(ArchivesVO archives) {
|
||||
|
||||
String archivesId= IdUtils.simpleUUID();
|
||||
String nowStatus = Constants.ARCHIVES_STATUS_SAVE;
|
||||
Boolean isSubmit = archives.getIsSubmit();
|
||||
if (isSubmit) {//保存并提交
|
||||
if (Constants.ARCHIVES_TYPE_JK.equals(archives.getType())) {//健康档案无需审核
|
||||
nowStatus = Constants.ARCHIVES_STATUS_RECEIVE_WAIT;
|
||||
} else {//其他需要审核
|
||||
Boolean skipApproval = archives.getSkipApproval();
|
||||
if (skipApproval) {//是否跳过审批
|
||||
nowStatus = Constants.ARCHIVES_STATUS_RECEIVE_WAIT;
|
||||
}else {
|
||||
nowStatus = Constants.ARCHIVES_STATUS_RECEIVE_SUBMITED;
|
||||
//插入审批流程
|
||||
flowService.insertFlow(archivesId, Constants.FLOW_TYPE_RECEIVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ArchivesMaster master = new ArchivesMaster();
|
||||
BeanUtils.copyProperties(archives, master);
|
||||
master.setName(archives.getUserNumber()+archives.getNickName());
|
||||
master.setArchiveNo((Constants.ARCHIVES_TYPE_JK.equals(archives.getType())?"JK":"RS")+archives.getUserNumber());
|
||||
master.setArchivesId(archivesId);
|
||||
master.setNowStatus(nowStatus);
|
||||
master.setCreateUser(SecurityUtils.getUserId());
|
||||
master.setUpdateUser(SecurityUtils.getUserId());
|
||||
master.setWarehouseType(Constants.WAREHOUSE_TYPE_ZS);
|
||||
|
||||
mapper.insertArchives(master);
|
||||
|
||||
Map<String, ArchivesFile> fileInfo = archives.getFileInfo();
|
||||
for (String type : fileInfo.keySet()) {
|
||||
ArchivesFile archivesFile = fileInfo.get(type);
|
||||
archivesFile.setArchivesFileId(IdUtils.simpleUUID());
|
||||
archivesFile.setArchivesId(archivesId);
|
||||
if (Constants.ARCHIVES_TYPE_RS.equals(archives.getType())) {
|
||||
archivesFile.setRsFileType(type);
|
||||
}else if (Constants.ARCHIVES_TYPE_JK.equals(archives.getType())) {
|
||||
archivesFile.setJkFileDate(type);
|
||||
}
|
||||
archivesFile.setDeleted(Constants.DELETED_NO);
|
||||
archivesFile.setCreateUser(SecurityUtils.getUserId());
|
||||
archivesFile.setCreateTime(DateUtils.getNowDate());
|
||||
archivesFileMapper.insertArchivesFile(archivesFile);
|
||||
|
||||
for (SystemFile systemFile: archivesFile.getFileList()) {
|
||||
systemFile.setFileObjectId(archivesFile.getArchivesFileId());
|
||||
systemFile.setFileDeleteType(Constants.DELETED_NO);
|
||||
fileMapper.updateSystemFile(systemFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改档案
|
||||
*
|
||||
* @param archives
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public void updateArchives(ArchivesVO archives) {
|
||||
|
||||
ArchivesMaster master = mapper.selectById(archives.getArchivesId());
|
||||
//档案能够修改的三种状态:保存未提交,未通过审批,已入库
|
||||
if (!Constants.ARCHIVES_STATUS_SAVE.equals(master.getNowStatus())
|
||||
&& !Constants.ARCHIVES_STATUS_RECEIVE_REJECT.equals(master.getNowStatus())
|
||||
&& !Constants.ARCHIVES_STATUS_RK.equals(master.getNowStatus())
|
||||
) {
|
||||
throw new CustomException("档案当前状态不能修改");
|
||||
}
|
||||
//审批未通过状态修改会先将上次流程结束
|
||||
if (Constants.ARCHIVES_STATUS_RECEIVE_REJECT.equals(archives.getNowStatus())) {
|
||||
flowService.destroyFlow(archives.getArchivesId(), Constants.FLOW_TYPE_RECEIVE);
|
||||
}
|
||||
|
||||
Boolean isSubmit = archives.getIsSubmit();
|
||||
String nowStatus = Constants.ARCHIVES_STATUS_SAVE;
|
||||
if (isSubmit) {
|
||||
if (Constants.ARCHIVES_TYPE_JK.equals(archives.getType())) {//健康档案无需审核
|
||||
nowStatus = Constants.ARCHIVES_STATUS_RECEIVE_WAIT;
|
||||
} else {//其他需要审核
|
||||
Boolean skipApproval = archives.getSkipApproval();
|
||||
if (skipApproval) {//是否跳过审批
|
||||
nowStatus = Constants.ARCHIVES_STATUS_RECEIVE_WAIT;
|
||||
}else {
|
||||
nowStatus = Constants.ARCHIVES_STATUS_RECEIVE_SUBMITED;
|
||||
//插入审批流程
|
||||
flowService.insertFlow(archives.getArchivesId(), Constants.FLOW_TYPE_RECEIVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ArchivesMaster archivesMaster = new ArchivesMaster();
|
||||
BeanUtils.copyProperties(archives, archivesMaster);
|
||||
archivesMaster.setNowStatus(nowStatus);
|
||||
archivesMaster.setUpdateUser(SecurityUtils.getUserId());
|
||||
mapper.updateArchive(archivesMaster);
|
||||
|
||||
//附件重新保存,删除原数据
|
||||
archivesFileMapper.removeByArchivesId(archives.getArchivesId());
|
||||
//保存附件
|
||||
Map<String, ArchivesFile> fileInfo = archives.getFileInfo();
|
||||
for (String type : fileInfo.keySet()) {
|
||||
ArchivesFile archivesFile = fileInfo.get(type);
|
||||
archivesFile.setArchivesFileId(IdUtils.simpleUUID());
|
||||
archivesFile.setArchivesId(archives.getArchivesId());
|
||||
if (Constants.ARCHIVES_TYPE_RS.equals(archives.getType())) {
|
||||
archivesFile.setRsFileType(type);
|
||||
}else if (Constants.ARCHIVES_TYPE_JK.equals(archives.getType())) {
|
||||
archivesFile.setJkFileDate(type);
|
||||
}
|
||||
archivesFile.setDeleted(Constants.DELETED_NO);
|
||||
archivesFile.setCreateUser(SecurityUtils.getUserId());
|
||||
archivesFile.setCreateTime(DateUtils.getNowDate());
|
||||
archivesFileMapper.insertArchivesFile(archivesFile);
|
||||
|
||||
if(archivesFile.getFileList()!=null){
|
||||
for (SystemFile systemFile: archivesFile.getFileList()) {
|
||||
systemFile.setFileObjectId(archivesFile.getArchivesFileId());
|
||||
systemFile.setFileDeleteType(Constants.DELETED_NO);
|
||||
fileMapper.updateSystemFile(systemFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交档案
|
||||
*
|
||||
* @param archives
|
||||
*/
|
||||
@Transient
|
||||
@Override
|
||||
public void submitArchives(ArchivesVO archives) {
|
||||
ArchivesMaster master = mapper.selectById(archives.getArchivesId());
|
||||
if (!Constants.ARCHIVES_STATUS_SAVE.equals(master.getNowStatus())) {
|
||||
throw new CustomException("当前档案所出状态不能提交");
|
||||
}
|
||||
if (Constants.ARCHIVES_TYPE_JK.equals(master.getType()) || archives.getSkipApproval()) {
|
||||
//健康档案无需审批,其他档案可跳过审批
|
||||
mapper.changeNowStatus(archives.getArchivesId(), Constants.ARCHIVES_STATUS_RECEIVE_WAIT);
|
||||
}else {
|
||||
mapper.changeNowStatus(archives.getArchivesId(), Constants.ARCHIVES_STATUS_RECEIVE_SUBMITED);
|
||||
flowService.insertFlow(archives.getArchivesId(), Constants.FLOW_TYPE_RECEIVE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤销提交
|
||||
*
|
||||
* @param archivesId
|
||||
*/
|
||||
@Transient
|
||||
@Override
|
||||
public void revocationArchives(String archivesId) {
|
||||
|
||||
ArchivesMaster master = mapper.selectById(archivesId);
|
||||
if (!Constants.ARCHIVES_STATUS_RECEIVE_SUBMITED.equals(master.getNowStatus())) {
|
||||
throw new CustomException("该档案已经不能撤销提交");
|
||||
}
|
||||
mapper.changeNowStatus(archivesId, Constants.ARCHIVES_STATUS_SAVE);
|
||||
flowService.destroyFlow(archivesId, Constants.FLOW_TYPE_RECEIVE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除档案
|
||||
*
|
||||
* @param archivesId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int removeArchives(String archivesId) {
|
||||
|
||||
ArchivesMaster master = mapper.selectById(archivesId);
|
||||
if (!Constants.ARCHIVES_STATUS_SAVE.equals(master.getNowStatus())
|
||||
&& !Constants.ARCHIVES_STATUS_RECEIVE_REJECT.equals(master.getNowStatus())) {
|
||||
throw new CustomException("该档案已经不能删除");
|
||||
}
|
||||
return mapper.romoveById(archivesId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeNowStatus(String archivesId, String nowStatus) {
|
||||
|
||||
mapper.changeNowStatus(archivesId, nowStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadArchiveFileList() {
|
||||
String path = "E:\\jeethink\\uploadPath\\uploadFiles";
|
||||
List<File> list = new ArrayList<>();
|
||||
list = FileUtils.getFiles(path,list);
|
||||
for (File file:list){
|
||||
String filePath = file.getPath();
|
||||
String[] filePathArray=filePath.split("\\\\");
|
||||
String archiveType = filePathArray[filePathArray.length-4];
|
||||
String userNum = filePathArray[filePathArray.length-3];
|
||||
String fileType = filePathArray[filePathArray.length-2];
|
||||
String fileName = filePathArray[filePathArray.length-1];
|
||||
/* if("person".equals(archiveType)){//人事档案目录
|
||||
ArchivesMaster archivesMaster = new ArchivesMaster();
|
||||
archivesMaster.setUserNumber(userNum);
|
||||
archivesMaster.setType(Constants.ARCHIVES_TYPE_RS);
|
||||
List<ArchivesMaster> archiveList = mapper.selectArchivesByUser(archivesMaster);
|
||||
if(archiveList.size()>0){
|
||||
ArchivesMaster rsArchive = archiveList.get(0);
|
||||
List<ArchivesFile> archivesFileList = archivesFileMapper.selectArchivesFileList(rsArchive.getArchivesId());
|
||||
for (ArchivesFile archivesFile:archivesFileList) {
|
||||
if(fileType.equals(archivesFile.getRsFileType())){
|
||||
SystemFile systemFile = new SystemFile();
|
||||
systemFile.setFileId(IdUtils.simpleUUID());
|
||||
systemFile.setFileObjectId(archivesFile.getArchivesFileId());
|
||||
systemFile.setFileSize(file.length());
|
||||
String[] fileNames = fileName.split("\\.");
|
||||
String fileName1 = fileName.split("\\.")[0];
|
||||
String fileName2 = fileName.split("\\.")[1];
|
||||
systemFile.setFileName(fileName.split("\\.")[0]);
|
||||
systemFile.setFileSuffix(fileName.split("\\.")[1]);
|
||||
systemFile.setFilePath(filePath);
|
||||
// String fileUrl = serverConfig.getUrl()+"/profile/"+filePathArray[filePathArray.length-6]+"/"+filePathArray[filePathArray.length-5]+"/"+archiveType+"/"+userNum+"/"+fileType+"/"+fileName;
|
||||
String fileUrl = "http://10.10.10.141:9001/profile/"+filePathArray[filePathArray.length-6]+"/"+filePathArray[filePathArray.length-5]+"/"+archiveType+"/"+userNum+"/"+fileType+"/"+fileName;
|
||||
systemFile.setFileUrl(fileUrl);
|
||||
systemFile.setFileDeleteType(Constants.DELETED_NO);
|
||||
systemFile.setFileCreateTime(DateUtils.getNowDate());
|
||||
systemFile.setCreateUserId(SecurityUtils.getUserId());
|
||||
fileMapper.insertSystemFile(systemFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
if("2021".equals(fileType)){
|
||||
if("health".equals(archiveType)){//健康档案目录
|
||||
ArchivesMaster archivesMaster = new ArchivesMaster();
|
||||
archivesMaster.setUserNumber(userNum);
|
||||
archivesMaster.setType(Constants.ARCHIVES_TYPE_JK);
|
||||
List<ArchivesMaster> archiveList = mapper.selectArchivesByUser(archivesMaster);
|
||||
if(archiveList.size()>0){
|
||||
ArchivesMaster rsArchive = archiveList.get(0);
|
||||
List<ArchivesFile> archivesFileList = archivesFileMapper.selectArchivesFileList(rsArchive.getArchivesId());
|
||||
for (ArchivesFile archivesFile:archivesFileList) {
|
||||
if(fileType.equals(archivesFile.getJkFileDate())){
|
||||
SystemFile systemFile = new SystemFile();
|
||||
systemFile.setFileId(IdUtils.simpleUUID());
|
||||
systemFile.setFileObjectId(archivesFile.getArchivesFileId());
|
||||
systemFile.setFileSize(file.length());
|
||||
systemFile.setFileName(fileName.split("\\.")[0]);
|
||||
systemFile.setFileSuffix(fileName.split("\\.")[1]);
|
||||
systemFile.setFilePath(filePath);
|
||||
systemFile.setFileCreateTime(DateUtils.getNowDate());
|
||||
// String fileUrl = serverConfig.getUrl()+"/profile"+"/"+filePathArray[filePathArray.length-5]+"/"+archiveType+"/"+userNum+"/"+fileType+"/"+fileName;
|
||||
String fileUrl = "http://10.10.10.141:9001/profile/"+filePathArray[filePathArray.length-6]+"/"+filePathArray[filePathArray.length-5]+"/"+archiveType+"/"+userNum+"/"+fileType+"/"+fileName;
|
||||
systemFile.setFileUrl(fileUrl);
|
||||
systemFile.setFileDeleteType(Constants.DELETED_NO);
|
||||
systemFile.setCreateUserId(SecurityUtils.getUserId());
|
||||
fileMapper.insertSystemFile(systemFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String importArchives(List<ArchivesMaster> archivesMasterList, boolean updateSupport) {
|
||||
if (StringUtils.isNull(archivesMasterList) || archivesMasterList.size() == 0)
|
||||
{
|
||||
throw new CustomException("导入用户数据不能为空!");
|
||||
}
|
||||
int successNum = 0;
|
||||
int failureNum = 0;
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
for (ArchivesMaster archivesMaster : archivesMasterList){
|
||||
try{
|
||||
// 验证是否存在这个用户
|
||||
String userNumber = archivesMaster.getUserNumber();
|
||||
SysUser u = userMapper.selectUserByUserNumber(userNumber);
|
||||
if (StringUtils.isNotNull(u)){
|
||||
archivesMaster.setArchivesId(IdUtils.simpleUUID());
|
||||
archivesMaster.setArchiveNo((Constants.ARCHIVES_TYPE_JK.equals(archivesMaster.getType())?"JK":"RS")+archivesMaster.getUserNumber());
|
||||
archivesMaster.setName(archivesMaster.getUserNumber()+archivesMaster.getNickName());
|
||||
archivesMaster.setDeleted(Constants.DELETED_NO);
|
||||
archivesMaster.setCreateUser(SecurityUtils.getUserId());
|
||||
archivesMaster.setCreateTime(DateUtils.getNowDate());
|
||||
archivesMaster.setUserId(u.getUserId());
|
||||
archivesMaster.setNowStatus(Constants.ARCHIVES_STATUS_RK);
|
||||
archivesMaster.setGdPeopleId(SecurityUtils.getUserId());
|
||||
archivesMaster.setType(Constants.ARCHIVES_TYPE_RS);
|
||||
archivesMaster.setWarehouseType(Constants.WAREHOUSE_TYPE_ZS);
|
||||
archivesMaster.setTier("0");
|
||||
archivesMaster.setIfPaper("0");
|
||||
archivesMaster.setPeopleType("2");
|
||||
archivesMaster.setClassified("0");
|
||||
archivesMaster.setDuration("0");
|
||||
mapper.insertArchives(archivesMaster);
|
||||
for (int i = 0; i <= 10; i++) {
|
||||
ArchivesFile archivesFile = new ArchivesFile();
|
||||
archivesFile.setArchivesFileId(IdUtils.simpleUUID());
|
||||
archivesFile.setArchivesId(archivesMaster.getArchivesId());
|
||||
archivesFile.setRsFileType(String.valueOf(i));
|
||||
archivesFile.setDeleted(Constants.DELETED_NO);
|
||||
archivesFile.setCreateUser(SecurityUtils.getUserId());
|
||||
archivesFile.setCreateTime(DateUtils.getNowDate());
|
||||
archivesFileMapper.insertArchivesFile(archivesFile);
|
||||
}
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、员工编号 " + archivesMaster.getUserNumber() + " 的人事档案导入成功");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
failureNum++;
|
||||
String msg = "<br/>" + failureNum + "、员工编号 " + archivesMaster.getUserNumber() + " 的人事档案导入失败:";
|
||||
failureMsg.append(msg + e.getMessage());
|
||||
log.error(msg, e);
|
||||
}
|
||||
}
|
||||
if (failureNum > 0)
|
||||
{
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||
throw new CustomException(failureMsg.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String importArchives2(List<ArchivesMaster> archivesMasterList, boolean updateSupport) {
|
||||
if (StringUtils.isNull(archivesMasterList) || archivesMasterList.size() == 0)
|
||||
{
|
||||
throw new CustomException("导入用户数据不能为空!");
|
||||
}
|
||||
int successNum = 0;
|
||||
int failureNum = 0;
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
for (ArchivesMaster archivesMaster : archivesMasterList){
|
||||
try{
|
||||
// 验证是否存在这个用户
|
||||
String userNumber = archivesMaster.getUserNumber();
|
||||
SysUser u = userMapper.selectUserByUserNumber(userNumber);
|
||||
if (StringUtils.isNotNull(u)){
|
||||
ArchivesFile archivesFile = new ArchivesFile();
|
||||
ArchivesMaster m=mapper.selectJk(userNumber);
|
||||
if(StringUtils.isNull(m)){
|
||||
archivesMaster.setArchivesId(IdUtils.simpleUUID());
|
||||
archivesMaster.setArchiveNo("JK"+archivesMaster.getUserNumber());
|
||||
archivesMaster.setName(archivesMaster.getUserNumber()+archivesMaster.getNickName());
|
||||
archivesMaster.setDeleted(Constants.DELETED_NO);
|
||||
archivesMaster.setCreateUser(SecurityUtils.getUserId());
|
||||
archivesMaster.setCreateTime(DateUtils.getNowDate());
|
||||
archivesMaster.setUserId(u.getUserId());
|
||||
archivesMaster.setNowStatus(Constants.ARCHIVES_STATUS_RK);
|
||||
archivesMaster.setGdPeopleId(SecurityUtils.getUserId());
|
||||
archivesMaster.setType(Constants.ARCHIVES_TYPE_JK);
|
||||
archivesMaster.setWarehouseType(Constants.WAREHOUSE_TYPE_ZS);
|
||||
archivesMaster.setTier("0");
|
||||
archivesMaster.setIfPaper("0");
|
||||
archivesMaster.setPeopleType("2");
|
||||
archivesMaster.setClassified("0");
|
||||
archivesMaster.setDuration("0");
|
||||
mapper.insertArchives(archivesMaster);
|
||||
archivesFile.setArchivesId(archivesMaster.getArchivesId());
|
||||
archivesFile.setArchivesFileId(IdUtils.simpleUUID());
|
||||
archivesFile.setJkFileDate(archivesMaster.getJkFileDate());
|
||||
archivesFile.setCheckConclusion(archivesMaster.getCheckConclusion());
|
||||
archivesFile.setCheckDate(archivesMaster.getCheckDate());
|
||||
archivesFile.setCheckHospital(archivesMaster.getCheckHospital());
|
||||
archivesFile.setDeleted(Constants.DELETED_NO);
|
||||
archivesFile.setCreateUser(SecurityUtils.getUserId());
|
||||
archivesFile.setCreateTime(DateUtils.getNowDate());
|
||||
archivesFileMapper.insertArchivesFile(archivesFile);
|
||||
}else {
|
||||
archivesFile.setArchivesId(m.getArchivesId());
|
||||
archivesFile.setArchivesFileId(IdUtils.simpleUUID());
|
||||
archivesFile.setJkFileDate(archivesMaster.getJkFileDate());
|
||||
archivesFile.setCheckConclusion(archivesMaster.getCheckConclusion());
|
||||
archivesFile.setCheckDate(archivesMaster.getCheckDate());
|
||||
archivesFile.setCheckHospital(archivesMaster.getCheckHospital());
|
||||
archivesFile.setDeleted(Constants.DELETED_NO);
|
||||
archivesFile.setCreateUser(SecurityUtils.getUserId());
|
||||
archivesFile.setCreateTime(DateUtils.getNowDate());
|
||||
archivesFileMapper.insertArchivesFile(archivesFile);
|
||||
}
|
||||
|
||||
|
||||
successNum++;
|
||||
/*successMsg.append("<br/>" + successNum + "、员工编号 " + archivesMaster.getUserNumber() + " 的健康档案导入成功");*/
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
failureNum++;
|
||||
String msg = "<br/>" + failureNum + "、员工编号 " + archivesMaster.getUserNumber() + " 的健康档案导入失败:";
|
||||
failureMsg.append(msg + e.getMessage());
|
||||
log.error(msg, e);
|
||||
}
|
||||
}
|
||||
if (failureNum > 0)
|
||||
{
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||
throw new CustomException(failureMsg.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArchivesMaster selectById(String archivesId) {
|
||||
return mapper.selectById(archivesId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String selectArchiveFileId(String userNumber, String type) {
|
||||
return archivesFileMapper.selectArchiveFileId(userNumber,type);
|
||||
}
|
||||
@Override
|
||||
public List<HashMap> selectArchivesFileById(String archivesId) {
|
||||
return archivesFileMapper.selectArchivesFileById(archivesId);
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.jeethink.receive.vo;
|
||||
|
||||
public class ApprovalVo {
|
||||
|
||||
//档案ID
|
||||
private String archiveId;
|
||||
//状态:pass:通过,reject:不通过
|
||||
private String status;
|
||||
//备注,不通过的理由
|
||||
private String remark;
|
||||
|
||||
public String getArchiveId() {
|
||||
return archiveId;
|
||||
}
|
||||
|
||||
public void setArchiveId(String archiveId) {
|
||||
this.archiveId = archiveId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.jeethink.receive.vo;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.flow.domain.FlowRecord;
|
||||
import com.jeethink.receive.domain.ArchivesFile;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ArchivesVO extends ArchivesMaster {
|
||||
|
||||
private Boolean isSubmit;
|
||||
private Boolean skipApproval;
|
||||
private List<FlowRecord> flowRecords;
|
||||
private Map<String, ArchivesFile> fileInfo;
|
||||
|
||||
|
||||
public Boolean getIsSubmit() {
|
||||
return isSubmit;
|
||||
}
|
||||
|
||||
public void setIsSubmit(Boolean submit) {
|
||||
isSubmit = submit;
|
||||
}
|
||||
|
||||
public Boolean getSkipApproval() {
|
||||
return skipApproval;
|
||||
}
|
||||
|
||||
public void setSkipApproval(Boolean skipApproval) {
|
||||
this.skipApproval = skipApproval;
|
||||
}
|
||||
|
||||
public List<FlowRecord> getFlowRecords() {
|
||||
return flowRecords;
|
||||
}
|
||||
|
||||
public void setFlowRecords(List<FlowRecord> flowRecords) {
|
||||
this.flowRecords = flowRecords;
|
||||
}
|
||||
|
||||
public Map<String, ArchivesFile> getFileInfo() {
|
||||
return fileInfo;
|
||||
}
|
||||
|
||||
public void setFileInfo(Map<String, ArchivesFile> fileInfo) {
|
||||
this.fileInfo = fileInfo;
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.jeethink.save.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.jeethink.common.annotation.Log;
|
||||
import com.jeethink.common.core.controller.BaseController;
|
||||
import com.jeethink.common.core.domain.AjaxResult;
|
||||
import com.jeethink.common.enums.BusinessType;
|
||||
import com.jeethink.save.service.IPutinService;
|
||||
import com.jeethink.common.utils.poi.ExcelUtil;
|
||||
import com.jeethink.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 档案入库Controller
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/save/putin")
|
||||
public class PutinController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IPutinService service;
|
||||
|
||||
/**
|
||||
* 查询档案入库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('save:archiveIn:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ArchivesMaster archives)
|
||||
{
|
||||
startPage();
|
||||
List<ArchivesMaster> list = service.selectPutinList(archives);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('save:archiveIn:query')")
|
||||
@GetMapping("/archives")
|
||||
public AjaxResult getInfo(@RequestParam String archivesId)
|
||||
{
|
||||
return AjaxResult.success(service.selectArchivesById(archivesId));
|
||||
}
|
||||
/**
|
||||
* 导出档案入库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('save:archiveIn:export')")
|
||||
@Log(title = "档案入库", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(ArchivesMaster archives)
|
||||
{
|
||||
List<ArchivesMaster> list = service.selectPutinList(archives);
|
||||
ExcelUtil<ArchivesMaster> util = new ExcelUtil<ArchivesMaster>(ArchivesMaster.class);
|
||||
return util.exportExcel(list, "archiveIn");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('save:archiveIn:confirm')")
|
||||
@GetMapping
|
||||
public AjaxResult confirm(@RequestParam String archivesId) {
|
||||
|
||||
service.confirmPutin(archivesId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package com.jeethink.save.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.jeethink.common.annotation.Log;
|
||||
import com.jeethink.common.core.controller.BaseController;
|
||||
import com.jeethink.common.core.domain.AjaxResult;
|
||||
import com.jeethink.common.enums.BusinessType;
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.save.service.IPutoutService;
|
||||
import com.jeethink.common.utils.poi.ExcelUtil;
|
||||
import com.jeethink.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 档案出库Controller
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/save/putout")
|
||||
public class PutoutController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IPutoutService service;
|
||||
|
||||
/**
|
||||
* 查询档案出库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('save:archiveOut:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ArchivesMaster archives)
|
||||
{
|
||||
startPage();
|
||||
List<ArchivesMaster> list = service.selectPutoutList(archives);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出档案出库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('save:archiveOut:export')")
|
||||
@Log(title = "档案出库", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public AjaxResult export(ArchivesMaster archives)
|
||||
{
|
||||
List<ArchivesMaster> list = service.selectPutoutList(archives);
|
||||
ExcelUtil<ArchivesMaster> util = new ExcelUtil<ArchivesMaster>(ArchivesMaster.class);
|
||||
return util.exportExcel(list, "archiveOut");
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认出库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('save:archiveOut:confirm')")
|
||||
@Log(title = "档案出库", businessType = BusinessType.OTHER)
|
||||
@GetMapping
|
||||
public AjaxResult confirm(@RequestParam String archivesId)
|
||||
{
|
||||
service.confirmPutout(archivesId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
package com.jeethink.save.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.jeethink.common.annotation.Log;
|
||||
import com.jeethink.common.core.controller.BaseController;
|
||||
import com.jeethink.common.core.domain.AjaxResult;
|
||||
import com.jeethink.common.enums.BusinessType;
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.save.service.IarchiveHandOverService;
|
||||
import com.jeethink.common.utils.poi.ExcelUtil;
|
||||
import com.jeethink.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 档案移交Controller
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/save/handOver")
|
||||
public class archiveHandOverController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IarchiveHandOverService archiveHandOverService;
|
||||
/*@Autowired
|
||||
private IRsArchiveService rsArchiveService;*/
|
||||
|
||||
/**
|
||||
* 查询档案移交列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('save:handOver:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ArchivesMaster archiveHandOver)
|
||||
{
|
||||
startPage();
|
||||
List<ArchivesMaster> list = archiveHandOverService.selectarchiveHandOverList(archiveHandOver);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出档案移交列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('save:handOver:export')")
|
||||
@Log(title = "档案移交", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(ArchivesMaster archiveHandOver)
|
||||
{
|
||||
List<ArchivesMaster> list = archiveHandOverService.selectarchiveHandOverList(archiveHandOver);
|
||||
ExcelUtil<ArchivesMaster> util = new ExcelUtil<ArchivesMaster>(ArchivesMaster.class);
|
||||
return util.exportExcel(list, "handOver");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取档案移交详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('save:handOver:query')")
|
||||
@GetMapping(value = "/{archivesId}")
|
||||
public AjaxResult getInfo(@PathVariable("archivesId") String archivesId)
|
||||
{
|
||||
HashMap hashMap = new HashMap();
|
||||
ArchivesMaster archivesMaster = archiveHandOverService.selectarchiveHandOverById(archivesId);
|
||||
hashMap.put("form",archivesMaster);
|
||||
//hashMap.put("fileInfo",rsArchiveService.selectRsArchivesFileList(archivesMaster));
|
||||
return AjaxResult.success(hashMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增档案移交
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('save:handOver:add')")
|
||||
@Log(title = "档案移交", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ArchivesMaster archiveHandOver)
|
||||
{
|
||||
return toAjax(archiveHandOverService.insertarchiveHandOver(archiveHandOver));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改档案移交
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('save:handOver:edit')")
|
||||
@Log(title = "档案移交", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ArchivesMaster archiveHandOver)
|
||||
{
|
||||
return toAjax(archiveHandOverService.updatearchiveHandOver(archiveHandOver));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除档案移交
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('save:handOver:remove')")
|
||||
@Log(title = "档案移交", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{archivesIds}")
|
||||
public AjaxResult remove(@PathVariable String[] archivesIds)
|
||||
{
|
||||
return toAjax(archiveHandOverService.deletearchiveHandOverByIds(archivesIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.jeethink.save.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
|
||||
/**
|
||||
* 档案移交Mapper接口
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-11
|
||||
*/
|
||||
public interface archiveHandOverMapper
|
||||
{
|
||||
/**
|
||||
* 查询档案移交
|
||||
*
|
||||
* @param archivesId 档案移交ID
|
||||
* @return 档案移交
|
||||
*/
|
||||
public ArchivesMaster selectarchiveHandOverById(String archivesId);
|
||||
|
||||
/**
|
||||
* 查询档案移交列表
|
||||
*
|
||||
* @param archiveHandOver 档案移交
|
||||
* @return 档案移交集合
|
||||
*/
|
||||
public List<ArchivesMaster> selectarchiveHandOverList(ArchivesMaster archiveHandOver);
|
||||
|
||||
/**
|
||||
* 新增档案移交
|
||||
*
|
||||
* @param archiveHandOver 档案移交
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertarchiveHandOver(ArchivesMaster archiveHandOver);
|
||||
|
||||
/**
|
||||
* 修改档案移交
|
||||
*
|
||||
* @param archiveHandOver 档案移交
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatearchiveHandOver(ArchivesMaster archiveHandOver);
|
||||
|
||||
/**
|
||||
* 删除档案移交
|
||||
*
|
||||
* @param archivesId 档案移交ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletearchiveHandOverById(String archivesId);
|
||||
|
||||
/**
|
||||
* 批量删除档案移交
|
||||
*
|
||||
* @param archivesIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletearchiveHandOverByIds(String[] archivesIds);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.jeethink.save.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.receive.vo.ArchivesVO;
|
||||
|
||||
/**
|
||||
* 档案入库Service接口
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-11
|
||||
*/
|
||||
public interface IPutinService
|
||||
{
|
||||
/**
|
||||
* 获取待入库列表
|
||||
* @param archives
|
||||
* @return
|
||||
*/
|
||||
List<ArchivesMaster> selectPutinList(ArchivesMaster archives);
|
||||
|
||||
/**
|
||||
* 确认入库
|
||||
* @param archivesId
|
||||
*/
|
||||
void confirmPutin(String archivesId);
|
||||
|
||||
ArchivesVO selectArchivesById(String archivesId);
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.jeethink.save.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
|
||||
/**
|
||||
* 档案出库Service接口
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-11
|
||||
*/
|
||||
public interface IPutoutService
|
||||
{
|
||||
/**
|
||||
* 查询档案出库列表
|
||||
*
|
||||
* @param archives 档案出库
|
||||
* @return 档案出库集合
|
||||
*/
|
||||
List<ArchivesMaster> selectPutoutList(ArchivesMaster archives);
|
||||
|
||||
/**
|
||||
* 确认出库
|
||||
* @param archivesId
|
||||
*/
|
||||
void confirmPutout(String archivesId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.jeethink.save.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
|
||||
/**
|
||||
* 档案移交Service接口
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-11
|
||||
*/
|
||||
public interface IarchiveHandOverService
|
||||
{
|
||||
/**
|
||||
* 查询档案移交
|
||||
*
|
||||
* @param archivesId 档案移交ID
|
||||
* @return 档案移交
|
||||
*/
|
||||
public ArchivesMaster selectarchiveHandOverById(String archivesId);
|
||||
|
||||
/**
|
||||
* 查询档案移交列表
|
||||
*
|
||||
* @param archiveHandOver 档案移交
|
||||
* @return 档案移交集合
|
||||
*/
|
||||
public List<ArchivesMaster> selectarchiveHandOverList(ArchivesMaster archiveHandOver);
|
||||
|
||||
/**
|
||||
* 新增档案移交
|
||||
*
|
||||
* @param archiveHandOver 档案移交
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertarchiveHandOver(ArchivesMaster archiveHandOver);
|
||||
|
||||
/**
|
||||
* 修改档案移交
|
||||
*
|
||||
* @param archiveHandOver 档案移交
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatearchiveHandOver(ArchivesMaster archiveHandOver);
|
||||
|
||||
/**
|
||||
* 批量删除档案移交
|
||||
*
|
||||
* @param archivesIds 需要删除的档案移交ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletearchiveHandOverByIds(String[] archivesIds);
|
||||
|
||||
/**
|
||||
* 删除档案移交信息
|
||||
*
|
||||
* @param archivesId 档案移交ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletearchiveHandOverById(String archivesId);
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.jeethink.save.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeethink.common.constant.Constants;
|
||||
import com.jeethink.common.exception.CustomException;
|
||||
import com.jeethink.flow.service.IFlowService;
|
||||
import com.jeethink.receive.mapper.ArchivesMapper;
|
||||
import com.jeethink.receive.service.IArchivesService;
|
||||
import com.jeethink.receive.vo.ArchivesVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.save.service.IPutinService;
|
||||
|
||||
/**
|
||||
* 档案入库Service业务层处理
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-11
|
||||
*/
|
||||
@Service
|
||||
public class PutinServiceImpl implements IPutinService
|
||||
{
|
||||
@Autowired
|
||||
private IArchivesService archivesService;
|
||||
@Autowired
|
||||
private IFlowService flowService;
|
||||
|
||||
@Override
|
||||
public List<ArchivesMaster> selectPutinList(ArchivesMaster archives) {
|
||||
|
||||
archives.setNowStatus(Constants.ARCHIVES_STATUS_RECEIVE_WAIT);
|
||||
return archivesService.selectArchivesList(archives);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void confirmPutin(String archivesId) {
|
||||
|
||||
ArchivesMaster archives = archivesService.selectById(archivesId);
|
||||
if (!Constants.ARCHIVES_STATUS_RECEIVE_WAIT.equals(archives.getNowStatus())) {
|
||||
throw new CustomException("该档案当前状态不能入库");
|
||||
}
|
||||
archivesService.changeNowStatus(archivesId, Constants.ARCHIVES_STATUS_RK);
|
||||
flowService.finishFlow(archivesId, Constants.FLOW_TYPE_RECEIVE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArchivesVO selectArchivesById(String archivesId) {
|
||||
|
||||
return archivesService.selectArchivesById(archivesId);
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.jeethink.save.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeethink.common.constant.Constants;
|
||||
import com.jeethink.common.exception.CustomException;
|
||||
import com.jeethink.flow.service.IFlowService;
|
||||
import com.jeethink.receive.mapper.ArchivesMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.save.service.IPutoutService;
|
||||
|
||||
/**
|
||||
* 档案出库Service业务层处理
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-11
|
||||
*/
|
||||
@Service
|
||||
public class PutoutServiceImpl implements IPutoutService
|
||||
{
|
||||
@Autowired
|
||||
private ArchivesMapper archivesMapper;
|
||||
|
||||
@Autowired
|
||||
private IFlowService flowService;
|
||||
|
||||
/**
|
||||
* 查询档案出库列表
|
||||
*
|
||||
* @param archives 档案出库
|
||||
* @return 档案出库集合
|
||||
*/
|
||||
@Override
|
||||
public List<ArchivesMaster> selectPutoutList(ArchivesMaster archives) {
|
||||
|
||||
archives.setNowStatus(Constants.ARCHIVES_STATUS_DESTROY_WAIT);
|
||||
return archivesMapper.selectArchivesList(archives);
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认出库
|
||||
*
|
||||
* @param archivesId
|
||||
*/
|
||||
@Override
|
||||
public void confirmPutout(String archivesId) {
|
||||
|
||||
ArchivesMaster archives = archivesMapper.selectById(archivesId);
|
||||
if (!Constants.ARCHIVES_STATUS_DESTROY_WAIT.equals(archives.getNowStatus())) {
|
||||
throw new CustomException("该档案当前状态不能出库");
|
||||
}
|
||||
archivesMapper.changeNowStatus(archivesId, Constants.ARCHIVES_STATUS_DESTROY);
|
||||
flowService.finishFlow(archivesId, Constants.FLOW_TYPE_DESTROY);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.jeethink.save.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.jeethink.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jeethink.save.mapper.archiveHandOverMapper;
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.save.service.IarchiveHandOverService;
|
||||
|
||||
/**
|
||||
* 档案移交Service业务层处理
|
||||
*
|
||||
* @author sh
|
||||
* @date 2022-11-11
|
||||
*/
|
||||
@Service
|
||||
public class archiveHandOverServiceImpl implements IarchiveHandOverService
|
||||
{
|
||||
@Autowired
|
||||
private archiveHandOverMapper archiveHandOverMapper;
|
||||
|
||||
/**
|
||||
* 查询档案移交
|
||||
*
|
||||
* @param archivesId 档案移交ID
|
||||
* @return 档案移交
|
||||
*/
|
||||
@Override
|
||||
public ArchivesMaster selectarchiveHandOverById(String archivesId)
|
||||
{
|
||||
return archiveHandOverMapper.selectarchiveHandOverById(archivesId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询档案移交列表
|
||||
*
|
||||
* @param archiveHandOver 档案移交
|
||||
* @return 档案移交
|
||||
*/
|
||||
@Override
|
||||
public List<ArchivesMaster> selectarchiveHandOverList(ArchivesMaster archiveHandOver)
|
||||
{
|
||||
return archiveHandOverMapper.selectarchiveHandOverList(archiveHandOver);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增档案移交
|
||||
*
|
||||
* @param archiveHandOver 档案移交
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertarchiveHandOver(ArchivesMaster archiveHandOver)
|
||||
{
|
||||
archiveHandOver.setCreateTime(DateUtils.getNowDate());
|
||||
return archiveHandOverMapper.insertarchiveHandOver(archiveHandOver);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改档案移交
|
||||
*
|
||||
* @param archiveHandOver 档案移交
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updatearchiveHandOver(ArchivesMaster archiveHandOver)
|
||||
{
|
||||
archiveHandOver.setUpdateTime(DateUtils.getNowDate());
|
||||
return archiveHandOverMapper.updatearchiveHandOver(archiveHandOver);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除档案移交
|
||||
*
|
||||
* @param archivesIds 需要删除的档案移交ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletearchiveHandOverByIds(String[] archivesIds)
|
||||
{
|
||||
return archiveHandOverMapper.deletearchiveHandOverByIds(archivesIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除档案移交信息
|
||||
*
|
||||
* @param archivesId 档案移交ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletearchiveHandOverById(String archivesId)
|
||||
{
|
||||
return archiveHandOverMapper.deletearchiveHandOverById(archivesId);
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.jeethink.tjfx.controller;
|
||||
|
||||
import com.jeethink.common.core.controller.BaseController;
|
||||
import com.jeethink.common.core.domain.AjaxResult;
|
||||
import com.jeethink.tjfx.service.ITjfxService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 统计分析
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/tjfx/tjfx")
|
||||
public class TjfxController extends BaseController
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private ITjfxService tjfxService;
|
||||
|
||||
/**
|
||||
* 查询首页顶部数据
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/selectShowData")
|
||||
public AjaxResult selectShowData(){
|
||||
HashMap map = new HashMap();
|
||||
map = tjfxService.selectShowData();
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询首页接收记录
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/selectReceiveList")
|
||||
public AjaxResult selectReceiveList(){
|
||||
List<HashMap> receiveList = tjfxService.selectReceiveList();
|
||||
return AjaxResult.success(receiveList);
|
||||
}
|
||||
@GetMapping("/selectBorrowList")
|
||||
public AjaxResult selectBorrowList(){
|
||||
List<HashMap> borrowList = tjfxService.selectBorrowList();
|
||||
return AjaxResult.success(borrowList);
|
||||
}
|
||||
@GetMapping("/selectReturnList")
|
||||
public AjaxResult selectReturnList(){
|
||||
List<HashMap> returnList = tjfxService.selectReturnList();
|
||||
return AjaxResult.success(returnList);
|
||||
}
|
||||
@GetMapping("/selectPieChartList")
|
||||
public AjaxResult selectPieChartList(){
|
||||
List<HashMap> pieChartList = tjfxService.selectPieChartList();
|
||||
return AjaxResult.success(pieChartList);
|
||||
}
|
||||
@GetMapping("/selectRKListByMonth")
|
||||
public AjaxResult selectRKListByMonth(){
|
||||
List<HashMap> RKListByMonth = tjfxService.selectRKListByMonth();
|
||||
return AjaxResult.success(RKListByMonth);
|
||||
}
|
||||
@GetMapping("/selectJyPieChartList")
|
||||
public AjaxResult selectJyPieChartList(){
|
||||
List<HashMap> pieChartList = tjfxService.selectJyPieChartList();
|
||||
return AjaxResult.success(pieChartList);
|
||||
}
|
||||
@GetMapping("/selectTJListByMonth")
|
||||
public AjaxResult selectTJListByMonth(){
|
||||
List<HashMap> list = tjfxService.selectTJListByMonth();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@GetMapping("/selectTJListByYear")
|
||||
public AjaxResult selectTJListByYear(){
|
||||
List<HashMap> list = tjfxService.selectTJListByYear();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@GetMapping("/selectReceiveLineList")
|
||||
public AjaxResult selectReceiveLineList(){
|
||||
List<HashMap> list = tjfxService.selectReceiveLineList();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@GetMapping("/selectBorrowBarList")
|
||||
public AjaxResult selectBorrowBarList(){
|
||||
List<HashMap> list = tjfxService.selectBorrowBarList();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.jeethink.tjfx.mapper;
|
||||
|
||||
import com.jeethink.dataCenter.domain.Warehouse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 统计分析Mapper接口
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
public interface TjfxMapper {
|
||||
|
||||
|
||||
List<HashMap> selectReceiveCount();
|
||||
|
||||
List<HashMap> selectManageCount();
|
||||
|
||||
List<HashMap> selectUseCount();
|
||||
|
||||
List<HashMap> selectSaveCount();
|
||||
|
||||
List<HashMap> selectReceiveList();
|
||||
|
||||
List<HashMap> selectBorrowList();
|
||||
|
||||
List<HashMap> selectReturnList();
|
||||
|
||||
List<HashMap> selectPieChartList();
|
||||
|
||||
List<HashMap> selectRKListByMonth();
|
||||
|
||||
List<HashMap> selectJyPieChartList();
|
||||
|
||||
List<HashMap> selectTJListByMonth();
|
||||
|
||||
List<HashMap> selectTJListByYear();
|
||||
|
||||
List<HashMap> selectRsListByMonth();
|
||||
|
||||
List<HashMap> selectJkListByMonth();
|
||||
|
||||
List<HashMap> selectRsJyListByMonth();
|
||||
|
||||
List<HashMap> selectJkJyListByMonth();
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.jeethink.tjfx.service;
|
||||
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 统计分析 服务层
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
public interface ITjfxService
|
||||
{
|
||||
|
||||
|
||||
HashMap selectShowData();
|
||||
|
||||
List<HashMap> selectReceiveList();
|
||||
|
||||
List<HashMap> selectBorrowList();
|
||||
|
||||
List<HashMap> selectReturnList();
|
||||
|
||||
List<HashMap> selectPieChartList();
|
||||
|
||||
List<HashMap> selectRKListByMonth();
|
||||
|
||||
List<HashMap> selectJyPieChartList();
|
||||
|
||||
List<HashMap> selectTJListByMonth();
|
||||
|
||||
List<HashMap> selectTJListByYear();
|
||||
|
||||
List<HashMap> selectReceiveLineList();
|
||||
|
||||
List<HashMap> selectBorrowBarList();
|
||||
}
|
@ -0,0 +1,184 @@
|
||||
package com.jeethink.tjfx.service.impl;
|
||||
|
||||
|
||||
import com.jeethink.tjfx.mapper.TjfxMapper;
|
||||
import com.jeethink.tjfx.service.ITjfxService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 统计分析 服务层
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@Service
|
||||
public class TjfxServiceImpl implements ITjfxService
|
||||
{
|
||||
@Autowired
|
||||
private TjfxMapper tjfxMapper;
|
||||
|
||||
@Override
|
||||
public HashMap selectShowData() {
|
||||
HashMap map = new HashMap();
|
||||
List<HashMap> receive = new ArrayList<>();
|
||||
List<HashMap> manage = new ArrayList<>();
|
||||
List<HashMap> use = new ArrayList<>();
|
||||
List<HashMap> save = new ArrayList<>();
|
||||
receive = tjfxMapper.selectReceiveCount();
|
||||
manage = tjfxMapper.selectManageCount();
|
||||
use = tjfxMapper.selectUseCount();
|
||||
save = tjfxMapper.selectSaveCount();
|
||||
map.put("receive",receive);
|
||||
map.put("manage",manage);
|
||||
map.put("use",use);
|
||||
map.put("save",save);
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> selectReceiveList() {
|
||||
List<HashMap> receiveList = tjfxMapper.selectReceiveList();
|
||||
return receiveList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> selectBorrowList() {
|
||||
List<HashMap> borrowList = tjfxMapper.selectBorrowList();
|
||||
return borrowList;
|
||||
}
|
||||
@Override
|
||||
public List<HashMap> selectReturnList() {
|
||||
List<HashMap> returnList = tjfxMapper.selectReturnList();
|
||||
return returnList;
|
||||
}
|
||||
@Override
|
||||
public List<HashMap> selectPieChartList() {
|
||||
List<HashMap> pieChartList = tjfxMapper.selectPieChartList();
|
||||
return pieChartList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> selectRKListByMonth() {
|
||||
List<HashMap> RKListByMonth = tjfxMapper.selectRKListByMonth();
|
||||
return RKListByMonth;
|
||||
}
|
||||
@Override
|
||||
public List<HashMap> selectJyPieChartList() {
|
||||
List<HashMap> jyPieChartList = tjfxMapper.selectJyPieChartList();
|
||||
return jyPieChartList;
|
||||
}
|
||||
@Override
|
||||
public List<HashMap> selectTJListByMonth() {
|
||||
List<HashMap> jyPieChartList = tjfxMapper.selectTJListByMonth();
|
||||
return jyPieChartList;
|
||||
}
|
||||
@Override
|
||||
public List<HashMap> selectTJListByYear() {
|
||||
List<HashMap> jyPieChartList = tjfxMapper.selectTJListByYear();
|
||||
return jyPieChartList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> selectReceiveLineList() {
|
||||
List<HashMap> rsList = tjfxMapper.selectRsListByMonth();
|
||||
List<HashMap> jkList = tjfxMapper.selectJkListByMonth();
|
||||
List list0 = Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
List<HashMap> list = new ArrayList<>();
|
||||
HashMap map1 = new HashMap();
|
||||
map1.put("name","人事");
|
||||
if(rsList.size()>0){
|
||||
List list1 = new ArrayList();
|
||||
list1.add(rsList.get(0).get("January"));
|
||||
list1.add(rsList.get(0).get("February"));
|
||||
list1.add(rsList.get(0).get("March"));
|
||||
list1.add(rsList.get(0).get("April"));
|
||||
list1.add(rsList.get(0).get("May"));
|
||||
list1.add(rsList.get(0).get("June"));
|
||||
list1.add(rsList.get(0).get("July"));
|
||||
list1.add(rsList.get(0).get("August"));
|
||||
list1.add(rsList.get(0).get("September"));
|
||||
list1.add(rsList.get(0).get("October"));
|
||||
list1.add(rsList.get(0).get("November"));
|
||||
list1.add(rsList.get(0).get("December"));
|
||||
map1.put("data",list1);
|
||||
}else{
|
||||
map1.put("data",list0);
|
||||
}
|
||||
list.add(map1);
|
||||
HashMap map2 = new HashMap();
|
||||
map2.put("name","健康");
|
||||
if(jkList.size()>0){
|
||||
List list2 = new ArrayList();
|
||||
list2.add(jkList.get(0).get("January"));
|
||||
list2.add(jkList.get(0).get("February"));
|
||||
list2.add(jkList.get(0).get("March"));
|
||||
list2.add(jkList.get(0).get("April"));
|
||||
list2.add(jkList.get(0).get("May"));
|
||||
list2.add(jkList.get(0).get("June"));
|
||||
list2.add(jkList.get(0).get("July"));
|
||||
list2.add(jkList.get(0).get("August"));
|
||||
list2.add(jkList.get(0).get("September"));
|
||||
list2.add(jkList.get(0).get("October"));
|
||||
list2.add(jkList.get(0).get("November"));
|
||||
list2.add(jkList.get(0).get("December"));
|
||||
map2.put("data",list2);
|
||||
}else{
|
||||
map2.put("data",list0);
|
||||
}
|
||||
list.add(map2);
|
||||
return list;
|
||||
}
|
||||
@Override
|
||||
public List<HashMap> selectBorrowBarList() {
|
||||
List<HashMap> rsList = tjfxMapper.selectRsJyListByMonth();
|
||||
List<HashMap> jkList = tjfxMapper.selectJkJyListByMonth();
|
||||
List list0 = Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
List<HashMap> list = new ArrayList<>();
|
||||
HashMap map1 = new HashMap();
|
||||
map1.put("name","人事");
|
||||
if(rsList.size()>0){
|
||||
List list1 = new ArrayList();
|
||||
list1.add(rsList.get(0).get("January"));
|
||||
list1.add(rsList.get(0).get("February"));
|
||||
list1.add(rsList.get(0).get("March"));
|
||||
list1.add(rsList.get(0).get("April"));
|
||||
list1.add(rsList.get(0).get("May"));
|
||||
list1.add(rsList.get(0).get("June"));
|
||||
list1.add(rsList.get(0).get("July"));
|
||||
list1.add(rsList.get(0).get("August"));
|
||||
list1.add(rsList.get(0).get("September"));
|
||||
list1.add(rsList.get(0).get("October"));
|
||||
list1.add(rsList.get(0).get("November"));
|
||||
list1.add(rsList.get(0).get("December"));
|
||||
map1.put("data",list1);
|
||||
}else{
|
||||
map1.put("data",list0);
|
||||
}
|
||||
list.add(map1);
|
||||
HashMap map2 = new HashMap();
|
||||
map2.put("name","健康");
|
||||
if(jkList.size()>0){
|
||||
List list2 = new ArrayList();
|
||||
list2.add(jkList.get(0).get("January"));
|
||||
list2.add(jkList.get(0).get("February"));
|
||||
list2.add(jkList.get(0).get("March"));
|
||||
list2.add(jkList.get(0).get("April"));
|
||||
list2.add(jkList.get(0).get("May"));
|
||||
list2.add(jkList.get(0).get("June"));
|
||||
list2.add(jkList.get(0).get("July"));
|
||||
list2.add(jkList.get(0).get("August"));
|
||||
list2.add(jkList.get(0).get("September"));
|
||||
list2.add(jkList.get(0).get("October"));
|
||||
list2.add(jkList.get(0).get("November"));
|
||||
list2.add(jkList.get(0).get("December"));
|
||||
map2.put("data",list2);
|
||||
}else{
|
||||
map2.put("data",list0);
|
||||
}
|
||||
list.add(map2);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.jeethink.using.controller;
|
||||
|
||||
import com.jeethink.bean.vo.Approval;
|
||||
import com.jeethink.common.core.controller.BaseController;
|
||||
import com.jeethink.common.core.domain.AjaxResult;
|
||||
import com.jeethink.common.core.page.TableDataInfo;
|
||||
import com.jeethink.using.domain.ArchivesBorrow;
|
||||
import com.jeethink.using.service.IBorrowApprovalService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/using/approval")
|
||||
public class BorrowApprovalController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IBorrowApprovalService approvalService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ArchivesBorrow borrow) {
|
||||
|
||||
startPage();
|
||||
List<ArchivesBorrow> list = approvalService.selectApprovalList(borrow);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public AjaxResult check(@RequestBody Approval approval) {
|
||||
|
||||
approvalService.checkApproval(approval);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package com.jeethink.using.controller;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.common.core.controller.BaseController;
|
||||
import com.jeethink.common.core.domain.AjaxResult;
|
||||
import com.jeethink.common.core.page.TableDataInfo;
|
||||
import com.jeethink.using.domain.ArchivesBorrow;
|
||||
import com.jeethink.using.service.IBorrowService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/using/borrow")
|
||||
public class BorrowController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IBorrowService service;
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ArchivesMaster archives) {
|
||||
|
||||
startPage();
|
||||
List<ArchivesMaster> list = service.selectArchivesList(archives);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public AjaxResult apply(@RequestBody ArchivesBorrow borrow) {
|
||||
|
||||
service.applyBorrow(borrow);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@GetMapping("/my")
|
||||
public TableDataInfo myBorrow(ArchivesBorrow borrow) {
|
||||
|
||||
startPage();
|
||||
List<ArchivesBorrow> list = service.selectMyBorrowList(borrow);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/revocation")
|
||||
public AjaxResult revocation(@RequestParam String borrowId) {
|
||||
|
||||
service.revocationBorrow(borrowId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@GetMapping("/info")
|
||||
public AjaxResult borrowInfo(@RequestParam String borrowId) {
|
||||
|
||||
return AjaxResult.success(service.selectById(borrowId));
|
||||
}
|
||||
|
||||
@GetMapping("/history")
|
||||
public TableDataInfo history(ArchivesBorrow borrow) {
|
||||
|
||||
startPage();
|
||||
List<ArchivesBorrow> list = service.selectBorrowHistory(borrow);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/reback")
|
||||
public AjaxResult reback(@RequestParam String borrowId) {
|
||||
|
||||
service.reback(borrowId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@GetMapping("/cancelback")
|
||||
public AjaxResult cancelback(@RequestParam String borrowId) {
|
||||
|
||||
service.cancelReback(borrowId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
package com.jeethink.using.domain;
|
||||
|
||||
|
||||
import com.jeethink.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class ArchivesBorrow extends BaseEntity {
|
||||
|
||||
private String borrowId;
|
||||
private String archivesId;
|
||||
private String borrowStatus;
|
||||
private Date rebackTime;
|
||||
private Date realRebackTime;
|
||||
private String borrowReason;
|
||||
|
||||
private String archivesName;
|
||||
private String createByName;
|
||||
private String archiveNo;
|
||||
private String classified;
|
||||
private String tier;
|
||||
|
||||
|
||||
public String getBorrowId() {
|
||||
return borrowId;
|
||||
}
|
||||
|
||||
public void setBorrowId(String borrowId) {
|
||||
this.borrowId = borrowId;
|
||||
}
|
||||
|
||||
|
||||
public String getArchivesId() {
|
||||
return archivesId;
|
||||
}
|
||||
|
||||
public void setArchivesId(String archivesId) {
|
||||
this.archivesId = archivesId;
|
||||
}
|
||||
|
||||
|
||||
public String getBorrowStatus() {
|
||||
return borrowStatus;
|
||||
}
|
||||
|
||||
public void setBorrowStatus(String borrowStatus) {
|
||||
this.borrowStatus = borrowStatus;
|
||||
}
|
||||
|
||||
|
||||
public Date getRebackTime() {
|
||||
return rebackTime;
|
||||
}
|
||||
|
||||
public void setRebackTime(Date rebackTime) {
|
||||
this.rebackTime = rebackTime;
|
||||
}
|
||||
|
||||
|
||||
public Date getRealRebackTime() {
|
||||
return realRebackTime;
|
||||
}
|
||||
|
||||
public void setRealRebackTime(Date realRebackTime) {
|
||||
this.realRebackTime = realRebackTime;
|
||||
}
|
||||
|
||||
public String getArchivesName() {
|
||||
return archivesName;
|
||||
}
|
||||
|
||||
public void setArchivesName(String archivesName) {
|
||||
this.archivesName = archivesName;
|
||||
}
|
||||
|
||||
public String getCreateByName() {
|
||||
return createByName;
|
||||
}
|
||||
|
||||
public void setCreateByName(String createByName) {
|
||||
this.createByName = createByName;
|
||||
}
|
||||
|
||||
public String getBorrowReason() {
|
||||
return borrowReason;
|
||||
}
|
||||
|
||||
public void setBorrowReason(String borrowReason) {
|
||||
this.borrowReason = borrowReason;
|
||||
}
|
||||
|
||||
public String getArchiveNo() {
|
||||
return archiveNo;
|
||||
}
|
||||
|
||||
public void setArchiveNo(String archiveNo) {
|
||||
this.archiveNo = archiveNo;
|
||||
}
|
||||
|
||||
public String getClassified() {
|
||||
return classified;
|
||||
}
|
||||
|
||||
public void setClassified(String classified) {
|
||||
this.classified = classified;
|
||||
}
|
||||
|
||||
public String getTier() {
|
||||
return tier;
|
||||
}
|
||||
|
||||
public void setTier(String tier) {
|
||||
this.tier = tier;
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.jeethink.using.mapper;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.using.domain.ArchivesBorrow;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BorrowMapper {
|
||||
|
||||
List<ArchivesBorrow> selectMyBorrowList(ArchivesBorrow borrow);
|
||||
|
||||
ArchivesBorrow selectById(String borrowId);
|
||||
|
||||
void removeBorrow(String borrowId);
|
||||
|
||||
List<ArchivesBorrow> selectBorrowHistory(ArchivesBorrow borrow);
|
||||
|
||||
/**
|
||||
* 查询借阅中的记录
|
||||
* @param borrow
|
||||
* @return
|
||||
*/
|
||||
List<ArchivesBorrow> selectBorrowingList(ArchivesBorrow borrow);
|
||||
|
||||
void insertBorrow(ArchivesBorrow borrow);
|
||||
|
||||
|
||||
void changeBorrowStatus(@Param("borrowId") String borrowId, @Param("borrowStatus") String borrowStatus);
|
||||
|
||||
List<ArchivesBorrow> selectStatusBorrowList(@Param("borrow") ArchivesBorrow borrow, @Param("statusList") List statusList);
|
||||
|
||||
List<ArchivesMaster> selectArchivesList(ArchivesMaster archives);
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.jeethink.using.service;
|
||||
|
||||
import com.jeethink.bean.vo.Approval;
|
||||
import com.jeethink.using.domain.ArchivesBorrow;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IBorrowApprovalService {
|
||||
|
||||
List<ArchivesBorrow> selectApprovalList(ArchivesBorrow borrow);
|
||||
|
||||
void checkApproval(Approval approval);
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.jeethink.using.service;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.using.domain.ArchivesBorrow;
|
||||
import com.jeethink.using.vo.BorrowVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IBorrowService {
|
||||
|
||||
/**
|
||||
* 获取可借阅档案
|
||||
* @param archives
|
||||
* @return
|
||||
*/
|
||||
List<ArchivesMaster> selectArchivesList(ArchivesMaster archives);
|
||||
|
||||
/**
|
||||
* 申请借阅
|
||||
* @param borrow
|
||||
*/
|
||||
void applyBorrow(ArchivesBorrow borrow);
|
||||
|
||||
/**
|
||||
* 获取我的借阅记录
|
||||
* @param borrow
|
||||
* @return
|
||||
*/
|
||||
List<ArchivesBorrow> selectMyBorrowList(ArchivesBorrow borrow);
|
||||
|
||||
/**
|
||||
* 撤销借阅申请
|
||||
* @param borrowId
|
||||
*/
|
||||
void revocationBorrow(String borrowId);
|
||||
|
||||
/**
|
||||
* 获取借阅详情
|
||||
* @param borrowId
|
||||
* @return
|
||||
*/
|
||||
BorrowVO selectById(String borrowId);
|
||||
|
||||
/**
|
||||
* 获取借阅历史
|
||||
* @param borrow
|
||||
* @return
|
||||
*/
|
||||
List<ArchivesBorrow> selectBorrowHistory(ArchivesBorrow borrow);
|
||||
|
||||
/**
|
||||
* 申请归还
|
||||
* @param borrowId
|
||||
*/
|
||||
void reback(String borrowId);
|
||||
|
||||
void cancelReback(String borrowId);
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package com.jeethink.using.service.impl;
|
||||
|
||||
import com.jeethink.bean.vo.Approval;
|
||||
import com.jeethink.common.constant.Constants;
|
||||
import com.jeethink.common.core.domain.entity.SysUser;
|
||||
import com.jeethink.common.exception.CustomException;
|
||||
import com.jeethink.common.utils.SecurityUtils;
|
||||
import com.jeethink.flow.service.IFlowService;
|
||||
import com.jeethink.using.domain.ArchivesBorrow;
|
||||
import com.jeethink.using.mapper.BorrowMapper;
|
||||
import com.jeethink.using.service.IBorrowApprovalService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class BorrowApprovalServiceImpl implements IBorrowApprovalService {
|
||||
|
||||
@Autowired
|
||||
private BorrowMapper mapper;
|
||||
@Autowired
|
||||
private IFlowService flowService;
|
||||
|
||||
@Override
|
||||
public List<ArchivesBorrow> selectApprovalList(ArchivesBorrow borrow) {
|
||||
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
borrow.setCreateBy(user.getUserName());
|
||||
List<ArchivesBorrow> list = new ArrayList<>();
|
||||
List statusList = new ArrayList();
|
||||
if (Constants.USER_TYPE_ZG.equals(user.getUserType())) {
|
||||
statusList.add(Constants.BORROW_STATUS_APPLY);
|
||||
statusList.add(Constants.BORROW_STATUS_BACK);
|
||||
list = mapper.selectStatusBorrowList(borrow, statusList);
|
||||
}else if (Constants.USER_TYPE_BZ.equals(user.getUserType())) {
|
||||
statusList.add(Constants.BORROW_STATUS_APPROVE);
|
||||
list = mapper.selectStatusBorrowList(borrow, statusList);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkApproval(Approval approval) {
|
||||
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
if (!Constants.USER_TYPE_ZG.equals(user.getUserType())
|
||||
&& !Constants.USER_TYPE_BZ.equals(user.getUserType())) {
|
||||
throw new CustomException("您没有审批权限");
|
||||
}
|
||||
|
||||
String borrowId = approval.getObjectId();
|
||||
ArchivesBorrow borrow = mapper.selectById(borrowId);
|
||||
if (Constants.USER_TYPE_ZG.equals(user.getUserType())) {//主管:借阅审批1与归还审批
|
||||
if (Constants.BORROW_STATUS_APPLY.equals(borrow.getBorrowStatus())) {
|
||||
if(Constants.APPROVE_PASS.equals(approval.getStatus())) {
|
||||
mapper.changeBorrowStatus(borrowId, Constants.BORROW_STATUS_APPROVE);
|
||||
}else {
|
||||
mapper.changeBorrowStatus(borrowId, Constants.BORROW_STATUS_REJECT);
|
||||
}
|
||||
flowService.updateFlow(borrowId, Constants.FLOW_TYPE_BORROW, approval.getStatus(), approval.getRemark());
|
||||
}else if (Constants.BORROW_STATUS_BACK.equals(borrow.getBorrowStatus())) {
|
||||
if(Constants.APPROVE_PASS.equals(approval.getStatus())) {
|
||||
mapper.changeBorrowStatus(borrowId, Constants.BORROW_STATUS_FINISH);
|
||||
}else {
|
||||
mapper.changeBorrowStatus(borrowId, Constants.BORROW_STATUS_BACK_REJECT);
|
||||
}
|
||||
flowService.updateFlow(borrowId, Constants.FLOW_TYPE_BACK, approval.getStatus(), approval.getRemark());
|
||||
} else {
|
||||
throw new CustomException("该档案目前无需审批");
|
||||
}
|
||||
}else if (Constants.USER_TYPE_BZ.equals(user.getUserType())) {//部长:借阅审批2
|
||||
if (Constants.BORROW_STATUS_APPROVE.equals(borrow.getBorrowStatus())) {
|
||||
if(Constants.APPROVE_PASS.equals(approval.getStatus())) {
|
||||
mapper.changeBorrowStatus(borrowId, Constants.BORROW_STATUS_VIEW);
|
||||
}else {
|
||||
mapper.changeBorrowStatus(borrowId, Constants.BORROW_STATUS_REJECT);
|
||||
}
|
||||
flowService.updateFlow(borrowId, Constants.FLOW_TYPE_BORROW, approval.getStatus(), approval.getRemark());
|
||||
}else {
|
||||
throw new CustomException("该档案目前无需审批");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
package com.jeethink.using.service.impl;
|
||||
|
||||
import com.jeethink.bean.domain.ArchivesMaster;
|
||||
import com.jeethink.common.constant.Constants;
|
||||
import com.jeethink.common.exception.CustomException;
|
||||
import com.jeethink.common.utils.SecurityUtils;
|
||||
import com.jeethink.common.utils.uuid.IdUtils;
|
||||
import com.jeethink.flow.domain.FlowRecord;
|
||||
import com.jeethink.flow.service.IFlowService;
|
||||
import com.jeethink.using.domain.ArchivesBorrow;
|
||||
import com.jeethink.using.mapper.BorrowMapper;
|
||||
import com.jeethink.using.service.IBorrowService;
|
||||
import com.jeethink.using.vo.BorrowVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class BorrowServiceImpl implements IBorrowService {
|
||||
|
||||
@Autowired
|
||||
private BorrowMapper mapper;
|
||||
@Autowired
|
||||
private IFlowService flowService;
|
||||
|
||||
@Override
|
||||
public List<ArchivesMaster> selectArchivesList(ArchivesMaster archives) {
|
||||
|
||||
archives.setCreateBy(SecurityUtils.getUsername());
|
||||
return mapper.selectArchivesList(archives);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBorrow(ArchivesBorrow borrow) {
|
||||
borrow.setCreateBy(SecurityUtils.getUsername());
|
||||
List<ArchivesBorrow> list = mapper.selectBorrowingList(borrow);
|
||||
if (list.size() > 0) {
|
||||
throw new CustomException("你已借阅该档案");
|
||||
}
|
||||
String borrowId = IdUtils.simpleUUID();
|
||||
borrow.setBorrowId(borrowId);
|
||||
borrow.setBorrowStatus(Constants.BORROW_STATUS_APPLY);
|
||||
mapper.insertBorrow(borrow);
|
||||
flowService.insertFlow(borrowId, Constants.FLOW_TYPE_BORROW);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArchivesBorrow> selectMyBorrowList(ArchivesBorrow borrow) {
|
||||
|
||||
String userName = SecurityUtils.getUsername();
|
||||
borrow.setCreateBy(userName);
|
||||
return mapper.selectMyBorrowList(borrow);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void revocationBorrow(String borrowId) {
|
||||
|
||||
ArchivesBorrow borrow = mapper.selectById(borrowId);
|
||||
if (!Constants.BORROW_STATUS_APPLY.equals(borrow.getBorrowStatus())) {
|
||||
throw new CustomException("该借阅申请已无法撤销");
|
||||
}
|
||||
mapper.removeBorrow(borrowId);
|
||||
flowService.destroyFlow(borrowId, Constants.FLOW_TYPE_BORROW);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BorrowVO selectById(String borrowId) {
|
||||
|
||||
ArchivesBorrow borrow = mapper.selectById(borrowId);
|
||||
List<FlowRecord> records = new ArrayList<>();
|
||||
if (Integer.parseInt(Constants.BORROW_STATUS_VIEW) >= Integer.parseInt(borrow.getBorrowStatus())) {
|
||||
records = flowService.selectRecord(borrowId, Constants.FLOW_TYPE_BORROW);
|
||||
}
|
||||
if (Integer.parseInt(Constants.BORROW_STATUS_VIEW) < Integer.parseInt(borrow.getBorrowStatus())) {
|
||||
records = flowService.selectRecord(borrowId, Constants.FLOW_TYPE_BACK);
|
||||
}
|
||||
BorrowVO vo = new BorrowVO(borrow);
|
||||
vo.setFlowRecords(records);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArchivesBorrow> selectBorrowHistory(ArchivesBorrow borrow) {
|
||||
|
||||
return mapper.selectBorrowHistory(borrow);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reback(String borrowId) {
|
||||
|
||||
ArchivesBorrow borrow = mapper.selectById(borrowId);
|
||||
if (!Constants.BORROW_STATUS_VIEW.equals(borrow.getBorrowStatus())
|
||||
&& !Constants.BORROW_STATUS_BACK_REJECT.equals(borrow.getBorrowStatus())) {
|
||||
throw new CustomException("该档案当前状态无法归还");
|
||||
}
|
||||
if (Constants.BORROW_STATUS_BACK_REJECT.equals(borrow.getBorrowStatus())) {
|
||||
flowService.destroyFlow(borrowId, Constants.FLOW_TYPE_BACK);
|
||||
}
|
||||
mapper.changeBorrowStatus(borrowId, Constants.BORROW_STATUS_BACK);
|
||||
flowService.insertFlow(borrowId, Constants.FLOW_TYPE_BACK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelReback(String borrowId) {
|
||||
|
||||
ArchivesBorrow borrow = mapper.selectById(borrowId);
|
||||
if (!Constants.BORROW_STATUS_BACK_REJECT.equals(borrow.getBorrowStatus())) {
|
||||
throw new CustomException("当前状态无法撤销归还");
|
||||
}
|
||||
mapper.changeBorrowStatus(borrowId, Constants.BORROW_STATUS_VIEW);
|
||||
flowService.destroyFlow(borrowId, Constants.FLOW_TYPE_BACK);
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.jeethink.using.vo;
|
||||
|
||||
import com.jeethink.common.utils.bean.BeanUtils;
|
||||
import com.jeethink.flow.domain.FlowRecord;
|
||||
import com.jeethink.using.domain.ArchivesBorrow;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BorrowVO extends ArchivesBorrow {
|
||||
|
||||
List<FlowRecord> flowRecords;
|
||||
|
||||
public BorrowVO(ArchivesBorrow borrow) {
|
||||
BeanUtils.copyProperties(borrow, this);
|
||||
}
|
||||
|
||||
public List<FlowRecord> getFlowRecords() {
|
||||
return flowRecords;
|
||||
}
|
||||
|
||||
public void setFlowRecords(List<FlowRecord> flowRecords) {
|
||||
this.flowRecords = flowRecords;
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.jeethink.bean.mapper.ArchivesMapper">
|
||||
<sql id="selectArchivesVo">
|
||||
select a.archives_id, a.name, a.archive_no, a.type, a.people_type, a.tier, a.classified, a.duration, a.if_paper,
|
||||
a.gd_people_id, a.create_time, a.update_time, a.now_status, u.nick_name user_name, u.user_num user_number,
|
||||
d.dept_name, su.nick_name as updater_name,a.warehouse_type
|
||||
from archives_master a
|
||||
left join sys_user u on a.user_id = a.user_id
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user su on su.user_id = a.update_user
|
||||
where a.deleted = '0'
|
||||
</sql>
|
||||
<sql id="selectHistory">
|
||||
select a.archives_id, a.name, a.archive_no, a.type, a.people_type, a.tier, a.classified, a.duration, a.if_paper,
|
||||
a.gd_people_id, a.create_time, a.update_time, a.now_status, u.nick_name user_name, u.user_num user_number,
|
||||
d.dept_name, su.nick_name as updater_name
|
||||
from archives_master a
|
||||
left join sys_user u on a.user_id = a.user_id
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user su on su.user_id = a.update_user
|
||||
left join flow f on f.object_id = a.archives_id
|
||||
where a.deleted = '0' and f.deleted = '0'
|
||||
</sql>
|
||||
|
||||
<update id="changeNowStatus">
|
||||
update archives_master set now_status = #{nowStatus}, update_user = #{updateUser}, update_time = now() where archives_id = #{archivesId}
|
||||
</update>
|
||||
<select id="selectArchivesById" resultMap="archivesMap">
|
||||
<include refid="selectArchivesVo"/>
|
||||
and a.archives_id = #{0}
|
||||
</select>
|
||||
<select id="selectStatusArchivesList" resultMap="archivesMap">
|
||||
<include refid="selectArchivesVo"/>
|
||||
and a.now_status = #{nowStatus}
|
||||
/*todo 其他查询条件*/
|
||||
</select>
|
||||
<select id="selectArchivesHistory" resultMap="archivesMap">
|
||||
<include refid="selectHistory"/>
|
||||
and f.flow_type = #{flowType}
|
||||
/*todo 其他查询条件*/
|
||||
</select>
|
||||
<select id="selectUserArchivesHistory" resultMap="archivesMap">
|
||||
<include refid="selectHistory"/>
|
||||
and f.flow_type = #{flowType} and f.create_by = #{userName}
|
||||
/*todo 其他查询条件*/
|
||||
</select>
|
||||
|
||||
|
||||
<resultMap id="archivesMap" type="ArchivesMaster">
|
||||
<id column="archives_id" property="archivesId"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="archive_no" property="archiveNo"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="people_type" property="peopleType"/>
|
||||
<result column="tier" property="tier"/>
|
||||
<result column="classified" property="classified"/>
|
||||
<result column="duration" property="duration"/>
|
||||
<result column="if_paper" property="ifPaper"/>
|
||||
<result column="gd_people_id" property="gdPeopleId"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="now_status" property="nowStatus"/>
|
||||
<result column="nick_name" property="nickName"/>
|
||||
<result column="user_number" property="userNumber"/>
|
||||
<result column="dept_name" property="deptName"/>
|
||||
<result column="updater_name" property="updaterName"/>
|
||||
</resultMap>
|
||||
</mapper>
|
@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jeethink.dataCenter.mapper.WarehouseMapper">
|
||||
|
||||
<resultMap type="Warehouse" id="warehouseResult">
|
||||
<id property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="level" column="level" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="description" column="description" />
|
||||
<result property="orderNum" column="order_num"/>
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="relaUser" column="rela_user" />
|
||||
<result property="relaUserName" column="rela_user_name" />
|
||||
<result property="wlh" column="wlh" />
|
||||
<result property="lwz" column="lwz" />
|
||||
<result property="ch" column="ch" />
|
||||
<result property="jh" column="jh" />
|
||||
<result property="archivesId" column="archives_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWarehouseVo">
|
||||
select w.id, w.name, w.ancestors, w.level, w.parent_id, w.description, w.status, w.order_num,
|
||||
w.create_by, w.create_time, w.update_by, w.update_time, w.rela_user,w.wlh,w.lwz,w.ch,w.jh,w.archives_id,
|
||||
u.nick_name as rela_user_name
|
||||
from warehouse w
|
||||
left join sys_user u on w.rela_user = u.user_id
|
||||
</sql>
|
||||
<insert id="insertWarehouse" parameterType="Warehouse">
|
||||
insert warehouse (name, parent_id, ancestors, level, description, status, order_num, rela_user, create_by, create_time, update_by, update_time,wlh,lwz,jh,ch,archives_id
|
||||
) values (
|
||||
#{name}, #{parentId}, #{ancestors}, #{level}, #{description}, #{status}, #{orderNum}, #{relaUser}, #{createBy}, now(), #{updateBy}, now(),#{wlh},#{lwz},#{jh},#{ch},#{archivesId}
|
||||
)
|
||||
</insert>
|
||||
<update id="updateWarehouse" parameterType="Warehouse">
|
||||
update warehouse set name = #{name}, parent_id = #{parentId}, ancestors = #{ancestors}, level = #{level}, description = #{description},
|
||||
status = #{status}, order_num = #{orderNum}, rela_user = #{relaUser}, update_by = #{updateBy}, update_time = now(),wlh=#{wlh},lwz=#{lwz},jh=#{jh},ch=#{ch},
|
||||
archives_id = #{archivesId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="deleteWarehouseById">
|
||||
delete from warehouse where id = #{0}
|
||||
</delete>
|
||||
<select id="selectWarehouseList" parameterType="Warehouse" resultMap="warehouseResult">
|
||||
<include refid="selectWarehouseVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> w.name like concat('%', #{name}, '%') </if>
|
||||
<if test="status != null and status != ''"> and w.status = #{status}</if>
|
||||
<if test="parentId != null">and w.parent_id = #{parentId}</if>
|
||||
</where>
|
||||
order by w.order_num
|
||||
</select>
|
||||
<select id="selectWarehouseById" resultMap="warehouseResult">
|
||||
<include refid="selectWarehouseVo"/>
|
||||
where id = #{0}
|
||||
</select>
|
||||
<select id="checkNameUnique" resultMap="warehouseResult">
|
||||
<include refid="selectWarehouseVo"/>
|
||||
where w.name = #{name} and w.parent_id = #{parentId}
|
||||
</select>
|
||||
<select id="selectNormalChildrenById" resultType="java.lang.Integer">
|
||||
select count(*) from warehouse where status = '0' and parent_id = #{0}
|
||||
</select>
|
||||
<select id="getChildList" resultMap="warehouseResult">
|
||||
<include refid="selectWarehouseVo"/>
|
||||
where w.parent_id = #{0}
|
||||
</select>
|
||||
<select id="selectWarehouseByRelaUser" resultMap="warehouseResult">
|
||||
<include refid="selectWarehouseVo"/>
|
||||
where w.rela_user = #{0}
|
||||
</select>
|
||||
<delete id="deleteArchives" parameterType="Long" >
|
||||
delete from warehouse where parent_id=#{id}
|
||||
</delete>
|
||||
<select id="selectArchivesById" parameterType="String" resultType="String">
|
||||
select name from archives_master where archives_id=#{archivesId}
|
||||
</select>
|
||||
<select id="selectArchivesByParentId" parameterType="Long" resultType="java.lang.String">
|
||||
select archives_id from warehouse where parent_id=#{parentId}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.jeethink.flow.mapper.FlowMapper">
|
||||
|
||||
<resultMap id="flowMap" type="Flow">
|
||||
<id property="flowId" column="flow_id"/>
|
||||
<result property="objectId" column="object_id"/>
|
||||
<result property="flowType" column="flow_type"/>
|
||||
<result property="stepNum" column="step_num"/>
|
||||
<result property="flowStatus" column="flow_status"/>
|
||||
<result property="createByName" column="create_by_name"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateByName" column="update_by_name"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
<insert id="insertFlow" parameterType="Flow">
|
||||
insert into flow (flow_id, object_id, flow_type, step_num, create_by, create_time, update_by, update_time)
|
||||
VALUES (#{flowId}, #{objectId}, #{flowType}, #{stepNum}, #{createBy}, now(), #{updateBy}, now())
|
||||
</insert>
|
||||
<insert id="insertRecord" parameterType="FlowRecord">
|
||||
insert into flow_record (record_id, flow_id, step_num, status, remark, create_by, create_time)
|
||||
values (#{recordId}, #{flowId}, #{stepNum}, #{status}, #{remark}, #{createBy}, now())
|
||||
</insert>
|
||||
<update id="updateFlow" parameterType="Flow">
|
||||
update flow set step_num = #{stepNum}, update_by = #{updateBy}, update_time = now()
|
||||
</update>
|
||||
<update id="changeStatusByObjectIdAndFlowType" parameterType="Flow">
|
||||
update flow set flow_status = #{flowStatus}, update_by = #{updateBy}, update_time = now()
|
||||
where flow_status != '2' and flow_status != '3' and object_id = #{objectId} and flow_type = #{flowType}
|
||||
</update>
|
||||
<select id="selectFlowByObjectIdAndFlowType" resultMap="flowMap">
|
||||
select f.flow_id, f.object_id, f.flow_type, f.step_num, f.flow_status,
|
||||
u1.nick_name as create_by_name, f.create_time, u2.nick_name as update_by_name, f.update_time
|
||||
from flow f
|
||||
left join sys_user u1 on f.create_by = u1.user_name
|
||||
left join sys_user u2 on f.update_by = u2.user_name
|
||||
where flow_status != '2' and flow_status != '3' and object_id = #{objectId} and flow_type = #{flowType}
|
||||
</select>
|
||||
<resultMap id="recordMap" type="FlowRecord">
|
||||
<id property="recordId" column="record_id"/>
|
||||
<result property="stepNum" column="step_num"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createByName" column="create_by_name"/>
|
||||
</resultMap>
|
||||
<select id="selectRecordByObjectIdAndFlowType" resultMap="recordMap">
|
||||
select r.record_id, r.step_num, r.status, r.remark, u.nick_name as create_by_name, r.create_time
|
||||
from flow_record r
|
||||
left join sys_user u on r.create_by = u.user_name
|
||||
left join flow f on r.flow_id = f.flow_id
|
||||
where f.flow_status != '2' and f.flow_status != '3' and f.object_id = #{objectId} and f.flow_type = #{flowType}
|
||||
</select>
|
||||
<resultMap id="stepMap" type="FlowStep">
|
||||
<id property="stepId" column="step_id"/>
|
||||
<result property="flowType" column="flow_type"/>
|
||||
<result property="stepName" column="step_name"/>
|
||||
<result property="stepNum" column="step_num"/>
|
||||
</resultMap>
|
||||
<select id="selectStepsByFlowType" resultMap="stepMap">
|
||||
select step_id, flow_type, step_name, step_num
|
||||
from flow_step where flow_type = #{0}
|
||||
order by step_num
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jeethink.manage.mapper.AuthenticateMapper">
|
||||
|
||||
<resultMap type="ArchivesMaster" id="archiveAuthenticateResult">
|
||||
<result property="archivesId" column="archives_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="archiveNo" column="archive_no" />
|
||||
<result property="type" column="type" />
|
||||
<result property="peopleType" column="people_type" />
|
||||
<result property="tier" column="tier" />
|
||||
<result property="classified" column="classified" />
|
||||
<result property="duration" column="duration" />
|
||||
<result property="ifPaper" column="if_paper" />
|
||||
<result property="gdPeopleId" column="gd_people_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createUser" column="create_user" />
|
||||
<result property="updateUser" column="update_user" />
|
||||
<result property="deleted" column="deleted" />
|
||||
<result property="userNumber" column="user_number" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectarchiveAuthenticateVo">
|
||||
select am.archives_id, am.name, am.archive_no, am.type, am.people_type, am.tier, am.classified, am.duration,
|
||||
am.if_paper, am.gd_people_id, am.destroy_type, am.put_type,am.out_type, am.user_id, am.create_time,
|
||||
am.update_time, am.create_user, am.update_user, am.deleted,am.user_name,am.user_number,
|
||||
su.nick_name,sd.dept_name
|
||||
from archives_master am left JOIN sys_user su on am.user_id = su.user_id
|
||||
left JOIN sys_dept sd on su.dept_id = sd.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectarchiveAuthenticateList" parameterType="ArchivesMaster" resultMap="archiveAuthenticateResult">
|
||||
<include refid="selectarchiveAuthenticateVo"/>
|
||||
<where>
|
||||
1=1
|
||||
and am.deleted = '0'
|
||||
and am.destroy_type='0'
|
||||
<if test="name != null and name != ''"> and am.name like concat('%', #{name}, '%')</if>
|
||||
<if test="peopleType != null and peopleType != ''"> and am.people_type = #{peopleType}</if>
|
||||
<if test="userId != null and userId != ''"> and su.user_id = #{userId}</if>
|
||||
<if test="deptId != null and deptId != '' and deptId != 100"> and (sd.dept_id = #{deptId} or sd.parent_id=#{deptId})</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectarchiveAuthenticateById" parameterType="String" resultMap="archiveAuthenticateResult">
|
||||
select archives_id, name, archive_no, type, people_type, tier, classified, duration, if_paper, gd_people_id, destroy_type, put_type,
|
||||
out_type, am.user_id, am.create_time, am.update_time, am.create_user, am.update_user, deleted ,u.nick_name user_name,u.user_num user_number
|
||||
from archives_master am
|
||||
left join sys_user u on u.user_id=am.user_id
|
||||
where archives_id = #{archivesId}
|
||||
</select>
|
||||
|
||||
<insert id="insertarchiveAuthenticate" parameterType="ArchivesMaster">
|
||||
insert into archives_master
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="archivesId != null">archives_id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="archiveNo != null">archive_no,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="peopleType != null">people_type,</if>
|
||||
<if test="tier != null">tier,</if>
|
||||
<if test="classified != null">classified,</if>
|
||||
<if test="duration != null">duration,</if>
|
||||
<if test="ifPaper != null">if_paper,</if>
|
||||
<if test="gdPeopleId != null">gd_people_id,</if>
|
||||
<if test="destroyType != null">destroy_type,</if>
|
||||
<if test="putType != null">put_type,</if>
|
||||
<if test="outType != null">out_type,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createUser != null">create_user,</if>
|
||||
<if test="updateUser != null">update_user,</if>
|
||||
<if test="deleted != null">deleted,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="archivesId != null">#{archivesId},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="archiveNo != null">#{archiveNo},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="peopleType != null">#{peopleType},</if>
|
||||
<if test="tier != null">#{tier},</if>
|
||||
<if test="classified != null">#{classified},</if>
|
||||
<if test="duration != null">#{duration},</if>
|
||||
<if test="ifPaper != null">#{ifPaper},</if>
|
||||
<if test="gdPeopleId != null">#{gdPeopleId},</if>
|
||||
<if test="destroyType != null">#{destroyType},</if>
|
||||
<if test="putType != null">#{putType},</if>
|
||||
<if test="outType != null">#{outType},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createUser != null">#{createUser},</if>
|
||||
<if test="updateUser != null">#{updateUser},</if>
|
||||
<if test="deleted != null">#{deleted},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatearchiveAuthenticate" parameterType="ArchivesMaster">
|
||||
update archives_master
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="archiveNo != null">archive_no = #{archiveNo},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="peopleType != null">people_type = #{peopleType},</if>
|
||||
<if test="tier != null">tier = #{tier},</if>
|
||||
<if test="classified != null">classified = #{classified},</if>
|
||||
<if test="duration != null">duration = #{duration},</if>
|
||||
<if test="ifPaper != null">if_paper = #{ifPaper},</if>
|
||||
<if test="gdPeopleId != null">gd_people_id = #{gdPeopleId},</if>
|
||||
<if test="destroyType != null">destroy_type = #{destroyType},</if>
|
||||
<if test="putType != null">put_type = #{putType},</if>
|
||||
<if test="outType != null">out_type = #{outType},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createUser != null">create_user = #{createUser},</if>
|
||||
<if test="updateUser != null">update_user = #{updateUser},</if>
|
||||
<if test="deleted != null">deleted = #{deleted},</if>
|
||||
</trim>
|
||||
where archives_id = #{archivesId}
|
||||
</update>
|
||||
|
||||
<delete id="deletearchiveAuthenticateById" parameterType="String">
|
||||
delete from archives_master where archives_id = #{archivesId}
|
||||
</delete>
|
||||
|
||||
<delete id="deletearchiveAuthenticateByIds" parameterType="String">
|
||||
delete from archives_master where archives_id in
|
||||
<foreach item="archivesId" collection="array" open="(" separator="," close=")">
|
||||
#{archivesId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.jeethink.receive.mapper.ArchivesFileMapper">
|
||||
<insert id="insertArchivesFile" parameterType="ArchivesFile">
|
||||
insert into archives_file (archives_file_id, rs_file_type, jk_file_date, check_hospital, check_conclusion, check_date, archives_id, create_time, update_time, create_user, update_user, deleted)
|
||||
VALUES (#{archivesFileId}, #{rsFileType}, #{jkFileDate}, #{checkHospital}, #{checkConclusion}, #{checkDate}, #{archivesId}, now(), now(), #{createUser}, #{updateUser}, '0')
|
||||
</insert>
|
||||
<update id="removeByArchivesId">
|
||||
update archives_file set deleted = '1' where archives_id = #{0}
|
||||
</update>
|
||||
<select id="selectArchivesFileList" resultType="ArchivesFile">
|
||||
select archives_file_id, rs_file_type, jk_file_date, check_hospital, check_conclusion, check_date, archives_id, create_time, update_time, create_user, update_user
|
||||
from archives_file where deleted = '0' and archives_id = #{0}
|
||||
order by cast(rs_file_type as SIGNED) asc, jk_file_date desc
|
||||
</select>
|
||||
<select id="selectArchiveFileId" resultType="String">
|
||||
select archives_file_id fileObjectId from archives_file f
|
||||
LEFT JOIN archives_master m on f.archives_id=m.archives_id
|
||||
LEFT JOIN sys_user u on u.user_id=m.user_id
|
||||
where u.user_num=#{userNumber} and f.rs_file_type=#{type} and f.deleted='0' and m.deleted='0' and u.del_flag='0'
|
||||
limit 1
|
||||
</select>
|
||||
<select id="selectArchivesFileById" parameterType="String" resultType="java.util.HashMap">
|
||||
select sf.file_name fileName ,sf.FILE_URL feilePath from system_file sf
|
||||
LEFT JOIN archives_file af on af.archives_file_id=sf.FILE_OBJECT_ID
|
||||
LEFT JOIN archives_master am on af.archives_id=am.archives_id
|
||||
WHERE am.archives_id=#{archivesId} and sf.FILE_DELETE_TYPE='0' and af.deleted='0'
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.jeethink.receive.mapper.ArchivesMapper">
|
||||
<sql id="selectArchives">
|
||||
select a.archives_id, a.name, a.archive_no, a.type, a.people_type, a.tier, a.classified, a.duration, a.if_paper, a.gd_people_id, a.now_status,
|
||||
a.user_id, u.nick_name, u.user_num as user_number, d.dept_id, d.dept_name, a.create_user, a.create_time, a.update_user, su.nick_name as updater_name, a.update_time,a.warehouse_type
|
||||
from archives_master a
|
||||
left join sys_user u on a.user_id = u.user_id
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user su on a.update_user = u.user_id
|
||||
where a.deleted = '0'
|
||||
</sql>
|
||||
<insert id="insertArchives" parameterType="ArchivesMaster">
|
||||
insert into archives_master (archives_id, name, archive_no, type, people_type, tier, classified, duration, now_status, if_paper, gd_people_id, user_id, create_time, update_time, create_user, update_user,warehouse_type)
|
||||
VALUES (#{archivesId}, #{name}, #{archiveNo}, #{type}, #{peopleType}, #{tier}, #{classified}, #{duration}, #{nowStatus}, #{ifPaper}, #{gdPeopleId}, #{userId}, now(), now(), #{createUser}, #{updateUser}, #{warehouseType})
|
||||
</insert>
|
||||
<update id="updateArchive" parameterType="ArchivesMaster">
|
||||
update archives_master set duration = #{duration}, now_status = #{nowStatus}, if_paper = #{ifPaper}, update_user = #{updateUser}, update_time = now(),warehouse_type = #{warehouseType}
|
||||
where archives_id = #{archivesId}
|
||||
</update>
|
||||
<update id="changeNowStatus">
|
||||
update archives_master set now_status = #{nowStatus} where archives_id = #{archivesId}
|
||||
</update>
|
||||
<update id="romoveById">
|
||||
update archives_master set deleted = '1' where archives_id = #{0}
|
||||
</update>
|
||||
<update id="postponeArchives" parameterType="ArchivesMaster">
|
||||
update archives_master set duration = #{duration}, update_user = #{updateUser}, update_time = now() where archives_id = #{archivesId}
|
||||
</update>
|
||||
<select id="selectById" resultType="ArchivesMaster">
|
||||
<include refid="selectArchives"/>
|
||||
and a.archives_id = #{0}
|
||||
</select>
|
||||
<select id="selectArchivesList" parameterType="ArchivesMaster" resultType="ArchivesMaster">
|
||||
<include refid="selectArchives"/>
|
||||
<if test="stage == 'receive'"> and a.now_status in ('0', '1', '2', '3', '9', '10') </if>
|
||||
<if test="stage == 'destroy'"> and a.now_status in ('31', '32', '33', '39') </if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type} </if>
|
||||
<if test="name != null and name != ''"> and a.name like concat('%', #{name}, '%')</if>
|
||||
<if test="archiveNo != null and archiveNo != ''"> and a.archive_no like concat('%', #{archiveNo}, '%')</if>
|
||||
<if test="peopleType != null and peopleType != ''"> and a.people_type = #{peopleType}</if>
|
||||
<if test="userId != null and userId != ''"> and a.user_id = #{userId}</if>
|
||||
<if test="deptId != null and deptId != '' and deptId != 1"> and (d.dept_id = #{deptId} or d.parent_id=#{deptId})</if>
|
||||
<if test="nowStatus != null and nowStatus != ''"> and a.now_status = #{nowStatus} </if>
|
||||
order by update_time desc,u.user_num
|
||||
</select>
|
||||
<select id="selectExpireArchivesList" resultType="ArchivesMaster">
|
||||
select a.archives_id, a.name, a.archive_no, a.type, a.people_type, a.tier, a.classified, a.duration, a.if_paper, a.gd_people_id, a.now_status,
|
||||
a.user_id, u.nick_name, a.create_user, a.create_time, a.update_user, a.update_time, ae.expire
|
||||
from archives_master a
|
||||
left join (
|
||||
select archives_id,
|
||||
(case when duration = '1' then DATEDIFF(DATE_ADD(update_time, INTERVAL 30 year ), NOW())
|
||||
when duration = '2' then DATEDIFF(DATE_ADD(update_time, INTERVAL 20 year ), NOW())
|
||||
when duration = '3' then DATEDIFF(DATE_ADD(update_time, INTERVAL 10 year ), NOW())
|
||||
else 500 end) as expire
|
||||
from archives_master
|
||||
) ae on a.archives_id = ae.archives_id
|
||||
left join sys_user u on a.user_id = u.user_id
|
||||
where a.deleted = '0' and a.now_status = '10' and ae.expire <= 30
|
||||
<if test="name != null and name != ''"> and a.name like concat('%', #{name}, '%')</if>
|
||||
<if test="peopleType != null and peopleType != ''"> and a.people_type = #{peopleType}</if>
|
||||
<if test="userId != null and userId != ''"> and a.user_id = #{userId}</if>
|
||||
order by ae.expire
|
||||
</select>
|
||||
<select id="selectArchivesByUser" resultType="com.jeethink.bean.domain.ArchivesMaster">
|
||||
select a.archives_id, name, archive_no, type, people_type, tier, classified, duration, if_paper, gd_people_id, a.user_id,
|
||||
a.create_time, a.update_time, create_user, update_user, deleted, now_status
|
||||
from archives_master a left join sys_user u on a.user_id = u.user_id where a.type = #{type} and u.user_num = #{userNumber}
|
||||
</select>
|
||||
|
||||
<select id="selectJk" parameterType="String" resultType="ArchivesMaster">
|
||||
SELECT am.* from archives_master am
|
||||
LEFT JOIN sys_user u on u.user_id=am.user_id
|
||||
WHERE u.user_num=#{userNum} and type='1'
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jeethink.save.mapper.archiveHandOverMapper">
|
||||
|
||||
<resultMap type="ArchivesMaster" id="archiveHandOverResult">
|
||||
<result property="archivesId" column="archives_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="archiveNo" column="archive_no" />
|
||||
<result property="type" column="type" />
|
||||
<result property="peopleType" column="people_type" />
|
||||
<result property="tier" column="tier" />
|
||||
<result property="classified" column="classified" />
|
||||
<result property="duration" column="duration" />
|
||||
<result property="ifPaper" column="if_paper" />
|
||||
<result property="gdPeopleId" column="gd_people_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createUser" column="create_user" />
|
||||
<result property="updateUser" column="update_user" />
|
||||
<result property="deleted" column="deleted" />
|
||||
<result property="userNumber" column="user_number" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="warehouseType" column="warehouse_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectarchiveHandOverVo">
|
||||
select am.archives_id, am.name, am.archive_no, am.type, am.people_type, am.tier, am.classified, am.duration, am.if_paper, am.gd_people_id,
|
||||
am.user_id, am.create_time, am.update_time, am.create_user, am.update_user, am.deleted,
|
||||
su.nick_name,sd.dept_name,am.warehouse_type
|
||||
from archives_master am
|
||||
</sql>
|
||||
|
||||
<select id="selectarchiveHandOverList" parameterType="ArchivesMaster" resultMap="archiveHandOverResult">
|
||||
<include refid="selectarchiveHandOverVo"/>
|
||||
left JOIN sys_user su on am.user_id = su.user_id
|
||||
left JOIN sys_dept sd on su.dept_id = sd.dept_id
|
||||
<where>
|
||||
1=1
|
||||
and am.now_status = '10'
|
||||
and am.deleted='0'
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="archiveNo != null and archiveNo != ''"> and archive_no like concat('%', #{archiveNo}, '%')</if>
|
||||
<if test="peopleType != null and peopleType != ''"> and people_type = #{peopleType}</if>
|
||||
<if test="userId != null and userId != ''"> and su.user_id = #{userId}</if>
|
||||
<if test="warehouseType != null and warehouseType != ''"> and am.warehouse_type = #{warehouseType}</if>
|
||||
<if test="deptId != null and deptId != '' and deptId != 100"> and (sd.dept_id = #{deptId} or sd.parent_id=#{deptId})</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectarchiveHandOverById" parameterType="String" resultMap="archiveHandOverResult">
|
||||
select archives_id, name, archive_no, type, people_type, tier, classified, duration, if_paper, gd_people_id,
|
||||
am.user_id, am.create_time, am.update_time, am.create_user, am.update_user, deleted ,u.nick_name user_name,u.user_num user_number,
|
||||
am.warehouse_type
|
||||
from archives_master am
|
||||
left join sys_user u on u.user_id=am.user_id
|
||||
where archives_id = #{archivesId}
|
||||
</select>
|
||||
|
||||
<insert id="insertarchiveHandOver" parameterType="ArchivesMaster">
|
||||
insert into archives_master
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="archivesId != null">archives_id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="archiveNo != null">archive_no,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="peopleType != null">people_type,</if>
|
||||
<if test="tier != null">tier,</if>
|
||||
<if test="classified != null">classified,</if>
|
||||
<if test="duration != null">duration,</if>
|
||||
<if test="ifPaper != null">if_paper,</if>
|
||||
<if test="gdPeopleId != null">gd_people_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createUser != null">create_user,</if>
|
||||
<if test="updateUser != null">update_user,</if>
|
||||
<if test="deleted != null">deleted,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="archivesId != null">#{archivesId},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="archiveNo != null">#{archiveNo},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="peopleType != null">#{peopleType},</if>
|
||||
<if test="tier != null">#{tier},</if>
|
||||
<if test="classified != null">#{classified},</if>
|
||||
<if test="duration != null">#{duration},</if>
|
||||
<if test="ifPaper != null">#{ifPaper},</if>
|
||||
<if test="gdPeopleId != null">#{gdPeopleId},</if>
|
||||
<if test="destroyType != null">#{destroyType},</if>
|
||||
<if test="outType != null">#{outType},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createUser != null">#{createUser},</if>
|
||||
<if test="updateUser != null">#{updateUser},</if>
|
||||
<if test="deleted != null">#{deleted},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatearchiveHandOver" parameterType="ArchivesMaster">
|
||||
update archives_master
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="archiveNo != null">archive_no = #{archiveNo},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="peopleType != null">people_type = #{peopleType},</if>
|
||||
<if test="tier != null">tier = #{tier},</if>
|
||||
<if test="classified != null">classified = #{classified},</if>
|
||||
<if test="duration != null">duration = #{duration},</if>
|
||||
<if test="ifPaper != null">if_paper = #{ifPaper},</if>
|
||||
<if test="gdPeopleId != null">gd_people_id = #{gdPeopleId},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createUser != null">create_user = #{createUser},</if>
|
||||
<if test="updateUser != null">update_user = #{updateUser},</if>
|
||||
<if test="deleted != null">deleted = #{deleted},</if>
|
||||
<if test="warehouseType != null">warehouse_type = #{warehouseType},</if>
|
||||
</trim>
|
||||
where archives_id = #{archivesId}
|
||||
</update>
|
||||
|
||||
<delete id="deletearchiveHandOverById" parameterType="String">
|
||||
delete from archives_master where archives_id = #{archivesId}
|
||||
</delete>
|
||||
|
||||
<delete id="deletearchiveHandOverByIds" parameterType="String">
|
||||
delete from archives_master where archives_id in
|
||||
<foreach item="archivesId" collection="array" open="(" separator="," close=")">
|
||||
#{archivesId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
390
JeeThink-archives/src/main/resources/mapper/tjfx/TjfxMapper.xml
Normal file
390
JeeThink-archives/src/main/resources/mapper/tjfx/TjfxMapper.xml
Normal file
@ -0,0 +1,390 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.jeethink.tjfx.mapper.TjfxMapper">
|
||||
|
||||
<!-- <resultMap id="flowMap" type="ArchivesFlow">
|
||||
<id property="flowId" column="flow_id"/>
|
||||
<result property="flowType" column="flow_type"/>
|
||||
<result property="archivesId" column="archives_id"/>
|
||||
<result property="nowStatus" column="now_status"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>-->
|
||||
|
||||
<select id="selectReceiveCount" resultType="java.util.HashMap">
|
||||
SELECT * FROM (
|
||||
( SELECT count(1) total FROM archives_master WHERE now_status = '10' and deleted = '0'
|
||||
) AS total,
|
||||
( SELECT count(1) month FROM archives_master
|
||||
WHERE now_status = '10' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-%m') and deleted = '0'
|
||||
)AS month ,
|
||||
( SELECT count(1) year FROM archives_master
|
||||
WHERE now_status = '10'
|
||||
AND date_format(update_time,'%Y')=date_format(now(),'%Y') and deleted = '0'
|
||||
)AS year
|
||||
)
|
||||
</select>
|
||||
<select id="selectManageCount" resultType="java.util.HashMap">
|
||||
SELECT * FROM (
|
||||
( SELECT count(1) total FROM archives_master WHERE now_status = '99' and deleted = '0'
|
||||
) AS total,
|
||||
( SELECT count(1) month FROM archives_master
|
||||
WHERE now_status = '99' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-%m') and deleted = '0'
|
||||
)AS month ,
|
||||
( SELECT count(1) year FROM archives_master
|
||||
WHERE now_status = '99'
|
||||
AND date_format(update_time,'%Y')=date_format(now(),'%Y') and deleted = '0'
|
||||
)AS year
|
||||
)
|
||||
</select>
|
||||
<select id="selectUseCount" resultType="java.util.HashMap">
|
||||
SELECT * FROM (
|
||||
( SELECT count(1) borrow FROM archives_borrow WHERE 1=1
|
||||
) AS borrow,
|
||||
( SELECT count(1) isReturn FROM archives_borrow WHERE borrow_status = '12'
|
||||
)AS isReturn ,
|
||||
( SELECT count(1) notReturn FROM archives_borrow WHERE borrow_status != '12'
|
||||
)AS notReturn
|
||||
)
|
||||
</select>
|
||||
<select id="selectSaveCount" resultType="java.util.HashMap">
|
||||
SELECT * FROM (
|
||||
( SELECT count(1) yj FROM archives_master WHERE 1=1 and deleted = '0'
|
||||
) AS yj,
|
||||
( SELECT count(1) rk FROM archives_master WHERE now_status = '10' and deleted = '0'
|
||||
)AS rk ,
|
||||
( SELECT count(1) ck FROM archives_master WHERE now_status = '99' and deleted = '0'
|
||||
)AS ck
|
||||
)
|
||||
</select>
|
||||
<select id="selectReceiveList" resultType="java.util.HashMap">
|
||||
SELECT am.archives_id archivesId,am.name,DATE_FORMAT(am.update_time,'%Y-%m-%d %H:%i:%s') time,su.nick_name userName
|
||||
FROM archives_master am
|
||||
left JOIN sys_user su on su.user_id = am.user_id
|
||||
WHERE 1=1 and am.deleted = '0' and am.now_status = '10'
|
||||
</select>
|
||||
<select id="selectBorrowList" resultType="java.util.HashMap">
|
||||
SELECT am.archives_id archivesId,am.name,ab.borrow_id borrowId, DATE_FORMAT(ab.create_time,'%Y-%m-%d %H:%i:%s') time,su.nick_name userName
|
||||
FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
left JOIN sys_user su on su.user_name = ab.create_by
|
||||
WHERE 1=1 and am.deleted = '0'
|
||||
</select>
|
||||
<select id="selectReturnList" resultType="java.util.HashMap">
|
||||
SELECT am.archives_id archivesId,am.name,ab.borrow_id borrowId, DATE_FORMAT(ab.real_reback_time,'%Y-%m-%d %H:%i:%s') time,su.nick_name userName
|
||||
FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
left JOIN sys_user su on su.user_name = ab.create_by
|
||||
WHERE 1=1 and am.deleted = '0' and ab.borrow_status = '12'
|
||||
</select>
|
||||
<select id="selectPieChartList" resultType="java.util.HashMap">
|
||||
SELECT COUNT(*) value,
|
||||
CASE
|
||||
WHEN type = 0 THEN '人事'
|
||||
WHEN type = 1 THEN '健康'
|
||||
END AS name
|
||||
FROM archives_master where deleted ='0' GROUP BY type
|
||||
</select>
|
||||
<select id="selectRKListByMonth" resultType="java.util.HashMap">
|
||||
SELECT * FROM (
|
||||
( SELECT count(1) January FROM archives_master
|
||||
WHERE now_status = '10' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-01')
|
||||
)AS January ,
|
||||
( SELECT count(1) February FROM archives_master
|
||||
WHERE now_status = '10' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-02')
|
||||
)AS February ,
|
||||
( SELECT count(1) March FROM archives_master
|
||||
WHERE now_status = '10' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-03')
|
||||
)AS March ,
|
||||
( SELECT count(1) April FROM archives_master
|
||||
WHERE now_status = '10' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-04')
|
||||
)AS April ,
|
||||
( SELECT count(1) May FROM archives_master
|
||||
WHERE now_status = '10' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-05')
|
||||
)AS May ,
|
||||
( SELECT count(1) June FROM archives_master
|
||||
WHERE now_status = '10' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-06')
|
||||
)AS June ,
|
||||
( SELECT count(1) July FROM archives_master
|
||||
WHERE now_status = '10' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-07')
|
||||
)AS July ,
|
||||
( SELECT count(1) August FROM archives_master
|
||||
WHERE now_status = '10' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-08')
|
||||
)AS August ,
|
||||
( SELECT count(1) September FROM archives_master
|
||||
WHERE now_status = '10' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-09')
|
||||
)AS September ,
|
||||
( SELECT count(1) October FROM archives_master
|
||||
WHERE now_status = '10' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-10')
|
||||
)AS October ,
|
||||
( SELECT count(1) November FROM archives_master
|
||||
WHERE now_status = '10' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-11')
|
||||
)AS November ,
|
||||
( SELECT count(1) December FROM archives_master
|
||||
WHERE now_status = '10' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-12')
|
||||
)AS December
|
||||
)
|
||||
</select>
|
||||
<select id="selectJyPieChartList" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
IFNULL(count(*),0) value,
|
||||
CASE
|
||||
WHEN type = 0 THEN '人事'
|
||||
WHEN type = 1 THEN '健康'
|
||||
END AS name
|
||||
FROM archives_borrow ab
|
||||
LEFT JOIN archives_master am ON am.archives_id = ab.archives_id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND am.deleted = '0'
|
||||
GROUP BY am.type
|
||||
</select>
|
||||
<select id="selectTJListByMonth" resultType="java.util.HashMap">
|
||||
SELECT * FROM (
|
||||
( SELECT count(1) January FROM archives_file af
|
||||
LEFT JOIN archives_master am on am.archives_id = af.archives_id
|
||||
WHERE am.now_status = '10' AND am.type='1' AND am.deleted='0' AND date_format(af.check_date,'%Y-%m')=date_format(now(),'%Y-01')
|
||||
)AS January ,
|
||||
( SELECT count(1) February FROM archives_file af
|
||||
LEFT JOIN archives_master am on am.archives_id = af.archives_id
|
||||
WHERE am.now_status = '10' AND am.type='1' AND am.deleted='0' AND date_format(af.check_date,'%Y-%m')=date_format(now(),'%Y-02')
|
||||
)AS February ,
|
||||
( SELECT count(1) March FROM archives_file af
|
||||
LEFT JOIN archives_master am on am.archives_id = af.archives_id
|
||||
WHERE am.now_status = '10' AND am.type='1' AND am.deleted='0' AND date_format(af.check_date,'%Y-%m')=date_format(now(),'%Y-03')
|
||||
)AS March ,
|
||||
( SELECT count(1) April FROM archives_file af
|
||||
LEFT JOIN archives_master am on am.archives_id = af.archives_id
|
||||
WHERE am.now_status = '10' AND am.type='1' AND am.deleted='0' AND date_format(af.check_date,'%Y-%m')=date_format(now(),'%Y-04')
|
||||
)AS April ,
|
||||
( SELECT count(1) May FROM archives_file af
|
||||
LEFT JOIN archives_master am on am.archives_id = af.archives_id
|
||||
WHERE am.now_status = '10' AND am.type='1' AND am.deleted='0' AND date_format(af.check_date,'%Y-%m')=date_format(now(),'%Y-05')
|
||||
)AS May ,
|
||||
( SELECT count(1) June FROM archives_file af
|
||||
LEFT JOIN archives_master am on am.archives_id = af.archives_id
|
||||
WHERE am.now_status = '10' AND am.type='1' AND am.deleted='0' AND date_format(af.check_date,'%Y-%m')=date_format(now(),'%Y-06')
|
||||
)AS June ,
|
||||
( SELECT count(1) July FROM archives_file af
|
||||
LEFT JOIN archives_master am on am.archives_id = af.archives_id
|
||||
WHERE am.now_status = '10' AND am.type='1' AND am.deleted='0' AND date_format(af.check_date,'%Y-%m')=date_format(now(),'%Y-07')
|
||||
)AS July ,
|
||||
( SELECT count(1) August FROM archives_file af
|
||||
LEFT JOIN archives_master am on am.archives_id = af.archives_id
|
||||
WHERE am.now_status = '10' AND am.type='1' AND am.deleted='0' AND date_format(af.check_date,'%Y-%m')=date_format(now(),'%Y-08')
|
||||
)AS August ,
|
||||
( SELECT count(1) September FROM archives_file af
|
||||
LEFT JOIN archives_master am on am.archives_id = af.archives_id
|
||||
WHERE am.now_status = '10' AND am.type='1' AND am.deleted='0' AND date_format(af.check_date,'%Y-%m')=date_format(now(),'%Y-09')
|
||||
)AS September ,
|
||||
( SELECT count(1) October FROM archives_file af
|
||||
LEFT JOIN archives_master am on am.archives_id = af.archives_id
|
||||
WHERE am.now_status = '10' AND am.type='1' AND am.deleted='0' AND date_format(af.check_date,'%Y-%m')=date_format(now(),'%Y-10')
|
||||
)AS October ,
|
||||
( SELECT count(1) November FROM archives_file af
|
||||
LEFT JOIN archives_master am on am.archives_id = af.archives_id
|
||||
WHERE am.now_status = '10' AND am.type='1' AND am.deleted='0' AND date_format(af.check_date,'%Y-%m')=date_format(now(),'%Y-11')
|
||||
)AS November ,
|
||||
( SELECT count(1) December FROM archives_file af
|
||||
LEFT JOIN archives_master am on am.archives_id = af.archives_id
|
||||
WHERE am.now_status = '10' AND am.type='1' AND am.deleted='0' AND date_format(af.check_date,'%Y-%m')=date_format(now(),'%Y-12')
|
||||
)AS December
|
||||
)
|
||||
</select>
|
||||
<select id="selectTJListByYear" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
count(af.archives_file_id) value, af.jk_file_date year
|
||||
FROM archives_file af
|
||||
WHERE
|
||||
1=1
|
||||
AND af.jk_file_date is not NULL
|
||||
AND af.jk_file_date <> ''
|
||||
and af.archives_id in (SELECT archives_id FROM archives_master WHERE deleted = '0' AND type = '1')
|
||||
GROUP BY af.jk_file_date
|
||||
</select>
|
||||
<select id="selectRsListByMonth" resultType="java.util.HashMap">
|
||||
SELECT * FROM (
|
||||
( SELECT count(1) January FROM archives_master
|
||||
WHERE now_status = '10' AND type='0' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-01')
|
||||
)AS January ,
|
||||
( SELECT count(1) February FROM archives_master
|
||||
WHERE now_status = '10' AND type='0' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-02')
|
||||
)AS February ,
|
||||
( SELECT count(1) March FROM archives_master
|
||||
WHERE now_status = '10' AND type='0' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-03')
|
||||
)AS March ,
|
||||
( SELECT count(1) April FROM archives_master
|
||||
WHERE now_status = '10' AND type='0' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-04')
|
||||
)AS April ,
|
||||
( SELECT count(1) May FROM archives_master
|
||||
WHERE now_status = '10' AND type='0' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-05')
|
||||
)AS May ,
|
||||
( SELECT count(1) June FROM archives_master
|
||||
WHERE now_status = '10' AND type='0' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-06')
|
||||
)AS June ,
|
||||
( SELECT count(1) July FROM archives_master
|
||||
WHERE now_status = '10' AND type='0' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-07')
|
||||
)AS July ,
|
||||
( SELECT count(1) August FROM archives_master
|
||||
WHERE now_status = '10' AND type='0' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-08')
|
||||
)AS August ,
|
||||
( SELECT count(1) September FROM archives_master
|
||||
WHERE now_status = '10' AND type='0' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-09')
|
||||
)AS September ,
|
||||
( SELECT count(1) October FROM archives_master
|
||||
WHERE now_status = '10' AND type='0' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-10')
|
||||
)AS October ,
|
||||
( SELECT count(1) November FROM archives_master
|
||||
WHERE now_status = '10' AND type='0' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-11')
|
||||
)AS November ,
|
||||
( SELECT count(1) December FROM archives_master
|
||||
WHERE now_status = '10' AND type='0' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-12')
|
||||
)AS December
|
||||
)
|
||||
</select>
|
||||
<select id="selectJkListByMonth" resultType="java.util.HashMap">
|
||||
SELECT * FROM (
|
||||
( SELECT count(1) January FROM archives_master
|
||||
WHERE now_status = '10' AND type='1' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-01')
|
||||
)AS January ,
|
||||
( SELECT count(1) February FROM archives_master
|
||||
WHERE now_status = '10' AND type='1' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-02')
|
||||
)AS February ,
|
||||
( SELECT count(1) March FROM archives_master
|
||||
WHERE now_status = '10' AND type='1' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-03')
|
||||
)AS March ,
|
||||
( SELECT count(1) April FROM archives_master
|
||||
WHERE now_status = '10' AND type='1' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-04')
|
||||
)AS April ,
|
||||
( SELECT count(1) May FROM archives_master
|
||||
WHERE now_status = '10' AND type='1' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-05')
|
||||
)AS May ,
|
||||
( SELECT count(1) June FROM archives_master
|
||||
WHERE now_status = '10' AND type='1' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-06')
|
||||
)AS June ,
|
||||
( SELECT count(1) July FROM archives_master
|
||||
WHERE now_status = '10' AND type='1' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-07')
|
||||
)AS July ,
|
||||
( SELECT count(1) August FROM archives_master
|
||||
WHERE now_status = '10' AND type='1' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-08')
|
||||
)AS August ,
|
||||
( SELECT count(1) September FROM archives_master
|
||||
WHERE now_status = '10' AND type='1' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-09')
|
||||
)AS September ,
|
||||
( SELECT count(1) October FROM archives_master
|
||||
WHERE now_status = '10' AND type='1' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-10')
|
||||
)AS October ,
|
||||
( SELECT count(1) November FROM archives_master
|
||||
WHERE now_status = '10' AND type='1' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-11')
|
||||
)AS November ,
|
||||
( SELECT count(1) December FROM archives_master
|
||||
WHERE now_status = '10' AND type='1' AND deleted='0' AND date_format(update_time,'%Y-%m')=date_format(now(),'%Y-12')
|
||||
)AS December
|
||||
)
|
||||
</select>
|
||||
<select id="selectRsJyListByMonth" resultType="java.util.HashMap">
|
||||
SELECT * FROM (
|
||||
( SELECT count(1) January FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='0' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-01')
|
||||
)AS January ,
|
||||
( SELECT count(1) February FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='0' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-02')
|
||||
)AS February ,
|
||||
( SELECT count(1) March FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='0' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-03')
|
||||
)AS March ,
|
||||
( SELECT count(1) April FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='0' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-04')
|
||||
)AS April ,
|
||||
( SELECT count(1) May FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='0' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-05')
|
||||
)AS May ,
|
||||
( SELECT count(1) June FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='0' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-06')
|
||||
)AS June ,
|
||||
( SELECT count(1) July FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='0' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-07')
|
||||
)AS July ,
|
||||
( SELECT count(1) August FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='0' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-08')
|
||||
)AS August ,
|
||||
( SELECT count(1) September FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='0' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-09')
|
||||
)AS September ,
|
||||
( SELECT count(1) October FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='0' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-10')
|
||||
)AS October ,
|
||||
( SELECT count(1) November FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='0' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-11')
|
||||
)AS November ,
|
||||
( SELECT count(1) December FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='0' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-12')
|
||||
)AS December
|
||||
)
|
||||
</select>
|
||||
<select id="selectJkJyListByMonth" resultType="java.util.HashMap">
|
||||
SELECT * FROM (
|
||||
( SELECT count(1) January FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='1' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-01')
|
||||
)AS January ,
|
||||
( SELECT count(1) February FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='1' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-02')
|
||||
)AS February ,
|
||||
( SELECT count(1) March FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='1' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-03')
|
||||
)AS March ,
|
||||
( SELECT count(1) April FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='1' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-04')
|
||||
)AS April ,
|
||||
( SELECT count(1) May FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='1' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-05')
|
||||
)AS May ,
|
||||
( SELECT count(1) June FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='1' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-06')
|
||||
)AS June ,
|
||||
( SELECT count(1) July FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='1' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-07')
|
||||
)AS July ,
|
||||
( SELECT count(1) August FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='1' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-08')
|
||||
)AS August ,
|
||||
( SELECT count(1) September FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='1' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-09')
|
||||
)AS September ,
|
||||
( SELECT count(1) October FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='1' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-10')
|
||||
)AS October ,
|
||||
( SELECT count(1) November FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='1' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-11')
|
||||
)AS November ,
|
||||
( SELECT count(1) December FROM archives_borrow ab
|
||||
left JOIN archives_master am on am.archives_id = ab.archives_id
|
||||
WHERE 1=1 and am.deleted = '0' AND am.type='1' AND date_format(ab.create_time,'%Y-%m')=date_format(now(),'%Y-12')
|
||||
)AS December
|
||||
)
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.jeethink.using.mapper.BorrowMapper">
|
||||
<insert id="insertBorrow" parameterType="ArchivesBorrow">
|
||||
insert into archives_borrow (borrow_id, archives_id, borrow_status, reback_time, create_by, create_time, borrow_reason)
|
||||
VALUES (#{borrowId}, #{archivesId}, #{borrowStatus}, #{rebackTime}, #{createBy}, now(), #{borrowReason})
|
||||
</insert>
|
||||
<update id="removeBorrow">
|
||||
update archives_borrow set deleted = '1' where borrow_id = #{0}
|
||||
</update>
|
||||
<update id="changeBorrowStatus">
|
||||
update archives_borrow
|
||||
<set>
|
||||
borrow_status = #{borrowStatus},
|
||||
<if test="borrowStatus=='12'">real_reback_time = now()</if>
|
||||
</set>
|
||||
where deleted = '0' and borrow_id = #{borrowId}
|
||||
</update>
|
||||
<sql id="selectBorrow">
|
||||
select b.borrow_id, b.archives_id, a.name as archives_name, a.archive_no, a.classified, a.tier, b.borrow_status, b.reback_time, b.real_reback_time, b.borrow_reason,
|
||||
b.create_by, u.nick_name as create_by_name, b.create_time, a.name as archives_name
|
||||
from archives_borrow b
|
||||
left join archives_master a on b.archives_id = a.archives_id
|
||||
left join sys_user u on b.create_by = u.user_name
|
||||
where a.deleted = '0'
|
||||
</sql>
|
||||
<select id="selectBorrowingList" parameterType="ArchivesBorrow" resultType="ArchivesBorrow">
|
||||
<include refid="selectBorrow"/>
|
||||
and b.borrow_status != '12' and b.borrow_status != '9'
|
||||
<if test="createBy != null and createBy != ''"> and b.create_by = #{createBy} </if>
|
||||
<if test="archivesId != null and archivesId != ''"> and b.archives_id = #{archivesId} </if>
|
||||
order by b.create_time desc
|
||||
</select>
|
||||
<select id="selectBorrowHistory" resultType="ArchivesBorrow">
|
||||
<include refid="selectBorrow"/>
|
||||
<if test="archivesId != null and archivesId != ''"> and b.archives_id = #{archivesId} </if>
|
||||
<if test="borrowStatus != null and borrowStatus != ''"> and b.borrow_status = #{borrowStatus} </if>
|
||||
<if test="archivesName != null and archivesName != ''"> and a.name like concat('%', #{archivesName}, '%') </if>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
<select id="selectById" resultType="ArchivesBorrow">
|
||||
<include refid="selectBorrow"/>
|
||||
and b.borrow_id = #{0}
|
||||
</select>
|
||||
<select id="selectMyBorrowList" resultType="ArchivesBorrow">
|
||||
<include refid="selectBorrow"/>
|
||||
and b.create_by = #{createBy}
|
||||
<if test="archivesId != null and archivesId != ''"> and b.archives_id = #{archivesId} </if>
|
||||
<if test="borrowStatus != null and borrowStatus != ''"> and b.borrow_status = #{borrowStatus} </if>
|
||||
<if test="archivesName != null and archivesName != ''"> and a.name like concat('%', #{archivesName}, '%') </if>
|
||||
<if test="archiveNo != null and archiveNo != ''"> and archive_no like concat('%', #{archiveNo}, '%')</if>
|
||||
order by b.create_time desc
|
||||
</select>
|
||||
<select id="selectStatusBorrowList" resultType="ArchivesBorrow">
|
||||
<include refid="selectBorrow"/>
|
||||
<if test="statusList != null and statusList.size() > 0">
|
||||
and b.borrow_status in <foreach collection="statusList" separator="," open="(" close=")" item="status">#{status}</foreach>
|
||||
</if>
|
||||
<if test="borrow.archivesId != null and borrow.archivesId != ''"> and b.archives_id = #{borrow.archivesId} </if>
|
||||
<if test="borrow.archivesName != null and borrow.archivesName != ''"> and a.name like concat('%', #{borrow.archivesName}, '%') </if>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
<select id="selectArchivesList" resultType="ArchivesMaster">
|
||||
select a.archives_id, a.name, a.archive_no, a.type, a.people_type, a.tier, a.classified, a.duration, a.create_time,
|
||||
a.if_paper, a.gd_people_id, a.user_id, u.nick_name, if(b.archives_id is not null, true, false) as is_borrowed
|
||||
from archives_master a
|
||||
left join sys_user u on a.user_id = u.user_id
|
||||
left join (
|
||||
select archives_id from archives_borrow where deleted = '0' and borrow_status != '12' and borrow_status != '9' and create_by = #{createBy}
|
||||
) b on a.archives_id = b.archives_id
|
||||
where a.deleted = '0' and a.now_status = '10' and a.type='0'
|
||||
<if test="name != null and name != ''"> and a.name like concat('%', #{name}, '%')</if>
|
||||
<if test="archiveNo != null and archiveNo != ''"> and a.archive_no like concat('%', #{archiveNo}, '%')</if>
|
||||
<if test="peopleType != null and peopleType != ''"> and a.people_type = #{peopleType}</if>
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user