提交 28f56f11 authored 作者: kxjia's avatar kxjia

提交新文件

上级 39357ace
......@@ -164,6 +164,16 @@ public class Result<T> implements Serializable {
return this;
}
public static<T> Result<T> ok(T data,String strMsg) {
Result<T> r = new Result<T>();
r.setSuccess(true);
r.setMessage(strMsg);
r.setCode(CommonConstant.SC_OK_200);
r.setResult(data);
return r;
}
/**
* 无权限访问返回结果
*/
......
......@@ -43,7 +43,7 @@ public class SsrfFileTypeFilter {
FILE_TYPE_WHITE_LIST.add("docx");
FILE_TYPE_WHITE_LIST.add("pdf");
FILE_TYPE_WHITE_LIST.add("csv");
// FILE_TYPE_WHITE_LIST.add("xml");
FILE_TYPE_WHITE_LIST.add("xml");
FILE_TYPE_WHITE_LIST.add("md");
//音视频文件
......
package org.jeecg.modules.demo.cloud.controller;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.cloud.service.JcloudDemoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......
......@@ -17,6 +17,7 @@ import javax.xml.transform.stream.StreamResult;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.stm.baosong.entity.TaskRecordVo;
import org.jeecg.modules.stm.baosong.service.IBaosongTaskAllocService;
import org.jeecg.modules.stm.baosong.service.IBaosongTaskReviewService;
import org.jeecg.modules.stm.baosong.service.IBaosongTaskService;
......@@ -191,42 +192,11 @@ public class BaosongTaskReviewController extends JeecgController<BaosongTaskRevi
return super.importExcel(request, response, BaosongTaskReview.class);
}
@RequestMapping(value = "/downLoadTaskXml2")
public Result<String> downLoadTaskXml2(HttpServletRequest request, BaosongTaskReview taskReview) {
Integer tplId = taskReview.getTplid();
List<Map<String,Object>> list = baosongTaskReviewService.queryTaskRecordForXml(taskReview);
BaosongTpl baosongTpl = baosongTplService.getById(tplId);
try {
String rootPath = uploadpath;
String newFileName = getReportFilePath(taskReview);
String templateFileName = getTempleFilePath(taskReview.getTplid());
String templetPath = rootPath+ templateFileName;
String reportPath = rootPath + newFileName;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
File xmlFile = new File(templetPath);
Document document = builder.parse(xmlFile);
document.getDocumentElement().normalize();
for(Map<String,Object> item:list) {
String code = item.get("code").toString();
String value = item.get("content").toString();
setNodeValue(document, code, value);
}
saveDocumentToFile(document, reportPath);
return Result.OK(newFileName);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
@RequestMapping(value = "/downLoadTaskXml")
public Result<String> downLoadTaskXml(HttpServletRequest request, BaosongTaskReview taskReview) {
Integer tplId = taskReview.getTplid();
Integer taskId = taskReview.getTaskid();
List<Map<String,Object>> list = baosongTaskReviewService.queryTaskRecordForXml(taskReview);
List<TaskRecordVo> list = baosongTaskReviewService.queryTaskRecordForXml(taskReview);
BaosongTpl baosongTpl = baosongTplService.getById(tplId);
BaosongTask baosongTask = baosongTaskService.getById(taskId);
try {
......
package org.jeecg.modules.stm.baosong.entity;
import lombok.Data;
import java.io.Serializable;
/**
* @Description: 填报记录
* @Author: jeecg-boot
* @Date: 2024-12-17
* @Version: V1.0
*/
@Data
public class TaskRecordVo implements Serializable {
private static final long serialVersionUID = 1L;
private java.lang.Integer tplid;
private java.lang.Integer taskid;
private java.lang.Integer itemid;
private java.lang.Integer rind;
private java.lang.String content;
private java.lang.String pcode;
private java.lang.String code;
private java.lang.String title;
}
......@@ -6,6 +6,7 @@ import java.util.Map;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.stm.baosong.entity.BaosongTaskReview;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.stm.baosong.entity.TaskRecordVo;
/**
* @Description: 内容检查
......@@ -15,5 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface BaosongTaskReviewMapper extends BaseMapper<BaosongTaskReview> {
List<Map<String,Object>> queryTaskReview(@Param("query") BaosongTaskReview taskReview);
List<Map<String,Object>> queryTaskRecordForXml(@Param("query") BaosongTaskReview taskReview);
List<TaskRecordVo> queryTaskRecordForXml(@Param("query") BaosongTaskReview taskReview);
}
......@@ -2,6 +2,7 @@ package org.jeecg.modules.stm.baosong.service;
import org.jeecg.modules.stm.baosong.entity.BaosongTaskReview;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.stm.baosong.entity.TaskRecordVo;
import java.util.List;
import java.util.Map;
......@@ -14,5 +15,5 @@ import java.util.Map;
*/
public interface IBaosongTaskReviewService extends IService<BaosongTaskReview> {
List<Map<String,Object>> queryTaskReview(BaosongTaskReview taskReview);
List<Map<String,Object>> queryTaskRecordForXml(BaosongTaskReview taskReview);
List<TaskRecordVo> queryTaskRecordForXml(BaosongTaskReview taskReview);
}
package org.jeecg.modules.stm.baosong.service.impl;
import org.jeecg.modules.stm.baosong.entity.BaosongTaskReview;
import org.jeecg.modules.stm.baosong.entity.TaskRecordVo;
import org.jeecg.modules.stm.baosong.mapper.BaosongTaskReviewMapper;
import org.jeecg.modules.stm.baosong.service.IBaosongTaskReviewService;
import org.springframework.stereotype.Service;
......@@ -25,7 +26,7 @@ public class BaosongTaskReviewServiceImpl extends ServiceImpl<BaosongTaskReviewM
}
@Override
public List<Map<String,Object>> queryTaskRecordForXml(BaosongTaskReview taskReview){
public List<TaskRecordVo> queryTaskRecordForXml(BaosongTaskReview taskReview){
return this.baseMapper.queryTaskRecordForXml(taskReview);
}
}
......@@ -16,16 +16,8 @@
ORDER BY A.id, B.code
</select>
<select id="queryTaskRecordForXml" resultType="java.util.Map">
SELECT
A.content,
A.taskid,
A.itemid,
A.rind,
B.tplid,
B.code,
B.pcode,
B.title
<select id="queryTaskRecordForXml" resultType="org.jeecg.modules.stm.baosong.entity.TaskRecordVo">
SELECT A.content,A.taskid,A.itemid,A.rind, B.tplid,B.code,B.pcode,B.title
FROM baosong_task_record A
RIGHT JOIN baosong_tpl_item B ON A.itemid = B.id
<where>
......@@ -36,7 +28,8 @@
AND B.tplid = #{query.tplid}
</if>
</where>
ORDER BY B.id, B.pcode, B.code
ORDER BY B.id,B.pcode,B.code
</select>
</mapper>
\ No newline at end of file
......@@ -155,7 +155,7 @@ spring:
# username: root
# password: ZhongRunChangHong/123
url: jdbc:mysql://localhost:3306/zrch_stm_db_3.9?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
url: jdbc:mysql://localhost:3306/zrch_stm_db_3.9_new?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论