|
@@ -192,6 +192,13 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
if (updateDetails.size()>0) {
|
|
if (updateDetails.size()>0) {
|
|
|
prodIODetailMapper.batchUpdate(updateDetails);
|
|
prodIODetailMapper.batchUpdate(updateDetails);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //检查更新后数据是否
|
|
|
|
|
+ String pu_code = prodInOut.getPi_pucode();
|
|
|
|
|
+ if (!StringUtils.isEmpty(pu_code)){
|
|
|
|
|
+ checkUpdateQty(pu_code,pi_class);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
baseDTO = getBaseDTOById(pi_id,pi_class,pi_inoutno);
|
|
baseDTO = getBaseDTOById(pi_id,pi_class,pi_inoutno);
|
|
|
//计算金额,未税单价,未税金额等
|
|
//计算金额,未税单价,未税金额等
|
|
|
calcProdInout(pi_id,pi_class);
|
|
calcProdInout(pi_id,pi_class);
|
|
@@ -202,6 +209,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
return baseDTO;
|
|
return baseDTO;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public void delete(Long id) {
|
|
public void delete(Long id) {
|
|
@@ -358,6 +366,22 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void checkUpdateQty(String pu_code, String pi_class) {
|
|
|
|
|
+ int count = 0;
|
|
|
|
|
+ if ("采购验收单".equals(pi_class)) {
|
|
|
|
|
+ count = getMapper().checkQtyFromPurchase(pu_code);
|
|
|
|
|
+ if (count>0){
|
|
|
|
|
+ throw new BizException(500, "明细行数量超过来源采购单明细行数量");
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if ("采购验退单".equals(pi_class)) {
|
|
|
|
|
+ count = getMapper().checkQtyFromProdIn(pu_code);
|
|
|
|
|
+ if (count>0){
|
|
|
|
|
+ throw new BizException(500, "明细行数量超过来源采购验收单明细行数量");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
public void updateYqty(ProdInOut prodInOut) {
|
|
public void updateYqty(ProdInOut prodInOut) {
|