|
@@ -44,6 +44,8 @@ import org.springframework.stereotype.Service;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.net.URLEncoder;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
@@ -376,14 +378,22 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
|
|
|
orderTarget.setStatus(String.valueOf(status));
|
|
|
}
|
|
|
|
|
|
+ BigDecimal price = order.getPrice();
|
|
|
if (order.getAgencyProportion() != null) {
|
|
|
- orderTarget.setAgencyProportion(String.valueOf(order.getAgencyProportion()));
|
|
|
+
|
|
|
+ BigDecimal selfAmount = price.multiply(order.getAgencyProportion().divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_DOWN);
|
|
|
+ orderTarget.setAgencyProportion(selfAmount.toString());
|
|
|
+// orderTarget.setAgencyProportion(String.valueOf(order.getAgencyProportion()));
|
|
|
}
|
|
|
if (order.getMerchantProportion() != null) {
|
|
|
- orderTarget.setMerchantProportion(String.valueOf(order.getMerchantProportion()));
|
|
|
+ BigDecimal merchantAmount = price.multiply(order.getMerchantProportion().divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_DOWN);
|
|
|
+ orderTarget.setMerchantProportion(merchantAmount.toString());
|
|
|
+// orderTarget.setMerchantProportion(String.valueOf(order.getMerchantProportion()));
|
|
|
}
|
|
|
if (order.getPersonageProportion() != null) {
|
|
|
- orderTarget.setPersonageProportion(String.valueOf(order.getPersonageProportion()));
|
|
|
+ BigDecimal personageAmount = price.multiply(order.getPersonageProportion().divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_DOWN);
|
|
|
+ orderTarget.setPersonageProportion(personageAmount.toString());
|
|
|
+// orderTarget.setPersonageProportion(String.valueOf(order.getPersonageProportion()));
|
|
|
}
|
|
|
|
|
|
if ("WEIXIN_NATIVE".equals(order.getFrpCode())) {
|