Merge remote-tracking branch 'origin/FOTON' into FOTON

This commit is contained in:
zj
2021-12-17 10:52:11 +08:00
22 changed files with 228 additions and 124 deletions
@@ -20,6 +20,12 @@ import java.util.Set;
//@FeignClient(value = "shan6")
public interface workFlowFeignClient {
@RequestMapping(value = "/bat-wkflow/busProcessModel/processModelHisOneUpdStatus",method = RequestMethod.GET)
BusProcessModelHis processModelHisOneUpdStatus(@RequestParam("pid") String pid, @RequestParam("taskId") String taskId);
@RequestMapping(value = "/bat-wkflow/busProcessModel/processModelHisOneCount",method = RequestMethod.GET)
BusProcessModelHis processModelHisOneCount(@RequestParam("pid") String pid);
@RequestMapping(value = "/bat-wkflow/busProcessModel/processModelHisOne",method = RequestMethod.GET)
BusProcessModelHis processModelHisOne(@RequestParam("pid") String pid, @RequestParam("taskId") String taskId);
@@ -28,6 +28,16 @@ public class workFlowFeignClientImpl {
@Autowired
private IUserEOService userEOService;
public BusProcessModelHis processModelHisOneUpdStatus(@RequestParam("pid") String pid,@RequestParam("taskId") String taskId){
BusProcessModelHis stringWrapper = workFlowFeignClient.processModelHisOneUpdStatus(pid,taskId);
return stringWrapper;
}
public BusProcessModelHis processModelHisOneCount(@RequestParam("pid") String pid){
BusProcessModelHis stringWrapper = workFlowFeignClient.processModelHisOneCount(pid);
return stringWrapper;
}
public BusProcessModelHis processModelHisOne(@RequestParam("pid") String pid,@RequestParam("taskId") String taskId){
BusProcessModelHis stringWrapper = workFlowFeignClient.processModelHisOne(pid,taskId);
return stringWrapper;
@@ -47,20 +47,34 @@ public class TableToExcel {
if (j<3)
hCell.setCellValue(columnMap.get(key));
}
Cell hCellh = headRow.createCell(2);
hCellh.setCellValue("修改意见内容");
Cell hCell = headRow.createCell(5);
hCell.setCellValue("提出部门");
Cell hCell1 = headRow.createCell(6);
hCell1.setCellValue("提出人");
Cell hCell2 = headRow.createCell(7);
hCell2.setCellValue("处理意见");
Cell nCell = neckRow.createCell(2);
nCell.setCellValue("修改前");
Cell nCell1 = neckRow.createCell(3);
nCell1.setCellValue("修改后");
Cell nCell2 = neckRow.createCell(4);
nCell2.setCellValue("修改理由");
if (null!=columnMap.get("commentText")) {
Cell hCellh = headRow.createCell(2);
hCellh.setCellValue("修改意见内容");
}
if (null!=columnMap.get("department")) {
Cell hCell = headRow.createCell(5);
hCell.setCellValue("提出部门");
}
if (null!=columnMap.get("responUserName")) {
Cell hCell1 = headRow.createCell(6);
hCell1.setCellValue("提出人");
}
if (null!=columnMap.get("stateText")) {
Cell hCell2 = headRow.createCell(7);
hCell2.setCellValue("处理意见");
}
if (null!=columnMap.get("oldText")) {
Cell nCell = neckRow.createCell(2);
nCell.setCellValue("修改前");
}
if (null!=columnMap.get("newText")) {
Cell nCell1 = neckRow.createCell(3);
nCell1.setCellValue("修改后");
}
if (null!=columnMap.get("reason")) {
Cell nCell1 = neckRow.createCell(4);
nCell1.setCellValue("修改理由");
}
//从第三行开始填充数据
@@ -25,14 +25,17 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.util.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.util.*;
import java.util.stream.Collectors;
@@ -41,12 +44,108 @@ import java.util.stream.Collectors;
@Api(tags = "福田标准法规-工作流管理")
public class WorkFlowController {
private static final Logger logger = LoggerFactory.getLogger(WorkFlowController.class);
@Autowired
private workFlowFeignClientImpl workFlowFeignClient;
@Value("${stand.edit.file.path}")
private String standEditFilePath;
// @Autowired
// private ExportExcelMapper exportExcelMapper;
@ApiOperation(value = "查询在线编辑流程汇总文件编辑对象")
@GetMapping("/processModelHisOneCount")
public BusProcessModelHis processModelHisOneCount(@RequestParam("pid") String pid){
return workFlowFeignClient.processModelHisOneCount(pid);
}
@ApiOperation(value = "|onlyOffice接收文件")
@PostMapping("/recieveFile")
public void recieveFile(HttpServletRequest request, HttpServletResponse response, String fileNm,String standNo,String pid,String taskId){
logger.info("**********进入onlyoffice接收文档接口************");
try {
PrintWriter writer = response.getWriter();
String body = "";
try {
Scanner scanner = new Scanner(request.getInputStream());
scanner.useDelimiter("\\A");
body = scanner.hasNext() ? scanner.next() : "";
scanner.close();
} catch (Exception ex) {
writer.write("get request.getInputStream error:" + ex.getMessage());
return;
}
if (body.isEmpty()) {
writer.write("empty request.getInputStream");
return;
}
net.sf.json.JSONObject jsonObj = net.sf.json.JSONObject.fromObject(body);
logger.info("**********onlyoffice接收文档接口获得结果body************" + body);
int status = (Integer) jsonObj.get("status");
int saved = 0;
if (status == 2 || status == 3)//MustSave, Corrupted
{
String downloadUri = (String) jsonObj.get("url");
try {
logger.info("**********onlyoffice接收文档接口获得downloadUri************" + downloadUri);
if (StringUtils.isNotEmpty(downloadUri)) {
File file = new File(standEditFilePath + standNo + "\\" + fileNm);
downloadNetFile(downloadUri, file);
}
} catch (Exception ex) {
saved = 1;
logger.info("**********onlyoffice接收文档接口异常************" + ex.getMessage());
logger.error(ex.getMessage(),ex);
}
} else if (status == 4) {
logger.info("**********onlyoffice接收文档接口开始修改文件状态状态4************");
logger.info("**********onlyoffice接收文档接口修改文件状态成功状态4************");
}
logger.info("onlyoffice编辑完成--------------");
writer.write("{\"error\":" + saved + "}");
// 更新在线编辑当前节点编辑状态
workFlowFeignClient.processModelHisOneUpdStatus(pid,taskId);
} catch (IOException e) {
logger.info("**********onlyoffice接收文档接口异常************" + e.getMessage());
logger.error(e.getMessage(),e);
return;
}
}
public void downloadNetFile(String downloadUrl, File file) {
try {
FileOutputStream fileOutputStream = new FileOutputStream(file);
URL url = new URL(downloadUrl);
URLConnection connection = url.openConnection();
InputStream inputStream = connection.getInputStream();
int length = 0;
byte[] bytes = new byte[1024];
while ((length = inputStream.read(bytes)) != -1) {
fileOutputStream.write(bytes, 0, length);
}
fileOutputStream.close();
inputStream.close();
} catch (IOException e) {
logger.error("download error ! url :{}, exception:{}", downloadUrl, e);
}
}
@ApiOperation(value = "更新在线编辑流程当前节点编辑状态")
@GetMapping("/processModelHisOneUpd")
public BusProcessModelHis processModelHisOneUpd(@RequestParam("pid") String pid,@RequestParam("taskId") String taskId){
return workFlowFeignClient.processModelHisOneUpdStatus(pid,taskId);
}
@ApiOperation(value = "查询在线编辑流程当前节点编辑对象")
@GetMapping("/processModelHisOne")
public BusProcessModelHis processModelHisOne(@RequestParam("pid") String pid,@RequestParam("taskId") String taskId){
@@ -78,6 +78,10 @@ public class BusProcessModelHis implements Serializable {
@TableField("EDIT_FILE_PATH")
private String editFilePath;
@ApiModelProperty(value = "onlyOffice 编辑类型 node 节点编辑 count 汇总编辑")
@TableField("EDIT_TYPE")
private String editType;
@ApiModelProperty(value = "逻辑状态")
@TableField("FLAG")
private String flag;
@@ -64,7 +64,11 @@ public class WebMvcConfig implements WebMvcConfigurer {
//文件预览
addInterceptor.excludePathPatterns("/api/att/attFile/getFileInfo");
// onlyOffice 回调
addInterceptor.excludePathPatterns("/api/att/attFile/recieveFile");
addInterceptor.excludePathPatterns("/api/lawss/activiti/recieveFile");
addInterceptor.excludePathPatterns("/api/lawss/activiti/processModelHisOne");
addInterceptor.excludePathPatterns("/api/lawss/activiti/processModelHisOneCount");
addInterceptor.excludePathPatterns("/api/att/attFile/getSyncPdfFileInfo");
//附件下载
@@ -78,7 +78,7 @@ public class FileMaterialController extends BaseController<FileMaterial> {
@PutMapping
@ApiOperation("修改文件资料组")
public ResponseMessage updateFileMaterial(FileMaterial fileMaterial){
public ResponseMessage updateFileMaterial(@RequestBody FileMaterial fileMaterial){
boolean b = iFileMaterialService.updateById(fileMaterial);
return Result.success(b);
@@ -8,6 +8,8 @@ import lombok.Data;
@Data
public class FileMaterialPage {
private String id;
private String dataTitle;
private String dataType;
@@ -52,7 +52,17 @@ public class FileMaterialServiceImpl extends ServiceImpl<FileMaterialDao, FileMa
queryPage.getEndDataUploadTime());
}
return this.page(new Page<>(queryPage.getPage(),queryPage.getPageSize()),queryWrapper);
if (queryPage.getId()!=null && !"".equals(queryPage.getId()) ){
queryWrapper.eq("id",queryPage.getId());
}
IPage<FileMaterial> page=null;
if (queryPage.getPage()==null || queryPage .getPageSize()==null){
page=new Page<>(1,1);
}else {
page=new Page<>(queryPage.getPage(),queryPage.getPageSize());
}
return this.page(page,queryWrapper);
}
@Override
@@ -15,11 +15,8 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.adc.da.base.web.BaseController;
import javax.servlet.http.HttpServletResponse;
@@ -77,6 +74,14 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
}
@ApiOperation(value = "增加意见")
@PostMapping("/saveBatch")
public ResponseMessage saveBatch(@RequestBody List<SarPublicIdeaAll> sar){
boolean flag=sarPublicIdeaAllImpl.saveBatch(sar);
return Result.success("200",flag);
}
@ApiOperation(value = "删除意见")
@GetMapping("/deleteStand")
public ResponseMessage deleteStand(DelStandDto delStandDto){
@@ -94,7 +99,7 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
@ApiOperation(value = "导出全部意见")
@GetMapping("/tuallStand")
public void getAllStand(HttpServletResponse response,String cid){
public void getAllStand(HttpServletResponse response,@RequestParam(value = "cid")String cid,@RequestParam(value = "type",required = false)String type){
try {
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
@@ -102,7 +107,7 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
List<SarPublicIdeaAll> data=new ArrayList<>();
if (!StringUtils.isEmpty(cid)){
data=sarPublicIdeaAllDao.getPublicAllIdea(cid);
data=sarPublicIdeaAllDao.getPublicAllIdea(cid,type);
}
List<GetExcelDto> standExcel=new ArrayList<>();
for (SarPublicIdeaAll sarPublicIdeaAll:data){
@@ -27,5 +27,5 @@ public interface SarPublicIdeaAllDao extends BaseMapper<SarPublicIdeaAll> {
Integer getAllDataByIdeaCount( @Param("ideaId")String ideaId);
List<SarPublicIdeaAll> getPublicAllIdea(@Param("cid") String cid);
List<SarPublicIdeaAll> getPublicAllIdea(@Param("cid") String cid,@Param("type")String type);
}
@@ -72,5 +72,8 @@ public class SarPublicIdea extends BaseEntity {
@TableField("files_name")
private String filesName;
@TableField("wkfiles")
private String wkfiles;
}
@@ -63,4 +63,13 @@ public class SarPublicIdeaAll extends BaseEntity {
public static final String CID = "cid";
@TableField("chapter_name")
private String chapterName;
@TableField(exist = false)
private String department;
@TableField("wk_flag")
private String wkFlag;
}
@@ -303,7 +303,7 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
if (result > 0) {
return Result.success("0", "删除成功", result);
}else if(result == -1) {
return Result.success("-1","所选的标准下挂有标准,无法删除");
return Result.success("-1","所选的标准下挂有清单,无法删除");
}
else {
return Result.error("删除失败");
@@ -162,7 +162,7 @@ public class SarStandFileEOController extends BaseController<SarStandFileEO> {
@GetMapping("/querySourceFileInfo")
public ResponseMessage<List<SarStandFileEO>> querySourceFileInfo(String standId){
List<SarStandFileEO> sarStandFileEOS = sarStandFileEOService.selectFileByStandId(standId);
List<SarStandFileEO> sarStandFileEOS = sarStandFileEOService.querySourceFileInfo(standId);
return Result.success(sarStandFileEOS);
}
}
@@ -38,12 +38,13 @@
<!-- 只查询这个部门下的子一级人员-->
<select id="selectNextUser" resultMap="TsUser">
select ts_user.EMAIL,ts_user.ACCOUNT,ts_user.CREATION_TIME,ts_user.DISABLE_FLAG,ts_user.EXT_INFO,ts_user.USID,
ts_user.INSTITUTION_ID,ts_user.INSTITUTION_NAME,ts_user.MODIFY_TIME,ts_user.OPER_USER,ts_user.PASSWORD,ts_user.PHONE,
ts_user.INSTITUTION_ID,t2.name as INSTITUTION_NAME,ts_user.MODIFY_TIME,ts_user.OPER_USER,ts_user.PASSWORD,ts_user.PHONE,
ts_user.POSITION_ID,ts_user.POSITION_NAME,ts_user.SEX,ts_user.SSO_ID,ts_user.STATE,ts_user.UNLOCK_FLAG,ts_user.USER_SOURCE,
ts_user.USER_TYPE,ts_user.VALID_FLAG,ts_user.WORK_NUM,concat(ts_user.UNAME,concat(concat("(",ts_user.ACCOUNT),")")) as uname,
ts_institution.name as unit,ts_institution.id as unitId
from ts_user
left join ts_institution ON ts_institution.id = (SELECT parent_id from ts_institution WHERE id = ts_user.INSTITUTION_ID)
left join ts_institution t2 on t2.id=ts_user.INSTITUTION_ID
WHERE institution_id=#{institutionId}
<if test="userName != null and userName != '' ">
and ( ts_user.ACCOUNT like concat(concat('%',#{userName}),'%') or ts_user.UNAME like concat(concat('%',#{userName}),'%') )
@@ -52,10 +53,11 @@
<select id="selectNextUserByIds" resultMap="TsUser">
select ts_user.EMAIL,ts_user.ACCOUNT,ts_user.CREATION_TIME,ts_user.DISABLE_FLAG,ts_user.EXT_INFO,ts_user.USID,
ts_user.INSTITUTION_ID,ts_user.INSTITUTION_NAME,ts_user.MODIFY_TIME,ts_user.OPER_USER,ts_user.PASSWORD,ts_user.PHONE,
ts_user.INSTITUTION_ID,ts_institution.name as INSTITUTION_NAME,ts_user.MODIFY_TIME,ts_user.OPER_USER,ts_user.PASSWORD,ts_user.PHONE,
ts_user.POSITION_ID,ts_user.POSITION_NAME,ts_user.SEX,ts_user.SSO_ID,ts_user.STATE,ts_user.UNLOCK_FLAG,ts_user.USER_SOURCE,
ts_user.USER_TYPE,ts_user.VALID_FLAG,ts_user.WORK_NUM,concat(ts_user.UNAME,concat(concat("(",ts_user.ACCOUNT),")")) as uname
from ts_user
left join ts_institution on ts_user.INSTITUTION_ID=ts_institution.id
WHERE 1=1
<if test="ids != null and ids.size()> 0 ">
and ts_user.USID in
@@ -3,33 +3,47 @@
<mapper namespace="com.adc.da.slrs.sarStandIdea.dao.SarPublicIdeaAllDao">
<select id="getPublicIdea" resultType="com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAll">
SELECT sar_public_idea_all.* FROM sar_public_idea
SELECT sar_public_idea_all.id,sar_public_idea_all.reason,ts_institution.name as dept_name,ts_institution.name as department,sar_public_idea_all.old_text,
sar_public_idea_all.new_text,ts_user.INSTITUTION_ID as dept_id,sar_public_idea_all.part_code,sar_public_idea_all.user_name,
sar_public_idea_all.user_id,sar_public_idea_all.content,sar_public_idea_all.idea_id,sar_public_idea_all.cid,
sar_public_idea_all.chapter_name as chapterName,sar_public_idea_all.wk_flag
FROM sar_public_idea
INNER JOIN sar_public_idea_all on sar_public_idea_all.idea_id = sar_public_idea.id
WHERE sar_public_idea_all.idea_id IS NOT NULL and sar_public_idea.uniques = #{unique}
left join ts_user on ts_user.USID = sar_public_idea_all.user_id
left join ts_institution on ts_institution.id=ts_user.INSTITUTION_ID
WHERE sar_public_idea_all.idea_id IS NOT NULL and sar_public_idea.uniques = #{unique} and sar_public_idea_all.wk_flag is null
</select>
<select id="getAllDataByIdea" resultType="com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAll">
SELECT sar_public_idea_all.id,sar_public_idea_all.reason,ts_user.INSTITUTION_NAME as dept_name,sar_public_idea_all.old_text,
SELECT sar_public_idea_all.id,sar_public_idea_all.reason,ts_institution.name as dept_name,sar_public_idea_all.old_text,sar_public_idea_all.wk_flag,
sar_public_idea_all.new_text,ts_user.INSTITUTION_ID as dept_id,sar_public_idea_all.part_code,sar_public_idea_all.user_name,
sar_public_idea_all.user_id,sar_public_idea_all.content,sar_public_idea_all.idea_id,sar_public_idea_all.cid
sar_public_idea_all.user_id,sar_public_idea_all.content,sar_public_idea_all.idea_id,sar_public_idea_all.cid,sar_public_idea_all.chapter_name as chapterName
FROM sar_public_idea_all
left join ts_user on sar_public_idea_all.user_id=ts_user.USID
left join ts_institution on ts_institution.id=ts_user.INSTITUTION_ID
WHERE
sar_public_idea_all.idea_id = #{ideaId}
sar_public_idea_all.idea_id = #{ideaId} and sar_public_idea_all.wk_flag is null
LIMIT ${(page-1)*size},${size}
</select>
<select id="getAllDataByIdeaCount" resultType="java.lang.Integer">
SELECT count(id)
FROM sar_public_idea_all WHERE
idea_id = #{ideaId}
idea_id = #{ideaId} and sar_public_idea_all.wk_flag is null
</select>
<select id="getPublicAllIdea" resultType="com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAll">
SELECT sar_public_idea_all.id,reason,ts_user.INSTITUTION_NAME as deptName,old_text,new_text,dept_id,part_code,user_name,user_id,content,idea_id,cid
SELECT sar_public_idea_all.id,reason,ts_institution.name as deptName,old_text,new_text,dept_id,part_code,user_name,user_id,content,idea_id,cid,chapter_name,wk_flag
FROM sar_public_idea_all
left join ts_user on ts_user.USID=sar_public_idea_all.user_id
left join ts_institution on ts_institution.id=ts_user.INSTITUTION_ID
WHERE cid = #{cid}
<if test="null==type or ''==type">
and sar_public_idea_all.wk_flag is null
</if>
<if test="null!=type and type != ''">
and sar_public_idea_all.wk_flag =='1'
</if>
ORDER BY part_code ASC
</select>
</mapper>
@@ -61,7 +61,7 @@
c.*
FROM
(
SELECT b.*,sar_standards_info.STAND_TYPE as standType , ts_user.UNAME as dutyEngineerName , ts_user.INSTITUTION_NAME as responsibleUnit FROM (
SELECT b.*,sar_standards_info.STAND_TYPE as standType , ts_user.UNAME as dutyEngineerName , ts_institution.name as responsibleUnit FROM (
SELECT (@i:=@i+1) as rows,sar_stand_unqualified.* FROM
sar_stand_unqualified,(SELECT @i:=0)j
WHERE
@@ -84,6 +84,7 @@
)b
left join sar_standards_info on b.STAND_ID = sar_standards_info.id
left join ts_user on ts_user.USID = b.DUTY_ENGINEER
left join ts_institution on ts_institution.id=ts_user.INSTITUTION_ID
)c
ORDER BY c.STAND_ID, CONVERT(SUBSTRING(c.ITEMS_NUM,1,(SELECT LOCATE('.',CONCAT(c.ITEMS_NUM,'.')))),SIGNED) ,c.rows
</select>
@@ -901,9 +901,6 @@
<!-- 标准名称 -->
<if test="standName != null and standName != ''">
and stand_name like concat(concat('%',#{standName}),'%')
or STAND_NUMBER like concat(concat('%',#{standName}),'%')
or STAND_YEAR like concat(concat('%',#{standName}),'%')
or STAND_SORT like concat(concat('%',#{standName}),'%')
</if>
<if test="standEnName != null and standEnName != ''">
and stand_en_name like concat(concat('%',#{standEnName}),'%')
@@ -4,20 +4,22 @@
<select id="researchDatas" resultType="com.adc.da.slrs.wgDept.entity.WgDeptShow">
select wg_dept.* ,ts_user.UNAME as name ,wg_dept.PHONE as phone ,wg_dept.EMAIL as email,ts_user.INSTITUTION_ID as deptId
,ts_user.INSTITUTION_NAME as deptName ,ts_institution.name as unitName , ts_institution.id as unit
,t2.name as deptName ,ts_institution.name as unitName , ts_institution.id as unit
from wg_dept
left join ts_user on ts_user.ACCOUNT = wg_dept.dept_people_id
left join ts_institution ON ts_institution.id = (SELECT parent_id from ts_institution WHERE id = ts_user.INSTITUTION_ID)
left join ts_institution t2 on t2.id=ts_user.INSTITUTION_ID
where wg_dept.wg_id =#{data}
</select>
<select id="researchAllDatas" resultType="com.adc.da.slrs.wgDept.entity.WgDeptShow">
select wg_dept.* ,concat(ts_user.UNAME,concat('(',concat(ts_user.USID,')'))) as name ,wg_dept.PHONE as phone ,wg_dept.EMAIL as email,ts_user.INSTITUTION_ID as deptId
,ts_user.INSTITUTION_NAME as deptName ,ts_institution.name as unit , ts_institution.id as unitId
,t2.name as deptName ,ts_institution.name as unit , ts_institution.id as unitId
from wg_dept
left join ts_user on ts_user.ACCOUNT = wg_dept.dept_people_id
left join wg_work_group on wg_work_group.id = wg_dept.wg_id
left join ts_institution ON ts_institution.id = (SELECT parent_id from ts_institution WHERE id = ts_user.INSTITUTION_ID)
left join ts_institution t2 on t2.id=ts_user.INSTITUTION_ID
where wg_work_group.type = #{type}
</select>
@@ -59,9 +59,6 @@ public class AttFileEOController {
@Value("${file.path}")
private String filePath;//文件存储路径
@Value("${stand.edit.file.path}")
private String standEditFilePath;
// @Autowired
// private RoleEOService roleEOService;
//
@@ -79,82 +76,6 @@ public class AttFileEOController {
return Result.success(attFileEO);
}
@ApiOperation(value = "|onlyOffice接收文件")
@PostMapping("/recieveFile")
public void recieveFile(HttpServletRequest request, HttpServletResponse response, String fileNm,String standNo){
logger.info("**********进入onlyoffice接收文档接口************");
try {
PrintWriter writer = response.getWriter();
String body = "";
try {
Scanner scanner = new Scanner(request.getInputStream());
scanner.useDelimiter("\\A");
body = scanner.hasNext() ? scanner.next() : "";
scanner.close();
} catch (Exception ex) {
writer.write("get request.getInputStream error:" + ex.getMessage());
return;
}
if (body.isEmpty()) {
writer.write("empty request.getInputStream");
return;
}
net.sf.json.JSONObject jsonObj = net.sf.json.JSONObject.fromObject(body);
logger.info("**********onlyoffice接收文档接口获得结果body************" + body);
int status = (Integer) jsonObj.get("status");
int saved = 0;
if (status == 2 || status == 3)//MustSave, Corrupted
{
String downloadUri = (String) jsonObj.get("url");
try {
logger.info("**********onlyoffice接收文档接口获得downloadUri************" + downloadUri);
if (StringUtils.isNotEmpty(downloadUri)) {
File file = new File(standEditFilePath + standNo + "\\" + fileNm);
downloadNetFile(downloadUri, file);
}
} catch (Exception ex) {
saved = 1;
logger.info("**********onlyoffice接收文档接口异常************" + ex.getMessage());
logger.error(ex.getMessage(),ex);
}
} else if (status == 4) {
logger.info("**********onlyoffice接收文档接口开始修改文件状态状态4************");
logger.info("**********onlyoffice接收文档接口修改文件状态成功状态4************");
}
logger.info("onlyoffice编辑完成--------------");
writer.write("{\"error\":" + saved + "}");
} catch (IOException e) {
logger.info("**********onlyoffice接收文档接口异常************" + e.getMessage());
logger.error(e.getMessage(),e);
return;
}
}
public void downloadNetFile(String downloadUrl, File file) {
try {
FileOutputStream fileOutputStream = new FileOutputStream(file);
URL url = new URL(downloadUrl);
URLConnection connection = url.openConnection();
InputStream inputStream = connection.getInputStream();
int length = 0;
byte[] bytes = new byte[1024];
while ((length = inputStream.read(bytes)) != -1) {
fileOutputStream.write(bytes, 0, length);
}
fileOutputStream.close();
inputStream.close();
} catch (IOException e) {
logger.error("download error ! url :{}, exception:{}", downloadUrl, e);
}
}
@ApiOperation(value="|File|上传文件")
@PostMapping(value="/upload",consumes="multipart/*",headers="content-type=multipart/form-data" )
@CrossOrigin(origins = "*", maxAge = 3600)
@@ -754,9 +754,10 @@
<!-- 根据account获取未逻辑删除的UserEO -->
<select id="getUserEOByAccountNotDeleted" resultMap="BaseResultMap" parameterType="java.lang.String">
select usid, account, valid_flag, password, uname, ext_info,email,work_num,creation_time,modify_time,oper_user,user_source,disable_flag,unlock_flag,user_type
,INSTITUTION_NAME,INSTITUTION_ID,SEX,PHONE,ts_institution.name as upDeptName,ts_institution.id as upDeptId
,t2.name as INSTITUTION_NAME,INSTITUTION_ID,SEX,PHONE,ts_institution.name as upDeptName,ts_institution.id as upDeptId
from TS_USER
left join ts_institution ON ts_institution.id = (SELECT parent_id from ts_institution WHERE id = ts_user.INSTITUTION_ID)
left join ts_institution t2 on ts_user.INSTITUTION_ID=t2.id
where account = #{account} and VALID_FLAG != 1
</select>