소스 검색

批示留言增加暂存、撤回功能。完成

wanyuan 9 달 전
부모
커밋
fb5bda510a

+ 15 - 2
tip-front/src/main/java/com/minto/app/task/controller/TaskByTypeController.java

@@ -7954,8 +7954,21 @@ public class TaskByTypeController extends BaseController{
             Long departmentId = AppContext.currentDepartmentId();
             //暂存信息
             model.put("pid", pid);
-            model.put("tempProcess", taskManager.findTaskProcessTempByTaskAndPerson(taskId, pid));
-
+            TaskProcessSummaryTempBean tmep = taskManager.findTaskProcessTempByTaskAndPerson(taskId, pid);
+            if(tmep != null && StringUtil.isNotEmpty(tmep.getData())){
+                Map<String, Object> tempData = JsonUtil.parseObject(tmep.getData());
+                model.put("tempOpinion", tempData.get("opinion"));
+                if(tempData.get("attachment") != null){
+                    List<String> fileStrs = JsonUtil.parseArray(JsonUtil.toJSONString(tempData.get("attachment")),String.class);
+                    List<Long> fileIds = fileStrs.stream().map(e->{
+                        int index = e.indexOf("*");
+                        String s = index<0?e:e.substring(0,index);
+                        return Long.valueOf(s);
+                    }).collect(Collectors.toList());
+                    List<SpaceFileBean> files = spaceManager.findSpaceFileBeans(fileIds);
+                    model.put("tempAttachment", JsonUtil.toJSONString(files));
+                }
+            }
             //设置查看标记 by zhangyu 2018-5-18
             TaskSummaryBean summary = taskManager.findTaskSummaryBeanById(taskId);
             String roles = orgManager.findAllRolesByPid(pid);

+ 32 - 6
tip-front/src/main/webapp/tc_suite/taskmt/taskMessageList.jsp

@@ -988,6 +988,8 @@
 <script type="text/javascript" src="${path}/tc_ttp/common/function.js${resSuffix}"></script>
 <script type="text/javascript" src="${path}/common/mCustomScrollbar/js/jquery.mCustomScrollbar.concat.min.js${resSuffix}"></script>
 <script type="application/javascript">
+    var tempOpinion = '${tempOpinion}';
+    var tempAttachment = '${tempAttachment}';
     $("#gdDiv").mCustomScrollbar({
         autoHideScrollbar:true,
         axis:"y"
@@ -1013,6 +1015,21 @@
                 $(this).hide();
             });
         }
+        //重写暂存
+        debugger;
+        if(tempOpinion){
+            $("#processForm2").find("#messageDiv2").find("#opinion2:first").val(tempOpinion);
+            showSize();
+        }
+        if(tempAttachment){
+            var attachmentArray = JSON.parse(tempAttachment);
+            var fileDiv = $("#processForm2").find("#messageDiv2").find("div[addFiles=addFiles]:first");
+            for(var i = 0; i < attachmentArray.length; i++){
+                attachmentArray[i].resouceType = 10020001;
+                addFileHtml(attachmentArray[i]);
+                //addFileHtml(attachmentArray[i], fileDiv);
+            }
+        }
     });
     window.onload = function () {
         var fileLi = $(".mt-fileLi");
@@ -1887,7 +1904,7 @@
                 type: "POST",
                 url: url,
                 async: true,
-                data: {data:data},
+                data: {data:JSON.stringify(data)},
                 dataType: "JSON",
                 traditional: true,
                 success: function (result) {
@@ -1921,6 +1938,7 @@
                 var fileResult = result.fileResult;
                 for(var i = 0; i < fileResult.length; i++) {
                     var file = fileResult[i];
+                    debugger;
                     addFileHtml(file);
                 }
             }});
@@ -1929,13 +1947,21 @@
     function serialize(obj){
         var o ={};
         $.each(obj,function(){
-            if(o[this.name]){
-                if(!o[this.name].push){
-                    o[this.name]=[o[this.name]];
+            debugger;
+            if("attachment" === this.name){
+                if(!o[this.name]){
+                    o[this.name] = [];
                 }
                 o[this.name].push(this.value||"");
-            }else {
-                o[this.name] = this.value || "";
+            }else{
+                if(o[this.name]){
+                    if(!o[this.name].push){
+                        o[this.name]=[o[this.name]];
+                    }
+                    o[this.name].push(this.value||"");
+                }else {
+                    o[this.name] = this.value || "";
+                }
             }
         });
         return o;

+ 1 - 1
tip-service/tip-common/src/main/java/com/minto/app/behavior/manager/BehManagerImpl.java

@@ -1443,7 +1443,7 @@ public class BehManagerImpl extends AsynchronousBatchTask<BehSummaryBean> implem
     @Override
     public void deleteByBehTypeAndExt1(Integer resType, String resId, String ext1){
         LogicalExpression c = Restrictions.and(Restrictions.eq("resType", resType),
-                Restrictions.eq("resId", resType));
+                Restrictions.eq("resId", resId));
         c = Restrictions.and(c,Restrictions.eq("ext1", ext1));
         behSummaryDao.delete(BehSummaryBean.class,c);
     }