Merge remote-tracking branch 'origin/czks1.0' into czks1.0

pull/14/head
songwenxuan 2023-12-28 13:45:58 +08:00
commit f36417ce03
21 changed files with 605 additions and 363 deletions

View File

@ -1,16 +1,15 @@
package com.zcloud.controller.app; package com.zcloud.controller.app;
import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.zcloud.aspect.DockAnnotation; import com.zcloud.aspect.DockAnnotation;
import com.zcloud.controller.base.BaseController;
import com.zcloud.dto.TenCorpDto; import com.zcloud.dto.TenCorpDto;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.bus.ImgFilesService;
import com.zcloud.service.mq.DockSendMessageService; import com.zcloud.service.mq.DockSendMessageService;
import com.zcloud.util.*; import com.zcloud.util.*;
import org.apache.commons.io.FileUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -19,13 +18,12 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import org.apache.commons.io.FileUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.zcloud.controller.base.BaseController; import java.io.File;
import com.zcloud.entity.Page; import java.util.ArrayList;
import com.zcloud.entity.PageData; import java.util.HashMap;
import com.zcloud.service.bus.ImgFilesService; import java.util.List;
import java.util.Map;
/** /**
* *
@ -51,7 +49,7 @@ public class AppImgFilesController extends BaseController {
@RequestMapping(value = "/add", headers = "content-type=multipart/form-data") @RequestMapping(value = "/add", headers = "content-type=multipart/form-data")
@ResponseBody @ResponseBody
@Transactional @Transactional
// @DockAnnotation(hasAnnex = true) @DockAnnotation(hasAnnex = true)
public Object finish( public Object finish(
@RequestParam(value = "FFILE", required = false) MultipartFile[] files, @RequestParam(value = "FFILE", required = false) MultipartFile[] files,
@RequestParam(value = "TYPE", required = false) String TYPE, @RequestParam(value = "TYPE", required = false) String TYPE,
@ -93,7 +91,7 @@ public class AppImgFilesController extends BaseController {
File old = new File(PathUtil.getProjectpath() + pageData.getString("FILEPATH")); File old = new File(PathUtil.getProjectpath() + pageData.getString("FILEPATH"));
old.delete(); old.delete();
imgfilesService.delete(pageData); imgfilesService.delete(pageData);
pageData.put("delete","1"); pageData.put("delete", "1");
TenCorpDto tenCorpDto = new TenCorpDto(); TenCorpDto tenCorpDto = new TenCorpDto();
tenCorpDto.setMessage("删除文件消息"); tenCorpDto.setMessage("删除文件消息");
tenCorpDto.setId(UuidUtil.get32UUID()); tenCorpDto.setId(UuidUtil.get32UUID());
@ -114,7 +112,7 @@ public class AppImgFilesController extends BaseController {
pd.put("FILEPATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); pd.put("FILEPATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd.put("TYPE", TYPE); pd.put("TYPE", TYPE);
pd.put("FOREIGN_KEY", FOREIGN_KEY); pd.put("FOREIGN_KEY", FOREIGN_KEY);
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile+ "/", IMGFILES_ID, FOREIGN_KEY, TYPE); Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/", IMGFILES_ID, FOREIGN_KEY, TYPE);
imgfilesService.save(pd); imgfilesService.save(pd);
} }
} }
@ -245,7 +243,7 @@ public class AppImgFilesController extends BaseController {
file.delete(); file.delete();
imgfilesService.delete(pd); imgfilesService.delete(pd);
TenCorpDto tenCorpDto = new TenCorpDto(); TenCorpDto tenCorpDto = new TenCorpDto();
pd.put("delete","1"); pd.put("delete", "1");
tenCorpDto.setData(pd); tenCorpDto.setData(pd);
dockSendMessageService.sendMessagePictureDelete(tenCorpDto); dockSendMessageService.sendMessagePictureDelete(tenCorpDto);
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果

View File

@ -1,5 +1,7 @@
package com.zcloud.controller.bus; package com.zcloud.controller.bus;
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.PageData; import com.zcloud.entity.PageData;
import com.zcloud.service.bus.ArchivesFilesService; import com.zcloud.service.bus.ArchivesFilesService;
@ -38,6 +40,7 @@ public class ArchivesFilesController extends BaseController {
*/ */
@RequestMapping(value="/add") @RequestMapping(value="/add")
@ResponseBody @ResponseBody
@DockAnnotation(hasAnnex = true)
public Object add( public Object add(
@RequestParam(value="FFILE",required=false) MultipartFile[] files, @RequestParam(value="FFILE",required=false) MultipartFile[] files,
@RequestParam(value="TYPE",required=false) String TYPE, @RequestParam(value="TYPE",required=false) String TYPE,
@ -52,7 +55,7 @@ public class ArchivesFilesController extends BaseController {
pd.put("TYPE", TYPE); pd.put("TYPE", TYPE);
pd.put("YEAR", YEAR); pd.put("YEAR", YEAR);
pd.put("STUDYTASK_ID", STUDYTASK_ID); pd.put("STUDYTASK_ID", STUDYTASK_ID);
ArrayList<String> sendPicturesList = new ArrayList<>();
if (files != null && files.length > 0) { if (files != null && files.length > 0) {
for (int i = 0; i < files.length; i++) { for (int i = 0; i < files.length; i++) {
String suffixName = files[i].getOriginalFilename().substring(files[i].getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); String suffixName = files[i].getOriginalFilename().substring(files[i].getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
@ -72,11 +75,14 @@ public class ArchivesFilesController extends BaseController {
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
pd.put("FILE_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); pd.put("FILE_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
sendPicturesList.add(pd.getString("FILE_PATH")+"@@"+fileName);
} }
} }
archivesfilesService.save(pd); archivesfilesService.save(pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData", JSON.toJSONString(pd));
map.put("sendPicturesList", JSON.toJSONString(sendPicturesList));
return map; return map;
} }
/** /**
@ -85,6 +91,7 @@ public class ArchivesFilesController extends BaseController {
*/ */
@RequestMapping(value="/delete") @RequestMapping(value="/delete")
@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";
@ -93,6 +100,7 @@ public class ArchivesFilesController extends BaseController {
Smb.deleteFile(pd.getString("FILE_PATH")); Smb.deleteFile(pd.getString("FILE_PATH"));
archivesfilesService.delete(pd); archivesfilesService.delete(pd);
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
map.put("dockData", JSON.toJSONString(pd)); //返回结果
return map; return map;
} }

View File

@ -6,6 +6,8 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.zcloud.aspect.DockAnnotation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -60,6 +62,7 @@ public class PersonObtainEvidenceController extends BaseController {
@RequestMapping(value="/add") @RequestMapping(value="/add")
@RequiresPermissions("personobtainevidence:add") @RequiresPermissions("personobtainevidence: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";
@ -72,6 +75,7 @@ public class PersonObtainEvidenceController extends BaseController {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否 pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
List<String> fileList = new ArrayList<>();
if (null != file && !file.isEmpty()) { if (null != file && !file.isEmpty()) {
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) { if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
@ -84,8 +88,11 @@ public class PersonObtainEvidenceController 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.FILEPATHIMG + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(file, fileName,Const.FILEPATHIMG + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("IMGPATH", Const.FILEPATHIMG + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("IMGPATH", Const.FILEPATHIMG + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
fileList.add(Const.HTTPFILEURL + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName + "@@" + fileName);
} }
personobtainevidenceService.save(pd); personobtainevidenceService.save(pd);
map.put("dockData", pd);
map.put("sendPicturesList", JSON.toJSONString(fileList));
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
@ -97,8 +104,9 @@ public class PersonObtainEvidenceController extends BaseController {
@RequestMapping(value="/delete") @RequestMapping(value="/delete")
@RequiresPermissions("personobtainevidence:del") @RequiresPermissions("personobtainevidence:del")
@ResponseBody @ResponseBody
@DockAnnotation
public Object delete() throws Exception{ public Object delete() throws Exception{
Map<String,String> map = new HashMap<String,String>(); 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();
@ -106,6 +114,7 @@ public class PersonObtainEvidenceController extends BaseController {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
personobtainevidenceService.delete(pd); personobtainevidenceService.delete(pd);
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
map.put("dockData", pd);
return map; return map;
} }
@ -116,6 +125,7 @@ public class PersonObtainEvidenceController extends BaseController {
@RequestMapping(value="/edit") @RequestMapping(value="/edit")
@RequiresPermissions("personobtainevidence:edit") @RequiresPermissions("personobtainevidence: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";
@ -123,6 +133,7 @@ public class PersonObtainEvidenceController extends BaseController {
pd = this.getPageData(); pd = this.getPageData();
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
List<String> fileList = new ArrayList<>();
if (null != file && !file.isEmpty()) { if (null != file && !file.isEmpty()) {
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) { if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
@ -135,8 +146,11 @@ public class PersonObtainEvidenceController 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.FILEPATHIMG + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(file, fileName,Const.FILEPATHIMG + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("IMGPATH", Const.FILEPATHIMG + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("IMGPATH", Const.FILEPATHIMG + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
fileList.add(Const.HTTPFILEURL + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName + "@@" + fileName);
} }
personobtainevidenceService.edit(pd); personobtainevidenceService.edit(pd);
map.put("dockData", pd);
map.put("sendPicturesList", JSON.toJSONString(fileList));
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }

View File

@ -6,6 +6,8 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.zcloud.aspect.DockAnnotation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -41,18 +43,22 @@ public class StudySectionController extends BaseController {
@Autowired @Autowired
private StudySectionService studysectionService; private StudySectionService studysectionService;
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/add") @RequestMapping(value = "/add")
@RequiresPermissions("studysection:add") @RequiresPermissions("studysection:add")
@ResponseBody @ResponseBody
public Object add(@RequestParam(value="file",required=false) MultipartFile file) throws Exception{ @DockAnnotation(hasAnnex = true)
Map<String,Object> map = new HashMap<String,Object>(); public Object add(@RequestParam(value = "file", required = false) MultipartFile file) throws Exception {
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();
ArrayList<String> sendPicturesList = new ArrayList<>();
pd.put("STUDYSECTION_ID", this.get32UUID()); //主键 pd.put("STUDYSECTION_ID", this.get32UUID()); //主键
pd.put("CREATOR", Jurisdiction.getUsername()); //添加人 pd.put("CREATOR", Jurisdiction.getUsername()); //添加人
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
@ -61,7 +67,7 @@ public class StudySectionController extends BaseController {
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否 pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
if (null != file && !file.isEmpty()) { if (null != file && !file.isEmpty()) {
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) { if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
errInfo = "fail"; errInfo = "fail";
map.put("result", errInfo); map.put("result", errInfo);
@ -71,24 +77,29 @@ public class StudySectionController extends BaseController {
String ffile = DateUtil.getDays(); String ffile = DateUtil.getDays();
// String filePath = PathUtil.getProjectpath() + Const.FILEPATHFILE + ffile; //文件上传路径 // String filePath = PathUtil.getProjectpath() + Const.FILEPATHFILE + ffile; //文件上传路径
// String fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传 // String fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传
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 + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
sendPicturesList.add(pd.getString("FILEPATH") + "@@" + fileName);
} }
studysectionService.save(pd); studysectionService.save(pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData", JSON.toJSONString(pd));
map.put("sendPicturesList", JSON.toJSONString(sendPicturesList));
return map; return map;
} }
/** /**
*
*
* @param out * @param out
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/delete") @RequestMapping(value = "/delete")
@RequiresPermissions("studysection:del") @RequiresPermissions("studysection:del")
@ResponseBody @ResponseBody
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";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
@ -99,15 +110,17 @@ public class StudySectionController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/edit") @RequestMapping(value = "/edit")
@RequiresPermissions("studysection:edit") @RequiresPermissions("studysection:edit")
@ResponseBody @ResponseBody
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();
@ -115,7 +128,7 @@ public class StudySectionController extends BaseController {
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
if (null != file && !file.isEmpty()) { if (null != file && !file.isEmpty()) {
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) { if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
errInfo = "fail"; errInfo = "fail";
map.put("result", errInfo); map.put("result", errInfo);
@ -123,8 +136,8 @@ public class StudySectionController extends BaseController {
return map; return map;
} }
String ffile = DateUtil.getDays(); String ffile = DateUtil.getDays();
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 + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
} }
studysectionService.edit(pd); studysectionService.edit(pd);
@ -133,26 +146,28 @@ public class StudySectionController extends BaseController {
} }
/** /**
*
*
* @param page * @param page
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/list") @RequestMapping(value = "/list")
@RequiresPermissions("studysection:list") @RequiresPermissions("studysection:list")
@ResponseBody @ResponseBody
public Object list(Page page) throws Exception{ public Object list(Page page) 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();
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
page.setPd(pd); page.setPd(pd);
List<PageData> varList = studysectionService.list(page); //列出StudySection列表 List<PageData> varList = studysectionService.list(page); //列出StudySection列表
if(varList != null && varList.size() > 0) { if (varList != null && varList.size() > 0) {
for(PageData var : varList) { for (PageData var : varList) {
if(var.get("FILEPATH") != null && Tools.notEmpty(var.getString("FILEPATH").toString())) { if (var.get("FILEPATH") != null && Tools.notEmpty(var.getString("FILEPATH").toString())) {
String suffix = var.get("FILEPATH").toString().substring(var.get("FILEPATH").toString().lastIndexOf(".") + 1); String suffix = var.get("FILEPATH").toString().substring(var.get("FILEPATH").toString().lastIndexOf(".") + 1);
var.put("extension_name", suffix); var.put("extension_name", suffix);
} }
@ -165,15 +180,17 @@ public class StudySectionController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/goEdit") @RequestMapping(value = "/goEdit")
@RequiresPermissions("studysection:edit") @RequiresPermissions("studysection:edit")
@ResponseBody @ResponseBody
public Object goEdit() throws Exception{ public Object goEdit() 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();
@ -183,41 +200,45 @@ public class StudySectionController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/deleteAll") @RequestMapping(value = "/deleteAll")
@RequiresPermissions("studysection:del") @RequiresPermissions("studysection:del")
@ResponseBody @ResponseBody
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";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
String DATA_IDS = pd.getString("DATA_IDS"); String DATA_IDS = pd.getString("DATA_IDS");
if(Tools.notEmpty(DATA_IDS)){ if (Tools.notEmpty(DATA_IDS)) {
String ArrayDATA_IDS[] = DATA_IDS.split(","); String ArrayDATA_IDS[] = DATA_IDS.split(",");
studysectionService.deleteAll(ArrayDATA_IDS); studysectionService.deleteAll(ArrayDATA_IDS);
errInfo = "success"; errInfo = "success";
}else{ } else {
errInfo = "fail"; errInfo = "fail";
} }
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
return map; return map;
} }
/**excel /**
* excel
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/excel") @RequestMapping(value = "/excel")
@RequiresPermissions("toExcel") @RequiresPermissions("toExcel")
public ModelAndView exportExcel() throws Exception{ public ModelAndView exportExcel() throws Exception {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
Map<String,Object> dataMap = new HashMap<String,Object>(); Map<String, Object> dataMap = new HashMap<String, Object>();
List<String> titles = new ArrayList<String>(); List<String> titles = new ArrayList<String>();
titles.add("所属行业"); //1 titles.add("所属行业"); //1
titles.add("所属专业"); //2 titles.add("所属专业"); //2
@ -235,7 +256,7 @@ public class StudySectionController extends BaseController {
dataMap.put("titles", titles); dataMap.put("titles", titles);
List<PageData> varOList = studysectionService.listAll(pd); List<PageData> varOList = studysectionService.listAll(pd);
List<PageData> varList = new ArrayList<PageData>(); List<PageData> varList = new ArrayList<PageData>();
for(int i=0;i<varOList.size();i++){ for (int i = 0; i < varOList.size(); i++) {
PageData vpd = new PageData(); PageData vpd = new PageData();
vpd.put("var1", varOList.get(i).getString("INDUSTRY")); //1 vpd.put("var1", varOList.get(i).getString("INDUSTRY")); //1
vpd.put("var2", varOList.get(i).getString("CORP_TYPE")); //2 vpd.put("var2", varOList.get(i).getString("CORP_TYPE")); //2
@ -254,7 +275,7 @@ public class StudySectionController extends BaseController {
} }
dataMap.put("varList", varList); dataMap.put("varList", varList);
ObjectExcelView erv = new ObjectExcelView(); ObjectExcelView erv = new ObjectExcelView();
mv = new ModelAndView(erv,dataMap); mv = new ModelAndView(erv, dataMap);
return mv; return mv;
} }

View File

@ -6,6 +6,8 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.zcloud.aspect.DockAnnotation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -48,6 +50,7 @@ public class TrainingInfoController extends BaseController {
@RequestMapping(value="/add") @RequestMapping(value="/add")
@RequiresPermissions("traininginfo:add") @RequiresPermissions("traininginfo: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";
@ -60,6 +63,7 @@ public class TrainingInfoController extends BaseController {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否 pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
List<String> fileLst = new ArrayList<>();
if (null != file && !file.isEmpty()) { if (null != file && !file.isEmpty()) {
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) { if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
@ -72,9 +76,12 @@ public class TrainingInfoController 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 + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(file, fileName,Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
fileLst.add(Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
} }
traininginfoService.save(pd); traininginfoService.save(pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData", pd);
map.put("sendPicturesList", fileLst);
return map; return map;
} }
@ -85,8 +92,9 @@ public class TrainingInfoController extends BaseController {
@RequestMapping(value="/delete") @RequestMapping(value="/delete")
@RequiresPermissions("traininginfo:del") @RequiresPermissions("traininginfo:del")
@ResponseBody @ResponseBody
@DockAnnotation
public Object delete() throws Exception{ public Object delete() throws Exception{
Map<String,String> map = new HashMap<String,String>(); 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();
@ -94,6 +102,7 @@ public class TrainingInfoController extends BaseController {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
traininginfoService.delete(pd); traininginfoService.delete(pd);
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
map.put("dockData", pd);
return map; return map;
} }
@ -104,6 +113,7 @@ public class TrainingInfoController extends BaseController {
@RequestMapping(value="/edit") @RequestMapping(value="/edit")
@RequiresPermissions("traininginfo:edit") @RequiresPermissions("traininginfo: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";
@ -111,6 +121,7 @@ public class TrainingInfoController extends BaseController {
pd = this.getPageData(); pd = this.getPageData();
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
List<String> fileLst = new ArrayList<>();
if (null != file && !file.isEmpty()) { if (null != file && !file.isEmpty()) {
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) { if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
@ -123,9 +134,12 @@ public class TrainingInfoController 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 + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(file, fileName,Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
fileLst.add(Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
} }
traininginfoService.edit(pd); traininginfoService.edit(pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData", pd);
map.put("sendPicturesList", JSON.toJSONString(fileLst));
return map; return map;
} }

View File

@ -7,6 +7,9 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.zcloud.aspect.DockAnnotation;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -50,6 +53,7 @@ public class TrainingPlanController extends BaseController {
@RequestMapping(value="/add") @RequestMapping(value="/add")
@RequiresPermissions("trainingplan:add") @RequiresPermissions("trainingplan: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";
@ -62,6 +66,7 @@ public class TrainingPlanController extends BaseController {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否 pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
List<String> fileList = new ArrayList<>();
if (null != file && !file.isEmpty()) { if (null != file && !file.isEmpty()) {
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) { if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
@ -74,8 +79,11 @@ public class TrainingPlanController 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 + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(file, fileName,Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
fileList.add(Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName + "@@" + fileName);
} }
trainingplanService.save(pd); trainingplanService.save(pd);
map.put("dockData", pd);
map.put("sendPicturesList", JSON.toJSONString(fileList));
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
@ -87,8 +95,9 @@ public class TrainingPlanController extends BaseController {
@RequestMapping(value="/delete") @RequestMapping(value="/delete")
@RequiresPermissions("trainingplan:del") @RequiresPermissions("trainingplan:del")
@ResponseBody @ResponseBody
@DockAnnotation
public Object delete() throws Exception{ public Object delete() throws Exception{
Map<String,String> map = new HashMap<String,String>(); 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();
@ -96,6 +105,7 @@ public class TrainingPlanController extends BaseController {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
trainingplanService.delete(pd); trainingplanService.delete(pd);
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
map.put("dockDate", pd);
return map; return map;
} }
@ -106,6 +116,7 @@ public class TrainingPlanController extends BaseController {
@RequestMapping(value="/edit") @RequestMapping(value="/edit")
@RequiresPermissions("trainingplan:edit") @RequiresPermissions("trainingplan: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";
@ -114,6 +125,7 @@ public class TrainingPlanController extends BaseController {
pd = this.getPageData(); pd = this.getPageData();
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
List<String> fileList = new ArrayList<>();
if (null != file && !file.isEmpty()) { if (null != file && !file.isEmpty()) {
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) { if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
@ -128,9 +140,12 @@ public class TrainingPlanController 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 + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(file, fileName,Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
fileList.add(Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName + "@@" + fileName);
} }
trainingplanService.edit(pd); trainingplanService.edit(pd);
map.put("dockData", pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("sendPicturesList", JSON.toJSONString(fileList));
return map; return map;
} }

View File

@ -1,5 +1,7 @@
package com.zcloud.controller.bus; package com.zcloud.controller.bus;
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;
@ -39,6 +41,7 @@ public class TrainingScheduleController extends BaseController {
*/ */
@RequestMapping(value="/add") @RequestMapping(value="/add")
@ResponseBody @ResponseBody
@DockAnnotation
public Object add() throws Exception{ public Object add() throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
@ -53,6 +56,7 @@ public class TrainingScheduleController extends BaseController {
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
trainingscheduleService.save(pd); trainingscheduleService.save(pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData", JSON.toJSONString(pd));
return map; return map;
} }
@ -62,6 +66,7 @@ public class TrainingScheduleController extends BaseController {
*/ */
@RequestMapping(value="/delete") @RequestMapping(value="/delete")
@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";
@ -69,6 +74,7 @@ public class TrainingScheduleController extends BaseController {
pd = this.getPageData(); pd = this.getPageData();
trainingscheduleService.delete(pd); trainingscheduleService.delete(pd);
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
map.put("dockData", JSON.toJSONString(pd)); //返回结果
return map; return map;
} }
@ -78,6 +84,7 @@ public class TrainingScheduleController extends BaseController {
*/ */
@RequestMapping(value="/edit") @RequestMapping(value="/edit")
@ResponseBody @ResponseBody
@DockAnnotation
public Object edit() throws Exception{ public Object edit() throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
@ -87,6 +94,7 @@ public class TrainingScheduleController extends BaseController {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
trainingscheduleService.edit(pd); trainingscheduleService.edit(pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData", JSON.toJSONString(pd));
return map; return map;
} }

View File

@ -6,6 +6,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.zcloud.aspect.DockAnnotation;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -48,6 +49,7 @@ public class VideoController extends BaseController {
@RequestMapping(value="/add") @RequestMapping(value="/add")
@RequiresPermissions("video:add") @RequiresPermissions("video: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";
@ -60,6 +62,7 @@ public class VideoController extends BaseController {
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否 pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
pd.put("TYPE", "0"); //是否置顶 0否 1是 pd.put("TYPE", "0"); //是否置顶 0否 1是
// pd.put("CORPINFO_TYPE", "1"); //上传状态(管理员上传 0企业上传1 // pd.put("CORPINFO_TYPE", "1"); //上传状态(管理员上传 0企业上传1
List<String> fileList = new ArrayList<>();
if (null != file && !file.isEmpty()) { if (null != file && !file.isEmpty()) {
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) { if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
@ -76,9 +79,12 @@ public class VideoController extends BaseController {
//pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); //pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
Smb.sshSftp(file, fileName,Const.HTTPFILEURL + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(file, fileName,Const.HTTPFILEURL + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("FILEPATH", Const.HTTPFILEURL + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("FILEPATH", Const.HTTPFILEURL + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
fileList.add(Const.HTTPFILEURL + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName + "@@" + fileName);
} }
videoService.save(pd); videoService.save(pd);
map.put("dockData", pd);
map.put("sendPicturesList", fileList);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
@ -90,13 +96,15 @@ public class VideoController extends BaseController {
@RequestMapping(value="/delete") @RequestMapping(value="/delete")
@RequiresPermissions("video:del") @RequiresPermissions("video:del")
@ResponseBody @ResponseBody
@DockAnnotation
public Object delete() throws Exception{ public Object delete() throws Exception{
Map<String,String> map = new HashMap<String,String>(); 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();
videoService.delete(pd); videoService.delete(pd);
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
map.put("dockData", pd);
return map; return map;
} }
@ -107,6 +115,7 @@ public class VideoController extends BaseController {
@RequestMapping(value="/edit") @RequestMapping(value="/edit")
@RequiresPermissions("video:edit") @RequiresPermissions("video:edit")
@ResponseBody @ResponseBody
@DockAnnotation
public Object edit() throws Exception{ public Object edit() throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
@ -114,6 +123,7 @@ public class VideoController extends BaseController {
pd = this.getPageData(); pd = this.getPageData();
videoService.edit(pd); videoService.edit(pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData", pd);
return map; return map;
} }
@ -150,6 +160,7 @@ public class VideoController extends BaseController {
@RequestMapping(value="/goEdit") @RequestMapping(value="/goEdit")
@RequiresPermissions("video:edit") @RequiresPermissions("video:edit")
@ResponseBody @ResponseBody
@DockAnnotation
public Object goEdit() throws Exception{ public Object goEdit() throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
@ -157,6 +168,7 @@ public class VideoController extends BaseController {
pd = this.getPageData(); pd = this.getPageData();
pd = videoService.findById(pd); //根据ID读取 pd = videoService.findById(pd); //根据ID读取
map.put("pd", pd); map.put("pd", pd);
map.put("dockData", pd);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
@ -168,6 +180,7 @@ public class VideoController extends BaseController {
@RequestMapping(value="/editZhiding") @RequestMapping(value="/editZhiding")
@RequiresPermissions("video:edit") @RequiresPermissions("video:edit")
@ResponseBody @ResponseBody
@DockAnnotation
public Object editZhiding() throws Exception{ public Object editZhiding() throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
@ -185,6 +198,7 @@ public class VideoController extends BaseController {
pd.put("TYPE", "1"); pd.put("TYPE", "1");
videoService.editZhiding(pd);//置顶信息 videoService.editZhiding(pd);//置顶信息
map.put("pd", pd); map.put("pd", pd);
map.put("dockData", pd);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }

View File

@ -1,12 +1,11 @@
package com.zcloud.controller.filemanager; package com.zcloud.controller.filemanager;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSON;
import com.zcloud.aspect.DockAnnotation;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -50,6 +49,7 @@ public class MfolderStipulateController extends BaseController {
@RequestMapping(value="/add") @RequestMapping(value="/add")
@RequiresPermissions("mfolderStipulate:add") @RequiresPermissions("mfolderStipulate:add")
@ResponseBody @ResponseBody
@DockAnnotation
public Object add() throws Exception{ public Object add() throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
@ -63,6 +63,7 @@ public class MfolderStipulateController extends BaseController {
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
pd.put("FILESIZE", ""); pd.put("FILESIZE", "");
mfolderService.save(pd); mfolderService.save(pd);
map.put("dockData", pd);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
@ -74,6 +75,7 @@ public class MfolderStipulateController extends BaseController {
@RequestMapping(value="/upload") @RequestMapping(value="/upload")
@RequiresPermissions("mfolderStipulate:add") @RequiresPermissions("mfolderStipulate:add")
@ResponseBody @ResponseBody
@DockAnnotation(hasAnnex = true)
public Object add( public Object add(
@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception{ @RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
@ -93,7 +95,9 @@ public class MfolderStipulateController extends BaseController {
// fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传 // fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传
fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName,Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(file, fileName,Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); //文件路径 pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
List<String> fileList = new ArrayList<>();
fileList.add(Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName + "@@" + fileName);
//pd.put("NAME", NAME); //文件名 //pd.put("NAME", NAME); //文件名
//pd.put("PARENT_ID", PARENT_ID); //目录ID //pd.put("PARENT_ID", PARENT_ID); //目录ID
pd.put("CTIME", DateUtil.date2Str(new Date())); //创建时间 pd.put("CTIME", DateUtil.date2Str(new Date())); //创建时间
@ -106,6 +110,8 @@ public class MfolderStipulateController extends BaseController {
pd.put("MFOLDER_ID", this.get32UUID()); //主键 pd.put("MFOLDER_ID", this.get32UUID()); //主键
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
map.put("dockData", pd);
map.put("sendPicturesList", JSON.toJSONString(fileList));
mfolderService.save(pd); //存入数据库表 mfolderService.save(pd); //存入数据库表
}else{ }else{
errInfo = "fail"; errInfo = "fail";
@ -121,6 +127,7 @@ public class MfolderStipulateController extends BaseController {
@RequestMapping(value="/editUpload") @RequestMapping(value="/editUpload")
@RequiresPermissions("mfolderStipulate:add") @RequiresPermissions("mfolderStipulate:add")
@ResponseBody @ResponseBody
@DockAnnotation(hasAnnex = true)
public Object editUpload( public Object editUpload(
@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception{ @RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
@ -128,6 +135,7 @@ public class MfolderStipulateController extends BaseController {
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
String ffile = DateUtil.getDays(), fileName = ""; String ffile = DateUtil.getDays(), fileName = "";
List<String> fileList = new ArrayList<>();
if (null != file && !file.isEmpty()) { if (null != file && !file.isEmpty()) {
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) { if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
@ -141,6 +149,8 @@ public class MfolderStipulateController extends BaseController {
fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName,Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(file, fileName,Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); //文件路径 pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); //文件路径
fileList.add(Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName + "@@" + fileName);
//pd.put("NAME", NAME); //文件名 //pd.put("NAME", NAME); //文件名
//pd.put("PARENT_ID", PARENT_ID); //目录ID //pd.put("PARENT_ID", PARENT_ID); //目录ID
pd.put("UNAME", Jurisdiction.getName()); //上传者,当前用户的姓名 pd.put("UNAME", Jurisdiction.getName()); //上传者,当前用户的姓名
@ -153,6 +163,10 @@ public class MfolderStipulateController extends BaseController {
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
} }
mfolderService.edit(pd); //存入数据库表 mfolderService.edit(pd); //存入数据库表
map.put("dockData", pd);
if (fileList.size() > 0) {
map.put("sendPicturesList", JSON.toJSONString(fileList));
}
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
return map; return map;
} }
@ -182,6 +196,7 @@ public class MfolderStipulateController extends BaseController {
*/ */
@RequestMapping(value="/uploadAll") @RequestMapping(value="/uploadAll")
@ResponseBody @ResponseBody
@DockAnnotation(hasAnnex = true)
public Object uploadAll( public Object uploadAll(
@RequestParam(value="file",required=false) MultipartFile file, @RequestParam(value="file",required=false) MultipartFile file,
@RequestParam(value="FH_ID",required=false) String MFOLDER_ID @RequestParam(value="FH_ID",required=false) String MFOLDER_ID
@ -203,6 +218,8 @@ public class MfolderStipulateController extends BaseController {
fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName,Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(file, fileName,Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); //文件路径 pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); //文件路径
List<String> fileList = new ArrayList<>();
fileList.add(Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName + "@@" + fileName);
String realName = file.getOriginalFilename(); String realName = file.getOriginalFilename();
String[] fileFullNames = realName.split("\\.");//上传文件全名 String[] fileFullNames = realName.split("\\.");//上传文件全名
String extension =fileFullNames[fileFullNames.length-1];//上传文件文件后缀 String extension =fileFullNames[fileFullNames.length-1];//上传文件文件后缀
@ -218,6 +235,8 @@ public class MfolderStipulateController extends BaseController {
pd.put("MFOLDER_ID", this.get32UUID()); //主键 pd.put("MFOLDER_ID", this.get32UUID()); //主键
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
mfolderService.save(pd); //存入数据库表 mfolderService.save(pd); //存入数据库表
map.put("dockData", pd);
map.put("sendPicturesList", JSON.toJSONString(fileList));
}else{ }else{
errInfo = "fail"; errInfo = "fail";
} }
@ -231,8 +250,9 @@ public class MfolderStipulateController extends BaseController {
@RequestMapping(value="/delete") @RequestMapping(value="/delete")
@RequiresPermissions("mfolderStipulate:del") @RequiresPermissions("mfolderStipulate:del")
@ResponseBody @ResponseBody
@DockAnnotation
public Object delete(@RequestParam String MFOLDER_ID,@RequestParam String FILEPATH) throws Exception{ public Object delete(@RequestParam String MFOLDER_ID,@RequestParam String FILEPATH) throws Exception{
Map<String,String> map = new HashMap<String,String>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd.put("parentId", MFOLDER_ID); pd.put("parentId", MFOLDER_ID);
@ -244,6 +264,7 @@ public class MfolderStipulateController extends BaseController {
} }
pd.put("MFOLDER_ID", MFOLDER_ID); pd.put("MFOLDER_ID", MFOLDER_ID);
mfolderService.delete(pd); mfolderService.delete(pd);
map.put("dockData", pd);
} }
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
return map; return map;
@ -256,12 +277,14 @@ public class MfolderStipulateController extends BaseController {
@RequestMapping(value="/edit") @RequestMapping(value="/edit")
@RequiresPermissions("mfolderStipulate:edit") @RequiresPermissions("mfolderStipulate:edit")
@ResponseBody @ResponseBody
@DockAnnotation
public Object edit() throws Exception{ public Object edit() 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();
mfolderService.edit(pd); mfolderService.edit(pd);
map.put("dockData", pd);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }

View File

@ -49,18 +49,28 @@ public class KeyprojectCheckController extends BaseController {
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();
PageData KEYPROJECTCHECK = new PageData();
// PageData KEYPROJECTCHECKINFO = new PageData();
// PageData HIDDEN = new PageData();
pd = this.getPageData(); pd = this.getPageData();
pd.put("KEYPROJECTCHECK_ID", this.get32UUID()); //主键 pd.put("KEYPROJECTCHECK_ID", this.get32UUID()); //主键
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("ISDELETE", 0); //是否删除 pd.put("ISDELETE", 0); //是否删除
pd.put("SOURCE", 1); //企业ID pd.put("SOURCE", 1); //企业ID
keyprojectcheckService.save(pd); keyprojectcheckService.save(pd);
KEYPROJECTCHECK.putAll(pd);
String currentTime = DateUtil.date2Str(new Date()); String currentTime = DateUtil.date2Str(new Date());
if (Tools.notEmpty(pd.getString("SITUATIONJSON"))) { if (Tools.notEmpty(pd.getString("SITUATIONJSON"))) {
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.getString("SITUATIONJSON")); List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.getString("SITUATIONJSON"));
String time = currentTime; String time = currentTime;
List situationPdList = new ArrayList<>();
for (JSONObject json : list) { for (JSONObject json : list) {
PageData situationPd = new PageData(); PageData situationPd = new PageData();
situationPd.put("KEYPROJECTCHECKINFO_ID", UuidUtil.get32UUID()); //主键 situationPd.put("KEYPROJECTCHECKINFO_ID", UuidUtil.get32UUID()); //主键
@ -72,8 +82,11 @@ public class KeyprojectCheckController extends BaseController {
situationPd.put("OPERATOR", pd.getString("OPERATOR")); //修改人 situationPd.put("OPERATOR", pd.getString("OPERATOR")); //修改人
situationPd.put("OPERATTIME", time); //修改时间 situationPd.put("OPERATTIME", time); //修改时间
keyprojectcheckInfoService.save(situationPd); keyprojectcheckInfoService.save(situationPd);
situationPdList.add(situationPd);
time = DateUtil.calculateDateSecond(time, 1); time = DateUtil.calculateDateSecond(time, 1);
} }
pd.put("KEYPROJECTCHECKINFO",situationPdList);
// p2.putAll(pd);
} }
if (Tools.notEmpty(pd.getString("HIDDENJSON"))) { if (Tools.notEmpty(pd.getString("HIDDENJSON"))) {
@ -110,7 +123,7 @@ public class KeyprojectCheckController extends BaseController {
hiddenList.add(hidden); hiddenList.add(hidden);
time = DateUtil.calculateDateSecond(time, 1); time = DateUtil.calculateDateSecond(time, 1);
} }
pd.put("hiddenList", hiddenList); pd.put("HIDDEN", hiddenList);
} }
map.put("pd", pd); map.put("pd", pd);
map.put("dockData", JSON.toJSONString(pd)); map.put("dockData", JSON.toJSONString(pd));

View File

@ -5,7 +5,6 @@ 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;
import com.zcloud.entity.system.Department;
import com.zcloud.service.bus.ImgFilesService; import com.zcloud.service.bus.ImgFilesService;
import com.zcloud.service.keyProjects.AIWarningService; import com.zcloud.service.keyProjects.AIWarningService;
import com.zcloud.service.keyProjects.OutSourcedService; import com.zcloud.service.keyProjects.OutSourcedService;
@ -15,7 +14,6 @@ import com.zcloud.service.system.UsersService;
import com.zcloud.util.*; import com.zcloud.util.*;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.session.Session;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -59,7 +57,7 @@ public class OutSourcedController extends BaseController {
@RequestMapping(value = "/add") @RequestMapping(value = "/add")
@RequiresPermissions("outsourced:add") @RequiresPermissions("outsourced:add")
@ResponseBody @ResponseBody
@DockAnnotation(isAdd = true,hasAnnex = true) @DockAnnotation(isAdd = true, hasAnnex = true)
public Object add(@RequestParam(value = "file", required = false) MultipartFile file, public Object add(@RequestParam(value = "file", required = false) MultipartFile file,
@RequestParam(value = "file1", required = false) MultipartFile file1, @RequestParam(value = "file1", required = false) MultipartFile file1,
@RequestParam(value = "file2", required = false) MultipartFile file2, @RequestParam(value = "file2", required = false) MultipartFile file2,
@ -238,7 +236,7 @@ public class OutSourcedController extends BaseController {
pdImg.put("FILEPATH", Const.FILEPATHYHTP + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pdImg.put("FILEPATH", Const.FILEPATHYHTP + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
pdImg.put("TYPE", "300"); pdImg.put("TYPE", "300");
pdImg.put("FOREIGN_KEY", pd.getString("OUTSOURCED_ID")); pdImg.put("FOREIGN_KEY", pd.getString("OUTSOURCED_ID"));
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");
imgfilesService.save(pdImg); imgfilesService.save(pdImg);
} }
} }
@ -250,7 +248,7 @@ public class OutSourcedController extends BaseController {
//} //}
pd.put("INVOLVING_CORPS", Jurisdiction.getCORPINFO_ID()); pd.put("INVOLVING_CORPS", Jurisdiction.getCORPINFO_ID());
outsourcedService.save(pd); outsourcedService.save(pd);
map.put("sendPicturesList",strings); pd.put("pictList",strings);
map.put("dockData", JSON.toJSONString(pd)); map.put("dockData", JSON.toJSONString(pd));
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
@ -445,8 +443,7 @@ public class OutSourcedController extends BaseController {
pdImg.put("TYPE", "300"); pdImg.put("TYPE", "300");
pdImg.put("FOREIGN_KEY", pd.getString("OUTSOURCED_ID")); pdImg.put("FOREIGN_KEY", pd.getString("OUTSOURCED_ID"));
imgfilesService.save(pdImg); imgfilesService.save(pdImg);
Smb.sshSftp(file9One, fileName, Const.FILEPATHYHTP + Jurisdiction.getCORPINFO_ID() + "/" + ffile Smb.sshSftp(file9One, fileName, Const.FILEPATHYHTP + Jurisdiction.getCORPINFO_ID() + "/" + ffile, IMGFILES_ID, pd.getString("OUTSOURCED_ID"), "300");
,IMGFILES_ID,pd.getString("OUTSOURCED_ID"),"300");
} }

View File

@ -56,11 +56,12 @@ public class AppKeyprojectCheckController extends BaseController {
*/ */
@RequestMapping(value="/add") @RequestMapping(value="/add")
@ResponseBody @ResponseBody
@DockAnnotation(isAdd = true) @DockAnnotation(hasAnnex = true)
public Object add() throws Exception{ public Object add() 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();
PageData KEYPROJECTCHECK = new PageData();
pd = this.getPageData(); pd = this.getPageData();
pd.put("KEYPROJECTCHECK_ID", this.get32UUID()); //主键 pd.put("KEYPROJECTCHECK_ID", this.get32UUID()); //主键
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
@ -71,8 +72,9 @@ public class AppKeyprojectCheckController extends BaseController {
ArrayList<PageData> parm2List = new ArrayList<>(); ArrayList<PageData> parm2List = new ArrayList<>();
ArrayList<PageData> parm3List = new ArrayList<>(); ArrayList<PageData> parm3List = new ArrayList<>();
parm1.putAll(pd); // parm1.putAll(pd);
keyprojectcheckService.save(parm1); keyprojectcheckService.save(pd);
KEYPROJECTCHECK.putAll(pd);
@ -95,6 +97,7 @@ public class AppKeyprojectCheckController extends BaseController {
parm2List.add(situationPd); parm2List.add(situationPd);
time = DateUtil.calculateDateSecond(time, 1); time = DateUtil.calculateDateSecond(time, 1);
} }
pd.put("KEYPROJECTCHECKINFO",parm2List);
} }
Boolean boo = false; // 增加开关控制 Boolean boo = false; // 增加开关控制
if (Tools.notEmpty(pd.getString("HIDDENJSON"))) { if (Tools.notEmpty(pd.getString("HIDDENJSON"))) {
@ -130,12 +133,12 @@ public class AppKeyprojectCheckController extends BaseController {
keyprojectHiddenService.save(hidden); keyprojectHiddenService.save(hidden);
parm3List.add(hidden); // parm3List.add(hidden);
hiddenList.add(hidden); hiddenList.add(hidden);
time = DateUtil.calculateDateSecond(time, 1); time = DateUtil.calculateDateSecond(time, 1);
} }
pd.put("hiddenList", hiddenList); pd.put("HIDDEN", JSON.toJSONString(hiddenList));
} }
try { try {
//这里发送短信 通知 先判断重点工程是否要求发短信, 不发直接过,发的话 找到对应人以及对应手机号 发送对应模板短信啊 //这里发送短信 通知 先判断重点工程是否要求发短信, 不发直接过,发的话 找到对应人以及对应手机号 发送对应模板短信啊
@ -187,12 +190,8 @@ public class AppKeyprojectCheckController extends BaseController {
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
}finally { }finally {
PageData pageData = new PageData();
pageData.put("p1",parm1);
pageData.put("p1",parm1);
pageData.put("p1",parm1);
map.put("pd",pd); map.put("pd",pd);
map.put("dockData", JSON.toJSONString(pageData)); map.put("dockData", JSON.toJSONString(pd));
map.put("result", errInfo); map.put("result", errInfo);
} }
return map; return map;
@ -267,8 +266,8 @@ public class AppKeyprojectCheckController extends BaseController {
List<PageData> situationList = keyprojectcheckInfoService.listAll(pd); List<PageData> situationList = keyprojectcheckInfoService.listAll(pd);
pd.put("FOREIGN_ID", pd.getString("KEYPROJECTCHECK_ID")); pd.put("FOREIGN_ID", pd.getString("KEYPROJECTCHECK_ID"));
pd.put("hiddenList", keyprojectHiddenService.listAllInspection(pd)); pd.put("hiddenList", JSON.toJSONString(keyprojectHiddenService.listAllInspection(pd)));
pd.put("situationList", situationList); pd.put("situationList", JSON.toJSONString(situationList));
map.put("pd", pd); map.put("pd", pd);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
@ -338,6 +337,7 @@ public class AppKeyprojectCheckController extends BaseController {
@RequestMapping(value="/check") @RequestMapping(value="/check")
@ResponseBody @ResponseBody
@Transactional @Transactional
@DockAnnotation
public Object check() throws Exception{ public Object check() throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
@ -347,6 +347,7 @@ public class AppKeyprojectCheckController extends BaseController {
keyprojectHiddenService.editstate(pd); keyprojectHiddenService.editstate(pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData", JSON.toJSONString(pd));
return map; return map;
} }
/** /**
@ -356,12 +357,14 @@ public class AppKeyprojectCheckController extends BaseController {
@RequestMapping(value="/editHiddenIspunish") @RequestMapping(value="/editHiddenIspunish")
@ResponseBody @ResponseBody
@Transactional @Transactional
@DockAnnotation
public Object editHiddenIspunish() throws Exception{ public Object editHiddenIspunish() 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();
keyprojectHiddenService.editstate(pd); keyprojectHiddenService.editstate(pd);
map.put("dockData", JSON.toJSONString(pd));
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }

View File

@ -1,7 +1,9 @@
package com.zcloud.controller.keyProjects.app; package com.zcloud.controller.keyProjects.app;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
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;
@ -55,6 +57,7 @@ public class AppKeyprojectPunishController extends BaseController {
*/ */
@RequestMapping(value="/add") @RequestMapping(value="/add")
@ResponseBody @ResponseBody
@DockAnnotation(isAdd = true)
public Object add() throws Exception{ public Object add() throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
@ -101,6 +104,7 @@ public class AppKeyprojectPunishController extends BaseController {
}finally { }finally {
map.put("result", errInfo); map.put("result", errInfo);
} }
map.put("dockData", JSON.toJSONString(pd));
return map; return map;
} }
@ -136,7 +140,7 @@ public class AppKeyprojectPunishController extends BaseController {
// String fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传 // String fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传
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("HANDLE_IMG", Const.FILEPATHFILE + ffile + "/" + fileName); pd.put("HANDLE_IMG", Const.FILEPATHFILE + pd.get("HANDLEDID") + "/" + ffile + "/" + fileName);
} }
} }
keyprojectpunishService.editstate(pd); keyprojectpunishService.editstate(pd);

View File

@ -1,5 +1,7 @@
package com.zcloud.controller.onlinexxks; package com.zcloud.controller.onlinexxks;
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;
@ -46,11 +48,13 @@ public class CurriculumController extends BaseController {
@RequestMapping(value="/add") @RequestMapping(value="/add")
@RequiresPermissions("curriculum:add") @RequiresPermissions("curriculum:add")
@ResponseBody @ResponseBody
@DockAnnotation(hasAnnex = true)
public Object add(@RequestParam(value="FFILE",required=false) MultipartFile FFILE) throws Exception{ public Object add(@RequestParam(value="FFILE",required=false) MultipartFile FFILE) 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();
ArrayList<String> sendPicturesList = new ArrayList<>();
pd.put("CURRICULUM_ID", this.get32UUID()); //主键 pd.put("CURRICULUM_ID", this.get32UUID()); //主键
pd.put("CREATOR", Jurisdiction.getUsername()); //添加人 pd.put("CREATOR", Jurisdiction.getUsername()); //添加人
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
@ -74,10 +78,13 @@ public class CurriculumController extends BaseController {
String fileName = this.get32UUID()+FFILE.getOriginalFilename().substring(FFILE.getOriginalFilename().lastIndexOf(".")); String fileName = this.get32UUID()+FFILE.getOriginalFilename().substring(FFILE.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(FFILE, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(FFILE, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("CAPTURE", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("CAPTURE", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
sendPicturesList.add(pd.getString("CAPTURE")+"@@"+fileName);
} }
curriculumService.save(pd); curriculumService.save(pd);
map.put("pd", pd); map.put("pd", pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("sendPicturesList", JSON.toJSONString(sendPicturesList));
map.put("dockData", JSON.toJSONString(pd));
return map; return map;
} }
@ -88,6 +95,7 @@ public class CurriculumController extends BaseController {
@RequestMapping(value="/delete") @RequestMapping(value="/delete")
@RequiresPermissions("curriculum:del") @RequiresPermissions("curriculum: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";
@ -104,6 +112,7 @@ public class CurriculumController extends BaseController {
} }
curriculumService.delete(pd); curriculumService.delete(pd);
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
map.put("dockData", JSON.toJSONString(pd)); //返回结果
return map; return map;
} }
@ -114,11 +123,13 @@ public class CurriculumController extends BaseController {
@RequestMapping(value="/edit") @RequestMapping(value="/edit")
@RequiresPermissions("curriculum:edit") @RequiresPermissions("curriculum:edit")
@ResponseBody @ResponseBody
@DockAnnotation(hasAnnex = true)
public Object edit(@RequestParam(value="FFILE",required=false) MultipartFile FFILE) throws Exception{ public Object edit(@RequestParam(value="FFILE",required=false) MultipartFile FFILE) 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();
ArrayList<String> sendPicturesList = new ArrayList<>();
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
if (null != FFILE && !FFILE.isEmpty()) { if (null != FFILE && !FFILE.isEmpty()) {
@ -137,10 +148,13 @@ public class CurriculumController extends BaseController {
String fileName = this.get32UUID()+FFILE.getOriginalFilename().substring(FFILE.getOriginalFilename().lastIndexOf(".")); String fileName = this.get32UUID()+FFILE.getOriginalFilename().substring(FFILE.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(FFILE, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(FFILE, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("CAPTURE", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("CAPTURE", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
sendPicturesList.add(pd.getString("CAPTURE")+"@@"+fileName);
} }
curriculumService.edit(pd); curriculumService.edit(pd);
map.put("pd", pd); map.put("pd", pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("sendPicturesList", JSON.toJSONString(sendPicturesList));
map.put("dockData",JSON.toJSONString(pd));
return map; return map;
} }

View File

@ -1,5 +1,7 @@
package com.zcloud.controller.onlinexxks; package com.zcloud.controller.onlinexxks;
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;
@ -42,12 +44,14 @@ public class DataCoursewareController extends BaseController {
@RequestMapping(value="/add") @RequestMapping(value="/add")
@RequiresPermissions("courseware:add") @RequiresPermissions("courseware:add")
@ResponseBody @ResponseBody
@DockAnnotation
public Object add(@RequestParam(value="cfile",required=false) MultipartFile cfile, public Object add(@RequestParam(value="cfile",required=false) MultipartFile cfile,
@RequestParam(value="ccfile",required=false) MultipartFile ccfile) throws Exception{ @RequestParam(value="ccfile",required=false) MultipartFile ccfile) 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();
ArrayList<String> sendPicturesList = new ArrayList<>();
pd.put("DATACOURSEWARE_ID", this.get32UUID()); //主键 pd.put("DATACOURSEWARE_ID", this.get32UUID()); //主键
pd.put("CREATOR", Jurisdiction.getUsername()); //添加人 pd.put("CREATOR", Jurisdiction.getUsername()); //添加人
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
@ -72,6 +76,7 @@ public class DataCoursewareController extends BaseController {
String fileName = this.get32UUID()+cfile.getOriginalFilename().substring(cfile.getOriginalFilename().lastIndexOf(".")); String fileName = this.get32UUID()+cfile.getOriginalFilename().substring(cfile.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(cfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(cfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("COURSEWAREFILES", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("COURSEWAREFILES", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
sendPicturesList.add(pd.getString("COURSEWAREFILES")+"@@"+fileName);
} }
if (null != ccfile && !ccfile.isEmpty()) { if (null != ccfile && !ccfile.isEmpty()) {
String suffixName = ccfile.getOriginalFilename().substring(ccfile.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); String suffixName = ccfile.getOriginalFilename().substring(ccfile.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
@ -89,9 +94,12 @@ public class DataCoursewareController extends BaseController {
String fileName = this.get32UUID()+ccfile.getOriginalFilename().substring(ccfile.getOriginalFilename().lastIndexOf(".")); String fileName = this.get32UUID()+ccfile.getOriginalFilename().substring(ccfile.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(ccfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(ccfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("COURSEWARECAPTURE", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("COURSEWARECAPTURE", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
sendPicturesList.add(pd.getString("COURSEWARECAPTURE")+"@@"+fileName);
} }
datacoursewareService.save(pd); datacoursewareService.save(pd);
map.put("pd", pd); map.put("pd", pd);
map.put("dockData", JSON.toJSONString(pd));
map.put("sendPicturesList", JSON.toJSONString(sendPicturesList));
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
@ -103,6 +111,7 @@ public class DataCoursewareController extends BaseController {
@RequestMapping(value="/delete") @RequestMapping(value="/delete")
@RequiresPermissions("courseware:del") @RequiresPermissions("courseware: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";
@ -126,6 +135,7 @@ public class DataCoursewareController extends BaseController {
questionService.deleteByCoursewareIds(pd); questionService.deleteByCoursewareIds(pd);
datacoursewareService.delete(pd); datacoursewareService.delete(pd);
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
map.put("dockData", JSON.toJSONString(pd)); //返回结果
return map; return map;
} }
@ -136,13 +146,14 @@ public class DataCoursewareController extends BaseController {
@RequestMapping(value="/edit") @RequestMapping(value="/edit")
@RequiresPermissions("courseware:edit") @RequiresPermissions("courseware:edit")
@ResponseBody @ResponseBody
@DockAnnotation
public Object edit(@RequestParam(value="cfile",required=false) MultipartFile cfile, public Object edit(@RequestParam(value="cfile",required=false) MultipartFile cfile,
@RequestParam(value="ccfile",required=false) MultipartFile ccfile) throws Exception{ @RequestParam(value="ccfile",required=false) MultipartFile ccfile) 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();
ArrayList<String> sendPicturesList = new ArrayList<>();
PageData d = datacoursewareService.findById(pd); PageData d = datacoursewareService.findById(pd);
//已经不修改了,还删附件是什么意思 //已经不修改了,还删附件是什么意思
// Smb.deleteFile(d.getString("COURSEWAREFILES")); // Smb.deleteFile(d.getString("COURSEWAREFILES"));
@ -165,6 +176,7 @@ public class DataCoursewareController extends BaseController {
String fileName = this.get32UUID()+cfile.getOriginalFilename().substring(cfile.getOriginalFilename().lastIndexOf(".")); String fileName = this.get32UUID()+cfile.getOriginalFilename().substring(cfile.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(cfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(cfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("COURSEWAREFILES", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("COURSEWAREFILES", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
sendPicturesList.add(pd.getString("COURSEWAREFILES")+"@@"+fileName);
} }
if (null != ccfile) { if (null != ccfile) {
String suffixName = ccfile.getOriginalFilename().substring(ccfile.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); String suffixName = ccfile.getOriginalFilename().substring(ccfile.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
@ -182,10 +194,13 @@ public class DataCoursewareController extends BaseController {
String fileName = this.get32UUID()+ccfile.getOriginalFilename().substring(ccfile.getOriginalFilename().lastIndexOf(".")); String fileName = this.get32UUID()+ccfile.getOriginalFilename().substring(ccfile.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(ccfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(ccfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("COURSEWARECAPTURE", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("COURSEWARECAPTURE", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
sendPicturesList.add(pd.getString("COURSEWARECAPTURE")+"@@"+fileName);
} }
datacoursewareService.edit(pd); datacoursewareService.edit(pd);
map.put("pd", pd); map.put("pd", pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData",JSON.toJSONString(pd));
map.put("sendPicturesList", JSON.toJSONString(sendPicturesList));
return map; return map;
} }
@ -355,6 +370,7 @@ public class DataCoursewareController extends BaseController {
@RequestMapping(value="/editState") @RequestMapping(value="/editState")
@RequiresPermissions("courseware:edit") @RequiresPermissions("courseware:edit")
@ResponseBody @ResponseBody
@DockAnnotation
public Object editState() throws Exception{ public Object editState() throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
@ -364,6 +380,7 @@ public class DataCoursewareController extends BaseController {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
datacoursewareService.editByState(pd); datacoursewareService.editByState(pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData",JSON.toJSONString(pd));
return map; return map;
} }
} }

View File

@ -1,5 +1,7 @@
package com.zcloud.controller.onlinexxks; package com.zcloud.controller.onlinexxks;
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;
@ -42,6 +44,7 @@ public class QuestionController extends BaseController {
@RequestMapping(value="/add") @RequestMapping(value="/add")
@RequiresPermissions( value = {"question:add" , "courseware:add"}, logical = Logical.OR) @RequiresPermissions( value = {"question:add" , "courseware:add"}, logical = Logical.OR)
@ResponseBody @ResponseBody
@DockAnnotation
public Object add() throws Exception{ public Object add() throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
@ -56,6 +59,7 @@ public class QuestionController extends BaseController {
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
questionService.save(pd); questionService.save(pd);
map.put("pd", pd); map.put("pd", pd);
map.put("dockData", JSON.toJSONString(pd));
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
@ -67,6 +71,7 @@ public class QuestionController extends BaseController {
@RequestMapping(value="/delete") @RequestMapping(value="/delete")
@RequiresPermissions( value = {"question:del" , "courseware:del"}, logical = Logical.OR) @RequiresPermissions( value = {"question:del" , "courseware:del"}, logical = Logical.OR)
@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";
@ -76,6 +81,7 @@ public class QuestionController extends BaseController {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
questionService.delete(pd); questionService.delete(pd);
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
map.put("dockData", JSON.toJSONString(pd)); //返回结果
return map; return map;
} }
@ -86,11 +92,19 @@ public class QuestionController extends BaseController {
@RequestMapping(value="/edit") @RequestMapping(value="/edit")
@RequiresPermissions( value = {"question:edit" , "courseware:edit"}, logical = Logical.OR) @RequiresPermissions( value = {"question:edit" , "courseware:edit"}, logical = Logical.OR)
@ResponseBody @ResponseBody
@DockAnnotation
public Object edit() throws Exception{ public Object edit() 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();
if (Tools.notEmpty(pd.getString("dockData"))) {
// 咱们的对接流程 如有异常 使用 throw new BizException();
PageData dockData = JSON.parseObject(pd.getString("dockData"), PageData.class);
// 正常返回
return ReturnMap.ok();
}
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
questionService.edit(pd); questionService.edit(pd);
@ -147,6 +161,7 @@ public class QuestionController extends BaseController {
@RequestMapping(value="/deleteAll") @RequestMapping(value="/deleteAll")
@RequiresPermissions( value = {"question:del" , "courseware:del"}, logical = Logical.OR) @RequiresPermissions( value = {"question:del" , "courseware:del"}, logical = Logical.OR)
@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";
@ -160,6 +175,8 @@ public class QuestionController extends BaseController {
pd.put("ArrayDATA_IDS", ArrayDATA_IDS); //待删除ids pd.put("ArrayDATA_IDS", ArrayDATA_IDS); //待删除ids
questionService.deleteAll(pd); questionService.deleteAll(pd);
errInfo = "success"; errInfo = "success";
map.put("dockData", JSON.toJSONString(pd)); //返回结果
}else{ }else{
errInfo = "fail"; errInfo = "fail";
} }
@ -293,13 +310,14 @@ public class QuestionController extends BaseController {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ResponseBody @ResponseBody
@Transactional @Transactional
@DockAnnotation
public Object readExcel2(@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception{ public Object readExcel2(@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception{
Map<String,String> map = new HashMap<String,String>(); Map<String,String> map = new HashMap<String,String>();
String errInfo = "success"; String errInfo = "success";
StringBuffer errorStr = new StringBuffer(); StringBuffer errorStr = new StringBuffer();
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); // COURSEWAREID pd = this.getPageData(); // COURSEWAREID
ArrayList<PageData> dataArrayList = new ArrayList<>();
if (null != file && !file.isEmpty()) { if (null != file && !file.isEmpty()) {
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase(); String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
if (!"xls".equals(suffixName)) { if (!"xls".equals(suffixName)) {
@ -446,6 +464,7 @@ public class QuestionController extends BaseController {
pageData.put("ISDELETE", "0"); //是否删除(0:有效 1删除) pageData.put("ISDELETE", "0"); //是否删除(0:有效 1删除)
pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
questionService.save(pageData); questionService.save(pageData);
dataArrayList.add(pageData);
} }
errorStr.append("成功导入"+listAll.size()+"条数据!"); errorStr.append("成功导入"+listAll.size()+"条数据!");
}else { }else {
@ -472,6 +491,8 @@ public class QuestionController extends BaseController {
map.put("msg",errorStr.toString()); //返回结果 map.put("msg",errorStr.toString()); //返回结果
map.put("isExcel","1"); //返回类型 map.put("isExcel","1"); //返回类型
map.put("resultStr", errorStr.toString()); map.put("resultStr", errorStr.toString());
pd.put("dataArrayList",dataArrayList);
map.put("dockData", JSON.toJSONString(pd));
return map; return map;
} }
} }

View File

@ -1,5 +1,7 @@
package com.zcloud.controller.onlinexxks; package com.zcloud.controller.onlinexxks;
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;
@ -40,6 +42,7 @@ public class StageexampaperInputController extends BaseController {
@RequestMapping(value="/add") @RequestMapping(value="/add")
@RequiresPermissions( value = {"stageexampaper:add", "curriculum:add"}, logical = Logical.OR) @RequiresPermissions( value = {"stageexampaper:add", "curriculum:add"}, logical = Logical.OR)
@ResponseBody @ResponseBody
@DockAnnotation
public Object add() throws Exception{ public Object add() throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
@ -58,6 +61,7 @@ public class StageexampaperInputController extends BaseController {
List<PageData> saveStageList = stageexampaperinputService.getSaveStage(pd); List<PageData> saveStageList = stageexampaperinputService.getSaveStage(pd);
if(null != saveStageList){ if(null != saveStageList){
pd.put("saveStageList",saveStageList);
stageexampaperinputService.save(pd); stageexampaperinputService.save(pd);
stageExamPaperInputQuestionService.saveAll(pd, saveStageList); stageExamPaperInputQuestionService.saveAll(pd, saveStageList);
}else{ }else{
@ -65,6 +69,7 @@ public class StageexampaperInputController extends BaseController {
map.put("msg", "培训行业类型或岗位培训类型对应的习题数量不足,无法生成试卷,请重新选择!"); map.put("msg", "培训行业类型或岗位培训类型对应的习题数量不足,无法生成试卷,请重新选择!");
} }
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData", JSON.toJSONString(pd));
return map; return map;
} }
@ -75,6 +80,7 @@ public class StageexampaperInputController extends BaseController {
@RequestMapping(value="/delete") @RequestMapping(value="/delete")
@RequiresPermissions( value = {"stageexampaper:del", "curriculum:del"}, logical = Logical.OR) @RequiresPermissions( value = {"stageexampaper:del", "curriculum:del"}, logical = Logical.OR)
@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";
@ -82,6 +88,7 @@ public class StageexampaperInputController extends BaseController {
pd = this.getPageData(); pd = this.getPageData();
stageexampaperinputService.delete(pd); stageexampaperinputService.delete(pd);
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
map.put("dockData", JSON.toJSONString(pd)); //返回结果
return map; return map;
} }
@ -257,6 +264,7 @@ public class StageexampaperInputController extends BaseController {
@RequestMapping(value="/editState") @RequestMapping(value="/editState")
@RequiresPermissions( value = {"stageexampaper:edit", "curriculum:edit"}, logical = Logical.OR) @RequiresPermissions( value = {"stageexampaper:edit", "curriculum:edit"}, logical = Logical.OR)
@ResponseBody @ResponseBody
@DockAnnotation
public Object editState() throws Exception{ public Object editState() throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
@ -266,6 +274,7 @@ public class StageexampaperInputController extends BaseController {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //操作时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //操作时间
stageexampaperinputService.editState(pd); stageexampaperinputService.editState(pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData", JSON.toJSONString(pd));
return map; return map;
} }
} }

View File

@ -1,5 +1,7 @@
package com.zcloud.controller.onlinexxks; package com.zcloud.controller.onlinexxks;
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;
@ -44,6 +46,7 @@ public class StudyTaskController extends BaseController {
@RequestMapping(value="/add") @RequestMapping(value="/add")
@RequiresPermissions("studytask:add") @RequiresPermissions("studytask:add")
@ResponseBody @ResponseBody
@DockAnnotation
public Object add() throws Exception{ public Object add() throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
@ -73,6 +76,7 @@ public class StudyTaskController extends BaseController {
stageStudentRelationService.saveFromPagerV2(pd); // 任务-人员 stageStudentRelationService.saveFromPagerV2(pd); // 任务-人员
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData", JSON.toJSONString(pd));
return map; return map;
} }

View File

@ -57,6 +57,7 @@ public class VideoCoursewareController extends BaseController {
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
ArrayList<String> sendPicturesList = new ArrayList<>();
pd.put("VIDEOCOURSEWARE_ID", this.get32UUID()); //主键 pd.put("VIDEOCOURSEWARE_ID", this.get32UUID()); //主键
pd.put("CREATOR", Jurisdiction.getUsername()); //添加人 pd.put("CREATOR", Jurisdiction.getUsername()); //添加人
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
@ -81,6 +82,7 @@ public class VideoCoursewareController extends BaseController {
String fileName = this.get32UUID() + vfile.getOriginalFilename().substring(vfile.getOriginalFilename().lastIndexOf(".")); String fileName = this.get32UUID() + vfile.getOriginalFilename().substring(vfile.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(vfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(vfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("VIDEOFILES", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("VIDEOFILES", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
sendPicturesList.add(pd.getString("VIDEOFILES")+"@@"+fileName);
// 将MultipartFile file转换成为File // 将MultipartFile file转换成为File
File f_file = FileUtil.MultipartFileToFile(vfile); File f_file = FileUtil.MultipartFileToFile(vfile);
MultimediaObject instance = new MultimediaObject(f_file); MultimediaObject instance = new MultimediaObject(f_file);
@ -107,10 +109,12 @@ public class VideoCoursewareController extends BaseController {
String fileName = this.get32UUID() + vcfile.getOriginalFilename().substring(vcfile.getOriginalFilename().lastIndexOf(".")); String fileName = this.get32UUID() + vcfile.getOriginalFilename().substring(vcfile.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(vcfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(vcfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("VIDEOCAPTURE", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("VIDEOCAPTURE", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
sendPicturesList.add(pd.getString("VIDEOCAPTURE")+"@@"+fileName);
} }
videocoursewareService.save(pd); videocoursewareService.save(pd);
map.put("pd", pd); map.put("pd", pd);
map.put("dockData", JSON.toJSONString(pd)); map.put("dockData", JSON.toJSONString(pd));
map.put("sendPicturesList", JSON.toJSONString(sendPicturesList));
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
@ -124,6 +128,7 @@ public class VideoCoursewareController extends BaseController {
@RequestMapping(value = "/delete") @RequestMapping(value = "/delete")
@RequiresPermissions("courseware:del") @RequiresPermissions("courseware: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";
@ -148,6 +153,7 @@ public class VideoCoursewareController extends BaseController {
questionService.deleteByCoursewareIds(pd); questionService.deleteByCoursewareIds(pd);
videocoursewareService.delete(pd); videocoursewareService.delete(pd);
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
map.put("dockData", JSON.toJSONString(pd)); //返回结果
return map; return map;
} }
@ -160,6 +166,7 @@ public class VideoCoursewareController extends BaseController {
@RequestMapping(value = "/edit") @RequestMapping(value = "/edit")
@RequiresPermissions("courseware:edit") @RequiresPermissions("courseware:edit")
@ResponseBody @ResponseBody
@DockAnnotation(hasAnnex = true)
public Object edit(@RequestParam(value = "vfile", required = false) MultipartFile vfile, public Object edit(@RequestParam(value = "vfile", required = false) MultipartFile vfile,
@RequestParam(value = "vcfile", required = false) MultipartFile vcfile) throws Exception { @RequestParam(value = "vcfile", required = false) MultipartFile vcfile) throws Exception {
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
@ -167,6 +174,7 @@ public class VideoCoursewareController extends BaseController {
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
PageData d = videocoursewareService.findById(pd); PageData d = videocoursewareService.findById(pd);
ArrayList<String> sendPicturesList = new ArrayList<>();
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
if (null != vfile) { if (null != vfile) {
@ -185,6 +193,7 @@ public class VideoCoursewareController extends BaseController {
String fileName = this.get32UUID() + vfile.getOriginalFilename().substring(vfile.getOriginalFilename().lastIndexOf(".")); String fileName = this.get32UUID() + vfile.getOriginalFilename().substring(vfile.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(vfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(vfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("VIDEOFILES", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("VIDEOFILES", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
sendPicturesList.add(pd.getString("VIDEOFILES")+"@@"+fileName);
// 将MultipartFile file转换成为File // 将MultipartFile file转换成为File
File f_file = FileUtil.MultipartFileToFile(vfile); File f_file = FileUtil.MultipartFileToFile(vfile);
MultimediaObject instance = new MultimediaObject(f_file); MultimediaObject instance = new MultimediaObject(f_file);
@ -211,9 +220,12 @@ public class VideoCoursewareController extends BaseController {
String fileName = this.get32UUID() + vcfile.getOriginalFilename().substring(vcfile.getOriginalFilename().lastIndexOf(".")); String fileName = this.get32UUID() + vcfile.getOriginalFilename().substring(vcfile.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(vcfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(vcfile, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("VIDEOCAPTURE", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("VIDEOCAPTURE", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
sendPicturesList.add(pd.getString("VIDEOCAPTURE")+"@@"+fileName);
} }
videocoursewareService.edit(pd); videocoursewareService.edit(pd);
map.put("pd", pd); map.put("pd", pd);
map.put("dockData", JSON.toJSONString(pd));
map.put("sendPicturesList", JSON.toJSONString(sendPicturesList));
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
@ -379,6 +391,7 @@ public class VideoCoursewareController extends BaseController {
@RequestMapping(value = "/editState") @RequestMapping(value = "/editState")
@RequiresPermissions("courseware:edit") @RequiresPermissions("courseware:edit")
@ResponseBody @ResponseBody
@DockAnnotation
public Object editState() throws Exception { public Object editState() throws Exception {
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success"; String errInfo = "success";
@ -388,6 +401,7 @@ public class VideoCoursewareController extends BaseController {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
videocoursewareService.editByState(pd); videocoursewareService.editByState(pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData", JSON.toJSONString(pd));
return map; return map;
} }
} }

View File

@ -1,5 +1,7 @@
package com.zcloud.controller.tzsb; package com.zcloud.controller.tzsb;
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.controller.bus.ImgFilesController; import com.zcloud.controller.bus.ImgFilesController;
import com.zcloud.entity.Page; import com.zcloud.entity.Page;
@ -45,6 +47,7 @@ public class SpecialEquipmentAqxjController extends BaseController {
@RequestMapping(value="/add") @RequestMapping(value="/add")
@RequiresPermissions("specialequipmentaqxj:add") @RequiresPermissions("specialequipmentaqxj:add")
@ResponseBody @ResponseBody
@DockAnnotation(hasAnnex = true)
public Object add(@RequestParam(value="FFILE",required=false) MultipartFile[] FILES, public Object add(@RequestParam(value="FFILE",required=false) MultipartFile[] FILES,
@RequestParam(value="TYPE",required=false) String[] TYPE) throws Exception{ @RequestParam(value="TYPE",required=false) String[] TYPE) throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
@ -75,6 +78,7 @@ public class SpecialEquipmentAqxjController extends BaseController {
imgFilesController.finish(fileList.toArray(fileArr),type,pd.getString("SPECIALEQUIPMENTAQXJ_ID")); imgFilesController.finish(fileList.toArray(fileArr),type,pd.getString("SPECIALEQUIPMENTAQXJ_ID"));
} }
map.put("pd", pd); map.put("pd", pd);
map.put("dockData", JSON.toJSONString(pd));
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }

View File

@ -1,5 +1,7 @@
package com.zcloud.controller.tzsb; package com.zcloud.controller.tzsb;
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;
@ -49,11 +51,13 @@ public class SpecialEquipmentController extends BaseController {
@RequestMapping(value="/add") @RequestMapping(value="/add")
@RequiresPermissions("specialequipment:add") @RequiresPermissions("specialequipment: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();
ArrayList<String> sendPicturesList = new ArrayList<>();
pd.put("SPECIALEQUIPMENT_ID", this.get32UUID()); //主键 pd.put("SPECIALEQUIPMENT_ID", this.get32UUID()); //主键
pd.put("CREATOR", Jurisdiction.getUsername()); //添加人 pd.put("CREATOR", Jurisdiction.getUsername()); //添加人
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
@ -78,8 +82,11 @@ public class SpecialEquipmentController extends BaseController {
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("TECHNICALFILENAME", file.getOriginalFilename()); pd.put("TECHNICALFILENAME", file.getOriginalFilename());
pd.put("TECHNICALFILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("TECHNICALFILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
sendPicturesList.add(pd.getString("TECHNICALFILEPATH")+"@@"+fileName);
} }
PageData dockData = new PageData();
specialequipmentService.save(pd); specialequipmentService.save(pd);
dockData.putAll(pd);
map.put("pd", pd); map.put("pd", pd);
PageData changeData = new PageData(); PageData changeData = new PageData();
@ -137,7 +144,10 @@ public class SpecialEquipmentController extends BaseController {
// changeData.put("REMARKS_BEFORE", pd.getString("REMARKS")); //备注(前) // changeData.put("REMARKS_BEFORE", pd.getString("REMARKS")); //备注(前)
changeData.put("REMARKS_AFTER", pd.getString("REMARKS")); //备注(后) changeData.put("REMARKS_AFTER", pd.getString("REMARKS")); //备注(后)
specialequipmentchangeService.save(changeData); specialequipmentchangeService.save(changeData);
dockData.put("changeData",changeData);
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData", JSON.toJSONString(dockData));
map.put("sendPicturesList", JSON.toJSONString(sendPicturesList));
return map; return map;
} }
@ -148,6 +158,7 @@ public class SpecialEquipmentController extends BaseController {
@RequestMapping(value="/delete") @RequestMapping(value="/delete")
@RequiresPermissions("specialequipment:del") @RequiresPermissions("specialequipment: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";
@ -192,7 +203,9 @@ public class SpecialEquipmentController extends BaseController {
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
specialequipmentService.delete(pd); specialequipmentService.delete(pd);
pd.put("changeData",changeData);
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
map.put("dockData", JSON.toJSONString(pd)); //返回结果
return map; return map;
} }
@ -203,13 +216,14 @@ public class SpecialEquipmentController extends BaseController {
@RequestMapping(value="/edit") @RequestMapping(value="/edit")
@RequiresPermissions("specialequipment:edit") @RequiresPermissions("specialequipment: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();
PageData updateBefour = specialequipmentService.findById(pd); PageData updateBefour = specialequipmentService.findById(pd);
ArrayList<String> sendPicturesList = new ArrayList<>();
PageData changeData = new PageData(); PageData changeData = new PageData();
changeData.put("SPECIALEQUIPMENTCHANGE_ID", this.get32UUID()); //主键 changeData.put("SPECIALEQUIPMENTCHANGE_ID", this.get32UUID()); //主键
changeData.put("SPECIALEQUIPMENT_ID", updateBefour.getString("SPECIALEQUIPMENT_ID")); //主键 changeData.put("SPECIALEQUIPMENT_ID", updateBefour.getString("SPECIALEQUIPMENT_ID")); //主键
@ -262,6 +276,7 @@ public class SpecialEquipmentController extends BaseController {
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); Smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
pd.put("TECHNICALFILENAME", file.getOriginalFilename()); pd.put("TECHNICALFILENAME", file.getOriginalFilename());
pd.put("TECHNICALFILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); pd.put("TECHNICALFILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
sendPicturesList.add(pd.getString("TECHNICALFILEPATH") + "@@"+ fileName);
} }
specialequipmentService.edit(pd); specialequipmentService.edit(pd);
changeData.put("EQUIPMENTNAME_AFTER", pd.getString("EQUIPMENTNAME")); //设备名称(后) changeData.put("EQUIPMENTNAME_AFTER", pd.getString("EQUIPMENTNAME")); //设备名称(后)
@ -294,8 +309,13 @@ public class SpecialEquipmentController extends BaseController {
changeData.put("TECHNICALFILEPATH_AFTER", pd.getString("TECHNICALFILEPATH")); //设备技术档案(附件)路径(后) changeData.put("TECHNICALFILEPATH_AFTER", pd.getString("TECHNICALFILEPATH")); //设备技术档案(附件)路径(后)
changeData.put("REMARKS_AFTER", pd.getString("REMARKS")); //备注(后) changeData.put("REMARKS_AFTER", pd.getString("REMARKS")); //备注(后)
specialequipmentchangeService.save(changeData); specialequipmentchangeService.save(changeData);
PageData dockData = new PageData();
dockData.putAll(pd);
dockData.put("changeData",changeData);
map.put("pd", pd); map.put("pd", pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData", JSON.toJSONString(dockData));
map.put("sendPicturesList", JSON.toJSONString(sendPicturesList));
return map; return map;
} }
@ -347,6 +367,7 @@ public class SpecialEquipmentController extends BaseController {
@RequestMapping(value="/deleteAll") @RequestMapping(value="/deleteAll")
@RequiresPermissions("specialequipment:del") @RequiresPermissions("specialequipment: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";
@ -355,6 +376,7 @@ public class SpecialEquipmentController extends BaseController {
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
String DATA_IDS = pd.getString("DATA_IDS"); String DATA_IDS = pd.getString("DATA_IDS");
ArrayList<PageData> changeDataList = new ArrayList<>();
if(Tools.notEmpty(DATA_IDS)){ if(Tools.notEmpty(DATA_IDS)){
String ArrayDATA_IDS[] = DATA_IDS.split(","); String ArrayDATA_IDS[] = DATA_IDS.split(",");
pd.put("ArrayDATA_IDS", ArrayDATA_IDS); //待删除ids pd.put("ArrayDATA_IDS", ArrayDATA_IDS); //待删除ids
@ -397,10 +419,15 @@ public class SpecialEquipmentController extends BaseController {
changeData.put("TECHNICALFILEPATH_AFTER", updateBefour.getString("TECHNICALFILEPATH")); //设备技术档案(附件)路径(前) changeData.put("TECHNICALFILEPATH_AFTER", updateBefour.getString("TECHNICALFILEPATH")); //设备技术档案(附件)路径(前)
changeData.put("REMARKS_AFTER", updateBefour.getString("REMARKS")); //备注(前) changeData.put("REMARKS_AFTER", updateBefour.getString("REMARKS")); //备注(前)
specialequipmentchangeService.save(changeData); specialequipmentchangeService.save(changeData);
changeDataList.add(changeData);
} }
specialequipmentService.deleteAll(pd); specialequipmentService.deleteAll(pd);
errInfo = "success"; errInfo = "success";
pd.put("changeDataList",changeDataList);
map.put("dockData", JSON.toJSONString(pd)); //返回结果
map.put("result", errInfo); //返回结果
}else{ }else{
errInfo = "fail"; errInfo = "fail";
} }