Commit b0efb821705f1340fed5349e5d1d511ce338e689
1 parent
c3e3b11f
库存汇总页面子单,货主修复
Showing
3 changed files
with
24 additions
and
14 deletions
src/main/java/com/huaheng/pc/inventory/InventoryMaterialSummary/controller/InventoryMaterialSummaryController.java
... | ... | @@ -70,22 +70,24 @@ public class InventoryMaterialSummaryController extends BaseController { |
70 | 70 | lambdaQueryWrapper.ge( |
71 | 71 | StringUtils.isNotEmpty(createdBegin), InventoryMaterialSummary::getCreated, createdBegin) |
72 | 72 | .le(StringUtils.isNotEmpty(createdEnd), InventoryMaterialSummary::getCreated, createdEnd)//创建时间范围 |
73 | - //货主 | |
74 | - .in(InventoryMaterialSummary::getCompanyCode, ShiroUtils.getCompanyCodeList()) | |
75 | 73 | //仓库 |
76 | 74 | .eq(InventoryMaterialSummary::getWarehouseCode, ShiroUtils.getWarehouseCode()) |
77 | 75 | //物料编码 |
78 | 76 | .eq(StringUtils.isNotEmpty(inventoryMaterialSummary.getMaterialCode()), InventoryMaterialSummary::getMaterialCode, inventoryMaterialSummary.getMaterialCode()) |
79 | 77 | //物料名称 |
80 | - .eq(StringUtils.isNotEmpty(inventoryMaterialSummary.getMaterialName()), InventoryMaterialSummary::getMaterialName, inventoryMaterialSummary.getMaterialName()); | |
81 | - //.orderByAsc(InventoryMaterialSummary::getMaterialCode); | |
78 | + .eq(StringUtils.isNotEmpty(inventoryMaterialSummary.getMaterialName()), InventoryMaterialSummary::getMaterialName, inventoryMaterialSummary.getMaterialName()) | |
79 | + //货主 | |
80 | + .in(StringUtils.isEmpty(inventoryMaterialSummary.getCompanyCode()),InventoryMaterialSummary::getCompanyCode, ShiroUtils.getCompanyCodeList()) | |
81 | + .eq(!StringUtils.isEmpty(inventoryMaterialSummary.getCompanyCode()),InventoryMaterialSummary::getCompanyCode,inventoryMaterialSummary.getCompanyCode()); | |
82 | + //.orderByAsc(InventoryMaterialSummary::getMaterialCode); | |
82 | 83 | |
83 | 84 | List<InventoryMaterialSummary> list = inventoryMaterialSummaryService.list(lambdaQueryWrapper); |
85 | + if (list == null) { | |
86 | + list = Collections.emptyList(); | |
87 | + } | |
84 | 88 | //筛选库存汇总数据的专用方法 |
85 | 89 | List<InventoryMaterialSummary> details = inventoryMaterialSummaryService.duplicateRemoval(list); |
86 | - if (details == null) { | |
87 | - details = Collections.emptyList(); | |
88 | - } | |
90 | + | |
89 | 91 | return details; |
90 | 92 | |
91 | 93 | |
... | ... | @@ -104,7 +106,10 @@ public class InventoryMaterialSummaryController extends BaseController { |
104 | 106 | //仓库 |
105 | 107 | .eq(InventoryMaterialSummary::getWarehouseCode, ShiroUtils.getWarehouseCode()) |
106 | 108 | //物料编码 |
107 | - .eq(InventoryMaterialSummary::getMaterialCode, inventoryMaterialSummaryChild.getMaterialCode()); | |
109 | + .eq(InventoryMaterialSummary::getMaterialCode, inventoryMaterialSummaryChild.getMaterialCode()) | |
110 | + //货主 | |
111 | + .eq(!StringUtils.isEmpty(inventoryMaterialSummaryChild.getCompanyCode()),InventoryMaterialSummary::getCompanyCode,inventoryMaterialSummaryChild.getCompanyCode()) | |
112 | + .in(StringUtils.isEmpty(inventoryMaterialSummaryChild.getCompanyCode()),InventoryMaterialSummary::getCompanyCode, ShiroUtils.getCompanyCodeList()); | |
108 | 113 | //.orderByDesc(InventoryMaterialSummary::getId); |
109 | 114 | |
110 | 115 | List<InventoryMaterialSummary> list = inventoryMaterialSummaryService.list(lambdaQueryWrapper); |
... | ... |
src/main/java/com/huaheng/pc/inventory/InventoryMaterialSummary/service/InventoryMaterialSummaryServiceImpl.java
... | ... | @@ -23,8 +23,10 @@ public class InventoryMaterialSummaryServiceImpl extends ServiceImpl<InventoryMa |
23 | 23 | * */ |
24 | 24 | @Override |
25 | 25 | public List<InventoryMaterialSummary> inventoryMaterialSummarySelect(List<InventoryMaterialSummary> inventoryMaterialSummaryList) { |
26 | + if(inventoryMaterialSummaryList.size() < 1){ | |
27 | + return inventoryMaterialSummaryList; | |
28 | + } | |
26 | 29 | /*以物料为条件把同物料数量全部相加,去重再展示*/ |
27 | - | |
28 | 30 | //单物料条件, |
29 | 31 | HashMap<String, InventoryMaterialSummary> map = new HashMap<String, InventoryMaterialSummary>(); |
30 | 32 | for (InventoryMaterialSummary bean : inventoryMaterialSummaryList) { |
... | ... | @@ -48,7 +50,9 @@ public class InventoryMaterialSummaryServiceImpl extends ServiceImpl<InventoryMa |
48 | 50 | * */ |
49 | 51 | @Override |
50 | 52 | public List<InventoryMaterialSummary> duplicateRemoval(List<InventoryMaterialSummary> inventoryMaterialSummaryList){ |
51 | - /*********/ | |
53 | + if(inventoryMaterialSummaryList.size() < 1){ | |
54 | + return inventoryMaterialSummaryList; | |
55 | + } | |
52 | 56 | //先找货主和物料码相同的物料SKU相加得总数 |
53 | 57 | for(InventoryMaterialSummary o:inventoryMaterialSummaryList){ |
54 | 58 | BigDecimal numQty = BigDecimal.ZERO; |
... | ... |
src/main/resources/templates/inventory/inventoryMaterialSummary/inventoryMaterialSummary.html
... | ... | @@ -147,7 +147,7 @@ |
147 | 147 | //传值 |
148 | 148 | warehouseCode : $('#warehouseCode').val(), |
149 | 149 | materialCode: row.materialCode, |
150 | - //materialName: row.materialName, | |
150 | + companyCode: row.companyCode, | |
151 | 151 | }, |
152 | 152 | columns: [ |
153 | 153 | { |
... | ... | @@ -177,7 +177,7 @@ |
177 | 177 | { |
178 | 178 | field: 'materialCode', |
179 | 179 | title: '物料编码', |
180 | - width: 150 | |
180 | + width: 120 | |
181 | 181 | }, |
182 | 182 | { |
183 | 183 | field: 'materialName', |
... | ... | @@ -192,7 +192,7 @@ |
192 | 192 | { |
193 | 193 | field: 'qty', |
194 | 194 | title: '库存数量', |
195 | - width: 80 | |
195 | + width: 70 | |
196 | 196 | }, |
197 | 197 | { |
198 | 198 | field: 'materialUnit', |
... | ... | @@ -222,7 +222,8 @@ |
222 | 222 | { |
223 | 223 | field: 'receiptCode', |
224 | 224 | title: '入库单编码', |
225 | - visible: true | |
225 | + visible: true, | |
226 | + width: 140 | |
226 | 227 | }, |
227 | 228 | { |
228 | 229 | field: 'created', |
... | ... |