fix:新功能提交

This commit is contained in:
old burden 2026-04-20 17:14:01 +08:00
parent 7177d7c404
commit 56389e5154
5 changed files with 21 additions and 53 deletions

View File

@ -42,22 +42,10 @@
</a-tabs> </a-tabs>
</div> </div>
</mf-dialog> </mf-dialog>
<Forgot
:visible="forgotVisible"
@open="forgotVisible = true"
@back="back"
@cancel="forgotVisible = false" />
<Register
:visible="registerVisible"
@cancel="registerVisible = false"
@back="backFormRegister"
@open="registerVisible = true" />
</div> </div>
</template> </template>
<script> <script>
import Forgot from './Forgot.vue'
import Register from './Register.vue'
import UserAccount from './UserAccount.vue' import UserAccount from './UserAccount.vue'
import ResumeRecord from './ResumeRecord.vue' import ResumeRecord from './ResumeRecord.vue'
@ -65,9 +53,7 @@ export default {
data() { data() {
return { return {
email: '', email: '',
forgotVisible: false,
emailVisible: false, emailVisible: false,
registerVisible: false,
loading: false, loading: false,
username: '', username: '',
password: '', password: '',
@ -75,22 +61,13 @@ export default {
} }
}, },
props: { props: {
visible: Boolean, visible: Boolean
register: Boolean
}, },
components: { components: {
Forgot,
Register,
UserAccount, UserAccount,
ResumeRecord ResumeRecord
}, },
mounted() { mounted() {
if (this.register) {
this.showRegister()
setTimeout((_) => {
this.$emit('cancel')
}, 300)
}
window.addEventListener('message', (event) => { window.addEventListener('message', (event) => {
if (event.data.type === 'google-login') { if (event.data.type === 'google-login') {
const { token } = event.data const { token } = event.data
@ -104,18 +81,6 @@ export default {
}) })
}, },
methods: { methods: {
showRegister() {
this.registerVisible = true
this.$emit('cancel')
},
back() {
this.forgotVisible = false
this.$emit('open')
},
backFormRegister() {
this.registerVisible = false
this.$emit('open')
},
backEmail() { backEmail() {
this.emailVisible = false this.emailVisible = false
this.$emit('open') this.$emit('open')
@ -148,10 +113,6 @@ export default {
.catch((_) => { .catch((_) => {
this.loading = false this.loading = false
}) })
},
showForgot() {
this.forgotVisible = true
this.$emit('cancel')
} }
} }
} }

View File

@ -73,4 +73,14 @@ public class BalanceChangerConstants {
*/ */
public static final int SYSTEM_OPERATION = 11; public static final int SYSTEM_OPERATION = 11;
/**
* 部门下发积分给用户
*/
public static final int DEPT_SCORE_ISSUE = 12;
/**
* 从用户回收积分到部门
*/
public static final int DEPT_SCORE_RECLAIM = 13;
} }

View File

@ -157,8 +157,6 @@ public class AiChargeRefundOrderServiceImpl implements IAiChargeRefundOrderServi
int type = order.getOrderType().intValue(); int type = order.getOrderType().intValue();
if (type == ChargeRefundOrderType.REFUND.getCode()) { if (type == ChargeRefundOrderType.REFUND.getCode()) {
rechargeScore = order.getAmount().negate(); rechargeScore = order.getAmount().negate();
} else if (type == ChargeRefundOrderType.MANUAL.getCode()) {
rechargeScore = order.getAmount();
} else { } else {
rechargeScore = order.getAmount(); rechargeScore = order.getAmount();
} }

View File

@ -59,19 +59,19 @@ public class DeptChargeRefundServiceImpl implements IDeptChargeRefundService {
// 1) 手工入账订单状态直接为已完成 // 1) 手工入账订单状态直接为已完成
AiChargeRefundOrder order = new AiChargeRefundOrder(); AiChargeRefundOrder order = new AiChargeRefundOrder();
order.setDelFlag("0"); order.setDelFlag("0");
order.setCreateBy(SecurityUtils.getUserId()); order.setCreateBy(SecurityUtils.getUsername());
order.setCreateTime(now); order.setCreateTime(now);
order.setUpdateTime(now); order.setUpdateTime(now);
order.setOrderNum(orderNum); order.setOrderNum(orderNum);
order.setDeptId(request.getDeptId()); order.setDeptId(request.getDeptId());
order.setOrderType(request.getOrderType()); order.setOrderType(Long.valueOf(request.getOrderType()));
// 金额两位小数向零截断非四舍五入避免入账金额被抬高 // 金额两位小数向零截断非四舍五入避免入账金额被抬高
order.setMoney(request.getMoney().setScale(2, RoundingMode.DOWN)); order.setMoney(request.getMoney().setScale(2, RoundingMode.DOWN));
order.setAmount(amountBd); order.setAmount(amountBd);
order.setRemark(request.getRemark()); order.setRemark(request.getRemark());
order.setStatus(ChargeRefundOrderStatusType.SUCCESS.getCode()); order.setStatus(ChargeRefundOrderStatusType.SUCCESS.getCode());
aiChargeRefundOrderService.insert(order); aiChargeRefundOrderService.insertAiChargeRefundOrder(order);
// 2) 原子更新部门积分退款时 rows==0 表示余额不足或部门无效依赖事务回滚撤销上一 INSERT // 2) 原子更新部门积分退款时 rows==0 表示余额不足或部门无效依赖事务回滚撤销上一 INSERT
int rows; int rows;
@ -101,16 +101,16 @@ public class DeptChargeRefundServiceImpl implements IDeptChargeRefundService {
record.setRelationOrderNo(orderNum); record.setRelationOrderNo(orderNum);
record.setDeptId(request.getDeptId()); record.setDeptId(request.getDeptId());
record.setType(orderType == ChargeRefundOrderType.CHARGE record.setType(orderType == ChargeRefundOrderType.CHARGE
? GroupBalanceChangeType.RECHARGE.getCode() ? Long.valueOf(GroupBalanceChangeType.RECHARGE.getCode())
: GroupBalanceChangeType.REFUND.getCode()); : Long.valueOf(GroupBalanceChangeType.REFUND.getCode()));
record.setChangeAmount(signedChange); record.setChangeAmount(signedChange);
record.setResultAmount(dept.getBalance()); record.setResultAmount(dept.getBalance());
record.setRemark(request.getRemark()); record.setRemark(request.getRemark());
record.setCreateBy(SecurityUtils.getUserId()); record.setCreateBy(SecurityUtils.getUsername());
record.setCreateTime(now); record.setCreateTime(now);
record.setUpdateTime(now); record.setUpdateTime(now);
aiGroupBalanceChangeRecordService.insert(record); aiGroupBalanceChangeRecordService.insertAiGroupBalanceChangeRecord(record);
} }
/** 业务单号前缀 + 日序 + 随机后缀,保证与流水 relation_order_no 一致。 */ /** 业务单号前缀 + 日序 + 随机后缀,保证与流水 relation_order_no 一致。 */

View File

@ -19,7 +19,6 @@ import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.request.ai.AiUserDeptScoreRequest; import com.ruoyi.common.core.request.ai.AiUserDeptScoreRequest;
import com.ruoyi.common.enums.GroupBalanceChangeType; import com.ruoyi.common.enums.GroupBalanceChangeType;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysDeptService; import com.ruoyi.system.service.ISysDeptService;
@ -133,12 +132,12 @@ public class DeptUserScoreTransferTxService {
AiGroupBalanceChangeRecord record = new AiGroupBalanceChangeRecord(); AiGroupBalanceChangeRecord record = new AiGroupBalanceChangeRecord();
record.setRelationOrderNo(orderNum); record.setRelationOrderNo(orderNum);
record.setDeptId(deptId); record.setDeptId(deptId);
record.setType(type); record.setType(Long.valueOf(type));
record.setChangeAmount(signedChange); record.setChangeAmount(signedChange);
record.setResultAmount(resultBalance); record.setResultAmount(resultBalance);
record.setRemark(remark); record.setRemark(remark);
record.setCreateBy(SecurityUtils.getUserId()); record.setCreateBy(SecurityUtils.getUsername());
aiGroupBalanceChangeRecordService.insert(record); aiGroupBalanceChangeRecordService.insertAiGroupBalanceChangeRecord(record);
} }
private static String buildOrderNum() { private static String buildOrderNum() {