|
@@ -46,6 +46,8 @@ import org.springblade.manager.entity.*;
|
|
|
import org.springblade.manager.mapper.WbsTreePrivateMapper;
|
|
|
import org.springblade.manager.service.*;
|
|
|
import org.springblade.manager.unit.FileUtils;
|
|
|
+import org.springblade.manager.unit.RegularExpressionUtil;
|
|
|
+import org.springblade.manager.unit.WbsElementUtil;
|
|
|
import org.springblade.manager.vo.*;
|
|
|
import org.springblade.manager.wrapper.ExcelTabWrapper;
|
|
|
import org.springblade.resource.feign.CommonFileClient;
|
|
@@ -483,19 +485,25 @@ public class ExcelTabController extends BladeController {
|
|
|
double maxScore = 0.48;
|
|
|
String lastName = "警告";
|
|
|
String attrInfo = "key" + "__" + i + "_" + j;
|
|
|
- ;
|
|
|
+ String filedType = "";
|
|
|
|
|
|
for (WbsFormElement elementInfo : elementList) {
|
|
|
String ysName = elementInfo.getEName().replaceAll("[^\u4E00-\u9FA5_]", "");
|
|
|
if (titleName.equals(ysName)) {
|
|
|
lastName = elementInfo.getEName();
|
|
|
attrInfo = elementInfo.getEKey() + "__" + i + "_" + j;
|
|
|
+
|
|
|
+ filedType = WbsElementUtil.getInitTableFiledType(elementInfo.getEType());
|
|
|
+
|
|
|
maxScore = 100;
|
|
|
is_true = true;
|
|
|
break;
|
|
|
} else {
|
|
|
if (MathUtil.sim(titleName, ysName) > maxScore) {
|
|
|
attrInfo = elementInfo.getEKey() + "__" + i + "_" + j;
|
|
|
+
|
|
|
+ filedType = WbsElementUtil.getInitTableFiledType(elementInfo.getEType());
|
|
|
+
|
|
|
lastName = ysName;
|
|
|
maxScore = MathUtil.sim(titleName, ysName);
|
|
|
is_true = true;
|
|
@@ -503,15 +511,19 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
String oncklickText = "'" + lastName + "'," + i + "," + j;
|
|
|
- if (is_true) {
|
|
|
- element.children().get(0).attr("placeholder", lastName).attr("@focus", "getInformation(" + oncklickText + ")")
|
|
|
- .attr("weighing", maxScore + "").attr("id", attrInfo).attr("keyName", attrInfo).attr("v-model", "formData." + attrInfo);
|
|
|
|
|
|
- //todo 正则表达式返回字段类型校验
|
|
|
+ //字段正则表达式校验
|
|
|
+ String regularExpression = "'" + RegularExpressionUtil.getRegularExpression(filedType) + "'," + "字段类型:" + (StringUtils.isNotEmpty(filedType) ? WbsElementUtil.getTypeName(filedType) : null) + "," + i + "," + j;
|
|
|
|
|
|
+ if (is_true) {
|
|
|
+ element.children().get(0).attr("placeholder", lastName).attr("@focus", "getInformation(" + oncklickText + ")")
|
|
|
+ .attr("weighing", maxScore + "").attr("id", attrInfo).attr("keyName", attrInfo)
|
|
|
+ .attr("@blur", "getRegularExpression(" + regularExpression + ")")
|
|
|
+ .attr("v-model", "formData." + attrInfo);
|
|
|
} else {
|
|
|
element.children().get(0).attr("placeholder", lastName).attr("@focus", "getInformation(" + oncklickText + ")")
|
|
|
- .attr("weighing", maxScore + "").attr("id", attrInfo).attr("keyName", attrInfo);
|
|
|
+ .attr("weighing", maxScore + "").attr("id", attrInfo).attr("keyName", attrInfo)
|
|
|
+ .attr("@blur", "getRegularExpression(" + regularExpression + ")");
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1767,7 +1779,7 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
|
|
|
//获取数据
|
|
|
- List<Map<String, Object>> businessDataMapList = this.getTheLogBusinessData(theLogId, nodePrimaryKeyId, recordTime).getData();
|
|
|
+ List<Map<String, Object>> businessDataMapList = (List<Map<String, Object>>)this.getTheLogBusinessData(theLogId, nodePrimaryKeyId, recordTime).getData();
|
|
|
//PDF路径
|
|
|
List<String> pdfUrls = new ArrayList<>();
|
|
|
|
|
@@ -1873,7 +1885,6 @@ public class ExcelTabController extends BladeController {
|
|
|
int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
|
|
|
|
|
|
final CellRange cellRange = sheet.getCellRange(y1, x1);
|
|
|
-
|
|
|
cellRange.setText(e.getId() + "");
|
|
|
cellRange.getCellStyle().getFont().setColor(Color.white);
|
|
|
|
|
@@ -1921,18 +1932,11 @@ public class ExcelTabController extends BladeController {
|
|
|
return R.data(null);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 获取当前用户当前日期的填报记录
|
|
|
- */
|
|
|
@GetMapping("/get-the-log-business-data")
|
|
|
@ApiOperationSupport(order = 26)
|
|
|
@ApiOperation(value = "获取当前用户当前日期的填报记录")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "theLogId", value = "日志记录的id,可能为空"),
|
|
|
- @ApiImplicitParam(name = "nodePrimaryKeyId", value = "当前操作的日志类型ID,即左侧列表的节点primaryKeyId"),
|
|
|
- @ApiImplicitParam(name = "recordTime", value = "当前选择的填写日期,即右侧日期控件所选日期,格式为 yyyy-MM-dd")
|
|
|
- })
|
|
|
- public R<List<Map<String, Object>>> getTheLogBusinessData(String theLogId, String nodePrimaryKeyId, String recordTime) {
|
|
|
+ @ApiImplicitParam(name = "theLogId", value = "日志ID", required = true)
|
|
|
+ public R getTheLogBusinessData(String theLogId, String nodePrimaryKeyId, String recordTime) {
|
|
|
List<Map<String, Object>> resultMapList = new ArrayList<>();
|
|
|
//获取对应的记录
|
|
|
JSONObject theLogJson;
|