|
|
|
@ -254,7 +254,7 @@ public class MaterialController { |
|
|
|
}*/ |
|
|
|
if (!"".equals(mname)) { |
|
|
|
// 如果是出入库
|
|
|
|
list = materialService.InitTreeForSelectName(mname.split(",")[0], type,map); |
|
|
|
list = materialService.InitTreeForSelectName(mname.split(",")[0], type, map); |
|
|
|
} else { |
|
|
|
list = materialService.InitTreeMenus_Test(); |
|
|
|
} |
|
|
|
@ -262,7 +262,6 @@ public class MaterialController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 根据id获取物料 |
|
|
|
* |
|
|
|
@ -295,7 +294,7 @@ public class MaterialController { |
|
|
|
List<InventoryP> inventory = materialService.findInventory(param); |
|
|
|
Map<String, Object> paramByBarcode = new HashMap<>(); |
|
|
|
paramByBarcode.put("mcode", mcode); |
|
|
|
paramByBarcode.put("codeFlag",1); |
|
|
|
paramByBarcode.put("codeFlag", 1); |
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(paramByBarcode); |
|
|
|
if (inventory.size() > 0) { |
|
|
|
InventoryP materialP = inventory.get(0); |
|
|
|
@ -341,7 +340,7 @@ public class MaterialController { |
|
|
|
param.put("code", inventory.getCode()); |
|
|
|
Map<String, Object> paramByBarcode = new HashMap<>(); |
|
|
|
paramByBarcode.put("mcode", inventory.getCode()); |
|
|
|
paramByBarcode.put("codeFlag",1); |
|
|
|
paramByBarcode.put("codeFlag", 1); |
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(paramByBarcode); |
|
|
|
inventory.setMaterialAndBarCodeList(materialByBarCodeByCondition); |
|
|
|
MaterialAndPlace placeAndMaterialByMidAndPid = placeService.findPlaceAndMaterialByMidAndPid(ObjectFormatUtil.toInteger(pid), inventory.getId()); |
|
|
|
@ -414,7 +413,7 @@ public class MaterialController { |
|
|
|
} |
|
|
|
paramByPrice.put("mcode", ip.getCode()); |
|
|
|
// 获取条形码与物料对应关系
|
|
|
|
paramByPrice.put("codeFlag",1); |
|
|
|
paramByPrice.put("codeFlag", 1); |
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(paramByPrice); |
|
|
|
ip.setMaterialAndBarCodeList(materialByBarCodeByCondition); |
|
|
|
List<SplitInfo> splitInfoByMid = splitUnitService.findSplitInfoByMid(ip.getMid()); |
|
|
|
@ -430,7 +429,7 @@ public class MaterialController { |
|
|
|
paramByPrice.put("mcode", mp.getCode()); |
|
|
|
paramByPrice.remove("code"); |
|
|
|
// 获取条形码与物料对应关系
|
|
|
|
paramByPrice.put("codeFlag",1); |
|
|
|
paramByPrice.put("codeFlag", 1); |
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(paramByPrice); |
|
|
|
mp.setMaterialAndBarCodeList(materialByBarCodeByCondition); |
|
|
|
} |
|
|
|
@ -470,7 +469,7 @@ public class MaterialController { |
|
|
|
List<SplitInfo> splitInfoByMid = splitUnitService.findSplitInfoByMid(inventoryP.getMid()); |
|
|
|
inventoryP.setSplitInfoList(splitInfoByMid); |
|
|
|
paramByBarcode.put("mcode", inventoryP.getCode()); |
|
|
|
paramByBarcode.put("codeFlag",1); |
|
|
|
paramByBarcode.put("codeFlag", 1); |
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(paramByBarcode); |
|
|
|
inventoryP.setMaterialAndBarCodeList(materialByBarCodeByCondition); |
|
|
|
List<PlaceP> placeList = new ArrayList<>(); |
|
|
|
@ -651,7 +650,7 @@ public class MaterialController { |
|
|
|
|
|
|
|
if (placeAndMaterialByMidAndPid != null) { |
|
|
|
SplitInventory splitInventory = splitUnitService.findSplitInventoryByIidAndSid(placeAndMaterialByMidAndPid.getId(), splitInfo.getId()); |
|
|
|
if(splitInventory != null) { |
|
|
|
if (splitInventory != null) { |
|
|
|
saveQuantity += (splitInventory.getSaveQuantity() - splitInventory.getOutQuantity()); |
|
|
|
|
|
|
|
SplitInfo parentSplitInfo = splitUnitService.findSplitInfoById(splitInfo.getParentId()); |
|
|
|
@ -744,7 +743,7 @@ public class MaterialController { |
|
|
|
param.put("mcode", material.getString("code")); |
|
|
|
MaterialP mp = new MaterialP(materialService.findMaterialById(material.getInteger("mid"))); |
|
|
|
// 获取物料与条形码的对应关系
|
|
|
|
param.put("codeFlag",1); |
|
|
|
param.put("codeFlag", 1); |
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param); |
|
|
|
for (int j = 0; j < depositoryByAdminorg.size(); j++) { |
|
|
|
Depository depository = depositoryByAdminorg.get(j); |
|
|
|
@ -777,11 +776,11 @@ public class MaterialController { |
|
|
|
String mcode = materialService.findMaterialCodeByQrCode(qrCode); |
|
|
|
// 根据物料编码获取物料
|
|
|
|
Material material = materialService.findMaterialByCode(mcode); |
|
|
|
if(material != null) { |
|
|
|
if (material != null) { |
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
List<PlaceP> placePList = new ArrayList<>(); |
|
|
|
param.put("mcode", mcode); |
|
|
|
param.put("codeFlag",1); |
|
|
|
param.put("codeFlag", 1); |
|
|
|
InventoryP ip = null; |
|
|
|
// 获取物料与条形码的对应关系
|
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param); |
|
|
|
@ -812,8 +811,7 @@ public class MaterialController { |
|
|
|
mp.setSplitInfoList(splitInfoByMid); |
|
|
|
return new RestResponse(mp); |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
} else { |
|
|
|
return new RestResponse(null); |
|
|
|
} |
|
|
|
|
|
|
|
@ -835,7 +833,7 @@ public class MaterialController { |
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
List<PlaceP> placePList = new ArrayList<>(); |
|
|
|
param.put("mcode", mcode); |
|
|
|
param.put("codeFlag",1); |
|
|
|
param.put("codeFlag", 1); |
|
|
|
InventoryP mp = null; |
|
|
|
// 获取物料与条形码的对应关系
|
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param); |
|
|
|
@ -882,7 +880,7 @@ public class MaterialController { |
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
List<PlaceP> placePList = new ArrayList<>(); |
|
|
|
param.put("mcode", mcode); |
|
|
|
param.put("codeFlag",1); |
|
|
|
param.put("codeFlag", 1); |
|
|
|
InventoryP mp = null; |
|
|
|
// 获取物料与条形码的对应关系
|
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param); |
|
|
|
@ -934,7 +932,7 @@ public class MaterialController { |
|
|
|
param.put("mcode", material.getString("code")); |
|
|
|
InventoryP mp = new InventoryP(materialService.findInventoryById(material.getInteger("mid"))); |
|
|
|
// 获取物料与条形码的对应关系
|
|
|
|
param.put("codeFlag",1); |
|
|
|
param.put("codeFlag", 1); |
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param); |
|
|
|
param.put("mcode", material.getString("code")); |
|
|
|
param.put("depositoryId", map.get("depositoryId")); |
|
|
|
@ -992,7 +990,7 @@ public class MaterialController { |
|
|
|
// 用于标识是否成功获取
|
|
|
|
boolean flag = true; |
|
|
|
param.put("mcode", material.getCode()); |
|
|
|
param.put("codeFlag",1); |
|
|
|
param.put("codeFlag", 1); |
|
|
|
// MaterialP mp = new MaterialP(material);
|
|
|
|
InventoryP mp = new InventoryP(); |
|
|
|
// 获取物料与条形码的对应关系
|
|
|
|
@ -1119,9 +1117,10 @@ public class MaterialController { |
|
|
|
// 如果没有获取到
|
|
|
|
materialByBarCode = materialService.findMaterialByBarCode(qrCode); |
|
|
|
} |
|
|
|
|
|
|
|
if (materialByBarCode != null) { |
|
|
|
List<SplitInfo> splitInfoByMid = splitUnitService.findSplitInfoByMid(materialByBarCode.getMid()); |
|
|
|
materialByBarCode.setSplitInfoList(splitInfoByMid); |
|
|
|
} |
|
|
|
result.put("material", materialByBarCode); |
|
|
|
return new RestResponse(result); |
|
|
|
} |
|
|
|
@ -1285,7 +1284,7 @@ public class MaterialController { |
|
|
|
InventoryP materialP = inventory.get(0); |
|
|
|
Map<String, Object> paramByBarCode = new HashMap<>(); |
|
|
|
paramByBarCode.put("mcode", materialP.getCode()); |
|
|
|
paramByBarCode.put("codeFlag",1); |
|
|
|
paramByBarCode.put("codeFlag", 1); |
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(paramByBarCode); |
|
|
|
materialP.setMaterialAndBarCodeList(materialByBarCodeByCondition); |
|
|
|
isExist = true; |
|
|
|
@ -1332,7 +1331,7 @@ public class MaterialController { |
|
|
|
param.put("mcode", material.getString("code")); |
|
|
|
InventoryP mp = new InventoryP(materialService.findInventoryById(material.getInteger("mid"))); |
|
|
|
// 获取物料与条形码的对应关系
|
|
|
|
param.put("codeFlag",1); |
|
|
|
param.put("codeFlag", 1); |
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param); |
|
|
|
param.put("mcode", material.getString("code")); |
|
|
|
param.put("depositoryId", map.get("depositoryId")); |
|
|
|
@ -1471,7 +1470,7 @@ public class MaterialController { |
|
|
|
Integer mid = ObjectFormatUtil.toInteger(map.get("mid")); |
|
|
|
Material materialById = materialService.findMaterialById(mid); |
|
|
|
map.put("mcode", materialById.getCode()); |
|
|
|
map.put("codeFlag",1); |
|
|
|
map.put("codeFlag", 1); |
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(map); |
|
|
|
Integer codeCountByCondition = materialService.findMaterialByBarCodeCountByCondition(map); |
|
|
|
return new RestResponse(materialByBarCodeByCondition, codeCountByCondition, 200); |
|
|
|
@ -1531,7 +1530,7 @@ public class MaterialController { |
|
|
|
// 如果成功获取
|
|
|
|
Map<String, Object> paramForCode = new HashMap<>(); |
|
|
|
paramForCode.put("mcode", materialP.getCode()); |
|
|
|
paramForCode.put("codeFlag",1); |
|
|
|
paramForCode.put("codeFlag", 1); |
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(paramForCode); |
|
|
|
List<SplitInfo> splitInfoByMid = splitUnitService.findSplitInfoByMid(materialP.getMid()); |
|
|
|
materialP.setSplitInfoList(splitInfoByMid); |
|
|
|
@ -1568,7 +1567,7 @@ public class MaterialController { |
|
|
|
return new RestResponse(null, 1, 200); |
|
|
|
} |
|
|
|
param.put("mcode", code); |
|
|
|
param.put("codeFlag",1); |
|
|
|
param.put("codeFlag", 1); |
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param); |
|
|
|
List<InventoryP> materialPByCondition = new ArrayList<>(); |
|
|
|
InventoryP mp = null; |
|
|
|
@ -1826,27 +1825,28 @@ public class MaterialController { |
|
|
|
|
|
|
|
/** |
|
|
|
* 用于修改对应的码值类型 |
|
|
|
* |
|
|
|
* @param map 参数 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("updateQrCodeType") |
|
|
|
public RestResponse updateQrCodeType(@RequestBody Map<String,Object> map){ |
|
|
|
public RestResponse updateQrCodeType(@RequestBody Map<String, Object> map) { |
|
|
|
// 获取转换类型
|
|
|
|
String type = (String) map.get("type"); |
|
|
|
String mcode = (String) map.get("mcode"); |
|
|
|
int result = 0; |
|
|
|
if(!"noMaterial".equals(mcode)){ |
|
|
|
if (!"noMaterial".equals(mcode)) { |
|
|
|
|
|
|
|
if("qTb".equals(type)){ |
|
|
|
if ("qTb".equals(type)) { |
|
|
|
// 如果是二维码转条形码
|
|
|
|
result = materialService.qrCodeToBarCode(map); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
// 如果是条形码转二维码
|
|
|
|
result = materialService.barCodeToQrCode(map); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return CrudUtil.putHandle(1,result); |
|
|
|
return CrudUtil.putHandle(1, result); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|