|
|
@@ -1643,23 +1643,37 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
System.out.println("数量为:"+Double.parseDouble(outgoingReturn.getAmount()));
|
|
|
System.out.println("已发数量为:"+Double.parseDouble(outgoingReturn.getAmountNum()));
|
|
|
System.out.println("取消数量为:"+Double.parseDouble(outgoingReturn.getAmountNumber()));
|
|
|
- ReturRemoval returRemoval = new ReturRemoval()
|
|
|
- .setDocumentId(outgoingReturn.getAskId())//单据id1
|
|
|
- .setRemovalCode(outgoingReturn.getAskId().substring(outgoingReturn.getAskId().length()-6)+outgoingReturn.getEntryNumber())//出库单编号1
|
|
|
- .setSourceType("8")//来源类型1
|
|
|
- .setMoveType(outgoingReturn.getMoveType())//移动类型1
|
|
|
-
|
|
|
- .setMaterialId(outgoingReturn.getMaterialId())//物料id
|
|
|
- .setWbs(outgoingReturn.getWbs())//wbs
|
|
|
- .setNum( String.valueOf(Double.parseDouble(outgoingReturn.getAmount()) - Double.parseDouble(outgoingReturn.getAmountNum()) - Double.parseDouble(outgoingReturn.getAmountNumber())) )//数量-已发数量-取消数量 = 未发数量
|
|
|
- .setEntryNumber(outgoingReturn.getEntryNumber())//分录号
|
|
|
- .setDocumentPointsId(" ")//分录单id
|
|
|
- .setStorageLocationCode(askGoodsMapper.getLocationCode(outgoingReturn.getWarehouse()));//库存编号
|
|
|
+ System.out.println("转化为整数为:"+Double.valueOf(outgoingReturn.getAmount()).intValue());
|
|
|
+ if (Double.valueOf(outgoingReturn.getAmountNum()).intValue() == 0){
|
|
|
+ ReturRemoval returRemoval = new ReturRemoval()
|
|
|
+ .setDocumentId(outgoingReturn.getAskId())//单据id1
|
|
|
+ .setRemovalCode(outgoingReturn.getAskId().substring(outgoingReturn.getAskId().length()-6)+outgoingReturn.getEntryNumber())//出库单编号1
|
|
|
+ .setSourceType("8")//来源类型1
|
|
|
+ .setMoveType(outgoingReturn.getMoveType())//移动类型1
|
|
|
|
|
|
- //添加父表信息
|
|
|
- askGoodsMapper.addReturnGsRemovalF(returRemoval);
|
|
|
- //添加子表信息
|
|
|
- askGoodsMapper.addReturnGsRemoval(returRemoval);
|
|
|
+ .setMaterialId(outgoingReturn.getMaterialId())//物料id
|
|
|
+ .setWbs(outgoingReturn.getWbs())//wbs
|
|
|
+
|
|
|
+ .setEntryNumber(outgoingReturn.getEntryNumber())//分录号
|
|
|
+ .setDocumentPointsId(" ")//分录单id
|
|
|
+ .setStorageLocationCode(askGoodsMapper.getLocationCode(outgoingReturn.getWarehouse()));//库存编号
|
|
|
+ if (Double.valueOf(outgoingReturn.getAmount()).intValue() < 0 ){
|
|
|
+ returRemoval.setNum( String.valueOf( Double.parseDouble(outgoingReturn.getAmount())));
|
|
|
+ }else {
|
|
|
+ returRemoval.setNum( String.valueOf(Double.parseDouble(outgoingReturn.getAmount()) - Double.parseDouble(outgoingReturn.getAmountNum()) - Double.parseDouble(outgoingReturn.getAmountNumber())) );//数量-已发数量-取消数量 = 未发数量
|
|
|
+ }
|
|
|
+
|
|
|
+ if (Double.valueOf(returRemoval.getNum()).intValue() == 0){
|
|
|
+ System.out.println("不能添加:"+Double.valueOf(returRemoval.getNum()).intValue());
|
|
|
+ }else {
|
|
|
+ //添加父表信息
|
|
|
+ askGoodsMapper.addReturnGsRemovalF(returRemoval);
|
|
|
+ //添加子表信息
|
|
|
+ askGoodsMapper.addReturnGsRemoval(returRemoval);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //删除
|
|
|
+ askGoodsMapper.DelOutgoingReturnList(outgoingReturn);
|
|
|
}
|
|
|
}
|
|
|
|