Compare commits
5 Commits
162224305f
...
964122f60f
Author | SHA1 | Date |
---|---|---|
|
964122f60f | |
|
86d7b05fe8 | |
|
ea61a437db | |
|
269dca200d | |
|
2670bb44be |
|
@ -310,7 +310,7 @@ public class SFTPUtil {
|
|||
OutputStream output = null;
|
||||
try {
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("开始获取远程文件:[{}]---->[{}]", new Object[]{directory, saveFile});
|
||||
logger.info("开始获取远程文件:[{}]---->[{}]", new Object[]{directory, newDownloadFile});
|
||||
}
|
||||
// sftp.cd(directory);
|
||||
if (logger.isInfoEnabled()) {
|
||||
|
|
|
@ -264,6 +264,21 @@ public class KcExportConfigTpkwcqkjzglxController extends JeecgController<KcExpo
|
|||
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value="kc_export_config_tpkwcqkjzglx-分页列表查询", notes="kc_export_config_tpkwcqkjzglx-分页列表查询")
|
||||
@GetMapping(value = "/list3")
|
||||
public Result<IPage<KcExportConfigTpkwcqkjzglx>> list3(KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<KcExportConfigTpkwcqkjzglx> queryWrapper = QueryGenerator.initQueryWrapper(kcExportConfigTpkwcqkjzglx, req.getParameterMap());
|
||||
queryWrapper.apply("(zt = '在职' or (zt= '退休' and ytkcs-0 >0) or (zt= '离职' and ytkcs-0 >0))");
|
||||
Page<KcExportConfigTpkwcqkjzglx> page = new Page<>(pageNo, pageSize);
|
||||
IPage<KcExportConfigTpkwcqkjzglx> pageList = kcExportConfigTpkwcqkjzglxService.list3(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
|
|
|
@ -46,4 +46,6 @@ public interface KcExportConfigTpkwcqkjzglxMapper extends BaseMapper<KcExportCon
|
|||
List<KcExportConfigTpkwcqkjzglx> getBxqSaveList(KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx);
|
||||
|
||||
List<KcExportConfigTpkwcqkjzglx> groupTklxList(@Param(Constants.WRAPPER) QueryWrapper<KcExportConfigTpkwcqkjzglx> queryWrapper);
|
||||
|
||||
IPage<KcExportConfigTpkwcqkjzglx> list3(Page<KcExportConfigTpkwcqkjzglx> page, @Param(Constants.WRAPPER) QueryWrapper<KcExportConfigTpkwcqkjzglx> queryWrapper);
|
||||
}
|
||||
|
|
|
@ -32,6 +32,19 @@
|
|||
</select>
|
||||
|
||||
|
||||
<select id="list3" resultType="org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx">
|
||||
SELECT
|
||||
distinct
|
||||
gh as id,
|
||||
xqxn,
|
||||
dwmc,
|
||||
gh,
|
||||
xm
|
||||
FROM
|
||||
kc_export_config_tpkwcqkjzglx
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="getByGh" resultType="org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx">
|
||||
select * from kc_export_config_tpkwcqkjzglx
|
||||
where gh = #{gh} order by create_time desc limit 1
|
||||
|
|
|
@ -44,4 +44,6 @@ public interface IKcExportConfigTpkwcqkjzglxService extends IService<KcExportCon
|
|||
List<KcExportConfigTpkwcqkjzglx> getSfybxqsj();
|
||||
|
||||
List<KcExportConfigTpkwcqkjzglx> groupTklxList(QueryWrapper<KcExportConfigTpkwcqkjzglx> queryWrapper);
|
||||
|
||||
IPage<KcExportConfigTpkwcqkjzglx> list3(Page<KcExportConfigTpkwcqkjzglx> page, QueryWrapper<KcExportConfigTpkwcqkjzglx> queryWrapper);
|
||||
}
|
||||
|
|
|
@ -379,4 +379,9 @@ public class KcExportConfigTpkwcqkjzglxServiceImpl extends ServiceImpl<KcExportC
|
|||
public List<KcExportConfigTpkwcqkjzglx> groupTklxList(QueryWrapper<KcExportConfigTpkwcqkjzglx> queryWrapper) {
|
||||
return baseMapper.groupTklxList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<KcExportConfigTpkwcqkjzglx> list3(Page<KcExportConfigTpkwcqkjzglx> page, QueryWrapper<KcExportConfigTpkwcqkjzglx> queryWrapper) {
|
||||
return baseMapper.list3(page,queryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -131,13 +131,13 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
zyInfoStudent.setCatename("东北师大全校作业比对库");
|
||||
xnccSave(zyInfoStudent,"0",response);//提交比对
|
||||
}else{
|
||||
// zyInfoStudent.setCateid("DBSDQXZYBDK001");
|
||||
// zyInfoStudent.setCatename("东北师大全校作业比对库");
|
||||
// zyInfoStudent.setCateid(cateid);
|
||||
// zyInfoStudent.setCatename(catename);
|
||||
// xnccSave(zyInfoStudent,"1");//不提交比对
|
||||
zyInfoStudent.setCateid("DBSDQXZYBDK001");
|
||||
zyInfoStudent.setCatename("东北师大全校作业比对库");
|
||||
zyInfoStudent.setCateid(cateid);
|
||||
zyInfoStudent.setCatename(catename);
|
||||
xnccSave(zyInfoStudent,"1",response);//不提交比对
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -263,7 +263,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
zyCcjgMapper.insert(zyCcjg);
|
||||
|
||||
//提交后直接开始检测
|
||||
String message = xfwbdKsjc(zyCcjg);
|
||||
String message = xfwbdKsjc(zyCcjg,"1");
|
||||
System.out.println("21-------->"+message);
|
||||
}else{
|
||||
System.out.println("3-------->");
|
||||
|
@ -275,7 +275,8 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
String url = "https://vims.fanyu.com/toole/smallcheck/submitData";
|
||||
//文件路径,文件存在,不存在的话需要先下载下来
|
||||
// String fileName = uploadpath+"/"+ zyInfoStudent.getFilePath();
|
||||
String fileName = getFileName(zyInfoStudent.getFilePath(),response);
|
||||
String filePath = zyInfoStudent.getFilePath();
|
||||
String fileName = getFileName(filePath,response);
|
||||
Map<String, String> textMap = new HashMap<String, String>();
|
||||
String titlePar =fileName.substring(fileName.lastIndexOf("/")+1,fileName.length());
|
||||
String title = titlePar.split("_")[0];
|
||||
|
@ -293,6 +294,9 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
Map<String, String> fileMap = new HashMap<String, String>();
|
||||
fileMap.put("file", fileName);
|
||||
String contentType = "";//image/png
|
||||
System.out.println("url--->"+url);
|
||||
System.out.println("textMap--->"+textMap);
|
||||
System.out.println("fileMap--->"+fileMap);
|
||||
String ret = formUpload(url, textMap, fileMap,contentType);
|
||||
JSONObject object= JSONObject.parseObject(ret);
|
||||
if("true".equals(object.getString("success"))){
|
||||
|
@ -310,7 +314,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
//判断是否开始查重 1的时候进行查重,0不查重
|
||||
if(StringUtils.equals("1",type)){
|
||||
//提交后直接开始检测
|
||||
String message = xfwbdKsjc(zyCcjg);
|
||||
String message = xfwbdKsjc(zyCcjg,"0");
|
||||
System.out.println("21-------->"+message);
|
||||
}
|
||||
|
||||
|
@ -320,7 +324,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
}
|
||||
|
||||
//小范围对比开始检测
|
||||
public String xfwbdKsjc(ZyCcjg zyCcjg) {
|
||||
public String xfwbdKsjc(ZyCcjg zyCcjg,String sfpj) {
|
||||
String url = "https://vims.fanyu.com/toole/smallcheck/beginCheck";
|
||||
//文件路径,文件存在,不存在的话需要先下载下来
|
||||
String paperid = zyCcjg.getPaperid();
|
||||
|
@ -331,6 +335,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
textMap.put("userid", weipuId);
|
||||
textMap.put("cateid", zyCcjg.getBdkbs());//比对库的id
|
||||
textMap.put("dataids", paperid);//资源id
|
||||
textMap.put("exclude", sfpj);//是否排已(1:排已, 0:不排已)
|
||||
String contentType = "";//image/png
|
||||
Map<String, String> fileMap = new HashMap<String, String>();
|
||||
String ret = formUpload(url, textMap, fileMap,contentType);
|
||||
|
@ -360,6 +365,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
Map<String, String> fileMap = new HashMap<String, String>();
|
||||
fileMap.put("file", fileName);
|
||||
String contentType = "";//image/png
|
||||
System.out.println("fileMap-------->"+fileMap);
|
||||
String ret = formUpload(url, textMap, fileMap,contentType);
|
||||
System.out.println("1-------->"+ret);
|
||||
JSONObject object= JSONObject.parseObject(ret);
|
||||
|
@ -410,27 +416,33 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
String fileName = "";
|
||||
if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) {
|
||||
fileName = uploadpath+"/"+ imgPath;
|
||||
System.out.println("1111111111111111----------->");
|
||||
}else if(CommonConstant.UPLOAD_TYPE_SFTP.equals(uploadType)){
|
||||
System.out.println("22222222222222----------->");
|
||||
InputStream inputStream = null;
|
||||
OutputStream outputStream = null;
|
||||
try{
|
||||
System.out.println("getFileName----------->");
|
||||
int index = imgPath.lastIndexOf("/");
|
||||
String path = "temp";
|
||||
if(index != -1){
|
||||
path = imgPath.substring(0,index);
|
||||
}
|
||||
|
||||
System.out.println("path----------->"+path);
|
||||
Map<String,String> map = SFTPUtil.download(sftpConfig,imgPath,getDownloadPath(path));
|
||||
System.out.println("map----------->"+map);
|
||||
if(!map.get("code").equals("0")){
|
||||
response.setStatus(404);
|
||||
throw new RuntimeException(map.get("msg"));
|
||||
// throw new RuntimeException(map.get("msg"));
|
||||
}
|
||||
String localFilePath = map.get("fileName");
|
||||
File file = new File(localFilePath);
|
||||
if(!file.exists()){
|
||||
response.setStatus(404);
|
||||
throw new RuntimeException("文件["+imgPath+"]不存在..");
|
||||
// throw new RuntimeException("文件["+imgPath+"]不存在..");
|
||||
}
|
||||
System.out.println("localFilePath----------->"+localFilePath);
|
||||
// 设置强制下载不打开
|
||||
response.setContentType("application/force-download");
|
||||
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"),"iso-8859-1"));
|
||||
|
@ -443,7 +455,9 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
}
|
||||
response.flushBuffer();
|
||||
fileName = localFilePath;
|
||||
System.out.println("fileName----------->"+fileName);
|
||||
}catch (Exception e){
|
||||
System.out.println("catch----------->"+e);
|
||||
// e.printStackTrace();
|
||||
}finally {
|
||||
SFTPUtil.disChannel();
|
||||
|
@ -463,6 +477,8 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
System.out.println("333333333333333----------->");
|
||||
}
|
||||
return fileName;
|
||||
}
|
||||
|
|
|
@ -177,8 +177,8 @@ jeecg:
|
|||
# 签名拦截接口
|
||||
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
|
||||
#local、minio、alioss
|
||||
uploadType: local
|
||||
# uploadType: sftp
|
||||
# uploadType: local
|
||||
uploadType: sftp
|
||||
# 前端访问地址
|
||||
domainUrl:
|
||||
pc: http://localhost:3100
|
||||
|
@ -346,5 +346,5 @@ sftp:
|
|||
username: sftp
|
||||
password: sftp
|
||||
timeout: 1000
|
||||
uploadpath: /kczx
|
||||
uploadpath: kczx
|
||||
fullpath: /home/sftp
|
|
@ -352,5 +352,5 @@ sftp:
|
|||
username: sftp
|
||||
password: Nenujwc@99
|
||||
timeout: 1000
|
||||
uploadpath: /kczx
|
||||
uploadpath: kczx
|
||||
fullpath: /home/sftp
|
Loading…
Reference in New Issue