|
@@ -5,22 +5,30 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.java110.api.listener.AbstractServiceApiListener;
|
|
import com.java110.api.listener.AbstractServiceApiListener;
|
|
|
import com.java110.core.annotation.Java110Listener;
|
|
import com.java110.core.annotation.Java110Listener;
|
|
|
import com.java110.core.context.DataFlowContext;
|
|
import com.java110.core.context.DataFlowContext;
|
|
|
|
|
+import com.java110.core.smo.fee.IFeeConfigInnerServiceSMO;
|
|
|
|
|
+import com.java110.dto.fee.FeeConfigDto;
|
|
|
import com.java110.entity.center.AppService;
|
|
import com.java110.entity.center.AppService;
|
|
|
import com.java110.event.service.api.ServiceDataFlowEvent;
|
|
import com.java110.event.service.api.ServiceDataFlowEvent;
|
|
|
import com.java110.utils.constant.BusinessTypeConstant;
|
|
import com.java110.utils.constant.BusinessTypeConstant;
|
|
|
import com.java110.utils.constant.CommonConstant;
|
|
import com.java110.utils.constant.CommonConstant;
|
|
|
import com.java110.utils.constant.ServiceCodeFeeConfigConstant;
|
|
import com.java110.utils.constant.ServiceCodeFeeConfigConstant;
|
|
|
import com.java110.utils.util.Assert;
|
|
import com.java110.utils.util.Assert;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.HttpMethod;
|
|
import org.springframework.http.HttpMethod;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 保存费用项侦听
|
|
* 保存费用项侦听
|
|
|
* add by wuxw 2019-06-30
|
|
* add by wuxw 2019-06-30
|
|
|
*/
|
|
*/
|
|
|
@Java110Listener("updateFeeConfigListener")
|
|
@Java110Listener("updateFeeConfigListener")
|
|
|
public class UpdateFeeConfigListener extends AbstractServiceApiListener {
|
|
public class UpdateFeeConfigListener extends AbstractServiceApiListener {
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
|
|
protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
|
|
|
|
|
|
|
@@ -83,6 +91,11 @@ public class UpdateFeeConfigListener extends AbstractServiceApiListener {
|
|
|
* @return 订单服务能够接受的报文
|
|
* @return 订单服务能够接受的报文
|
|
|
*/
|
|
*/
|
|
|
private JSONObject updateFeeConfig(JSONObject paramInJson, DataFlowContext dataFlowContext) {
|
|
private JSONObject updateFeeConfig(JSONObject paramInJson, DataFlowContext dataFlowContext) {
|
|
|
|
|
+ FeeConfigDto feeConfigDto = new FeeConfigDto();
|
|
|
|
|
+ feeConfigDto.setCommunityId(paramInJson.getString("communityId"));
|
|
|
|
|
+ feeConfigDto.setConfigId(paramInJson.getString("configId"));
|
|
|
|
|
+ List<FeeConfigDto> feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto);
|
|
|
|
|
+ Assert.listOnlyOne(feeConfigDtos, "未找到该费用项");
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
|
|
JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
|
|
@@ -91,6 +104,7 @@ public class UpdateFeeConfigListener extends AbstractServiceApiListener {
|
|
|
business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
|
|
business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
|
|
|
JSONObject businessFeeConfig = new JSONObject();
|
|
JSONObject businessFeeConfig = new JSONObject();
|
|
|
businessFeeConfig.putAll(paramInJson);
|
|
businessFeeConfig.putAll(paramInJson);
|
|
|
|
|
+ businessFeeConfig.put("isDefault", feeConfigDtos.get(0).getIsDefault());
|
|
|
//计算 应收金额
|
|
//计算 应收金额
|
|
|
business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessFeeConfig", businessFeeConfig);
|
|
business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessFeeConfig", businessFeeConfig);
|
|
|
return business;
|
|
return business;
|