diff --git a/sql/20231108JS.sql b/sql/20231108JS.sql index bcfd3289..2d7ca31a 100644 --- a/sql/20231108JS.sql +++ b/sql/20231108JS.sql @@ -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 '状态'; diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/BorrowApplyController.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/BorrowApplyController.java index 533b735e..b7207bc7 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/BorrowApplyController.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/BorrowApplyController.java @@ -113,21 +113,19 @@ public class BorrowApplyController { // 找到了endTime最新的任务 BorrowApplyUpdateReqVO updateReqVO = new BorrowApplyUpdateReqVO(); updateReqVO.setId(t.getId()); - if (latest.getResult().equals(2)){ + if (latest.getResult().equals(2)) { updateReqVO.setBorrowState("0");//已借阅 - }else { + } else { updateReqVO.setBorrowState("1");//驳回or未借阅 } - if (!latest.getResult().toString().equals(t.getStatus())) { - updateReqVO.setStatus(latest.getResult().toString()); - borrowApplyService.updateBorrowApply(updateReqVO); - } + borrowApplyService.updateBorrowApply(updateReqVO); + } } + PageResult pageResult2 = borrowApplyService.getBorrowApplyPage(pageVO); + return success(BorrowApplyConvert.INSTANCE.convertPage(pageResult2)); } - PageResult pageResult2 = borrowApplyService.getBorrowApplyPage(pageVO); - return success(BorrowApplyConvert.INSTANCE.convertPage(pageResult2)); } return success(BorrowApplyConvert.INSTANCE.convertPage(pageResult)); } diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyBaseVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyBaseVO.java index 7e7949c5..683ed78e 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyBaseVO.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyBaseVO.java @@ -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; } diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyCreateReqVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyCreateReqVO.java index a397da6c..442e8ca0 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyCreateReqVO.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyCreateReqVO.java @@ -11,4 +11,7 @@ import javax.validation.constraints.*; @ToString(callSuper = true) public class BorrowApplyCreateReqVO extends BorrowApplyBaseVO { + @Schema(description = "id") + private Long id; + } diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyExcelVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyExcelVO.java index 6a9c20ed..aa627448 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyExcelVO.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyExcelVO.java @@ -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; + } diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyExportReqVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyExportReqVO.java index 3c19058e..63a878c5 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyExportReqVO.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyExportReqVO.java @@ -86,7 +86,9 @@ public class BorrowApplyExportReqVO { * 状态 */ @Schema(description = "状态", example = "状态") - private String status; + private Long status; + + } diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyPageReqVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyPageReqVO.java index c401428e..1e7cb98a 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyPageReqVO.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/borrowapply/vo/BorrowApplyPageReqVO.java @@ -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; diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/record/RecordController.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/record/RecordController.java index 7e06cbec..cfdbaff4 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/record/RecordController.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/record/RecordController.java @@ -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> getRecordList(@RequestParam("ids") Collection ids) { - List list = recordService.getRecordList(ids); + public CommonResult> getRecordList(@RequestParam("ids") Collection ids,String fileNum) { + List list = recordService.getRecordList(ids,fileNum); return success(RecordConvert.INSTANCE.convertList(list)); } diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/dataobject/borrowapply/BorrowApplyDO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/dataobject/borrowapply/BorrowApplyDO.java index b13d5c83..15da9087 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/dataobject/borrowapply/BorrowApplyDO.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/dataobject/borrowapply/BorrowApplyDO.java @@ -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; + } diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/borrowapply/BorrowApplyServiceImpl.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/borrowapply/BorrowApplyServiceImpl.java index 14f927b9..b7271b68 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/borrowapply/BorrowApplyServiceImpl.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/borrowapply/BorrowApplyServiceImpl.java @@ -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 list = borrowApplyDOPageResult.getList(); for (BorrowApplyDO b:list) { - if (b.getBorrowState().equals("0")){ - return CommonResult.error("档案已被借阅"); + //通过案卷号判断是否被借阅 + if (StringUtils.isNotNull(b.getFilesNum())) { + if (b.getFilesNum().equals(createReqVO.getFilesNum()) && b.getFilesNum().equals("0")) { + return CommonResult.error("档案已被借阅"); + } } } } + //这里设置工作流属性 - borrowApply.setBillType("BORROW"); - borrowApplyMapper.insert(borrowApply); Map variables = new HashMap<>(); - variables.put("billId", borrowApply.getId()); + //这个if判断这个申请单是暂存还是提交 因为暂存和提交都是会调这个接口 所以会重复新增条数 + if (StringUtils.isNull(borrowApply.getProcessInstanceId())){ + borrowApply.setBillType("BORROW"); + borrowApplyMapper.insert(borrowApply); + 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()); } diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/packages/PackagesServiceImpl.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/packages/PackagesServiceImpl.java index 3dc9a1a9..e385e0ce 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/packages/PackagesServiceImpl.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/packages/PackagesServiceImpl.java @@ -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; diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordService.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordService.java index 883ab94d..b9bb5ab1 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordService.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordService.java @@ -50,7 +50,7 @@ public interface RecordService { * @param ids 编号 * @return 归档列表 */ - List getRecordList(Collection ids); + List getRecordList(Collection ids,String fileNum); /** * 获得归档分页 diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordServiceImpl.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordServiceImpl.java index fb7f0c0e..ebb06db7 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordServiceImpl.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordServiceImpl.java @@ -204,8 +204,9 @@ public class RecordServiceImpl implements RecordService { } @Override - public List getRecordList(Collection ids) { - return recordMapper.selectBatchIds(ids); + public List getRecordList(Collection ids, String fileNum) { + LambdaQueryWrapperX wrapperX = new LambdaQueryWrapperX<>(); + return recordMapper.selectList(wrapperX.likeIfPresent(RecordDO::getFilesNum,fileNum)); } @Override diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/server/license/config/WebMvcConfig.java b/yudao-server/src/main/java/cn/iocoder/yudao/server/license/config/WebMvcConfig.java index a712f956..4ffc1f37 100644 --- a/yudao-server/src/main/java/cn/iocoder/yudao/server/license/config/WebMvcConfig.java +++ b/yudao-server/src/main/java/cn/iocoder/yudao/server/license/config/WebMvcConfig.java @@ -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"); } }