|
@@ -1217,7 +1217,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
|
|
|
@Override
|
|
|
public IFormulaService calculate(TableElementConverter tec) {
|
|
|
- if (ExecuteType.INSPECTION.equals(tec.getExecuteType())) {
|
|
|
+ if (ExecuteType.INSPECTION.equals(tec.getExecuteType()) || ExecuteType.LOGINFO.equals(tec.getExecuteType())) {
|
|
|
/*天气*/
|
|
|
weather(tec);
|
|
|
}
|
|
@@ -1225,7 +1225,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
tec.formDataMap.putAll(baseMap);*/
|
|
|
/*通用计算*/
|
|
|
generalCalc(tec);
|
|
|
- if (ExecuteType.INSPECTION.equals(tec.getExecuteType())) {
|
|
|
+ if (ExecuteType.INSPECTION.equals(tec.getExecuteType())|| ExecuteType.LOGINFO.equals(tec.getExecuteType()) ) {
|
|
|
if (tec.isNew) {
|
|
|
//TODO
|
|
|
} else {
|
|
@@ -2510,8 +2510,10 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
/*ids 表流水号 projectId项目 nodeId工序节点的pkeyId ExecuteType执行模式 质检或者试验 首件*/
|
|
|
if (executeType.equals(ExecuteType.INSPECTION)) {
|
|
|
return listForContract(ids, projectId, nodeId);
|
|
|
- } else if (executeType.equals(ExecuteType.TESTING)) {
|
|
|
+ } else if (executeType.equals(ExecuteType.TESTING) ) {
|
|
|
return listForPrivate(ids, projectId, nodeId);
|
|
|
+ } else if (executeType.equals(ExecuteType.LOGINFO) ) {
|
|
|
+ return listForPrivateByLog(ids, projectId, nodeId);
|
|
|
}
|
|
|
return Collections.emptyList();
|
|
|
}
|
|
@@ -5319,6 +5321,24 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
return Collections.emptyList();
|
|
|
}
|
|
|
|
|
|
+ private List<KeyMapper> listForPrivateByLog(List<Long> ids, String projectId, String nodeId) {
|
|
|
+ /**/
|
|
|
+ List<Map<String, Object>> listMap = listMap(ids, ExecuteType.TESTING);
|
|
|
+ List<KeyMapper> list = listMap.stream().map(m -> BeanUtil.toBean(m, KeyMapper.class)).collect(Collectors.toList());
|
|
|
+ if (Func.isNotEmpty(listMap)) {
|
|
|
+ WbsTreePrivate wtp = this.wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, nodeId));
|
|
|
+ List<Map<String, Object>> efMap = this.jdbcTemplate.queryForList("select element_id elementId,formula_id formulaId,scope " +
|
|
|
+ "from m_element_formula_mapping " +
|
|
|
+ "where element_id in(" + list.stream().map(KeyMapper::getFieldId).distinct().map(Func::toStr).collect(Collectors.joining(",")) + ") " +
|
|
|
+ "and is_deleted=0 " + " and ( scope<2 or (scope =10 and project_id = " + projectId + ") or (scope=20 and project_id =" + projectId + " and node_id=" + wtp.getId() + "))");
|
|
|
+ setFormula(list, efMap);
|
|
|
+ if (list.size() > 0) {
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+
|
|
|
/*获取计量公式,计量表是被动加载的,也不存在表单,所以需要根据计量类型获取*/
|
|
|
private void listForMeter(List<FormData> curFormDatas, String projectId, String parentId) {
|
|
|
List<WbsTreePrivate> wtpList = this.wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getParentId, parentId));
|