提交 6d73ad04 authored 作者: jacksmith1988's avatar jacksmith1988

//add code

上级 f3e415a8
......@@ -141,12 +141,15 @@ public class MerchantOrder {
private MerchantOrderPayInfo payInfo;
@NotFound(action = NotFoundAction.IGNORE)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "gathering_id", updatable = false, insertable = false, foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT))
private GatheringCode gatheringCode;
// private String gatheringId;
@Column(name = "gathering_id", length = 32)
private String gatheringId;
private String remark;
......@@ -175,12 +178,12 @@ public class MerchantOrder {
setRemark(remark);
}
public void updateReceived(String receivedAccountId, String gatheringCodeStorageId,String gatheringId) {
public void updateReceived(String receivedAccountId, String gatheringCodeStorageId,GatheringCode gatheringCode) {
this.setReceivedAccountId(receivedAccountId);
this.setGatheringCodeStorageId(gatheringCodeStorageId);
this.setOrderState(Constant.商户订单状态_已接单);
this.setReceivedTime(new Date());
this.setGatheringId(gatheringCode.getId());
}
public void customerCancelOrderRefund() {
......
......@@ -489,9 +489,9 @@ public class MerchantOrderService {
//todo this is temporary code 这里要匹配有资源的用户接单
List<UserAccount> userAccounts = userAccountRepo.findAllByAccountTypeAndState(Constant.账号类型_会员, Constant.账号状态_启用).orElseThrow(() -> new BizException(BizError.系统无可用商户));
Collections.shuffle(userAccounts);
this.receiveOrder(userAccounts.get(RandomUtil.randomInt(0, userAccounts.size())).getId(), merchantOrder.getId());
this.receiveOrder(userAccounts.get(0).getId(), merchantOrder.getId());
return MerchantOrderVO.convertFor(merchantOrder);
}
......@@ -546,7 +546,7 @@ public class MerchantOrderService {
if (setting != null && setting.getOrderPayEffectiveDuration() != null) {
orderEffectiveDuration = setting.getOrderPayEffectiveDuration();
}
platformOrder.updateReceived(userAccount.getId(), gatheringCode.getStorageId(), gatheringCode.getId());
platformOrder.updateReceived(userAccount.getId(), gatheringCode.getStorageId(), gatheringCode);
platformOrder.updateRemark(gatheringCode.getBankCode() + "_" + gatheringCode.getBankUsername() + "_" + gatheringCode.getBankAddress());
platformOrder.updateUsefulTime(
DateUtil.offset(platformOrder.getReceivedTime(), DateField.MINUTE, orderEffectiveDuration));
......
......@@ -3,6 +3,7 @@ package me.zohar.runscore.useraccount.service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
......@@ -74,9 +75,6 @@ public class UserAccountService {
/**
* 更新接单状态
*
* @param userAccountId
* @param receiveOrderState
*/
@Transactional
public void updateReceiveOrderState(@NotBlank String userAccountId, @NotBlank String receiveOrderState) {
......@@ -229,7 +227,7 @@ public class UserAccountService {
throw new BizException(BizError.下级账号的返点不能大于上级账号);
}
newUserAccount.setInviterId(inviter.getId());
newUserAccount.setAccountLevel(inviter.getAccountLevel() + 1);
newUserAccount.setAccountLevel(Optional.ofNullable(inviter.getAccountLevel()).orElse(0) + 1);
newUserAccount.setAccountLevelPath(inviter.getAccountLevelPath() + "." + newUserAccount.getId());
}
userAccountRepo.save(newUserAccount);
......@@ -237,8 +235,6 @@ public class UserAccountService {
/**
* 账号注册
*
* @param param
*/
@ParamValid
@Transactional
......
......@@ -208,14 +208,14 @@ var gatheringCodeVM = new Vue({
// return;
// }
// }
if (editGatheringCode.payee == null || editGatheringCode.payee == '') {
/*if (editGatheringCode.payee == null || editGatheringCode.payee == '') {
layer.alert('请选择收款人', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
}*/
if ($('.gathering-code-pic').fileinput('getPreview').content.length != 0 || editGatheringCode.gatheringChannelCode =='bankcard') {
that.addOrUpdateGatheringCodeInner();
......
......@@ -140,14 +140,17 @@
</option>
</select>
</div>
<!--<div class="form-group">
<label> <span> 收款金额:</span>
<div class="custom-control custom-checkbox custom-control-inline" v-on:click="switchGatheringAmountMode">
<div class="form-group">
<label> <span> 单笔最大收款金额:</span>
<!--<div class="custom-control custom-checkbox custom-control-inline" v-on:click="switchGatheringAmountMode">
<input type="checkbox" id="fixedGatheringAmount" class="custom-control-input" v-model="editGatheringCode.fixedGatheringAmount">
<label for="fixedGatheringAmount" class="custom-control-label">固定收款金额</label>
</div>
</label> <input type="number" class="form-control" v-model="editGatheringCode.gatheringAmount" :disabled="!editGatheringCode.fixedGatheringAmount">
</div>-->
</label>
<!--<input type="number" class="form-control" v-model="editGatheringCode.gatheringAmount" :disabled="!editGatheringCode.fixedGatheringAmount">-->
<input type="number" class="form-control" v-model="editGatheringCode.gatheringAmount" >
</div>
<div class="form-group">
<label>收款人:</label> <input type="text" class="form-control"
v-model="editGatheringCode.payee">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
MySQL Backup
Database: runscore
Backup Time: 2021-11-13 10:39:45
*/
SET FOREIGN_KEY_CHECKS=0;
DROP VIEW IF EXISTS `runscore`.`v_merchant_month_statistical`;
DROP VIEW IF EXISTS `runscore`.`v_merchant_today_statistical`;
DROP VIEW IF EXISTS `runscore`.`v_merchant_total_statistical`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_merchant_month_statistical` AS select `po`.`merchant_id` AS `merchant_id`,round(sum(`po`.`gathering_amount`),4) AS `gathering_amount`,count(1) AS `order_num`,round(sum((case when (`po`.`order_state` = '4') then `po`.`gathering_amount` else 0 end)),4) AS `trade_amount`,sum((case when (`po`.`order_state` = '4') then 1 else 0 end)) AS `paid_order_num` from (`merchant_order` `po` left join `merchant` `ua` on((`po`.`merchant_id` = `ua`.`id`))) where ((`po`.`received_account_id` is not null) and (`po`.`submit_time` >= str_to_date(date_format(curdate(),'%Y-%m-01 00:00:00'),'%Y-%m-%d %H:%i:%s')) and (`po`.`submit_time` < (str_to_date(date_format(curdate(),'%Y-%m-01 00:00:00'),'%Y-%m-%d %H:%i:%s') + interval 1 month))) group by `po`.`merchant_id`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_merchant_today_statistical` AS select `po`.`merchant_id` AS `merchant_id`,round(sum(`po`.`gathering_amount`),4) AS `gathering_amount`,count(1) AS `order_num`,round(sum((case when (`po`.`order_state` = '4') then `po`.`gathering_amount` else 0 end)),4) AS `trade_amount`,sum((case when (`po`.`order_state` = '4') then 1 else 0 end)) AS `paid_order_num` from (`merchant_order` `po` left join `merchant` `ua` on((`po`.`merchant_id` = `ua`.`id`))) where ((`po`.`received_account_id` is not null) and (`po`.`received_time` >= str_to_date(date_format(now(),'%Y-%m-%d'),'%Y-%m-%d %H:%i:%s')) and (`po`.`received_time` < (str_to_date(date_format(now(),'%Y-%m-%d'),'%Y-%m-%d %H:%i:%s') + interval 1 day))) group by `po`.`merchant_id`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_merchant_total_statistical` AS select `po`.`merchant_id` AS `merchant_id`,round(sum(`po`.`gathering_amount`),4) AS `gathering_amount`,count(1) AS `order_num`,round(sum((case when (`po`.`order_state` = '4') then `po`.`gathering_amount` else 0 end)),4) AS `trade_amount`,sum((case when (`po`.`order_state` = '4') then 1 else 0 end)) AS `paid_order_num` from (`merchant_order` `po` left join `merchant` `ua` on((`po`.`merchant_id` = `ua`.`id`))) where (`po`.`received_account_id` is not null) group by `po`.`merchant_id`;
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论