解决修改商品条码会导致条码丢失的bug
This commit is contained in:
@@ -96,18 +96,20 @@ public class MaterialExtendService {
|
||||
}
|
||||
}
|
||||
//针对多属性商品要考虑到有条码被删的情况,需要和原来的条码明细进行对比
|
||||
//1.先查询原来的条码列表
|
||||
List<MaterialExtendVo4List> meList = materialExtendMapperEx.getDetailList(materialId);
|
||||
//2.构造新的条码列表map
|
||||
Map<String, String> barCodeMap = new HashMap<>();
|
||||
for (int i = 0; i < meArr.size(); i++) {
|
||||
JSONObject tempJson = meArr.getJSONObject(i);
|
||||
barCodeMap.put(tempJson.getString("barCode"),tempJson.getString("barCode"));
|
||||
}
|
||||
//3.如果老的条码在新的里面不存在,则丢入删除队列
|
||||
for(MaterialExtendVo4List me: meList) {
|
||||
if(barCodeMap.get(me.getBarCode()) == null) {
|
||||
deletedJson.add(me.getId());
|
||||
if(StringUtil.isNotEmpty(obj.getString("manySku"))) {
|
||||
//1.先查询原来的条码列表
|
||||
List<MaterialExtendVo4List> meList = materialExtendMapperEx.getDetailList(materialId);
|
||||
//2.构造新的条码列表map
|
||||
Map<String, String> barCodeMap = new HashMap<>();
|
||||
for (int i = 0; i < meArr.size(); i++) {
|
||||
JSONObject tempJson = meArr.getJSONObject(i);
|
||||
barCodeMap.put(tempJson.getString("barCode"),tempJson.getString("barCode"));
|
||||
}
|
||||
//3.如果老的条码在新的里面不存在,则丢入删除队列
|
||||
for(MaterialExtendVo4List me: meList) {
|
||||
if(barCodeMap.get(me.getBarCode()) == null) {
|
||||
deletedJson.add(me.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user