修改提成计算
This commit is contained in:
parent
330f583adb
commit
72ebb5580c
ruoyi-admin/src/main/java/com/ruoyi/web/controller/custom
ruoyi-custom/src/main/resources/mapper/custom
@ -121,19 +121,21 @@ public class SysCommisionController extends BaseController {
|
||||
tmpQueryCom.setUserId(detail.getUserId());
|
||||
List<SysCommision> tmpComList = sysCommisionService.selectSysCommisionList(tmpQueryCom);
|
||||
|
||||
float dAmount = detail.getAmount().floatValue();
|
||||
for (int i = 0; i < tmpComList.size(); i++) {
|
||||
SysCommision com = tmpComList.get(i);
|
||||
float dAmount = detail.getAmount().floatValue();
|
||||
float cAmount = com.getAmount().floatValue();
|
||||
detail.setRate(com.getRate());
|
||||
if (dAmount < cAmount && i == 0) {
|
||||
if (dAmount <= cAmount && i == 0) {
|
||||
// 第一条规则
|
||||
detail.setRate(com.getRate());
|
||||
break;
|
||||
} else if (i == tmpComList.size() - 1 && dAmount > cAmount) {
|
||||
} else if (i == tmpComList.size() - 1 && dAmount >= cAmount) {
|
||||
// 最后一条规则
|
||||
detail.setRate(com.getRate());
|
||||
break;
|
||||
} else if (dAmount >= cAmount && dAmount < tmpComList.get(i + 1).getAmount().floatValue()) {
|
||||
} else if (cAmount < dAmount && dAmount <= tmpComList.get(i + 1).getAmount().floatValue()) {
|
||||
// 中间规则
|
||||
detail.setRate(tmpComList.get(i + 1).getRate());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -82,6 +82,12 @@
|
||||
<property name="beginTime" value="#{beginTime}"/>
|
||||
<property name="endTime" value="#{endTime}"/>
|
||||
</include>
|
||||
UNION
|
||||
<include refid="groupAmountVo">
|
||||
<property name="column" value="planner_assis_id"/>
|
||||
<property name="beginTime" value="#{beginTime}"/>
|
||||
<property name="endTime" value="#{endTime}"/>
|
||||
</include>
|
||||
) AS a USING(user_id)
|
||||
<where>
|
||||
<if test="postId != null and postId != ''">and post_id = #{postId}</if>
|
||||
|
Loading…
x
Reference in New Issue
Block a user