八项作业

pull/14/head
dearlin 2023-12-25 14:42:45 +08:00
parent c1431c47db
commit 87aee42fdb
6 changed files with 2442 additions and 2244 deletions

BIN
1703230140663.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -52,7 +52,7 @@ public class MfolderController extends BaseController {
@RequestMapping(value="/add")
@RequiresPermissions("mfolder:add")
@ResponseBody
@DockAnnotation(isAdd = true)
@DockAnnotation
public Object add() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
@ -80,13 +80,7 @@ public class MfolderController extends BaseController {
@RequiresPermissions("mfolder:add")
@ResponseBody
@DockAnnotation(hasAnnex = true)
public Object add(
@RequestParam(value="FFILE",required=false) MultipartFile file,
@RequestParam(value="NAME",required=false) String NAME,
@RequestParam(value="PARENT_ID",required=false) String PARENT_ID,
@RequestParam(value="REMARKS",required=false) String REMARKS,
@RequestParam(value="SHARE",required=false) String SHARE
) throws Exception{
public Object add(@RequestParam(value="FFILE",required=false) MultipartFile file, @RequestParam(value="NAME",required=false) String NAME, @RequestParam(value="PARENT_ID",required=false) String PARENT_ID, @RequestParam(value="REMARKS",required=false) String REMARKS, @RequestParam(value="SHARE",required=false) String SHARE) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
ArrayList<String> pictureList = new ArrayList<>();
String errInfo = "success";
@ -100,8 +94,6 @@ public class MfolderController extends BaseController {
map.put("msg", "文件格式不正确!");
return map;
}
// String filePath = PathUtil.getProjectpath() + Const.FILEPATHFILE + ffile; //文件上传路径
// fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传
Long size = file.getSize()/1024;
fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName,Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
@ -117,10 +109,6 @@ public class MfolderController extends BaseController {
pd.put("MFOLDER_ID", this.get32UUID()); //主键
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
mfolderService.save(pd); //存入数据库表
//存自己表里的附件 使用文件全路径加文件名的方式 示例
// /uploadFiles/yhtp/8415df13cc4c46f0ac32f579462dbb8f/20231215/d3bc85d1bbe84b75b1e6e8b6182dc547.jpg
// @@
// d3bc85d1bbe84b75b1e6e8b6182dc547.jpg
pictureList.add(Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName+
"@@"
+fileName);

View File

@ -2,6 +2,7 @@ package com.zcloud.controller.gf;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.aspect.DockAnnotation;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
@ -76,6 +77,7 @@ public class AppGFHighWorkController extends BaseController {
@RequestMapping(value="/add")
@ResponseBody
@Transactional
@DockAnnotation
public Object add() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
@ -101,12 +103,14 @@ public class AppGFHighWorkController extends BaseController {
if(pd.get("APPLY_STATUS").equals("1")) {
PageData log = new PageData();
log.put("HIGHWORKLOG_ID", this.get32UUID());
log.put("ACTION", "提交申请");
log.put("HIGHWORK_ID", pd.get("HIGHWORK_ID"));
log.put("CREATOR",pd.get("ACTION_USER"));
log.put("CREATTIME", DateUtil.date2Str(new Date()));
GFhighWorkLogService.save(log);
pd.put("logData",JSON.toJSONString(log));
// 发短信
PageData mes = new PageData();
@ -139,6 +143,7 @@ public class AppGFHighWorkController extends BaseController {
sendMessageUtil.sendMessages(mes, paramsList);
}
map.put("result", errInfo);
map.put("dockData", JSON.toJSONString(pd));
return map;
}
@ -148,6 +153,7 @@ public class AppGFHighWorkController extends BaseController {
*/
@RequestMapping(value="/delete")
@ResponseBody
@DockAnnotation
public Object delete() throws Exception{
Map<String,String> map = new HashMap<String,String>();
String errInfo = "success";
@ -155,6 +161,7 @@ public class AppGFHighWorkController extends BaseController {
pd = this.getPageData();
GFhighworkService.delete(pd);
map.put("result", errInfo); //返回结果
map.put("dockData", JSON.toJSONString(pd)); //返回结果
return map;
}
@ -221,6 +228,7 @@ public class AppGFHighWorkController extends BaseController {
@RequestMapping(value="/editGuardian")
@ResponseBody
@Transactional
@DockAnnotation(hasAnnex = true)
public Object editGuardian(
@RequestParam(value="FFILE",required=false) MultipartFile[] files
) throws Exception{
@ -232,13 +240,14 @@ public class AppGFHighWorkController extends BaseController {
pd2 = GFhighworkService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
ArrayList<String> sendPicturesList = new ArrayList<>();
if (files != null && files.length > 0) {
MultipartFile file = files[0];
String ffile = DateUtil.getDays();
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
sendPicturesList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName+"@@"+fileName);
pd2.put("GUARDIAN_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd2.put("GUARDIAN_USER_SIGNER_TIME", pd.get("SIGNER_TIME"));
// pd2.put("GUARDIAN_CONTENT", pd.get("CONTENT"));
@ -288,6 +297,8 @@ public class AppGFHighWorkController extends BaseController {
// sendMessageUtil.sendMessages(mes, paramsList);
// }
map.put("result", errInfo);
map.put("dockData", JSON.toJSONString(pd2));
map.put("sendPicturesList", JSON.toJSONString(sendPicturesList));
return map;
}
/**
@ -297,6 +308,7 @@ public class AppGFHighWorkController extends BaseController {
@RequestMapping(value="/editConfess")
@ResponseBody
@Transactional
@DockAnnotation(hasAnnex = true)
public Object editConfess(
@RequestParam(value="FFILE",required=false) MultipartFile[] files
) throws Exception{
@ -306,6 +318,7 @@ public class AppGFHighWorkController extends BaseController {
pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFhighworkService.findById(pd);
ArrayList<String> sendPicturesList = new ArrayList<>();
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
if (files != null && files.length > 0) {
@ -314,7 +327,7 @@ public class AppGFHighWorkController extends BaseController {
String ffile = DateUtil.getDays();
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
sendPicturesList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName+"@@"+fileName);
pd2.put("CONFESS_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd2.put("CONFESS_USER_SIGNER_TIME", pd.get("SIGNER_TIME"));
// pd2.put("GUARDIAN_CONTENT", pd.get("CONTENT"));
@ -322,6 +335,8 @@ public class AppGFHighWorkController extends BaseController {
GFhighworkService.edit(pd2);
}
map.put("result", errInfo);
map.put("dockData", JSON.toJSONString(pd2));
map.put("sendPicturesList", JSON.toJSONString(sendPicturesList));
return map;
}
/**
@ -331,11 +346,11 @@ public class AppGFHighWorkController extends BaseController {
@RequestMapping(value="/editAcceptconfess")
@ResponseBody
@Transactional
@DockAnnotation(hasAnnex = true)
public Object editAcceptconfess(MultipartRequest request) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFhighworkService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
@ -343,18 +358,23 @@ public class AppGFHighWorkController extends BaseController {
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME[] = pd.getString("SIGNTIME").split(",");
ArrayList<String> sendPicturesList = new ArrayList<>();
ArrayList<PageData> highworkacceptuserList = new ArrayList<>();
for (int i = 0; i < SIGNTIME.length; i++) {
signertime = SIGNTIME[i];
fileList.add(request.getFile("file"+i));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveImg(fileList.toArray(fileArr),signertime,pd.getString("HIGHWORK_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_CONFESS_USER_ID"),pd.getString("ACCEPT_CONFESS_DEPARTMENT_ID"));
saveImg(sendPicturesList,highworkacceptuserList,fileList.toArray(fileArr),signertime,pd.getString("HIGHWORK_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_CONFESS_USER_ID"),pd.getString("ACCEPT_CONFESS_DEPARTMENT_ID"));
fileList.clear();
}
PageData dockData = new PageData();
dockData.put("highworkacceptuserList", JSON.toJSONString(highworkacceptuserList));
map.put("result", errInfo);
map.put("dockData", dockData);
map.put("sendPicturesList", JSON.toJSONString(sendPicturesList));
return map;
}
private void saveImg(MultipartFile[] files,String signertime, String HIGHWORK_ID, String CORPINFO_ID, String ACCEPT_CONFESS_USER_ID, String ACCEPT_CONFESS_DEPARTMENT_ID) throws Exception{
private void saveImg(ArrayList<String> sendPicturesList,ArrayList<PageData> highworkacceptuserList,MultipartFile[] files,String signertime, String HIGHWORK_ID, String CORPINFO_ID, String ACCEPT_CONFESS_USER_ID, String ACCEPT_CONFESS_DEPARTMENT_ID) throws Exception{
if (files != null && files.length > 0) {
for (int i = 0; i < files.length; i++) {
PageData pd = new PageData();
@ -363,6 +383,7 @@ public class AppGFHighWorkController extends BaseController {
String ffile = DateUtil.getDays();
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
smb.sshSftp(file, fileName,Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile);
sendPicturesList.add(Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile + "/" + fileName+"@@"+fileName);
pd.put("ACCEPT_CONFESS_USER_SIGNER_TIME", signertime);
pd.put("ACCEPT_CONFESS_ID", this.get32UUID());
pd.put("OPERATOR", pd.get("OPERATOR")); //修改人
@ -376,6 +397,7 @@ public class AppGFHighWorkController extends BaseController {
pd.put("ACCEPT_USER_ID","");
pd.put("ACCEPT_DEPARTMENT_ID", "");
highworkacceptuserService.save(pd);
highworkacceptuserList.add(pd);
}
}
}
@ -532,6 +554,7 @@ public class AppGFHighWorkController extends BaseController {
@RequestMapping(value="/editStatus")
@ResponseBody
@Transactional
@DockAnnotation(hasAnnex = true)
public Object editStatus(
@RequestParam(value="FFILE",required=false) MultipartFile[] files
) throws Exception{
@ -545,6 +568,8 @@ public class AppGFHighWorkController extends BaseController {
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
// pd2.put("OTHER_PROTECTIVE_MEASURES", pd.get("OTHER_PROTECTIVE_MEASURES")); //修改人
// pd2.put("HAZARD_IDENTIFICATION", pd.get("HAZARD_IDENTIFICATION")); //修改人
ArrayList<String> sendPicturesList = new ArrayList<>();
ArrayList<PageData> toMeasuresList = new ArrayList<>();
PageData log = new PageData();
log.put("HIGHWORKLOG_ID", this.get32UUID());
// log.put("ACTION", "审核打回");
@ -577,6 +602,7 @@ public class AppGFHighWorkController extends BaseController {
String ffile = DateUtil.getDays();
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
sendPicturesList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName);
pd2.put("CONSTRUCTION_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd2.put("CONSTRUCTION_USER_SIGNER_TIME", pd.get("SIGNER_TIME"));
@ -604,6 +630,7 @@ public class AppGFHighWorkController extends BaseController {
measures.put("CONFIRM_ID", pd.get("OPERATOR"));
measures.put("CONFIRM_NAME", pd.get("ACTION_USER"));
GFhighWorkToMeasuresService.save(measures);
toMeasuresList.add(measures);
}
log.put("ACTION", "作业单位通过");
@ -664,6 +691,7 @@ public class AppGFHighWorkController extends BaseController {
String ffile = DateUtil.getDays();
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
sendPicturesList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName);
pd2.put("LEADER_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd2.put("LEADER_USER_SIGNER_TIME", pd.get("SIGNER_TIME"));
@ -730,6 +758,7 @@ public class AppGFHighWorkController extends BaseController {
String ffile = DateUtil.getDays();
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
sendPicturesList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName);
pd2.put("AUDIT_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd2.put("AUDIT_USER_SIGNER_TIME", pd.get("SIGNER_TIME"));
@ -788,6 +817,7 @@ public class AppGFHighWorkController extends BaseController {
String ffile = DateUtil.getDays();
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
sendPicturesList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName);
pd2.put("APPROVE_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd2.put("APPROVE_USER_SIGNER_TIME", pd.get("SIGNER_TIME"));
@ -836,6 +866,7 @@ public class AppGFHighWorkController extends BaseController {
String ffile = DateUtil.getDays();
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
sendPicturesList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName);
pd2.put("ACCEPT_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd2.put("ACCEPT_USER_SIGNER_TIME", pd.get("SIGNER_TIME"));
@ -1026,6 +1057,13 @@ public class AppGFHighWorkController extends BaseController {
break;
}
GFhighWorkLogService.save(log);
PageData dockData = new PageData();
dockData.put("logData",JSON.toJSONString(log));
dockData.put("STATUS",status);
dockData.put("saveData",JSON.toJSONString(pd2));
dockData.put("requestData",JSON.toJSONString(pd));
dockData.put("toMeasuresList",JSON.toJSONString(toMeasuresList));
map.put("dockData", JSON.toJSONString(dockData));
map.put("result", errInfo);
return map;
}

View File

@ -445,7 +445,8 @@ public class OutSourcedController extends BaseController {
pdImg.put("TYPE", "300");
pdImg.put("FOREIGN_KEY", pd.getString("OUTSOURCED_ID"));
imgfilesService.save(pdImg);
Smb.sshSftp(file9One, fileName, Const.FILEPATHYHTP + Jurisdiction.getCORPINFO_ID() + "/" + ffile,IMGFILES_ID,pd.getString("OUTSOURCED_ID"),"300");
Smb.sshSftp(file9One, fileName, Const.FILEPATHYHTP + Jurisdiction.getCORPINFO_ID() + "/" + ffile
,IMGFILES_ID,pd.getString("OUTSOURCED_ID"),"300");
}