package com.java110.order.smo.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.order.dao.ICenterServiceDAO;
import com.java110.order.smo.ICenterServiceSMO;
import com.java110.utils.cache.AppRouteCache;
import com.java110.utils.cache.MappingCache;
import com.java110.utils.constant.*;
import com.java110.utils.exception.*;
import com.java110.utils.factory.ApplicationContextFactory;
import com.java110.utils.kafka.KafkaFactory;
import com.java110.utils.log.LoggerEngine;
import com.java110.utils.util.*;
import com.java110.core.client.RestTemplate;
import com.java110.core.context.DataFlow;
import com.java110.core.factory.AuthenticationFactory;
import com.java110.core.factory.DataFlowFactory;
import com.java110.core.factory.DataTransactionFactory;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.entity.center.AppRoute;
import com.java110.entity.center.AppService;
import com.java110.entity.center.Business;
import com.java110.entity.center.DataFlowLinksCost;
import com.java110.core.event.center.DataFlowEventPublishing;
import com.java110.core.log.LogAgent;
import com.java110.service.init.ServiceInfoListener;
import com.java110.service.smo.IQueryServiceSMO;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* 中心服务处理类
* Created by wuxw on 2018/4/13.
*/
@Service("centerServiceSMOImpl")
//@Transactional
public class CenterServiceSMOImpl extends LoggerEngine implements ICenterServiceSMO {
@Autowired
ICenterServiceDAO centerServiceDaoImpl;
@Autowired
private RestTemplate restTemplate;
@Autowired
private RestTemplate outRestTemplate;
@Autowired
private IQueryServiceSMO queryServiceSMOImpl;
@Override
@Deprecated
public String service(String reqJson, Map<String, String> headers) throws SMOException{
DataFlow dataFlow = null;
JSONObject responseJson = null;
String resJson = "";
try {
reqJson = decrypt(reqJson,headers);
DataFlowEventPublishing.preValidateData(reqJson,headers);
//1.0 创建数据流
dataFlow = DataFlowFactory.newInstance(DataFlow.class).builder(reqJson, headers);
//DataFlowEventPublishing.initDataFlowComplete(dataFlow);
//2.0 加载配置信息
initConfigData(dataFlow);
//DataFlowEventPublishing.loadConfigDataComplete(dataFlow);
//3.0 校验 APPID是否有权限操作serviceCode
judgeAuthority(dataFlow);
//4.0 调用规则校验
ruleValidate(dataFlow);
//DataFlowEventPublishing.ruleValidateComplete(dataFlow);
//5.0 保存订单和业务项 c_orders c_order_attrs c_business c_business_attrs
saveOrdersAndBusiness(dataFlow);
//6.0 调用下游系统
//DataFlowEventPublishing.invokeBusinessSystem(dataFlow);
invokeBusinessSystem(dataFlow);
responseJson = DataTransactionFactory.createCommonResponseJson(dataFlow);
} catch (DecryptException e){ //解密异常
responseJson = DataTransactionFactory.createOrderResponseJson(ResponseConstant.NO_TRANSACTION_ID,
e.getResult().getCode(), e.getMessage());
}catch (BusinessException e) {
try {
//7.0 作废订单和业务项
invalidOrderAndBusiness(dataFlow);
//8.0 广播作废业务系统订单信息
//想法:这里可以直接不广播,只有在业务返回时才广播,
// 疑问:在这里部分消息发出去了,如果在receiveBusinessSystemNotifyMessage这个方法中依然没有收到,我们认为是下游系统也是失败了不用处理,
//目前看逻辑也是对的
//invalidBusinessSystem(dataFlow);
} catch (Exception e1) {
LoggerEngine.error("作废订单失败", e);
//9.0 将订单状态改为失败,人工处理。
updateOrderAndBusinessError(dataFlow);
} finally {
responseJson = DataTransactionFactory.createOrderResponseJson(dataFlow.getTransactionId(),
e.getResult().getCode(), e.getMessage());
}
} catch (OrdersException e) {
responseJson = DataTransactionFactory.createOrderResponseJson(dataFlow.getTransactionId(),
e.getResult().getCode(), e.getMessage());
} catch (RuleException e) {
responseJson = DataTransactionFactory.createOrderResponseJson(dataFlow.getTransactionId(),
e.getResult().getCode(), e.getMessage());
} catch (NoAuthorityException e) {
responseJson = DataTransactionFactory.createOrderResponseJson(dataFlow.getTransactionId(),
e.getResult().getCode(), e.getMessage());
} catch (InitConfigDataException e){
responseJson = DataTransactionFactory.createOrderResponseJson(dataFlow.getTransactionId(),
e.getResult().getCode(), e.getMessage());
}catch (Exception e) {
logger.error("内部异常了:",e);
responseJson = DataTransactionFactory.createOrderResponseJson(dataFlow == null
? ResponseConstant.NO_TRANSACTION_ID
: dataFlow.getTransactionId(),
ResponseConstant.RESULT_CODE_INNER_ERROR, "内部异常了:" + e.getMessage() + e.getLocalizedMessage());
} finally {
if(dataFlow != null) {
//这里记录日志
Date endDate = DateUtil.getCurrentDate();
dataFlow.setEndDate(endDate);
dataFlow.setResJson(responseJson);
//添加耗时
//DataFlowFactory.addCostTime(dataFlow, "service", "业务处理总耗时", dataFlow.getStartDate(), dataFlow.getEndDate());
//保存耗时
//saveCostTimeLogMessage(dataFlow);
//处理返回报文鉴权
AuthenticationFactory.putSign(dataFlow, responseJson);
saveLogMessage(dataFlow,LogAgent.createLogMessage(dataFlow.getRequestHeaders(),dataFlow.getReqJson().toJSONString()),
LogAgent.createLogMessage(dataFlow.getResponseHeaders(),dataFlow.getResJson().toJSONString()),endDate.getTime()-dataFlow.getStartDate().getTime());
// DataFlowEventPublishing.dataResponse(dataFlow,reqJson,headers);
}
resJson = encrypt(responseJson.toJSONString(),headers);
//这里保存耗时,以及日志
return resJson;
}
}
/**
* 业务统一处理服务方法
* @param reqJson 请求报文json
* @return
*/
public ResponseEntity<String> serviceApi(String reqJson, Map<String,String> headers) throws SMOException{
DataFlow dataFlow = null;
JSONObject responseJson = null;
ResponseEntity<String> responseEntity = null;
try {
DataFlowEventPublishing.preValidateData(reqJson,headers);
//1.0 创建数据流
dataFlow = DataFlowFactory.newInstance(DataFlow.class).builder(reqJson, headers);
//DataFlowEventPublishing.initDataFlowComplete(dataFlow);
//2.0 加载配置信息
initConfigData(dataFlow);
//DataFlowEventPublishing.loadConfigDataComplete(dataFlow);
//3.0 校验 APPID是否有权限操作serviceCode
judgeAuthority(dataFlow);
//4.0 调用规则校验
ruleValidate(dataFlow);
//DataFlowEventPublishing.ruleValidateComplete(dataFlow);
//5.0 保存订单和业
没有合适的资源?快使用搜索试试~ 我知道了~
HC小区物业管理系统
共2000个文件
java:3222个
xml:150个
json:134个
5星 · 超过95%的资源 需积分: 19 24 下载量 49 浏览量
2020-12-15
10:07:37
上传
评论 4
收藏 13.51MB ZIP 举报
温馨提示
HC小区物业管理系统包含收费+报表,报修,门禁道闸,线上缴费,社区商圈,巡检,公众号欠费推送和公告微信推送功能,目前系统已经在安徽宿州4个小区, 深圳2个小区,西安11个小区,山东5个小区和哈尔滨1个小区等商业化运营平稳。
资源详情
资源评论
资源推荐
收起资源包目录
HC小区物业管理系统 (2000个子文件)
centerService.docx 248KB
userService.docx 221KB
centerServiceTestDocument.docx 143KB
choose.html 3KB
manage.html 2KB
viewInfo.html 1KB
flow.html 1KB
delete.html 1KB
add.html 1KB
edit.html 1KB
flow.html 1019B
binding.html 788B
add.html 384B
CenterServiceSMOImpl.java 62KB
AssetImportSMOImpl.java 40KB
FTPClientTemplate.java 35KB
GenerateCodeFactory.java 33KB
OrderServiceSMOImpl.java 32KB
FeeBMOImpl.java 32KB
DataFlowFactory.java 32KB
BusinessTypeConstant.java 30KB
ComputeFeeSMOImpl.java 30KB
OrderDataFlowContextFactory.java 28KB
WorkflowInnerServiceSMOImpl.java 28KB
UserServiceDaoImpl.java 26KB
HcFtpToFileSystemConfigAction.java 25KB
CommunityBMOImpl.java 25KB
FrontFeeServiceSMOImpl.java 25KB
ContractApi.java 24KB
RuleCommon.java 24KB
RoomServiceSMOImpl.java 23KB
ServiceCodeConstant.java 22KB
OwnerAppLoginSMOImpl.java 22KB
GenerateBillTemplate.java 20KB
QueryOweFeeImpl.java 20KB
GeneratorBindingComponent.java 20KB
QueryServiceSMOImpl.java 20KB
MachineRoadGateOpenListener.java 19KB
StoreServiceDaoImpl.java 19KB
AuthenticationFactory.java 18KB
DownloadFileFromFtpToTable.java 18KB
GeneratorManagerComponent.java 17KB
CommunityServiceDaoImpl.java 17KB
AbstractOrderServiceSMOImpl.java 17KB
CarServiceSMOImpl.java 17KB
RentingApi.java 16KB
Java110MybatisInterceptor.java 16KB
PackingSpaceServiceSMOImpl.java 16KB
AssetExportSMOImpl.java 16KB
OwnerBMOImpl.java 16KB
ParkingSpaceBMOImpl.java 16KB
HcFtpToFileSystemQuartz.java 16KB
DataTransactionFactory.java 16KB
GoodCollectionUserInnerServiceSMOImpl.java 16KB
ApiServiceSMOImpl.java 16KB
UpdateFeeInfoListener.java 15KB
FeeSharingBMOImpl.java 15KB
PrivilegeSMOImpl.java 15KB
ComplaintUserInnerServiceSMOImpl.java 15KB
OrderProcessServiceSMOImpl.java 15KB
ApplicationKeyBMOImpl.java 15KB
PurchaseApplyUserInnerServiceSMOImpl.java 15KB
RestApi.java 15KB
PrivilegeServiceSMOImpl.java 15KB
RepairDispatchListener.java 15KB
CenterServiceDAOImpl.java 15KB
GenerateBillProTemplate.java 14KB
StaffServiceSMOImpl.java 14KB
UpdateStoreInfoListener.java 14KB
WeChatPushMessageTemplate.java 14KB
CallComponentController.java 14KB
AbstractStoreBusinessServiceDataFlowListener.java 14KB
OwnerServiceSMOImpl.java 14KB
BaseComponentSMO.java 14KB
GeneratorApiListener.java 14KB
MachineTranslateBMOImpl.java 14KB
DeleteStoreInfoListener.java 14KB
FtpUploadTemplate.java 13KB
SaveStoreInfoListener.java 13KB
GeneratorApiListener.java 13KB
RoomBMOImpl.java 13KB
AppController.java 13KB
StringUtil.java 13KB
ListOwnerOweFeeListener.java 13KB
RentingPayFeeConfirmListener.java 13KB
AbstractServiceApiPlusListener.java 13KB
GeneratorEditComponent.java 12KB
FeeInnerServiceSMOImpl.java 12KB
UpdateCommunityInfoListener.java 12KB
GeneratorAddComponent.java 12KB
DateUtil.java 12KB
DemoServiceSMOImpl.java 12KB
OIdServiceSMOImpl.java 12KB
StoreBMOImpl.java 12KB
ProtocolUtil.java 12KB
ListAdvertPhotoAndVediosListener.java 12KB
GeneratorInspectionTaskTemplate.java 12KB
PayOweFeeImpl.java 11KB
ApiBaseBMO.java 11KB
FloorServiceSMOImpl.java 11KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
weixin_41922623
- 粉丝: 2
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论10