Commit 64d2eaf7 by 高晓磊

文件共享元数据描述补充,boolean类型判断可以为0 1和true false

parent d9b06fdd
......@@ -93,7 +93,9 @@ public class SandMiningAreaServiceImpl implements SandMiningAreaService {
public void deleteById(UUID id) {
sandMiningAreaDao.deleteById(id);
WarnSetting warnSetting = warningSettingService.getWarnSetting(SandMiningAreaConstant.SAND_MINING_AREA_BILL_TYPE, id, SandMiningAreaConstant.SAND_MINING_AREA_WARN_TARGET);
warningSettingService.deleteWarnSetting(warnSetting.getSettingId());
if(warnSetting!=null&&warnSetting.getSettingId()!=null){
warningSettingService.deleteWarnSetting(warnSetting.getSettingId());
}
}
@Override
......
......@@ -56,11 +56,11 @@ public class LevelValues {
this.level = level;
}
public List<ValueFormat> getParamValueFormatList() {
public List<ValueFormat> getValueFormatList() {
return valueFormatList;
}
public void setParamValueFormatList(List<ValueFormat> valueFormatList) {
public void setValueFormatList(List<ValueFormat> valueFormatList) {
this.valueFormatList = valueFormatList;
}
......
......@@ -18,6 +18,7 @@ import com.xyst.dinas.fileshared.dao.FileSharedSettingDao;
import com.xyst.dinas.fileshared.entity.*;
import com.xyst.dinas.fileshared.service.FileSharedSettingService;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
......@@ -111,7 +112,7 @@ public class FileSharedSettingServiceImpl implements FileSharedSettingService {
List<QueryConditionObj> queryConditionObjs = JsonUtil.jsonToList(conditions, QueryConditionObj.class);
Map<Integer, Object> valueMap = new HashMap<>();
levelValuesReqStream.forEach(a-> valueMap.put(a.getLevel(),a.getValue()));
levelValuesReqStream.forEach(a -> valueMap.put(a.getLevel(), a.getValue()));
ArrayList<LevelValues> levelValues1 = new ArrayList<>();
// a.setValue(valueMap.get(a.getLevel()));
folderLevelValueSettingDateBase.stream().filter(a -> valueMap.containsKey(a.getLevel())).forEach(a -> {
......@@ -198,8 +199,19 @@ public class FileSharedSettingServiceImpl implements FileSharedSettingService {
String type = nowLevelValue.getType();
Integer nowLevel = nowLevelValue.getLevel();
String format = nowLevelValue.getFormat();
Stream<RowData> masterFiled = rowData.stream().filter(rowData1 -> !CollectionUtils.isEmpty(attachmentService.findByBelongId(UUID.fromString(rowData1.get("id").toString()))));
//判断数据中该字段的值为null的情况
Map<Boolean, List<RowData>> collect1 = masterFiled.collect(Collectors.groupingBy(rowData1 -> null == rowData1.get(nowLevelValue.getName())));
if (collect1.containsKey(true)) {
folderInfos.add(new FolderInfo(settingId, nowLevel, "isNull", "其它", type, nowLevel - 1, nextLevel));
}
if (!collect1.containsKey(false)) {
return folderInfos;
}
masterFiled = collect1.get(false).stream();
//同时排除值为null的可能
switch (type) {
default:
case "string": {
......@@ -210,33 +222,47 @@ public class FileSharedSettingServiceImpl implements FileSharedSettingService {
}
case "boolean": {
Map<String, List<RowData>> collect = masterFiled.collect(Collectors.groupingBy(rowData1 -> rowData1.get(nowLevelValue.getName()).toString()));
List<ValueFormat> paramValueFormatList = nowLevelValue.getParamValueFormatList();
List<ValueFormat> paramValueFormatList = nowLevelValue.getValueFormatList();
Set<String> strings = collect.keySet();
for (String string : strings) {
boolean isNumber = NumberUtils.isNumber(string);
boolean b = isNumber ? 1 == Integer.parseInt(string) : Boolean.parseBoolean(string);
boolean isAdd = false;
for (ValueFormat valueFormat : paramValueFormatList) {
String s = valueFormat.getValue().toString();
if (string.equals(s)) {
folderInfos.add(new FolderInfo(settingId, nowLevel, Boolean.valueOf(s), s, type, nowLevel - 1, nextLevel));
isNumber = NumberUtils.isNumber(s);
boolean sb = isNumber ? 1 == Integer.parseInt(s) : Boolean.parseBoolean(s);
if (sb == b) {
folderInfos.add(new FolderInfo(settingId, nowLevel, sb, valueFormat.getFormat(), type, nowLevel - 1, nextLevel));
isAdd = true;
}
}
folderInfos.add(new FolderInfo(settingId, nowLevel, string, string, type, nowLevel - 1, nextLevel));
if (!isAdd) {
folderInfos.add(new FolderInfo(settingId, nowLevel, string, string, type, nowLevel - 1, nextLevel));
}
}
break;
}
case "int": {
Map<Integer, List<RowData>> collect = masterFiled.collect(Collectors.groupingBy(rowData1 -> Integer.parseInt(rowData1.get(nowLevelValue.getName()).toString())));
List<ValueFormat> paramValueFormatList = nowLevelValue.getParamValueFormatList();
List<ValueFormat> paramValueFormatList = nowLevelValue.getValueFormatList();
Set<Integer> strings = collect.keySet();
for (Integer integer : strings) {
boolean isAdd = false;
for (ValueFormat valueFormat : paramValueFormatList) {
String s = valueFormat.getValue().toString();
if (integer.equals(Integer.parseInt(s))) {
folderInfos.add(new FolderInfo(settingId, nowLevel, Boolean.valueOf(s), s, type, nowLevel - 1, nextLevel));
folderInfos.add(new FolderInfo(settingId, nowLevel, s, valueFormat.getFormat(), type, nowLevel - 1, nextLevel));
isAdd = true;
}
}
folderInfos.add(new FolderInfo(settingId, nowLevel, integer, integer + "", type, nowLevel - 1, nextLevel));
break;
if (!isAdd) {
folderInfos.add(new FolderInfo(settingId, nowLevel, integer, integer + "", type, nowLevel - 1, nextLevel));
}
}
break;
}
case "datetime": {
SimpleDateFormat simpleDateFormat;
......@@ -264,17 +290,27 @@ public class FileSharedSettingServiceImpl implements FileSharedSettingService {
}
private List<QueryConditionObj> getFolderCondition(LevelValues levelValues) throws ParseException {
if (null == levelValues.getValue()) {
Object levelValue = levelValues.getValue();
if (null == levelValue) {
return new ArrayList<>();
}
ArrayList<QueryConditionObj> queryConditionObjs = new ArrayList<>();
QueryConditionObj queryConditionObj = new QueryConditionObj();
queryConditionObj.setName(levelValues.getName());
String type = levelValues.getType();
if ("isNull".equals(levelValue.toString())) {
queryConditionObj.setRelation(3);
ArrayList<Object> values = new ArrayList<>(1);
values.add(levelValue);
queryConditionObj.setValues(values);
queryConditionObjs.add(queryConditionObj);
return queryConditionObjs;
}
switch (type) {
case "datetime": {
//日期类处理,仅允许出现 ["YYYY年MM月dd日","yyyy年MM月","yyyy年"] 3种格式
String value = levelValues.getValue().toString();
String value = levelValue.toString();
SimpleDateFormat simpleDateFormat;
Date startDateTime;
Date endDateTime;
......@@ -308,22 +344,18 @@ public class FileSharedSettingServiceImpl implements FileSharedSettingService {
queryConditionObjs.add(queryConditionObj1);
}
break;
case "boolean":
// levelValue = Boolean.valueOf(levelValue.toString());
boolean isNumber = NumberUtils.isNumber(levelValue.toString());
levelValue= isNumber ? 1 == Integer.parseInt(levelValue.toString()) : Boolean.parseBoolean(levelValue.toString());
case "uuid":
case "int":
case "boolean": {
case "string":
default:
queryConditionObj.setRelation(3);
ArrayList<Object> values = new ArrayList<>(1);
values.add(levelValues.getValue());
values.add(levelValue);
queryConditionObj.setValues(values);
}
break;
case "string": {
queryConditionObj.setRelation(1);
ArrayList<Object> values = new ArrayList<>(1);
values.add(levelValues.getValue());
queryConditionObj.setValues(values);
}
default:
break;
}
queryConditionObjs.add(queryConditionObj);
......
......@@ -5,7 +5,7 @@
<name>ArtificialRecharge</name>
<title>人工充值</title>
<tags></tags>
<description></description>
<description>人工充值</description>
</header>
<content>
<customQuery id='1b47a7c5-b121-4a57-99d6-e4553814e411'>
......
......@@ -5,7 +5,7 @@
<name>ExpenseAdjust</name>
<title>费用调整</title>
<tags></tags>
<description></description>
<description>费用调整</description>
</header>
<content>
<customQuery id='a21f0532-a280-465f-9ef6-95ebb4f44a87'>
......
......@@ -5,7 +5,7 @@
<name>FinanceRefund</name>
<title>财务退款</title>
<tags></tags>
<description></description>
<description>财务退款</description>
</header>
<content>
<customQuery id='bb49e1ae-2930-4b82-ab98-2cd6f8b06953'>
......
<model>
<header>
<type>inz.query.Query</type>
<package>com.xyst.dinas.finance.query</package>
<package>com.xyst.dinas.fileshared.query</package>
<name>BankRechargeDetail</name>
<title>银行充值明细</title>
<tags></tags>
<description></description>
<description>银行充值明细</description>
</header>
<content>
<customQuery id='0606f47c-5f64-433a-b54a-3e9ea8b04382'>
......
......@@ -5,12 +5,11 @@
<name>SalesPlan</name>
<title>销售计划</title>
<tags></tags>
<description></description>
<description>销售计划</description>
</header>
<content>
<customQuery id='72f25343-d3b1-46e6-ab05-e1dd5b8eec63'>
<kclass>com.xyst.dinas.sales.datamodel.SalesPlan</kclass>
<dataProcessor>com.xyst.dinas.sales.processor.SalesPlanProcessor</dataProcessor>
<authorityItem></authorityItem>
<innerScene title='全部'>
<id>8658d8f9-ca38-469d-af98-555a334566e2</id>
......
<model>
<header>
<type>inz.query.Query</type>
<package>com.xyst.dinas.sales.query</package>
<package>com.xyst.dinas.fileshared.query</package>
<name>SalesPlanTemp</name>
<title>临时销售计划</title>
<tags></tags>
<description></description>
<description>临时销售计划</description>
</header>
<content>
<customQuery id='a397201e-5821-4a80-ac35-d0ceb48a3517'>
......
......@@ -5,7 +5,7 @@
<name>VehicleDispatch</name>
<title>派单</title>
<tags></tags>
<description></description>
<description>派单</description>
</header>
<content>
<customQuery id='07818d15-d8db-42f9-8951-acb61c7a322e'>
......
<model>
<header>
<type>inz.query.Query</type>
<package>com.xyst.dinas.safe.query</package>
<package>com.xyst.dinas.fileshared.query</package>
<name>VehicleViolation</name>
<title>车辆违规记录</title>
<tags/>
......
......@@ -4,6 +4,7 @@
<id>1b47a7c5-b121-4a57-99d6-e4553814e411</id>
<name>com.xyst.dinas.fileshared.query.ArtificialRecharge</name>
<title>人工充值</title>
<description>人工充值</description>
<define>inz.query.Query</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.finance.datamodel.ArtificialRecharge</dependency>
......
......@@ -2,8 +2,9 @@
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/inz-query">
<specification>1.0</specification>
<id>0606f47c-5f64-433a-b54a-3e9ea8b04382</id>
<name>com.xyst.dinas.finance.query.BankRechargeDetail</name>
<name>com.xyst.dinas.fileshared.query.BankRechargeDetail</name>
<title>银行充值明细</title>
<description>银行充值明细</description>
<define>inz.query.Query</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.finance.datamodel.BankRechargeDetail</dependency>
......
......@@ -4,6 +4,7 @@
<id>a21f0532-a280-465f-9ef6-95ebb4f44a87</id>
<name>com.xyst.dinas.fileshared.query.ExpenseAdjust</name>
<title>费用调整</title>
<description>费用调整</description>
<define>inz.query.Query</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.finance.datamodel.ExpenseAdjust</dependency>
......
......@@ -4,6 +4,7 @@
<id>bb49e1ae-2930-4b82-ab98-2cd6f8b06953</id>
<name>com.xyst.dinas.fileshared.query.FinanceRefund</name>
<title>财务退款</title>
<description>财务退款</description>
<define>inz.query.Query</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.finance.datamodel.FinanceRefund</dependency>
......
......@@ -4,13 +4,14 @@
<id>72f25343-d3b1-46e6-ab05-e1dd5b8eec63</id>
<name>com.xyst.dinas.fileshared.query.SalesPlan</name>
<title>销售计划</title>
<description>销售计划</description>
<define>inz.query.Query</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.sales.datamodel.SalesPlan</dependency>
<content>
<m:query>
<m:type>com.xyst.dinas.sales.datamodel.SalesPlan</m:type>
<m:dataProcessor>com.xyst.dinas.sales.processor.SalesPlanProcessor</m:dataProcessor>
<m:dataProcessor></m:dataProcessor>
<m:authorityItem></m:authorityItem>
<m:innerScenes>
<m:innerScene>
......
......@@ -2,8 +2,9 @@
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/inz-query">
<specification>1.0</specification>
<id>a397201e-5821-4a80-ac35-d0ceb48a3517</id>
<name>com.xyst.dinas.sales.query.SalesPlanTemp</name>
<name>com.xyst.dinas.fileshared.query.SalesPlanTemp</name>
<title>临时销售计划</title>
<description>临时销售计划</description>
<define>inz.query.Query</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.sales.datamodel.SalesPlanTemp</dependency>
......
......@@ -4,6 +4,7 @@
<id>07818d15-d8db-42f9-8951-acb61c7a322e</id>
<name>com.xyst.dinas.fileshared.query.VehicleDispatch</name>
<title>派单</title>
<description>派单</description>
<define>inz.query.Query</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.transport.datamodel.VehicleDispatch</dependency>
......
......@@ -2,7 +2,7 @@
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/inz-query">
<specification>1.0</specification>
<id>661b3217-8959-429b-b7e4-88a1f3ad0034</id>
<name>com.xyst.dinas.safe.query.VehicleViolation</name>
<name>com.xyst.dinas.fileshared.query.VehicleViolation</name>
<title>车辆违规记录</title>
<description>人员违规记录</description>
<define>inz.query.Query</define>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment