|
|
@@ -15,9 +15,11 @@ import com.github.microservice.net.ResultContent;
|
|
|
import com.github.microservice.net.ResultMessage;
|
|
|
import com.github.microservice.types.OrderModeType;
|
|
|
import com.github.microservice.types.OrderState;
|
|
|
+import com.github.microservice.types.payment.ChargeableType;
|
|
|
import com.github.microservice.types.payment.PaymentDeviceType;
|
|
|
import com.github.microservice.types.payment.PaymentType;
|
|
|
import com.zhongshu.card.client.model.base.SuperSearch;
|
|
|
+import com.zhongshu.card.client.model.org.OrganizationSimpleModel;
|
|
|
import com.zhongshu.card.client.model.org.UserJoinBusOrgModel;
|
|
|
import com.zhongshu.card.client.model.payment.*;
|
|
|
import com.zhongshu.card.client.model.payment.statistic.BusinessMainStatisticModel;
|
|
|
@@ -25,7 +27,6 @@ import com.zhongshu.card.client.model.payment.statistic.StatisticItem;
|
|
|
import com.zhongshu.card.client.model.payment.statistic.StatisticSearch;
|
|
|
import com.zhongshu.card.client.model.school.AreaSimpleModel;
|
|
|
import com.zhongshu.card.client.service.payment.ExpenseFlowService;
|
|
|
-import com.zhongshu.card.client.type.DataState;
|
|
|
import com.zhongshu.card.client.type.RefundState;
|
|
|
import com.zhongshu.card.client.type.StatisticType;
|
|
|
import com.zhongshu.card.client.type.UserState;
|
|
|
@@ -38,14 +39,16 @@ import com.zhongshu.card.server.core.dao.org.OrganizationDao;
|
|
|
import com.zhongshu.card.server.core.dao.org.UserCountDao;
|
|
|
import com.zhongshu.card.server.core.dao.payment.ExpenseFlowDao;
|
|
|
import com.zhongshu.card.server.core.dao.school.CardInfoDao;
|
|
|
+import com.zhongshu.card.server.core.dataConfig.OrderConfig;
|
|
|
import com.zhongshu.card.server.core.domain.devices.DeviceInfo;
|
|
|
-import com.zhongshu.card.server.core.domain.devices.permiss.DevicePermiss;
|
|
|
import com.zhongshu.card.server.core.domain.org.Organization;
|
|
|
import com.zhongshu.card.server.core.domain.org.UserAccount;
|
|
|
import com.zhongshu.card.server.core.domain.payment.ExpenseFlow;
|
|
|
import com.zhongshu.card.server.core.domain.school.CardInfo;
|
|
|
import com.zhongshu.card.server.core.httpRequest.ApiRequestService;
|
|
|
import com.zhongshu.card.server.core.service.base.SuperService;
|
|
|
+import com.zhongshu.card.server.core.service.devices.DeviceInfoServiceImpl;
|
|
|
+import com.zhongshu.card.server.core.service.devices.permiss.DevicePermissVerifyService;
|
|
|
import com.zhongshu.card.server.core.service.org.OrganizationServiceImpl;
|
|
|
import com.zhongshu.card.server.core.service.paySetting.ProjectPaySettingServiceImpl;
|
|
|
import com.zhongshu.card.server.core.service.school.AreaServiceImpl;
|
|
|
@@ -107,6 +110,12 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
@Autowired
|
|
|
private AreaServiceImpl areaService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DevicePermissVerifyService devicePermissVerifyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private DeviceInfoServiceImpl deviceInfoService;
|
|
|
+
|
|
|
/**
|
|
|
* 创建流水
|
|
|
*
|
|
|
@@ -125,39 +134,51 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
* @return
|
|
|
*/
|
|
|
public ResultContent<ExpenseFlow> createExpenseFlowByHxz(ConsumTransactionsModel iotParam, ExpenseFlow expenseFlow) {
|
|
|
- BeanUtils.copyProperties(iotParam, expenseFlow, "id");
|
|
|
+ CreateOrderParam param = new CreateOrderParam();
|
|
|
+ // 渠道订单支付模式
|
|
|
+ if (iotParam.getMode() == 0) {
|
|
|
+ param.setOrderModeType(OrderModeType.Consume);
|
|
|
+ } else if (iotParam.getMode() == 2) {
|
|
|
+ // 查询余额
|
|
|
+ param.setOrderModeType(OrderModeType.BalanceInquiry);
|
|
|
+ }
|
|
|
+ // 消费来源
|
|
|
+ param.setOrderFromType(iotParam.getOrderFromType());
|
|
|
+ // 消息id
|
|
|
+ param.setMqttDataId(iotParam.getMqttDataId());
|
|
|
+ // 消费订单号
|
|
|
+ param.setOrderNo(iotParam.getOrder());
|
|
|
+ // 卡号
|
|
|
+ param.setCardNo(iotParam.getCardNo());
|
|
|
+ // 消费金额
|
|
|
+ param.setAmount(iotParam.getAmount());
|
|
|
+ // 设备deviceId
|
|
|
+ param.setDeviceId(iotParam.getDeviceId());
|
|
|
|
|
|
- expenseFlow.setUserId(iotParam.getUserId());
|
|
|
+ // 定额支付
|
|
|
+ param.setChargeableType(ChargeableType.Specified);
|
|
|
|
|
|
- // 订单产生 类型、方式(订单来源)
|
|
|
- expenseFlow.setOrderFromType(iotParam.getOrderFromType());
|
|
|
- // 订单关联的商品信息
|
|
|
- expenseFlow.setProductProvideId(iotParam.getProductProvideId());
|
|
|
- // 订单计费方式
|
|
|
- expenseFlow.setChargeableType(iotParam.getChargeableType());
|
|
|
+ // 是否可以匿名下单
|
|
|
+ param.setIsAnonymous(Boolean.FALSE);
|
|
|
|
|
|
- expenseFlow.setMqttDataId(iotParam.getMqttDataId());
|
|
|
+ return createOrder(param, expenseFlow);
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultContent<ExpenseFlow> createOrder(CreateOrderParam param, ExpenseFlow expenseFlow) {
|
|
|
+ BeanUtils.copyProperties(param, expenseFlow, "id");
|
|
|
|
|
|
expenseFlow.setTimes();
|
|
|
- // 消费订单号
|
|
|
- expenseFlow.setOrderNo(iotParam.getOrder());
|
|
|
- // 卡片信息
|
|
|
- expenseFlow.setCardNo(iotParam.getCardNo());
|
|
|
// 本地订单号
|
|
|
String paymentNo = NextNoUtil.getNextPaymentNo(null);
|
|
|
// 支付订单号
|
|
|
expenseFlow.setPaymentNo(paymentNo);
|
|
|
+
|
|
|
// 支付金额
|
|
|
- BigDecimal amount = CommonUtil.turnMoney2BigDecimal(iotParam.getAmount());
|
|
|
+ BigDecimal amount = CommonUtil.turnMoney2BigDecimal(param.getAmount());
|
|
|
expenseFlow.setPayAmount(amount);
|
|
|
|
|
|
- expenseFlow.setDeviceId(iotParam.getDeviceId());
|
|
|
-
|
|
|
// 传过来的参数
|
|
|
- expenseFlow.setParam(iotParam);
|
|
|
-
|
|
|
- // 来源设备产品类型
|
|
|
- expenseFlow.setPaymentDeviceType(iotParam.getPaymentDeviceType());
|
|
|
+ expenseFlow.setParam(param);
|
|
|
|
|
|
// 订单支付状态
|
|
|
expenseFlow.setOrderState(OrderState.WAIT_PAYMENT);
|
|
|
@@ -165,48 +186,18 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
// 默认未结算状态
|
|
|
expenseFlow.setSettlementState(SettlementState.Unsettled);
|
|
|
|
|
|
- // 验证参数、填充数据
|
|
|
- commonVerifyExpenseFlow(expenseFlow);
|
|
|
- return ResultContent.buildSuccess(expenseFlow);
|
|
|
- }
|
|
|
-
|
|
|
+ expenseFlow.setStartTime(System.currentTimeMillis());
|
|
|
|
|
|
- /**
|
|
|
- * 订单支付
|
|
|
- *
|
|
|
- * @param entity
|
|
|
- * @return
|
|
|
- */
|
|
|
- public ResultContent<ExpenseFlow> orderPay(ExpenseFlow entity) {
|
|
|
- // 判断参数是否符合要求
|
|
|
- if (entity.getVerifyParamIsSuccess() == null || !entity.getVerifyParamIsSuccess()) {
|
|
|
- // 参数验证失败
|
|
|
- entity.setIsPaySuccess(Boolean.FALSE);
|
|
|
- entity.setPayRemark(entity.getVerifyParamMsg());
|
|
|
- entity.setPaymentStatus("支付失败");
|
|
|
- expenseFlowDao.save(entity);
|
|
|
- return ResultContent.buildSuccess(entity);
|
|
|
+ // 订单支付的有效期
|
|
|
+ Long expirationTime = param.getExpirationTime();
|
|
|
+ if (expirationTime == null || expirationTime <= 0) {
|
|
|
+ expirationTime = OrderConfig.orderExpirationTime;
|
|
|
}
|
|
|
- expenseFlowDao.save(entity);
|
|
|
+ expenseFlow.setExpirationTime(System.currentTimeMillis() + expirationTime);
|
|
|
|
|
|
- if (entity.getMode() != null) {
|
|
|
- if (entity.getMode() == 0) {
|
|
|
- // 支付模式
|
|
|
- entity.setOrderModeType(OrderModeType.Consume);
|
|
|
- // 支付
|
|
|
- payCallService.payOrder(entity);
|
|
|
- } else if (entity.getMode() == 2) {
|
|
|
- // 查询余额模式 因为只有钱包有余额,所以 默认默认为钱包支付渠道
|
|
|
- entity.setOrderModeType(OrderModeType.BalanceInquiry);
|
|
|
- entity.setPaymentStatus("查询余额");
|
|
|
- entity.setPayRemark("查询余额");
|
|
|
- entity.setOrderState(OrderState.PAID_ERROR);
|
|
|
- entity.setIsPaySuccess(Boolean.TRUE);
|
|
|
- entity.setPaymentType(PaymentType.UserWallet);
|
|
|
- expenseFlowDao.save(entity);
|
|
|
- }
|
|
|
- }
|
|
|
- return ResultContent.buildSuccess();
|
|
|
+ // 验证参数、填充数据
|
|
|
+ commonVerifyExpenseFlow(expenseFlow);
|
|
|
+ return ResultContent.buildSuccess(expenseFlow);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -255,47 +246,66 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
return ResultContent.buildSuccess(expenseFlow);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 同意验证 支付订单的数据是否符合要求
|
|
|
*
|
|
|
* @param entity
|
|
|
*/
|
|
|
private void commonVerifyExpenseFlow(ExpenseFlow entity) {
|
|
|
- String deviceId = entity.getDeviceId();
|
|
|
- // 验证设备
|
|
|
- DeviceInfo deviceInfo = deviceInfoDao.findTopByDeviceId(deviceId);
|
|
|
- if (ObjectUtils.isEmpty(deviceInfo)) {
|
|
|
- entity.setVerifyError("业务设备未注册");
|
|
|
- return;
|
|
|
- }
|
|
|
+ String projectOid = entity.getProjectOid();
|
|
|
+ String payType = entity.getPayType();
|
|
|
+ String userId = entity.getUserId();
|
|
|
+
|
|
|
+ // 设备消费模式
|
|
|
+ if (entity.getIsDeviceOrder() != null && entity.getIsDeviceOrder()) {
|
|
|
+ String deviceId = entity.getDeviceId();
|
|
|
+ // 验证设备
|
|
|
+ DeviceInfo deviceInfo = deviceInfoDao.findTopByDeviceId(deviceId);
|
|
|
+ if (ObjectUtils.isEmpty(deviceInfo)) {
|
|
|
+ entity.setVerifyError("业务设备未注册");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 设备已停用
|
|
|
+ if (deviceInfo.getState() != null && deviceInfo.getState() != DeviceState.Enable) {
|
|
|
+ entity.setVerifyError(String.format("设备%s", deviceInfo.getState().getRemark()));
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- // 设备已停用
|
|
|
- if (deviceInfo.getState() != null && deviceInfo.getState() != DeviceState.Enable) {
|
|
|
- entity.setVerifyError(String.format("设备%s", deviceInfo.getState().getRemark()));
|
|
|
- return;
|
|
|
+ // 检查设备是否绑定机构
|
|
|
+ if (StringUtils.isEmpty(deviceInfo.getBeLongOid())) {
|
|
|
+ entity.setVerifyError(String.format("设备未绑定机构"));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 设备所属的商户/机构
|
|
|
+ entity.setShopOid(deviceInfo.getBeLongOid());
|
|
|
+ // 设备区域
|
|
|
+ entity.setArea(areaService.toSimpleModel(deviceInfo.getArea()));
|
|
|
+ // 填充项目信息
|
|
|
+ projectOid = deviceInfo.getProjectOid();
|
|
|
+
|
|
|
+ if (StringUtils.isEmpty(payType) && deviceInfo.getDeviceType() != null) {
|
|
|
+ payType = deviceInfo.getDeviceType().getRemark();
|
|
|
+ }
|
|
|
}
|
|
|
+ entity.setPayType(payType);
|
|
|
|
|
|
- // 检查设备是否绑定机构
|
|
|
- if (StringUtils.isEmpty(deviceInfo.getBeLongOid())) {
|
|
|
- entity.setVerifyError(String.format("设备未绑定机构"));
|
|
|
- return;
|
|
|
- }
|
|
|
- // 设备所属的商户/机构
|
|
|
- entity.setShopOid(deviceInfo.getBeLongOid());
|
|
|
- // 设备区域
|
|
|
- entity.setArea(areaService.toSimpleModel(deviceInfo.getArea()));
|
|
|
- // 填充项目信息
|
|
|
- String projectOid = deviceInfo.getProjectOid();
|
|
|
- Organization projectInfo = organizationDao.findTopByOid(projectOid);
|
|
|
- if (ObjectUtils.isNotEmpty(projectInfo)) {
|
|
|
- entity.setProjectCode(projectInfo.getCode());
|
|
|
- entity.setProjectOid(projectInfo.getOid());
|
|
|
+ // 确定项目信息
|
|
|
+ if (StringUtils.isNotEmpty(projectOid)) {
|
|
|
+ Organization projectInfo = organizationDao.findTopByOid(projectOid);
|
|
|
+ if (ObjectUtils.isNotEmpty(projectInfo)) {
|
|
|
+ entity.setProjectCode(projectInfo.getCode());
|
|
|
+ entity.setProjectOid(projectInfo.getOid());
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
// 验证项目信息
|
|
|
if (StringUtils.isEmpty(entity.getProjectCode())) {
|
|
|
entity.setVerifyError("未绑定项目信息");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ // 刷卡消费
|
|
|
if (entity.getOrderFromType() == OrderFromType.Swipe) {
|
|
|
CardInfo cardInfo = cardInfoDao.findByCode(entity.getCardNo());
|
|
|
// 验证卡片
|
|
|
@@ -304,7 +314,7 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
return;
|
|
|
}
|
|
|
entity.setCardInfo(cardInfo);
|
|
|
- entity.setUserId(cardInfo.getUserId());
|
|
|
+ userId = cardInfo.getUserId();
|
|
|
|
|
|
// 判断卡片是否可用
|
|
|
if (cardInfo.getCardState() != CardState.Enable) {
|
|
|
@@ -316,53 +326,47 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
entity.setVerifyError(String.format("卡片已作废"));
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- ConsumTransactionsModel iotParam = (ConsumTransactionsModel) entity.getParam();
|
|
|
- if ((iotParam.getMode() != 0 || iotParam.getMode() != 2) && iotParam.getPayType() != 0) {
|
|
|
- entity.setVerifyError("消费模式不支持");
|
|
|
- return;
|
|
|
- }
|
|
|
- entity.setMode(iotParam.getMode());
|
|
|
}
|
|
|
|
|
|
- // 验证用户信息
|
|
|
- if (StringUtils.isEmpty(entity.getUserId())) {
|
|
|
- entity.setVerifyError("订单未找到用户");
|
|
|
+ if (entity.getOrderModeType() == null) {
|
|
|
+ entity.setVerifyError("消费模式不支持");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- UserAccount userAccount = userCountDao.findTopByUserId(entity.getUserId());
|
|
|
- if (ObjectUtils.isEmpty(userAccount)) {
|
|
|
- entity.setVerifyError("用户未注册");
|
|
|
- return;
|
|
|
- }
|
|
|
- entity.setUserName(userAccount.getName());
|
|
|
- entity.setUserAccount(userAccount);
|
|
|
+ // 验证用户信息
|
|
|
+ if ((entity.getIsAnonymous() == null || !entity.getIsAnonymous())) {
|
|
|
+ if (StringUtils.isEmpty(userId)) {
|
|
|
+ entity.setVerifyError("订单未找到用户");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ entity.setUserId(userId);
|
|
|
|
|
|
- if (userAccount.getState() == UserState.Locked) {
|
|
|
- entity.setVerifyError("用户已锁定");
|
|
|
- return;
|
|
|
- }
|
|
|
- // 判断设备和用户是否绑定
|
|
|
- DevicePermiss devicePermiss = devicePermissDao.findTopByUserIdAndDeviceIdAndProjectOid(entity.getUserId(), entity.getDeviceId(), entity.getProjectOid());
|
|
|
- if (ObjectUtils.isEmpty(devicePermiss)) {
|
|
|
- entity.setVerifyError("用户没有使用设备权限");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (devicePermiss.getDataState() == null || devicePermiss.getDataState() != DataState.Enable) {
|
|
|
- entity.setVerifyError("用户设备权限未启用");
|
|
|
- return;
|
|
|
- }
|
|
|
- // 消费设备信息
|
|
|
- if (deviceInfo.getDeviceType() != null) {
|
|
|
- entity.setPayType(deviceInfo.getDeviceType().getRemark());
|
|
|
- } else {
|
|
|
- entity.setPayType("消费");
|
|
|
+ UserAccount userAccount = userCountDao.findTopByUserId(entity.getUserId());
|
|
|
+ if (ObjectUtils.isEmpty(userAccount)) {
|
|
|
+ entity.setVerifyError("用户未注册");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ entity.setUserName(userAccount.getName());
|
|
|
+ entity.setUserAccount(userAccount);
|
|
|
+
|
|
|
+ if (userAccount.getState() == UserState.Locked) {
|
|
|
+ entity.setVerifyError("用户已锁定");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (entity.getIsDeviceOrder() != null && entity.getIsDeviceOrder()) {
|
|
|
+ // 判断用户是否有设备使用权限
|
|
|
+ ResultContent<String> verifyDeviceContent = devicePermissVerifyService.verifyDevice(entity.getUserId(), entity.getDeviceId(), null);
|
|
|
+ if (verifyDeviceContent.isFailed()) {
|
|
|
+ entity.setVerifyError(verifyDeviceContent.getMsg());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 金额判断
|
|
|
BigDecimal payAmount = entity.getPayAmount();
|
|
|
- if (entity.getMode() == 0 && CommonUtil.bigDecimalIsEmpty(payAmount)) {
|
|
|
+ if (entity.getOrderModeType() == OrderModeType.Consume && CommonUtil.bigDecimalIsEmpty(payAmount)) {
|
|
|
entity.setVerifyError("消费金额不能小于等于0");
|
|
|
return;
|
|
|
}
|
|
|
@@ -370,6 +374,40 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
entity.setVerifyParamMsg("参数验证成功");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 订单支付
|
|
|
+ *
|
|
|
+ * @param entity
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public ResultContent<ExpenseFlow> orderPay(ExpenseFlow entity) {
|
|
|
+ // 判断参数是否符合要求
|
|
|
+ if (entity.getVerifyParamIsSuccess() == null || !entity.getVerifyParamIsSuccess()) {
|
|
|
+ // 参数验证失败
|
|
|
+ entity.setIsPaySuccess(Boolean.FALSE);
|
|
|
+ entity.setPayRemark(entity.getVerifyParamMsg());
|
|
|
+ entity.setPaymentStatus("支付失败");
|
|
|
+ expenseFlowDao.save(entity);
|
|
|
+ return ResultContent.buildSuccess(entity);
|
|
|
+ }
|
|
|
+ expenseFlowDao.save(entity);
|
|
|
+
|
|
|
+ if (entity.getOrderModeType() == OrderModeType.Consume) {
|
|
|
+ // 支付
|
|
|
+ payCallService.payOrder(entity);
|
|
|
+ } else if (entity.getOrderModeType() == OrderModeType.BalanceInquiry) {
|
|
|
+ // 查询余额模式 因为只有钱包有余额,所以 默认默认为钱包支付渠道
|
|
|
+ entity.setOrderModeType(OrderModeType.BalanceInquiry);
|
|
|
+ entity.setPaymentStatus("查询余额");
|
|
|
+ entity.setPayRemark("查询余额");
|
|
|
+ entity.setOrderState(OrderState.PAID_ERROR);
|
|
|
+ entity.setIsPaySuccess(Boolean.TRUE);
|
|
|
+ entity.setPaymentType(PaymentType.UserWallet);
|
|
|
+ expenseFlowDao.save(entity);
|
|
|
+ }
|
|
|
+ return ResultContent.buildSuccess();
|
|
|
+ }
|
|
|
+
|
|
|
public ExpenseFlow saveInfo(ExpenseFlow entity) {
|
|
|
if (ObjectUtils.isNotEmpty(entity)) {
|
|
|
expenseFlowDao.save(entity);
|
|
|
@@ -781,6 +819,52 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 得到订单支付显示信息
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public ResultContent getOrderPayDetail(String id) {
|
|
|
+ ExpenseFlow entity = expenseFlowDao.findTopById(id);
|
|
|
+ ExpenseFlowPayShowModel model = toPayShowModel(entity);
|
|
|
+ return ResultContent.buildSuccess(model);
|
|
|
+ }
|
|
|
+
|
|
|
+ public ExpenseFlowPayShowModel toPayShowModel(ExpenseFlow entity) {
|
|
|
+ ExpenseFlowPayShowModel model = new ExpenseFlowPayShowModel();
|
|
|
+ if (ObjectUtils.isNotEmpty(entity)) {
|
|
|
+ BeanUtils.copyProperties(entity, model);
|
|
|
+
|
|
|
+ // 设备信息
|
|
|
+ if (StringUtils.isNotEmpty(entity.getDeviceId())) {
|
|
|
+ model.setDeviceInfo(deviceInfoService.getDeviceInfoModel(entity.getDeviceId()));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 收款机构信息
|
|
|
+ ResultContent<OrganizationSimpleModel> orgContent = organizationService.getDetail(entity.getShopOid());
|
|
|
+ if (orgContent.isSuccess()) {
|
|
|
+ model.setShopInfo(orgContent.getContent());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断是否可以支付
|
|
|
+ OrderPayModel payModel = isCanPay(entity);
|
|
|
+ BeanUtils.copyProperties(payModel, model);
|
|
|
+ }
|
|
|
+ return model;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 判断订单是否可以支付
|
|
|
+ *
|
|
|
+ * @param entity
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public OrderPayModel isCanPay(ExpenseFlow entity) {
|
|
|
+ OrderPayModel model = new OrderPayModel();
|
|
|
+
|
|
|
+ return model;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 模型转换
|
|
|
@@ -792,8 +876,6 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
|
|
|
ExpenseFlowModel model = new ExpenseFlowModel();
|
|
|
if (ObjectUtils.isNotEmpty(entity)) {
|
|
|
BeanUtils.copyProperties(entity, model);
|
|
|
- // 卡片信息
|
|
|
- // 用户信息
|
|
|
}
|
|
|
return model;
|
|
|
}
|