| | |
| | | import com.java110.intf.store.*; |
| | | import com.java110.po.allocationStorehouseApply.AllocationStorehouseApplyPo; |
| | | import com.java110.po.purchase.ResourceStorePo; |
| | | import com.java110.po.resourceStoreTimes.ResourceStoreTimesPo; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | |
| | | resourceStoreDtos = resourceStoreInnerServiceSMOImpl.queryResourceStores(resourceStoreDto); |
| | | Assert.listOnlyOne(resourceStoreDtos, "原仓库记录不存在"); |
| | | resourceStorePo = BeanConvertUtil.covertBean(allocationStorehouseDto, resourceStorePo); |
| | | resourceStorePo.setResId(resourceStoreDtos.get(0).getResId()); |
| | | resourceStorePo.setResId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_resId)); |
| | | resourceStorePo.setStock(allocationStorehouseDto.getStock()); |
| | | //获取最小计量单位数量 |
| | | if (StringUtil.isEmpty(resourceStoreDtos.get(0).getMiniUnitStock())) { |
| | |
| | | resourceStorePo.setRssId(resourceStoreDtos.get(0).getRssId()); |
| | | resourceStorePo.setMiniUnitCode(resourceStoreDtos.get(0).getMiniUnitCode()); |
| | | resourceStorePo.setMiniUnitStock(resourceStoreDtos.get(0).getMiniUnitStock()); |
| | | flag = resourceStoreV1InnerServiceSMOImpl.updateResourceStore(resourceStorePo); |
| | | flag = resourceStoreV1InnerServiceSMOImpl.saveResourceStore(resourceStorePo); |
| | | if (flag < 1) { |
| | | throw new CmdException("修改失败"); |
| | | throw new CmdException("添加失败"); |
| | | } |
| | | } |
| | | } |