Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
ims
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
ims
Commits
c26be54c
提交
c26be54c
authored
8月 22, 2023
作者:
张小凤
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Requirements(update)
上级
94afe77f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
4 行增加
和
118 行删除
+4
-118
RequirementsController.java
...om/mmc/csf/release/controller/RequirementsController.java
+1
-1
RequirementsServiceImpl.java
...mmc/csf/release/service/impl/RequirementsServiceImpl.java
+0
-115
RequirementsDao.xml
...rc/main/resources/mapper/requirements/RequirementsDao.xml
+3
-2
没有找到文件。
release-service/src/main/java/com/mmc/csf/release/controller/RequirementsController.java
浏览文件 @
c26be54c
...
...
@@ -172,7 +172,7 @@ public class RequirementsController extends BaseController {
}
@Api
ModelProperty
(
value
=
"new--小程序————飞手端确认结算"
)
@Api
Operation
(
value
=
"new--小程序————飞手端确认结算"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"confirmSettlement"
)
public
ResultBody
confirmSettlement
(
HttpServletRequest
request
)
{
...
...
release-service/src/main/java/com/mmc/csf/release/service/impl/RequirementsServiceImpl.java
浏览文件 @
c26be54c
...
...
@@ -935,121 +935,6 @@ public class RequirementsServiceImpl implements RequirementsService {
//表示订单计算完成,需要支付的钱都算出来了
walletFlowVO
.
toString
();
System
.
out
.
println
(
walletFlowVO
);
/* orderNumberDTO.setWeChatPay(walletFlowVO.getWeChat());
if (orderNumberDTO.getWeChatPay() != null) {
orderNumberDTO.setPaymentOrderNumber(randomOrderCode());
}*/
// return ResultBody.success(orderNumberDTO);
/* //云享金
BigDecimal cashAmount = requirementsInfoDO.getCashAmount();
//佣金
BigDecimal salaryAmount = requirementsInfoDO.getSalaryAmount();
//微信金额
BigDecimal weChat = requirementsInfoDO.getWeChat();
//需要支付的总金额
BigDecimal totalAmount = requirementsInfoDO.getTotalAmount();
System.out.println(totalAmount);
totalAmount = totalAmount.multiply(new BigDecimal(0.3));
//云享金
BigDecimal cashAmt = payWalletDTO.getCashAmt();
//佣金
BigDecimal salaryAmt = payWalletDTO.getSalaryAmt();
String json = stringRedisTemplate.opsForValue().get(requirementsInfoDO.getWechatPayOrderNumber() + requirementsInfoDO.getUserAccountId());
GetOrderNumberDTO orderNumberDTO = JSONObject.parseObject(json, GetOrderNumberDTO.class);
if (cashAmount.equals(BigDecimal.ZERO) && salaryAmount.equals(BigDecimal.ZERO) && weChat.equals(BigDecimal.ZERO)) {
return ResultBody.error(ResultEnum.PLEASE_SELECT_PAYMENT);
}
if (!cashAmount.equals(BigDecimal.ZERO) && salaryAmount.equals(BigDecimal.ZERO) && weChat.equals(BigDecimal.ZERO)) {
//总金额大于云享金剩余的金额
if (totalAmount.compareTo(cashAmt) == 1) {
return ResultBody.error(ResultEnum.OVER_THE_TOTAL);
}
//总金额小于云享金剩余的金额
if (totalAmount.compareTo(cashAmt) == -1) {
walletFlowVO.setCashAmount(totalAmount);
}
walletFlowVO.setCashAmount(totalAmount.negate());
//冻结云享金
extracted(walletFlowVO, requirementsInfoDO);
}
if (cashAmount.equals(BigDecimal.ZERO) && !salaryAmount.equals(BigDecimal.ZERO) && weChat.equals(BigDecimal.ZERO)) {
//总金额大于佣金剩余的金额
if (totalAmount.compareTo(salaryAmt) == 1) {
return ResultBody.error(ResultEnum.SALARY_PAYMENT_FAILURE);
}
//总金额小于佣金剩余的金额
if (totalAmount.compareTo(salaryAmount) == -1) {
walletFlowVO.setSalaryAmount(totalAmount);
}
walletFlowVO.setSalaryAmount(totalAmount.negate());
extracted(walletFlowVO, requirementsInfoDO);
}
//单独微信制度 可以进行支付
if (cashAmount.equals(BigDecimal.ZERO) && salaryAmount.equals(BigDecimal.ZERO) && !weChat.equals(BigDecimal.ZERO)) {
BigDecimal weChatPay = orderNumberDTO.getWeChatPay().negate();
walletFlowVO.setWeChat(weChatPay);
extracted(walletFlowVO, requirementsInfoDO);
}
//云享金与佣金剩余金额足够及不足够
if (!cashAmount.equals(BigDecimal.ZERO) && !salaryAmount.equals(BigDecimal.ZERO) && weChat.equals(BigDecimal.ZERO)) {
BigDecimal add = cashAmt.add(salaryAmt);
if (totalAmount.compareTo(add) == 1) {
return ResultBody.error(ResultEnum.CASH_SALARY_PAYMENT_FAILURE);
}
//云享金不足佣金可以补上
if (totalAmount.compareTo(add) == -1) {
BigDecimal cash = cashAmt.subtract(totalAmount);
if (cash.compareTo(BigDecimal.ZERO) <= 0) {
BigDecimal salary = salaryAmt.subtract(cash.negate());
System.out.println(salary);
//云享金
walletFlowVO.setCashAmount(cashAmt.negate());
walletFlowVO.setSalaryAmount(cashAmt.negate());
extracted(walletFlowVO, requirementsInfoDO);
}
//云享金足够 不扣除佣金剩余的金额
if (cash.compareTo(BigDecimal.ZERO) > 0) {
walletFlowVO.setCashAmount(cash.negate());
extracted(walletFlowVO, requirementsInfoDO);
}
}
}
//选择佣金或者微信支付
if (cashAmount.equals(BigDecimal.ZERO) && !salaryAmount.equals(BigDecimal.ZERO) && !weChat.equals(BigDecimal.ZERO)) {
BigDecimal salary = salaryAmt.subtract(totalAmount);
if (salary.compareTo(BigDecimal.ZERO) >= 0) {
walletFlowVO.setSalaryAmount(totalAmount);
extracted(walletFlowVO, requirementsInfoDO);
}
if (salary.compareTo(BigDecimal.ZERO) < 0) {
BigDecimal weChatPay = orderNumberDTO.getWeChatPay();
walletFlowVO.setSalaryAmount(salary);
walletFlowVO.setWeChat(weChatPay.negate());
extracted(walletFlowVO, requirementsInfoDO);
}
return ResultBody.success(orderNumberDTO);
}
if (!cashAmount.equals(BigDecimal.ZERO) && !salaryAmount.equals(BigDecimal.ZERO) && !weChat.equals(BigDecimal.ZERO)) {
BigDecimal cash = cashAmt.subtract(totalAmount);
BigDecimal salary = salaryAmt.subtract(cash.negate());
// 如果云享金充足
if (cash.compareTo(BigDecimal.ZERO) >= 0) {
walletFlowVO.setCashAmount(totalAmount);
}
if (cash.compareTo(BigDecimal.ZERO) < 0 && salary.compareTo(BigDecimal.ZERO) >= 0) {
walletFlowVO.setCashAmount(cashAmt.negate());
walletFlowVO.setSalaryAmount(cash);
extracted(walletFlowVO, requirementsInfoDO);
}
if (cash.compareTo(BigDecimal.ZERO) < 0 && salary.compareTo(BigDecimal.ZERO) < 0) {
walletFlowVO.setCashAmount(cashAmt);
walletFlowVO.setSalaryAmount(salaryAmt);
walletFlowVO.setWeChat(orderNumberDTO.getWeChatPay());
}
}*/
RequirementsServiceDO
requirementsServiceDO
=
new
RequirementsServiceDO
(
pilot
,
requirementsInfoDO
);
requirementsServiceDO
.
setCashAmount
(
walletFlowVO
.
getCashAmount
());
requirementsServiceDO
.
setSalaryAmount
(
walletFlowVO
.
getSalaryAmount
());
...
...
release-service/src/main/resources/mapper/requirements/RequirementsDao.xml
浏览文件 @
c26be54c
...
...
@@ -238,7 +238,8 @@
ra.total_amount,
ra.order_amount,
ra.update_order_amount,
ri.insurance
ri.insurance,
ri.publish
FROM requirements_info ri
left join requirements_amount ra
on ra.requirements_info_id = ri.id and ri.user_account_id = ra.user_account_id
...
...
@@ -349,7 +350,7 @@
salary_amount,
wechat_pay_order_number, service_flow_id, preempt_total_amount)
VALUES (#{requirementsInfoId}, #{serviceDictionaryId}, #{pilotCertificationId}, #{pilotCertificationUserId},
#{teamId}, #{teamUserId}, #{cashAmount}, #{weChat}, #{salaryAmount}, #{wechatPayOrderNumber}, 2
00
,
#{teamId}, #{teamUserId}, #{cashAmount}, #{weChat}, #{salaryAmount}, #{wechatPayOrderNumber}, 2,
preemptTotalAmount);
</insert>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论