|
@ -32,6 +32,7 @@ import io.swagger.v3.oas.annotations.Parameter; |
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.validation.annotation.Validated; |
|
|
import org.springframework.validation.annotation.Validated; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
@ -158,6 +159,7 @@ public class PurchasePlanDetailController { |
|
|
vo.setCreator(userApi.getUserNickname(vo.getCreator())); |
|
|
vo.setCreator(userApi.getUserNickname(vo.getCreator())); |
|
|
vo.setUpdater(userApi.getUserNickname(vo.getUpdater())); |
|
|
vo.setUpdater(userApi.getUserNickname(vo.getUpdater())); |
|
|
PurchasePlanMainDO purchasePlanMainDO = mainMap.get(vo.getMasterId()); |
|
|
PurchasePlanMainDO purchasePlanMainDO = mainMap.get(vo.getMasterId()); |
|
|
|
|
|
BigDecimal receivedQty = BigDecimal.ZERO; |
|
|
if(purchasePlanMainDO != null){ |
|
|
if(purchasePlanMainDO != null){ |
|
|
purchasePlanMainDO.setId(null); |
|
|
purchasePlanMainDO.setId(null); |
|
|
purchasePlanMainDO.setCreator(null); |
|
|
purchasePlanMainDO.setCreator(null); |
|
@ -167,8 +169,14 @@ public class PurchasePlanDetailController { |
|
|
purchasePlanMainDO.setRemark(null); |
|
|
purchasePlanMainDO.setRemark(null); |
|
|
purchasePlanMainDO.setAvailable(null); |
|
|
purchasePlanMainDO.setAvailable(null); |
|
|
BeanUtil.copyProperties(purchasePlanMainDO,vo,options); |
|
|
BeanUtil.copyProperties(purchasePlanMainDO,vo,options); |
|
|
|
|
|
// 更新已经收货数量
|
|
|
|
|
|
BigDecimal purchaseReceiveQty = purchasePlanDetailService.updatePurchaseReceiveQty(purchasePlanMainDO.getNumber(),vo.getPoNumber(),vo.getPoLine(),vo.getItemCode()); |
|
|
|
|
|
if(purchaseReceiveQty.compareTo(BigDecimal.ZERO) > 0){ |
|
|
|
|
|
receivedQty = purchaseReceiveQty; |
|
|
|
|
|
}else { |
|
|
|
|
|
receivedQty = vo.getReceivedQty()==null?BigDecimal.ZERO:vo.getReceivedQty();//已收货数量
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
BigDecimal receivedQty = vo.getReceivedQty()==null?BigDecimal.ZERO:vo.getReceivedQty();//已收货数量
|
|
|
|
|
|
BigDecimal shippedQty = vo.getShippedQty()==null?BigDecimal.ZERO:vo.getShippedQty();//已发货数量
|
|
|
BigDecimal shippedQty = vo.getShippedQty()==null?BigDecimal.ZERO:vo.getShippedQty();//已发货数量
|
|
|
vo.setNotReceiveQty(shippedQty.subtract(receivedQty));//在途数量
|
|
|
vo.setNotReceiveQty(shippedQty.subtract(receivedQty));//在途数量
|
|
|
PurchaseMainDO purchaseMainDO1 = purchaseMainMapper.selectByNumber(vo.getPoNumber()); |
|
|
PurchaseMainDO purchaseMainDO1 = purchaseMainMapper.selectByNumber(vo.getPoNumber()); |
|
@ -194,6 +202,7 @@ public class PurchasePlanDetailController { |
|
|
return success(result); |
|
|
return success(result); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/senior") |
|
|
@PostMapping("/senior") |
|
|
@Operation(summary = "高级搜索获得要货计划子信息分页") |
|
|
@Operation(summary = "高级搜索获得要货计划子信息分页") |
|
|
public CommonResult<PageResult<PurchasePlanDetailRespVO>> getPurchasePlanDetailSenior(@Valid @RequestBody CustomConditions conditions) { |
|
|
public CommonResult<PageResult<PurchasePlanDetailRespVO>> getPurchasePlanDetailSenior(@Valid @RequestBody CustomConditions conditions) { |
|
@ -288,6 +297,7 @@ public class PurchasePlanDetailController { |
|
|
vo.setCreator(userApi.getUserNickname(vo.getCreator())); |
|
|
vo.setCreator(userApi.getUserNickname(vo.getCreator())); |
|
|
vo.setUpdater(userApi.getUserNickname(vo.getUpdater())); |
|
|
vo.setUpdater(userApi.getUserNickname(vo.getUpdater())); |
|
|
PurchasePlanMainDO purchasePlanMainDO = mainMap.get(vo.getMasterId()); |
|
|
PurchasePlanMainDO purchasePlanMainDO = mainMap.get(vo.getMasterId()); |
|
|
|
|
|
BigDecimal receivedQty = BigDecimal.ZERO; |
|
|
if(purchasePlanMainDO != null){ |
|
|
if(purchasePlanMainDO != null){ |
|
|
purchasePlanMainDO.setId(null); |
|
|
purchasePlanMainDO.setId(null); |
|
|
purchasePlanMainDO.setCreator(null); |
|
|
purchasePlanMainDO.setCreator(null); |
|
@ -296,8 +306,15 @@ public class PurchasePlanDetailController { |
|
|
purchasePlanMainDO.setUpdater(null); |
|
|
purchasePlanMainDO.setUpdater(null); |
|
|
purchasePlanMainDO.setRemark(null); |
|
|
purchasePlanMainDO.setRemark(null); |
|
|
BeanUtil.copyProperties(purchasePlanMainDO,vo,options); |
|
|
BeanUtil.copyProperties(purchasePlanMainDO,vo,options); |
|
|
|
|
|
// 更新已经收货数量
|
|
|
|
|
|
BigDecimal purchaseReceiveQty = purchasePlanDetailService.updatePurchaseReceiveQty(purchasePlanMainDO.getNumber(),vo.getPoNumber(),vo.getPoLine(),vo.getItemCode()); |
|
|
|
|
|
if(purchaseReceiveQty.compareTo(BigDecimal.ZERO) > 0){ |
|
|
|
|
|
receivedQty = purchaseReceiveQty; |
|
|
|
|
|
}else { |
|
|
|
|
|
receivedQty = vo.getReceivedQty()==null?BigDecimal.ZERO:vo.getReceivedQty();//已收货数量
|
|
|
} |
|
|
} |
|
|
BigDecimal receivedQty = vo.getReceivedQty()==null?BigDecimal.ZERO:vo.getReceivedQty();//已收货数量
|
|
|
} |
|
|
|
|
|
// BigDecimal receivedQty = vo.getReceivedQty()==null?BigDecimal.ZERO:vo.getReceivedQty();//已收货数量
|
|
|
BigDecimal shippedQty = vo.getShippedQty()==null?BigDecimal.ZERO:vo.getShippedQty();//已发货数量
|
|
|
BigDecimal shippedQty = vo.getShippedQty()==null?BigDecimal.ZERO:vo.getShippedQty();//已发货数量
|
|
|
vo.setNotReceiveQty(shippedQty.subtract(receivedQty));//在途数量
|
|
|
vo.setNotReceiveQty(shippedQty.subtract(receivedQty));//在途数量
|
|
|
PurchaseMainDO purchaseMainDO1 = purchaseMainMapper.selectByNumber(vo.getPoNumber()); |
|
|
PurchaseMainDO purchaseMainDO1 = purchaseMainMapper.selectByNumber(vo.getPoNumber()); |
|
@ -318,6 +335,8 @@ public class PurchasePlanDetailController { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
// 已收数量,在途数量 更新
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return success(result); |
|
|
return success(result); |
|
|