| | |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * 编码统一生成服务 |
| | | */ |
| | | @Service |
| | | @Transactional(propagation = Propagation.NOT_SUPPORTED) |
| | | public class CodeGeneratorService extends BaseServiceImpl { |
| | | |
| | | |
| | |
| | | } |
| | | //机构 |
| | | if (param.getAgencyId() != null) { |
| | | sql.append(" and left(ware.AGENCY_ID, length(:lengthAgencyId)) = :agencyId"); |
| | | paramts.put("lengthAgencyId", param.getAgencyId()); |
| | | // sql.append(" and left(ware.AGENCY_ID, length(:lengthAgencyId)) = :agencyId"); |
| | | sql.append(" and ware.AGENCY_ID = :agencyId"); |
| | | // paramts.put("lengthAgencyId", param.getAgencyId()); |
| | | paramts.put("agencyId", param.getAgencyId()); |
| | | } |
| | | //仓库类型 |
| | |
| | | } |
| | | //机构 |
| | | if (param.getAgencyId() != null) { |
| | | sql.append(" and left(ware.AGENCY_ID, length(:lengthAgencyId)) = :agencyId"); |
| | | paramts.put("lengthAgencyId", param.getAgencyId()); |
| | | // sql.append(" and left(ware.AGENCY_ID, length(:lengthAgencyId)) = :agencyId"); |
| | | sql.append(" and ware.AGENCY_ID = :agencyId"); |
| | | // paramts.put("lengthAgencyId", param.getAgencyId()); |
| | | paramts.put("agencyId", param.getAgencyId()); |
| | | } |
| | | //仓库类型 |
| | |
| | | List<LWhProcureModel> goodsModelNumList = lWhProcureModelService.getModelByForm(businessEnum, whFormTransferId); |
| | | if (CollectionUtils.isEmpty(goodsModelNumList)) { |
| | | log.error("没有要入库的物品"); |
| | | return null; |
| | | throw new RuntimeException("没有要入库的物品"); |
| | | // return null; |
| | | } |
| | | Long outWarehouseId = lWhFormTransfer.getOutWarehouseId(); |
| | | String outWarehouseName = lWhFormTransfer.getOutWarehouseName(); |
| | |
| | | String nickName = currentUser.getNick_name(); |
| | | // 出库单流水id |
| | | Long outWarehouseFlowId = lWhFormTransfer.getOutWarehouseFlowId(); |
| | | if (outWarehouseFlowId == null){ |
| | | log.error("调拨失败!未找到出库单"); |
| | | return; |
| | | } |
| | | // 入库仓库类型 0机构1部门 |
| | | Integer inWarehouseType = lWhFormTransfer.getInWarehouseType(); |
| | | Long inWarehouseId = lWhFormTransfer.getInWarehouseId(); |
| | |
| | | synchronized (warehouseModelLockObj) { |
| | | // 根据出库流水ID 查询 出库的物品ID |
| | | outGoodsIds = getGoodsidByFlowId(outWarehouseFlowId, oldRecordId); |
| | | if (CollectionUtils.isEmpty(outGoodsIds)){ |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | throw new RuntimeException("入库单失败,未查询到物品!"); |
| | | } |
| | | // 库存物品详情(L_WH_GOODS)中 状态设置为1 |
| | | lWhGoodsService.modGoodsTransfering(outGoodsIds, inWarehouseType, inWarehouseId, inWarehouseName, goodsStatus); |
| | | |
| | |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | //机构 |
| | | if (param.getAgencyId() != null) { |
| | | sqlCangKuWhere.append(" AND left(tenant.id, length(:lengthAgencyId)) = :agencyId"); |
| | | paramts.put("lengthAgencyId", param.getAgencyId()); |
| | | // sqlCangKuWhere.append(" AND left(tenant.id, length(:lengthAgencyId)) = :agencyId"); |
| | | sqlCangKuWhere.append(" AND tenant.id = :agencyId"); |
| | | // paramts.put("lengthAgencyId", param.getAgencyId()); |
| | | paramts.put("agencyId", param.getAgencyId()); |
| | | } |
| | | // 部门 |
| | |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | //机构 |
| | | if (param.getAgencyId() != null) { |
| | | sql.append(" and left(ware.AGENCY_ID, length(:lengthAgencyId)) = :agencyId"); |
| | | paramts.put("lengthAgencyId", param.getAgencyId()); |
| | | // sql.append(" and left(ware.AGENCY_ID, length(:lengthAgencyId)) = :agencyId"); |
| | | sql.append(" and ware.AGENCY_ID = :agencyId"); |
| | | // paramts.put("lengthAgencyId", param.getAgencyId()); |
| | | paramts.put("agencyId", param.getAgencyId()); |
| | | } |
| | | //仓库类型 |