|
|
@@ -195,7 +195,15 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
if (ObjectUtil.isEmpty(req.getProjectId())) {
|
|
|
throw new BaseException("请选择项目");
|
|
|
}
|
|
|
- if (ObjectUtil.isEmpty(req.getDocumentNumber())) {
|
|
|
+ CostDocumentTemplate costDocumentTemplate = this.costDocumentTemplateManager.get(req.getDocumentId());
|
|
|
+ if (costDocumentTemplate == null || BaseConstant.DELETE_FLAG.equals(costDocumentTemplate.getIsDeleted())) {
|
|
|
+ throw new BaseException("文书模板不存在");
|
|
|
+ }
|
|
|
+ if (!costDocumentTemplate.getAlias().equals("cbjsgzdg")
|
|
|
+ &&!costDocumentTemplate.getAlias().equals("cbjsjtsyjl")
|
|
|
+ &&!costDocumentTemplate.getAlias().equals("cbshcbyjb1")
|
|
|
+ &&!costDocumentTemplate.getAlias().equals("cbjstqzldjb")
|
|
|
+ && ObjectUtil.isEmpty(req.getDocumentNumber())) {
|
|
|
throw new BaseException("请填写通知文号");
|
|
|
}
|
|
|
if (ObjectUtil.isEmpty(req.getEnterpriseId())) {
|
|
|
@@ -204,30 +212,28 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
req.setGenerateTime(LocalDateTime.now());
|
|
|
req.setIsPushed("1");
|
|
|
|
|
|
- CostDocumentTemplate costDocumentTemplate = this.costDocumentTemplateManager.get(req.getDocumentId());
|
|
|
- if (costDocumentTemplate == null || BaseConstant.DELETE_FLAG.equals(costDocumentTemplate.getIsDeleted())) {
|
|
|
- throw new BaseException("文书模板不存在");
|
|
|
- }
|
|
|
+
|
|
|
req.setDocumentAlias(costDocumentTemplate.getAlias());
|
|
|
AuditedUnit auditedUnit = auditedUnitManager.get(req.getEnterpriseId());
|
|
|
if (auditedUnit == null || BaseConstant.DELETE_FLAG.equals(auditedUnit.getIsDeleted())) {
|
|
|
throw new BaseException("被监审单位不存在");
|
|
|
}
|
|
|
- CostDocumentWh costDocumentWh = costDocumentWhManager.get(req.getDocumentWhId());
|
|
|
- if (costDocumentWh == null || BaseConstant.DELETE_FLAG.equals(costDocumentWh.getIsDeleted())) {
|
|
|
- throw new BaseException("文书文号不存在");
|
|
|
- }
|
|
|
+ CostDocumentWh costDocumentWh=null;
|
|
|
//返回文号
|
|
|
- String whNo = this.getWH(costDocumentWh);
|
|
|
- //校验文号唯一性
|
|
|
- /*Boolean b = whMap.get(whNo);
|
|
|
- if (b==null || !b) {
|
|
|
- whMap.put(whNo,true);
|
|
|
- }else {
|
|
|
- throw new BaseException("【"+whNo+"】文号已存在请重新添加");
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
+ String whNo;
|
|
|
+ if (!costDocumentTemplate.getAlias().equals("cbjsgzdg")
|
|
|
+ &&!costDocumentTemplate.getAlias().equals("cbjsjtsyjl")
|
|
|
+ &&!costDocumentTemplate.getAlias().equals("cbshcbyjb1")
|
|
|
+ &&!costDocumentTemplate.getAlias().equals("cbjstqzldjb")) {
|
|
|
+ costDocumentWh= costDocumentWhManager.get(req.getDocumentWhId());
|
|
|
+ if (costDocumentWh == null || BaseConstant.DELETE_FLAG.equals(costDocumentWh.getIsDeleted())) {
|
|
|
+ throw new BaseException("文书文号不存在");
|
|
|
+ }
|
|
|
+ //返回文号
|
|
|
+ whNo = this.getWH(costDocumentWh);
|
|
|
+ } else {
|
|
|
+ whNo = "";
|
|
|
+ }
|
|
|
LambdaQueryWrapper<CostProjectDocument> qw = new LambdaQueryWrapper<>();
|
|
|
qw.eq(CostProjectDocument::getProjectId, req.getProjectId());
|
|
|
qw.eq(CostProjectDocument::getDocumentId, req.getDocumentId());
|
|
|
@@ -261,7 +267,15 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
if (StringUtils.isNotBlank(costProjectDocumentFile.getTableName())){
|
|
|
if(StringUtil.isEmpty(costProjectDocumentFile.getWhereValue())){
|
|
|
costProjectDocumentFile.setWhereValue(costProjectApproval.getProjectId());
|
|
|
- }else {
|
|
|
+ } else if (costProjectDocument.getDocumentAlias().equals("cbjsgzdg")
|
|
|
+ &&!costProjectDocument.getDocumentAlias().equals("cbjsjtsyjl")
|
|
|
+ &&!costProjectDocument.getDocumentAlias().equals("cbshcbyjb1")
|
|
|
+ &&!costProjectDocument.getDocumentAlias().equals("cbjstqzldjb")) {
|
|
|
+ String whereValue1 = costProjectDocumentFile.getWhereValue();
|
|
|
+ String replace = whereValue1.replace("?", "'" + costProjectApproval.getProjectId() + "'");
|
|
|
+ String replaced = replace.replace("&", auditedUnit.getUnitId());
|
|
|
+ costProjectDocumentFile.setWhereValue(replaced);
|
|
|
+ } else {
|
|
|
String whereValue1 = costProjectDocumentFile.getWhereValue();
|
|
|
String replace = whereValue1.replace("?", "'" + costProjectApproval.getProjectId() + "'");
|
|
|
costProjectDocumentFile.setWhereValue(replace);
|
|
|
@@ -274,7 +288,7 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
});
|
|
|
|
|
|
|
|
|
- if (!costProjectDocument.getDocumentAlias().equals("sdhz")) {
|
|
|
+ if (!costDocumentTemplate.getAlias().equals("sdhz")) {
|
|
|
|
|
|
CostDocumentTemplate templateManagerById = costDocumentTemplateManager.getByAlias("sdhz");
|
|
|
if (templateManagerById==null) {
|
|
|
@@ -353,7 +367,7 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
costProjectDocumentFile.setDataValue("");
|
|
|
break;
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(f.getTableName())){
|
|
|
+ /*if (StringUtils.isNotBlank(f.getTableName())){
|
|
|
if(StringUtil.isEmpty(costProjectDocumentFile.getWhereValue())){
|
|
|
costProjectDocumentFile.setWhereValue(costProjectApproval.getProjectId());
|
|
|
}else {
|
|
|
@@ -364,7 +378,7 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
String colValue = costTemplateFileManager.getColValue(costProjectDocumentFile.getTableName(), costProjectDocumentFile.getColName(), costProjectDocumentFile.getWhereName(), costProjectDocumentFile.getWhereValue());
|
|
|
//获取whereValue字段值
|
|
|
costProjectDocumentFile.setDataValue(colValue);
|
|
|
- }
|
|
|
+ }*/
|
|
|
arrayList.add(costProjectDocumentFile);
|
|
|
});
|
|
|
costProjectDocumentFileManager.saveBatch(arrayList);
|
|
|
@@ -373,9 +387,10 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
|
|
|
//保存解析出的文件内容
|
|
|
costProjectDocumentFileManager.saveBatch(req.getCostProjectDocumentFiles());
|
|
|
-
|
|
|
- //更新文号值
|
|
|
- costDocumentWhManager.updateCurrentValue(costDocumentWh.getId());
|
|
|
+ if (costDocumentWh!=null) {
|
|
|
+ //更新文号值
|
|
|
+ costDocumentWhManager.updateCurrentValue(costDocumentWh.getId());
|
|
|
+ }
|
|
|
|
|
|
whMap.remove(whNo);
|
|
|
}
|