Commit ec47b0515a0f47f6ee84f1e1fe21dd336eb29028
1 parent
e699159b
修改入库多仓库报错
Showing
3 changed files
with
9 additions
and
5 deletions
src/main/java/com/huaheng/pc/config/company/service/CompanyServiceImpl.java
... | ... | @@ -100,6 +100,7 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl |
100 | 100 | return AjaxResult.success("更新成功!"); |
101 | 101 | } |
102 | 102 | |
103 | + @Override | |
103 | 104 | public List<Map<String, Object>> getCode(){ |
104 | 105 | LambdaQueryWrapper<Company> lambda = Wrappers.lambdaQuery(); |
105 | 106 | lambda.select(Company::getCode, Company::getId, Company::getName) |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java
... | ... | @@ -85,12 +85,13 @@ public class ReceivingService { |
85 | 85 | @Transactional |
86 | 86 | public Boolean position(ReceiptContainerDetail receiptContainerDetail){ |
87 | 87 | ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(receiptContainerDetail.getReceiptContainerId()); |
88 | - if (!(0 ==receiptContainerHeader.getStatus())){ | |
88 | + if (0 != receiptContainerHeader.getStatus()){ | |
89 | 89 | throw new ServiceException("该入库组盘已生成任务不能重新定位"); |
90 | 90 | } |
91 | 91 | //如果入库组盘表中有目标库位说明已经指定 |
92 | 92 | if (StringUtils.isNotEmpty(receiptContainerHeader.getToLocation())){return true;} |
93 | - String locatingRule = receiptContainerHeader.getLocatingRule(); //定位规则 | |
93 | + //定位规则 | |
94 | + String locatingRule = receiptContainerHeader.getLocatingRule(); | |
94 | 95 | if (StringUtils.isEmpty(locatingRule)){ |
95 | 96 | locatingRule = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId()).getLocatingRule(); |
96 | 97 | //入库单明细定位规则不为空时执行 |
... | ... | @@ -127,12 +128,14 @@ public class ReceivingService { |
127 | 128 | throw new ServiceException("未绑定定位规则"); |
128 | 129 | } |
129 | 130 | LambdaQueryWrapper<FilterConfigDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
130 | - lambdaQueryWrapper.eq(FilterConfigDetail::getCode, locatingRule); | |
131 | + lambdaQueryWrapper.eq(FilterConfigDetail::getWarehouseCode, ShiroUtils.getWarehouseCode()) | |
132 | + .eq(FilterConfigDetail::getCode, locatingRule); | |
131 | 133 | FilterConfigDetail filterConfigDetail = filterConfigDetailService.getOne(lambdaQueryWrapper); |
132 | 134 | |
133 | 135 | //根据定位规则查询库位编码 |
134 | 136 | LambdaQueryWrapper<Location> locationLambda = Wrappers.lambdaQuery(); |
135 | - locationLambda.last(filterConfigDetail.getStatement()); | |
137 | + locationLambda.eq(Location::getWarehouseCode, ShiroUtils.getWarehouseCode()) | |
138 | + .last(filterConfigDetail.getStatement()); | |
136 | 139 | String locationCode = locationService.getOne(locationLambda).getCode(); |
137 | 140 | if (locationCode == null){ |
138 | 141 | throw new ServiceException("没有库位可分配"); |
... | ... |
src/main/resources/mybatis/task/TaskHeaderMapper.xml
... | ... | @@ -47,7 +47,7 @@ |
47 | 47 | <select id="getReceiptTask" resultType="java.util.Map"> |
48 | 48 | SELECT rd.id receiptDetailId,rd.receiptId,td.taskId, td.warehouseCode, td.id taskDetailId, td.status, |
49 | 49 | td.containerCode, td.qty, td.materialCode,rd.totalQty,td.materialSpec, |
50 | - rd.receiptCode,td.inventorySts, | |
50 | + rd.receiptCode,rd.inventorySts, | |
51 | 51 | td.materialName, rd.batch, rd.lot, |
52 | 52 | rd.manufactureDate, rd.expirationDate |
53 | 53 | FROM task_detail td |
... | ... |