添加新字段及对应功能
This commit is contained in:
parent
32ab35ac8d
commit
2aacae23e8
|
@ -66,14 +66,14 @@
|
||||||
|
|
||||||
<select id="getListByCode" resultType="org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx">
|
<select id="getListByCode" resultType="org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx">
|
||||||
select * from (
|
select * from (
|
||||||
select a.tklx,a.gh,a.xm,a.dwmc,a.ytkcs,a.rjzy,count(c.upuserid) as sjtkcs from kc_export_config_tpkwcqkjzglx a
|
select GROUP_CONCAT(a.tklx) as tklx,a.gh,a.xm,a.dwmc,max(a.ytkcs) ytkcs,a.rjzy,count(c.upuserid) as sjtkcs from kc_export_config_tpkwcqkjzglx a
|
||||||
LEFT JOIN kc_xqxn_history b on a.xqxn = b.title
|
LEFT JOIN kc_xqxn_history b on a.xqxn = b.title
|
||||||
LEFT JOIN kc_evaluation c on a.gh = c.upuserid and c.up_date BETWEEN b.start_time and b.end_time
|
LEFT JOIN kc_evaluation c on a.gh = c.upuserid and c.up_date BETWEEN b.start_time and b.end_time
|
||||||
where xqxn = #{kcExportConfigTpkwcqkjzglx.xqxn} and (zt = '在职' or (zt= '退休' and ytkcs-0 >0)) and tklx in (${kcExportConfigTpkwcqkjzglx.code})
|
where xqxn = #{kcExportConfigTpkwcqkjzglx.xqxn} and (zt = '在职' or (zt= '退休' and ytkcs-0 >0)) and tklx in (${kcExportConfigTpkwcqkjzglx.code})
|
||||||
<if test="kcExportConfigTpkwcqkjzglx.dwmc != null and kcExportConfigTpkwcqkjzglx.dwmc != ''">
|
<if test="kcExportConfigTpkwcqkjzglx.dwmc != null and kcExportConfigTpkwcqkjzglx.dwmc != ''">
|
||||||
and dwmc = #{kcExportConfigTpkwcqkjzglx.dwmc}
|
and dwmc = #{kcExportConfigTpkwcqkjzglx.dwmc}
|
||||||
</if>
|
</if>
|
||||||
GROUP BY a.tklx,a.gh,a.xm,a.dwmc,a.ytkcs,a.rjzy
|
GROUP BY a.gh,a.xm,a.dwmc,a.rjzy
|
||||||
) a
|
) a
|
||||||
<where>
|
<where>
|
||||||
<if test='kcExportConfigTpkwcqkjzglx.type != null and kcExportConfigTpkwcqkjzglx.type == "1"'>
|
<if test='kcExportConfigTpkwcqkjzglx.type != null and kcExportConfigTpkwcqkjzglx.type == "1"'>
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package org.jeecg.modules.kc.zyInfoStudent.controller;
|
package org.jeecg.modules.kc.zyInfoStudent.controller;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
@ -9,8 +11,13 @@ import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import cn.hutool.core.io.FileUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.util.DateUtils;
|
||||||
|
import org.jeecg.common.util.SpringContextHolder;
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
|
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
|
||||||
import org.jeecg.modules.kc.zyInfoStudent.service.IZyInfoStudentService;
|
import org.jeecg.modules.kc.zyInfoStudent.service.IZyInfoStudentService;
|
||||||
|
@ -20,6 +27,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecg.modules.tools.Global;
|
||||||
|
import org.jeecg.modules.tools.pdf.PDFUtil;
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
@ -27,6 +36,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
@ -51,6 +61,8 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
|
||||||
@Autowired
|
@Autowired
|
||||||
private IZyInfoStudentService zyInfoStudentService;
|
private IZyInfoStudentService zyInfoStudentService;
|
||||||
|
|
||||||
|
@Value("${jeecg.path.upload}")
|
||||||
|
private String upLoadPath;
|
||||||
/**
|
/**
|
||||||
* 分页列表查询
|
* 分页列表查询
|
||||||
*
|
*
|
||||||
|
@ -172,4 +184,33 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
|
||||||
return super.importExcel(request, response, ZyInfoStudent.class);
|
return super.importExcel(request, response, ZyInfoStudent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AutoLog(value = "学生作业上传")
|
||||||
|
@ApiOperation(value="学生作业上传", notes="学生作业上传")
|
||||||
|
@RequestMapping(value = "/zyscStu", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> zyscStu(@RequestBody ZyInfoStudent zyInfoStudent) {
|
||||||
|
|
||||||
|
String nameLast = zyInfoStudent.getFilePath().substring(zyInfoStudent.getFilePath().lastIndexOf(".")+1);
|
||||||
|
if(StringUtils.equals("pdf",nameLast)){
|
||||||
|
zyInfoStudent.setPdfPath(zyInfoStudent.getFilePath());
|
||||||
|
}else{
|
||||||
|
Global global = SpringContextHolder.getBean(Global.class);
|
||||||
|
FileUtil.mkdir(global.getContractDickPath());
|
||||||
|
String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
|
||||||
|
String docPath = upLoadPath+ File.separator+ zyInfoStudent.getFilePath();
|
||||||
|
String namePath = dd + ".pdf";
|
||||||
|
String pdfPath = global.getContractDickPath() + namePath;
|
||||||
|
System.out.println("filPath:"+zyInfoStudent.getFilePath());
|
||||||
|
System.out.println("docPath:"+docPath);
|
||||||
|
System.out.println("pdfPath:"+pdfPath);
|
||||||
|
PDFUtil.office2PDF(docPath,pdfPath);
|
||||||
|
zyInfoStudent.setPdfPath("contract/"+namePath);
|
||||||
|
}
|
||||||
|
zyInfoStudentService.updateById(zyInfoStudent);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,6 +84,7 @@ public class ZyInfoStudent implements Serializable {
|
||||||
private java.lang.String aigcsftg;
|
private java.lang.String aigcsftg;
|
||||||
private java.lang.String studentName;
|
private java.lang.String studentName;
|
||||||
private java.lang.String score;
|
private java.lang.String score;
|
||||||
|
private java.lang.String pdfPath;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String catename;
|
private String catename;
|
||||||
|
|
|
@ -78,8 +78,6 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean save(ZyInfoStudent zyInfoStudent) {
|
public boolean save(ZyInfoStudent zyInfoStudent) {
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
||||||
zyInfoStudent.setStudentName(sysUser.getRealname());
|
|
||||||
baseMapper.insert(zyInfoStudent);
|
baseMapper.insert(zyInfoStudent);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue