|
@@ -7,6 +7,7 @@ import com.google.common.collect.Maps;
|
|
|
import com.jeeplus.common.persistence.Page;
|
|
|
import com.jeeplus.common.service.CrudService;
|
|
|
import com.jeeplus.common.utils.MyBeanUtils;
|
|
|
+import com.jeeplus.common.utils.SpringContextHolder;
|
|
|
import com.jeeplus.common.utils.StringUtils;
|
|
|
import com.jeeplus.modules.isignature.service.ISignatureDocumentService;
|
|
|
import com.jeeplus.modules.projectcontentinfo.dao.ProjectContentChangeDao;
|
|
@@ -18,10 +19,10 @@ import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
|
|
|
import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
|
|
|
import com.jeeplus.modules.projectreportnum.service.ProjectReportNumService;
|
|
|
import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
|
|
|
+import com.jeeplus.modules.sys.dao.MainDictDetailDao;
|
|
|
import com.jeeplus.modules.sys.dao.WorkattachmentDao;
|
|
|
-import com.jeeplus.modules.sys.entity.Office;
|
|
|
-import com.jeeplus.modules.sys.entity.User;
|
|
|
-import com.jeeplus.modules.sys.entity.Workattachment;
|
|
|
+import com.jeeplus.modules.sys.entity.*;
|
|
|
+import com.jeeplus.modules.sys.service.MainDictService;
|
|
|
import com.jeeplus.modules.sys.utils.DictUtils;
|
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
|
import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
|
|
@@ -80,6 +81,10 @@ public class ProjectcontentinfoService extends CrudService<ProjectcontentinfoDao
|
|
|
@Autowired
|
|
|
private ProjectReportNumService projectReportNumService;
|
|
|
|
|
|
+ private static MainDictDetailDao mainDictDetailDao = SpringContextHolder.getBean(MainDictDetailDao.class);
|
|
|
+
|
|
|
+ private static MainDictService mainDictService = SpringContextHolder.getBean(MainDictService.class);
|
|
|
+
|
|
|
public Projectcontentinfo get(String id) {
|
|
|
return super.get(id);
|
|
|
}
|
|
@@ -272,7 +277,7 @@ public class ProjectcontentinfoService extends CrudService<ProjectcontentinfoDao
|
|
|
dataName = projectContentData.getNumber()+projectContentData.getName();
|
|
|
infoId = projectContentData.getId();
|
|
|
save = true;
|
|
|
- }else if (projectcontentinfo.getProjectReportData()!=null){
|
|
|
+ }else if (projectcontentinfo.getProjectReportData()!=null) {
|
|
|
//保存工作报告相关数据
|
|
|
ProjectReportData projectReportData = projectcontentinfo.getProjectReportData();
|
|
|
projectContentDataList = projectReportData.getProjectContentDataList();
|
|
@@ -280,38 +285,74 @@ public class ProjectcontentinfoService extends CrudService<ProjectcontentinfoDao
|
|
|
projectReportData.setOfficeId(contentinfo.getOfficeId());
|
|
|
projectReportData.setProject(contentinfo.getProject());
|
|
|
Boolean status = false;
|
|
|
- if (StringUtils.isBlank(projectReportData.getId())){
|
|
|
+ if (StringUtils.isBlank(projectReportData.getId())) {
|
|
|
status = true;
|
|
|
projectReportData.setFileStatus("1");
|
|
|
}
|
|
|
- if (type==1){
|
|
|
- //暂存
|
|
|
- projectReportData.setStatus("1");
|
|
|
- String num = projectReportData.getNumber();
|
|
|
- if(StringUtils.isNotBlank(num)){
|
|
|
- projectReportNumService.updateNum(num);
|
|
|
- }
|
|
|
- projectReportDataService.save(projectReportData);
|
|
|
- }else {
|
|
|
- //送审
|
|
|
- Map<String, Object> variables = Maps.newHashMap();
|
|
|
- projectReportData.setStatus("2");
|
|
|
- String processInstanceId = "";
|
|
|
- //判断是否存在撤回
|
|
|
- if (StringUtils.isNotBlank(projectReportData.getId())){
|
|
|
- ProjectReportData old = projectReportDataService.get(projectReportData.getId());
|
|
|
- if (StringUtils.isNotBlank(old.getProcessInstanceId())){
|
|
|
- processInstanceId = old.getProcessInstanceId();
|
|
|
+ if (type == 1) {
|
|
|
+ //如果复核标准无需复核,则直接完成,无需进行审批
|
|
|
+ if ("0".equals(projectcontentinfo.getProjectReportData().getReviewStandard())) {
|
|
|
+ //直接完成
|
|
|
+ projectReportData.setStatus("5");
|
|
|
+ String num = projectReportData.getNumber();
|
|
|
+ if (StringUtils.isNotBlank(num)) {
|
|
|
+ projectReportNumService.updateNum(num);
|
|
|
}
|
|
|
+ projectReportDataService.save(projectReportData);
|
|
|
+ }else {
|
|
|
+ //暂存
|
|
|
+ projectReportData.setStatus("1");
|
|
|
+ String num = projectReportData.getNumber();
|
|
|
+ if (StringUtils.isNotBlank(num)) {
|
|
|
+ projectReportNumService.updateNum(num);
|
|
|
+ }
|
|
|
+ projectReportDataService.save(projectReportData);
|
|
|
}
|
|
|
- //获取项目信息
|
|
|
- ProjectRecords projectRecord = projectRecordsService.getMasters(projectcontentinfo.getProject().getId());
|
|
|
- projectcontentinfo.setProject(projectRecord);
|
|
|
- if (type == 2) {
|
|
|
- //启动流程
|
|
|
- String str = projectReportDataService.save(projectReportData, variables, processInstanceId, projectcontentinfo.getProject().getProjectLeaders());
|
|
|
- if (!str.equals("true")){
|
|
|
- return str;
|
|
|
+ } else {
|
|
|
+ //如果复核标准无需复核,则直接完成,无需进行审批
|
|
|
+ if ("0".equals(projectcontentinfo.getProjectReportData().getReviewStandard())) {
|
|
|
+ //直接完成
|
|
|
+ if (StringUtils.isNotBlank(projectReportData.getReportId())){
|
|
|
+ projectReportData.setId(projectReportData.getReportId());
|
|
|
+ projectReportData.setReportId(null);
|
|
|
+ }
|
|
|
+ projectReportData.setStatus("5");
|
|
|
+ String num = projectReportData.getNumber();
|
|
|
+ if (StringUtils.isNotBlank(num)) {
|
|
|
+ projectReportNumService.updateNum(num);
|
|
|
+ }
|
|
|
+ projectReportDataService.save(projectReportData);
|
|
|
+ }else{
|
|
|
+ //送审
|
|
|
+ Map<String, Object> variables = Maps.newHashMap();
|
|
|
+ projectReportData.setStatus("2");
|
|
|
+ String processInstanceId = "";
|
|
|
+ //判断是否存在撤回
|
|
|
+ if (StringUtils.isNotBlank(projectReportData.getId())) {
|
|
|
+ ProjectReportData old = projectReportDataService.get(projectReportData.getId());
|
|
|
+ if (StringUtils.isNotBlank(old.getProcessInstanceId())) {
|
|
|
+ processInstanceId = old.getProcessInstanceId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //获取项目信息
|
|
|
+ ProjectRecords projectRecord = projectRecordsService.getMasters(projectcontentinfo.getProject().getId());
|
|
|
+ projectcontentinfo.setProject(projectRecord);
|
|
|
+ if (type == 2) {
|
|
|
+ //如果复核标准无需复核,则直接完成,无需进行审批
|
|
|
+ if ("0".equals(projectcontentinfo.getProjectReportData().getReviewStandard())) {
|
|
|
+ //直接完成
|
|
|
+ projectReportData.setStatus("5");
|
|
|
+ String num = projectReportData.getNumber();
|
|
|
+ if (StringUtils.isNotBlank(num)) {
|
|
|
+ projectReportNumService.updateNum(num);
|
|
|
+ }
|
|
|
+ projectReportDataService.save(projectReportData);
|
|
|
+ }
|
|
|
+ //启动流程
|
|
|
+ String str = projectReportDataService.save(projectReportData, variables, processInstanceId, projectcontentinfo.getProject().getProjectLeaders());
|
|
|
+ if (!str.equals("true")) {
|
|
|
+ return str;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -940,8 +981,11 @@ public class ProjectcontentinfoService extends CrudService<ProjectcontentinfoDao
|
|
|
}
|
|
|
}
|
|
|
if (type==1){
|
|
|
- projectReportData.setStatus("1");
|
|
|
- projectReportChangeService.save(projectReportData);
|
|
|
+ //如果复核标准无需复核,则直接完成,无需进行审批
|
|
|
+ if (!"0".equals(projectcontentinfo.getProjectReportData().getReviewStandard())) {
|
|
|
+ projectReportData.setStatus("1");
|
|
|
+ projectReportChangeService.save(projectReportData);
|
|
|
+ }
|
|
|
}else {
|
|
|
Map<String, Object> variables = Maps.newHashMap();
|
|
|
projectReportData.setStatus("2");
|
|
@@ -958,9 +1002,12 @@ public class ProjectcontentinfoService extends CrudService<ProjectcontentinfoDao
|
|
|
projectReportData.setOfficeId(projectRecord.getOffice().getId());
|
|
|
}
|
|
|
if (type==2) {
|
|
|
- String str = projectReportChangeService.save(projectReportData, variables, processInstanceId, projectcontentinfo.getProject().getProjectLeaders());
|
|
|
- if (!str.equals("true")) {
|
|
|
- return false;
|
|
|
+ //如果复核标准无需复核,则直接完成,无需进行审批
|
|
|
+ if (!"0".equals(projectcontentinfo.getProjectReportData().getReviewStandard())) {
|
|
|
+ String str = projectReportChangeService.save(projectReportData, variables, processInstanceId, projectcontentinfo.getProject().getProjectLeaders());
|
|
|
+ if (!str.equals("true")) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -971,14 +1018,29 @@ public class ProjectcontentinfoService extends CrudService<ProjectcontentinfoDao
|
|
|
reportData.setBeforeCount(0);
|
|
|
projectReportChangeService.insert(reportData);
|
|
|
}
|
|
|
- reportData.setStatus("8");
|
|
|
- /*if ("3".equals(reportData.getFileStatus())){
|
|
|
- reportData.setFileStatus("1");
|
|
|
- }*/
|
|
|
- projectReportDataService.save(reportData);
|
|
|
ProjectReportRecord projectReportRecord = new ProjectReportRecord();
|
|
|
- projectReportRecord.setReport(reportData);
|
|
|
- projectReportRecord.setStatus("2");
|
|
|
+ //如果复核标准无需复核,则直接完成,无需进行审批
|
|
|
+ if ("0".equals(projectcontentinfo.getProjectReportData().getReviewStandard())) {
|
|
|
+ //直接完成
|
|
|
+ if (StringUtils.isNotBlank(projectReportData.getReportId())){
|
|
|
+ projectReportData.setId(projectReportData.getReportId());
|
|
|
+ projectReportData.setReportId(null);
|
|
|
+ }
|
|
|
+ projectReportData.setStatus("5");
|
|
|
+ String num = projectReportData.getNumber();
|
|
|
+ if (StringUtils.isNotBlank(num)) {
|
|
|
+ projectReportNumService.updateNum(num);
|
|
|
+ }
|
|
|
+ projectReportDataService.update(projectReportData);
|
|
|
+ projectReportRecord.setReport(projectReportData);
|
|
|
+ projectReportRecord.setStatus("5");
|
|
|
+ }else {
|
|
|
+ //变更修改
|
|
|
+ reportData.setStatus("8");
|
|
|
+ projectReportDataService.save(reportData);
|
|
|
+ projectReportRecord.setReport(reportData);
|
|
|
+ projectReportRecord.setStatus("2");
|
|
|
+ }
|
|
|
List<ProjectReportRecord> projectReportRecords = projectReportRecordService.findList(projectReportRecord);
|
|
|
if (projectReportRecords!=null && projectReportRecords.size()!=0){
|
|
|
for (ProjectReportRecord reportRecord:projectReportRecords){
|
|
@@ -1285,4 +1347,50 @@ public class ProjectcontentinfoService extends CrudService<ProjectcontentinfoDao
|
|
|
return filename;
|
|
|
}
|
|
|
|
|
|
+ public List<MainDictDetail> getAchievementTypeList(String achievementParentId){
|
|
|
+ String type = "achievement_type";
|
|
|
+ List<MainDictDetail> dictList=new ArrayList<>();
|
|
|
+ String comId=UserUtils.getSelectCompany().getId();
|
|
|
+ String branchId=UserUtils.getSelectBranchOffice();
|
|
|
+ MainDict mainDict = mainDictService.getIdByName(type);
|
|
|
+ try {
|
|
|
+ MainDictDetail mainDictDetail = new MainDictDetail();
|
|
|
+ if("1".equals(mainDict.getDictType())){
|
|
|
+ mainDictDetail.setBranchOffice(comId);
|
|
|
+ }else{
|
|
|
+ mainDictDetail.setBranchOffice(branchId);
|
|
|
+ }
|
|
|
+ mainDictDetail.setAchievementParentId(achievementParentId);
|
|
|
+ mainDictDetail.setType(type);
|
|
|
+ dictList = mainDictDetailDao.findAchievementParentIdList(mainDictDetail);
|
|
|
+ return dictList;
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println("获取业务字典失败!");
|
|
|
+ }
|
|
|
+ return dictList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<MainDictDetail> getReviewStandardList(String reviewStandardParentId){
|
|
|
+ String type = "reviewStandard";
|
|
|
+ List<MainDictDetail> dictList=new ArrayList<>();
|
|
|
+ String comId=UserUtils.getSelectCompany().getId();
|
|
|
+ String branchId=UserUtils.getSelectBranchOffice();
|
|
|
+ MainDict mainDict = mainDictService.getIdByName(type);
|
|
|
+ try {
|
|
|
+ MainDictDetail mainDictDetail = new MainDictDetail();
|
|
|
+ if("1".equals(mainDict.getDictType())){
|
|
|
+ mainDictDetail.setBranchOffice(comId);
|
|
|
+ }else{
|
|
|
+ mainDictDetail.setBranchOffice(branchId);
|
|
|
+ }
|
|
|
+ mainDictDetail.setReviewStandardParentId(reviewStandardParentId);
|
|
|
+ mainDictDetail.setType(type);
|
|
|
+ dictList = mainDictDetailDao.findReviewStandardParentIdList(mainDictDetail);
|
|
|
+ return dictList;
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println("获取业务字典失败!");
|
|
|
+ }
|
|
|
+ return dictList;
|
|
|
+ }
|
|
|
+
|
|
|
}
|