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