计算实时通话费用bug

master
wujingtao 2 years ago
parent c52d732ac2
commit 8edca3ca77

@ -282,6 +282,7 @@ public class TelephoneCallServiceImpl implements TelephoneCallService {
telephoneCallStopDTO.setCallId(requestId);
return CommonResponse.createBySuccess(telephoneCallStopDTO);
}
@Override
public CommonResponse<Object> rollCallStop(TelephoneCallStopDTO telephoneCallStopDTO) {
if (rollCallReq.stopReq(telephoneCallStopDTO)) {
@ -289,6 +290,7 @@ public class TelephoneCallServiceImpl implements TelephoneCallService {
}
return CommonResponse.createByError();
}
/**
* ()
*
@ -424,16 +426,19 @@ public class TelephoneCallServiceImpl implements TelephoneCallService {
* @param duration
* @return
*/
private Double dealDuration(int duration) {
private double dealDuration(int duration) {
if (duration <= DefaultNumberConstants.SIXTY) {
return 1.00;
} else {
//余数
int i = duration % 60;
double div = NumberUtil.div(duration, 60);
//整数
int q = duration / 60;
if (i > 0) {
return NumberUtil.add(div, 1);
return NumberUtil.add(q, 1);
} else {
return div;
return q;
}
}
}

Loading…
Cancel
Save