forked from integrated_whb/integrated_whb
Merge remote-tracking branch 'origin/dev' into dev
commit
b5f800bf86
|
@ -43,12 +43,8 @@ public class AppTrafficSafetyMeetingController extends BaseController {
|
|||
if (Tools.notEmpty(MEETING_TITLE))
|
||||
pd.put("MEETING_TITLE", MEETING_TITLE.trim());
|
||||
|
||||
// String MEETING_TYPE = pd.getString("MEETING_TYPE"); // 关键词检索条件
|
||||
// if (Tools.notEmpty(MEETING_TYPE))
|
||||
// pd.put("MEETING_TYPE", MEETING_TYPE.trim());
|
||||
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = trafficSafetyMeetingService.listForSafetyMeeting(page);
|
||||
List<PageData> varList = trafficSafetyMeetingService.listForSafetyMeetingUser(page);
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
|
|
|
@ -77,10 +77,18 @@ public class TrafficSafetyMeetingController extends BaseController {
|
|||
pd.put("VIDEO_NAME",pd.getString("CREATORNAME"));
|
||||
}
|
||||
String meetingDate = pd.getString("MEETING_DATE");
|
||||
String[] dates = meetingDate.split(",");
|
||||
if (dates.length == 2){
|
||||
String[] dates = meetingDate.split(",");
|
||||
if (dates.length == 2) {
|
||||
pd.put("MEETING_DATE_START", dates[0].trim());
|
||||
pd.put("MEETING_DATE_END", dates[1].trim());
|
||||
|
||||
Date now = new Date();
|
||||
Date meetingStart = DateUtil.fomatDate(dates[0].trim());
|
||||
Date meetingEnd = DateUtil.fomatDate(dates[1].trim());
|
||||
|
||||
// 判断会议状态并更新MEETING_STATUS
|
||||
String status = meetingEnd.before(now) ? "2" : (meetingStart.after(now) ? "0" : "1");
|
||||
pd.put("MEETING_STATUS", status);
|
||||
}
|
||||
trafficSafetyMeetingService.save(pd);
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public class TrafficSecurityManagementAgreementController extends BaseController
|
|||
map.put("msg", "文件格式不正确!");
|
||||
return map;
|
||||
}
|
||||
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
String fileName =file.getOriginalFilename();
|
||||
smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("OPERATINGCOMPANY") + "/" + ffile);
|
||||
pd.put("ATTACHMENT_ROUTE", Const.FILEPATHFILE + pd.getString("OPERATINGCOMPANY") + "/" + ffile + "/" + fileName);
|
||||
pd.put("ATTACHMENT_NAME",pd.getString("CREATORNAME"));
|
||||
|
@ -97,7 +97,8 @@ public class TrafficSecurityManagementAgreementController extends BaseController
|
|||
map.put("msg", "文件格式不正确!");
|
||||
return map;
|
||||
}
|
||||
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
//String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
String fileName =file.getOriginalFilename();
|
||||
smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("OPERATINGCOMPANY") + "/" + ffile);
|
||||
pd.put("ATTACHMENT_ROUTE", Const.FILEPATHFILE + pd.getString("OPERATINGCOMPANY") + "/" + ffile + "/" + fileName);
|
||||
pd.put("ATTACHMENT_NAME",pd.getString("CREATORNAME"));
|
||||
|
|
|
@ -0,0 +1,496 @@
|
|||
package com.zcloud.controller.study;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.logs.LogAnno;
|
||||
import com.zcloud.service.study.MfolderStipulateService;
|
||||
import com.zcloud.util.*;
|
||||
import net.sf.json.JSONArray;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 说明:文件管理
|
||||
* 作者:zCloud
|
||||
* 官网:
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/app/mfolderStipulate")
|
||||
public class AppMfolderStipulateController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private MfolderStipulateService mfolderService;
|
||||
@Autowired
|
||||
private Smb smb;
|
||||
/**创建目录
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/add")
|
||||
// @RequiresPermissions("mfolderStipulate:add")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "手机",menuServer= "文件管理",instructionsOperate = "文件管理",instructionsType = "创建目录")
|
||||
public Object add() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("MFOLDER_ID", this.get32UUID()); //主键
|
||||
pd.put("FILEPATH", ""); //路径
|
||||
pd.put("CTIME", DateUtil.date2Str(new Date())); //创建时间
|
||||
pd.put("UNAME", Jurisdiction.getName()); //上传者
|
||||
pd.put("MASTER", Jurisdiction.getUsername()); //所属人
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||
pd.put("FILESIZE", "");
|
||||
mfolderService.save(pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**上传文件
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/upload")
|
||||
// @RequiresPermissions("mfolderStipulate:add")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "手机",menuServer= "文件管理",instructionsOperate = "文件管理",instructionsType = "上传文件")
|
||||
public Object add(
|
||||
@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String ffile = DateUtil.getDays(), fileName = "";
|
||||
if (null != file && !file.isEmpty()) {
|
||||
File tempFile = new File(file.getOriginalFilename()); //新建file
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream(), tempFile); //将MultipartFile复制到File
|
||||
fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
|
||||
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); //文件路径
|
||||
//pd.put("NAME", NAME); //文件名
|
||||
//pd.put("PARENT_ID", PARENT_ID); //目录ID
|
||||
pd.put("CTIME", DateUtil.date2Str(new Date())); //创建时间
|
||||
pd.put("UNAME", Jurisdiction.getName()); //上传者,当前用户的姓名
|
||||
pd.put("MASTER", Jurisdiction.getUsername()); //用户名
|
||||
pd.put("FILESIZE", FileUtil.getFilesize(tempFile)); //文件大小
|
||||
//pd.put("REMARKS", REMARKS); //备注
|
||||
//pd.put("SHARE", SHARE); //是否共享
|
||||
//pd.put("TYPE", TYPE); //数据类型 1.文件夹 2.文件
|
||||
|
||||
pd.put("MFOLDER_ID", this.get32UUID()); //主键
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||
mfolderService.save(pd); //存入数据库表
|
||||
|
||||
FileUtils.deleteQuietly(tempFile);//删除临时文件
|
||||
}else{
|
||||
errInfo = "error";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**上传文件
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/editUpload")
|
||||
// @RequiresPermissions("mfolderStipulate:add")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "手机",menuServer= "文件管理",instructionsOperate = "文件管理",instructionsType = "上传文件")
|
||||
public Object editUpload(
|
||||
@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String ffile = DateUtil.getDays(), fileName = "";
|
||||
if (null != file && !file.isEmpty()) {
|
||||
File tempFile = new File(file.getOriginalFilename()); //新建file
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream(), tempFile); //将MultipartFile复制到File
|
||||
fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
|
||||
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); //文件路径
|
||||
//pd.put("NAME", NAME); //文件名
|
||||
//pd.put("PARENT_ID", PARENT_ID); //目录ID
|
||||
pd.put("UNAME", Jurisdiction.getName()); //上传者,当前用户的姓名
|
||||
pd.put("MASTER", Jurisdiction.getUsername()); //用户名
|
||||
pd.put("FILESIZE", FileUtil.getFilesize(tempFile)); //文件大小
|
||||
//pd.put("REMARKS", REMARKS); //备注
|
||||
//pd.put("SHARE", SHARE); //是否共享
|
||||
//pd.put("TYPE", TYPE); //数据类型 1.文件夹 2.文件
|
||||
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||
FileUtils.deleteQuietly(tempFile);//删除临时文件
|
||||
}
|
||||
mfolderService.edit(pd); //存入数据库表
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**去修改页面获取数据
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/goEdit")
|
||||
// @RequiresPermissions("mfolderStipulate:edit")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "手机",menuServer= "文件管理",instructionsOperate = "文件管理",instructionsType = "去修改页面获取数据")
|
||||
public Object goEdit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = mfolderService.findById(pd); //根据ID读取
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**上传文件
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/uploadAll")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "手机",menuServer= "文件管理",instructionsOperate = "文件管理",instructionsType = "上传文件")
|
||||
public Object uploadAll(
|
||||
@RequestParam(value="file",required=false) MultipartFile file,
|
||||
@RequestParam(value="FH_ID",required=false) String MFOLDER_ID
|
||||
) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
String ffile = DateUtil.getDays(), fileName = "";
|
||||
if (null != file && !file.isEmpty()) {
|
||||
File tempFile = new File(file.getOriginalFilename()); //新建file
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream(), tempFile); //将MultipartFile复制到File
|
||||
fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
|
||||
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); //文件路径
|
||||
String realName = file.getOriginalFilename();
|
||||
String[] fileFullNames = realName.split("\\.");//上传文件全名
|
||||
String extension =fileFullNames[fileFullNames.length-1];//上传文件文件后缀
|
||||
String realName2 =realName.substring(0,realName.length()-extension.length()-1); //去除文件后缀名称
|
||||
pd.put("NAME", realName2); //文件名
|
||||
pd.put("PARENT_ID", MFOLDER_ID); //目录ID
|
||||
pd.put("CTIME", DateUtil.date2Str(new Date())); //创建时间
|
||||
pd.put("UNAME", Jurisdiction.getName()); //上传者,当前用户的姓名
|
||||
pd.put("MASTER", Jurisdiction.getUsername()); //用户名
|
||||
pd.put("FILESIZE", FileUtil.getFilesize(tempFile)); //文件大小
|
||||
pd.put("REMARKS", "无"); //备注
|
||||
pd.put("SHARE", "no"); //是否共享
|
||||
pd.put("MFOLDER_ID", this.get32UUID()); //主键
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||
mfolderService.save(pd); //存入数据库表
|
||||
|
||||
FileUtils.deleteQuietly(tempFile);//删除临时文件
|
||||
}else{
|
||||
errInfo = "error";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
/**删除
|
||||
* @param out
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/delete")
|
||||
// @RequiresPermissions("mfolderStipulate:del")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "手机",menuServer= "文件管理",instructionsOperate = "文件管理",instructionsType = "删除")
|
||||
public Object delete(@RequestParam String MFOLDER_ID, @RequestParam String FILEPATH) throws Exception{
|
||||
Map<String,String> map = new HashMap<String,String>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd.put("parentId", MFOLDER_ID);
|
||||
if(mfolderService.listByParentId(pd).size() > 0){ //判断是否有子级,是:不允许删除
|
||||
errInfo = "error";
|
||||
}else{
|
||||
pd.put("MFOLDER_ID", MFOLDER_ID);
|
||||
mfolderService.delete(pd);
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/edit")
|
||||
// @RequiresPermissions("mfolderStipulate:edit")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "手机",menuServer= "文件管理",instructionsOperate = "文件管理",instructionsType = "修改")
|
||||
public Object edit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
mfolderService.edit(pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/list")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "手机",menuServer= "文件管理",instructionsOperate = "文件管理",instructionsType = "列表")
|
||||
public Object list(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
//pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
String MFOLDER_ID = null;
|
||||
if( pd.get("MFOLDER_ID")!=null && Tools.notEmpty( pd.get("MFOLDER_ID").toString())) {
|
||||
MFOLDER_ID = null == pd.get("MFOLDER_ID")?"":pd.get("MFOLDER_ID").toString();
|
||||
pd.put("MFOLDER_ID", MFOLDER_ID); //当作上级ID
|
||||
}
|
||||
|
||||
// if(Tools.notEmpty(SHARE) && "yes".equals(SHARE)) {
|
||||
// pd.put("SHARE", "yes");
|
||||
// }else {
|
||||
// pd.put("USERNAME", "admin".equals(Jurisdiction.getUsername())?"":Jurisdiction.getUsername()); //除admin用户外,只能查看自己的数据
|
||||
// }
|
||||
pd.put("SHARE", "yes");
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = mfolderService.list(page); //列出Mfolder列表
|
||||
if(MFOLDER_ID==null || "0".equals(MFOLDER_ID)) {
|
||||
map.put("PARENT_ID", "0"); //上级ID
|
||||
}else {
|
||||
map.put("PARENT_ID", mfolderService.findById(pd).getString("PARENT_ID")); //上级ID
|
||||
}
|
||||
for(int i=0;i<varList.size();i++){
|
||||
String FILEPATH = varList.get(i).getString("FILEPATH");
|
||||
if(Tools.isEmpty(FILEPATH))break;
|
||||
String extension_name = FILEPATH.substring(59, FILEPATH.length());//文件拓展名
|
||||
String fileType = "file";
|
||||
int zindex1 = "java,php,jsp,html,css,txt,asp".indexOf(extension_name);
|
||||
if(zindex1 != -1){
|
||||
fileType = "wenben"; //文本类型
|
||||
}
|
||||
int zindex2 = "jpg,gif,bmp,png".indexOf(extension_name);
|
||||
if(zindex2 != -1){
|
||||
fileType = "tupian"; //图片文件类型
|
||||
}
|
||||
int zindex3 = "rar,zip,rar5".indexOf(extension_name);
|
||||
if(zindex3 != -1){
|
||||
fileType = "yasuo"; //压缩文件类型
|
||||
}
|
||||
int zindex4 = "doc,docx".indexOf(extension_name);
|
||||
if(zindex4 != -1){
|
||||
fileType = "doc"; //doc文件类型
|
||||
}
|
||||
int zindex5 = "xls,xlsx".indexOf(extension_name);
|
||||
if(zindex5 != -1){
|
||||
fileType = "xls"; //xls文件类型
|
||||
}
|
||||
int zindex6 = "ppt,pptx".indexOf(extension_name);
|
||||
if(zindex6 != -1){
|
||||
fileType = "ppt"; //ppt文件类型
|
||||
}
|
||||
int zindex7 = "pdf".indexOf(extension_name);
|
||||
if(zindex7 != -1){
|
||||
fileType = "pdf"; //ppt文件类型
|
||||
}
|
||||
int zindex8 = "fly,f4v,mp4,m3u8,webm,ogg,avi".indexOf(extension_name);
|
||||
if(zindex8 != -1){
|
||||
fileType = "video"; //视频文件类型
|
||||
}
|
||||
varList.get(i).put("extension_name", extension_name); //文件拓展名
|
||||
varList.get(i).put("fileType", fileType); //用于文件图标
|
||||
}
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示列表ztree
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/listTree")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "手机",menuServer= "文件管理",instructionsOperate = "文件管理",instructionsType = "显示列表")
|
||||
public Object listTree()throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String SHARE = pd.getString("SHARE");
|
||||
/*if(!(Tools.notEmpty(SHARE) && "yes".equals(SHARE))) {
|
||||
pd.put("USERNAME", "admin".equals(Jurisdiction.getUsername())?"":Jurisdiction.getUsername()); //除admin用户外,只能查看自己的数据
|
||||
}*/
|
||||
pd.put("parentId", "0");
|
||||
pd.put("SHARE", SHARE);
|
||||
//pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||
JSONArray arr = JSONArray.fromObject(mfolderService.listTree(pd,SHARE));
|
||||
String json = arr.toString();
|
||||
json = json.replaceAll("MFOLDER_ID", "id").replaceAll("PARENT_ID", "pId").replaceAll("NAME", "name").replaceAll("subMfolder", "nodes").replaceAll("hasMfolder", "checked").replaceAll("treeurl", "url");
|
||||
map.put("zTreeNodes", json);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* app显示列表ztree
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/appListTree")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "手机",menuServer= "文件管理",instructionsOperate = "文件管理",instructionsType = "显示列表")
|
||||
public Object appListTree()throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String SHARE = pd.getString("SHARE");
|
||||
/*if(!(Tools.notEmpty(SHARE) && "yes".equals(SHARE))) {
|
||||
pd.put("USERNAME", "admin".equals(Jurisdiction.getUsername())?"":Jurisdiction.getUsername()); //除admin用户外,只能查看自己的数据
|
||||
}*/
|
||||
pd.put("parentId", "0");
|
||||
pd.put("SHARE", SHARE);
|
||||
//pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||
if(Tools.isEmpty(pd.getString("KEYWORDS"))){
|
||||
JSONArray arr = JSONArray.fromObject(mfolderService.appListTree(pd,SHARE));
|
||||
String json = arr.toString();
|
||||
json = json.replaceAll("MFOLDER_ID", "id").replaceAll("PARENT_ID", "pId").replaceAll("NAME", "title").replaceAll("subMfolder", "children").replaceAll("hasMfolder", "checked").replaceAll("treeurl", "url");
|
||||
map.put("zTreeNodes", json);
|
||||
} else {
|
||||
List<PageData> varList = mfolderService.findByName(pd);
|
||||
map.put("varList", varList);
|
||||
}
|
||||
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**批量操作
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/makeAll")
|
||||
// @RequiresPermissions("mfolderStipulate:edit")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "手机",menuServer= "文件管理",instructionsOperate = "文件管理",instructionsType = "批量操作")
|
||||
public Object deleteAll() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String DATA_IDS = pd.getString("DATA_IDS");
|
||||
if(Tools.notEmpty(DATA_IDS)){
|
||||
String ArrayDATA_IDS[] = DATA_IDS.split(",");
|
||||
pd.put("IDS", ArrayDATA_IDS);
|
||||
mfolderService.makeAll(pd);
|
||||
errInfo = "success";
|
||||
}else{
|
||||
errInfo = "error";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**下载
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/download")
|
||||
@LogAnno(menuType= "手机",menuServer= "文件管理",instructionsOperate = "文件管理",instructionsType = "下载")
|
||||
public void download(HttpServletResponse response)throws NofileStiException {
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
try {
|
||||
pd = mfolderService.findById(pd);
|
||||
String FILEPATH = pd.getString("FILEPATH");
|
||||
// String fileName = pd.getString("NAME");
|
||||
FileDownload.mfFileDownload(response, Const.HTTPFILEURL + FILEPATH, FILEPATH.substring(FILEPATH.length()<85?27:60, FILEPATH.length()));
|
||||
} catch (Exception e) {
|
||||
throw new NofileStiException("=========要下载的文件已经没有了=========");
|
||||
}
|
||||
}
|
||||
|
||||
/**listByParentId
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/listByParentId")
|
||||
@ResponseBody
|
||||
public Object listByParentId()throws NofileStiException {
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
List<PageData> varList = new ArrayList<PageData>();
|
||||
try {
|
||||
varList = mfolderService.listAll(pd);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} //列出Mfolder列表
|
||||
for(int i=0;i<varList.size();i++){
|
||||
String FILEPATH = varList.get(i).getString("FILEPATH");
|
||||
if(Tools.isEmpty(FILEPATH))break;
|
||||
String extension_name = FILEPATH.substring(59, FILEPATH.length());//文件拓展名
|
||||
String fileType = "file";
|
||||
int zindex1 = "java,php,jsp,html,css,txt,asp".indexOf(extension_name);
|
||||
if(zindex1 != -1){
|
||||
fileType = "wenben"; //文本类型
|
||||
}
|
||||
int zindex2 = "jpg,gif,bmp,png".indexOf(extension_name);
|
||||
if(zindex2 != -1){
|
||||
fileType = "tupian"; //图片文件类型
|
||||
}
|
||||
int zindex3 = "rar,zip,rar5".indexOf(extension_name);
|
||||
if(zindex3 != -1){
|
||||
fileType = "yasuo"; //压缩文件类型
|
||||
}
|
||||
int zindex4 = "doc,docx".indexOf(extension_name);
|
||||
if(zindex4 != -1){
|
||||
fileType = "doc"; //doc文件类型
|
||||
}
|
||||
int zindex5 = "xls,xlsx".indexOf(extension_name);
|
||||
if(zindex5 != -1){
|
||||
fileType = "xls"; //xls文件类型
|
||||
}
|
||||
int zindex6 = "ppt,pptx".indexOf(extension_name);
|
||||
if(zindex6 != -1){
|
||||
fileType = "ppt"; //ppt文件类型
|
||||
}
|
||||
int zindex7 = "pdf".indexOf(extension_name);
|
||||
if(zindex7 != -1){
|
||||
fileType = "pdf"; //ppt文件类型
|
||||
}
|
||||
int zindex8 = "fly,f4v,mp4,m3u8,webm,ogg,avi".indexOf(extension_name);
|
||||
if(zindex8 != -1){
|
||||
fileType = "video"; //视频文件类型
|
||||
}
|
||||
varList.get(i).put("extension_name", extension_name); //文件拓展名
|
||||
varList.get(i).put("fileType", fileType); //用于文件图标
|
||||
}
|
||||
map.put("varList", varList);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package com.zcloud.controller.study;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.logs.LogAnno;
|
||||
import com.zcloud.service.study.StudySectionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 说明:学习园地
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2021-01-07
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/app/studysection")
|
||||
public class AppStudySectionController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private StudySectionService studysectionService;
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/list")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "手机",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "列表")
|
||||
public Object list(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
//Jurisdiction.getCORPINFO_ID()
|
||||
pd.put("CORPINFO_ID", pd.get("CORPINFO_ID"));
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = studysectionService.list(page); //列出StudySection列表
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**去修改页面获取数据
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/goEdit")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "手机",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "去修改页面获取数据")
|
||||
public Object goEdit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = studysectionService.findById(pd); //根据ID读取
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package com.zcloud.controller.study;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.logs.LogAnno;
|
||||
import com.zcloud.service.study.TempStudyService;
|
||||
import com.zcloud.service.study.TempStudyUsersService;
|
||||
import com.zcloud.util.DateUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 说明:临时学习任务
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-05-18
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/app/tempstudy")
|
||||
public class AppTempStudyController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private TempStudyService tempstudyService;
|
||||
@Autowired
|
||||
private TempStudyUsersService tempStudyUsersService;
|
||||
|
||||
/**修改
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/edit")
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
@LogAnno(menuType= "手机",menuServer= "临时学习任务",instructionsOperate = "临时学习任务",instructionsType = "修改")
|
||||
public Object edit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = tempStudyUsersService.findById(pd);
|
||||
pd.put("STATUS",1);
|
||||
pd.put("STUDY_TIME", DateUtil.date2Str(new Date()));
|
||||
tempStudyUsersService.edit(pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/list")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "手机",menuServer= "临时学习任务",instructionsOperate = "临时学习任务",instructionsType = "列表")
|
||||
public Object list(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = tempStudyUsersService.list(page); //列出TempStudy列表
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,455 @@
|
|||
package com.zcloud.controller.study;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.entity.system.Mfolder;
|
||||
import com.zcloud.logs.LogAnno;
|
||||
import com.zcloud.service.study.MfolderStipulateService;
|
||||
import com.zcloud.util.*;
|
||||
import net.sf.json.JSONArray;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 说明:文件管理
|
||||
* 作者:zCloud
|
||||
* 官网:
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/mfolderStipulate")
|
||||
public class MfolderStipulateController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private MfolderStipulateService mfolderService;
|
||||
@Autowired
|
||||
private Smb smb;
|
||||
/**创建目录
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/add")
|
||||
// @RequiresPermissions("mfolderStipulate:add")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "法规库",instructionsType = "创建目录")
|
||||
public Object add() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("MFOLDER_ID", this.get32UUID()); //主键
|
||||
pd.put("FILEPATH", ""); //路径
|
||||
pd.put("CTIME", DateUtil.date2Str(new Date())); //创建时间
|
||||
pd.put("UNAME", Jurisdiction.getName()); //上传者
|
||||
pd.put("MASTER", Jurisdiction.getUsername()); //所属人
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||
pd.put("FILESIZE", "");
|
||||
mfolderService.save(pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**上传文件
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/upload")
|
||||
// @RequiresPermissions("mfolderStipulate:add")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "法规库",instructionsType = "上传文件")
|
||||
public Object add(
|
||||
@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String ffile = DateUtil.getDays(), fileName = "";
|
||||
if (null != file && !file.isEmpty()) {
|
||||
File tempFile = new File(file.getOriginalFilename()); //新建file
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream(), tempFile); //将MultipartFile复制到File
|
||||
fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
|
||||
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); //文件路径
|
||||
//pd.put("NAME", NAME); //文件名
|
||||
//pd.put("PARENT_ID", PARENT_ID); //目录ID
|
||||
pd.put("CTIME", DateUtil.date2Str(new Date())); //创建时间
|
||||
pd.put("UNAME", Jurisdiction.getName()); //上传者,当前用户的姓名
|
||||
pd.put("MASTER", Jurisdiction.getUsername()); //用户名
|
||||
pd.put("FILESIZE", FileUtil.getFilesize(tempFile)); //文件大小
|
||||
//pd.put("REMARKS", REMARKS); //备注
|
||||
//pd.put("SHARE", SHARE); //是否共享
|
||||
//pd.put("TYPE", TYPE); //数据类型 1.文件夹 2.文件
|
||||
|
||||
pd.put("MFOLDER_ID", this.get32UUID()); //主键
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||
mfolderService.save(pd); //存入数据库表
|
||||
|
||||
FileUtils.deleteQuietly(tempFile);//删除临时文件
|
||||
}else{
|
||||
errInfo = "error";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**上传文件
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/editUpload")
|
||||
// @RequiresPermissions("mfolderStipulate:add")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "法规库",instructionsType = "上传文件")
|
||||
public Object editUpload(
|
||||
@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String ffile = DateUtil.getDays(), fileName = "";
|
||||
if (null != file && !file.isEmpty()) {
|
||||
File tempFile = new File(file.getOriginalFilename()); //新建file
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream(), tempFile); //将MultipartFile复制到File
|
||||
fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
|
||||
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); //文件路径
|
||||
//pd.put("NAME", NAME); //文件名
|
||||
//pd.put("PARENT_ID", PARENT_ID); //目录ID
|
||||
pd.put("UNAME", Jurisdiction.getName()); //上传者,当前用户的姓名
|
||||
pd.put("MASTER", Jurisdiction.getUsername()); //用户名
|
||||
pd.put("FILESIZE", FileUtil.getFilesize(tempFile)); //文件大小
|
||||
//pd.put("REMARKS", REMARKS); //备注
|
||||
//pd.put("SHARE", SHARE); //是否共享
|
||||
//pd.put("TYPE", TYPE); //数据类型 1.文件夹 2.文件
|
||||
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||
|
||||
FileUtils.deleteQuietly(tempFile);//删除临时文件
|
||||
}
|
||||
mfolderService.edit(pd); //存入数据库表
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**去修改页面获取数据
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/goEdit")
|
||||
// @RequiresPermissions("mfolderStipulate:edit")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "法规库",instructionsType = "去修改页面获取数据")
|
||||
public Object goEdit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = mfolderService.findById(pd); //根据ID读取
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**上传文件
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/uploadAll")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "法规库",instructionsType = "上传文件")
|
||||
public Object uploadAll(
|
||||
@RequestParam(value="file",required=false) MultipartFile file,
|
||||
@RequestParam(value="FH_ID",required=false) String MFOLDER_ID
|
||||
) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
String ffile = DateUtil.getDays(), fileName = "";
|
||||
if (null != file && !file.isEmpty()) {
|
||||
File tempFile = new File(file.getOriginalFilename()); //新建file
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream(), tempFile); //将MultipartFile复制到File
|
||||
fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
|
||||
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); //文件路径
|
||||
String realName = file.getOriginalFilename();
|
||||
String[] fileFullNames = realName.split("\\.");//上传文件全名
|
||||
String extension =fileFullNames[fileFullNames.length-1];//上传文件文件后缀
|
||||
String realName2 =realName.substring(0,realName.length()-extension.length()-1); //去除文件后缀名称
|
||||
pd.put("NAME", realName2); //文件名
|
||||
pd.put("PARENT_ID", MFOLDER_ID); //目录ID
|
||||
pd.put("CTIME", DateUtil.date2Str(new Date())); //创建时间
|
||||
pd.put("UNAME", Jurisdiction.getName()); //上传者,当前用户的姓名
|
||||
pd.put("MASTER", Jurisdiction.getUsername()); //用户名
|
||||
pd.put("FILESIZE", FileUtil.getFilesize(tempFile)); //文件大小
|
||||
pd.put("REMARKS", "无"); //备注
|
||||
pd.put("SHARE", "no"); //是否共享
|
||||
pd.put("MFOLDER_ID", this.get32UUID()); //主键
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||
mfolderService.save(pd); //存入数据库表
|
||||
|
||||
FileUtils.deleteQuietly(tempFile);//删除临时文件
|
||||
}else{
|
||||
errInfo = "error";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
/**删除
|
||||
* @param out
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/delete")
|
||||
// @RequiresPermissions("mfolderStipulate:del")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "法规库",instructionsType = "删除")
|
||||
public Object delete(@RequestParam String MFOLDER_ID, @RequestParam String FILEPATH) throws Exception{
|
||||
Map<String,String> map = new HashMap<String,String>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd.put("parentId", MFOLDER_ID);
|
||||
if(mfolderService.listByParentId(pd).size() > 0){ //判断是否有子级,是:不允许删除
|
||||
errInfo = "error";
|
||||
}else{
|
||||
pd.put("MFOLDER_ID", MFOLDER_ID);
|
||||
mfolderService.delete(pd);
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/edit")
|
||||
// @RequiresPermissions("mfolderStipulate:edit")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "法规库",instructionsType = "修改")
|
||||
public Object edit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
mfolderService.edit(pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/list")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "法规库",instructionsType = "列表")
|
||||
public Object list(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
//pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
String MFOLDER_ID = null;
|
||||
if( pd.get("MFOLDER_ID")!=null && Tools.notEmpty( pd.get("MFOLDER_ID").toString())) {
|
||||
MFOLDER_ID = null == pd.get("MFOLDER_ID")?"":pd.get("MFOLDER_ID").toString();
|
||||
pd.put("MFOLDER_ID", MFOLDER_ID); //当作上级ID
|
||||
}
|
||||
|
||||
// if(Tools.notEmpty(SHARE) && "yes".equals(SHARE)) {
|
||||
// pd.put("SHARE", "yes");
|
||||
// }else {
|
||||
// pd.put("USERNAME", "admin".equals(Jurisdiction.getUsername())?"":Jurisdiction.getUsername()); //除admin用户外,只能查看自己的数据
|
||||
// }
|
||||
pd.put("SHARE", "yes");
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = mfolderService.list(page); //列出Mfolder列表
|
||||
if(MFOLDER_ID==null || "0".equals(MFOLDER_ID)) {
|
||||
map.put("PARENT_ID", "0"); //上级ID
|
||||
}else {
|
||||
map.put("PARENT_ID", mfolderService.findById(pd).getString("PARENT_ID")); //上级ID
|
||||
}
|
||||
for(int i=0;i<varList.size();i++){
|
||||
String FILEPATH = varList.get(i).getString("FILEPATH");
|
||||
if(Tools.isEmpty(FILEPATH))break;
|
||||
String extension_name = FILEPATH.substring(59, FILEPATH.length());//文件拓展名
|
||||
String fileType = "file";
|
||||
int zindex1 = "java,php,jsp,html,css,txt,asp".indexOf(extension_name);
|
||||
if(zindex1 != -1){
|
||||
fileType = "wenben"; //文本类型
|
||||
}
|
||||
int zindex2 = "jpg,gif,bmp,png".indexOf(extension_name);
|
||||
if(zindex2 != -1){
|
||||
fileType = "tupian"; //图片文件类型
|
||||
}
|
||||
int zindex3 = "rar,zip,rar5".indexOf(extension_name);
|
||||
if(zindex3 != -1){
|
||||
fileType = "yasuo"; //压缩文件类型
|
||||
}
|
||||
int zindex4 = "doc,docx".indexOf(extension_name);
|
||||
if(zindex4 != -1){
|
||||
fileType = "doc"; //doc文件类型
|
||||
}
|
||||
int zindex5 = "xls,xlsx".indexOf(extension_name);
|
||||
if(zindex5 != -1){
|
||||
fileType = "xls"; //xls文件类型
|
||||
}
|
||||
int zindex6 = "ppt,pptx".indexOf(extension_name);
|
||||
if(zindex6 != -1){
|
||||
fileType = "ppt"; //ppt文件类型
|
||||
}
|
||||
int zindex7 = "pdf".indexOf(extension_name);
|
||||
if(zindex7 != -1){
|
||||
fileType = "pdf"; //ppt文件类型
|
||||
}
|
||||
int zindex8 = "fly,f4v,mp4,m3u8,webm,ogg,avi".indexOf(extension_name);
|
||||
if(zindex8 != -1){
|
||||
fileType = "video"; //视频文件类型
|
||||
}
|
||||
varList.get(i).put("extension_name", extension_name); //文件拓展名
|
||||
varList.get(i).put("fileType", fileType); //用于文件图标
|
||||
}
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示列表ztree
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/listTree")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "法规库",instructionsType = "显示列表")
|
||||
public Object listTree()throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String SHARE = pd.getString("SHARE");
|
||||
if(!(Tools.notEmpty(SHARE) && "yes".equals(SHARE))) {
|
||||
pd.put("USERNAME", "admin".equals(Jurisdiction.getUsername())?"": Jurisdiction.getUsername()); //除admin用户外,只能查看自己的数据
|
||||
}
|
||||
pd.put("parentId", "0");
|
||||
pd.put("SHARE", SHARE);
|
||||
//pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||
JSONArray arr = JSONArray.fromObject(mfolderService.listTree(pd,SHARE));
|
||||
String json = arr.toString();
|
||||
json = json.replaceAll("MFOLDER_ID", "id").replaceAll("PARENT_ID", "pId").replaceAll("NAME", "name").replaceAll("subMfolder", "nodes").replaceAll("hasMfolder", "checked").replaceAll("treeurl", "url");
|
||||
map.put("zTreeNodes", json);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**获取连级数据
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/getLevels")
|
||||
@ResponseBody
|
||||
public Object getLevels() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String PARENTID = pd.getString("PARENTID");
|
||||
PARENTID = Tools.isEmpty(PARENTID)?"0":PARENTID;
|
||||
List<Mfolder> varList = mfolderService.findByParentId(PARENTID); //用传过来的ID获取此ID下的子列表数据
|
||||
// List<PageData> pdList = new ArrayList<PageData>();
|
||||
// for(Mfolder d :varList){
|
||||
// PageData pdf = new PageData();
|
||||
// pdf.put("DICTIONARIES_ID", d.getDICTIONARIES_ID());
|
||||
// pdf.put("BIANMA", d.getBIANMA());
|
||||
// pdf.put("NAME", d.getNAME());
|
||||
// pdList.add(pdf);
|
||||
// }
|
||||
map.put("varList", varList);
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**批量操作
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/makeAll")
|
||||
// @RequiresPermissions("mfolderStipulate:edit")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "法规库",instructionsType = "批量操作")
|
||||
public Object deleteAll() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String DATA_IDS = pd.getString("DATA_IDS");
|
||||
if(Tools.notEmpty(DATA_IDS)){
|
||||
String ArrayDATA_IDS[] = DATA_IDS.split(",");
|
||||
pd.put("IDS", ArrayDATA_IDS);
|
||||
mfolderService.makeAll(pd);
|
||||
errInfo = "success";
|
||||
}else{
|
||||
errInfo = "error";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**下载
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/download")
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "法规库",instructionsType = "下载")
|
||||
public void download(HttpServletResponse response)throws NofileStiException {
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
try {
|
||||
pd = mfolderService.findById(pd);
|
||||
String FILEPATH = pd.getString("FILEPATH");
|
||||
// String fileName = pd.getString("NAME");
|
||||
FileDownload.mfFileDownload(response, Const.HTTPFILEURL + FILEPATH, FILEPATH.substring(FILEPATH.length()<85?27:60, FILEPATH.length()));
|
||||
} catch (Exception e) {
|
||||
throw new NofileStiException("=========要下载的文件已经没有了=========");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* 自定义异常类
|
||||
*/
|
||||
class NofileStiException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public NofileStiException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public NofileStiException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public NofileStiException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public NofileStiException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,255 @@
|
|||
package com.zcloud.controller.study;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.logs.LogAnno;
|
||||
import com.zcloud.service.study.StudySectionService;
|
||||
import com.zcloud.service.study.TempStudyService;
|
||||
import com.zcloud.util.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 说明:学习园地
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2021-01-07
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/studysection")
|
||||
public class StudySectionController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private StudySectionService studysectionService;
|
||||
@Autowired
|
||||
private Smb smb;
|
||||
@Autowired
|
||||
private TempStudyService tempstudyService;
|
||||
/**新增
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/add")
|
||||
// @RequiresPermissions("studysection:add")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "新增")
|
||||
public Object add(@RequestParam(value="file",required=false) MultipartFile file) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("STUDYSECTION_ID", this.get32UUID()); //主键
|
||||
pd.put("CREATOR", Jurisdiction.getUsername()); //添加人
|
||||
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
||||
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
|
||||
if (null != file && !file.isEmpty()) {
|
||||
String ffile = DateUtil.getDays();
|
||||
// String filePath = PathUtil.getProjectpath() + Const.FILEPATHFILE + ffile; //文件上传路径
|
||||
// String fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传
|
||||
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
|
||||
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
|
||||
}
|
||||
studysectionService.save(pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**删除
|
||||
* @param out
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/delete")
|
||||
// @RequiresPermissions("studysection:del")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "删除")
|
||||
public Object delete() throws Exception{
|
||||
Map<String,String> map = new HashMap<String,String>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("COURSEWARE_ID", pd.get("STUDYSECTION_ID"));
|
||||
List<PageData> list = tempstudyService.listAllbyId(pd);
|
||||
if(list!=null && list.size()>0) {
|
||||
// map.put("result", "fail"); //返回结果
|
||||
map.put("msg", "该任务正在进行(或有下级),无法删除");
|
||||
return map;
|
||||
}
|
||||
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
studysectionService.delete(pd);
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/edit")
|
||||
// @RequiresPermissions("studysection:edit")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "修改")
|
||||
public Object edit(@RequestParam(value="file",required=false) MultipartFile file) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
if (null != file && !file.isEmpty()) {
|
||||
String ffile = DateUtil.getDays();
|
||||
// String filePath = PathUtil.getProjectpath() + Const.FILEPATHFILE + ffile; //文件上传路径
|
||||
// String fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传
|
||||
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
|
||||
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
|
||||
}
|
||||
studysectionService.edit(pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/list")
|
||||
// @RequiresPermissions("studysection:list")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "列表")
|
||||
public Object list(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = studysectionService.list(page); //列出StudySection列表
|
||||
if(varList != null && varList.size() > 0) {
|
||||
for(PageData var : varList) {
|
||||
if(var.get("FILEPATH") != null && Tools.notEmpty(var.getString("FILEPATH").toString())) {
|
||||
String suffix = var.get("FILEPATH").toString().substring(var.get("FILEPATH").toString().lastIndexOf(".") + 1);
|
||||
var.put("extension_name", suffix);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**去修改页面获取数据
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/goEdit")
|
||||
// @RequiresPermissions("studysection:edit")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "去修改页面获取数据")
|
||||
public Object goEdit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = studysectionService.findById(pd); //根据ID读取
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**批量删除
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/deleteAll")
|
||||
// @RequiresPermissions("studysection:del")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "批量删除")
|
||||
public Object deleteAll() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String DATA_IDS = pd.getString("DATA_IDS");
|
||||
if(Tools.notEmpty(DATA_IDS)){
|
||||
String ArrayDATA_IDS[] = DATA_IDS.split(",");
|
||||
studysectionService.deleteAll(ArrayDATA_IDS);
|
||||
errInfo = "success";
|
||||
}else{
|
||||
errInfo = "error";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**导出到excel
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/excel")
|
||||
// @RequiresPermissions("toExcel")
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "导出到Excel")
|
||||
public ModelAndView exportExcel() throws Exception{
|
||||
ModelAndView mv = new ModelAndView();
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
Map<String,Object> dataMap = new HashMap<String,Object>();
|
||||
List<String> titles = new ArrayList<String>();
|
||||
titles.add("所属行业"); //1
|
||||
titles.add("所属专业"); //2
|
||||
titles.add("所属小专业"); //3
|
||||
titles.add("类型"); //4
|
||||
titles.add("标题"); //5
|
||||
titles.add("内容"); //6
|
||||
titles.add("附件路径"); //7
|
||||
titles.add("企业ID"); //8
|
||||
titles.add("添加人"); //9
|
||||
titles.add("添加时间"); //10
|
||||
titles.add("修改人"); //11
|
||||
titles.add("修改时间"); //12
|
||||
titles.add("是否删除 1-是 0-否"); //13
|
||||
dataMap.put("titles", titles);
|
||||
List<PageData> varOList = studysectionService.listAll(pd);
|
||||
List<PageData> varList = new ArrayList<PageData>();
|
||||
for(int i=0;i<varOList.size();i++){
|
||||
PageData vpd = new PageData();
|
||||
vpd.put("var1", varOList.get(i).getString("INDUSTRY")); //1
|
||||
vpd.put("var2", varOList.get(i).getString("CORP_TYPE")); //2
|
||||
vpd.put("var3", varOList.get(i).getString("CORP_TYPE_SMALL")); //3
|
||||
vpd.put("var4", varOList.get(i).getString("TYPE")); //4
|
||||
vpd.put("var5", varOList.get(i).getString("TITLE")); //5
|
||||
vpd.put("var6", varOList.get(i).getString("CONTENT")); //6
|
||||
vpd.put("var7", varOList.get(i).getString("FILEPATH")); //7
|
||||
vpd.put("var8", varOList.get(i).getString("CORPINFO_ID")); //8
|
||||
vpd.put("var9", varOList.get(i).getString("CREATOR")); //9
|
||||
vpd.put("var10", varOList.get(i).getString("CREATTIME")); //10
|
||||
vpd.put("var11", varOList.get(i).getString("OPERATOR")); //11
|
||||
vpd.put("var12", varOList.get(i).getString("OPERATTIME")); //12
|
||||
vpd.put("var13", varOList.get(i).getString("ISDELETE")); //13
|
||||
varList.add(vpd);
|
||||
}
|
||||
dataMap.put("varList", varList);
|
||||
ObjectExcelView erv = new ObjectExcelView();
|
||||
mv = new ModelAndView(erv,dataMap);
|
||||
return mv;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,263 @@
|
|||
package com.zcloud.controller.study;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.logs.LogAnno;
|
||||
import com.zcloud.service.study.TempStudyService;
|
||||
import com.zcloud.service.study.TempStudyUsersService;
|
||||
import com.zcloud.util.DateUtil;
|
||||
import com.zcloud.util.Jurisdiction;
|
||||
import com.zcloud.util.ObjectExcelView;
|
||||
import com.zcloud.util.Tools;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 说明:临时学习任务
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-05-18
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/tempstudy")
|
||||
public class TempStudyController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private TempStudyService tempstudyService;
|
||||
@Autowired
|
||||
private TempStudyUsersService tempStudyUsersService;
|
||||
|
||||
/**新增
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/add")
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "新增")
|
||||
public Object add() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("TEMPSTUDY_ID", this.get32UUID()); //主键
|
||||
pd.put("CREATOR", Jurisdiction.getUsername()); //添加人
|
||||
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
||||
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
pd.put("ISDELETE",0); //是否删除(0:有效 1:删除)
|
||||
pd.put("STATUS",0);
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
|
||||
if (pd.get("STUDY_USER_IDS") != null && !pd.get("STUDY_USER_IDS").equals("")) {
|
||||
String[] userids = pd.get("STUDY_USER_IDS").toString().split(",");
|
||||
for (String id : userids) {
|
||||
PageData user = new PageData();
|
||||
user.put("TEMPSTUDYUSERS_ID", this.get32UUID());
|
||||
user.put("TEMPSTUDY_ID", pd.get("TEMPSTUDY_ID"));
|
||||
user.put("USER_ID",id);
|
||||
user.put("STATUS",0);
|
||||
// 保存所选的课件
|
||||
tempStudyUsersService.save(user);
|
||||
}
|
||||
pd.put("USER_NUM",userids.length);
|
||||
}
|
||||
|
||||
tempstudyService.save(pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**删除
|
||||
* @param out
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/delete")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "删除")
|
||||
public Object delete() throws Exception{
|
||||
Map<String,String> map = new HashMap<String,String>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
tempstudyService.delete(pd);
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/edit")
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "启用或禁用")
|
||||
public Object edit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
Object status = pd.get("STATUS");
|
||||
pd = tempstudyService.findById(pd);
|
||||
pd.put("STATUS",status);
|
||||
// tempStudyUsersService.delete(pd);
|
||||
// if (pd.get("STUDY_USER_IDS") != null && !pd.get("STUDY_USER_IDS").equals("")) {
|
||||
// String[] userids = pd.get("STUDY_USER_IDS").toString().split(",");
|
||||
// for (String id : userids) {
|
||||
// PageData user = new PageData();
|
||||
// user.put("TEMPSTUDYUSERS_ID", this.get32UUID());
|
||||
// user.put("TEMPSTUDY_ID", pd.get("TEMPSTUDY_ID"));
|
||||
// user.put("USER_ID",id);
|
||||
// user.put("STATUS",0);
|
||||
// // 保存所选的课件
|
||||
// tempStudyUsersService.save(user);
|
||||
// }
|
||||
// pd.put("USER_NUM",userids.length);
|
||||
// }
|
||||
tempstudyService.edit(pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/list")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "列表")
|
||||
public Object list(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = tempstudyService.list(page); //列出TempStudy列表
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/studentList")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "列表")
|
||||
public Object studentList(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = tempStudyUsersService.list(page); //列出TempStudy列表
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**去修改页面获取数据
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/goEdit")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "去修改页面获取数据")
|
||||
public Object goEdit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = tempstudyService.findById(pd); //根据ID读取
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**批量删除
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/deleteAll")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "批量删除")
|
||||
public Object deleteAll() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String DATA_IDS = pd.getString("DATA_IDS");
|
||||
if(Tools.notEmpty(DATA_IDS)){
|
||||
String ArrayDATA_IDS[] = DATA_IDS.split(",");
|
||||
tempstudyService.deleteAll(ArrayDATA_IDS);
|
||||
errInfo = "success";
|
||||
}else{
|
||||
errInfo = "error";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**导出到excel
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/excel")
|
||||
// @RequiresPermissions("toExcel")
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "学习园地",instructionsType = "导出到excel")
|
||||
public ModelAndView exportExcel() throws Exception{
|
||||
ModelAndView mv = new ModelAndView();
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
Map<String,Object> dataMap = new HashMap<String,Object>();
|
||||
List<String> titles = new ArrayList<String>();
|
||||
titles.add("企业"); //1
|
||||
titles.add("名称"); //2
|
||||
titles.add("课件类型"); //3
|
||||
titles.add("课件ID"); //4
|
||||
titles.add("学习类型"); //5
|
||||
titles.add("状态"); //6
|
||||
titles.add("删除"); //7
|
||||
titles.add("添加人"); //8
|
||||
titles.add("添加时间"); //9
|
||||
titles.add("修改人"); //10
|
||||
titles.add("修改时间"); //11
|
||||
dataMap.put("titles", titles);
|
||||
List<PageData> varOList = tempstudyService.listAll(pd);
|
||||
List<PageData> varList = new ArrayList<PageData>();
|
||||
for(int i=0;i<varOList.size();i++){
|
||||
PageData vpd = new PageData();
|
||||
vpd.put("var1", varOList.get(i).getString("CORPINFO_ID")); //1
|
||||
vpd.put("var2", varOList.get(i).getString("NAME")); //2
|
||||
vpd.put("var3", varOList.get(i).getString("COURSEWARE_TYPE")); //3
|
||||
vpd.put("var4", varOList.get(i).getString("COURSEWARE_ID")); //4
|
||||
vpd.put("var5", varOList.get(i).getString("STUDY_TYPE")); //5
|
||||
vpd.put("var6", varOList.get(i).get("STATUS").toString()); //6
|
||||
vpd.put("var7", varOList.get(i).get("ISDELETE").toString()); //7
|
||||
vpd.put("var8", varOList.get(i).getString("CREATOR")); //8
|
||||
vpd.put("var9", varOList.get(i).getString("CREATTIME")); //9
|
||||
vpd.put("var10", varOList.get(i).getString("OPERATOR")); //10
|
||||
vpd.put("var11", varOList.get(i).getString("OPERATTIME")); //11
|
||||
varList.add(vpd);
|
||||
}
|
||||
dataMap.put("varList", varList);
|
||||
ObjectExcelView erv = new ObjectExcelView();
|
||||
mv = new ModelAndView(erv,dataMap);
|
||||
return mv;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,273 @@
|
|||
package com.zcloud.controller.study;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.logs.LogAnno;
|
||||
import com.zcloud.service.study.VideoService;
|
||||
import com.zcloud.util.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 说明:视频管理
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2021-01-15
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/video")
|
||||
public class VideoController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private VideoService videoService;
|
||||
@Autowired
|
||||
private Smb smb;
|
||||
/**新增
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/add")
|
||||
// @RequiresPermissions("video:add")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "企业视频",instructionsType = "新增")
|
||||
public Object add(@RequestParam(value="file",required=false) MultipartFile file) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("VIDEO_ID", this.get32UUID()); //主键
|
||||
pd.put("CREATOR", Jurisdiction.getUsername());//添加人
|
||||
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
|
||||
pd.put("TYPE", "0"); //是否置顶 0否 1是
|
||||
// pd.put("CORPINFO_TYPE", "1"); //上传状态(管理员上传 0企业上传1)
|
||||
if (null != file && !file.isEmpty()) {
|
||||
String ffile = DateUtil.getDays();
|
||||
// String filePath = PathUtil.getProjectpath() + Const.FILEPATHFILE + ffile; //文件上传路径
|
||||
// String fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传
|
||||
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
|
||||
pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
|
||||
}
|
||||
|
||||
videoService.save(pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**删除
|
||||
* @param out
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/delete")
|
||||
// @RequiresPermissions("video:del")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "企业视频",instructionsType = "删除")
|
||||
public Object delete() throws Exception{
|
||||
Map<String,String> map = new HashMap<String,String>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
videoService.delete(pd);
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/edit")
|
||||
// @RequiresPermissions("video:edit")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "企业视频",instructionsType = "修改")
|
||||
public Object edit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
videoService.edit(pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/list")
|
||||
// @RequiresPermissions("video:list")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "企业视频",instructionsType = "列表")
|
||||
public Object list(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
if(null != Jurisdiction.getCORPINFO_ID()) {
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
}
|
||||
page.setPd(pd);
|
||||
// page.set
|
||||
List<PageData> varList = videoService.list(page); //列出Video列表
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**去修改页面获取数据
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/goEdit")
|
||||
// @RequiresPermissions("video:edit")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "企业视频",instructionsType = "去修改页面获取数据")
|
||||
public Object goEdit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = videoService.findById(pd); //根据ID读取
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**列表 数据置顶
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/editZhiding")
|
||||
// @RequiresPermissions("video:edit")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "企业视频",instructionsType = "数据置顶列表")
|
||||
public Object editZhiding() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
if(Tools.isEmpty(Jurisdiction.getCORPINFO_ID())) {
|
||||
pd.put("CORPINFO_TYPE", "2");
|
||||
}else {
|
||||
pd.put("CORPINFO_TYPE", "1");
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
}
|
||||
pd.put("TYPE", "0");//重置置顶信息。把所有的数据全部取消置顶
|
||||
videoService.editZhiding(pd);
|
||||
pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("TYPE", "1");
|
||||
videoService.editZhiding(pd);//置顶信息
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
/**批量删除
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/deleteAll")
|
||||
// @RequiresPermissions("video:del")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "企业视频",instructionsType = "批量删除")
|
||||
public Object deleteAll() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String DATA_IDS = pd.getString("DATA_IDS");
|
||||
if(Tools.notEmpty(DATA_IDS)){
|
||||
String ArrayDATA_IDS[] = DATA_IDS.split(",");
|
||||
videoService.deleteAll(ArrayDATA_IDS);
|
||||
errInfo = "success";
|
||||
}else{
|
||||
errInfo = "error";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**导出到excel
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/excel")
|
||||
// @RequiresPermissions("toExcel")
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "企业视频",instructionsType = "导出到excel")
|
||||
public ModelAndView exportExcel() throws Exception{
|
||||
ModelAndView mv = new ModelAndView();
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
Map<String,Object> dataMap = new HashMap<String,Object>();
|
||||
List<String> titles = new ArrayList<String>();
|
||||
titles.add("视频名称"); //1
|
||||
titles.add("附件路径"); //2
|
||||
titles.add("添加人"); //3
|
||||
titles.add("添加时间"); //4
|
||||
titles.add("是否删除 1-是 0-否"); //5
|
||||
titles.add("企业ID"); //6
|
||||
titles.add("是否置顶 0否 1是"); //7
|
||||
titles.add("上传状态(管理员上传 0企业上传1)"); //8
|
||||
titles.add("备注"); //9
|
||||
dataMap.put("titles", titles);
|
||||
List<PageData> varOList = videoService.listAll(pd);
|
||||
List<PageData> varList = new ArrayList<PageData>();
|
||||
for(int i=0;i<varOList.size();i++){
|
||||
PageData vpd = new PageData();
|
||||
vpd.put("var1", varOList.get(i).getString("NAME")); //1
|
||||
vpd.put("var2", varOList.get(i).getString("FILEPATH")); //2
|
||||
vpd.put("var3", varOList.get(i).getString("CREATOR")); //3
|
||||
vpd.put("var4", varOList.get(i).getString("CREATTIME")); //4
|
||||
vpd.put("var5", varOList.get(i).getString("ISDELETE")); //5
|
||||
vpd.put("var6", varOList.get(i).getString("CORPINFO_ID")); //6
|
||||
vpd.put("var7", varOList.get(i).getString("TYPE")); //7
|
||||
vpd.put("var8", varOList.get(i).getString("CORPINFO_TYPE")); //8
|
||||
vpd.put("var9", varOList.get(i).getString("DESCR")); //9
|
||||
varList.add(vpd);
|
||||
}
|
||||
dataMap.put("varList", varList);
|
||||
ObjectExcelView erv = new ObjectExcelView();
|
||||
mv = new ModelAndView(erv,dataMap);
|
||||
return mv;
|
||||
}
|
||||
/**数据可视化平台首页获取
|
||||
* 1.获取企业的置顶视频
|
||||
* 2.获取管理的置顶视频
|
||||
* 3.没有视频或者没有置顶视频
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/getObjectForBiLogin")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "综合管理",menuServer= "学习园地",instructionsOperate = "企业视频",instructionsType = "数据可视化平台首页获取")
|
||||
public Object getObjectForBiLogin() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd.put("TYPE", "1");
|
||||
pd.put("CORPINFO_TYPE", "1");
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
List<PageData> cpvarList = videoService.listAll(pd); //企业视频
|
||||
pd = new PageData();
|
||||
pd.put("CORPINFO_TYPE", "2");
|
||||
pd.put("TYPE", "1");
|
||||
List<PageData> ptVarList = videoService.listAll(pd); //平台视频
|
||||
|
||||
map.put("ptVarList", ptVarList);
|
||||
map.put("cpvarList", cpvarList);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
}
|
|
@ -13,7 +13,12 @@ public interface TrafficSafetyMeetingMapper {
|
|||
* @param page
|
||||
* @return
|
||||
*/
|
||||
List<PageData> datalistPage(Page page);
|
||||
List<PageData> datalistPage(Page page); /**
|
||||
* 列表
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
List<PageData> datalistPageUser(Page page);
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
package com.zcloud.mapper.datasource.study;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:学习园地
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2021-01-07
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface StudySectionMapper{
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void save(PageData pd);
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void delete(PageData pd);
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void edit(PageData pd);
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> datalistPage(Page page);
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> listAll(PageData pd);
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData findById(PageData pd);
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteAll(String[] ArrayDATA_IDS);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.zcloud.mapper.datasource.study;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:临时学习任务
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-05-18
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface TempStudyMapper{
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void save(PageData pd);
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void delete(PageData pd);
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void edit(PageData pd);
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> datalistPage(Page page);
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> listAll(PageData pd);
|
||||
List<PageData> listAllbyId(PageData pd);
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData findById(PageData pd);
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteAll(String[] ArrayDATA_IDS);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.zcloud.mapper.datasource.study;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:临时学习人员
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-05-18
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface TempStudyUsersMapper{
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void save(PageData pd);
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void delete(PageData pd);
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void edit(PageData pd);
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> datalistPage(Page page);
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> listAll(PageData pd);
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData findById(PageData pd);
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteAll(String[] ArrayDATA_IDS);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.zcloud.mapper.datasource.study;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:视频管理
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2021-01-15
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface VideoMapper{
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void save(PageData pd);
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void delete(PageData pd);
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void edit(PageData pd);
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> datalistPage(Page page);
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> listAll(PageData pd);
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData findById(PageData pd);
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteAll(String[] ArrayDATA_IDS);
|
||||
/**
|
||||
* 初始化置顶信息
|
||||
* 置顶视频
|
||||
* @param pd
|
||||
*/
|
||||
void editZhiding(PageData pd);
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ import java.util.List;
|
|||
|
||||
public interface TrafficSafetyMeetingService {
|
||||
List<PageData> listForSafetyMeeting(Page page);
|
||||
List<PageData> listForSafetyMeetingUser(Page page);
|
||||
|
||||
void delete(PageData pd) throws Exception;
|
||||
|
||||
|
|
|
@ -26,6 +26,16 @@ public class TrafficSafetyMeetingServiceImpl implements TrafficSafetyMeetingServ
|
|||
return trafficSafetyMeetingMapper.datalistPage(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PageData> listForSafetyMeetingUser(Page page) {
|
||||
return trafficSafetyMeetingMapper.datalistPageUser(page);
|
||||
}
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
package com.zcloud.service.study;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.entity.system.Mfolder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明: 文件管理接口
|
||||
* 作者:zCloud
|
||||
* 官网:
|
||||
* @version
|
||||
*/
|
||||
public interface MfolderStipulateService {
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception;
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception;
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception;
|
||||
|
||||
/**批量操作
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void makeAll(PageData pd)throws Exception;
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception;
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception;
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception;
|
||||
|
||||
/**
|
||||
* 通过ID获取其子级列表
|
||||
* @param parentId
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Mfolder> listByParentId(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 获取所有数据并填充每条数据的子级列表(递归处理)
|
||||
* @param MENU_ID
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Mfolder> listTree(PageData pd, String SHARE) throws Exception;
|
||||
|
||||
/**
|
||||
* 获取所有数据并填充每条数据的子级列表(递归处理)app
|
||||
* @param MENU_ID
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Mfolder> appListTree(PageData pd, String SHARE) throws Exception;
|
||||
|
||||
/**
|
||||
* 通过父ID查询sql
|
||||
* @param PARENTID
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Mfolder> findByParentId(String PARENTID) throws Exception;
|
||||
|
||||
/**法规库
|
||||
* APP查询法规库
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> findByName(PageData pd) throws Exception;
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.zcloud.service.study;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:学习园地
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2021-01-07
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface StudySectionService{
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception;
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception;
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception;
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception;
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception;
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception;
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.zcloud.service.study;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:临时学习任务
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-05-18
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface TempStudyService{
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception;
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception;
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception;
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception;
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAllbyId(PageData pd)throws Exception;
|
||||
public List<PageData> listAll(PageData pd)throws Exception;
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception;
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.zcloud.service.study;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:临时学习人员
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-05-18
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface TempStudyUsersService{
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception;
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception;
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception;
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception;
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception;
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception;
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.zcloud.service.study;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:视频管理
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2021-01-15
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface VideoService{
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception;
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception;
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception;
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception;
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception;
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception;
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void editZhiding(PageData pd)throws Exception;
|
||||
}
|
||||
|
|
@ -0,0 +1,159 @@
|
|||
package com.zcloud.service.study.impl;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.entity.system.Mfolder;
|
||||
import com.zcloud.mapper.datasource.filemanager.MfolderStipulateMapper;
|
||||
import com.zcloud.service.study.MfolderStipulateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明: 文件管理接口实现类
|
||||
* 作者:luoxiaobao
|
||||
* 官网:
|
||||
* @version
|
||||
*/
|
||||
@Service
|
||||
@Transactional //开启事物
|
||||
public class MfolderStipulateServiceImpl implements MfolderStipulateService {
|
||||
|
||||
@Autowired
|
||||
private MfolderStipulateMapper mfolderMapper;
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception{
|
||||
mfolderMapper.save(pd);
|
||||
}
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception{
|
||||
mfolderMapper.delete(pd);
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception{
|
||||
mfolderMapper.edit(pd);
|
||||
}
|
||||
|
||||
/**批量操作
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void makeAll(PageData pd)throws Exception{
|
||||
mfolderMapper.makeAll(pd);
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception{
|
||||
return mfolderMapper.datalistPage(page);
|
||||
}
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception{
|
||||
return mfolderMapper.listAll(pd);
|
||||
}
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception{
|
||||
return mfolderMapper.findById(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过ID获取其子级列表
|
||||
* @param parentId
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Mfolder> listByParentId(PageData pd) throws Exception {
|
||||
return mfolderMapper.listByParentId(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有数据并填充每条数据的子级列表(递归处理)
|
||||
* @param MENU_ID
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Mfolder> listTree(PageData pd, String SHARE) throws Exception {
|
||||
List<Mfolder> valueList = this.listByParentId(pd);
|
||||
try {
|
||||
for(int n=0;n<valueList.size();n++){
|
||||
Mfolder fhentity = valueList.get(n);
|
||||
pd.put("parentId", fhentity.getMFOLDER_ID());
|
||||
fhentity.setTreeurl("0".equals(fhentity.getPARENT_ID())?("mfolder_list.html?MFOLDER_ID="+fhentity.getMFOLDER_ID()+"&SHARE="+("yes".equals(SHARE)?fhentity.getFSHARE():"")):"");
|
||||
fhentity.setSubMfolder(this.listTree(pd,SHARE));
|
||||
fhentity.setTarget("treeFrame");
|
||||
}
|
||||
|
||||
}catch (ConcurrentModificationException e) {
|
||||
}
|
||||
return valueList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有数据并填充每条数据的子级列表(递归处理)app使用
|
||||
* @param MENU_ID
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Mfolder> appListTree(PageData pd, String SHARE) throws Exception {
|
||||
pd.put("TYPE", "1");
|
||||
List<Mfolder> valueList = this.listByParentId(pd);
|
||||
try {
|
||||
for(int n=0;n<valueList.size();n++){
|
||||
Mfolder fhentity = valueList.get(n);
|
||||
pd.put("parentId", fhentity.getMFOLDER_ID());
|
||||
fhentity.setTreeurl("0".equals(fhentity.getPARENT_ID())?("mfolder_list.html?MFOLDER_ID="+fhentity.getMFOLDER_ID()+"&SHARE="+("yes".equals(SHARE)?fhentity.getFSHARE():"")):"");
|
||||
fhentity.setSubMfolder(this.appListTree(pd,SHARE));
|
||||
fhentity.setTarget("treeFrame");
|
||||
}
|
||||
|
||||
}catch (ConcurrentModificationException e) {
|
||||
}
|
||||
return valueList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过父ID获取其子级列表
|
||||
* @param PARENTID
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Mfolder> findByParentId(String PARENTID) throws Exception {
|
||||
return mfolderMapper.findByParentId(PARENTID);
|
||||
}
|
||||
|
||||
/**
|
||||
* APP查询法规库
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> findByName(PageData pd) throws Exception {
|
||||
return mfolderMapper.findByName(pd);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package com.zcloud.service.study.impl;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.study.StudySectionMapper;
|
||||
import com.zcloud.service.study.StudySectionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:学习园地
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2021-01-07
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Service
|
||||
@Transactional //开启事物
|
||||
public class StudySectionServiceImpl implements StudySectionService {
|
||||
|
||||
@Autowired
|
||||
private StudySectionMapper studysectionMapper;
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception{
|
||||
studysectionMapper.save(pd);
|
||||
}
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception{
|
||||
studysectionMapper.delete(pd);
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception{
|
||||
studysectionMapper.edit(pd);
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception{
|
||||
return studysectionMapper.datalistPage(page);
|
||||
}
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception{
|
||||
return studysectionMapper.listAll(pd);
|
||||
}
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception{
|
||||
return studysectionMapper.findById(pd);
|
||||
}
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
|
||||
studysectionMapper.deleteAll(ArrayDATA_IDS);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
package com.zcloud.service.study.impl;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.study.TempStudyMapper;
|
||||
import com.zcloud.service.study.TempStudyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:临时学习任务
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-05-18
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Service
|
||||
@Transactional //开启事物
|
||||
public class TempStudyServiceImpl implements TempStudyService{
|
||||
|
||||
@Autowired
|
||||
private TempStudyMapper tempstudyMapper;
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception{
|
||||
tempstudyMapper.save(pd);
|
||||
}
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception{
|
||||
tempstudyMapper.delete(pd);
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception{
|
||||
tempstudyMapper.edit(pd);
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception{
|
||||
return tempstudyMapper.datalistPage(page);
|
||||
}
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAllbyId(PageData pd)throws Exception{
|
||||
return tempstudyMapper.listAllbyId(pd);
|
||||
}
|
||||
public List<PageData> listAll(PageData pd)throws Exception{
|
||||
return tempstudyMapper.listAll(pd);
|
||||
}
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception{
|
||||
return tempstudyMapper.findById(pd);
|
||||
}
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
|
||||
tempstudyMapper.deleteAll(ArrayDATA_IDS);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package com.zcloud.service.study.impl;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.study.TempStudyUsersMapper;
|
||||
import com.zcloud.service.study.TempStudyUsersService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:临时学习人员
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-05-18
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Service
|
||||
@Transactional //开启事物
|
||||
public class TempStudyUsersServiceImpl implements TempStudyUsersService {
|
||||
|
||||
@Autowired
|
||||
private TempStudyUsersMapper tempstudyusersMapper;
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception{
|
||||
tempstudyusersMapper.save(pd);
|
||||
}
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception{
|
||||
tempstudyusersMapper.delete(pd);
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception{
|
||||
tempstudyusersMapper.edit(pd);
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception{
|
||||
return tempstudyusersMapper.datalistPage(page);
|
||||
}
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception{
|
||||
return tempstudyusersMapper.listAll(pd);
|
||||
}
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception{
|
||||
return tempstudyusersMapper.findById(pd);
|
||||
}
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
|
||||
tempstudyusersMapper.deleteAll(ArrayDATA_IDS);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.zcloud.service.study.impl;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.study.VideoMapper;
|
||||
import com.zcloud.service.study.VideoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:视频管理
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2021-01-14 * 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Service
|
||||
@Transactional //开启事物
|
||||
public class VideoServiceImpl implements VideoService {
|
||||
|
||||
@Autowired
|
||||
private VideoMapper videoMapper;
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception{
|
||||
videoMapper.save(pd);
|
||||
}
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception{
|
||||
videoMapper.delete(pd);
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception{
|
||||
videoMapper.edit(pd);
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception{
|
||||
return videoMapper.datalistPage(page);
|
||||
}
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception{
|
||||
return videoMapper.listAll(pd);
|
||||
}
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception{
|
||||
return videoMapper.findById(pd);
|
||||
}
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
|
||||
videoMapper.deleteAll(ArrayDATA_IDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editZhiding(PageData pd) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
videoMapper.editZhiding(pd);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -199,6 +199,7 @@ public class UserCorpServiceImpl implements UserCorpService {
|
|||
uc.put("USER_CORP_ID", pd.getString("USER_CORP_ID"));
|
||||
uc.put("USER_ID", pd.getString("USER_ID"));
|
||||
uc.put("APPLY_STATUS", pd.getString("REVIEW_RESULT"));
|
||||
uc.put("ISDELETE", "2");
|
||||
if ("1".equals(pd.getString("REVIEW_RESULT"))) {
|
||||
pd.put("DUTIES", "");
|
||||
pd.put("TITLE", "");
|
||||
|
|
|
@ -933,6 +933,7 @@ public class UsersServiceImpl implements UsersService {
|
|||
uc.put("USER_CORP_ID", pd.getString("USER_CORP_ID"));
|
||||
uc.put("USER_ID", pd.getString("USER_ID"));
|
||||
uc.put("APPLY_STATUS", pd.getString("REVIEW_RESULT"));
|
||||
uc.put("ISDELETE", "2");
|
||||
if ("1".equals(pd.getString("REVIEW_RESULT"))) {
|
||||
pd.put("DUTIES", "");
|
||||
pd.put("TITLE", "");
|
||||
|
|
|
@ -149,6 +149,28 @@
|
|||
<if test="pd.MEETING_TYPE != null and pd.MEETING_TYPE != ''"><!-- 关键词检索-会议类型 -->
|
||||
and f.MEETING_TYPE = #{pd.MEETING_TYPE}
|
||||
</if>
|
||||
ORDER BY f.CREATETIME DESC
|
||||
</select>
|
||||
|
||||
<!--列表-->
|
||||
<select id="datalistPageUser" parameterType="page" resultType="pd">
|
||||
select
|
||||
f.*,
|
||||
i.CORP_NAME
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
left join bus_corp_info i on f.TRANSPORTATIONCOMPANY = i.CORPINFO_ID
|
||||
left join bus_traffic_safety_meeting_recipient e on f.SAFETY_MEETING_ID = e.SAFETY_MEETING_ID
|
||||
where f.ISDELETE = '0'
|
||||
AND
|
||||
e.PRACTITIONER = #{pd.USER_ID}
|
||||
<if test="pd.MEETING_TITLE != null and pd.MEETING_TITLE != ''"><!-- 关键词检索-会议标题 -->
|
||||
and f.MEETING_TITLE like CONCAT('%',#{pd.MEETING_TITLE},'%')
|
||||
</if>
|
||||
<if test="pd.MEETING_TYPE != null and pd.MEETING_TYPE != ''"><!-- 关键词检索-会议类型 -->
|
||||
and f.MEETING_TYPE = #{pd.MEETING_TYPE}
|
||||
</if>
|
||||
ORDER BY f.CREATETIME DESC
|
||||
</select>
|
||||
|
||||
<select id="getInfo" resultType="com.zcloud.entity.PageData" parameterType="com.zcloud.entity.PageData">
|
||||
|
|
|
@ -137,9 +137,11 @@
|
|||
|
||||
<select id="findById" resultType="com.zcloud.entity.PageData" parameterType="com.zcloud.entity.PageData">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
<include refid="Field"></include>,
|
||||
i.CORP_NAME
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
left join bus_corp_info i on f.OPERATINGCOMPANY = i.CORPINFO_ID
|
||||
where
|
||||
f.MANAGEMENTAGREEMENT_ID = #{MANAGEMENTAGREEMENT_ID}
|
||||
</select>
|
||||
|
|
|
@ -179,7 +179,10 @@
|
|||
, REPLYDATE=#{REPLYDATE}
|
||||
</if>
|
||||
<if test="TYPE != null and TYPE != ''">
|
||||
, `TYPE`=#{TYPE}
|
||||
, TYPE=#{TYPE}
|
||||
</if>
|
||||
<if test="REPLY != null and REPLY != ''">
|
||||
, REPLY=#{REPLY}
|
||||
</if>
|
||||
<if test="REPLYCONTENT != null and REPLYCONTENT != ''">
|
||||
, REPLYCONTENT=#{REPLYCONTENT}
|
||||
|
|
|
@ -211,24 +211,22 @@
|
|||
s.PHONE,
|
||||
t.OPERATTIME as STARTTIME,
|
||||
p.OPERATTIME as STOPTIME,
|
||||
c.PLATE_NUMBER,
|
||||
c.APPROVED_TOTAL_MASS,
|
||||
c.APPROVED_LOAD_CAPACITY,
|
||||
c.VIN,
|
||||
b.LOCATIONNAME AS ORIGIN_NAME,
|
||||
b2.LOCATIONNAME AS DESTINATION_NAME,
|
||||
m.CUSTOMERNAME AS CLIENT_NAME,
|
||||
e.FRAMES_NUMBER AS VIN,
|
||||
c2.CUSTOMERNAME AS CONFIRMER_NAME
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
left join bus_traffic_operatingvehicle e on f.TRANSPORTVEHICLE = e.PLATE_NUMBER
|
||||
left join sys_user s on s.USER_ID = f.PRACTITIONER
|
||||
left join bus_traffic_driving_sign t on t.WAYBILLREGISTRATION_ID = f.WAYBILLREGISTRATION_ID and t.CHECKTYPE_ID = 'status001'
|
||||
left join bus_traffic_driving_sign p on p.WAYBILLREGISTRATION_ID = f.WAYBILLREGISTRATION_ID and p.CHECKTYPE_ID = 'status003'
|
||||
left join bus_traffic_mechanical_freighttrailer c on c.FREIGHTTRAILER_ID = f.TRUCKCART
|
||||
left join bus_traffic_location_management b on f.ORIGIN = b.LOCATIONNAME_ID
|
||||
left join bus_traffic_location_management b2 on f.DESTINATION = b2.LOCATIONNAME_ID
|
||||
left join bus_traffic_customer_management m on f.CLIENT = m.CUSTOMERNAME_ID
|
||||
left join bus_traffic_customer_management c2 on f.CONFIRMER = c2.CUSTOMERNAME_ID
|
||||
left join bus_traffic_driving_sign p on p.WAYBILLREGISTRATION_ID = f.WAYBILLREGISTRATION_ID and p.CHECKTYPE_ID = 'status003'
|
||||
left join bus_traffic_mechanical_freighttrailer c on c.FREIGHTTRAILER_ID = f.TRUCKCART
|
||||
left join bus_traffic_location_management b on f.ORIGIN = b.LOCATIONNAME_ID
|
||||
left join bus_traffic_location_management b2 on f.DESTINATION = b2.LOCATIONNAME_ID
|
||||
left join bus_traffic_customer_management m on f.CLIENT = m.CUSTOMERNAME_ID
|
||||
left join bus_traffic_customer_management c2 on f.CONFIRMER = c2.CUSTOMERNAME_ID
|
||||
where
|
||||
f.WAYBILLREGISTRATION_ID = #{WAYBILLREGISTRATION_ID}
|
||||
</select>
|
||||
|
|
|
@ -250,6 +250,7 @@
|
|||
<include refid="tableName"></include>
|
||||
set
|
||||
APPLY_STATUS = #{APPLY_STATUS},
|
||||
ISDELETE = #{ISDELETE},
|
||||
OPERATOR = #{OPERATOR},
|
||||
OPERATORNAME = #{OPERATORNAME},
|
||||
OPERATTIME = #{OPERATTIME},
|
||||
|
|
Loading…
Reference in New Issue