|
@@ -35,6 +35,7 @@ import com.fs.his.dto.ExpressInfoDTO;
|
|
import com.fs.his.dto.StoreOrderExpressExportDTO;
|
|
import com.fs.his.dto.StoreOrderExpressExportDTO;
|
|
import com.fs.his.dto.TracesDTO;
|
|
import com.fs.his.dto.TracesDTO;
|
|
import com.fs.his.enums.FsStoreOrderLogEnum;
|
|
import com.fs.his.enums.FsStoreOrderLogEnum;
|
|
|
|
+import com.fs.his.enums.FsStoreOrderStatusEnum;
|
|
import com.fs.his.enums.ShipperCodeEnum;
|
|
import com.fs.his.enums.ShipperCodeEnum;
|
|
import com.fs.his.param.FsFollowMsgParam;
|
|
import com.fs.his.param.FsFollowMsgParam;
|
|
import com.fs.his.param.FsStoreOrderParam;
|
|
import com.fs.his.param.FsStoreOrderParam;
|
|
@@ -420,9 +421,40 @@ public class FsStoreOrderController extends BaseController
|
|
@PutMapping
|
|
@PutMapping
|
|
public AjaxResult edit(@RequestBody FsStoreOrder fsStoreOrder)
|
|
public AjaxResult edit(@RequestBody FsStoreOrder fsStoreOrder)
|
|
{
|
|
{
|
|
|
|
+ AjaxResult error = moneyCheck(fsStoreOrder);
|
|
|
|
+ if (error != null) return error;
|
|
return toAjax(fsStoreOrderService.updateFsStoreOrder(fsStoreOrder));
|
|
return toAjax(fsStoreOrderService.updateFsStoreOrder(fsStoreOrder));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private AjaxResult moneyCheck(FsStoreOrder fsStoreOrder) {
|
|
|
|
+ BigDecimal payRemain = fsStoreOrder.getPayRemain();
|
|
|
|
+ BigDecimal payPrice = fsStoreOrder.getPayPrice();
|
|
|
|
+ if (payRemain != null && payPrice == null){
|
|
|
|
+ return AjaxResult.error("订单应收金额不正确!");
|
|
|
|
+ }
|
|
|
|
+ if (payRemain == null && payPrice != null){
|
|
|
|
+ return AjaxResult.error("订单物流代收金额不正确!");
|
|
|
|
+ }
|
|
|
|
+ if (payRemain != null && payPrice != null){
|
|
|
|
+ FsStoreOrder temp = fsStoreOrderService.selectFsStoreOrderByOrderId(fsStoreOrder.getOrderId());
|
|
|
|
+ if (!((Objects.equals(temp.getStatus(), FsStoreOrderStatusEnum.STATUS_2.getValue())
|
|
|
|
+ || (Objects.equals(temp.getStatus(), FsStoreOrderStatusEnum.STATUS_1.getValue())))
|
|
|
|
+ || (StringUtils.isNotBlank(temp.getExtendOrderId())))
|
|
|
|
+ ){
|
|
|
|
+
|
|
|
|
+ BigDecimal payMoney = temp.getPayMoney();
|
|
|
|
+ if (fsStoreOrder.getPayMoney()!=null){
|
|
|
|
+ fsStoreOrder.setPayMoney(payMoney);
|
|
|
|
+ }
|
|
|
|
+ BigDecimal tempPayPrice = payMoney.add(payRemain);
|
|
|
|
+ if(0 != tempPayPrice.compareTo(fsStoreOrder.getPayPrice())){
|
|
|
|
+ return AjaxResult.error("订单金额不正确!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 修改订单
|
|
* 修改订单
|
|
*/
|
|
*/
|