| | |
| | | import com.java110.acct.smo.IQrCodePaymentSMO; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.AbstractServiceCmdListener; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.core.factory.CallApiServiceFactory; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.dto.fee.FeeDetailDto; |
| | | import com.java110.intf.community.ICommunityV1InnerServiceSMO; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.CommonConstant; |
| | |
| | | * 扫码付 |
| | | */ |
| | | @Java110Cmd(serviceCode = "payment.qrCodePayment") |
| | | public class QrCodePaymentCmd extends AbstractServiceCmdListener { |
| | | public class QrCodePaymentCmd extends Cmd { |
| | | private static Logger logger = LoggerFactory.getLogger(QrCodePaymentCmd.class); |
| | | |
| | | @Autowired |
| | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "authCode", "未包含授权码"); |
| | | Assert.hasKeyAndValue(reqJson, "receivedAmount", "未包含支付金额"); |
| | | Assert.hasKeyAndValue(reqJson, "subServiceCode", "未包含支付接口"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | int pre = Integer.parseInt(authCode.substring(0, 2)); |
| | | if (pre > 24 && pre < 31) { // 支付宝 |
| | | qrCodePaymentSMOImpl = ApplicationContextFactory.getBean("qrCodeAliPaymentAdapt", IQrCodePaymentSMO.class); |
| | | reqJson.put("primeRate", FeeDetailDto.PRIME_REATE_WECHAT_QRCODE); |
| | | } else { |
| | | qrCodePaymentSMOImpl = ApplicationContextFactory.getBean("qrCodeWechatPaymentAdapt", IQrCodePaymentSMO.class); |
| | | reqJson.put("primeRate", FeeDetailDto.PRIME_REATE_ALI_QRCODE); |
| | | } |
| | | } else { |
| | | qrCodePaymentSMOImpl = ApplicationContextFactory.getBean(payQrAdapt, IQrCodePaymentSMO.class); |
| | |
| | | |
| | | Assert.listOnlyOne(communityDtos, "小区不存在"); |
| | | |
| | | String feeName = communityDtos.get(0).getName() + "-" + reqJson.getString("payerObjName") + "-" + reqJson.getString("feeName"); |
| | | String feeName = communityDtos.get(0).getName(); |
| | | if (!StringUtil.isEmpty(reqJson.getString("payerObjName"))) { |
| | | feeName += ("-" + reqJson.getString("payerObjName")); |
| | | } |
| | | |
| | | if (!StringUtil.isEmpty(reqJson.getString("feeName"))) { |
| | | feeName += ("-" + reqJson.getString("feeName")); |
| | | } |
| | | |
| | | if (feeName.length() > 120) { |
| | | feeName = feeName.substring(0, 120); |
| | | } |
| | | |
| | | ResultVo resultVo = null; |
| | | try { |
| | |
| | | } |
| | | String appId = cmdDataFlowContext.getReqHeaders().get(CommonConstant.APP_ID); |
| | | String userId = cmdDataFlowContext.getReqHeaders().get(CommonConstant.USER_ID); |
| | | JSONObject paramOut = CallApiServiceFactory.postForApi(appId, reqJson, "fee.payFee", JSONObject.class, userId); |
| | | //JSONObject paramOut = CallApiServiceFactory.postForApi(appId, reqJson, "fee.payFee", JSONObject.class, userId); |
| | | JSONObject paramOut = CallApiServiceFactory.postForApi(appId, reqJson, reqJson.getString("subServiceCode"), JSONObject.class, userId); |
| | | cmdDataFlowContext.setResponseEntity(ResultVo.createResponseEntity(paramOut)); |
| | | } |
| | | |