Selaa lähdekoodia

1.监审通知修改回显优化
2.接收文书列表,查看,上传

赵越越 1 kuukausi sitten
vanhempi
commit
c89e2a4266

+ 2 - 2
assembly/src/main/resources/application-dev.yml

@@ -8,9 +8,9 @@ spring:
       datasource:
         master:
           username: root
-          password: June-15$Password
+          password: Chemicals_20181101!
           driver-class-name: com.mysql.cj.jdbc.Driver
-          url: jdbc:mysql://116.204.108.139:3306/chengben?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true
+          url: jdbc:mysql://1.71.91.48:3306/chengben?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true
           druid:
             filters: stat
             # druid oracle 验证语句

+ 2 - 0
assistMg/src/main/java/com/hotent/baseInfo/manager/AuditedUnitManager.java

@@ -28,6 +28,8 @@ public interface AuditedUnitManager extends BaseManager<AuditedUnit> {
     PageList<AuditedUnit> pageList(AuditedUnitPageReq req) throws Exception;
 
     List<AuditedUnit> getList(String unitId) throws Exception;
+
+    List<AuditedUnit> getByUserAccount(String account);
 }
 
 

+ 7 - 0
assistMg/src/main/java/com/hotent/baseInfo/manager/impl/AuditedUnitManagerImpl.java

@@ -159,6 +159,13 @@ public class AuditedUnitManagerImpl extends BaseManagerImpl<AuditedUnitDao, Audi
                 );
         return units;
     }
+
+    @Override
+    public List<AuditedUnit> getByUserAccount(String account) {
+        QueryWrapper<AuditedUnit> wrapper = new QueryWrapper<>();
+        wrapper.eq("account",account);
+        return this.list(wrapper);
+    }
 }
 
 

+ 12 - 2
assistMg/src/main/java/com/hotent/project/controller/CostProjectDocumentController.java

@@ -2,6 +2,7 @@ package com.hotent.project.controller;
 
 
 import com.aliyun.tea.utils.StringUtils;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.hotent.base.annotation.ApiGroup;
 import com.hotent.base.constants.ApiGroupConsts;
 import com.hotent.baseInfo.model.CostDocumentTemplateFile;
@@ -77,8 +78,10 @@ public class CostProjectDocumentController extends BaseController<CostProjectDoc
 	//分页查询
 	@PostMapping(value="/pageList")
 	@ApiOperation(value="分页查询pageList",httpMethod = "POST",notes = "分页查询pageList")
-	public CommonResult<PageResp<CostProjectDocument>> pageList(@RequestBody CostProjectDocumentPageReq req) {
-		return CommonResult.<PageResp<CostProjectDocument>>ok().value(crudService.pageQuery(req, baseService::pageList));
+	public CommonResult<PageResp<CostProjectDocument>> pageList(@RequestBody CostProjectDocumentPageReq req) throws Exception{
+		IPage<CostProjectDocument> costProjectDocumentIPage = baseService.pageList(req);
+		PageResp<CostProjectDocument> success = PageResp.success(costProjectDocumentIPage);
+		return CommonResult.<PageResp<CostProjectDocument>>ok().value(success);
 
 	}
 
@@ -97,7 +100,14 @@ public class CostProjectDocumentController extends BaseController<CostProjectDoc
 	public CommonResult<String> update(@RequestBody CostProjectDocumentReq req) {
 		costProjectDocumentManager.updateProjectDocument(req);
 		return CommonResult.<String>ok().message("修改成功");
+	}
 
+	//修改
+	@PostMapping(value="/feedback/document/url")
+	@ApiOperation(value="修改update",httpMethod = "POST",notes = "修改update")
+	public CommonResult<String> feedbackDocumentUrl(@RequestBody CostProjectDocumentReq req) {
+		baseService.feedbackDocumentUrl(req);
+		return CommonResult.<String>ok().message("修改成功");
 	}
 
 	@PostMapping(value="/deleteByIds")

+ 2 - 1
assistMg/src/main/java/com/hotent/project/manager/CostProjectDocumentManager.java

@@ -36,7 +36,7 @@ public interface CostProjectDocumentManager extends BaseManager<CostProjectDocum
 	void createOrUpdate(CostProjectDocument costProjectDocument);
 
 
-	IPage<CostProjectDocument> pageList(CostProjectDocumentPageReq req);
+	IPage<CostProjectDocument> pageList(CostProjectDocumentPageReq req) throws Exception;
 
 
 //	void create(CostProjectDocument costProjectDocument);
@@ -60,4 +60,5 @@ public interface CostProjectDocumentManager extends BaseManager<CostProjectDocum
 	String createDocument(String id);
 
 
+	void feedbackDocumentUrl(CostProjectDocumentReq req);
 }

+ 5 - 2
assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectDocumentFileManagerImpl.java

@@ -57,7 +57,10 @@ public class CostProjectDocumentFileManagerImpl extends BaseManagerImpl<CostProj
 
 	@Override
 	public List<CostProjectDocumentFile> getInfo(String id) {
-		CostProjectDocument costProjectDocument = costProjectDocumentManager.getDetail(id);
-		return this.getCostProjectDocumentFiles(costProjectDocument.getProjectId(),costProjectDocument.getDocumentId());
+		//CostProjectDocument costProjectDocument = costProjectDocumentManager.getDetail(id);
+		//return this.getCostProjectDocumentFiles(costProjectDocument.getProjectId(),costProjectDocument.getDocumentId());
+		QueryWrapper<CostProjectDocumentFile> wrapper = new QueryWrapper<>();
+		wrapper.eq("project_document_id",id);
+		return this.list(wrapper);
 	}
 }

+ 104 - 34
assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectDocumentManagerImpl.java

@@ -114,7 +114,7 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
     }
 
     @Override
-    public IPage<CostProjectDocument> pageList(CostProjectDocumentPageReq req) {
+    public IPage<CostProjectDocument> pageList(CostProjectDocumentPageReq req) throws Exception {
         LambdaQueryWrapper<CostProjectDocument> qw = new LambdaQueryWrapper<>();
         if (req.getDocumentType() != null) {
 //            LambdaQueryWrapper<CostDocumentTemplate> lambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -122,7 +122,21 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
 //            lambdaQueryWrapper.eq(CostDocumentTemplate::getIsWh, "0");
             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());
         return this.page(page, qw);
@@ -206,12 +220,12 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
         //返回文号
         String whNo = this.getWH(costDocumentWh);
         //校验文号唯一性
-        Boolean b = whMap.get(whNo);
+        /*Boolean b = whMap.get(whNo);
         if (b==null || !b) {
             whMap.put(whNo,true);
         }else {
             throw new BaseException("【"+whNo+"】文号已存在请重新添加");
-        }
+        }*/
 
 
         LambdaQueryWrapper<CostProjectDocument> qw = new LambdaQueryWrapper<>();
@@ -221,24 +235,53 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
         if (this.count(qw) > 0) {
             throw new BaseException("该项目监审单位已存在此文书");
         }
+        IUser iUser = ContextUtil.getCurrentUser();
+        User user = userService.getByAccount(iUser.getAccount());
         CostProjectApproval costProjectApproval = costProjectApprovalManager.get(req.getProjectId());
         //类型转换
         CostProjectDocument costProjectDocument = new CostProjectDocument();
         BeanUtil.copyProperties(req, costProjectDocument);
         costProjectDocument.setDocumentNumber(whNo);
         costProjectDocument.setDocumentName(costDocumentTemplate.getDocumentName());
+        costProjectDocument.setCreateBy(user.getCreateBy());
         costProjectDocument.setDocumentType(costDocumentTemplate.getType());
         costProjectDocument.setProjectId(costProjectApproval.getProjectId());
         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");
             if (templateManagerById==null) {
                 throw new BaseException("未查询到送达回证文书模板信息,请先添加");
             }
 
-            IUser iUser = ContextUtil.getCurrentUser();
-            User user = userService.getByAccount(iUser.getAccount());
+
             ArrayList<CostProjectDocumentFile> arrayList = new ArrayList<>();
             CostProjectDocument projectDocument = new CostProjectDocument();
             BeanUtil.copyProperties(costProjectDocument, projectDocument);
@@ -252,13 +295,22 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
             if (list == null || list.isEmpty()) {
                 throw new BaseException("文书文号不存在");
             }
+
             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.setDocumentWhId(costDocument.getId());
             projectDocument.setDocumentId(String.valueOf(templateManagerById.getId()));
-            projectDocument.setDocumentName(templateManagerById.getDocumentName());
+            projectDocument.setDocumentName(costProjectDocument.getDocumentName()+"-"+templateManagerById.getDocumentName());
             projectDocument.setDocumentType(templateManagerById.getType());
             projectDocument.setDocumentAlias(templateManagerById.getAlias());
             //super.create(projectDocument);
@@ -273,11 +325,33 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
                 costProjectDocumentFile.setCreateBy(user.getAccount());
                 costProjectDocumentFile.setCreateTime(LocalDateTime.now());
                 costProjectDocumentFile.setProjectId(costProjectApproval.getProjectId());
-                costProjectDocumentFile.setProjectId(costProjectDocument.getProjectId());
+                costProjectDocumentFile.setProjectDocumentId(projectDocument.getId());
+                //costProjectDocumentFile.setProjectId(costProjectDocument.getProjectId());
                 switch (f.getPinyin()) {
+                    case "JiaGeZhuGuanBuMenHuoChengBenDiaoChaJiGou":
+                        costProjectDocumentFile.setDataValue(costProjectApproval.getOrgName());
+                        break;
+                    case "SongDaWenShuMingCheng":
+                        costProjectDocumentFile.setDataValue(costDocument.getWhName());
+                        break;
                     case "SongDaWenShuWenHao":
                         costProjectDocumentFile.setDataValue(projectDocument.getDocumentNumber());
                         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(StringUtil.isEmpty(costProjectDocumentFile.getWhereValue())){
@@ -294,30 +368,9 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
                 arrayList.add(costProjectDocumentFile);
             });
             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());
 
@@ -463,4 +516,21 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
         DocumentProcessor.processWordDocument(templatePath,outputPath,map,new LinkedHashMap<>());
         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);
+    }
 }

+ 12 - 0
assistMg/src/main/java/com/hotent/project/model/CostProjectDocumentFile.java

@@ -31,6 +31,11 @@ public class CostProjectDocumentFile extends BaseModel<CostProjectDocumentFile>
     @TableField("project_id")
     @JsonProperty("projectId")
     private String projectId;
+
+    @ApiModelProperty(value = "项目监审文书表 id")
+    @TableField("project_document_id")
+    @JsonProperty("projectDocumentId")
+    private String projectDocumentId;
     
     @ApiModelProperty(value = "名称")
     @TableField("original_text")
@@ -144,6 +149,13 @@ public class CostProjectDocumentFile extends BaseModel<CostProjectDocumentFile>
     public void setProjectId(String projectId) {
         this.projectId = projectId;
     }
+
+    public void setProjectDocumentId(String projectDocumentId) {
+        this.projectDocumentId = projectDocumentId;
+    }
+    public String getProjectDocumentId() {
+        return projectDocumentId;
+    }
     public String getOriginalText() {
         return originalText;
     }

+ 3 - 0
assistMg/src/main/java/com/hotent/project/req/CostProjectDocumentPageReq.java

@@ -18,4 +18,7 @@ public class CostProjectDocumentPageReq extends PageReq {
     @ApiModelProperty(value = "文书类型")
     private String documentType;
 
+    @ApiModelProperty(value = "查看权限类型:0:查看全部,1:查看被监审单位是当前登录用户的,2:查看当前登录人创建的")
+    private Integer permissionType=0;
+
 }