12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180 |
- /**
- * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
- */
- package com.jeeplus.modules.act.web;
- import java.io.InputStream;
- import java.io.UnsupportedEncodingException;
- import java.net.URLDecoder;
- import java.util.Date;
- import java.text.SimpleDateFormat;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import javax.servlet.ServletContext;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import com.jeeplus.common.json.AjaxJson;
- import com.jeeplus.common.utils.SpringContextHolder;
- import com.jeeplus.common.websocket.service.system.SystemInfoSocketHandler;
- import com.jeeplus.modules.act.service.ActModelService;
- import com.jeeplus.modules.oa.entity.OaNotify;
- import com.jeeplus.modules.oa.entity.OaNotifyRecord;
- import com.jeeplus.modules.oa.service.OaNotifyService;
- import com.jeeplus.modules.sg.managementcenter.activiti.entity.*;
- import com.jeeplus.modules.sg.managementcenter.activiti.service.ConstructionService;
- import com.jeeplus.modules.sg.managementcenter.activiti.service.DiscloseService;
- import com.jeeplus.modules.sg.managementcenter.activiti.service.ProcessPersonnelService;
- import com.jeeplus.modules.sg.managementcenter.activiti.service.UploadImagesService;
- import com.jeeplus.modules.sg.managementcenter.activiti.utils.MyActiviUtils;
- import com.jeeplus.modules.sg.managementcenter.constructionProject.entity.ConstructionProject;
- import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
- import com.jeeplus.modules.sg.managementcenter.materialproject.service.MaterialProjectService;
- import com.jeeplus.modules.sg.managementcenter.project.service.ProjectService;
- import com.jeeplus.modules.sg.materialmodule.activiti.entity.NonPower;
- import com.jeeplus.modules.sg.materialmodule.activiti.service.MaterialModuleService;
- import com.jeeplus.modules.sg.materialmodule.activiti.service.NonPowerService;
- import com.jeeplus.modules.sg.picking.activiti.entity.PickApplication;
- import com.jeeplus.modules.sg.picking.activiti.entity.ShowList;
- import com.jeeplus.modules.sg.picking.activiti.service.PickIngService;
- import com.jeeplus.modules.sg.settActivi.service.SettActiviService;
- import com.jeeplus.modules.sys.service.SystemService;
- import org.activiti.engine.HistoryService;
- import org.activiti.engine.RepositoryService;
- import org.activiti.engine.RuntimeService;
- import org.activiti.engine.TaskService;
- import org.activiti.engine.history.HistoricTaskInstance;
- import org.activiti.engine.impl.RepositoryServiceImpl;
- import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
- import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
- import org.activiti.engine.impl.pvm.PvmActivity;
- import org.activiti.engine.impl.pvm.PvmTransition;
- import org.activiti.engine.impl.pvm.process.ActivityImpl;
- import org.activiti.engine.impl.pvm.process.ProcessDefinitionImpl;
- import org.activiti.engine.impl.pvm.process.TransitionImpl;
- import org.activiti.engine.impl.task.TaskDefinition;
- import org.activiti.engine.runtime.ProcessInstance;
- import org.activiti.engine.task.Task;
- import org.apache.commons.lang3.StringUtils;
- import org.apache.ibatis.annotations.Param;
- import org.apache.shiro.authz.annotation.RequiresPermissions;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.ui.Model;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.ResponseBody;
- import com.jeeplus.core.persistence.Page;
- import com.jeeplus.core.web.BaseController;
- import com.jeeplus.modules.act.entity.Act;
- import com.jeeplus.modules.act.service.ActTaskService;
- import com.jeeplus.modules.act.utils.ActUtils;
- import com.jeeplus.modules.sys.utils.UserUtils;
- /**
- * 流程个人任务相关Controller
- *
- * @author jeeplus
- * @version 2016-11-03
- */
- @Controller
- @RequestMapping(value = "${adminPath}/act/task")
- public class ActTaskController extends BaseController {
- @Autowired
- private ActTaskService actTaskService;
- @Autowired
- private HistoryService historyService;
- @Autowired
- private RuntimeService runtimeService;
- @Autowired
- private RepositoryService repositoryService;
- @Autowired
- private TaskService taskService;
- @Autowired
- private ConstructionService constructionService;
- @Autowired
- private DiscloseService discloseService;
- @Autowired
- private UploadImagesService uploadImagesService;
- @Autowired
- private OaNotifyService oaNotifyService;
- @Autowired
- private NonPowerService nonPowerService;
- @Autowired
- private ProjectService projectService;
- @Autowired
- private ActModelService actModelService;
- @Autowired
- private PickIngService pickIngService;
- @Autowired
- private SystemService systemService;
- @Autowired
- private MaterialModuleService materialModuleService;
- @Autowired
- private SettActiviService settActiviService;
- @Autowired
- private MaterialProjectService materialProjectService;
- /**
- * 获取待办列表
- *
- * @return
- */
- @RequestMapping(value = {"todo", ""})
- public String todoList(Act act, HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {
- return "modules/bpm/task/todo/taskTodoList";
- }
- @ResponseBody
- @RequestMapping(value = "todo/data")
- public Map<String, Object> todoListData(Act act, HttpServletRequest request, HttpServletResponse response, Model model, String xmName) throws Exception {
- Page<HashMap<String, String>> page = actTaskService.todoList(new Page<HashMap<String, String>>(request, response), act);
- return getBootstrapData(page);
- /* Page<HashMap<String, String>> page = actTaskService.newTodoList(new Page<HashMap<String, String>>(request, response), act, xmName);
- Map<String, Object> map = new HashMap<String, Object>();
- return getBootstrapData(page);*/
- }
- /**
- * 获取已办任务
- *
- * @return
- */
- @RequestMapping(value = "historic")
- public String historicList(Act act, HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {
- return "modules/bpm/task/history/taskHistoricList";
- }
- @ResponseBody
- @RequestMapping(value = "historic/data")
- public Map<String, Object> historicListData(Act act, HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {
- Page<HashMap<String, String>> page = actTaskService.historicList(new Page<HashMap<String, String>>(request, response), act);
- return getBootstrapData(page);
- }
- /**
- * 获取我的申请列表
- *
- * @return
- */
- @RequestMapping(value = "myApplyed")
- public String myApplyedList(Act act, HttpServletResponse response, Model model) throws Exception {
- return "modules/bpm/task/apply/taskMyAppledList";
- }
- @ResponseBody
- @RequestMapping(value = "myApplyed/data")
- public Map<String, Object> myApplyedListData(Act act, HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {
- Page<HashMap> page = actTaskService.getMyStartedProcIns(UserUtils.getUser(), new Page<HashMap>(request, response));
- return getBootstrapData(page);
- }
- /**
- * 获取流转历史列表
- *
- * @param startAct 开始活动节点名称
- * @param endAct 结束活动节点名称
- */
- @RequestMapping(value = "histoicFlow")
- public String histoicFlow(Act act, String startAct, String endAct, Model model) {
- if (StringUtils.isNotBlank(act.getProcInsId())) {
- List<Act> histoicFlowList = actTaskService.histoicFlowList(act.getProcInsId(), startAct, endAct);
- model.addAttribute("histoicFlowList", histoicFlowList);
- }
- return "modules/bpm/task/history/taskHistoricFlow";
- }
- /**
- * 获取流程流向图
- *
- * @param startAct 开始活动节点名称
- * @param endAct 结束活动节点名称
- */
- @RequestMapping(value = "flowChart")
- public String flowChart(Act act, String startAct, String endAct, Model model) {
- if (StringUtils.isNotBlank(act.getProcInsId())) {
- List<Act> histoicFlowList = actTaskService.histoicFlowList(act.getProcInsId(), startAct, endAct);
- model.addAttribute("histoicFlowList", histoicFlowList);
- }
- return "modules/bpm/task/chart/taskFlowChart";
- }
- /**
- * 获取流程列表
- *
- * @param category 流程分类
- */
- @RequestMapping(value = "process")
- public String processList(String category, HttpServletRequest request, HttpServletResponse response, Model model) {
- Page<Object[]> page = new Page<Object[]>(request, response);
- model.addAttribute("category", category);
- return "modules/bpm/task/process/taskProcessList";
- }
- /**
- * 获取流程表单
- */
- @RequestMapping(value = "form")
- public String form(Act act, HttpServletRequest request, Model model) {
- // 获取流程XML上的表单KEY
- String formKey = actTaskService.getFormKey(act.getProcDefId(), act.getTaskDefKey());
- // 获取流程实例对象
- if (act.getProcInsId() != null) {
- if (actTaskService.getProcIns(act.getProcInsId()) != null) {
- try {
- act.setProcIns(actTaskService.getProcIns(act.getProcInsId()));
- } catch (Exception e) {
- e.printStackTrace();
- }
- } else {
- act.setFinishedProcIns(actTaskService.getFinishedProcIns(act.getProcInsId()));
- }
- if (actTaskService.isNextGatewaty(act.getProcInsId())) {
- act.setIsNextGatewaty(true);
- } else {
- act.setIsNextGatewaty(false);
- }
- }
- return "redirect:" + ActUtils.getFormUrl(formKey, act);
- }
- /**
- * 根据流程实例ID,获取当前节点的流程表单详情
- */
- @RequestMapping(value = "formDetail")
- public String formDetail(Act act, HttpServletRequest request, Model model) {
- // 获取流程XML上的表单KEY
- String taskDefKey = nextTaskDefinition(act.getProcInsId());
- String formKey = actTaskService.getFormKey(act.getProcDefId(), taskDefKey);
- // 获取流程实例对象
- if (act.getProcInsId() != null) {
- if (actTaskService.getProcIns(act.getProcInsId()) != null) {
- act.setProcIns(actTaskService.getProcIns(act.getProcInsId()));
- } else {
- act.setFinishedProcIns(actTaskService.getFinishedProcIns(act.getProcInsId()));
- }
- if (actTaskService.isNextGatewaty(act.getProcInsId())) {
- act.setIsNextGatewaty(true);
- } else {
- act.setIsNextGatewaty(false);
- }
- }
- return "redirect:" + ActUtils.getFormUrl(formKey, act);
- }
- /**
- * 启动流程
- */
- @RequestMapping(value = "start")
- @ResponseBody
- public String start(Act act, String table, String id, Model model) throws Exception {
- actTaskService.startProcess(act.getProcDefKey(), act.getBusinessId(), act.getBusinessTable(), act.getTitle());
- return "true";//adminPath + "/act/task";
- }
- /**
- * 签收任务
- */
- @RequestMapping(value = "claim")
- @ResponseBody
- public String claim(Act act) {
- String userId = UserUtils.getUser().getLoginName();//ObjectUtils.toString(UserUtils.getUser().getId());
- actTaskService.claim(act.getTaskId(), userId);
- return "true";//adminPath + "/act/task";
- }
- /**
- * 完成任务
- * vars.keys=flag,pass
- * vars.values=1,true
- * vars.types=S,B @see com.jeeplus.jeeplus.modules.act.utils.PropertyType
- */
- @RequestMapping(value = "complete")
- @ResponseBody
- public String complete(Act act) {
- actTaskService.complete(act.getTaskId(), act.getProcInsId(), act.getComment(), act.getVars().getVariableMap());
- return "true";//adminPath + "/act/task";
- }
- /**
- * 读取带跟踪的图片
- */
- @RequestMapping(value = "trace/photo/{procDefId}/{execId}")
- public void tracePhoto(@PathVariable("procDefId") String procDefId, @PathVariable("execId") String execId, HttpServletResponse response) throws Exception {
- InputStream imageStream = actTaskService.tracePhoto(procDefId, execId);
- // 输出资源内容到相应对象
- byte[] b = new byte[1024];
- int len;
- while ((len = imageStream.read(b, 0, 1024)) != -1) {
- response.getOutputStream().write(b, 0, len);
- }
- }
- /**
- * 输出跟踪流程信息
- *
- * @return
- * @throws Exception
- */
- @ResponseBody
- @RequestMapping(value = "trace/info/{proInsId}")
- public List<Map<String, Object>> traceInfo(@PathVariable("proInsId") String proInsId) throws Exception {
- List<Map<String, Object>> activityInfos = actTaskService.traceProcess(proInsId);
- return activityInfos;
- }
- /**
- * 显示流程图
- @RequestMapping(value = "processPic")
- public void processPic(String procDefId, HttpServletResponse response) throws Exception {
- ProcessDefinition procDef = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId).singleResult();
- String diagramResourceName = procDef.getDiagramResourceName();
- InputStream imageStream = repositoryService.getResourceAsStream(procDef.getDeploymentId(), diagramResourceName);
- byte[] b = new byte[1024];
- int len = -1;
- while ((len = imageStream.read(b, 0, 1024)) != -1) {
- response.getOutputStream().write(b, 0, len);
- }
- }*/
- /**
- * 获取跟踪信息
- @RequestMapping(value = "processMap")
- public String processMap(String procDefId, String proInstId, Model model)
- throws Exception {
- List<ActivityImpl> actImpls = new ArrayList<ActivityImpl>();
- ProcessDefinition processDefinition = repositoryService
- .createProcessDefinitionQuery().processDefinitionId(procDefId)
- .singleResult();
- ProcessDefinitionImpl pdImpl = (ProcessDefinitionImpl) processDefinition;
- String processDefinitionId = pdImpl.getId();// 流程标识
- ProcessDefinitionEntity def = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService)
- .getDeployedProcessDefinition(processDefinitionId);
- List<ActivityImpl> activitiList = def.getActivities();// 获得当前任务的所有节点
- List<String> activeActivityIds = runtimeService.getActiveActivityIds(proInstId);
- for (String activeId : activeActivityIds) {
- for (ActivityImpl activityImpl : activitiList) {
- String id = activityImpl.getId();
- if (activityImpl.isScope()) {
- if (activityImpl.getActivities().size() > 1) {
- List<ActivityImpl> subAcList = activityImpl
- .getActivities();
- for (ActivityImpl subActImpl : subAcList) {
- String subid = subActImpl.getId();
- System.out.println("subImpl:" + subid);
- if (activeId.equals(subid)) {// 获得执行到那个节点
- actImpls.add(subActImpl);
- break;
- }
- }
- }
- }
- if (activeId.equals(id)) {// 获得执行到那个节点
- actImpls.add(activityImpl);
- System.out.println(id);
- }
- }
- }
- model.addAttribute("procDefId", procDefId);
- model.addAttribute("proInstId", proInstId);
- model.addAttribute("actImpls", actImpls);
- return "modules/act/actTaskMap";
- }*/
- /**
- * 删除任务
- *
- * @param taskId 流程实例ID
- * @param reason 删除原因
- */
- @ResponseBody
- @RequiresPermissions("act:process:edit")
- @RequestMapping(value = "deleteTask")
- public AjaxJson deleteTask(String taskId, String reason) {
- AjaxJson j = new AjaxJson();
- if (StringUtils.isBlank(reason)) {
- j.setSuccess(false);
- j.setMsg("请填写删除原因");
- } else {
- actTaskService.deleteTask(taskId, reason);
- j.setSuccess(true);
- j.setMsg("删除任务成功,任务ID=" + taskId);
- }
- return j;
- }
- /**
- * 审批
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "audit")
- public AjaxJson auditTask(Act act) {
- AjaxJson j = new AjaxJson();
- actTaskService.auditSave(act);
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 经研所审批
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "economics")
- public AjaxJson economics(Act act, String pic, UploadImages uploadImages) {
- AjaxJson j = new AjaxJson();
- try {
- if (pic != null && !"".equals(pic)) {
- uploadImages.setPath(pic);
- // uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setImgName("上传新图纸");
- // uploadImages.setuId(UserUtils.getUser().getName());
- // Project user = MyActiviUtils.findUser(act.getProcInsId());
- // uploadImages.setProjectId(user.getId());
- // uploadImagesService.save(uploadImages);
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.economics(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 人工选择问题类型审批
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "artificialTask")
- public AjaxJson artificialTask(Act act, Construction construction) {
- AjaxJson j = new AjaxJson();
- try {
- constructionService.updateOIPI(construction);
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.artificialTask(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 交底:运行人员审核
- */
- @ResponseBody
- @RequestMapping(value = "humanReview")
- public AjaxJson humanReview(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.humanReview(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 导入材料表和拆旧物资表
- */
- @ResponseBody
- @RequestMapping(value = "importTable")
- public AjaxJson importTable(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.importTable(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 导入工程量
- */
- @ResponseBody
- @RequestMapping(value = "engineering")
- public AjaxJson engineering(Act act, Construction construction) {
- AjaxJson j = new AjaxJson();
- try {
- Construction construction1 = constructionService.get(construction);
- if (construction1.getQuantity() == null) {
- j.setSuccess(false);
- j.setMsg("请先导入工程量");
- return j;
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.engineering(act,construction1);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 政处是否自己进行
- */
- @ResponseBody
- @RequestMapping(value = "ruralOffice")
- public AjaxJson ruralOffice(Act act, Construction construction) {
- AjaxJson j = new AjaxJson();
- try {
- constructionService.updateIfSelf(construction);
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.ruralOffice(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 农村专职判断
- */
- @ResponseBody
- @RequestMapping(value = "ruralJudge")
- public AjaxJson ruralJudge(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.ruralJudge(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 农村上传文件
- */
- @ResponseBody
- @RequestMapping(value = "ruralFiles")
- public AjaxJson ruralFiles(Act act,String path,String path1, String reserveProjectName,Construction construction) {
- AjaxJson j = new AjaxJson();
- try {
- constructionService.updateIfBorrow(construction);
- if (path != null && !"".equals(path)) {
- UploadImages uploadImages = new UploadImages();
- uploadImages.setPath(path);
- uploadImages.setUid(UserUtils.getUser().getName());
- uploadImages.setImgName("22");
- uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setReserveProjectName(reserveProjectName);
- constructionService.uploadSave(uploadImages);
- }
- if (path1 != null && !"".equals(path1)) {
- UploadImages uploadImages = new UploadImages();
- uploadImages.setPath(path1);
- uploadImages.setUid(UserUtils.getUser().getName());
- uploadImages.setImgName("23");
- uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setReserveProjectName(reserveProjectName);
- constructionService.uploadSave(uploadImages);
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.ruralFiles(act,construction);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 交底:是否借款
- */
- @ResponseBody
- @RequestMapping(value = "divideForm")
- public AjaxJson divideForm(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- act.setComment(URLDecoder.decode(act.getComment(), "UTF-8"));
- actTaskService.divideForm(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 交底:是否借款
- */
- @ResponseBody
- @RequestMapping(value = "ruralLoan")
- public AjaxJson ruralLoan(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- act.setComment(URLDecoder.decode(act.getComment(), "UTF-8"));
- actTaskService.ruralLoan(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 交底:是否支付
- */
- @ResponseBody
- @RequestMapping(value = "ruralPays")
- public AjaxJson ruralPays(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- act.setComment(URLDecoder.decode(act.getComment(), "UTF-8"));
- actTaskService.ruralPays(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 是否可以政策处理(农场/民事)
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "policiesChange")
- public AjaxJson policiesChange(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.policiesChange(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 上传借款单据
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "loanUploadList")
- public AjaxJson loanUploadList(Act act, String pic, UploadImages uploadImages) {
- AjaxJson j = new AjaxJson();
- try {
- if (pic != null && pic != "") {
- uploadImages.setPath(pic);
- // uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setImgName("上传借款单据");
- // uploadImages.setuId(UserUtils.getUser().getName());
- // Project user = MyActiviUtils.findUser(act.getProcInsId());
- // uploadImages.setProjectId(user.getId());
- uploadImagesService.save(uploadImages);
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.loanUploadList(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 项目经理重新审核是否可以政策处理(农场/民事)
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "managerPolicesChange")
- public AjaxJson managerPolicesChange(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.managerPolicesChange(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 上传未签字版政策处理清单
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "notSignUpload")
- public AjaxJson notSignUpload(Act act, String pic, UploadImages uploadImages) {
- AjaxJson j = new AjaxJson();
- try {
- if (pic != null && pic != "") {
- uploadImages.setPath(pic);
- // uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setImgName("2");
- // uploadImages.setuId(UserUtils.getUser().getName());
- // Project user = MyActiviUtils.findUser(act.getProcInsId());
- // uploadImages.setProjectId(user.getId());
- uploadImagesService.save(uploadImages);
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.notSignUpload(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 上传签字版政策处理清单
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "signUploadList")
- public AjaxJson signUploadList(Act act, String pic, UploadImages uploadImages) {
- AjaxJson j = new AjaxJson();
- try {
- if (pic != null && pic != "") {
- uploadImages.setPath(pic);
- // uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setImgName("3");
- // uploadImages.setuId(UserUtils.getUser().getName());
- // Project user = MyActiviUtils.findUser(act.getProcInsId());
- // uploadImages.setProjectId(user.getId());
- uploadImagesService.save(uploadImages);
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.signUploadList(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 上传签字版合同
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "contractUploadList")
- public AjaxJson contractUploadList(Act act, String pic, UploadImages uploadImages) {
- AjaxJson j = new AjaxJson();
- try {
- if (pic != null && pic != "") {
- uploadImages.setPath(pic);
- // uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setImgName("4");
- // uploadImages.setuId(UserUtils.getUser().getName());
- // Project user = MyActiviUtils.findUser(act.getProcInsId());
- // uploadImages.setProjectId(user.getId());
- uploadImagesService.save(uploadImages);
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.contractUploadList(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 运行单位经理判定设计变更
- */
- @ResponseBody
- @RequestMapping(value = "operator")
- public AjaxJson operator(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.operator(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 项目经理判断是否需要设计变更
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "managerDesign")
- public AjaxJson managerDesign(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.managerDesign(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 运行单位经理审核方案
- */
- @ResponseBody
- @RequestMapping(value = "designUpload")
- public AjaxJson designUpload(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.designUpload(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 设计单位人员重新设计
- */
- @ResponseBody
- @RequestMapping(value = "operatorUpload")
- public AjaxJson operatorUpload(Act act, String path, String reserveProjectName) {
- AjaxJson j = new AjaxJson();
- try {
- if (path != null && !"".equals(path)) {
- UploadImages uploadImages = new UploadImages();
- uploadImages.setPath(path);
- uploadImages.setUid(UserUtils.getUser().getName());
- uploadImages.setImgName("1");
- uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setReserveProjectName(reserveProjectName);
- constructionService.uploadSave(uploadImages);
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.operatorUpload(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 运行经理审核设计变更后
- */
- @ResponseBody
- @RequestMapping(value = "managerUpload")
- public AjaxJson managerUpload(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.managerUpload(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 配网经理审核设计变更后
- */
- @ResponseBody
- @RequestMapping(value = "afterDistribution")
- public AjaxJson afterDistribution(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.afterDistribution(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 施工单位判断变更后材料
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "conAfterChange")
- public AjaxJson conAfterChange(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.conAfterChange(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 施工审批
- */
- @ResponseBody
- @RequestMapping(value = "audit2")
- public AjaxJson auditTask2(Act act, Construction construction) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- if ("no".equals(act.getFlag())) {
- int byProcInsId = discloseService.findByProcInsId(act.getProcInsId());
- if (byProcInsId <= 0) {
- construction.preInsert();
- discloseService.insertDiscloseRole(construction);
- } else {
- discloseService.updateDiscloseByProcInsId(construction);
- }
- }
- actTaskService.auditSave2(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 项目经理组织交底
- *
- * @param
- */
- @ResponseBody
- @RequestMapping(value = "audit3")
- public AjaxJson auditTask3(Act act) {
- AjaxJson j = new AjaxJson();
- String s = "";
- // MyNeedList 项目经理组织交底 = MyActiviUtils.findActivity("项目经理组织交底");
- boolean flag = false;
- Disclose dc = new Disclose();
- /* dc.setProcInsId(act.getProcInsId());
- Disclose disclose = discloseService.get(dc);
- if (null == disclose) {
- j.setSuccess(false);
- j.setMsg("请导入数据");
- return j;
- }
- Boolean flagDesign = actTaskService.isJudgeDesign(disclose);//设计变更
- Boolean flagItemCLose = actTaskService.isJudgeItemClose(disclose);//项目关闭
- String flagDeal = actTaskService.newJudgeDeal(disclose);
- if (null == disclose.getPrecondition() || "".equals(disclose.getPrecondition())) {
- if (flagItemCLose) {
- if (null == disclose.getExplanationOfNecessity() || disclose.getExplanationOfNecessity().equals("")) {
- s = "必要性问题说明不能为空!";
- flag = true;
- }
- }
- if (flagDesign) {
- if (null == disclose.getInconsistentDescription() || disclose.getInconsistentDescription().equals("")) {
- s += "图纸现场不一致说明不能为空!";
- flag = true;
- }
- }
- if ("民事农村".equals(flagDeal) || "行政".equals(flagDeal)) {
- String policyHandlingInstructions = disclose.getPolicyHandlingInstructions();
- if (policyHandlingInstructions == null || "".equals(policyHandlingInstructions)) {
- s += "政策处理说明不能为空";
- flag = true;
- }
- }
- if (null == disclose.getPolicyHandlingInstructions() || disclose.getPolicyHandlingInstructions().equals("")) {
- s += " 政策处理说明不能为空!";
- flag = true;
- }
- if (flag) {
- j.setSuccess(false);
- j.setMsg(s);
- return j;
- }
- }
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.auditSave3(act, disclose, flagDesign, flagItemCLose, flagDeal);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }*/
- j.setMsg("审批成功");
- return j;
- }
- /*
- 交底:判断项目是否需要关闭
- */
- @ResponseBody
- @RequestMapping(value = "speciallyTask")
- public AjaxJson speciallyTask(Act act, String tuser, Construction construction) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.specially(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- if ("yes".equals(act.getFlag())) {
- j.setMsg("审批成功");
- } else {
- j.setMsg("驳回成功");
- }
- return j;
- }
- /*
- 项目关闭:项目经理
- */
- @ResponseBody
- @RequestMapping(value = "managerFormTask")
- public AjaxJson managerFormTask(Act act, String fullName, String tuser, Construction construction) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.managerFormTask(act, fullName);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- if ("yes".equals(act.getFlag())) {
- j.setMsg("审批成功");
- } else {
- j.setMsg("驳回成功");
- }
- return j;
- }
- /*
- 项目关闭:运行人员
- */
- @ResponseBody
- @RequestMapping(value = "memberTask")
- public AjaxJson memberTask(Act act, String fullTime, String tuser, Construction construction) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.addMember(act, fullTime);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- if ("yes".equals(act.getFlag())) {
- j.setMsg("审批成功");
- } else {
- j.setMsg("驳回成功");
- }
- return j;
- }
- /*
- 项目关闭:系统专职
- */
- @ResponseBody
- @RequestMapping(value = "departmentTask")
- public AjaxJson departmentTask(Act act, String tuser, Construction construction) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.addDepartment(act);
- // projectService.updateStatusBy("0", act.getProcInsId());
- // projectService.updateStatusByClose("1", act.getProcInsId());
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- // Project user = MyActiviUtils.findUser(act.getProcInsId());
- // User user1 = UserUtils.getByUserName(user.getProjectManageRole());
- OaNotify oaNotify = new OaNotify();
- oaNotify.setType("4");
- oaNotify.setTitle("施工交底结束(项目关闭)");
- oaNotify.setContent("项目为:[" + construction.getProjectName() + "]的项目已经施工交底完成");
- oaNotify.setStatus("1");
- // oaNotify.setOaNotifyRecordIds(user1.getId());
- oaNotifyService.save(oaNotify);
- List<OaNotifyRecord> list = oaNotify.getOaNotifyRecordList();
- for (OaNotifyRecord o : list) {
- //发送通知到客户端
- ServletContext context = SpringContextHolder
- .getBean(ServletContext.class);
- new SystemInfoSocketHandler().sendMessageToUser(UserUtils.get(o.getUser().getId()).getLoginName(), "收到一条新通知,请到我的通知查看!");
- }
- // j.setMsg("审批成功;已经通知" + user.getProjectManageRole());
- return j;
- }
- @ResponseBody
- @RequestMapping(value = "policiesDealTask")
- public AjaxJson policiesDealTask(Act act, String fullName, String tuser, Construction construction) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.policiesDeal(act, fullName);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- if ("yes".equals(act.getFlag())) {
- j.setMsg("审批成功");
- } else {
- j.setMsg("驳回成功");
- }
- return j;
- }
- /***
- * 项目经理判定是否关闭
- * */
- @ResponseBody
- @RequestMapping(value = "coveredForm")
- public AjaxJson coveredForm(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.coveredForm(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 配网工程专职判定是否关闭
- */
- @ResponseBody
- @RequestMapping(value = "sealForm")
- public AjaxJson sealForm(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.sealForm(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- @ResponseBody
- @RequestMapping(value = "phaseManagerTask")
- public AjaxJson phaseManagerTask(Act act, String fullName) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.phaseManager(act, fullName);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- if ("yes".equals(act.getFlag())) {
- j.setMsg("审批成功");
- } else {
- j.setMsg("驳回成功");
- }
- return j;
- }
- /*
- 政策处理:配网政策处理专职 : 上传收据
- */
- @ResponseBody
- @RequestMapping(value = "receiptForm")
- public AjaxJson receiptForm(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.receiptForm(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- if ("yes".equals(act.getFlag())) {
- j.setMsg("审批成功");
- } else {
- j.setMsg("驳回成功");
- }
- return j;
- }
- /**
- * 配网工程专职判定变更或关闭
- * */
- @ResponseBody
- @RequestMapping(value = "singleForm")
- public AjaxJson singleForm(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.singleForm(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 配网项目经理判定变更或关闭
- * */
- @ResponseBody
- @RequestMapping(value = "documentsForm")
- public AjaxJson documentsForm(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.documentsForm(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 配网系统专职确认系统关闭
- * */
- @ResponseBody
- @RequestMapping(value = "confirmClose")
- public AjaxJson confirmClose(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.confirmClose(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 施工交底审批
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "newAudit")
- public AjaxJson newAuditTask(Act act, String tuser, Construction construction) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.newAuditSave(act, tuser, construction);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 取回流程
- *
- * @param taskId
- */
- @ResponseBody
- @RequestMapping(value = "callback")
- public AjaxJson callback(@Param("taskId") String taskId) {
- AjaxJson j = new AjaxJson();
- try {
- Map<String, Object> variables;
- // 取得当前任务
- HistoricTaskInstance currTask = historyService
- .createHistoricTaskInstanceQuery().taskId(taskId)
- .singleResult();
- // 取得流程实例
- ProcessInstance instance = runtimeService
- .createProcessInstanceQuery()
- .processInstanceId(currTask.getProcessInstanceId())
- .singleResult();
- if (instance == null) {
- j.setSuccess(false);
- j.setMsg("流程已经结束");
- return j;
- }
- variables = instance.getProcessVariables();
- // 取得流程定义
- ProcessDefinitionEntity definition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService)
- .getDeployedProcessDefinition(currTask
- .getProcessDefinitionId());
- if (definition == null) {
- j.setSuccess(false);
- j.setMsg("流程定义未找到");
- return j;
- }
- // 取得下一步活动
- ActivityImpl currActivity = ((ProcessDefinitionImpl) definition)
- .findActivity(currTask.getTaskDefinitionKey());
- List<PvmTransition> nextTransitionList = currActivity
- .getOutgoingTransitions();
- for (PvmTransition nextTransition : nextTransitionList) {
- PvmActivity nextActivity = nextTransition.getDestination();
- List<HistoricTaskInstance> completeTasks = historyService
- .createHistoricTaskInstanceQuery()
- .processInstanceId(instance.getId())
- .taskDefinitionKey(nextActivity.getId()).finished()
- .list();
- int finished = completeTasks.size();
- if (finished > 0) {
- j.setSuccess(false);
- j.setMsg("存在已经完成的下一步,流程不能取回");
- return j;
- }
- List<Task> nextTasks = taskService.createTaskQuery().processInstanceId(instance.getId())
- .taskDefinitionKey(nextActivity.getId()).list();
- for (Task nextTask : nextTasks) {
- //取活动,清除活动方向
- List<PvmTransition> oriPvmTransitionList = new ArrayList<PvmTransition>();
- List<PvmTransition> pvmTransitionList = nextActivity
- .getOutgoingTransitions();
- for (PvmTransition pvmTransition : pvmTransitionList) {
- oriPvmTransitionList.add(pvmTransition);
- }
- pvmTransitionList.clear();
- //建立新方向
- ActivityImpl nextActivityImpl = ((ProcessDefinitionImpl) definition)
- .findActivity(nextTask.getTaskDefinitionKey());
- TransitionImpl newTransition = nextActivityImpl
- .createOutgoingTransition();
- newTransition.setDestination(currActivity);
- //完成任务
- taskService.complete(nextTask.getId(), variables);
- historyService.deleteHistoricTaskInstance(nextTask.getId());
- //恢复方向
- currActivity.getIncomingTransitions().remove(newTransition);
- List<PvmTransition> pvmTList = nextActivity
- .getOutgoingTransitions();
- pvmTList.clear();
- for (PvmTransition pvmTransition : oriPvmTransitionList) {
- pvmTransitionList.add(pvmTransition);
- }
- }
- }
- historyService.deleteHistoricTaskInstance(currTask.getId());
- j.setSuccess(true);
- j.setMsg("取回成功");
- return j;
- } catch (Exception e) {
- j.setSuccess(false);
- j.setMsg("流程取回失败,未知错误.");
- return j;
- }
- }
- /**
- * 根据实例编号查找下一个任务节点
- *
- * @param procInstId :实例编号
- * @return
- */
- public String nextTaskDefinition(String procInstId) {
- //流程标示
- String processDefinitionId = historyService.createHistoricProcessInstanceQuery().processInstanceId(procInstId).singleResult().getProcessDefinitionId();
- ProcessDefinitionEntity def = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService).getDeployedProcessDefinition(processDefinitionId);
- //执行实例
- ExecutionEntity execution = (ExecutionEntity) runtimeService.createProcessInstanceQuery().processInstanceId(procInstId).singleResult();
- //当前实例的执行到哪个节点
- if (execution == null) {
- TaskDefinition[] taskDefinitions = {};
- taskDefinitions = def.getTaskDefinitions().values().toArray(taskDefinitions);
- return taskDefinitions[taskDefinitions.length - 1].getKey();
- } else {
- return execution.getActivityId();
- }
- }
- @ResponseBody
- @RequestMapping(value = "pickIng")
- public AjaxJson pickIng(Act act, String selectNumber) {
- AjaxJson j = new AjaxJson();
- try {
- pickIngService.updateSelectNumber(selectNumber, act.getProcInsId());
- List<ShowList> showLists = MyActiviUtils.finaList(selectNumber);
- for (ShowList a : showLists) {
- a.preInsert();
- a.setProcInsId(act.getProcInsId());
- }
- pickIngService.delAllTem();
- pickIngService.processTemList(showLists);
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.pickIng(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- //开具设计清单
- @ResponseBody
- @RequestMapping(value = "materialReport")
- public AjaxJson materialReport(Act act, String selectNumber,String reserveName) {
- AjaxJson j = new AjaxJson();
- try {
- if (null!=reserveName&&reserveName!=""){
- MaterialProject materialProject = new MaterialProject();
- materialProject.setReserveProjectName(reserveName);
- List<MaterialProject> list = materialProjectService.findJugdeReserve(materialProject);
- if (list.size() > 0){
- j.setMsg("项目名称已存在");
- j.setSuccess(false);
- return j;
- }
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.materialReport(act,selectNumber,reserveName);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- //审核材料清单
- @ResponseBody
- @RequestMapping(value = "materialReportBillOff")
- public AjaxJson materialReportBillOff(Act act, String selectNumber,String reserveName) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- Boolean aBoolean = actTaskService.materialReportBillOff(act);
- if (aBoolean){
- j.setSuccess(false);
- j.setMsg("项目名称已存在,请联系流程发起人");
- return j;
- }
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 审批
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "constructionLeader")
- public AjaxJson constructionLeader(Act act) {
- AjaxJson j = new AjaxJson();
- actTaskService.constructionLeader(act);
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 施工单位物资专职审核
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "fullExamine")
- public AjaxJson fullExamine(Act act) {
- AjaxJson j = new AjaxJson();
- actTaskService.fullExamine(act);
- j.setMsg("审批成功");
- return j;
- }
- @ResponseBody
- @RequestMapping(value = "managerExam")
- public AjaxJson managerExam(Act act) {
- AjaxJson j = new AjaxJson();
- actTaskService.managerExam(act);
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 项目中心领导审核领料单
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "leaderExamine")
- public AjaxJson leaderExamine(Act act) {
- AjaxJson j = new AjaxJson();
- actTaskService.leaderExamine(act);
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 项目中心领导审核领料单
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "leaderExamine1")
- public AjaxJson leaderExamine1(Act act) {
- AjaxJson j = new AjaxJson();
- actTaskService.leaderExamine(act);
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 配网项目经理审核领料单
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "managerAudit")
- public AjaxJson managerAudit(Act act) {
- AjaxJson j = new AjaxJson();
- actTaskService.managerAudit(act);
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 配网物资专职审核领料单
- *
- * @param act
- */
- @ResponseBody
- @RequestMapping(value = "netExamine")
- public AjaxJson netExamine(Act act) {
- AjaxJson j = new AjaxJson();
- actTaskService.netExamine(act);
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 结算填写现场使用量
- */
- @ResponseBody
- @RequestMapping(value = "useQuantityTask")
- public AjaxJson useQuantityTask(Act act) {
- AjaxJson j = new AjaxJson();
- actTaskService.useQuantity(act);
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 复合数量修改
- */
- @ResponseBody
- @RequestMapping(value = "reviewQuantityTask")
- public AjaxJson reviewQuantityTask(Act act, String pic, UploadImages uploadImages) {
- AjaxJson j = new AjaxJson();
- if (pic != null && pic != "") {
- uploadImages.setPath(pic);
- // uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setImgName("21");
- // uploadImages.setuId(UserUtils.getUser().getName());
- // Project user = MyActiviUtils.findJSUser(act.getProcInsId());
- // uploadImages.setProjectId(user.getId());
- uploadImagesService.save(uploadImages);
- }
- actTaskService.reviewQuantity(act);
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 结束流程,完成结算
- */
- @ResponseBody
- @RequestMapping(value = "returnDocTask")
- public AjaxJson returnDocTask(Act act) {
- AjaxJson j = new AjaxJson();
- settActiviService.finSetStatus(act.getProcInsId());
- actTaskService.returnDoc(act);
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 经研所判定是否设计变更
- */
- @ResponseBody
- @RequestMapping(value = "auditDrawings")
- public AjaxJson auditDrawings(Act act, String path, String reserveProjectName) {
- AjaxJson j = new AjaxJson();
- try {
- if (path != null && !"".equals(path)) {
- UploadImages uploadImages = new UploadImages();
- uploadImages.setPath(path);
- uploadImages.setUid(UserUtils.getUser().getName());
- uploadImages.setImgName("1");
- uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setReserveProjectName(reserveProjectName);
- constructionService.uploadSave(uploadImages);
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.auditDrawings(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 项目经理审核流程提前领料是否通过
- */
- @ResponseBody
- @RequestMapping(value = "applicationAudit")
- public AjaxJson applicationAudit(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.applicationAudit(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 项目经理审核流程提前施工
- */
- @ResponseBody
- @RequestMapping(value = "contructionManager")
- public AjaxJson contructionManager(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.contructionManager(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 施工单位项目经理土建开工报告填写
- */
- @ResponseBody
- @RequestMapping(value = "nonPowerStartTask")
- public AjaxJson nonPowerStartTask(Act act, NonPower nonPower) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- //修改土建开工报告信息
- act = nonPower.getAct();
- nonPowerService.updateStart(nonPower);
- actTaskService.nonPowerStartTask(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 施工单位项目经理电气开工流程提交文件
- */
- @ResponseBody
- @RequestMapping(value = "electricalStartTask")
- public AjaxJson electricalStartTask(Act act, String pic, UploadImages uploadImages) {
- AjaxJson j = new AjaxJson();
- try {
- if (pic != null && pic != "") {
- uploadImages.setPath(pic);
- // uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setImgName("14");
- // uploadImages.setuId(UserUtils.getUser().getName());
- // Project user = MyActiviUtils.sgFindUser(act.getProcInsId());
- // uploadImages.setProjectId(user.getId());
- uploadImagesService.save(uploadImages);
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.electricalStartTask(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 施工单位项目经理土建施工中流程提交文件
- */
- @ResponseBody
- @RequestMapping(value = "nonPowerMiddleTask")
- public AjaxJson nonPowerMiddleTask(Act act, String pic, UploadImages uploadImages) {
- AjaxJson j = new AjaxJson();
- try {
- if (pic != null && pic != "") {
- uploadImages.setPath(pic);
- // uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setImgName("12");
- // uploadImages.setuId(UserUtils.getUser().getName());
- // Project user = MyActiviUtils.sgFindUser(act.getProcInsId());
- // uploadImages.setProjectId(user.getId());
- uploadImagesService.save(uploadImages);
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.nonPowerMiddleTask(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 施工单位项目经理电气施工中流程提交文件
- */
- @ResponseBody
- @RequestMapping(value = "electricalMiddleTask")
- public AjaxJson electricalMiddleTask(Act act, String pic, UploadImages uploadImages) {
- AjaxJson j = new AjaxJson();
- try {
- if (pic != null && pic != "") {
- uploadImages.setPath(pic);
- // Project project1 = MyActiviUtils.sgFindUser(act.getProcInsId());
- // project1.getId();
- // uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setImgName("15");
- // uploadImages.setuId(UserUtils.getUser().getName());
- // Project user = MyActiviUtils.sgFindUser(act.getProcInsId());
- // uploadImages.setProjectId(user.getId());
- uploadImagesService.save(uploadImages);
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.electricalMiddleTask(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 审核土建施工流程
- */
- @ResponseBody
- @RequestMapping(value = "nonRePowerMiddleTask")
- public AjaxJson nonRePowerMiddleTask(Act act) {
- AjaxJson j = new AjaxJson();
- String comment = null;
- try {
- comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.nonRePowerMiddleTask(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 审核土建竣工流程
- */
- @ResponseBody
- @RequestMapping(value = "nonRePowerEndTask")
- public AjaxJson nonRePowerEndTask(Act act) {
- AjaxJson j = new AjaxJson();
- String comment = null;
- try {
- comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.nonRePowerEndTask(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 审核土建竣工流程
- */
- @ResponseBody
- @RequestMapping(value = "rePowerEnd")
- public AjaxJson rePowerEnd(Act act) {
- AjaxJson j = new AjaxJson();
- String comment = null;
- try {
- comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.rePowerEnd(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 电气竣工流程
- */
- @ResponseBody
- @RequestMapping(value = "electricalEndTask")
- public AjaxJson electricalEndTask(Act act, String pic, UploadImages uploadImages) {
- AjaxJson j = new AjaxJson();
- try {
- if (pic != null && pic != "") {
- uploadImages.setPath(pic);
- // uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setImgName("16");
- // uploadImages.setuId(UserUtils.getUser().getName());
- // Project user = MyActiviUtils.sgFindUser(act.getProcInsId());
- // uploadImages.setProjectId(user.getId());
- uploadImagesService.save(uploadImages);
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.electricalEndTask(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 审核电气施工中流程
- */
- @ResponseBody
- @RequestMapping(value = "reElectricalMiddleTask")
- public AjaxJson reElectricalMiddleTask(Act act) {
- AjaxJson j = new AjaxJson();
- String comment = null;
- try {
- comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.reElectricalMiddleTask(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 审核电气竣工流程
- */
- @ResponseBody
- @RequestMapping(value = "reElectricalEndTask")
- public AjaxJson reElectricalEndTask(Act act) {
- AjaxJson j = new AjaxJson();
- String comment = null;
- try {
- comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.reElectricalEndTask(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 土建竣工流程
- */
- @ResponseBody
- @RequestMapping(value = "nonPowerEndTask")
- public AjaxJson nonPowerEndTask(Act act, NonPower nonPower) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- nonPowerService.updateEnd(nonPower);
- actTaskService.nonPowerEndTask(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 配网项目经理判断是否完成土建
- */
- @ResponseBody
- @RequestMapping(value = "reviewNonPower")
- public AjaxJson reviewNonPower(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- //设置土建完成
- materialModuleService.updateNonPower(act.getProcInsId());
- actTaskService.reviewNonPower(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 配网项目经理判断是否完成电气
- */
- @ResponseBody
- @RequestMapping(value = "reviewElectrical")
- public AjaxJson reviewElectrical(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- //设置土建完成
- materialModuleService.updateElectrical(act.getProcInsId());
- actTaskService.reviewElectrical(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 施工单位项目经理判断是否包含涉电工作
- */
- @ResponseBody
- @RequestMapping(value = "managerWhetherTask")
- public AjaxJson managerWhetherTask(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.managerWhetherTask(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 施工单位项目经理上传涉电项目开工流程工作
- */
- @ResponseBody
- @RequestMapping(value = "PowerStartTask")
- public AjaxJson PowerStartTask(Act act, String pic, String imgName, UploadImages uploadImages) {
- AjaxJson j = new AjaxJson();
- try {
- //获取当前的流程实例id
- String procInsId = act.getProcInsId();
- //根据项目信息查询计划开工日期
- String projectName = materialModuleService.findProjectName(procInsId);
- Date specificTime = materialModuleService.findSpecificTime(projectName);
- // Project project1 = MyActiviUtils.sgFindUser(procInsId);
- // String[] needUser = {project1.getConstructionUnitManage()};
- // List<String> listUserId = MyActiviUtils.getListUserId(needUser);
- // List<String> userId = materialModuleService.findUserId(listUserId);
- // String stringJoiningTogether = MyActiviUtils.getStringJoiningTogether(userId);
- OaNotify oaNotify = new OaNotify();
- oaNotify.setType("4");
- oaNotify.setTitle("施工验收流程项目计划信息");
- oaNotify.setStatus("1");
- // oaNotify.setOaNotifyRecordIds(stringJoiningTogether);
- if (specificTime == null) {
- //根据流程实例id查询对应的项目信息(如果没有,发送通知,没有该项目计划信息)
- oaNotify.setContent(projectName + ":项目没有对应的计划信息");
- oaNotifyService.save(oaNotify);
- List<OaNotifyRecord> list = oaNotify.getOaNotifyRecordList();
- for (OaNotifyRecord o : list) {
- //发送通知到客户端
- ServletContext context = SpringContextHolder.getBean(ServletContext.class);
- new SystemInfoSocketHandler().sendMessageToUser(UserUtils.get(o.getUser().getId()).getLoginName(), "收到一条新通知,请到我的通知查看!");
- }
- } else {
- //将计划赶工日期与当前时间比对(则将不符情况以通知形式发送)
- SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMdd");
- boolean timeFlag = fmt.format(specificTime).equals(fmt.format(new Date()));
- if (timeFlag == false) {
- oaNotify.setContent(projectName + ":计划时间与实际时间不符");
- oaNotifyService.save(oaNotify);
- List<OaNotifyRecord> list = oaNotify.getOaNotifyRecordList();
- for (OaNotifyRecord o : list) {
- //发送通知到客户端
- ServletContext context = SpringContextHolder.getBean(ServletContext.class);
- new SystemInfoSocketHandler().sendMessageToUser(UserUtils.get(o.getUser().getId()).getLoginName(), "收到一条新通知,请到我的通知查看!");
- }
- }
- }
- if (pic != null && pic != "") {
- uploadImages.setPath(pic);
- // uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setImgName("17");
- // uploadImages.setuId(UserUtils.getUser().getName());
- // Project user = MyActiviUtils.sgFindUser(act.getProcInsId());
- // uploadImages.setProjectId(user.getId());
- uploadImagesService.save(uploadImages);
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.PowerStartTask(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 施工单位项目经理上传涉电项目竣工流程工作
- */
- @ResponseBody
- @RequestMapping(value = "PowerEndTask")
- public AjaxJson PowerEndTask(Act act, String pic, UploadImages uploadImages) {
- AjaxJson j = new AjaxJson();
- try {
- if (pic != null && pic != "") {
- uploadImages.setPath(pic);
- // uploadImages.setProcInsId(act.getProcInsId());
- uploadImages.setImgName("18");
- // uploadImages.setuId(UserUtils.getUser().getName());
- // Project user = MyActiviUtils.sgFindUser(act.getProcInsId());
- // uploadImages.setProjectId(user.getId());
- uploadImagesService.save(uploadImages);
- }
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.PowerEndTask(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- /**
- * 配网项目经理判断涉电工作
- */
- @ResponseBody
- @RequestMapping(value = "PowerWhetherTask")
- public AjaxJson PowerWhetherTask(Act act) {
- AjaxJson j = new AjaxJson();
- try {
- //对项目选择二次涉电的时候
- String flag = act.getFlag();
- if ("second".equals(flag)) {
- //获取项目定义号,查询项目信息
- String projectName = materialModuleService.findProjectName(act.getProcInsId());
- ConstructionProject project = materialModuleService.findProject(projectName);
- if (project == null) {
- //没有,不允许发起二次涉电
- j.setSuccess(false);
- j.setMsg("没有该项目的计划信息,无法发起二次涉电");
- return j;
- } else {
- //如果有,记录数据,保存数据在项目名称后加入二次涉电插入项目库
- String projectName1 = project.getProjectName();
- project.setProjectName(projectName1 + "二次涉电");
- project.setProjectStatus("0");
- materialModuleService.conProject(project);
- }
- }
- materialModuleService.updatePower(act.getProcInsId());
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
- act.setComment(comment);
- actTaskService.PowerWhetherTask(act);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- j.setMsg("审批成功");
- return j;
- }
- }
|