对接到沧州矿石

pull/11/head
zhaoyu 2023-12-28 16:45:28 +08:00
parent fa82dc7272
commit 18b1a824b4
1 changed files with 21 additions and 3 deletions

View File

@ -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<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
List<String> 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<PageData> 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<String, String> map = new HashMap<String, String>();
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<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
List<String> 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<String, Object> map = new HashMap<String, Object>();
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;
}