Commit b0efb821705f1340fed5349e5d1d511ce338e689

Authored by xqs
1 parent c3e3b11f

库存汇总页面子单,货主修复

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