diff --git a/src/main/java/com/zcloud/controller/keyProjects/UnitsController.java b/src/main/java/com/zcloud/controller/keyProjects/UnitsController.java index 1c6234bf..f5d91978 100644 --- a/src/main/java/com/zcloud/controller/keyProjects/UnitsController.java +++ b/src/main/java/com/zcloud/controller/keyProjects/UnitsController.java @@ -1,5 +1,7 @@ package com.zcloud.controller.keyProjects; +import com.alibaba.fastjson.JSON; +import com.zcloud.aspect.DockAnnotation; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; @@ -41,11 +43,13 @@ public class UnitsController extends BaseController { @RequestMapping(value = "/add") @RequiresPermissions("units:add") @ResponseBody + @DockAnnotation(hasAnnex = true) public Object add(@RequestParam(value = "file", required = false) MultipartFile file) throws Exception { Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); + List picturesList = new ArrayList<>(); pd.put("UNITS_ID", this.get32UUID()); //主键 pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 @@ -66,9 +70,13 @@ public class UnitsController extends BaseController { String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); Smb.sshSftp(file, fileName, Const.FILEPATHFILE + "/" + ffile); pd.put("FILEPATH", Const.FILEPATHFILE + "/" + ffile + "/" + fileName); + picturesList.add(Const.FILEPATHFILE + "/" + ffile + "/" + fileName+"@@"+fileName); } // List list = unitsService.listAll(pd); unitsService.save(pd); + pd.put("sendAllCorp",1); + map.put("dockData", JSON.toJSONString(pd)); + map.put("sendPicturesList",JSON.toJSONString(picturesList)); map.put("result", errInfo); return map; } @@ -76,12 +84,13 @@ public class UnitsController extends BaseController { /** * 删除 * - * @param out + * @param * @throws Exception */ @RequestMapping(value = "/delete") @RequiresPermissions("units:del") @ResponseBody + @DockAnnotation public Object delete() throws Exception { Map map = new HashMap(); String errInfo = "success"; @@ -95,6 +104,8 @@ public class UnitsController extends BaseController { map.put("msg", "只有添加人"+state+"可以删除相关方!"); return map; } + pd.put("sendAllCorp",1); + map.put("dockData", JSON.toJSONString(pd)); map.put("result", errInfo); //返回结果 return map; } @@ -108,12 +119,13 @@ public class UnitsController extends BaseController { @RequestMapping(value = "/edit") @RequiresPermissions("units:edit") @ResponseBody + @DockAnnotation(hasAnnex = true) public Object edit(@RequestParam(value = "file", required = false) MultipartFile file) throws Exception { Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - + List picturesList = new ArrayList<>(); String state = unitsService.IsJudgeCreator(pd.getString("UNITS_ID")); if(!"1".equals(state)){ errInfo = "fail"; @@ -136,10 +148,13 @@ public class UnitsController extends BaseController { String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); Smb.sshSftp(file, fileName, Const.FILEPATHFILE + "/" + ffile); pd.put("FILEPATH", Const.FILEPATHFILE + "/" + ffile + "/" + fileName); + picturesList.add(Const.FILEPATHFILE + "/" + ffile + "/" + fileName+"@@"+fileName); } unitsService.edit(pd); - + pd.put("sendAllCorp",1); + map.put("dockData", JSON.toJSONString(pd)); + map.put("sendPicturesList",JSON.toJSONString(picturesList)); map.put("result", errInfo); return map; } @@ -236,6 +251,7 @@ public class UnitsController extends BaseController { @RequestMapping(value = "/deleteAll") @RequiresPermissions("units:del") @ResponseBody + @DockAnnotation public Object deleteAll() throws Exception { Map map = new HashMap(); String errInfo = "success"; @@ -249,6 +265,8 @@ public class UnitsController extends BaseController { } else { errInfo = "fail"; } + pd.put("sendAllCorp",1); + map.put("dockData", JSON.toJSONString(pd)); map.put("result", errInfo); //返回结果 return map; }