|
@@ -10,6 +10,7 @@ import ieven.server.webapp.domain.data.DataService;
|
|
import ieven.server.webapp.domain.data.Fields;
|
|
import ieven.server.webapp.domain.data.Fields;
|
|
import ieven.server.webapp.domain.data.StaticInput;
|
|
import ieven.server.webapp.domain.data.StaticInput;
|
|
import ieven.server.webapp.domain.exporter.Exporter;
|
|
import ieven.server.webapp.domain.exporter.Exporter;
|
|
|
|
+import ieven.server.webapp.domain.file.LogicalFile;
|
|
import ieven.server.webapp.domain.model.Model;
|
|
import ieven.server.webapp.domain.model.Model;
|
|
import ieven.server.webapp.infrastructure.wrapper.Mapped;
|
|
import ieven.server.webapp.infrastructure.wrapper.Mapped;
|
|
import ieven.server.webapp.service.alipay.AlipayService;
|
|
import ieven.server.webapp.service.alipay.AlipayService;
|
|
@@ -72,7 +73,7 @@ public class AlipayController {
|
|
} else {
|
|
} else {
|
|
Future<Long> totalFuture = this.dataService.countTotalByQuery(new Query(criteria));
|
|
Future<Long> totalFuture = this.dataService.countTotalByQuery(new Query(criteria));
|
|
|
|
|
|
- List<DataMap> dataMaps =
|
|
|
|
|
|
+ List<DataMap> dataMaps =
|
|
this.mongoTemplate.find(
|
|
this.mongoTemplate.find(
|
|
(new Query(criteria)).skip(skip).limit(pageSize), DataMap.class);
|
|
(new Query(criteria)).skip(skip).limit(pageSize), DataMap.class);
|
|
Long total;
|
|
Long total;
|
|
@@ -119,7 +120,7 @@ public class AlipayController {
|
|
} else {
|
|
} else {
|
|
Future<Long> totalFuture = this.dataService.countTotalByQuery(new Query(criteria));
|
|
Future<Long> totalFuture = this.dataService.countTotalByQuery(new Query(criteria));
|
|
|
|
|
|
- List<DataMap> dataMaps =
|
|
|
|
|
|
+ List<DataMap> dataMaps =
|
|
this.mongoTemplate.find(
|
|
this.mongoTemplate.find(
|
|
(new Query(criteria)).skip(skip).limit(pageSize), DataMap.class);
|
|
(new Query(criteria)).skip(skip).limit(pageSize), DataMap.class);
|
|
Long total;
|
|
Long total;
|
|
@@ -242,6 +243,36 @@ public class AlipayController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @PostMapping({"/getFileIdByName"})
|
|
|
|
+ public Mapped getFileIdByName(@RequestBody LineInput input) {
|
|
|
|
+ String modelId = input.getModelId();
|
|
|
|
+ if (modelId == null) {
|
|
|
|
+ return Mapped.ERROR("没有选择模型!");
|
|
|
|
+ } else {
|
|
|
|
+ String dateFileId = getFileId(input.getFilename(), modelId, mongoTemplate);
|
|
|
|
+ Mapped mapped = Mapped.OK();
|
|
|
|
+ mapped.put("result", dateFileId);
|
|
|
|
+ mapped.put("code", 200);
|
|
|
|
+ return mapped;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected String getFileId(String filename, String modelId, MongoTemplate mongoTemplate) {
|
|
|
|
+ Query query =
|
|
|
|
+ new Query(
|
|
|
|
+ Criteria.where("modelId")
|
|
|
|
+ .is(modelId)
|
|
|
|
+ .and("filename")
|
|
|
|
+ .is(filename)
|
|
|
|
+ .and("generated")
|
|
|
|
+ .is(Boolean.TRUE));
|
|
|
|
+ LogicalFile oldFile = mongoTemplate.findOne(query, LogicalFile.class);
|
|
|
|
+ if (oldFile != null) {
|
|
|
|
+ return oldFile.getId();
|
|
|
|
+ } else {
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
private Criteria resolveDetailQuery(
|
|
private Criteria resolveDetailQuery(
|
|
String filename, String fileId, String lineId, String clickHeader) {
|
|
String filename, String fileId, String lineId, String clickHeader) {
|
|
List<String> fileIds = this.destFileId(fileId);
|
|
List<String> fileIds = this.destFileId(fileId);
|
|
@@ -332,6 +363,50 @@ public class AlipayController {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ dszfbyhid = (String) dataMap.get("交易对手账号");
|
|
|
|
+ if (!clickHeader.equals("交易总额") && !clickHeader.equals("总笔数")) {
|
|
|
|
+ if (!clickHeader.equals("交易主体收入金额") && !clickHeader.equals("交易主体收入笔数")) {
|
|
|
|
+ if (clickHeader.equals("交易主体支出金额") || clickHeader.equals("交易主体支出笔数")) {
|
|
|
|
+ criteria.and("交易对手账号").is(dszfbyhid).and("借贷类型").is("出");
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ criteria.and("交易对手账号").is(dszfbyhid).and("借贷类型").is("入");
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ criteria.and("交易对手账号").is(dszfbyhid);
|
|
|
|
+ }
|
|
|
|
+ } else if (filename.equals("数据分析-账户透视")) {
|
|
|
|
+ if (lineId == null) {
|
|
|
|
+ return criteria;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ dataMap = this.mongoTemplate.findById(lineId, DataMap.class);
|
|
|
|
+ if (dataMap == null) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ dszfbyhid = (String) dataMap.get("交易主体账号");
|
|
|
|
+ if (!clickHeader.equals("交易总额") && !clickHeader.equals("总笔数")) {
|
|
|
|
+ if (!clickHeader.equals("收入金额") && !clickHeader.equals("收入笔数")) {
|
|
|
|
+ if (clickHeader.equals("支出金额") || clickHeader.equals("支出笔数")) {
|
|
|
|
+ criteria.and("交易主体账号").is(dszfbyhid).and("借贷类型").is("出");
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ criteria.and("交易主体账号").is(dszfbyhid).and("借贷类型").is("入");
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ criteria.and("交易主体账号").is(dszfbyhid);
|
|
|
|
+ }
|
|
|
|
+ } else if (filename.equals("数据分析-对手透视")) {
|
|
|
|
+ if (lineId == null) {
|
|
|
|
+ return criteria;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ dataMap = this.mongoTemplate.findById(lineId, DataMap.class);
|
|
|
|
+ if (dataMap == null) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
dszfbyhid = (String) dataMap.get("交易对手账号");
|
|
dszfbyhid = (String) dataMap.get("交易对手账号");
|
|
if (!clickHeader.equals("交易总额") && !clickHeader.equals("总笔数")) {
|
|
if (!clickHeader.equals("交易总额") && !clickHeader.equals("总笔数")) {
|
|
if (!clickHeader.equals("交易主体收入金额") && !clickHeader.equals("交易主体收入笔数")) {
|
|
if (!clickHeader.equals("交易主体收入金额") && !clickHeader.equals("交易主体收入笔数")) {
|