|
@@ -4,6 +4,8 @@ import com.jeeplus.common.config.Global;
|
|
import com.jeeplus.common.persistence.Page;
|
|
import com.jeeplus.common.persistence.Page;
|
|
import com.jeeplus.common.service.CrudService;
|
|
import com.jeeplus.common.service.CrudService;
|
|
import com.jeeplus.common.utils.MenuStatusEnum;
|
|
import com.jeeplus.common.utils.MenuStatusEnum;
|
|
|
|
+import com.jeeplus.modules.act.entity.Act;
|
|
|
|
+import com.jeeplus.modules.act.service.ActTaskService;
|
|
import com.jeeplus.modules.projectAccessory.dao.ProjectTemplateDao;
|
|
import com.jeeplus.modules.projectAccessory.dao.ProjectTemplateDao;
|
|
import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
|
|
import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
|
|
import com.jeeplus.modules.projectFilingBatch.dao.ProjectFilingBatchDao;
|
|
import com.jeeplus.modules.projectFilingBatch.dao.ProjectFilingBatchDao;
|
|
@@ -12,6 +14,8 @@ import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
|
|
import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingbatchRelation;
|
|
import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingbatchRelation;
|
|
import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao;
|
|
import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao;
|
|
import com.jeeplus.modules.projectcontentinfo.dao.ProjectcontentinfoDao;
|
|
import com.jeeplus.modules.projectcontentinfo.dao.ProjectcontentinfoDao;
|
|
|
|
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportRecord;
|
|
|
|
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportRecordService;
|
|
import com.jeeplus.modules.projectrecord.entity.ProjectRecordTreeData;
|
|
import com.jeeplus.modules.projectrecord.entity.ProjectRecordTreeData;
|
|
import com.jeeplus.modules.projectreportnum.service.ProjectReportNumService;
|
|
import com.jeeplus.modules.projectreportnum.service.ProjectReportNumService;
|
|
import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectClientLinkmanDao;
|
|
import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectClientLinkmanDao;
|
|
@@ -22,6 +26,7 @@ import com.jeeplus.modules.serialnum.service.SerialNumTplService;
|
|
import com.jeeplus.modules.sys.dao.UserDao;
|
|
import com.jeeplus.modules.sys.dao.UserDao;
|
|
import com.jeeplus.modules.sys.entity.MainDictDetail;
|
|
import com.jeeplus.modules.sys.entity.MainDictDetail;
|
|
import com.jeeplus.modules.sys.entity.Office;
|
|
import com.jeeplus.modules.sys.entity.Office;
|
|
|
|
+import com.jeeplus.modules.sys.entity.User;
|
|
import com.jeeplus.modules.sys.service.AreaService;
|
|
import com.jeeplus.modules.sys.service.AreaService;
|
|
import com.jeeplus.modules.sys.service.OfficeService;
|
|
import com.jeeplus.modules.sys.service.OfficeService;
|
|
import com.jeeplus.modules.sys.utils.DictUtils;
|
|
import com.jeeplus.modules.sys.utils.DictUtils;
|
|
@@ -37,6 +42,9 @@ import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
|
|
import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
|
|
import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
|
|
import jersey.repackaged.com.google.common.collect.Lists;
|
|
import jersey.repackaged.com.google.common.collect.Lists;
|
|
import org.activiti.engine.HistoryService;
|
|
import org.activiti.engine.HistoryService;
|
|
|
|
+import org.activiti.engine.history.HistoricProcessInstance;
|
|
|
|
+import org.activiti.engine.runtime.ProcessInstance;
|
|
|
|
+import org.activiti.engine.task.Task;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -106,6 +114,10 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
|
|
@Autowired
|
|
@Autowired
|
|
private RuralProjectMessageAllDao ruralProjectMessageAllDao;
|
|
private RuralProjectMessageAllDao ruralProjectMessageAllDao;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private ActTaskService actTaskService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ProjectReportRecordService projectReportRecordService;
|
|
|
|
+ @Autowired
|
|
private RuralProjectMessageAllConfigService ruralProjectMessageAllConfigService;
|
|
private RuralProjectMessageAllConfigService ruralProjectMessageAllConfigService;
|
|
|
|
|
|
|
|
|
|
@@ -1297,6 +1309,182 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
|
|
return page;
|
|
return page;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 根据项目id进行电子归档的批量驳回操作
|
|
|
|
+ * @param projectIdList
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Transactional(readOnly = false)
|
|
|
|
+ public String reportBatchReject(List<String> projectIdList){
|
|
|
|
+ Map map = new HashMap();
|
|
|
|
+
|
|
|
|
+ //获取当前登录人信息
|
|
|
|
+ User user = UserUtils.getUser();
|
|
|
|
+
|
|
|
|
+ //合规的项目集合(B级项目)
|
|
|
|
+ List<RuralProjectRecords> complianceProjectList = Lists.newArrayList();
|
|
|
|
+ //不合规的项目集合(A级项目)
|
|
|
|
+ List<RuralProjectRecords> irregularityProjectList = Lists.newArrayList();
|
|
|
|
+ //不合规的项目集合(没有进行质量复核的项目)
|
|
|
|
+ List<RuralProjectRecords> irregularityReportProjectList = Lists.newArrayList();
|
|
|
|
+ //合规的项目集合(质量复核人员和当前登陆人相同)
|
|
|
|
+ List<RuralProjectRecords> complianceBzshbUserIdProjectList = Lists.newArrayList();
|
|
|
|
+ //合规的项目集合(质量复核人员和当前登陆人不同)
|
|
|
|
+ List<RuralProjectRecords> irregularityBzshbUserIdProjectList = Lists.newArrayList();
|
|
|
|
+ //合规的项目质量复核id集合(质量复核人员和当前登陆人相同)
|
|
|
|
+ List<String> complianceBzshbUserIdReportIdList = Lists.newArrayList();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //驳回成功的电子归档数据
|
|
|
|
+ List<ProjectReportRecord> successProjectReportRecordList = Lists.newArrayList();
|
|
|
|
+ //审核状态不符合的电子归档数据
|
|
|
|
+ List<ProjectReportRecord> inconformityStatusProjectReportRecordList = Lists.newArrayList();
|
|
|
|
+ //审核节点不符合的电子归档数据
|
|
|
|
+ List<ProjectReportRecord> inconformityNodeProjectReportRecordList = Lists.newArrayList();
|
|
|
|
+
|
|
|
|
+ //根据项目id查询项目信息,并筛选出项目的项目等级为B级的信息
|
|
|
|
+ List<RuralProjectRecords> projectRecordsList = ruralProjectMessageAllDao.getProjectRecordsByIdList(projectIdList);
|
|
|
|
+ for (RuralProjectRecords projectRecords : projectRecordsList) {
|
|
|
|
+ //判断项目登记为B级的数据进行保留,A级的进行舍去
|
|
|
|
+ if("1".equals(projectRecords.getSubmitMoney())){
|
|
|
|
+ //判断质量复核通过的数据
|
|
|
|
+ if(null != projectRecords.getProjectReportStatus() && 5 == projectRecords.getProjectReportStatus()){
|
|
|
|
+ complianceProjectList.add(projectRecords);
|
|
|
|
+ }else{
|
|
|
|
+ irregularityReportProjectList.add(projectRecords);
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ irregularityProjectList.add(projectRecords);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //根据项目id批量查询项目质量复核选择的审核人信息
|
|
|
|
+ //循环质量复核信息,将不是当前登陆人审核的数据信息排除
|
|
|
|
+ for (RuralProjectRecords projectRecords: complianceProjectList) {
|
|
|
|
+ //如果报告审核人员和当前登陆人相同,则该数据符合要求
|
|
|
|
+ if(projectRecords.getBzshbUserId().equals(user.getId())){
|
|
|
|
+ complianceBzshbUserIdProjectList.add(projectRecords);
|
|
|
|
+ complianceBzshbUserIdReportIdList.add(projectRecords.getPrdId());
|
|
|
|
+ }else{
|
|
|
|
+ irregularityBzshbUserIdProjectList.add(projectRecords);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //复核条件的项目信息查询对应的电子归档信息
|
|
|
|
+ if(complianceBzshbUserIdReportIdList.size()>0){
|
|
|
|
+ //根据项目质量复核id查询电子归档信息
|
|
|
|
+ List<ProjectReportRecord> reportRecordByReportIdList = ruralProjectMessageAllDao.getReportRecordByReportIdList(complianceBzshbUserIdReportIdList);
|
|
|
|
+ //保证项目电子归档的审核状态为2
|
|
|
|
+ for (ProjectReportRecord reportRecord : reportRecordByReportIdList) {
|
|
|
|
+ if("2".equals(reportRecord.getStatus())){
|
|
|
|
+ //根据电子归档流程id查询流程信息
|
|
|
|
+ Act act = getByAct(reportRecord.getProcessInstanceId());
|
|
|
|
+ //给驳回信息添加信息
|
|
|
|
+ act.setFlag("no");
|
|
|
|
+ //判定当前节点为总审审批节点
|
|
|
|
+ if("bzshb".equals(act.getTaskDefKey())){
|
|
|
|
+ reportRecord.setAct(act);
|
|
|
|
+ List<User> users = UserUtils.getByProssType(reportRecord.getProcessInstanceId(),5);
|
|
|
|
+ if (users==null ) {
|
|
|
|
+ users = UserUtils.getByRoleActivityEnname("bggdgly",3,user.getOffice().getId(),"10",reportRecord.getCreateBy());
|
|
|
|
+ }
|
|
|
|
+ projectReportRecordService.newAuditSaveTwo(reportRecord, users);
|
|
|
|
+ successProjectReportRecordList.add(reportRecord);
|
|
|
|
+ } else {
|
|
|
|
+ //电子归档审核节点不对的数据
|
|
|
|
+ inconformityStatusProjectReportRecordList.add(reportRecord);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ //电子归档流程状态不对的数据
|
|
|
|
+ inconformityNodeProjectReportRecordList.add(reportRecord);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //成功的电子归档报告号信息
|
|
|
|
+ List<String> successNumberList = Lists.newArrayList();
|
|
|
|
+ //审核节点不对的电子归档报告号信息
|
|
|
|
+ List<String> statusNumberList = Lists.newArrayList();
|
|
|
|
+ //流程状态不对的电子归档报告号信息
|
|
|
|
+ List<String> nodeNumberList = Lists.newArrayList();
|
|
|
|
+ //审核人不对的电子归档报告号信息
|
|
|
|
+ List<String> noBzshbUserNumberList = Lists.newArrayList();
|
|
|
|
+ //没有质量复核的项目编号信息
|
|
|
|
+ List<String> irregularityReportProjectNumberList = Lists.newArrayList();
|
|
|
|
+
|
|
|
|
+ StringBuilder returnStr = new StringBuilder();
|
|
|
|
+ //成功的电子归档报告号信息
|
|
|
|
+ if(successProjectReportRecordList.size()>0){
|
|
|
|
+ for (ProjectReportRecord info : successProjectReportRecordList) {
|
|
|
|
+ successNumberList.add(info.getReport().getNumber());
|
|
|
|
+ }
|
|
|
|
+ returnStr.append("报告号:").append(String.join("、",successNumberList)).append(" 驳回成功。</br>");
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ //审核节点不对的电子归档报告号信息
|
|
|
|
+ if(inconformityStatusProjectReportRecordList.size()>0){
|
|
|
|
+ for (ProjectReportRecord info : inconformityStatusProjectReportRecordList) {
|
|
|
|
+ statusNumberList.add(info.getReport().getNumber());
|
|
|
|
+ }
|
|
|
|
+ returnStr.append("报告号:").append(String.join("、",statusNumberList)).append(" 因审核节点错误驳回失败。</br>");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //流程状态不对的电子归档报告号信息
|
|
|
|
+ if(inconformityNodeProjectReportRecordList.size()>0){
|
|
|
|
+ for (ProjectReportRecord info : inconformityNodeProjectReportRecordList) {
|
|
|
|
+ nodeNumberList.add(info.getReport().getNumber());
|
|
|
|
+ }
|
|
|
|
+ returnStr.append("报告号:").append(String.join("、",nodeNumberList)).append(" 因审核状态错误驳回失败。</br>");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //审核人不对的电子归档报告号信息
|
|
|
|
+ if(irregularityBzshbUserIdProjectList.size()>0){
|
|
|
|
+ for (RuralProjectRecords info : irregularityBzshbUserIdProjectList) {
|
|
|
|
+ noBzshbUserNumberList.add(info.getProjectReportNumber());
|
|
|
|
+ }
|
|
|
|
+ returnStr.append("报告号:").append(String.join("、",noBzshbUserNumberList)).append(" 因审核人不符驳回失败。</br>");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //没有质量复核的项目编号信息
|
|
|
|
+ if(irregularityReportProjectList.size()>0){
|
|
|
|
+ for (RuralProjectRecords info : irregularityReportProjectList) {
|
|
|
|
+ irregularityReportProjectNumberList.add(info.getProjectId());
|
|
|
|
+ }
|
|
|
|
+ returnStr.append("项目编号:").append(String.join("、",irregularityReportProjectNumberList)).append(" 因未质量符合驳回失败。");
|
|
|
|
+ }
|
|
|
|
+ map.put("success",true);
|
|
|
|
+
|
|
|
|
+ return returnStr.toString();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public Act getByAct(String processInstanceId){
|
|
|
|
+ Act act = new Act();
|
|
|
|
+ HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
|
|
|
+ ProcessInstance processInstance = actTaskService.getProcIns(processInstanceId);
|
|
|
|
+ if (processInstance!=null) {
|
|
|
|
+ List<Task> taskList = actTaskService.getCurrentTaskList(processInstance);
|
|
|
|
+ if(taskList!=null && taskList.size()>1){
|
|
|
|
+ for (Task taskInfok:taskList) {
|
|
|
|
+ if (UserUtils.getUser().getId().equals(taskInfok.getAssignee())) {
|
|
|
|
+ act.setTaskId(taskInfok.getId());
|
|
|
|
+ act.setTaskName(taskInfok.getName());
|
|
|
|
+ act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
|
|
|
|
+ act.setProcDefId(taskInfok.getProcessDefinitionId());
|
|
|
|
+ act.setProcInsId(taskInfok.getProcessInstanceId());
|
|
|
|
+ act.setTask(taskInfok);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ Task task = actTaskService.getCurrentTaskInfo(processInstance);
|
|
|
|
+ act.setTaskId(task.getId());
|
|
|
|
+ act.setTaskName(task.getName());
|
|
|
|
+ act.setTaskDefKey(task.getTaskDefinitionKey());
|
|
|
|
+ act.setProcDefId(task.getProcessDefinitionId());
|
|
|
|
+ act.setProcInsId(task.getProcessInstanceId());
|
|
|
|
+ act.setTask(task);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return act;
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|