|
@@ -114,7 +114,7 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public IPage<CostProjectDocument> pageList(CostProjectDocumentPageReq req) {
|
|
|
|
|
|
|
+ public IPage<CostProjectDocument> pageList(CostProjectDocumentPageReq req) throws Exception {
|
|
|
LambdaQueryWrapper<CostProjectDocument> qw = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<CostProjectDocument> qw = new LambdaQueryWrapper<>();
|
|
|
if (req.getDocumentType() != null) {
|
|
if (req.getDocumentType() != null) {
|
|
|
// LambdaQueryWrapper<CostDocumentTemplate> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
// LambdaQueryWrapper<CostDocumentTemplate> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
@@ -122,7 +122,21 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
// lambdaQueryWrapper.eq(CostDocumentTemplate::getIsWh, "0");
|
|
// lambdaQueryWrapper.eq(CostDocumentTemplate::getIsWh, "0");
|
|
|
qw.eq(CostProjectDocument::getDocumentType, req.getDocumentType());
|
|
qw.eq(CostProjectDocument::getDocumentType, req.getDocumentType());
|
|
|
}
|
|
}
|
|
|
- qw.eq(CostProjectDocument::getProjectId, req.getProjectId());
|
|
|
|
|
|
|
+ if (StringUtil.isNotEmpty(req.getProjectId())) {
|
|
|
|
|
+ qw.eq(CostProjectDocument::getProjectId, req.getProjectId());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(req.getPermissionType().equals(1)){
|
|
|
|
|
+ IUser iUser = ContextUtil.getCurrentUser();
|
|
|
|
|
+ User user = userService.getByAccount(iUser.getAccount());
|
|
|
|
|
+ List<AuditedUnit> auditedUnit=auditedUnitManager.getByUserAccount(user.getId());
|
|
|
|
|
+ List<String> collected = auditedUnit.stream().map(AuditedUnit::getUnitId).distinct().collect(Collectors.toList());
|
|
|
|
|
+ qw.in(CostProjectDocument::getEnterpriseId, collected);
|
|
|
|
|
+ } else if (req.getPermissionType().equals(2)) {
|
|
|
|
|
+ IUser iUser = ContextUtil.getCurrentUser();
|
|
|
|
|
+ User user = userService.getByAccount(iUser.getAccount());
|
|
|
|
|
+ qw.eq(CostProjectDocument::getCreateBy, user.getAccount());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
IPage<CostProjectDocument> page = new Page<>(req.getPageNum(), req.getPageSize());
|
|
IPage<CostProjectDocument> page = new Page<>(req.getPageNum(), req.getPageSize());
|
|
|
return this.page(page, qw);
|
|
return this.page(page, qw);
|
|
@@ -206,12 +220,12 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
//返回文号
|
|
//返回文号
|
|
|
String whNo = this.getWH(costDocumentWh);
|
|
String whNo = this.getWH(costDocumentWh);
|
|
|
//校验文号唯一性
|
|
//校验文号唯一性
|
|
|
- Boolean b = whMap.get(whNo);
|
|
|
|
|
|
|
+ /*Boolean b = whMap.get(whNo);
|
|
|
if (b==null || !b) {
|
|
if (b==null || !b) {
|
|
|
whMap.put(whNo,true);
|
|
whMap.put(whNo,true);
|
|
|
}else {
|
|
}else {
|
|
|
throw new BaseException("【"+whNo+"】文号已存在请重新添加");
|
|
throw new BaseException("【"+whNo+"】文号已存在请重新添加");
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<CostProjectDocument> qw = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<CostProjectDocument> qw = new LambdaQueryWrapper<>();
|
|
@@ -221,24 +235,53 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
if (this.count(qw) > 0) {
|
|
if (this.count(qw) > 0) {
|
|
|
throw new BaseException("该项目监审单位已存在此文书");
|
|
throw new BaseException("该项目监审单位已存在此文书");
|
|
|
}
|
|
}
|
|
|
|
|
+ IUser iUser = ContextUtil.getCurrentUser();
|
|
|
|
|
+ User user = userService.getByAccount(iUser.getAccount());
|
|
|
CostProjectApproval costProjectApproval = costProjectApprovalManager.get(req.getProjectId());
|
|
CostProjectApproval costProjectApproval = costProjectApprovalManager.get(req.getProjectId());
|
|
|
//类型转换
|
|
//类型转换
|
|
|
CostProjectDocument costProjectDocument = new CostProjectDocument();
|
|
CostProjectDocument costProjectDocument = new CostProjectDocument();
|
|
|
BeanUtil.copyProperties(req, costProjectDocument);
|
|
BeanUtil.copyProperties(req, costProjectDocument);
|
|
|
costProjectDocument.setDocumentNumber(whNo);
|
|
costProjectDocument.setDocumentNumber(whNo);
|
|
|
costProjectDocument.setDocumentName(costDocumentTemplate.getDocumentName());
|
|
costProjectDocument.setDocumentName(costDocumentTemplate.getDocumentName());
|
|
|
|
|
+ costProjectDocument.setCreateBy(user.getCreateBy());
|
|
|
costProjectDocument.setDocumentType(costDocumentTemplate.getType());
|
|
costProjectDocument.setDocumentType(costDocumentTemplate.getType());
|
|
|
costProjectDocument.setProjectId(costProjectApproval.getProjectId());
|
|
costProjectDocument.setProjectId(costProjectApproval.getProjectId());
|
|
|
super.create(costProjectDocument);
|
|
super.create(costProjectDocument);
|
|
|
- /*if (costProjectDocument.getDocumentAlias().equals("cbjstzs")) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //文件关联信息赋值
|
|
|
|
|
+ req.getCostProjectDocumentFiles().forEach(costProjectDocumentFile -> {
|
|
|
|
|
+ costProjectDocumentFile.setDocumentId(costProjectDocument.getDocumentId());
|
|
|
|
|
+ costProjectDocumentFile.setProjectId(costProjectDocument.getProjectId());
|
|
|
|
|
+ costProjectDocumentFile.setProjectDocumentId(costProjectDocument.getId());
|
|
|
|
|
+ switch (costProjectDocumentFile.getPinyin()) {
|
|
|
|
|
+ case "SongDaWenShuWenHao":
|
|
|
|
|
+ costProjectDocumentFile.setDataValue(whNo);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(costProjectDocumentFile.getTableName())){
|
|
|
|
|
+ if(StringUtil.isEmpty(costProjectDocumentFile.getWhereValue())){
|
|
|
|
|
+ costProjectDocumentFile.setWhereValue(costProjectApproval.getProjectId());
|
|
|
|
|
+ }else {
|
|
|
|
|
+ String whereValue1 = costProjectDocumentFile.getWhereValue();
|
|
|
|
|
+ String replace = whereValue1.replace("?", "'" + costProjectApproval.getProjectId() + "'");
|
|
|
|
|
+ costProjectDocumentFile.setWhereValue(replace);
|
|
|
|
|
+ }
|
|
|
|
|
+ String colValue = costTemplateFileManager.getColValue(costProjectDocumentFile.getTableName(), costProjectDocumentFile.getColName(), costProjectDocumentFile.getWhereName(), costProjectDocumentFile.getWhereValue());
|
|
|
|
|
+ //获取whereValue字段值
|
|
|
|
|
+ costProjectDocumentFile.setDataValue(colValue);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (!costProjectDocument.getDocumentAlias().equals("sdhz")) {
|
|
|
|
|
|
|
|
CostDocumentTemplate templateManagerById = costDocumentTemplateManager.getByAlias("sdhz");
|
|
CostDocumentTemplate templateManagerById = costDocumentTemplateManager.getByAlias("sdhz");
|
|
|
if (templateManagerById==null) {
|
|
if (templateManagerById==null) {
|
|
|
throw new BaseException("未查询到送达回证文书模板信息,请先添加");
|
|
throw new BaseException("未查询到送达回证文书模板信息,请先添加");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- IUser iUser = ContextUtil.getCurrentUser();
|
|
|
|
|
- User user = userService.getByAccount(iUser.getAccount());
|
|
|
|
|
|
|
+
|
|
|
ArrayList<CostProjectDocumentFile> arrayList = new ArrayList<>();
|
|
ArrayList<CostProjectDocumentFile> arrayList = new ArrayList<>();
|
|
|
CostProjectDocument projectDocument = new CostProjectDocument();
|
|
CostProjectDocument projectDocument = new CostProjectDocument();
|
|
|
BeanUtil.copyProperties(costProjectDocument, projectDocument);
|
|
BeanUtil.copyProperties(costProjectDocument, projectDocument);
|
|
@@ -252,13 +295,22 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
if (list == null || list.isEmpty()) {
|
|
if (list == null || list.isEmpty()) {
|
|
|
throw new BaseException("文书文号不存在");
|
|
throw new BaseException("文书文号不存在");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
CostDocumentWh costDocument = list.get(0);
|
|
CostDocumentWh costDocument = list.get(0);
|
|
|
- projectDocument.setDocumentNumber(costDocument.getRulePattern().replace("{prefixText}", costDocument.getPrefixText())
|
|
|
|
|
- .replace("{year}", costDocument.getYear()).replace("{currentValue}", costDocument.getCurrentValue().toString()));
|
|
|
|
|
|
|
+ //返回文号
|
|
|
|
|
+ String whno = this.getWH(costDocument);
|
|
|
|
|
+ //校验文号唯一性
|
|
|
|
|
+ /*Boolean bwhno = whMap.get(whNo);
|
|
|
|
|
+ if (bwhno==null || !bwhno) {
|
|
|
|
|
+ whMap.put(whno,true);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ throw new BaseException("【"+whNo+"】文号已存在请重新添加");
|
|
|
|
|
+ }*/
|
|
|
|
|
+ projectDocument.setDocumentNumber(whno);
|
|
|
projectDocument.setElectronicDocumentUrl(templateManagerById.getFileUrl());
|
|
projectDocument.setElectronicDocumentUrl(templateManagerById.getFileUrl());
|
|
|
projectDocument.setDocumentWhId(costDocument.getId());
|
|
projectDocument.setDocumentWhId(costDocument.getId());
|
|
|
projectDocument.setDocumentId(String.valueOf(templateManagerById.getId()));
|
|
projectDocument.setDocumentId(String.valueOf(templateManagerById.getId()));
|
|
|
- projectDocument.setDocumentName(templateManagerById.getDocumentName());
|
|
|
|
|
|
|
+ projectDocument.setDocumentName(costProjectDocument.getDocumentName()+"-"+templateManagerById.getDocumentName());
|
|
|
projectDocument.setDocumentType(templateManagerById.getType());
|
|
projectDocument.setDocumentType(templateManagerById.getType());
|
|
|
projectDocument.setDocumentAlias(templateManagerById.getAlias());
|
|
projectDocument.setDocumentAlias(templateManagerById.getAlias());
|
|
|
//super.create(projectDocument);
|
|
//super.create(projectDocument);
|
|
@@ -273,11 +325,33 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
costProjectDocumentFile.setCreateBy(user.getAccount());
|
|
costProjectDocumentFile.setCreateBy(user.getAccount());
|
|
|
costProjectDocumentFile.setCreateTime(LocalDateTime.now());
|
|
costProjectDocumentFile.setCreateTime(LocalDateTime.now());
|
|
|
costProjectDocumentFile.setProjectId(costProjectApproval.getProjectId());
|
|
costProjectDocumentFile.setProjectId(costProjectApproval.getProjectId());
|
|
|
- costProjectDocumentFile.setProjectId(costProjectDocument.getProjectId());
|
|
|
|
|
|
|
+ costProjectDocumentFile.setProjectDocumentId(projectDocument.getId());
|
|
|
|
|
+ //costProjectDocumentFile.setProjectId(costProjectDocument.getProjectId());
|
|
|
switch (f.getPinyin()) {
|
|
switch (f.getPinyin()) {
|
|
|
|
|
+ case "JiaGeZhuGuanBuMenHuoChengBenDiaoChaJiGou":
|
|
|
|
|
+ costProjectDocumentFile.setDataValue(costProjectApproval.getOrgName());
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "SongDaWenShuMingCheng":
|
|
|
|
|
+ costProjectDocumentFile.setDataValue(costDocument.getWhName());
|
|
|
|
|
+ break;
|
|
|
case "SongDaWenShuWenHao":
|
|
case "SongDaWenShuWenHao":
|
|
|
costProjectDocumentFile.setDataValue(projectDocument.getDocumentNumber());
|
|
costProjectDocumentFile.setDataValue(projectDocument.getDocumentNumber());
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case "ShouSongDaRen":
|
|
|
|
|
+ costProjectDocumentFile.setDataValue(auditedUnit.getContactName());
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "BeiJianShenDanWeiBanGongDiDian":
|
|
|
|
|
+ costProjectDocumentFile.setDataValue(auditedUnit.getAddress());
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "TongZhiSongDaShiJian":
|
|
|
|
|
+ costProjectDocumentFile.setDataValue(DateUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "BeiJianShenDanWeiLianXiRenDianHua":
|
|
|
|
|
+ costProjectDocumentFile.setDataValue(auditedUnit.getContactMobile());
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ costProjectDocumentFile.setDataValue("");
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
if (StringUtils.isNotBlank(f.getTableName())){
|
|
if (StringUtils.isNotBlank(f.getTableName())){
|
|
|
if(StringUtil.isEmpty(costProjectDocumentFile.getWhereValue())){
|
|
if(StringUtil.isEmpty(costProjectDocumentFile.getWhereValue())){
|
|
@@ -294,30 +368,9 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
arrayList.add(costProjectDocumentFile);
|
|
arrayList.add(costProjectDocumentFile);
|
|
|
});
|
|
});
|
|
|
costProjectDocumentFileManager.saveBatch(arrayList);
|
|
costProjectDocumentFileManager.saveBatch(arrayList);
|
|
|
- }*/
|
|
|
|
|
- //文件关联信息赋值
|
|
|
|
|
- req.getCostProjectDocumentFiles().forEach(costProjectDocumentFile -> {
|
|
|
|
|
- costProjectDocumentFile.setDocumentId(costProjectDocument.getDocumentId());
|
|
|
|
|
- costProjectDocumentFile.setProjectId(costProjectDocument.getProjectId());
|
|
|
|
|
- switch (costProjectDocumentFile.getPinyin()) {
|
|
|
|
|
- case "SongDaWenShuWenHao":
|
|
|
|
|
- costProjectDocumentFile.setDataValue(whNo);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- if (StringUtils.isNotBlank(costProjectDocumentFile.getTableName())){
|
|
|
|
|
- if(StringUtil.isEmpty(costProjectDocumentFile.getWhereValue())){
|
|
|
|
|
- costProjectDocumentFile.setWhereValue(costProjectApproval.getProjectId());
|
|
|
|
|
- }else {
|
|
|
|
|
- String whereValue1 = costProjectDocumentFile.getWhereValue();
|
|
|
|
|
- String replace = whereValue1.replace("?", "'" + costProjectApproval.getProjectId() + "'");
|
|
|
|
|
- costProjectDocumentFile.setWhereValue(replace);
|
|
|
|
|
- }
|
|
|
|
|
- String colValue = costTemplateFileManager.getColValue(costProjectDocumentFile.getTableName(), costProjectDocumentFile.getColName(), costProjectDocumentFile.getWhereName(), costProjectDocumentFile.getWhereValue());
|
|
|
|
|
- //获取whereValue字段值
|
|
|
|
|
- costProjectDocumentFile.setDataValue(colValue);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ whMap.remove(whNo);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- });
|
|
|
|
|
//保存解析出的文件内容
|
|
//保存解析出的文件内容
|
|
|
costProjectDocumentFileManager.saveBatch(req.getCostProjectDocumentFiles());
|
|
costProjectDocumentFileManager.saveBatch(req.getCostProjectDocumentFiles());
|
|
|
|
|
|
|
@@ -463,4 +516,21 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
DocumentProcessor.processWordDocument(templatePath,outputPath,map,new LinkedHashMap<>());
|
|
DocumentProcessor.processWordDocument(templatePath,outputPath,map,new LinkedHashMap<>());
|
|
|
return EipConfig.getImgUrl()+FileUploadUtil.getPathFileName(outputPath,fileName);
|
|
return EipConfig.getImgUrl()+FileUploadUtil.getPathFileName(outputPath,fileName);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void feedbackDocumentUrl(CostProjectDocumentReq req) {
|
|
|
|
|
+ if (ObjectUtil.isEmpty(req.getId())) {
|
|
|
|
|
+ throw new BaseException("请选择要修改的文书");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (ObjectUtil.isEmpty(req.getFeedbackDocumentUrl())) {
|
|
|
|
|
+ throw new BaseException("被监审单位反馈资料附件ID集合不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ CostProjectDocument projectDocument = this.get(req.getId());
|
|
|
|
|
+ if(projectDocument==null){
|
|
|
|
|
+ throw new BaseException("根据id未查询到实体信息");
|
|
|
|
|
+ }
|
|
|
|
|
+ projectDocument.setFeedbackDocumentUrl(req.getFeedbackDocumentUrl());
|
|
|
|
|
+ projectDocument.setFeedbackTime(LocalDateTime.now());
|
|
|
|
|
+ this.update(projectDocument);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|