冻结退款金额
parent
b5ba949b38
commit
4e07bb9cfe
|
|
@ -279,4 +279,10 @@ public class OrderclusterController extends BaseController {
|
|||
|
||||
renderJson(OrderclusterSyncService.me.forwardTemp(ordercluster_id, new BigDecimal(total_weight), cutoff_time, trucks, tokenuser));
|
||||
}
|
||||
|
||||
public void getMaximumConfiguration(){
|
||||
String unit_price = get("unit_price");
|
||||
int customer_id=getInt("customer_id");
|
||||
renderJson(OrderclusterSyncService.me.getMaximumConfiguration(customer_id, unit_price));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import com.cowr.ssjygl.customer.supermarketproduct.CustomerSupermarketProductSer
|
|||
import com.cowr.ssjygl.modifylog.ModifyLogService;
|
||||
import com.cowr.ssjygl.order.ordercluster.OrderclusterService;
|
||||
import com.cowr.ssjygl.prepay.prepaycustomer.PrepayCustomerService;
|
||||
import com.cowr.ssjygl.prepay.refunddetail.RefundDetailService;
|
||||
import com.cowr.ssjygl.supermarket.product.SupermarketProductService;
|
||||
import com.cowr.ssjygl.supermarket.receiverdistance.SupermarketReceiverDistanceService;
|
||||
import com.jfinal.kit.StrKit;
|
||||
|
|
@ -1309,4 +1310,27 @@ public class OrderclusterSyncService extends BaseSyncService {
|
|||
|
||||
return ret ? Result.success() : Result.failed("操作失败");
|
||||
}
|
||||
|
||||
/**
|
||||
*获取最大可购买重量
|
||||
* @param customer_id 客户ID
|
||||
* @param unit_price 单价
|
||||
* @return
|
||||
*/
|
||||
public Map getMaximumConfiguration( int customer_id,String unit_price){
|
||||
Map result=new HashMap();
|
||||
Integer count = Db.queryInt("select count(distinct s.name) from ordercluster t \n" +
|
||||
" left join supermarket s on s.id = t.supermarket_id \n" +
|
||||
" where t.customer_id =?", customer_id);
|
||||
result.put("count",count);
|
||||
//当前用户如果只在一个沙场里面买沙,就计算最大可购买重量
|
||||
if(count<=1){
|
||||
PrepayCustomer prepayCustomer = PrepayCustomerService.me.getPrepayCustomer(customer_id);
|
||||
BigDecimal availableBalance = RefundDetailService.me.getAvailableBalance(prepayCustomer.getCustomerId(), prepayCustomer.getSurplus());
|
||||
BigDecimal maximumConfiguration=availableBalance.divide(new BigDecimal(unit_price),2,BigDecimal.ROUND_HALF_UP);
|
||||
result.put("maximumConfiguration",maximumConfiguration);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue