|
@@ -15,81 +15,83 @@ import java.util.List;
|
|
|
|
|
|
@Service
|
|
|
public class FieldsService extends Ops {
|
|
|
- @Autowired MongoTemplate mongoTemplate;
|
|
|
+ @Autowired
|
|
|
+ MongoTemplate mongoTemplate;
|
|
|
|
|
|
- @Autowired private HeaderProperties headerProperties;
|
|
|
+ @Autowired
|
|
|
+ private HeaderProperties headerProperties;
|
|
|
|
|
|
- /**
|
|
|
- * 校验上传的文件格式是否符合业务类型规则
|
|
|
- *
|
|
|
- * @param originFields
|
|
|
- */
|
|
|
- public void checkAllFields(List<Fields> originFields) {
|
|
|
- // 五联单-注册信息
|
|
|
- List<Fields> fields = this.checkFields(originFields, AlipayType.ALIPAY_ORIGIN_REGISTER);
|
|
|
- this.updateLogicalFile(fields, "五联单-注册信息");
|
|
|
+ /**
|
|
|
+ * 校验上传的文件格式是否符合业务类型规则
|
|
|
+ *
|
|
|
+ * @param originFields
|
|
|
+ */
|
|
|
+ public void checkAllFields(List<Fields> originFields) {
|
|
|
+ // 五联单-注册信息
|
|
|
+ List<Fields> fields = this.checkFields(originFields, AlipayType.ALIPAY_ORIGIN_REGISTER);
|
|
|
+ this.updateLogicalFile(fields, "五联单-注册信息");
|
|
|
|
|
|
- fields = this.checkFields(originFields, 12);
|
|
|
- this.updateLogicalFile(fields, "五联单-注册信息");
|
|
|
+ fields = this.checkFields(originFields, 12);
|
|
|
+ this.updateLogicalFile(fields, "五联单-注册信息");
|
|
|
|
|
|
- fields = this.checkFields(originFields, 13);
|
|
|
- this.updateLogicalFile(fields, "五联单-注册信息");
|
|
|
+ fields = this.checkFields(originFields, 13);
|
|
|
+ this.updateLogicalFile(fields, "五联单-注册信息");
|
|
|
|
|
|
- fields = this.checkFields(originFields, 14);
|
|
|
- this.updateLogicalFile(fields, "五联单-注册信息");
|
|
|
+ fields = this.checkFields(originFields, 14);
|
|
|
+ this.updateLogicalFile(fields, "五联单-注册信息");
|
|
|
|
|
|
- // 五联单-登录日志
|
|
|
- fields = this.checkFields(originFields, AlipayType.ALIPAY_ORIGIN_LOGIN);
|
|
|
- this.updateLogicalFile(fields, "五联单-登录日志");
|
|
|
- // 五联单-交易记录
|
|
|
- fields = this.checkFields(originFields, AlipayType.ALIPAY_ORIGIN_TRADE);
|
|
|
- this.updateLogicalFile(fields, "五联单-交易记录");
|
|
|
- // 五联单-账户明细
|
|
|
- fields = this.checkFields(originFields, AlipayType.ALIPAY_ORIGIN_ACCOUNT);
|
|
|
- this.updateLogicalFile(fields, "五联单-账户明细");
|
|
|
- // 五联单-转账明细 ALIPAY_ORIGIN_TRANSFER
|
|
|
- fields = this.checkFields(originFields, AlipayType.ALIPAY_ORIGIN_TRANSFER);
|
|
|
- this.updateLogicalFile(fields, "五联单-转账明细 ");
|
|
|
- // 反诈平台订单数据
|
|
|
- fields = matchHeaders(originFields, headerProperties.getAntiCheatOrigin());
|
|
|
- this.updateLogicalFile(fields, "反诈平台订单数据");
|
|
|
- // 治安平台订单数据
|
|
|
- fields = matchHeaders(originFields, headerProperties.getSecurityOrigin());
|
|
|
- this.updateLogicalFile(fields, "治安平台订单数据");
|
|
|
- // 财付通 开户信息
|
|
|
- fields = matchHeaders(originFields, TenpayHeaders.getHeaders(3));
|
|
|
- this.updateLogicalFile(fields, "财付通-注册信息");
|
|
|
- // 财付通-订单明细
|
|
|
- fields = matchHeaders(originFields, TenpayHeaders.getHeaders(6));
|
|
|
- this.updateLogicalFile(fields, "财付通-订单明细2");
|
|
|
- fields = matchHeaders(originFields, TenpayHeaders.getHeaders(5));
|
|
|
- this.updateLogicalFile(fields, "财付通-订单明细2");
|
|
|
- fields = matchHeaders(originFields, TenpayHeaders.getHeaders(1));
|
|
|
- this.updateLogicalFile(fields, "财付通-订单明细2");
|
|
|
- fields = matchHeaders(originFields, TenpayHeaders.getHeaders(2));
|
|
|
- this.updateLogicalFile(fields, "财付通-订单明细2");
|
|
|
- fields = matchHeaders(originFields, TenpayHeaders.getHeaders(7));
|
|
|
- this.updateLogicalFile(fields, "财付通-订单明细1");
|
|
|
- fields = matchHeaders(originFields, TenpayHeaders.getHeaders(8));
|
|
|
- this.updateLogicalFile(fields, "财付通-订单明细1");
|
|
|
- // 财付通-手机明细
|
|
|
- fields = matchHeaders(originFields, TenpayHeaders.getHeaders(4));
|
|
|
- this.updateLogicalFile(fields, "财付通-手机明细");
|
|
|
+ // 五联单-登录日志
|
|
|
+ fields = this.checkFields(originFields, AlipayType.ALIPAY_ORIGIN_LOGIN);
|
|
|
+ this.updateLogicalFile(fields, "五联单-登录日志");
|
|
|
+ // 五联单-交易记录
|
|
|
+ fields = this.checkFields(originFields, AlipayType.ALIPAY_ORIGIN_TRADE);
|
|
|
+ this.updateLogicalFile(fields, "五联单-交易记录");
|
|
|
+ // 五联单-账户明细
|
|
|
+ fields = this.checkFields(originFields, AlipayType.ALIPAY_ORIGIN_ACCOUNT);
|
|
|
+ this.updateLogicalFile(fields, "五联单-账户明细");
|
|
|
+ // 五联单-转账明细 ALIPAY_ORIGIN_TRANSFER
|
|
|
+ fields = this.checkFields(originFields, AlipayType.ALIPAY_ORIGIN_TRANSFER);
|
|
|
+ this.updateLogicalFile(fields, "五联单-转账明细 ");
|
|
|
+ // 反诈平台订单数据
|
|
|
+ fields = matchHeaders(originFields, headerProperties.getAntiCheatOrigin());
|
|
|
+ this.updateLogicalFile(fields, "反诈平台订单数据");
|
|
|
+ // 治安平台订单数据
|
|
|
+ fields = matchHeaders(originFields, headerProperties.getSecurityOrigin());
|
|
|
+ this.updateLogicalFile(fields, "治安平台订单数据");
|
|
|
+ // 财付通 开户信息
|
|
|
+ fields = matchHeaders(originFields, TenpayHeaders.getHeaders(3));
|
|
|
+ this.updateLogicalFile(fields, "财付通-注册信息");
|
|
|
+ // 财付通-订单明细
|
|
|
+ fields = matchHeaders(originFields, TenpayHeaders.getHeaders(6));
|
|
|
+ this.updateLogicalFile(fields, "财付通-订单明细2");
|
|
|
+ fields = matchHeaders(originFields, TenpayHeaders.getHeaders(5));
|
|
|
+ this.updateLogicalFile(fields, "财付通-订单明细2");
|
|
|
+ fields = matchHeaders(originFields, TenpayHeaders.getHeaders(1));
|
|
|
+ this.updateLogicalFile(fields, "财付通-订单明细2");
|
|
|
+ fields = matchHeaders(originFields, TenpayHeaders.getHeaders(2));
|
|
|
+ this.updateLogicalFile(fields, "财付通-订单明细2");
|
|
|
+ fields = matchHeaders(originFields, TenpayHeaders.getHeaders(7));
|
|
|
+ this.updateLogicalFile(fields, "财付通-订单明细1");
|
|
|
+ fields = matchHeaders(originFields, TenpayHeaders.getHeaders(8));
|
|
|
+ this.updateLogicalFile(fields, "财付通-订单明细1");
|
|
|
+ // 财付通-手机明细
|
|
|
+ fields = matchHeaders(originFields, TenpayHeaders.getHeaders(4));
|
|
|
+ this.updateLogicalFile(fields, "财付通-手机明细");
|
|
|
|
|
|
- fields = matchHeaders(originFields, headerProperties.getEconomicOrder());
|
|
|
- this.updateLogicalFile(fields, "经侦数据-订单明细");
|
|
|
+ fields = matchHeaders(originFields, headerProperties.getEconomicOrder());
|
|
|
+ this.updateLogicalFile(fields, "经侦数据-订单明细");
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- void updateLogicalFile(List<Fields> fields, String matchType) {
|
|
|
- if (fields.size() > 0) {
|
|
|
- for (Fields field : fields) {
|
|
|
- Query query = new Query();
|
|
|
- query.addCriteria(Criteria.where("_id").is(field.getFileId()));
|
|
|
- Update update = new Update();
|
|
|
- update.set("matchType", matchType);
|
|
|
- this.mongoTemplate.updateFirst(query, update, "logical_file");
|
|
|
- }
|
|
|
+ void updateLogicalFile(List<Fields> fields, String matchType) {
|
|
|
+ if (fields.size() > 0) {
|
|
|
+ for (Fields field : fields) {
|
|
|
+ Query query = new Query();
|
|
|
+ query.addCriteria(Criteria.where("_id").is(field.getFileId()));
|
|
|
+ Update update = new Update();
|
|
|
+ update.set("matchType", matchType);
|
|
|
+ this.mongoTemplate.updateFirst(query, update, "logical_file");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
}
|