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