|
|
|
@ -112,12 +112,15 @@ public class MaterialServiceImpl implements MaterialService { |
|
|
|
Integer typeId = ObjectFormatUtil.toInteger(map.get("typeId").toString()); |
|
|
|
MaterialType materialTypeById = materialTypeMapper.findMaterialTypeById(typeId); |
|
|
|
map.put("materialTypeId", materialTypeById.getOldId()); |
|
|
|
String code = materialTypeById.getOldId().toString(); |
|
|
|
List<Material> materialByType = materialMapper.findMaterialByType(materialTypeById.getOldId()); |
|
|
|
String newCode = ""; |
|
|
|
if (materialByType == null) { |
|
|
|
materialByType = new ArrayList<>(); |
|
|
|
newCode = String.format("%04d", 1); |
|
|
|
} else { |
|
|
|
newCode = String.format("%04d",Integer.parseInt(materialByType.get(materialByType.size() - 1).getCode()) + 1); |
|
|
|
|
|
|
|
} |
|
|
|
map.put("code", code + String.format("%04d", materialByType.size() + 1)); |
|
|
|
map.put("code",newCode); |
|
|
|
} |
|
|
|
if (map.containsKey("barCode")) { |
|
|
|
materialMapper.addBarCodeAndMcode(map); |
|
|
|
@ -438,7 +441,7 @@ public class MaterialServiceImpl implements MaterialService { |
|
|
|
@Override |
|
|
|
public Material findMaterialById(int id) { |
|
|
|
Material material = materialMapper.findMaterialById(id); |
|
|
|
if(material != null) { |
|
|
|
if (material != null) { |
|
|
|
if (material.getMaterialTypeId() != null) { |
|
|
|
MaterialType materialTypeByOldId = materialTypeMapper.findMaterialTypeByOldId(material.getMaterialTypeId()); |
|
|
|
material.setTypeName(materialTypeByOldId.getTname()); |
|
|
|
@ -1720,8 +1723,8 @@ public class MaterialServiceImpl implements MaterialService { |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 如果不大于
|
|
|
|
insertForSplitInventory.put("saveQuantity",(int)(quantity * 100)); |
|
|
|
insertForSplitInventory.put("inQuantity",(int)(quantity * 100)); |
|
|
|
insertForSplitInventory.put("saveQuantity", (int) (quantity * 100)); |
|
|
|
insertForSplitInventory.put("inQuantity", (int) (quantity * 100)); |
|
|
|
splitUnitMapper.addSplitInventory(insertForSplitInventory); |
|
|
|
} |
|
|
|
} |
|
|
|
|