提交 9cb3fade authored 作者: liuluyu's avatar liuluyu

Merge branch 'master' of http://47.97.51.208/root/zrch-risk-39

......@@ -79,6 +79,7 @@
"swagger-ui-dist": "^5.29.3",
"tinymce": "6.6.2",
"vditor": "^3.11.2",
"vkbeautify": "^0.99.3",
"vue": "^3.5.22",
"vue-cropper": "^0.6.5",
"vue-cropperjs": "^5.0.0",
......
......@@ -176,6 +176,9 @@ importers:
vditor:
specifier: ^3.11.2
version: 3.11.2
vkbeautify:
specifier: ^0.99.3
version: 0.99.3
vue:
specifier: ^3.5.22
version: 3.5.27(typescript@5.9.3)
......@@ -7619,6 +7622,9 @@ packages:
yaml:
optional: true
vkbeautify@0.99.3:
resolution: {integrity: sha512-2ozZEFfmVvQcHWoHLNuiKlUfDKlhh4KGsy54U0UrlLMR1SO+XKAIDqBxtBwHgNrekurlJwE8A9K6L49T78ZQ9Q==}
vue-component-type-helpers@2.2.12:
resolution: {integrity: sha512-YbGqHZ5/eW4SnkPNR44mKVc6ZKQoRs/Rux1sxC6rdwXb4qpbOSYfDr9DsTHolOTGmIKgM9j141mZbBeg05R1pw==}
......@@ -15963,6 +15969,8 @@ snapshots:
terser: 5.46.0
tsx: 4.21.0
vkbeautify@0.99.3: {}
vue-component-type-helpers@2.2.12: {}
vue-cropper@0.6.5: {}
......
......@@ -51,11 +51,11 @@ const gridOptions = reactive<VxeGridProps<RowVO>>({
{ field: 'itemName', title: '字段名称',width: "15%"},
{ field: 'values', title: '最近5年填报数据',width: "75%",
children: [
{ field: 'value1', title: '第一次',width: "15%"},
{ field: 'value2', title: '第二次',width: "15%"},
{ field: 'value3', title: '第三次',width: "15%"},
{ field: 'value4', title: '第四次',width: "15%"},
{ field: 'value5', title: '第五次',width: "15%"},
{ field: 'value0', title: '第一次',width: "15%"},
{ field: 'value1', title: '第二次',width: "15%"},
{ field: 'value2', title: '第三次',width: "15%"},
{ field: 'value3', title: '第四次',width: "15%"},
{ field: 'value4', title: '第五次',width: "15%"},
],
},
{ field: 'opt', title: '操作' ,width: "10%"},
......@@ -67,19 +67,24 @@ async function onDrawerShow(tplid: number) {
const retData = await findFillHistoryForCheck({
tplid: tplid
});
// 调试:查看数据结构
console.log('原始数据:', retData);
// 处理 values 数据
const processedData = retData.map(item => {
const processedData = retData.map((item, itemIndex) => {
const processedItem = {...item};
// 将 values 数组中的 value 属性提取出来
if (Array.isArray(processedItem.values)) {
processedItem.values.forEach((valueItem, index) => {
// 将每个 valueItem 的 value 属性设置到单独的字段中
processedItem[`value${index}`] = valueItem.value;
// 注意:index从0开始,但字段名应该从1开始
processedItem[`value${index + 1}`] = valueItem.value;
});
}
return processedItem;
});
console.log('处理后的数据:', processedData);
gridOptions.data = processedData;
return false;
}
......
......@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.stm.baosong.entity.BaosongDataValid;
import org.jeecg.modules.stm.baosong.entity.BaosongTaskAlloc;
import org.jeecg.modules.stm.baosong.entity.BaosongTaskRecord;
import org.jeecg.modules.stm.baosong.entity.BaosongTplItem;
import org.jeecg.modules.stm.baosong.service.IBaosongDataValidService;
......@@ -224,4 +225,14 @@ public class BaosongDataValidController extends JeecgController<BaosongDataValid
return Result.OK(retMap);
}
@GetMapping(value = "/getTblvalidFormula")
public Result<List<BaosongDataValid>> getTblvalidFormula(BaosongDataValid dataValid, HttpServletRequest req) {
List<BaosongDataValid> listFormula = baosongDataValidService.lambdaQuery()
.eq(BaosongDataValid::getTplid, dataValid.getTplid())
.list();
return Result.OK(listFormula);
}
}
......@@ -268,4 +268,31 @@ public class BaosongTaskAllocController extends JeecgController<BaosongTaskAlloc
list.addAll(0,rootItemList);
}
}
@GetMapping(value = "/findUserRightForTplItem")
public Result<Set<String>> findUserRightForTplItem(BaosongTaskAlloc taskAlloc,HttpServletRequest req) {
Set<String> retCodeSet = new HashSet<>();
try {
String userId = UserUtil.getUserId();
List<BaosongTaskAlloc> allocTplList = baosongTaskAllocService.lambdaQuery()
.eq(BaosongTaskAlloc::getFillUser, userId)
.eq(BaosongTaskAlloc::getTaskid,taskAlloc.getTaskid())
.eq(BaosongTaskAlloc::getTplid,taskAlloc.getTplid())
.list();
Set<Integer> tplIdSet = new HashSet<>();
for (BaosongTaskAlloc alloc : allocTplList) {
tplIdSet.add(alloc.getItemid());
}
List<BaosongTplItem> itemList = baosongTplItemService.lambdaQuery()
.in(BaosongTplItem::getId,tplIdSet)
.list();
for (BaosongTplItem item : itemList) {
retCodeSet.add(item.getPcode()+"_"+item.getCode());
}
return Result.OK(retCodeSet);
} catch (Exception e) {
log.error("查询用户模板权限失败", e);
return Result.error("查询失败,请稍后重试");
}
}
}
package org.jeecg.modules.stm.baosong.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import com.aliyun.oss.ServiceException;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
......@@ -41,6 +41,7 @@ public class BaosongTaskRecordController extends JeecgController<BaosongTaskReco
@Autowired
private IBaosongTaskRecordService baosongTaskRecordService;
/**
* 分页列表查询
*
......@@ -261,4 +262,72 @@ public class BaosongTaskRecordController extends JeecgController<BaosongTaskReco
}
@GetMapping(value = "/findFillHistoryForCheck")
public Result<List<Map<String, Object>>> findFillHistoryForCheckTraditional(BaosongQuery baosongQuery, HttpServletRequest req) {
// 参数校验
if (baosongQuery == null) {
return Result.error("查询参数不能为空");
}
List<Map<String, Object>> retList = new ArrayList<>();
try {
List<BaosongQuery> list = baosongTaskRecordService.findTaskRecords(baosongQuery);
if (CollectionUtils.isEmpty(list)) {
return Result.OK(Collections.emptyList());
}
// 使用 LinkedHashMap 保持插入顺序
Map<Integer, List<Map<String, Object>>> tmpMap = new LinkedHashMap<>();
Map<Integer, String> itemNameMap = new HashMap<>();
Map<Integer,String> taskNameMap = new HashMap<>();
for (BaosongQuery taskRecord : list) {
Integer itemId = taskRecord.getItemid();
// 获取或创建列表
List<Map<String, Object>> cList = tmpMap.computeIfAbsent(itemId,
k -> new ArrayList<>());
// 构建值Map
Map<String, Object> tmpVal = new HashMap<>(3);
tmpVal.put("value", taskRecord.getContent());
tmpVal.put("taskid", taskRecord.getTaskid());
tmpVal.put("taskName", taskRecord.getTaskName());
cList.add(tmpVal);
// 存储 itemName(如果已存在则跳过)
itemNameMap.putIfAbsent(itemId, taskRecord.getTplItemName());
if(taskNameMap.get(taskRecord.getTaskid())!=null){
taskNameMap.put(taskRecord.getTaskid(),taskRecord.getTaskName());
}
}
// 构建结果
for (Map.Entry<Integer, List<Map<String, Object>>> entry : tmpMap.entrySet()) {
Integer itemId = entry.getKey();
Map<String, Object> resultItem = new HashMap<>(3);
resultItem.put("itemId", itemId);
resultItem.put("itemName", itemNameMap.get(itemId));
resultItem.put("values", entry.getValue());
retList.add(resultItem);
}
// 可选:按 itemId 排序
retList.sort(Comparator.comparing(m -> (Integer) m.get("itemId")));
} catch (ServiceException e) {
log.error("查询填报历史记录失败,查询参数:{}", baosongQuery, e);
return Result.error("查询失败:" + e.getMessage());
} catch (Exception e) {
log.error("系统异常,查询填报历史记录失败", e);
return Result.error("系统异常,请稍后重试");
}
return Result.OK(retList);
}
}
......@@ -290,13 +290,14 @@ public class BaosongTplController extends JeecgController<BaosongTpl, IBaosongTp
}
@GetMapping(value = "/findUserRightForTpl")
public Result<List<BaosongTpl>> findUserRightForTpl(HttpServletRequest req) {
public Result<List<BaosongTpl>> findUserRightForTpl(Integer taskId,HttpServletRequest req) {
List<BaosongTpl> retTplList = new ArrayList<>();
try {
String userId = UserUtil.getUserId();
List<BaosongTaskAlloc> allocTplList = baosongTaskAllocService.lambdaQuery()
.eq(BaosongTaskAlloc::getFillUser, userId)
.eq(BaosongTaskAlloc::getTaskid,taskId)
.list();
Set<Integer> tplIdSet = new HashSet<>();
for (BaosongTaskAlloc alloc : allocTplList) {
......@@ -319,4 +320,6 @@ public class BaosongTplController extends JeecgController<BaosongTpl, IBaosongTp
return Result.error("查询失败,请稍后重试");
}
}
}
......@@ -34,30 +34,24 @@ public class BaosongDataValid implements Serializable {
/**id*/
@TableId(type = IdType.AUTO)
private java.lang.Integer id;
/**模板ID*/
@Excel(name = "模板", width = 15)
private Integer tplid;
/**公式编号*/
@Excel(name = "公式编号", width = 15)
private java.lang.String code;
/**名称*/
@Excel(name = "名称", width = 15)
private java.lang.String name;
/**验证公式*/
@Excel(name = "验证公式", width = 15)
private java.lang.String formula;
/**类型*/
@Excel(name = "类型", width = 15)
private java.lang.Integer ctp;
/**分类
* 1=表内校验
......@@ -66,32 +60,24 @@ public class BaosongDataValid implements Serializable {
* 4=不同年份校验
* */
@Excel(name = "分类", width = 15)
private java.lang.Integer tp;
/**预期值*/
@Excel(name = "预期值", width = 15)
private java.lang.String expectedValue;
/**更新时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private java.util.Date updateTime;
/**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private java.util.Date createTime;
/**参数*/
@Excel(name = "参数", width = 15)
private java.lang.String params;
/**说明*/
@Excel(name = "说明", width = 15)
private java.lang.String des;
@Excel(name = "itemid", width = 15)
private java.lang.Integer tplItemid;
}
......@@ -151,9 +151,13 @@ spring:
slow-sql-millis: 5000
datasource:
master:
url: jdbc:mysql://47.98.203.68:3306/zrch_stm_db_3.9?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
# url: jdbc:mysql://47.98.203.68:3306/zrch_stm_db_3.9?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
# 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
username: root
password: ZhongRunChangHong/123
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
# # shardingjdbc数据源
# sharding-db:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论