任教课程-进入课程接口 sql增加删除状态筛选
This commit is contained in:
parent
e1cbeecf8b
commit
eb6f1e59dd
|
@ -331,6 +331,7 @@ public class KcKechengbiaoController extends JeecgController<KcKechengbiao, IKcK
|
||||||
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
|
||||||
kcKechengbiaoQueryWrapper.eq("rwbh",rwbh);
|
kcKechengbiaoQueryWrapper.eq("rwbh",rwbh);
|
||||||
kcKechengbiaoQueryWrapper.eq("xqxn",xqxn);
|
kcKechengbiaoQueryWrapper.eq("xqxn",xqxn);
|
||||||
|
kcKechengbiaoQueryWrapper.eq("flag","0");
|
||||||
kcKechengbiaoQueryWrapper.last("limit 1");
|
kcKechengbiaoQueryWrapper.last("limit 1");
|
||||||
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
|
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
|
||||||
return Result.OK(kcKechengbiao);
|
return Result.OK(kcKechengbiao);
|
||||||
|
|
|
@ -31,100 +31,29 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: kc_casusers
|
* @Description: kc_casusers
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-05-22
|
* @Date: 2023-05-22
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/v3/3rd")
|
@RequestMapping("/v3/3rd")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class WpsController extends JeecgController<KcCasusers, IKcCasusersService> {
|
public class WpsController extends JeecgController<KcCasusers, IKcCasusersService> {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IZyInfoStudentService zyInfoStudentService;
|
private IZyInfoStudentService zyInfoStudentService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService sysUserService;
|
private ISysUserService sysUserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文档预览
|
* 文档预览
|
||||||
|
*
|
||||||
* @param fileId
|
* @param fileId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/files/{fileId}", method = {RequestMethod.GET})
|
@RequestMapping(value = "/files/{fileId}", method = {RequestMethod.GET})
|
||||||
public Map<String,Object> files(@PathVariable("fileId") String fileId) {
|
public Map<String, Object> files(@PathVariable("fileId") String fileId) {
|
||||||
|
|
||||||
ZyInfoStudent zyInfoStudent = zyInfoStudentService.getById(fileId);
|
|
||||||
WpsEnti map = new WpsEnti();
|
|
||||||
map.setId(zyInfoStudent.getId());
|
|
||||||
map.setName(zyInfoStudent.getFilePath());
|
|
||||||
map.setVersion(1);
|
|
||||||
map.setSize(1);
|
|
||||||
map.setName(zyInfoStudent.getFilePath().substring(zyInfoStudent.getFilePath().lastIndexOf("/")+1));
|
|
||||||
Long createTime = zyInfoStudent.getCreateTime().getTime()/1000;
|
|
||||||
Long updateTime = zyInfoStudent.getUpdateTime().getTime()/1000;
|
|
||||||
map.setCreate_time(Integer.parseInt(createTime+""));
|
|
||||||
map.setModify_time(Integer.parseInt(updateTime+""));
|
|
||||||
map.setCreator_id(zyInfoStudent.getCreateBy());
|
|
||||||
map.setModifier_id(zyInfoStudent.getUpdateBy());
|
|
||||||
Map<String,Object> mapRet = new HashMap<>();
|
|
||||||
mapRet.put("code",0);
|
|
||||||
mapRet.put("data",map);
|
|
||||||
return mapRet;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件下载地址
|
|
||||||
* @param fileId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "/files/{fileId}/download", method = {RequestMethod.GET})
|
|
||||||
public Map<String,Object> download(@PathVariable("fileId") String fileId) {
|
|
||||||
ZyInfoStudent zyInfoStudent = zyInfoStudentService.getById(fileId);
|
|
||||||
Map<String,Object> mapRet = new HashMap<>();
|
|
||||||
Map<String,Object> mapRet2 = new HashMap<>();
|
|
||||||
// https://kczxcs.nenu.edu.cn/jeecg-boot/sys/common/static/temp/QA%E4%BD%9C%E4%B8%9A%E7%B3%BB%E7%BB%9F%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98_1733101749150.docx
|
|
||||||
mapRet2.put("url","https://kczxcs.nenu.edu.cn/jeecg-boot/sys/common/static/"+zyInfoStudent.getFilePath());
|
|
||||||
mapRet.put("code",0);
|
|
||||||
mapRet.put("data",mapRet2);
|
|
||||||
return mapRet;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取文档用户权限
|
|
||||||
* @param fileId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "/files/{fileId}/permission", method = {RequestMethod.GET})
|
|
||||||
public Map<String,Object> permission(@PathVariable("fileId") String fileId) {
|
|
||||||
ZyInfoStudent zyInfoStudent = zyInfoStudentService.getById(fileId);
|
|
||||||
Map<String,Object> mapRet = new HashMap<>();
|
|
||||||
Map<String,Object> mapRet2 = new HashMap<>();
|
|
||||||
mapRet.put("code",0);
|
|
||||||
mapRet2.put("comment",1);
|
|
||||||
// mapRet2.put("copy",1);
|
|
||||||
mapRet2.put("download",1);
|
|
||||||
mapRet2.put("history",1);
|
|
||||||
mapRet2.put("print",1);
|
|
||||||
mapRet2.put("read",1);
|
|
||||||
// mapRet2.put("rename",1);
|
|
||||||
// mapRet2.put("saveas",1);
|
|
||||||
mapRet2.put("update",1);
|
|
||||||
mapRet2.put("user_id",zyInfoStudent.getCreateBy());
|
|
||||||
|
|
||||||
mapRet.put("data",mapRet2);
|
|
||||||
return mapRet;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文档预览
|
|
||||||
* @param fileId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "/files/{fileId}/versions", method = {RequestMethod.GET})
|
|
||||||
public Map<String,Object> versions(@PathVariable("fileId") String fileId) {
|
|
||||||
|
|
||||||
ZyInfoStudent zyInfoStudent = zyInfoStudentService.getById(fileId);
|
ZyInfoStudent zyInfoStudent = zyInfoStudentService.getById(fileId);
|
||||||
WpsEnti map = new WpsEnti();
|
WpsEnti map = new WpsEnti();
|
||||||
|
@ -132,91 +61,168 @@ public class WpsController extends JeecgController<KcCasusers, IKcCasusersServic
|
||||||
map.setName(zyInfoStudent.getFilePath());
|
map.setName(zyInfoStudent.getFilePath());
|
||||||
map.setVersion(1);
|
map.setVersion(1);
|
||||||
map.setSize(1);
|
map.setSize(1);
|
||||||
map.setName(zyInfoStudent.getFilePath().substring(zyInfoStudent.getFilePath().lastIndexOf("/")+1));
|
map.setName(zyInfoStudent.getFilePath().substring(zyInfoStudent.getFilePath().lastIndexOf("/") + 1));
|
||||||
Long createTime = zyInfoStudent.getCreateTime().getTime()/1000;
|
Long createTime = zyInfoStudent.getCreateTime().getTime() / 1000;
|
||||||
Long updateTime = zyInfoStudent.getUpdateTime().getTime()/1000;
|
Long updateTime = zyInfoStudent.getUpdateTime().getTime() / 1000;
|
||||||
map.setCreate_time(Integer.parseInt(createTime+""));
|
map.setCreate_time(Integer.parseInt(createTime + ""));
|
||||||
map.setModify_time(Integer.parseInt(updateTime+""));
|
map.setModify_time(Integer.parseInt(updateTime + ""));
|
||||||
map.setCreator_id(zyInfoStudent.getCreateBy());
|
map.setCreator_id(zyInfoStudent.getCreateBy());
|
||||||
map.setModifier_id(zyInfoStudent.getUpdateBy());
|
map.setModifier_id(zyInfoStudent.getUpdateBy());
|
||||||
Map<String,Object> mapRet = new HashMap<>();
|
Map<String, Object> mapRet = new HashMap<>();
|
||||||
mapRet.put("code",0);
|
mapRet.put("code", 0);
|
||||||
mapRet.put("data",map);
|
mapRet.put("data", map);
|
||||||
|
return mapRet;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件下载地址
|
||||||
|
*
|
||||||
|
* @param fileId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/files/{fileId}/download", method = {RequestMethod.GET})
|
||||||
|
public Map<String, Object> download(@PathVariable("fileId") String fileId) {
|
||||||
|
ZyInfoStudent zyInfoStudent = zyInfoStudentService.getById(fileId);
|
||||||
|
Map<String, Object> mapRet = new HashMap<>();
|
||||||
|
Map<String, Object> mapRet2 = new HashMap<>();
|
||||||
|
// https://kczxcs.nenu.edu.cn/jeecg-boot/sys/common/static/temp/QA%E4%BD%9C%E4%B8%9A%E7%B3%BB%E7%BB%9F%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98_1733101749150.docx
|
||||||
|
mapRet2.put("url", "https://kczxcs.nenu.edu.cn/jeecg-boot/sys/common/static/" + zyInfoStudent.getFilePath());
|
||||||
|
mapRet.put("code", 0);
|
||||||
|
mapRet.put("data", mapRet2);
|
||||||
|
return mapRet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文档用户权限
|
||||||
|
*
|
||||||
|
* @param fileId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/files/{fileId}/permission", method = {RequestMethod.GET})
|
||||||
|
public Map<String, Object> permission(@PathVariable("fileId") String fileId,
|
||||||
|
@RequestHeader(value = "X-WebOffice-Token", required = false) String webOfficeToken) {
|
||||||
|
ZyInfoStudent zyInfoStudent = zyInfoStudentService.getById(fileId);
|
||||||
|
Map<String, Object> mapRet = new HashMap<>();
|
||||||
|
Map<String, Object> mapRet2 = new HashMap<>();
|
||||||
|
mapRet.put("code", 0);
|
||||||
|
mapRet2.put("comment", 1);
|
||||||
|
// mapRet2.put("copy",1);
|
||||||
|
mapRet2.put("download", 1);
|
||||||
|
mapRet2.put("history", 1);
|
||||||
|
mapRet2.put("print", 1);
|
||||||
|
mapRet2.put("read", 1);
|
||||||
|
// mapRet2.put("rename",1);
|
||||||
|
// mapRet2.put("saveas",1);
|
||||||
|
mapRet2.put("update", webOfficeToken.equals(zyInfoStudent.getCreateBy()) ? 0 : 1);
|
||||||
|
// mapRet2.put("user_id",zyInfoStudent.getCreateBy());
|
||||||
|
mapRet2.put("user_id", webOfficeToken);
|
||||||
|
mapRet.put("data", mapRet2);
|
||||||
|
return mapRet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档预览
|
||||||
|
*
|
||||||
|
* @param fileId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/files/{fileId}/versions", method = {RequestMethod.GET})
|
||||||
|
public Map<String, Object> versions(@PathVariable("fileId") String fileId) {
|
||||||
|
|
||||||
|
ZyInfoStudent zyInfoStudent = zyInfoStudentService.getById(fileId);
|
||||||
|
WpsEnti map = new WpsEnti();
|
||||||
|
map.setId(zyInfoStudent.getId());
|
||||||
|
map.setName(zyInfoStudent.getFilePath());
|
||||||
|
map.setVersion(1);
|
||||||
|
map.setSize(1);
|
||||||
|
map.setName(zyInfoStudent.getFilePath().substring(zyInfoStudent.getFilePath().lastIndexOf("/") + 1));
|
||||||
|
Long createTime = zyInfoStudent.getCreateTime().getTime() / 1000;
|
||||||
|
Long updateTime = zyInfoStudent.getUpdateTime().getTime() / 1000;
|
||||||
|
map.setCreate_time(Integer.parseInt(createTime + ""));
|
||||||
|
map.setModify_time(Integer.parseInt(updateTime + ""));
|
||||||
|
map.setCreator_id(zyInfoStudent.getCreateBy());
|
||||||
|
map.setModifier_id(zyInfoStudent.getUpdateBy());
|
||||||
|
Map<String, Object> mapRet = new HashMap<>();
|
||||||
|
mapRet.put("code", 0);
|
||||||
|
mapRet.put("data", map);
|
||||||
return mapRet;
|
return mapRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping(value = "/users")
|
@GetMapping(value = "/users")
|
||||||
public Map<String, Object> users(@RequestParam(name="user_ids",required=true) String user_ids) {
|
public Map<String, Object> users(@RequestParam(name = "user_ids", required = true) String user_ids) {
|
||||||
System.out.println("user_ids : " + user_ids);
|
System.out.println("user_ids : " + user_ids);
|
||||||
String userIds[] = user_ids.split(",");
|
String userIds[] = user_ids.split(",");
|
||||||
List<Map<String,Object>> list = new ArrayList<>();
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
Map<String,Object> mapRet = new HashMap<>();
|
Map<String, Object> mapRet = new HashMap<>();
|
||||||
mapRet.put("code",0);
|
mapRet.put("code", 0);
|
||||||
for(String userId : userIds){
|
for (String userId : userIds) {
|
||||||
SysUser sysUser = sysUserService.getUserByName(userId);
|
SysUser sysUser = sysUserService.getUserByName(userId);
|
||||||
System.out.println("sysUser : " + sysUser);
|
System.out.println("sysUser : " + sysUser);
|
||||||
Map<String,Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("id",sysUser.getUsername());
|
map.put("id", sysUser.getUsername());
|
||||||
map.put("name",sysUser.getRealname());
|
map.put("name", sysUser.getRealname());
|
||||||
list.add(map);
|
list.add(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
mapRet.put("data",list);
|
mapRet.put("data", list);
|
||||||
return mapRet;
|
return mapRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 准备上传阶段
|
* 准备上传阶段
|
||||||
|
*
|
||||||
* @param fileId
|
* @param fileId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/files/{fileId}/upload/prepare", method = {RequestMethod.GET})
|
@RequestMapping(value = "/files/{fileId}/upload/prepare", method = {RequestMethod.GET})
|
||||||
public Map<String,Object> prepare(@PathVariable("fileId") String fileId) {
|
public Map<String, Object> prepare(@PathVariable("fileId") String fileId) {
|
||||||
Map<String,Object> mapRet = new HashMap<>();
|
Map<String, Object> mapRet = new HashMap<>();
|
||||||
mapRet.put("code",0);
|
mapRet.put("code", 0);
|
||||||
Map<String,Object> mapRet2 = new HashMap<>();
|
Map<String, Object> mapRet2 = new HashMap<>();
|
||||||
String jmArr[] = {"sha1"};
|
String jmArr[] = {"sha1"};
|
||||||
mapRet2.put("digest_types",jmArr);
|
mapRet2.put("digest_types", jmArr);
|
||||||
mapRet.put("data",mapRet2);
|
mapRet.put("data", mapRet2);
|
||||||
mapRet.put("message","");
|
mapRet.put("message", "");
|
||||||
return mapRet;
|
return mapRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = "/files/{fileId}/upload/address", method = {RequestMethod.POST})
|
@RequestMapping(value = "/files/{fileId}/upload/address", method = {RequestMethod.POST})
|
||||||
public Map<String,Object> address(@PathVariable("fileId") String fileId, @RequestBody WpsUploadEnti wpsUploadEnti) {
|
public Map<String, Object> address(@PathVariable("fileId") String fileId, @RequestBody WpsUploadEnti wpsUploadEnti) {
|
||||||
ZyInfoStudent zyInfoStudent = zyInfoStudentService.getById(fileId);
|
ZyInfoStudent zyInfoStudent = zyInfoStudentService.getById(fileId);
|
||||||
Map<String,Object> mapRet = new HashMap<>();
|
Map<String, Object> mapRet = new HashMap<>();
|
||||||
mapRet.put("code",0);
|
mapRet.put("code", 0);
|
||||||
Map<String,Object> mapRet2 = new HashMap<>();
|
Map<String, Object> mapRet2 = new HashMap<>();
|
||||||
mapRet2.put("url","https://kczxcs.nenu.edu.cn/jeecg-boot/sys/common/static/"+zyInfoStudent.getFilePath());
|
mapRet2.put("url", "https://kczxcs.nenu.edu.cn/jeecg-boot/sys/common/static/" + zyInfoStudent.getFilePath());
|
||||||
mapRet2.put("method","POST");
|
mapRet2.put("method", "POST");
|
||||||
mapRet.put("data",mapRet2);
|
mapRet.put("data", mapRet2);
|
||||||
mapRet.put("message","");
|
mapRet.put("message", "");
|
||||||
return mapRet;
|
return mapRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/files/{fileId}/upload/complete", method = {RequestMethod.POST})
|
@RequestMapping(value = "/files/{fileId}/upload/complete", method = {RequestMethod.POST})
|
||||||
public Map<String,Object> complete(@PathVariable("fileId") String fileId, @RequestBody WpsUploadEnti wpsUploadEnti,HttpServletRequest request, HttpServletResponse response) {
|
public Map<String, Object> complete(@PathVariable("fileId") String fileId, @RequestBody WpsUploadEnti wpsUploadEnti, HttpServletRequest request, HttpServletResponse response) {
|
||||||
ZyInfoStudent zyInfoStudent = zyInfoStudentService.getById(fileId);
|
ZyInfoStudent zyInfoStudent = zyInfoStudentService.getById(fileId);
|
||||||
Map<String,Object> mapRet = new HashMap<>();
|
Map<String, Object> mapRet = new HashMap<>();
|
||||||
mapRet.put("code",0);
|
mapRet.put("code", 0);
|
||||||
WpsEnti map = new WpsEnti();
|
WpsEnti map = new WpsEnti();
|
||||||
map.setId(zyInfoStudent.getId());
|
map.setId(zyInfoStudent.getId());
|
||||||
map.setName(zyInfoStudent.getFilePath());
|
map.setName(zyInfoStudent.getFilePath());
|
||||||
map.setVersion(2);
|
map.setVersion(2);
|
||||||
map.setSize(1);
|
map.setSize(1);
|
||||||
map.setName(zyInfoStudent.getFilePath().substring(zyInfoStudent.getFilePath().lastIndexOf("/")+1));
|
map.setName(zyInfoStudent.getFilePath().substring(zyInfoStudent.getFilePath().lastIndexOf("/") + 1));
|
||||||
Long createTime = zyInfoStudent.getCreateTime().getTime()/1000;
|
Long createTime = zyInfoStudent.getCreateTime().getTime() / 1000;
|
||||||
Long updateTime = zyInfoStudent.getUpdateTime().getTime()/1000;
|
Long updateTime = zyInfoStudent.getUpdateTime().getTime() / 1000;
|
||||||
map.setCreate_time(Integer.parseInt(createTime+""));
|
map.setCreate_time(Integer.parseInt(createTime + ""));
|
||||||
map.setModify_time(Integer.parseInt(updateTime+""));
|
map.setModify_time(Integer.parseInt(updateTime + ""));
|
||||||
map.setCreator_id(zyInfoStudent.getCreateBy());
|
map.setCreator_id(zyInfoStudent.getCreateBy());
|
||||||
map.setModifier_id(zyInfoStudent.getUpdateBy());
|
map.setModifier_id(zyInfoStudent.getUpdateBy());
|
||||||
mapRet.put("data",map);
|
mapRet.put("data", map);
|
||||||
mapRet.put("message","");
|
mapRet.put("message", "");
|
||||||
return mapRet;
|
return mapRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue