借阅工作流

new
parent 32d52702bd
commit ae8184d58f

@ -33,3 +33,6 @@ INSERT INTO `lyr-one`.`bpm_task_assign_rule` (`id`, `model_id`, `process_definit
--
alter table archives_borrow_apply alter column status set default 1;
ALTER TABLE archives_borrow_apply MODIFY COLUMN status int(64) COMMENT '';

@ -118,17 +118,15 @@ public class BorrowApplyController {
} else {
updateReqVO.setBorrowState("1");//驳回or未借阅
}
if (!latest.getResult().toString().equals(t.getStatus())) {
updateReqVO.setStatus(latest.getResult().toString());
borrowApplyService.updateBorrowApply(updateReqVO);
}
}
}
}
PageResult<BorrowApplyDO> pageResult2 = borrowApplyService.getBorrowApplyPage(pageVO);
return success(BorrowApplyConvert.INSTANCE.convertPage(pageResult2));
}
}
return success(BorrowApplyConvert.INSTANCE.convertPage(pageResult));
}

@ -88,7 +88,14 @@ public class BorrowApplyBaseVO {
*
*/
@Schema(description = "状态", example = "状态")
private String status;
private Long status;
/**
*
*/
@Schema(description = "用于前端判断修改接口的同意和提交按钮", example = "用于前端判断修改接口的同意和提交按钮")
@TableField(exist = false)
private Boolean isAuthorised;
}

@ -11,4 +11,7 @@ import javax.validation.constraints.*;
@ToString(callSuper = true)
public class BorrowApplyCreateReqVO extends BorrowApplyBaseVO {
@Schema(description = "id")
private Long id;
}

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.archives.controller.admin.borrowapply.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
@ -75,4 +76,11 @@ public class BorrowApplyExcelVO {
@Schema(description = "案卷号", example = "案卷号")
private String filesNum;
/**
*
*/
@Schema(description = "用于前端判断修改接口的同意和提交按钮", example = "用于前端判断修改接口的同意和提交按钮")
@TableField(exist = false)
private Boolean isAuthorised;
}

@ -86,7 +86,9 @@ public class BorrowApplyExportReqVO {
*
*/
@Schema(description = "状态", example = "状态")
private String status;
private Long status;
}

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.archives.controller.admin.borrowapply.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
@ -93,7 +94,14 @@ public class BorrowApplyPageReqVO extends PageParam {
*
*/
@Schema(description = "状态", example = "状态")
private String status;
private Long status;
/**
*
*/
@Schema(description = "用于前端判断修改接口的同意和提交按钮", example = "用于前端判断修改接口的同意和提交按钮")
@TableField(exist = false)
private Boolean isAuthorised;

@ -88,8 +88,8 @@ public class RecordController {
@Operation(summary = "获得归档列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('archives:record:query')")
public CommonResult<List<RecordRespVO>> getRecordList(@RequestParam("ids") Collection<Long> ids) {
List<RecordDO> list = recordService.getRecordList(ids);
public CommonResult<List<RecordRespVO>> getRecordList(@RequestParam("ids") Collection<Long> ids,String fileNum) {
List<RecordDO> list = recordService.getRecordList(ids,fileNum);
return success(RecordConvert.INSTANCE.convertList(list));
}

@ -120,7 +120,15 @@ public class BorrowApplyDO extends BaseDO {
*
*/
@Schema(description = "状态", example = "状态")
private String status;
private Long status;
/**
*
*/
@Schema(description = "用于前端判断修改接口的同意和提交按钮", example = "用于前端判断修改接口的同意和提交按钮")
@TableField(exist = false)
private Boolean isAuthorised;
}

@ -1,16 +1,22 @@
package cn.iocoder.yudao.module.archives.service.borrowapply;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.string.StringUtils;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.archives.controller.admin.record.vo.RecordUpdateReqVO;
import cn.iocoder.yudao.module.archives.dal.dataobject.record.RecordDO;
import cn.iocoder.yudao.module.archives.dal.dataobject.turnover.TurnOverDO;
import cn.iocoder.yudao.module.archives.service.record.RecordService;
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheet.QuotationSheetDO;
import cn.iocoder.yudao.module.bs.enums.BillTypeEnum;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -26,6 +32,7 @@ import cn.iocoder.yudao.module.archives.convert.borrowapply.BorrowApplyConvert;
import cn.iocoder.yudao.module.archives.dal.mysql.borrowapply.BorrowApplyMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.archives.enums.ErrorCodeConstants.*;
import static com.baomidou.mybatisplus.extension.toolkit.Db.saveOrUpdate;
import static com.baomidou.mybatisplus.extension.toolkit.Db.updateById;
/**
@ -66,16 +73,26 @@ public class BorrowApplyServiceImpl implements BorrowApplyService {
if (StringUtils.isNotNull(borrowApplyDOPageResult)){
List<BorrowApplyDO> list = borrowApplyDOPageResult.getList();
for (BorrowApplyDO b:list) {
if (b.getBorrowState().equals("0")){
//通过案卷号判断是否被借阅
if (StringUtils.isNotNull(b.getFilesNum())) {
if (b.getFilesNum().equals(createReqVO.getFilesNum()) && b.getFilesNum().equals("0")) {
return CommonResult.error("档案已被借阅");
}
}
}
}
//这里设置工作流属性
Map<String, Object> variables = new HashMap<>();
//这个if判断这个申请单是暂存还是提交 因为暂存和提交都是会调这个接口 所以会重复新增条数
if (StringUtils.isNull(borrowApply.getProcessInstanceId())){
borrowApply.setBillType("BORROW");
borrowApplyMapper.insert(borrowApply);
Map<String, Object> variables = new HashMap<>();
variables.put("billId", borrowApply.getId());
}
if (ObjectUtil.isNull(variables.get("billId"))){
variables.put("billId", this.borrowApplyMapper.selectOne(BorrowApplyDO::getProcessInstanceId, borrowApply.getProcessInstanceId()).getId());
}
variables.put("userName", createReqVO.getUserName());
variables.put("deptName", createReqVO.getDeptName());
variables.put("billName", "档案借阅申请单");
@ -84,7 +101,8 @@ public class BorrowApplyServiceImpl implements BorrowApplyService {
String processInstanceId = processInstanceApi.createProcessInstance(loginUser.getId(),
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
.setVariables(variables).setBusinessKey(String.valueOf(borrowApply.getId())));
this.borrowApplyMapper.updateById(new BorrowApplyDO().setId(borrowApply.getId()).setProcessInstanceId(processInstanceId));
int i = this.borrowApplyMapper.updateById(new BorrowApplyDO().setId(borrowApply.getId()).setProcessInstanceId(processInstanceId).setStatus(createReqVO.getStatus()));
// 返回
return CommonResult.success(borrowApply);
}
@ -148,6 +166,7 @@ public class BorrowApplyServiceImpl implements BorrowApplyService {
@Override
public BorrowApplyDO getBorrowApply(Long id) {
BorrowApplyDO borrowApplyDO = borrowApplyMapper.selectById(id);
borrowApplyDO.setIsAuthorised(borrowApplyDO.getStatus()==1 ? true : false);
RecordDO record = recordService.getRecord(borrowApplyDO.getRecordId());
return borrowApplyDO.setSite(record.getSite()).setFileType(record.getFileType()).setFilesNum(record.getFilesNum());
}

@ -10,6 +10,8 @@ import cn.iocoder.yudao.module.setting.dal.dataobject.organization.OrganizationD
import cn.iocoder.yudao.module.setting.dal.mysql.depot.DepotMapper;
import cn.iocoder.yudao.module.setting.dal.mysql.depotcabinet.DepotCabinetMapper;
import cn.iocoder.yudao.module.setting.dal.mysql.organization.OrganizationMapper;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import me.zhyd.oauth.log.Log;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -59,7 +61,9 @@ public class PackagesServiceImpl implements PackagesService {
PackagesDO packages = PackagesConvert.INSTANCE.convert(createReqVO);
String url = getUrl(packages);
packages.setCodeUrl(url);
packages.setCodeValue(packages.getCaseNum()+"-"+packages.getCatalogNum()+"-"+packages.getFilesNum());
packages.setCodeValue("业务实体:"+packages.getCompany()+" "+"库房名称:"+packages.getDeptName()+" "+
"档案柜:"+packages.getCabinetName()+" "+"会计年份:"+packages.getYear()+" "+"全宗号:"+
packages.getCaseNum()+" "+"目录号:"+packages.getCatalogNum()+" "+"案卷号:"+packages.getFilesNum());
//位置
Long organizationId = packages.getCompanyId();
Long depotId = packages.getDepotId();
@ -151,7 +155,9 @@ public class PackagesServiceImpl implements PackagesService {
private String getUrl(PackagesDO packages){
// InetAddress address = InetAddress.getLocalHost();//获取的是本地的IP地址
// String hostAddress = address.getHostAddress();
File buf = BarcodeUtil.generateBarCode(packages.getCaseNum()+"-"+ packages.getCatalogNum()+"-"+ packages.getFilesNum(), "QR_CODE",
File buf = BarcodeUtil.generateBarCode(
"Year:"+packages.getYear()+"\n"+"month:"+packages.getPeriod()+"\n"+"fullSerialNumber:"+
packages.getCaseNum()+"\n"+"catalogNumber:"+packages.getCatalogNum()+"\n"+"docketNo:"+packages.getFilesNum(), "QR_CODE",
"./tmp/Packages/" + packages.getCaseNum()+"-"+ packages.getCatalogNum()+"-"+ packages.getFilesNum() + ".png");
MultipartFile file = FileUtils.getMultipartFile(buf);
String url= null;

@ -50,7 +50,7 @@ public interface RecordService {
* @param ids
* @return
*/
List<RecordDO> getRecordList(Collection<Long> ids);
List<RecordDO> getRecordList(Collection<Long> ids,String fileNum);
/**
*

@ -204,8 +204,9 @@ public class RecordServiceImpl implements RecordService {
}
@Override
public List<RecordDO> getRecordList(Collection<Long> ids) {
return recordMapper.selectBatchIds(ids);
public List<RecordDO> getRecordList(Collection<Long> ids, String fileNum) {
LambdaQueryWrapperX<RecordDO> wrapperX = new LambdaQueryWrapperX<>();
return recordMapper.selectList(wrapperX.likeIfPresent(RecordDO::getFilesNum,fileNum));
}
@Override

@ -30,6 +30,6 @@ public class WebMvcConfig implements WebMvcConfigurer {
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new LicenseCheckInterceptor()).addPathPatterns("/admin-api/system/auth/login");
// registry.addInterceptor(new LicenseCheckInterceptor()).addPathPatterns("/admin-api/system/auth/login");
}
}

Loading…
Cancel
Save